Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
bdcecd51
宇宙模拟器
项目概览
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看板
提交
bdcecd51
编写于
12月 04, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
64cffa20
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
15 addition
and
8 deletion
+15
-8
sim_scenes/featured/wormhole_sim_v2.py
sim_scenes/featured/wormhole_sim_v2.py
+15
-8
未找到文件。
sim_scenes/featured/wormhole_sim_v2.py
浏览文件 @
bdcecd51
...
@@ -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
=
1
00
# 1
10
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
*
1
00
obj
.
planet
.
init_scale
=
self
.
SIZE_SCALE
*
5
00
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,6 +428,9 @@ class WormholeSim(UniverseSimScenes):
...
@@ -425,6 +428,9 @@ 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)
if
around_direction
==
""
or
around_direction
is
None
:
planet_direction
=
None
else
:
planet_direction
=
getattr
(
self
.
camera_target
.
planet
,
around_direction
)
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"
):
...
@@ -448,6 +454,7 @@ class WormholeSim(UniverseSimScenes):
...
@@ -448,6 +454,7 @@ 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
if
planet_direction
is
not
None
:
self
.
camera_target
.
planet
.
position
+=
planet_direction
*
self
.
camera_target
.
around_speed
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录