class_physicsbody.rst 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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/PhysicsBody.xml.
  6. .. _class_PhysicsBody:
  7. PhysicsBody
  8. ===========
  9. **Inherits:** :ref:`CollisionObject<class_CollisionObject>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`KinematicBody<class_KinematicBody>`, :ref:`PhysicalBone<class_PhysicalBone>`, :ref:`RigidBody<class_RigidBody>`, :ref:`StaticBody<class_StaticBody>`
  11. Base class for all objects affected by physics in 3D space.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. PhysicsBody is an abstract base class for implementing a physics body. All \*Body types inherit from it.
  16. \ **Warning:** With a non-uniform scale this node will probably not function as expected. Please make sure to keep its scale uniform (i.e. the same on all axes), and change the size(s) of its collision shape(s) instead.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`../tutorials/physics/physics_introduction`
  21. .. rst-class:: classref-reftable-group
  22. Methods
  23. -------
  24. .. table::
  25. :widths: auto
  26. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  27. | void | :ref:`add_collision_exception_with<class_PhysicsBody_method_add_collision_exception_with>` **(** :ref:`Node<class_Node>` body **)** |
  28. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`Array<class_Array>` | :ref:`get_collision_exceptions<class_PhysicsBody_method_get_collision_exceptions>` **(** **)** |
  30. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`remove_collision_exception_with<class_PhysicsBody_method_remove_collision_exception_with>` **(** :ref:`Node<class_Node>` body **)** |
  32. +---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
  33. .. rst-class:: classref-section-separator
  34. ----
  35. .. rst-class:: classref-descriptions-group
  36. Method Descriptions
  37. -------------------
  38. .. _class_PhysicsBody_method_add_collision_exception_with:
  39. .. rst-class:: classref-method
  40. void **add_collision_exception_with** **(** :ref:`Node<class_Node>` body **)**
  41. Adds a body to the list of bodies that this body can't collide with.
  42. .. rst-class:: classref-item-separator
  43. ----
  44. .. _class_PhysicsBody_method_get_collision_exceptions:
  45. .. rst-class:: classref-method
  46. :ref:`Array<class_Array>` **get_collision_exceptions** **(** **)**
  47. Returns an array of nodes that were added as collision exceptions for this body.
  48. .. rst-class:: classref-item-separator
  49. ----
  50. .. _class_PhysicsBody_method_remove_collision_exception_with:
  51. .. rst-class:: classref-method
  52. void **remove_collision_exception_with** **(** :ref:`Node<class_Node>` body **)**
  53. Removes a body from the list of bodies that this body can't collide with.
  54. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  55. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  56. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  57. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`