class_csgmesh.rst 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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/modules/csg/doc_classes/CSGMesh.xml.
  6. .. _class_CSGMesh:
  7. CSGMesh
  8. =======
  9. **Inherits:** :ref:`CSGPrimitive<class_CSGPrimitive>` **<** :ref:`CSGShape<class_CSGShape>` **<** :ref:`GeometryInstance<class_GeometryInstance>` **<** :ref:`VisualInstance<class_VisualInstance>` **<** :ref:`CullInstance<class_CullInstance>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A CSG Mesh shape that uses a mesh resource.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This CSG node allows you to use any mesh resource as a CSG shape, provided it is closed, does not self-intersect, does not contain internal faces and has no edges that connect to more than two faces. See also :ref:`CSGPolygon<class_CSGPolygon>` for drawing 2D extruded polygons to be used as CSG nodes.
  15. \ **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance<class_MeshInstance>` with a :ref:`PrimitiveMesh<class_PrimitiveMesh>`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Prototyping levels with CSG <../tutorials/3d/csg_tools>`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +---------------------------------+--------------------------------------------------+
  26. | :ref:`Material<class_Material>` | :ref:`material<class_CSGMesh_property_material>` |
  27. +---------------------------------+--------------------------------------------------+
  28. | :ref:`Mesh<class_Mesh>` | :ref:`mesh<class_CSGMesh_property_mesh>` |
  29. +---------------------------------+--------------------------------------------------+
  30. .. rst-class:: classref-section-separator
  31. ----
  32. .. rst-class:: classref-descriptions-group
  33. Property Descriptions
  34. ---------------------
  35. .. _class_CSGMesh_property_material:
  36. .. rst-class:: classref-property
  37. :ref:`Material<class_Material>` **material**
  38. .. rst-class:: classref-property-setget
  39. - void **set_material** **(** :ref:`Material<class_Material>` value **)**
  40. - :ref:`Material<class_Material>` **get_material** **(** **)**
  41. The :ref:`Material<class_Material>` used in drawing the CSG shape.
  42. .. rst-class:: classref-item-separator
  43. ----
  44. .. _class_CSGMesh_property_mesh:
  45. .. rst-class:: classref-property
  46. :ref:`Mesh<class_Mesh>` **mesh**
  47. .. rst-class:: classref-property-setget
  48. - void **set_mesh** **(** :ref:`Mesh<class_Mesh>` value **)**
  49. - :ref:`Mesh<class_Mesh>` **get_mesh** **(** **)**
  50. The :ref:`Mesh<class_Mesh>` resource to use as a CSG shape.
  51. \ **Note:** When using an :ref:`ArrayMesh<class_ArrayMesh>`, avoid meshes with vertex normals unless a flat shader is required. By default, CSGMesh will ignore the mesh's vertex normals and use a smooth shader calculated using the faces' normals. If a flat shader is required, ensure that all faces' vertex normals are parallel.
  52. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  53. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  54. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  55. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`