Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
c9b1160a
宇宙模拟器
项目概览
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看板
提交
c9b1160a
编写于
12月 04, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
c1bf0019
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
2 deletion
+35
-2
sim_scenes/solar_system/solar_system_reality_2.py
sim_scenes/solar_system/solar_system_reality_2.py
+35
-2
未找到文件。
sim_scenes/solar_system/solar_system_reality_2.py
浏览文件 @
c9b1160a
...
...
@@ -138,7 +138,7 @@ class SolarSystemRealitySim(UniverseSimScenes):
@return:
"""
# 运行前触发
self
.
set_window_size
((
19
20
,
1079
),
False
)
self
.
set_window_size
((
19
19
,
1080
),
False
)
self
.
sky
=
create_sphere_sky
(
scale
=
80000
)
...
...
@@ -280,7 +280,8 @@ class SolarSystemRealitySim(UniverseSimScenes):
lambda
:
self
.
recover_body_scale
([
self
.
jupiter
,
self
.
saturn
]),
lambda
:
self
.
recover_body_scale
([
self
.
uranus
,
self
.
neptune
]),
lambda
:
self
.
recover_sky
(),
lambda
:
self
.
recover_run
()
# lambda: self.recover_run(),
self
.
set_bodies_as_real_scale_animation
]
def
enabled_orbit_line
(
self
,
orbit_line
):
...
...
@@ -368,6 +369,26 @@ class SolarSystemRealitySim(UniverseSimScenes):
ext_fun_for_method
(
body
.
planet
,
after_run_fun
=
update_scale
)
def
set_body_as_real_scale_animation
(
self
,
body
):
UrsinaConfig
.
run_speed_factor
=
0.01
body
.
planet
.
origin_update
=
body
.
planet
.
update
size_scale
,
scale_x
=
self
.
body_scale_dict
[
body
]
scale_inc
=
(
scale_x
-
scale_x
/
size_scale
)
/
200.0
# scale_inc = (scale_x / size_scale) / 10.0
def
update_scale
():
planet_scale_x
=
body
.
planet
.
scale_x
planet_scale_x
-=
scale_inc
if
planet_scale_x
<=
scale_x
/
size_scale
:
planet_scale_x
=
scale_x
/
size_scale
body
.
planet
.
update
=
lambda
:
None
# body.planet.origin_update
body
.
planet
.
scale
=
planet_scale_x
# scale_x / size_scale
body
.
planet
.
update
=
update_scale
# ext_fun_for_method(body.planet, after_run_fun=update_scale)
def
set_bodies_as_real_scale
(
self
):
self
.
save_body_scale
()
for
body
in
self
.
bodies
:
...
...
@@ -380,6 +401,18 @@ class SolarSystemRealitySim(UniverseSimScenes):
self
.
sky
.
alpha
=
0
def
set_bodies_as_real_scale_animation
(
self
):
# self.save_body_scale()
for
body
in
self
.
bodies
:
self
.
set_body_as_real_scale_animation
(
body
)
# for orbit_line in self.orbit_lines:
# orbit_line.origin_alpha = orbit_line.alpha
# # orbit_line.alpha = 0
# orbit_line.enabled = False
self
.
sky
.
alpha
=
0
def
save_body_scale
(
self
):
self
.
body_scale_dict
=
{}
for
body
in
self
.
bodies
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录