PrimitiveMesh
Hereda: Mesh < Resource < RefCounted < Object
Heredado por: BoxMesh, CapsuleMesh, CylinderMesh, PlaneMesh, PointMesh, PrismMesh, RibbonTrailMesh, SphereMesh, TextMesh, TorusMesh, TubeTrailMesh
Clase base para todas las mallas primitivas. Maneja la aplicación de un Material a una malla primitiva.
Descripción
Clase base para todas las mallas primitivas. Maneja la aplicación de un Material a una malla primitiva. Algunos ejemplos son BoxMesh, CapsuleMesh, CylinderMesh, PlaneMesh, PrismMesh y SphereMesh.
Propiedades
|
||
|
||
|
||
|
Métodos
_create_mesh_array() virtual const |
|
get_mesh_arrays() const |
|
void |
Descripciones de Propiedades
If set, generates UV2 UV coordinates applying a padding using the uv2_padding setting. UV2 is needed for lightmapping.
AABB custom_aabb = AABB(0, 0, 0, 0, 0, 0) 🔗
Sobrescribe el AABB con uno definido por usuario para el uso con el tronco(frustum). Especialmente util para evitar inesperadas selecciones cuando se use un shader a vertices desplazados.
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.
El actual Material de la malla primitiva.
Si add_uv2 está activado, especifica el relleno en píxeles aplicado a lo largo de las costuras de la malla. Los valores de relleno más bajos permiten hacer un mejor uso de la textura del lightmap (lo que resulta en una mayor densidad de texeles), pero pueden introducir sangrado visible del lightmap a lo largo de los bordes.
Si el tamaño de la textura del lightmap no se puede determinar al generar la malla, UV2 se calcula asumiendo un tamaño de textura de 1024x1024.
Descripciones de Métodos
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.