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

Python超人-宇宙模拟器

上级 64cffa20
...@@ -75,9 +75,12 @@ class WormholeSim(UniverseSimScenes): ...@@ -75,9 +75,12 @@ class WormholeSim(UniverseSimScenes):
# around_acc_speed: int = -1.5 # around_acc_speed: int = -1.5
wormhole_infos = [ wormhole_infos = [
{"name": "我们宇宙", "position": [D, 0, -D], "rotation_y": 100, "around_direction": "left", {"name": "我们宇宙", "position": [D, 0, -D], "rotation_y": 100,
"camera_forward_speed": 0, "around_max_count": 200, "camera_target_max_speed": 1000, # "around_direction": "left",
"around_max_speed": -300, "around_min_speed": 150, "around_direction": "",
"camera_forward_speed": 0, "around_max_count": 800, "camera_target_max_speed": 1000,
# "around_max_speed": -300, "around_min_speed": 150,
"around_max_speed": -2, "around_min_speed": 1,
"camera_max_speed": 2200, "camera_max_speed": 2200,
"camera_target_init_speed": 5}, "camera_target_init_speed": 5},
{"name": "宇宙1", "position": [D, 0, D], "rotation_z": 0, "around_acc_speed": -2, "around_direction": "left", {"name": "宇宙1", "position": [D, 0, D], "rotation_z": 0, "around_acc_speed": -2, "around_direction": "left",
...@@ -230,7 +233,7 @@ class WormholeSim(UniverseSimScenes): ...@@ -230,7 +233,7 @@ class WormholeSim(UniverseSimScenes):
# camera.scale = 1000 # camera.scale = 1000
# camera.parent = camera_target.planet # camera.parent = camera_target.planet
# camera.rotation_x = 90 # camera.rotation_x = 90
camera.fov = 110 camera.fov = 100 # 110
for universe in self.universes: for universe in self.universes:
universe.planet.collider = "sphere" universe.planet.collider = "sphere"
...@@ -320,7 +323,7 @@ class WormholeSim(UniverseSimScenes): ...@@ -320,7 +323,7 @@ class WormholeSim(UniverseSimScenes):
self.camera_target.speed = self.get_wormhole_data("camera_target_init_speed") self.camera_target.speed = self.get_wormhole_data("camera_target_init_speed")
camera.speed = self.get_wormhole_data("camera_init_speed") camera.speed = self.get_wormhole_data("camera_init_speed")
if self.exit_app and self.current_idx == 2: if self.exit_app and self.current_idx == 1:
print("结束") print("结束")
exit(0) exit(0)
...@@ -405,7 +408,7 @@ class WormholeSim(UniverseSimScenes): ...@@ -405,7 +408,7 @@ class WormholeSim(UniverseSimScenes):
def scale_up(self, obj): def scale_up(self, obj):
if obj is None: if obj is None:
return return
obj.planet.init_scale = self.SIZE_SCALE * 100 obj.planet.init_scale = self.SIZE_SCALE * 500
def scale_down(self, obj, scale_size=None): def scale_down(self, obj, scale_size=None):
if obj is None: if obj is None:
...@@ -425,7 +428,10 @@ class WormholeSim(UniverseSimScenes): ...@@ -425,7 +428,10 @@ class WormholeSim(UniverseSimScenes):
self.camera_target.planet.look_at(around_target) self.camera_target.planet.look_at(around_target)
# print(self.camera_target.planet.rotation_x,self.camera_target.planet.rotation_y,self.camera_target.planet.rotation_z) # print(self.camera_target.planet.rotation_x,self.camera_target.planet.rotation_y,self.camera_target.planet.rotation_z)
planet_direction = getattr(self.camera_target.planet, around_direction) if around_direction == "" or around_direction is None:
planet_direction = None
else:
planet_direction = getattr(self.camera_target.planet, around_direction)
if not hasattr(self.camera_target, "around_speed"): if not hasattr(self.camera_target, "around_speed"):
self.camera_target.around_speed = 0 self.camera_target.around_speed = 0
...@@ -448,7 +454,8 @@ class WormholeSim(UniverseSimScenes): ...@@ -448,7 +454,8 @@ class WormholeSim(UniverseSimScenes):
if abs(self.camera_target.around_speed) > abs(around_max_speed): if abs(self.camera_target.around_speed) > abs(around_max_speed):
self.camera_target.around_speed = around_max_speed self.camera_target.around_speed = around_max_speed
self.camera_target.planet.position += planet_direction * self.camera_target.around_speed if planet_direction is not None:
self.camera_target.planet.position += planet_direction * self.camera_target.around_speed
print("around_speed", self.camera_target.around_speed) print("around_speed", self.camera_target.around_speed)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册