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

太阳系三体模拟器

上级 12c827d4
......@@ -150,8 +150,14 @@ class UrsinaSimulator(Simulator):
self.last_time = datetime.datetime.now() - datetime.timedelta(seconds=2)
if "light" in kwargs:
if kwargs["light"]:
li = PointLight()
# PointLight, SpotLight, AmbientLight
for v in self.ursina_views:
if v.body.is_fixed_star:
PointLight(parent=v)
# PointLight(parent=camera, color=color.white, position=(0, 0, 0))
# AmbientLight(color=color.rgba(100, 100, 100, 0.1))
# DirectionalLight
# SpotLight
if "cosmic_bg" in kwargs:
cosmic_bg = kwargs["cosmic_bg"]
if cosmic_bg is None:
......
......@@ -207,7 +207,7 @@ class Planet(Entity):
# texture = eval(f"{_type}_texture")
# e = os.path.exists(texture)
# texture = self.__set_texture(body_view.texture)
if hasattr(body_view,"texture"):
if hasattr(body_view, "texture"):
texture = load_texture(body_view.texture)
else:
texture = None
......@@ -288,6 +288,10 @@ class UrsinaView(BodyView):
ring.position = self.planet.position
def update(self):
# self.planet.clear_light()
if self.body.is_fixed_star:
# 如果是恒星(如:太阳),自身会发光,则需要关闭灯光
self.planet.set_light_off()
self.planet.turn()
def appear(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册