class_primitivemesh.rst 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/PrimitiveMesh.xml.
  6. .. _class_PrimitiveMesh:
  7. PrimitiveMesh
  8. =============
  9. **Inherits:** :ref:`Mesh<class_Mesh>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. **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>`, :ref:`TextMesh<class_TextMesh>`, :ref:`TorusMesh<class_TorusMesh>`
  11. Base class for all primitive meshes. Handles applying a :ref:`Material<class_Material>` to a primitive mesh.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. 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>`.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +---------------------------------+--------------------------------------------------------------+------------------------------+
  22. | :ref:`AABB<class_AABB>` | :ref:`custom_aabb<class_PrimitiveMesh_property_custom_aabb>` | ``AABB( 0, 0, 0, 0, 0, 0 )`` |
  23. +---------------------------------+--------------------------------------------------------------+------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`flip_faces<class_PrimitiveMesh_property_flip_faces>` | ``false`` |
  25. +---------------------------------+--------------------------------------------------------------+------------------------------+
  26. | :ref:`Material<class_Material>` | :ref:`material<class_PrimitiveMesh_property_material>` | |
  27. +---------------------------------+--------------------------------------------------------------+------------------------------+
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +---------------------------+----------------------------------------------------------------------------------------+
  34. | :ref:`Array<class_Array>` | :ref:`get_mesh_arrays<class_PrimitiveMesh_method_get_mesh_arrays>` **(** **)** |const| |
  35. +---------------------------+----------------------------------------------------------------------------------------+
  36. .. rst-class:: classref-section-separator
  37. ----
  38. .. rst-class:: classref-descriptions-group
  39. Property Descriptions
  40. ---------------------
  41. .. _class_PrimitiveMesh_property_custom_aabb:
  42. .. rst-class:: classref-property
  43. :ref:`AABB<class_AABB>` **custom_aabb** = ``AABB( 0, 0, 0, 0, 0, 0 )``
  44. .. rst-class:: classref-property-setget
  45. - void **set_custom_aabb** **(** :ref:`AABB<class_AABB>` value **)**
  46. - :ref:`AABB<class_AABB>` **get_custom_aabb** **(** **)**
  47. Overrides the :ref:`AABB<class_AABB>` with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices.
  48. .. rst-class:: classref-item-separator
  49. ----
  50. .. _class_PrimitiveMesh_property_flip_faces:
  51. .. rst-class:: classref-property
  52. :ref:`bool<class_bool>` **flip_faces** = ``false``
  53. .. rst-class:: classref-property-setget
  54. - void **set_flip_faces** **(** :ref:`bool<class_bool>` value **)**
  55. - :ref:`bool<class_bool>` **get_flip_faces** **(** **)**
  56. If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn.
  57. This gives the same result as using :ref:`Material3D.CULL_BACK<class_Material3D_constant_CULL_BACK>` in :ref:`Material3D.params_cull_mode<class_Material3D_property_params_cull_mode>`.
  58. .. rst-class:: classref-item-separator
  59. ----
  60. .. _class_PrimitiveMesh_property_material:
  61. .. rst-class:: classref-property
  62. :ref:`Material<class_Material>` **material**
  63. .. rst-class:: classref-property-setget
  64. - void **set_material** **(** :ref:`Material<class_Material>` value **)**
  65. - :ref:`Material<class_Material>` **get_material** **(** **)**
  66. The current :ref:`Material<class_Material>` of the primitive mesh.
  67. .. rst-class:: classref-section-separator
  68. ----
  69. .. rst-class:: classref-descriptions-group
  70. Method Descriptions
  71. -------------------
  72. .. _class_PrimitiveMesh_method_get_mesh_arrays:
  73. .. rst-class:: classref-method
  74. :ref:`Array<class_Array>` **get_mesh_arrays** **(** **)** |const|
  75. Returns mesh arrays used to constitute surface of :ref:`Mesh<class_Mesh>`. The result can be passed to :ref:`ArrayMesh.add_surface_from_arrays<class_ArrayMesh_method_add_surface_from_arrays>` to create a new surface. For example:
  76. ::
  77. var c := CylinderMesh.new()
  78. var arr_mesh := ArrayMesh.new()
  79. arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays())
  80. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  81. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  82. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  83. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`