Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
f87304ac
宇宙模拟器
项目概览
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看板
提交
f87304ac
编写于
10月 27, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
4cc3ad22
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
3 deletion
+13
-3
sim_scenes/tri_bodies/two_way_foil.py
sim_scenes/tri_bodies/two_way_foil.py
+8
-3
simulators/ursina_simulator.py
simulators/ursina_simulator.py
+5
-0
未找到文件。
sim_scenes/tri_bodies/two_way_foil.py
浏览文件 @
f87304ac
...
@@ -66,8 +66,8 @@ class TwoWayFoilSim:
...
@@ -66,8 +66,8 @@ class TwoWayFoilSim:
self
.
two_way_foil
=
QuadObj
(
texture
=
'two_way_foil.png'
,
self
.
two_way_foil
=
QuadObj
(
texture
=
'two_way_foil.png'
,
# size_scale=4e7,
# size_scale=4e7,
size_scale
=
1e7
,
size_scale
=
1e7
,
init_velocity
=
[
0
,
-
6
,
15
0
],
init_velocity
=
[
0
,
-
50
,
6
0
],
init_position
=
[
0
,
0.5
*
AU
,
-
10
*
AU
])
\
init_position
=
[
0
,
5
*
AU
,
-
6
*
AU
])
\
.
set_light_disable
(
True
).
set_ignore_gravity
(
True
)
.
set_light_disable
(
True
).
set_ignore_gravity
(
True
)
# 不断扩展的圆形二向箔
# 不断扩展的圆形二向箔
self
.
two_way_foil_circle
=
CircleObj
(
texture
=
"two_way_foil_circle.png"
,
self
.
two_way_foil_circle
=
CircleObj
(
texture
=
"two_way_foil_circle.png"
,
...
@@ -173,7 +173,8 @@ class TwoWayFoilSim:
...
@@ -173,7 +173,8 @@ class TwoWayFoilSim:
# 对Y轴进行压平动画,如果压平大小不足 1/50,则继续压缩,直到压缩到 1/50 就不压缩了
# 对Y轴进行压平动画,如果压平大小不足 1/50,则继续压缩,直到压缩到 1/50 就不压缩了
# (如果觉得 1/50 的厚度压的不够,还可以继续压缩,基本上就够了)
# (如果觉得 1/50 的厚度压的不够,还可以继续压缩,基本上就够了)
if
planet
.
scale_y_v
>
planet
.
init_scale_y
/
50
:
# if planet.scale_y_v > planet.init_scale_y / 50:
if
planet
.
scale_y_v
>
0.5
:
planet
.
scale_y_v
/=
1.01
planet
.
scale_y_v
/=
1.01
else
:
else
:
self
.
gen_pixcel_image
(
planet
)
self
.
gen_pixcel_image
(
planet
)
...
@@ -223,6 +224,10 @@ class TwoWayFoilSim:
...
@@ -223,6 +224,10 @@ class TwoWayFoilSim:
def
two_way_foil_update
():
def
two_way_foil_update
():
target
=
self
.
get_target
()
target
=
self
.
get_target
()
if
target
is
self
.
sun
:
# 关闭太阳的光晕
self
.
sun
.
hide_children
()
# 让实体A朝向实体B
# 让实体A朝向实体B
# self.two_way_foil.planet.look_at(target)
# self.two_way_foil.planet.look_at(target)
if
target
is
not
None
:
if
target
is
not
None
:
...
...
simulators/ursina_simulator.py
浏览文件 @
f87304ac
...
@@ -92,6 +92,10 @@ class UrsinaSimulator(Simulator):
...
@@ -92,6 +92,10 @@ class UrsinaSimulator(Simulator):
def
body_visibled
():
def
body_visibled
():
return
body
.
planet
.
enabled
return
body
.
planet
.
enabled
def
hide_children
():
for
c
in
body
.
planet
.
children
:
c
.
enabled
=
False
# Explosion animation
# Explosion animation
def
body_explode
(
target
=
None
,
scale
=
1
,
fps
=
6
):
def
body_explode
(
target
=
None
,
scale
=
1
,
fps
=
6
):
# from panda3d.core import GeomUtils
# from panda3d.core import GeomUtils
...
@@ -144,6 +148,7 @@ class UrsinaSimulator(Simulator):
...
@@ -144,6 +148,7 @@ class UrsinaSimulator(Simulator):
body
.
set_visible
=
body_visible
body
.
set_visible
=
body_visible
body
.
explode
=
body_explode
body
.
explode
=
body_explode
body
.
visibled
=
body_visibled
body
.
visibled
=
body_visibled
body
.
hide_children
=
hide_children
# def get_bodies_max_distance(self, body_views):
# def get_bodies_max_distance(self, body_views):
# max_distance = 0
# max_distance = 0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录