class_csgmesh.rst 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the CSGMesh.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_CSGMesh:
  6. CSGMesh
  7. =======
  8. **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>`
  9. A CSG Mesh shape that uses a mesh resource.
  10. Description
  11. -----------
  12. 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.
  13. **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.
  14. Tutorials
  15. ---------
  16. - `Prototyping levels with CSG <$DOCS_URL/tutorials/3d/csg_tools.html>`__
  17. Properties
  18. ----------
  19. +---------------------------------+--------------------------------------------------+
  20. | :ref:`Material<class_Material>` | :ref:`material<class_CSGMesh_property_material>` |
  21. +---------------------------------+--------------------------------------------------+
  22. | :ref:`Mesh<class_Mesh>` | :ref:`mesh<class_CSGMesh_property_mesh>` |
  23. +---------------------------------+--------------------------------------------------+
  24. Property Descriptions
  25. ---------------------
  26. .. _class_CSGMesh_property_material:
  27. - :ref:`Material<class_Material>` **material**
  28. +----------+---------------------+
  29. | *Setter* | set_material(value) |
  30. +----------+---------------------+
  31. | *Getter* | get_material() |
  32. +----------+---------------------+
  33. The :ref:`Material<class_Material>` used in drawing the CSG shape.
  34. ----
  35. .. _class_CSGMesh_property_mesh:
  36. - :ref:`Mesh<class_Mesh>` **mesh**
  37. +----------+-----------------+
  38. | *Setter* | set_mesh(value) |
  39. +----------+-----------------+
  40. | *Getter* | get_mesh() |
  41. +----------+-----------------+
  42. The :ref:`Mesh<class_Mesh>` resource to use as a CSG shape.
  43. **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.
  44. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  45. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  46. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`