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
Hérite de : Mesh < Resource < RefCounted < Object
Hérité par : BoxMesh, CapsuleMesh, CylinderMesh, PlaneMesh, PointMesh, PrismMesh, RibbonTrailMesh, SphereMesh, TextMesh, TorusMesh, TubeTrailMesh
Classe de base pour tous les maillages primitifs. Gère l'application d'un Material à un maillage primitif.
Description
Classe de base pour tous les maillages primitifs. Gère l'application d'un Material à un maillage primitif. On peut citer par exemple BoxMesh, CapsuleMesh, CylinderMesh, PlaneMesh, PrismMesh, et SphereMesh.
Propriétés
|
||
|
||
|
||
|
Méthodes
_create_mesh_array() virtual const |
|
get_mesh_arrays() const |
|
void |
Descriptions des propriétés
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) 🔗
Surcharge le AABB avec celui défini par l'utilisateur pour le calcul du culling d'affichage. Particulièrement utile pour éviter un culling inattendu lors de l'utilisation d'un shader qui décale les sommets.
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.
Le Material actuel du maillage primitif.
If add_uv2 is set, specifies the padding in pixels applied along seams of the mesh. Lower padding values allow making better use of the lightmap texture (resulting in higher texel density), but may introduce visible lightmap bleeding along edges.
If the size of the lightmap texture can't be determined when generating the mesh, UV2 is calculated assuming a texture size of 1024x1024.
Descriptions des méthodes
Array _create_mesh_array() virtual const 🔗
Redéfinissez cette méthode pour personnaliser comment ce maillage primitif devrait être généré. Devrait renvoyer un Array où chaque élément est un autre Array de valeurs requises pour le maillage (voir les constantes ArrayType).
Array get_mesh_arrays() const 🔗
Renvoie les tableaux du maillage utilisés pour constituer la surface de ce maillage primitif.
Exemple : Passez le résultat à ArrayMesh.add_surface_from_arrays() pour créer une nouvelle 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() 🔗
Demande une mise à jour de ce maillage primitif selon ses propriétés.