class_shape3d.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/Shape3D.xml.
  6. .. _class_Shape3D:
  7. Shape3D
  8. =======
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`BoxShape3D<class_BoxShape3D>`, :ref:`CapsuleShape3D<class_CapsuleShape3D>`, :ref:`ConcavePolygonShape3D<class_ConcavePolygonShape3D>`, :ref:`ConvexPolygonShape3D<class_ConvexPolygonShape3D>`, :ref:`CylinderShape3D<class_CylinderShape3D>`, :ref:`HeightMapShape3D<class_HeightMapShape3D>`, :ref:`SeparationRayShape3D<class_SeparationRayShape3D>`, :ref:`SphereShape3D<class_SphereShape3D>`, :ref:`WorldBoundaryShape3D<class_WorldBoundaryShape3D>`
  11. Abstract base class for 3D shapes used for physics collision.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Abstract base class for all 3D shapes, intended for use in physics.
  16. \ **Performance:** Primitive shapes, especially :ref:`SphereShape3D<class_SphereShape3D>`, are fast to check collisions against. :ref:`ConvexPolygonShape3D<class_ConvexPolygonShape3D>` and :ref:`HeightMapShape3D<class_HeightMapShape3D>` are slower, and :ref:`ConcavePolygonShape3D<class_ConcavePolygonShape3D>` is the slowest.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`Physics introduction <../tutorials/physics/physics_introduction>`
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +---------------------------+----------------------------------------------------------------------+----------+
  27. | :ref:`float<class_float>` | :ref:`custom_solver_bias<class_Shape3D_property_custom_solver_bias>` | ``0.0`` |
  28. +---------------------------+----------------------------------------------------------------------+----------+
  29. | :ref:`float<class_float>` | :ref:`margin<class_Shape3D_property_margin>` | ``0.04`` |
  30. +---------------------------+----------------------------------------------------------------------+----------+
  31. .. rst-class:: classref-reftable-group
  32. Methods
  33. -------
  34. .. table::
  35. :widths: auto
  36. +-----------------------------------+------------------------------------------------------------------------+
  37. | :ref:`ArrayMesh<class_ArrayMesh>` | :ref:`get_debug_mesh<class_Shape3D_method_get_debug_mesh>` **(** **)** |
  38. +-----------------------------------+------------------------------------------------------------------------+
  39. .. rst-class:: classref-section-separator
  40. ----
  41. .. rst-class:: classref-descriptions-group
  42. Property Descriptions
  43. ---------------------
  44. .. _class_Shape3D_property_custom_solver_bias:
  45. .. rst-class:: classref-property
  46. :ref:`float<class_float>` **custom_solver_bias** = ``0.0``
  47. .. rst-class:: classref-property-setget
  48. - void **set_custom_solver_bias** **(** :ref:`float<class_float>` value **)**
  49. - :ref:`float<class_float>` **get_custom_solver_bias** **(** **)**
  50. The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved.
  51. When set to ``0``, the default value from :ref:`ProjectSettings.physics/3d/solver/default_contact_bias<class_ProjectSettings_property_physics/3d/solver/default_contact_bias>` is used.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_Shape3D_property_margin:
  55. .. rst-class:: classref-property
  56. :ref:`float<class_float>` **margin** = ``0.04``
  57. .. rst-class:: classref-property-setget
  58. - void **set_margin** **(** :ref:`float<class_float>` value **)**
  59. - :ref:`float<class_float>` **get_margin** **(** **)**
  60. The collision margin for the shape. This is not used in Godot Physics.
  61. 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.
  62. .. rst-class:: classref-section-separator
  63. ----
  64. .. rst-class:: classref-descriptions-group
  65. Method Descriptions
  66. -------------------
  67. .. _class_Shape3D_method_get_debug_mesh:
  68. .. rst-class:: classref-method
  69. :ref:`ArrayMesh<class_ArrayMesh>` **get_debug_mesh** **(** **)**
  70. Returns the :ref:`ArrayMesh<class_ArrayMesh>` used to draw the debug collision for this **Shape3D**.
  71. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  72. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  73. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  74. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  75. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  76. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  77. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`