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

太阳系三体模拟器

上级 560fc950
......@@ -161,10 +161,14 @@ class UrsinaUI:
def callback_action(b=body):
self.bodies_button_list_click(b)
distance_to_entity = distance(body.planet, camera)
d = distance_to_entity / UrsinaConfig.SCALE_FACTOR / AU
name = f"{body.name}\t距离:{d:.4f}天文单位"
button_dict[name] = callback_action
if body.appeared:
distance_to_entity = distance(body.planet, camera)
d = distance_to_entity / UrsinaConfig.SCALE_FACTOR / AU
name = f"{body.name}\t距离:{d:.4f}天文单位"
button_dict[name] = callback_action
else:
name = f"{body.name}\t距离太远,找不到了"
button_dict[name] = lambda: self.bodies_button_list_click(None)
if hasattr(self, "bodies_button_list"):
destroy(self.bodies_button_list)
......
......@@ -62,8 +62,8 @@ class UrsinaSimulator(Simulator):
def on_searching_bodies(self, **kwargs):
views = []
for view in self.body_views:
if view.appeared:
views.append(view)
# if view.appeared:
views.append(view)
return views
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册