:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/PrimitiveMesh.xml. .. _class_PrimitiveMesh: PrimitiveMesh ============= **Inherits:** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Inherited By:** :ref:`CapsuleMesh`, :ref:`CubeMesh`, :ref:`CylinderMesh`, :ref:`PlaneMesh`, :ref:`PointMesh`, :ref:`PrismMesh`, :ref:`QuadMesh`, :ref:`SphereMesh`, :ref:`TextMesh`, :ref:`TorusMesh` Base class for all primitive meshes. Handles applying a :ref:`Material` to a primitive mesh. .. rst-class:: classref-introduction-group Description ----------- Base class for all primitive meshes. Handles applying a :ref:`Material` to a primitive mesh. Examples include :ref:`CapsuleMesh`, :ref:`CubeMesh`, :ref:`CylinderMesh`, :ref:`PlaneMesh`, :ref:`PrismMesh`, :ref:`QuadMesh`, and :ref:`SphereMesh`. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +---------------------------------+--------------------------------------------------------------+------------------------------+ | :ref:`AABB` | :ref:`custom_aabb` | ``AABB( 0, 0, 0, 0, 0, 0 )`` | +---------------------------------+--------------------------------------------------------------+------------------------------+ | :ref:`bool` | :ref:`flip_faces` | ``false`` | +---------------------------------+--------------------------------------------------------------+------------------------------+ | :ref:`Material` | :ref:`material` | | +---------------------------------+--------------------------------------------------------------+------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +---------------------------+----------------------------------------------------------------------------------------+ | :ref:`Array` | :ref:`get_mesh_arrays` **(** **)** |const| | +---------------------------+----------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_PrimitiveMesh_property_custom_aabb: .. rst-class:: classref-property :ref:`AABB` **custom_aabb** = ``AABB( 0, 0, 0, 0, 0, 0 )`` .. rst-class:: classref-property-setget - void **set_custom_aabb** **(** :ref:`AABB` value **)** - :ref:`AABB` **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. .. rst-class:: classref-item-separator ---- .. _class_PrimitiveMesh_property_flip_faces: .. rst-class:: classref-property :ref:`bool` **flip_faces** = ``false`` .. rst-class:: classref-property-setget - void **set_flip_faces** **(** :ref:`bool` value **)** - :ref:`bool` **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:`Material3D.CULL_BACK` in :ref:`Material3D.params_cull_mode`. .. rst-class:: classref-item-separator ---- .. _class_PrimitiveMesh_property_material: .. rst-class:: classref-property :ref:`Material` **material** .. rst-class:: classref-property-setget - void **set_material** **(** :ref:`Material` value **)** - :ref:`Material` **get_material** **(** **)** The current :ref:`Material` of the primitive mesh. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_PrimitiveMesh_method_get_mesh_arrays: .. rst-class:: classref-method :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: :: var c := CylinderMesh.new() var arr_mesh := ArrayMesh.new() arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays()) .. |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.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`