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

Python超人-宇宙模拟器

上级 16d07895
......@@ -8,6 +8,19 @@
#  天体质量:
#  平均密度:
```
```text
上标文本
参考:https://cn.piliapp.com/symbol/subscript-superscript/
⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ ⁹ ⁺ ⁻ ⁼ ⁽ ⁾ ⁿ
₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ ₊ ₋ ₌ ₍ ₎
ₐ ₑ ₒ ₓ ₔ ° ⁱ
⁄ ² ³
ᴬ ᴮ ᴰ ᴱ ᴳ ᴴ ᴵ ᴶ ᴷ ᴸ ᴹ ᴺ ᴼ ᴾ ᴿ ᵀ ᵁ ⱽ ᵂ
ᵃ ᵇ ᶜ ᵈ ᵉ ᶠ ᵍ ʰ ⁱ ʲ ᵏ ˡ ᵐ ⁿ ᵒ ᵖ ʳ ˢ ᵗ ᵘ ᵛ ʷ ˣ ʸ ᶻ
ₐ ₑ ₕ ᵢ ⱼ ₖ ₗ ₘ ₙ ₒ ₚ ᵣ ₛ ₜ ᵤ ᵥ ₓ
ᵋ ᵝ ᵞ ᵟ ᵠ ᵡ ᵦ ᵧ ᵨ ᵩ ᵪ ᶥ ᶿ
```
参考:
https://solarsystem.nasa.gov/solar-system/our-solar-system/overview/
https://trek.nasa.gov/mars/
......
......@@ -317,9 +317,9 @@ class TheLostPlanetSim(UniverseSimScenes):
# (self.asteroid_fade_out, 900, 1),
# 第4波行星
(self.camera_back_2, 900, -1),
(self.neptune_orbit_the_sun, 900, 1),
(self.neptune_orbit_the_sun, 9000, 1),
(lambda: None, -1, -1)
(lambda: exit(0), -1, -1)
]
self._steps = []
......@@ -405,9 +405,9 @@ if __name__ == '__main__':
ursina_run(sim.bodies,
SECONDS_PER_YEAR,
gravity_works=False,
show_exit_button=False,
show_control_info=False,
show_camera_info=False,
# show_exit_button=False,
# show_control_info=False,
# show_camera_info=False,
# position=(0, 2 * AU, -11 * AU),
# position=(0, 20 * AU, 10 * AU),
# position=(4.5 * AU, AU, 5 * AU),
......@@ -416,4 +416,4 @@ if __name__ == '__main__':
# show_timer=True,
cosmic_bg='',
# show_trail=True,
show_grid=False)
show_grid=True)
......@@ -15,6 +15,8 @@ from common.consts import LIGHT_SPEED
import math
import numpy as np
from sim_scenes.universe_sim_scenes import UniverseSimScenes
def calc_run(bodies, dt=SECONDS_PER_WEEK, on_init=None, **kwargs):
from simulators.calc_simulator import CalcSimulator
......@@ -193,6 +195,12 @@ def ursina_run(bodies,
from simulators.ursina.entities.ursina_player import UrsinaPlayer
body_sys = System(bodies)
if UniverseSimScenes.screen_record:
show_exit_button = False
show_control_info = False
show_camera_info = False
show_grid = False
if show_name:
for body in body_sys.bodies:
body.show_name = True
......
......@@ -8,6 +8,7 @@
# ==============================================================================
from objs import CoreValagaClas
import sys
from ursina import application
class UniverseSimScenes:
......@@ -15,18 +16,20 @@ class UniverseSimScenes:
可以作为宇宙模拟场景的基类,但是不是必须的。
"""
screen_record = False
record_rate = 1
def __new__(cls, *args, **kwargs):
print("参数个数", len(sys.argv))
if len(sys.argv) > 1:
UniverseSimScenes.set_window_size((1920, 1079), False)
cls.record_rate = 2
else:
cls.record_rate = 1
UniverseSimScenes.screen_record = True
application.time_scale = 0.00001
instance = super().__new__(cls, *args, **kwargs)
return instance
@staticmethod
def create_camera_target(init_position=[0, 0, 0], size_scale=1e3):
camera_target = CoreValagaClas(name="摄像机镜头", mass=1e30, color=(111, 140, 255),
......
......@@ -322,7 +322,7 @@ class UrsinaSimulator(Simulator):
window.fps_counter.enabled = False
window.exit_button.enabled = show_exit_button
# window.editor_ui.enabled = True
# window.fullscreen_button.enabled = False
# # 场景加入雾的效果
# scene.fog_color = color.orange
# scene.fog_density = 800 * UrsinaConfig.SCALE_FACTOR
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册