Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
91a8e795
宇宙模拟器
项目概览
Python_超人
/
宇宙模拟器
通知
19
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
宇宙模拟器
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
91a8e795
编写于
12月 08, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
4079b23c
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
12 addition
and
7 deletion
+12
-7
sim_scenes/featured/the_lost_planet.py
sim_scenes/featured/the_lost_planet.py
+12
-7
未找到文件。
sim_
lab
/the_lost_planet.py
→
sim_
scenes/featured
/the_lost_planet.py
浏览文件 @
91a8e795
...
...
@@ -40,7 +40,7 @@ class TheLostPlanetSim(UniverseSimScenes):
self
.
ship
=
ScifiGunship
(
name
=
"飞船"
,
mass
=
1e30
,
color
=
(
111
,
140
,
255
),
init_position
=
self
.
mars
.
init_position
,
init_velocity
=
[
0
,
0
,
0
],
size_scale
=
2e4
,
distance_scale
=
2.9
).
\
size_scale
=
2e4
,
distance_scale
=
2.9
).
\
set_ignore_gravity
(
True
).
set_light_disable
(
True
)
self
.
bodies
=
[
...
...
@@ -107,7 +107,7 @@ class TheLostPlanetSim(UniverseSimScenes):
事件绑定后,模拟器运行前会触发
@return:
"""
from
ursina
import
camera
,
Vec3
from
ursina
import
camera
,
Vec3
,
application
# 创建天空
create_sphere_sky
(
scale
=
20000
,
rotation_x
=
0
,
rotation_y
=
80
)
...
...
@@ -133,6 +133,7 @@ class TheLostPlanetSim(UniverseSimScenes):
# self.asteroids.planet.enabled = False
self
.
moon
.
planet
.
enabled
=
False
application
.
time_scale
=
0.1
# ceres.planet.enabled = False
# self.moon.planet.look_at(self.mars.planet)
...
...
@@ -351,6 +352,8 @@ class TheLostPlanetSim(UniverseSimScenes):
self
.
create_asteroid
(
smooth
=
True
)
self
.
asteroid_num
+=
1
camera
.
position
+=
camera
.
forward
*
0.1
def
moon_move_to_target_and_rotation
(
self
,
target
,
rotation_radius
,
end_angle
,
end_tag
,
forward
,
angle_val
):
...
...
@@ -408,6 +411,7 @@ class TheLostPlanetSim(UniverseSimScenes):
end_tag
=
"moon_around_earth"
,
forward
=
0.02
,
angle_val
=
1
)
self
.
steps
=
[
(
self
.
asteroid_fade_in
,
3
,
1
),
(
self
.
asteroid_fade_out
,
3
,
1
),
...
...
@@ -415,7 +419,8 @@ class TheLostPlanetSim(UniverseSimScenes):
# (self.ship_go_to_moon, -1, 1),
(
self
.
moon_renovation
,
10
,
-
1
),
(
step_05
,
-
1
,
-
1
),
(
step_06
,
-
1
,
-
1
),
(
step_06
,
50
,
-
1
),
(
lambda
:
exit
(
0
),
-
1
,
-
1
)
]
def
on_timer_changed
(
self
,
time_data
):
...
...
@@ -474,7 +479,7 @@ class TheLostPlanetSim(UniverseSimScenes):
if
__name__
==
'__main__'
:
sim
=
TheLostPlanetSim
()
#
UniverseSimScenes.set_window_size((1920, 1079), False)
UniverseSimScenes
.
set_window_size
((
1920
,
1079
),
False
)
# 运行前会触发 on_ready
UrsinaEvent
.
on_ready_subscription
(
sim
.
on_ready
)
# UrsinaEvent.after_ready_subscription(after_ready)
...
...
@@ -492,7 +497,7 @@ if __name__ == '__main__':
# position=(0, 20 * AU, 10 * AU),
position
=
(
5.5
*
AU
,
AU
,
5
*
AU
),
timer_enabled
=
True
,
show_timer
=
True
,
#
show_timer=True,
cosmic_bg
=
''
,
# show_trail=True,
show_grid
=
False
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录