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...
PrimitiveMesh
繼承: Mesh < Resource < RefCounted < Object
被繼承: BoxMesh, CapsuleMesh, CylinderMesh, PlaneMesh, PointMesh, PrismMesh, RibbonTrailMesh, SphereMesh, TextMesh, TorusMesh, TubeTrailMesh
所有圖元網格的基底類別。處理將 Material 套用到圖元網格的問題。
說明
所有基本網格的基底類別,能夠處理將 Material 套用到基本網格的操作。有 BoxMesh、CapsuleMesh、CylinderMesh、PlaneMesh、PrismMesh、SphereMesh 等基本網格。
屬性
|
||
|
||
|
||
|
方法
_create_mesh_array() virtual const |
|
get_mesh_arrays() const |
|
void |
屬性說明
打開後將生成 UV2 UV 座標,使用 uv2_padding 設定的間距。光照對應需要 UV2。
AABB custom_aabb = AABB(0, 0, 0, 0, 0, 0) 🔗
使用使用者自訂的 AABB 取代預設值,供視錐剔除使用。當著色器會偏移頂點時,可避免被意外剔除。
If true, the order of the vertices in each triangle is reversed, resulting in the backside of the mesh being drawn.
This gives the same result as using BaseMaterial3D.CULL_FRONT in BaseMaterial3D.cull_mode.
該圖元網格的目前 Material。
如果設定了 add_uv2,則指定沿網格接縫被套用的以圖元為單位的填充。較低的填充值允許更好地利用光照貼圖紋理(導致更高的紋素密度),但可能會沿邊緣引入可見的光照貼圖滲色。
如果在生成網格時無法確定光照貼圖紋理的大小,則計算 UV2 時假定紋理大小為 1024x1024。
方法說明
Array _create_mesh_array() virtual const 🔗
Override this method to customize how this primitive mesh should be generated. Should return an Array where each element is another Array of values required for the mesh (see the ArrayType constants).
Array get_mesh_arrays() const 🔗
Returns the mesh arrays used to make up the surface of this primitive mesh.
Example: Pass the result to ArrayMesh.add_surface_from_arrays() to create a new surface:
var c = CylinderMesh.new()
var arr_mesh = ArrayMesh.new()
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays())
var c = new CylinderMesh();
var arrMesh = new ArrayMesh();
arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, c.GetMeshArrays());
void request_update() 🔗
Request an update of this primitive mesh based on its properties.