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

Python超人-宇宙模拟器

上级 4cc3ad22
......@@ -66,8 +66,8 @@ class TwoWayFoilSim:
self.two_way_foil = QuadObj(texture='two_way_foil.png',
# size_scale=4e7,
size_scale=1e7,
init_velocity=[0, -6, 150],
init_position=[0, 0.5 * AU, -10 * AU]) \
init_velocity=[0, -50, 60],
init_position=[0, 5 * AU, -6 * AU]) \
.set_light_disable(True).set_ignore_gravity(True)
# 不断扩展的圆形二向箔
self.two_way_foil_circle = CircleObj(texture="two_way_foil_circle.png",
......@@ -173,7 +173,8 @@ class TwoWayFoilSim:
# 对Y轴进行压平动画,如果压平大小不足 1/50,则继续压缩,直到压缩到 1/50 就不压缩了
# (如果觉得 1/50 的厚度压的不够,还可以继续压缩,基本上就够了)
if planet.scale_y_v > planet.init_scale_y / 50:
# if planet.scale_y_v > planet.init_scale_y / 50:
if planet.scale_y_v > 0.5:
planet.scale_y_v /= 1.01
else:
self.gen_pixcel_image(planet)
......@@ -223,6 +224,10 @@ class TwoWayFoilSim:
def two_way_foil_update():
target = self.get_target()
if target is self.sun:
# 关闭太阳的光晕
self.sun.hide_children()
# 让实体A朝向实体B
# self.two_way_foil.planet.look_at(target)
if target is not None:
......
......@@ -92,6 +92,10 @@ class UrsinaSimulator(Simulator):
def body_visibled():
return body.planet.enabled
def hide_children():
for c in body.planet.children:
c.enabled = False
# Explosion animation
def body_explode(target=None, scale=1, fps=6):
# from panda3d.core import GeomUtils
......@@ -144,6 +148,7 @@ class UrsinaSimulator(Simulator):
body.set_visible = body_visible
body.explode = body_explode
body.visibled = body_visibled
body.hide_children = hide_children
# def get_bodies_max_distance(self, body_views):
# max_distance = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册