Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Python_超人
宇宙模拟器
提交
9809fe3d
宇宙模拟器
项目概览
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看板
提交
9809fe3d
编写于
6月 23, 2023
作者:
三月三net
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Python超人-宇宙模拟器
上级
15270931
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
14 deletion
+26
-14
simulators/ursina/entities/entity_utils.py
simulators/ursina/entities/entity_utils.py
+14
-14
simulators/ursina/ursina_mesh.py
simulators/ursina/ursina_mesh.py
+12
-0
未找到文件。
simulators/ursina/entities/entity_utils.py
浏览文件 @
9809fe3d
...
...
@@ -33,7 +33,7 @@ def create_name_text(parent):
origin
=
(
0
,
0
))
name_text
.
background
.
color
=
color
.
rgba
(
b_color
[
0
],
b_color
[
1
],
b_color
[
2
],
0.3
)
name_text
.
resolution
=
24
#
self.name_text.scale = self
.scale
#
parent.name_text.scale = parent
.scale
if
text_color
is
None
:
text_color
=
get_inverse_color
(
b_color
)
else
:
...
...
@@ -239,7 +239,7 @@ def create_trail_line(parent, pos):
return
trail
def
create_rings
(
self
):
def
create_rings
(
parent
):
"""
创建行星环(使用土星贴图)
@return:
...
...
@@ -248,34 +248,34 @@ def create_rings(self):
rings_texture
=
find_file
(
rings_texture
)
# 行星环偏移角度
#
self
.ring_rotation_x = 80
#
parent
.ring_rotation_x = 80
# 创建行星环
#
self.ring = Entity(parent=self
.planet, model='circle', texture=rings_texture, scale=3.5,
# rotation=(
self
.ring_rotation_x, 0, 0), double_sided=True)
#
parent.ring = Entity(parent=parent
.planet, model='circle', texture=rings_texture, scale=3.5,
# rotation=(
parent
.ring_rotation_x, 0, 0), double_sided=True)
# 行星环偏移角度
self
.
ring_rotation_x
=
80
parent
.
ring_rotation_x
=
80
# 创建行星环
torus
=
create_torus
(
0.7
,
1.2
,
64
)
self
.
ring
=
Entity
(
parent
=
self
,
model
=
torus
,
texture
=
rings_texture
,
scale
=
1
,
rotation
=
(
self
.
ring_rotation_x
,
0
,
0
),
double_sided
=
True
)
parent
.
ring
=
Entity
(
parent
=
parent
,
model
=
torus
,
texture
=
rings_texture
,
scale
=
1
,
rotation
=
(
parent
.
ring_rotation_x
,
0
,
0
),
double_sided
=
True
)
# 设置行星环不受灯光影响,否则看不清行星环
self
.
ring
.
set_light_off
()
parent
.
ring
.
set_light_off
()
def
clear_trails
(
self
):
def
clear_trails
(
parent
):
"""
@param
self
:
@param
parent
:
@return:
"""
if
not
hasattr
(
self
,
"trails"
):
if
not
hasattr
(
parent
,
"trails"
):
return
# 删除拖尾
for
entity
,
pos
in
self
.
trails
.
items
():
for
entity
,
pos
in
parent
.
trails
.
items
():
destroy
(
entity
)
self
.
trails
.
clear
()
parent
.
trails
.
clear
()
def
create_fixed_star_lights
(
fixed_star
):
...
...
simulators/ursina/ursina_mesh.py
浏览文件 @
9809fe3d
...
...
@@ -109,6 +109,18 @@ def create_line(from_pos, to_pos, parent=None, alpha=1.0, len_scale=1, set_light
return
line
def
create_circle
(
parent
=
None
,
pos
=
Vec3
(
0
,
0
,
0
),
thickness
=
1
,
scale
=
1
,
color
=
color
.
white
,
alpha
=
1
):
circle
=
Entity
(
parent
=
parent
,
model
=
"circle"
,
thickness
=
thickness
,
scale
=
scale
,
position
=
pos
,
color
=
color
,
alpha
=
alpha
)
return
circle
def
create_circle_line
(
parent
=
None
,
pos
=
Vec3
(
0
,
0
,
0
),
thickness
=
1
,
scale
=
1
,
color
=
color
.
white
,
alpha
=
1
):
circle
=
Entity
(
parent
=
parent
,
model
=
"circle"
,
thickness
=
thickness
,
scale
=
scale
,
position
=
pos
,
color
=
color
,
alpha
=
alpha
)
return
circle
def
create_arrow_line
(
from_pos
,
to_pos
,
parent
=
None
,
label
=
None
,
set_light_off
=
True
,
alpha
=
1.0
,
len_scale
=
0.5
,
color
=
color
.
white
,
thickness
=
2
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录