:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/PrimitiveMesh.xml. .. _class_PrimitiveMesh: PrimitiveMesh ============= **Inherits:** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`RefCounted` **<** :ref:`Object` **Inherited By:** :ref:`BoxMesh`, :ref:`CapsuleMesh`, :ref:`CylinderMesh`, :ref:`PlaneMesh`, :ref:`PointMesh`, :ref:`PrismMesh`, :ref:`QuadMesh`, :ref:`RibbonTrailMesh`, :ref:`SphereMesh`, :ref:`TextMesh`, :ref:`TubeTrailMesh` Base class for all primitive meshes. Handles applying a :ref:`Material` to a primitive mesh. Description ----------- Base class for all primitive meshes. Handles applying a :ref:`Material` to a primitive mesh. Examples include :ref:`BoxMesh`, :ref:`CapsuleMesh`, :ref:`CylinderMesh`, :ref:`PlaneMesh`, :ref:`PrismMesh`, :ref:`QuadMesh`, and :ref:`SphereMesh`. Properties ---------- +---------------------------------+--------------------------------------------------------------+ | :ref:`AABB` | :ref:`custom_aabb` | +---------------------------------+--------------------------------------------------------------+ | :ref:`bool` | :ref:`flip_faces` | +---------------------------------+--------------------------------------------------------------+ | :ref:`Material` | :ref:`material` | +---------------------------------+--------------------------------------------------------------+ Methods ------- +---------------------------+--------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`_create_mesh_array` **(** **)** |virtual| |const| | +---------------------------+--------------------------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_mesh_arrays` **(** **)** |const| | +---------------------------+--------------------------------------------------------------------------------------------------------+ Property Descriptions --------------------- .. _class_PrimitiveMesh_property_custom_aabb: - :ref:`AABB` **custom_aabb** +----------+------------------------+ | *Setter* | set_custom_aabb(value) | +----------+------------------------+ | *Getter* | get_custom_aabb() | +----------+------------------------+ Overrides the :ref:`AABB` with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. ---- .. _class_PrimitiveMesh_property_flip_faces: - :ref:`bool` **flip_faces** +----------+-----------------------+ | *Setter* | set_flip_faces(value) | +----------+-----------------------+ | *Getter* | get_flip_faces() | +----------+-----------------------+ If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. This gives the same result as using :ref:`BaseMaterial3D.CULL_FRONT` in :ref:`BaseMaterial3D.cull_mode`. ---- .. _class_PrimitiveMesh_property_material: - :ref:`Material` **material** +----------+---------------------+ | *Setter* | set_material(value) | +----------+---------------------+ | *Getter* | get_material() | +----------+---------------------+ The current :ref:`Material` of the primitive mesh. Method Descriptions ------------------- .. _class_PrimitiveMesh_method__create_mesh_array: - :ref:`Array` **_create_mesh_array** **(** **)** |virtual| |const| ---- .. _class_PrimitiveMesh_method_get_mesh_arrays: - :ref:`Array` **get_mesh_arrays** **(** **)** |const| Returns mesh arrays used to constitute surface of :ref:`Mesh`. The result can be passed to :ref:`ArrayMesh.add_surface_from_arrays` to create a new surface. For example: .. tabs:: .. code-tab:: gdscript var c = CylinderMesh.new() var arr_mesh = ArrayMesh.new() arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays()) .. code-tab:: csharp var c = new CylinderMesh(); var arrMesh = new ArrayMesh(); arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, c.GetMeshArrays()); .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`