class_shape.rst 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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/Shape.xml.
  6. .. _class_Shape:
  7. Shape
  8. =====
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`BoxShape<class_BoxShape>`, :ref:`CapsuleShape<class_CapsuleShape>`, :ref:`ConcavePolygonShape<class_ConcavePolygonShape>`, :ref:`ConvexPolygonShape<class_ConvexPolygonShape>`, :ref:`CylinderShape<class_CylinderShape>`, :ref:`HeightMapShape<class_HeightMapShape>`, :ref:`PlaneShape<class_PlaneShape>`, :ref:`RayShape<class_RayShape>`, :ref:`SphereShape<class_SphereShape>`
  11. Base class for all 3D shape resources.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Base class for all 3D shape resources. Nodes that inherit from this can be used as shapes for a :ref:`PhysicsBody<class_PhysicsBody>` or :ref:`Area<class_Area>` objects.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`../tutorials/physics/physics_introduction`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +---------------------------+--------------------------------------------+----------+
  26. | :ref:`float<class_float>` | :ref:`margin<class_Shape_property_margin>` | ``0.04`` |
  27. +---------------------------+--------------------------------------------+----------+
  28. .. rst-class:: classref-reftable-group
  29. Methods
  30. -------
  31. .. table::
  32. :widths: auto
  33. +-----------------------------------+----------------------------------------------------------------------+
  34. | :ref:`ArrayMesh<class_ArrayMesh>` | :ref:`get_debug_mesh<class_Shape_method_get_debug_mesh>` **(** **)** |
  35. +-----------------------------------+----------------------------------------------------------------------+
  36. .. rst-class:: classref-section-separator
  37. ----
  38. .. rst-class:: classref-descriptions-group
  39. Property Descriptions
  40. ---------------------
  41. .. _class_Shape_property_margin:
  42. .. rst-class:: classref-property
  43. :ref:`float<class_float>` **margin** = ``0.04``
  44. .. rst-class:: classref-property-setget
  45. - void **set_margin** **(** :ref:`float<class_float>` value **)**
  46. - :ref:`float<class_float>` **get_margin** **(** **)**
  47. The collision margin for the shape. Used in Bullet Physics only.
  48. Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp.
  49. .. rst-class:: classref-section-separator
  50. ----
  51. .. rst-class:: classref-descriptions-group
  52. Method Descriptions
  53. -------------------
  54. .. _class_Shape_method_get_debug_mesh:
  55. .. rst-class:: classref-method
  56. :ref:`ArrayMesh<class_ArrayMesh>` **get_debug_mesh** **(** **)**
  57. Returns the :ref:`ArrayMesh<class_ArrayMesh>` used to draw the debug collision for this **Shape**.
  58. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  59. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  60. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  61. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`