提交 b135a34d 编写于 作者: 三月三net's avatar 三月三net

太阳系三体模拟器

上级 13ced94f
...@@ -81,7 +81,6 @@ class UrsinaUI: ...@@ -81,7 +81,6 @@ class UrsinaUI:
wp = WindowPanel( wp = WindowPanel(
title='', title='',
content=( content=(
Text('方位控制: Q W E A S D + 鼠标右键', font='msyhl.ttc'),
# InputField(name='name_field'), # InputField(name='name_field'),
# Button(text='Submit', color=color.azure), # Button(text='Submit', color=color.azure),
self.point_button, self.point_button,
...@@ -116,8 +115,9 @@ class UrsinaUI: ...@@ -116,8 +115,9 @@ class UrsinaUI:
# self.text_time_scale_info = None # self.text_time_scale_info = None
self.settings_handler.input = self.settings_handler_input self.settings_handler.input = self.settings_handler_input
# self.show_text_time_scale_info() # self.show_text_time_scale_info()
key_info_str = "按[空格]设置" # Text('方位控制: Q W E A S D + 鼠标右键', font='msyhl.ttc'),
key_info = Text(text=key_info_str, font=UrsinaConfig.CN_FONT, position=(-0.5, 0.5), origin=(-1, 1), key_info_str = "方位控制[键盘QWEASD]+[鼠标右键],按[空格]更多控制"
key_info = Text(text=key_info_str, font=UrsinaConfig.CN_FONT, position=(-1, 0.5), origin=(-1, 1),
background=True) background=True)
# # self.show_button() # # self.show_button()
# slider_text = Text(text='自转速度', scale=1, position=(-0.6, 0.3)) # slider_text = Text(text='自转速度', scale=1, position=(-0.6, 0.3))
......
...@@ -84,6 +84,7 @@ class UrsinaSimulator(Simulator): ...@@ -84,6 +84,7 @@ class UrsinaSimulator(Simulator):
else: else:
evolve_dt = UrsinaConfig.seconds_per * run_speed_factor evolve_dt = UrsinaConfig.seconds_per * run_speed_factor
evolve_dt = evolve_dt * self.interval_fator
super().evolve(evolve_dt) super().evolve(evolve_dt)
def cosmic_background(self, texture='../textures/cosmic2.jpg'): def cosmic_background(self, texture='../textures/cosmic2.jpg'):
...@@ -182,9 +183,9 @@ class UrsinaSimulator(Simulator): ...@@ -182,9 +183,9 @@ class UrsinaSimulator(Simulator):
# camera.rotation_x = -30 # camera.rotation_x = -30
# 设定时间间隔为0.01秒 # 设定时间间隔为0.01秒
interval = 0.01 self.interval_fator = 0.01
self.evolve_dt = dt * interval self.evolve_dt = dt
self.interval = datetime.timedelta(seconds=interval) self.interval = datetime.timedelta(seconds=self.interval_fator)
self.last_time = datetime.datetime.now() - datetime.timedelta(seconds=2) self.last_time = datetime.datetime.now() - datetime.timedelta(seconds=2)
if "light" in kwargs: if "light" in kwargs:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册