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

太阳系三体模拟器

上级 8e147141
...@@ -28,6 +28,7 @@ class UrsinaPlayer(FirstPersonController): ...@@ -28,6 +28,7 @@ class UrsinaPlayer(FirstPersonController):
""" """
""" """
# body_rotation_speed_control = 1.0 # body_rotation_speed_control = 1.0
def __init__(self, position, view_azimuth=0, targets=None): def __init__(self, position, view_azimuth=0, targets=None):
...@@ -260,15 +261,18 @@ class Planet(Entity): ...@@ -260,15 +261,18 @@ class Planet(Entity):
self.clear_trails() self.clear_trails()
def follow_parent(self): def follow_parent(self):
if not hasattr(self.body_view, "bodies_system"): if not hasattr(self, "f_parent"):
return if not hasattr(self.body_view, "bodies_system"):
sys = self.body_view.bodies_system return
for b in sys.bodies: sys = self.body_view.bodies_system
if self.body_view.body.parent == b: for b in sys.bodies:
pos = b.position * UrsinaConfig.SCALE_FACTOR if self.body_view.body.parent == b:
self.x = -pos[1] self.f_parent = b
self.y = pos[2] break
self.z = pos[0] pos = self.f_parent.position * UrsinaConfig.SCALE_FACTOR
self.x = -pos[1]
self.y = pos[2]
self.z = pos[0]
def create_rings(self): def create_rings(self):
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册