class_shape3d.rst 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/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. 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:`PhysicsBody3D<class_PhysicsBody3D>` or :ref:`Area3D<class_Area3D>` objects.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Physics introduction <../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:`custom_solver_bias<class_Shape3D_property_custom_solver_bias>` | ``0.0`` |
  27. +---------------------------+----------------------------------------------------------------------+----------+
  28. | :ref:`float<class_float>` | :ref:`margin<class_Shape3D_property_margin>` | ``0.04`` |
  29. +---------------------------+----------------------------------------------------------------------+----------+
  30. .. rst-class:: classref-reftable-group
  31. Methods
  32. -------
  33. .. table::
  34. :widths: auto
  35. +-----------------------------------+------------------------------------------------------------------------+
  36. | :ref:`ArrayMesh<class_ArrayMesh>` | :ref:`get_debug_mesh<class_Shape3D_method_get_debug_mesh>` **(** **)** |
  37. +-----------------------------------+------------------------------------------------------------------------+
  38. .. rst-class:: classref-section-separator
  39. ----
  40. .. rst-class:: classref-descriptions-group
  41. Property Descriptions
  42. ---------------------
  43. .. _class_Shape3D_property_custom_solver_bias:
  44. .. rst-class:: classref-property
  45. :ref:`float<class_float>` **custom_solver_bias** = ``0.0``
  46. .. rst-class:: classref-property-setget
  47. - void **set_custom_solver_bias** **(** :ref:`float<class_float>` value **)**
  48. - :ref:`float<class_float>` **get_custom_solver_bias** **(** **)**
  49. The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved.
  50. 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.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_Shape3D_property_margin:
  54. .. rst-class:: classref-property
  55. :ref:`float<class_float>` **margin** = ``0.04``
  56. .. rst-class:: classref-property-setget
  57. - void **set_margin** **(** :ref:`float<class_float>` value **)**
  58. - :ref:`float<class_float>` **get_margin** **(** **)**
  59. The collision margin for the shape. This is not used in Godot Physics.
  60. 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.
  61. .. rst-class:: classref-section-separator
  62. ----
  63. .. rst-class:: classref-descriptions-group
  64. Method Descriptions
  65. -------------------
  66. .. _class_Shape3D_method_get_debug_mesh:
  67. .. rst-class:: classref-method
  68. :ref:`ArrayMesh<class_ArrayMesh>` **get_debug_mesh** **(** **)**
  69. Returns the :ref:`ArrayMesh<class_ArrayMesh>` used to draw the debug collision for this **Shape3D**.
  70. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  71. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  72. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  73. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  74. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  75. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`