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

太阳系三体模拟器

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