class_primitivemesh.rst 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the PrimitiveMesh.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_PrimitiveMesh:
  6. PrimitiveMesh
  7. =============
  8. **Inherits:** :ref:`Mesh<class_Mesh>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  9. **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>`
  10. **Category:** Core
  11. Brief Description
  12. -----------------
  13. Base class for all primitive meshes. Handles applying a :ref:`Material<class_Material>` to a primitive mesh.
  14. Properties
  15. ----------
  16. +---------------------------------+--------------------------------------------------------------+--------------------------+
  17. | :ref:`AABB<class_AABB>` | :ref:`custom_aabb<class_PrimitiveMesh_property_custom_aabb>` | AABB( 0, 0, 0, 0, 0, 0 ) |
  18. +---------------------------------+--------------------------------------------------------------+--------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`flip_faces<class_PrimitiveMesh_property_flip_faces>` | false |
  20. +---------------------------------+--------------------------------------------------------------+--------------------------+
  21. | :ref:`Material<class_Material>` | :ref:`material<class_PrimitiveMesh_property_material>` | |
  22. +---------------------------------+--------------------------------------------------------------+--------------------------+
  23. Methods
  24. -------
  25. +---------------------------+--------------------------------------------------------------------------------------+
  26. | :ref:`Array<class_Array>` | :ref:`get_mesh_arrays<class_PrimitiveMesh_method_get_mesh_arrays>` **(** **)** const |
  27. +---------------------------+--------------------------------------------------------------------------------------+
  28. Description
  29. -----------
  30. 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>`.
  31. Property Descriptions
  32. ---------------------
  33. .. _class_PrimitiveMesh_property_custom_aabb:
  34. - :ref:`AABB<class_AABB>` **custom_aabb**
  35. +-----------+--------------------------+
  36. | *Default* | AABB( 0, 0, 0, 0, 0, 0 ) |
  37. +-----------+--------------------------+
  38. | *Setter* | set_custom_aabb(value) |
  39. +-----------+--------------------------+
  40. | *Getter* | get_custom_aabb() |
  41. +-----------+--------------------------+
  42. 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.
  43. .. _class_PrimitiveMesh_property_flip_faces:
  44. - :ref:`bool<class_bool>` **flip_faces**
  45. +-----------+-----------------------+
  46. | *Default* | false |
  47. +-----------+-----------------------+
  48. | *Setter* | set_flip_faces(value) |
  49. +-----------+-----------------------+
  50. | *Getter* | get_flip_faces() |
  51. +-----------+-----------------------+
  52. If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. Result is the same as using \*CULL_BACK\* in :ref:`SpatialMaterial<class_SpatialMaterial>`.
  53. .. _class_PrimitiveMesh_property_material:
  54. - :ref:`Material<class_Material>` **material**
  55. +----------+---------------------+
  56. | *Setter* | set_material(value) |
  57. +----------+---------------------+
  58. | *Getter* | get_material() |
  59. +----------+---------------------+
  60. The current :ref:`Material<class_Material>` of the primitive mesh.
  61. Method Descriptions
  62. -------------------
  63. .. _class_PrimitiveMesh_method_get_mesh_arrays:
  64. - :ref:`Array<class_Array>` **get_mesh_arrays** **(** **)** const
  65. 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.