Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
36ee01cd
宇宙模拟器
项目概览
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看板
提交
36ee01cd
编写于
11月 20, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
0f55a42a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
24 deletion
+23
-24
sim_lab/wormhole_sim.py
sim_lab/wormhole_sim.py
+23
-24
未找到文件。
sim_lab/wormhole_sim.py
浏览文件 @
36ee01cd
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
# python_version :3.9
# python_version :3.9
# ==============================================================================
# ==============================================================================
from
bodies
import
Sun
,
Earth
from
bodies
import
Sun
,
Earth
from
sim_scenes.universe_sim_scenes
import
UniverseSimScenes
from
simulators.ursina.entities.entity_utils
import
create_ambient_light
from
simulators.ursina.entities.entity_utils
import
create_ambient_light
from
bodies.universe_body
import
create_universe_body
from
bodies.universe_body
import
create_universe_body
from
common.consts
import
SECONDS_PER_DAY
,
SECONDS_PER_WEEK
,
SECONDS_PER_MONTH
,
SECONDS_PER_YEAR
,
AU
from
common.consts
import
SECONDS_PER_DAY
,
SECONDS_PER_WEEK
,
SECONDS_PER_MONTH
,
SECONDS_PER_YEAR
,
AU
...
@@ -31,7 +32,7 @@ class WormholeInfo:
...
@@ -31,7 +32,7 @@ class WormholeInfo:
camera_target_speed
:
int
=
2000
camera_target_speed
:
int
=
2000
camera_target_max_speed
:
int
=
2000
camera_target_max_speed
:
int
=
2000
camera_forward_speed
:
int
=
-
0.1
camera_forward_speed
:
int
=
-
0.1
camera_max_speed
:
int
=
5
000
camera_max_speed
:
int
=
4
000
camera_acc_speed
:
int
=
1.02
camera_acc_speed
:
int
=
1.02
camera_forward_acc_speed
:
int
=
0.01
camera_forward_acc_speed
:
int
=
0.01
size_factor
:
float
=
10
size_factor
:
float
=
10
...
@@ -45,16 +46,7 @@ class WormholeInfo:
...
@@ -45,16 +46,7 @@ class WormholeInfo:
around_acc_speed
:
int
=
-
2
around_acc_speed
:
int
=
-
2
# class WormholeInfoParams:
class
WormholeSim
(
UniverseSimScenes
):
# def __init__(self):
# self.params = []
#
# def add(self, param_name):
#
# return self
class
WormholeSim
:
SIZE_SCALE
=
1
SIZE_SCALE
=
1
D
=
AU
/
10
*
SIZE_SCALE
D
=
AU
/
10
*
SIZE_SCALE
...
@@ -107,19 +99,20 @@ class WormholeSim:
...
@@ -107,19 +99,20 @@ class WormholeSim:
# around_acc_speed: int = -2
# around_acc_speed: int = -2
wormhole_infos
=
[
wormhole_infos
=
[
{
"position"
:
[
D
,
0
,
-
D
],
"rotation_y"
:
-
150
},
{
"name"
:
"我们宇宙"
,
"position"
:
[
D
,
0
,
-
D
],
"rotation_y"
:
-
150
,
"around_direction"
:
"down"
,
{
"position"
:
[
D
,
0
,
D
],
"rotation_z"
:
30
,
"around_acc_speed"
:
-
20
,
"around_min_speed"
:
150
,
"camera_forward_speed"
:
0
,
"around_max_count"
:
400
},
"camera_forward_speed"
:
-
0.3
,
"around_max_count"
:
500
},
{
"name"
:
"红色宇宙"
,
"position"
:
[
D
,
0
,
D
],
"rotation_z"
:
30
,
"around_acc_speed"
:
-
20
,
{
"position"
:
[
-
D
,
-
D
,
D
]},
"around_min_speed"
:
150
,
"camera_forward_speed"
:
-
0.2
,
"around_max_count"
:
600
},
{
"position"
:
[
-
D
,
0
,
-
D
]},
{
"name"
:
"黄色宇宙"
,
"position"
:
[
-
D
,
-
D
,
D
],
"around_direction"
:
"left"
},
{
"position"
:
[
D
,
D
,
D
]},
{
"name"
:
"梦海宇宙"
,
"position"
:
[
-
D
,
0
,
-
D
]},
{
"position"
:
[
D
,
-
D
,
D
]},
{
"name"
:
"金色宇宙"
,
"position"
:
[
-
D
,
D
,
D
],
"around_max_count"
:
400
},
{
"position"
:
[
-
D
,
-
D
,
-
D
]},
# {"position": [D, -D, D]},
{
"position"
:
[
-
D
,
0
,
D
]},
# {"position": [- D, -D, -D]},
{
"position"
:
[
D
,
D
,
-
D
]},
# {"position": [- D, 0, D]},
{
"position"
:
[
-
D
,
D
,
-
D
]},
# {"position": [D, D, -D]},
{
"position"
:
[
-
D
,
D
,
D
]},
# {"position": [- D, D, -D]},
{
"position"
:
[
D
,
-
D
,
-
D
]}
# {"position": [- D, D, D]},
# {"position": [D, -D, -D]}
]
]
def
build_wormhole_info_param
(
wormhole_info
):
def
build_wormhole_info_param
(
wormhole_info
):
...
@@ -445,6 +438,9 @@ class WormholeSim:
...
@@ -445,6 +438,9 @@ class WormholeSim:
UrsinaEvent
.
on_ready_subscription
(
wormhole_sim
.
on_ready
)
UrsinaEvent
.
on_ready_subscription
(
wormhole_sim
.
on_ready
)
def
run
(
self
):
def
run
(
self
):
self
.
set_window_size
((
1920
,
1079
),
False
)
self
.
build_events
()
self
.
build_events
()
# 使用 ursina 查看的运行效果
# 使用 ursina 查看的运行效果
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
# 常用快捷键: P:运行和暂停 O:重新开始 I:显示天体轨迹
...
@@ -457,8 +453,11 @@ class WormholeSim:
...
@@ -457,8 +453,11 @@ class WormholeSim:
position
=
[
0
,
self
.
D
,
-
self
.
D
*
2
],
position
=
[
0
,
self
.
D
,
-
self
.
D
*
2
],
cosmic_bg
=
''
,
cosmic_bg
=
''
,
gravity_works
=
False
,
gravity_works
=
False
,
bg_music
=
'sounds/no_glory.mp3'
,
timer_enabled
=
True
,
timer_enabled
=
True
,
show_grid
=
False
,
show_grid
=
False
,
show_camera_info
=
False
,
show_control_info
=
False
,
show_trail
=
False
)
show_trail
=
False
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录