123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Shape3D.xml.
- .. _class_Shape3D:
- Shape3D
- =======
- **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
- **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>`
- Abstract base class for 3D shapes used for physics collision.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- Abstract base class for all 3D shapes, intended for use in physics.
- \ **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.
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - :doc:`Physics introduction <../tutorials/physics/physics_introduction>`
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +---------------------------+----------------------------------------------------------------------+----------+
- | :ref:`float<class_float>` | :ref:`custom_solver_bias<class_Shape3D_property_custom_solver_bias>` | ``0.0`` |
- +---------------------------+----------------------------------------------------------------------+----------+
- | :ref:`float<class_float>` | :ref:`margin<class_Shape3D_property_margin>` | ``0.04`` |
- +---------------------------+----------------------------------------------------------------------+----------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-----------------------------------+------------------------------------------------------------------+
- | :ref:`ArrayMesh<class_ArrayMesh>` | :ref:`get_debug_mesh<class_Shape3D_method_get_debug_mesh>`\ (\ ) |
- +-----------------------------------+------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_Shape3D_property_custom_solver_bias:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **custom_solver_bias** = ``0.0`` :ref:`🔗<class_Shape3D_property_custom_solver_bias>`
- .. rst-class:: classref-property-setget
- - |void| **set_custom_solver_bias**\ (\ value\: :ref:`float<class_float>`\ )
- - :ref:`float<class_float>` **get_custom_solver_bias**\ (\ )
- The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved.
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Shape3D_property_margin:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **margin** = ``0.04`` :ref:`🔗<class_Shape3D_property_margin>`
- .. rst-class:: classref-property-setget
- - |void| **set_margin**\ (\ value\: :ref:`float<class_float>`\ )
- - :ref:`float<class_float>` **get_margin**\ (\ )
- The collision margin for the shape. This is not used in Godot Physics.
- 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.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_Shape3D_method_get_debug_mesh:
- .. rst-class:: classref-method
- :ref:`ArrayMesh<class_ArrayMesh>` **get_debug_mesh**\ (\ ) :ref:`🔗<class_Shape3D_method_get_debug_mesh>`
- Returns the :ref:`ArrayMesh<class_ArrayMesh>` used to draw the debug collision for this **Shape3D**.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
- .. |void| replace:: :abbr:`void (No return value.)`
|