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

Python超人-宇宙模拟器

上级 8e7a7199
......@@ -36,21 +36,24 @@ def create_halley_comet(init_velocity, init_position):
# 每76.1年环绕太阳一周的周期彗星
halley_comet = HalleComet(
# size_scale=4e7,
size_scale=0.2e8,
size_scale=0.15e8,
init_velocity=init_velocity,
init_position=init_position) \
.set_light_disable(True)
return halley_comet
def create_orbit_line(center_body, body, start_time):
def create_orbit_line(center_body, body, start_time, alpha=0.2):
if not hasattr(body, "orbital_days"):
return None
orbital_days = int(math.ceil(body.orbital_days))
points = get_reality_orbit_points(type(body).__name__.lower(), start_time=start_time, days=orbital_days,
points = get_reality_orbit_points(type(body).__name__.lower(),
start_time=start_time,
days=orbital_days,
segments=100)
# print(points)
orbit_line = create_orbit_by_points(center_body.position, points, line_color=body.trail_color, alpha=0.3)
orbit_line = create_orbit_by_points(center_body.position, points, line_color=body.trail_color,
alpha=alpha)
return orbit_line
......
......@@ -66,7 +66,7 @@ class HalleyCometSim(HalleyCometSimBase):
# UrsinaConfig.trail_length = 300
UrsinaConfig.trail_type = "line"
# UrsinaConfig.trail_length = 152 # 尾巴数量刚刚好
UrsinaConfig.trail_length = 135
UrsinaConfig.trail_length = 130
UrsinaConfig.trail_thickness_factor = 3
# UrsinaConfig.trail_length = 180
......@@ -370,6 +370,8 @@ class HalleyCometSim(HalleyCometSimBase):
@param dt:
@return:
"""
if dt.year > 2058:
UrsinaConfig.trail_length = 155
# 更新天体的位置
self.set_bodies_position(time_data)
# 更新时钟
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册