Files
godot-docs/classes/class_primitivemesh.rst
2020-03-13 17:17:50 +01:00

99 lines
4.4 KiB
ReStructuredText

:github_url: hide
.. Generated automatically by doc/tools/makerst.py in Godot's source tree.
.. DO NOT EDIT THIS FILE, but the PrimitiveMesh.xml source instead.
.. The source is found in doc/classes or modules/<name>/doc_classes.
.. _class_PrimitiveMesh:
PrimitiveMesh
=============
**Inherits:** :ref:`Mesh<class_Mesh>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
**Inherited By:** :ref:`CapsuleMesh<class_CapsuleMesh>`, :ref:`CubeMesh<class_CubeMesh>`, :ref:`CylinderMesh<class_CylinderMesh>`, :ref:`PlaneMesh<class_PlaneMesh>`, :ref:`PointMesh<class_PointMesh>`, :ref:`PrismMesh<class_PrismMesh>`, :ref:`QuadMesh<class_QuadMesh>`, :ref:`SphereMesh<class_SphereMesh>`
Base class for all primitive meshes. Handles applying a :ref:`Material<class_Material>` to a primitive mesh.
Description
-----------
Base class for all primitive meshes. Handles applying a :ref:`Material<class_Material>` to a primitive mesh. Examples include :ref:`CapsuleMesh<class_CapsuleMesh>`, :ref:`CubeMesh<class_CubeMesh>`, :ref:`CylinderMesh<class_CylinderMesh>`, :ref:`PlaneMesh<class_PlaneMesh>`, :ref:`PrismMesh<class_PrismMesh>`, :ref:`QuadMesh<class_QuadMesh>`, and :ref:`SphereMesh<class_SphereMesh>`.
Properties
----------
+---------------------------------+--------------------------------------------------------------+------------------------------+
| :ref:`AABB<class_AABB>` | :ref:`custom_aabb<class_PrimitiveMesh_property_custom_aabb>` | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
+---------------------------------+--------------------------------------------------------------+------------------------------+
| :ref:`bool<class_bool>` | :ref:`flip_faces<class_PrimitiveMesh_property_flip_faces>` | ``false`` |
+---------------------------------+--------------------------------------------------------------+------------------------------+
| :ref:`Material<class_Material>` | :ref:`material<class_PrimitiveMesh_property_material>` | |
+---------------------------------+--------------------------------------------------------------+------------------------------+
Methods
-------
+---------------------------+--------------------------------------------------------------------------------------+
| :ref:`Array<class_Array>` | :ref:`get_mesh_arrays<class_PrimitiveMesh_method_get_mesh_arrays>` **(** **)** const |
+---------------------------+--------------------------------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_PrimitiveMesh_property_custom_aabb:
- :ref:`AABB<class_AABB>` **custom_aabb**
+-----------+------------------------------+
| *Default* | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
+-----------+------------------------------+
| *Setter* | set_custom_aabb(value) |
+-----------+------------------------------+
| *Getter* | get_custom_aabb() |
+-----------+------------------------------+
Overrides the :ref:`AABB<class_AABB>` with one defined by user for use with frustum culling. Especially useful to avoid unnexpected culling when using a shader to offset vertices.
----
.. _class_PrimitiveMesh_property_flip_faces:
- :ref:`bool<class_bool>` **flip_faces**
+-----------+-----------------------+
| *Default* | ``false`` |
+-----------+-----------------------+
| *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_BACK<class_BaseMaterial3D_constant_CULL_BACK>` in :ref:`BaseMaterial3D.cull_mode<class_BaseMaterial3D_property_cull_mode>`.
----
.. _class_PrimitiveMesh_property_material:
- :ref:`Material<class_Material>` **material**
+----------+---------------------+
| *Setter* | set_material(value) |
+----------+---------------------+
| *Getter* | get_material() |
+----------+---------------------+
The current :ref:`Material<class_Material>` of the primitive mesh.
Method Descriptions
-------------------
.. _class_PrimitiveMesh_method_get_mesh_arrays:
- :ref:`Array<class_Array>` **get_mesh_arrays** **(** **)** const
Returns mesh arrays used to constitute surface of :ref:`Mesh<class_Mesh>`. Mesh arrays can be used with :ref:`ArrayMesh<class_ArrayMesh>` to create new surfaces.