Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
BoxMesh¶
继承: PrimitiveMesh < Mesh < Resource < RefCounted < Object
生成轴对齐盒 PrimitiveMesh。
描述¶
生成轴对齐盒 PrimitiveMesh。
这个盒子的 UV 布局是以 3×2 的方式排列的,允许单独对每个面进行贴图。要在所有的面上应用相同的纹理,请将材质的 UV 属性改为 Vector3(3, 2, 1)
。这样做等价于在顶点着色器中添加 UV *= vec2(3.0, 2.0)
。
注意:当使用很大且有纹理的 BoxMesh 时(例如作为地板),你可能会发现 UV 偶尔抖动的问题,这取决于相机的角度。要解决此问题,请增加 subdivide_depth、subdivide_height 和 subdivide_width,直到你不再注意到 UV 抖动。
属性¶
|
||
|
||
|
||
|
属性说明¶
Vector3 size = Vector3(1, 1, 1)
该盒子的宽度、高度和深度。
int subdivide_depth = 0
沿 Z 轴插入的额外边缘环的数量。
int subdivide_height = 0
沿 Y 轴插入的额外边缘环的数量。
int subdivide_width = 0
沿 X 轴插入的额外边缘环的数量。