class_physicsdirectbodystate.rst 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the PhysicsDirectBodyState.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_PhysicsDirectBodyState:
  5. PhysicsDirectBodyState
  6. ======================
  7. **Inherits:** :ref:`Object<class_Object>`
  8. **Inherited By:** :ref:`BulletPhysicsDirectBodyState<class_BulletPhysicsDirectBodyState>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Properties
  13. ----------
  14. +-----------------------------------+------------------------------------------------------------------------------------+
  15. | :ref:`Vector3<class_Vector3>` | :ref:`angular_velocity<class_PhysicsDirectBodyState_angular_velocity>` |
  16. +-----------------------------------+------------------------------------------------------------------------------------+
  17. | :ref:`Vector3<class_Vector3>` | :ref:`center_of_mass<class_PhysicsDirectBodyState_center_of_mass>` |
  18. +-----------------------------------+------------------------------------------------------------------------------------+
  19. | :ref:`Vector3<class_Vector3>` | :ref:`inverse_inertia<class_PhysicsDirectBodyState_inverse_inertia>` |
  20. +-----------------------------------+------------------------------------------------------------------------------------+
  21. | :ref:`float<class_float>` | :ref:`inverse_mass<class_PhysicsDirectBodyState_inverse_mass>` |
  22. +-----------------------------------+------------------------------------------------------------------------------------+
  23. | :ref:`Vector3<class_Vector3>` | :ref:`linear_velocity<class_PhysicsDirectBodyState_linear_velocity>` |
  24. +-----------------------------------+------------------------------------------------------------------------------------+
  25. | :ref:`Basis<class_Basis>` | :ref:`principal_inertia_axes<class_PhysicsDirectBodyState_principal_inertia_axes>` |
  26. +-----------------------------------+------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`sleeping<class_PhysicsDirectBodyState_sleeping>` |
  28. +-----------------------------------+------------------------------------------------------------------------------------+
  29. | :ref:`float<class_float>` | :ref:`step<class_PhysicsDirectBodyState_step>` |
  30. +-----------------------------------+------------------------------------------------------------------------------------+
  31. | :ref:`float<class_float>` | :ref:`total_angular_damp<class_PhysicsDirectBodyState_total_angular_damp>` |
  32. +-----------------------------------+------------------------------------------------------------------------------------+
  33. | :ref:`Vector3<class_Vector3>` | :ref:`total_gravity<class_PhysicsDirectBodyState_total_gravity>` |
  34. +-----------------------------------+------------------------------------------------------------------------------------+
  35. | :ref:`float<class_float>` | :ref:`total_linear_damp<class_PhysicsDirectBodyState_total_linear_damp>` |
  36. +-----------------------------------+------------------------------------------------------------------------------------+
  37. | :ref:`Transform<class_Transform>` | :ref:`transform<class_PhysicsDirectBodyState_transform>` |
  38. +-----------------------------------+------------------------------------------------------------------------------------+
  39. Methods
  40. -------
  41. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`add_central_force<class_PhysicsDirectBodyState_add_central_force>` **(** :ref:`Vector3<class_Vector3>` force **)** |
  43. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`add_force<class_PhysicsDirectBodyState_add_force>` **(** :ref:`Vector3<class_Vector3>` force, :ref:`Vector3<class_Vector3>` position **)** |
  45. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | void | :ref:`add_torque<class_PhysicsDirectBodyState_add_torque>` **(** :ref:`Vector3<class_Vector3>` torque **)** |
  47. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | void | :ref:`apply_central_impulse<class_PhysicsDirectBodyState_apply_central_impulse>` **(** :ref:`Vector3<class_Vector3>` j **)** |
  49. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | void | :ref:`apply_impulse<class_PhysicsDirectBodyState_apply_impulse>` **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` j **)** |
  51. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | void | :ref:`apply_torque_impulse<class_PhysicsDirectBodyState_apply_torque_impulse>` **(** :ref:`Vector3<class_Vector3>` j **)** |
  53. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`RID<class_RID>` | :ref:`get_contact_collider<class_PhysicsDirectBodyState_get_contact_collider>` **(** :ref:`int<class_int>` contact_idx **)** const |
  55. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`int<class_int>` | :ref:`get_contact_collider_id<class_PhysicsDirectBodyState_get_contact_collider_id>` **(** :ref:`int<class_int>` contact_idx **)** const |
  57. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Object<class_Object>` | :ref:`get_contact_collider_object<class_PhysicsDirectBodyState_get_contact_collider_object>` **(** :ref:`int<class_int>` contact_idx **)** const |
  59. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`Vector3<class_Vector3>` | :ref:`get_contact_collider_position<class_PhysicsDirectBodyState_get_contact_collider_position>` **(** :ref:`int<class_int>` contact_idx **)** const |
  61. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`int<class_int>` | :ref:`get_contact_collider_shape<class_PhysicsDirectBodyState_get_contact_collider_shape>` **(** :ref:`int<class_int>` contact_idx **)** const |
  63. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Vector3<class_Vector3>` | :ref:`get_contact_collider_velocity_at_position<class_PhysicsDirectBodyState_get_contact_collider_velocity_at_position>` **(** :ref:`int<class_int>` contact_idx **)** const |
  65. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`get_contact_count<class_PhysicsDirectBodyState_get_contact_count>` **(** **)** const |
  67. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`float<class_float>` | :ref:`get_contact_impulse<class_PhysicsDirectBodyState_get_contact_impulse>` **(** :ref:`int<class_int>` contact_idx **)** const |
  69. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`Vector3<class_Vector3>` | :ref:`get_contact_local_normal<class_PhysicsDirectBodyState_get_contact_local_normal>` **(** :ref:`int<class_int>` contact_idx **)** const |
  71. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`Vector3<class_Vector3>` | :ref:`get_contact_local_position<class_PhysicsDirectBodyState_get_contact_local_position>` **(** :ref:`int<class_int>` contact_idx **)** const |
  73. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :ref:`get_contact_local_shape<class_PhysicsDirectBodyState_get_contact_local_shape>` **(** :ref:`int<class_int>` contact_idx **)** const |
  75. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`PhysicsDirectSpaceState<class_PhysicsDirectSpaceState>` | :ref:`get_space_state<class_PhysicsDirectBodyState_get_space_state>` **(** **)** |
  77. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`integrate_forces<class_PhysicsDirectBodyState_integrate_forces>` **(** **)** |
  79. +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. Property Descriptions
  81. ---------------------
  82. .. _class_PhysicsDirectBodyState_angular_velocity:
  83. - :ref:`Vector3<class_Vector3>` **angular_velocity**
  84. +----------+-----------------------------+
  85. | *Setter* | set_angular_velocity(value) |
  86. +----------+-----------------------------+
  87. | *Getter* | get_angular_velocity() |
  88. +----------+-----------------------------+
  89. The angular velocity of the body.
  90. .. _class_PhysicsDirectBodyState_center_of_mass:
  91. - :ref:`Vector3<class_Vector3>` **center_of_mass**
  92. +----------+----------------------+
  93. | *Getter* | get_center_of_mass() |
  94. +----------+----------------------+
  95. .. _class_PhysicsDirectBodyState_inverse_inertia:
  96. - :ref:`Vector3<class_Vector3>` **inverse_inertia**
  97. +----------+-----------------------+
  98. | *Getter* | get_inverse_inertia() |
  99. +----------+-----------------------+
  100. The inverse of the inertia of the body.
  101. .. _class_PhysicsDirectBodyState_inverse_mass:
  102. - :ref:`float<class_float>` **inverse_mass**
  103. +----------+--------------------+
  104. | *Getter* | get_inverse_mass() |
  105. +----------+--------------------+
  106. The inverse of the mass of the body.
  107. .. _class_PhysicsDirectBodyState_linear_velocity:
  108. - :ref:`Vector3<class_Vector3>` **linear_velocity**
  109. +----------+----------------------------+
  110. | *Setter* | set_linear_velocity(value) |
  111. +----------+----------------------------+
  112. | *Getter* | get_linear_velocity() |
  113. +----------+----------------------------+
  114. The linear velocity of the body.
  115. .. _class_PhysicsDirectBodyState_principal_inertia_axes:
  116. - :ref:`Basis<class_Basis>` **principal_inertia_axes**
  117. +----------+------------------------------+
  118. | *Getter* | get_principal_inertia_axes() |
  119. +----------+------------------------------+
  120. .. _class_PhysicsDirectBodyState_sleeping:
  121. - :ref:`bool<class_bool>` **sleeping**
  122. +----------+------------------------+
  123. | *Setter* | set_sleep_state(value) |
  124. +----------+------------------------+
  125. | *Getter* | is_sleeping() |
  126. +----------+------------------------+
  127. ``true`` if this body is currently sleeping (not active).
  128. .. _class_PhysicsDirectBodyState_step:
  129. - :ref:`float<class_float>` **step**
  130. +----------+------------+
  131. | *Getter* | get_step() |
  132. +----------+------------+
  133. The timestep (delta) used for the simulation.
  134. .. _class_PhysicsDirectBodyState_total_angular_damp:
  135. - :ref:`float<class_float>` **total_angular_damp**
  136. +----------+--------------------------+
  137. | *Getter* | get_total_angular_damp() |
  138. +----------+--------------------------+
  139. The rate at which the body stops rotating, if there are not any other forces moving it.
  140. .. _class_PhysicsDirectBodyState_total_gravity:
  141. - :ref:`Vector3<class_Vector3>` **total_gravity**
  142. +----------+---------------------+
  143. | *Getter* | get_total_gravity() |
  144. +----------+---------------------+
  145. The total gravity vector being currently applied to this body.
  146. .. _class_PhysicsDirectBodyState_total_linear_damp:
  147. - :ref:`float<class_float>` **total_linear_damp**
  148. +----------+-------------------------+
  149. | *Getter* | get_total_linear_damp() |
  150. +----------+-------------------------+
  151. The rate at which the body stops moving, if there are not any other forces moving it.
  152. .. _class_PhysicsDirectBodyState_transform:
  153. - :ref:`Transform<class_Transform>` **transform**
  154. +----------+----------------------+
  155. | *Setter* | set_transform(value) |
  156. +----------+----------------------+
  157. | *Getter* | get_transform() |
  158. +----------+----------------------+
  159. The transformation matrix of the body.
  160. Method Descriptions
  161. -------------------
  162. .. _class_PhysicsDirectBodyState_add_central_force:
  163. - void **add_central_force** **(** :ref:`Vector3<class_Vector3>` force **)**
  164. Adds a constant directional force without affecting rotation.
  165. This is equivalent to ``add_force(force, Vector3(0,0,0))``.
  166. .. _class_PhysicsDirectBodyState_add_force:
  167. - void **add_force** **(** :ref:`Vector3<class_Vector3>` force, :ref:`Vector3<class_Vector3>` position **)**
  168. Adds a constant force (i.e. acceleration).
  169. .. _class_PhysicsDirectBodyState_add_torque:
  170. - void **add_torque** **(** :ref:`Vector3<class_Vector3>` torque **)**
  171. Adds a constant rotational force (i.e. a motor) without affecting position.
  172. .. _class_PhysicsDirectBodyState_apply_central_impulse:
  173. - void **apply_central_impulse** **(** :ref:`Vector3<class_Vector3>` j **)**
  174. Applies a single directional impulse without affecting rotation.
  175. This is equivalent to ``apply_impulse(Vector3(0,0,0), impulse)``.
  176. .. _class_PhysicsDirectBodyState_apply_impulse:
  177. - void **apply_impulse** **(** :ref:`Vector3<class_Vector3>` position, :ref:`Vector3<class_Vector3>` j **)**
  178. Apply a positioned impulse (which will be affected by the body mass and shape). This is the equivalent of hitting a billiard ball with a cue: a force that is applied once, and only once. Both the impulse and the position are in global coordinates, and the position is relative to the object's origin.
  179. .. _class_PhysicsDirectBodyState_apply_torque_impulse:
  180. - void **apply_torque_impulse** **(** :ref:`Vector3<class_Vector3>` j **)**
  181. Apply a torque impulse (which will be affected by the body mass and shape). This will rotate the body around the passed in vector.
  182. .. _class_PhysicsDirectBodyState_get_contact_collider:
  183. - :ref:`RID<class_RID>` **get_contact_collider** **(** :ref:`int<class_int>` contact_idx **)** const
  184. .. _class_PhysicsDirectBodyState_get_contact_collider_id:
  185. - :ref:`int<class_int>` **get_contact_collider_id** **(** :ref:`int<class_int>` contact_idx **)** const
  186. .. _class_PhysicsDirectBodyState_get_contact_collider_object:
  187. - :ref:`Object<class_Object>` **get_contact_collider_object** **(** :ref:`int<class_int>` contact_idx **)** const
  188. .. _class_PhysicsDirectBodyState_get_contact_collider_position:
  189. - :ref:`Vector3<class_Vector3>` **get_contact_collider_position** **(** :ref:`int<class_int>` contact_idx **)** const
  190. .. _class_PhysicsDirectBodyState_get_contact_collider_shape:
  191. - :ref:`int<class_int>` **get_contact_collider_shape** **(** :ref:`int<class_int>` contact_idx **)** const
  192. .. _class_PhysicsDirectBodyState_get_contact_collider_velocity_at_position:
  193. - :ref:`Vector3<class_Vector3>` **get_contact_collider_velocity_at_position** **(** :ref:`int<class_int>` contact_idx **)** const
  194. .. _class_PhysicsDirectBodyState_get_contact_count:
  195. - :ref:`int<class_int>` **get_contact_count** **(** **)** const
  196. .. _class_PhysicsDirectBodyState_get_contact_impulse:
  197. - :ref:`float<class_float>` **get_contact_impulse** **(** :ref:`int<class_int>` contact_idx **)** const
  198. Impulse created by the contact. Only implemented for Bullet physics.
  199. .. _class_PhysicsDirectBodyState_get_contact_local_normal:
  200. - :ref:`Vector3<class_Vector3>` **get_contact_local_normal** **(** :ref:`int<class_int>` contact_idx **)** const
  201. .. _class_PhysicsDirectBodyState_get_contact_local_position:
  202. - :ref:`Vector3<class_Vector3>` **get_contact_local_position** **(** :ref:`int<class_int>` contact_idx **)** const
  203. .. _class_PhysicsDirectBodyState_get_contact_local_shape:
  204. - :ref:`int<class_int>` **get_contact_local_shape** **(** :ref:`int<class_int>` contact_idx **)** const
  205. .. _class_PhysicsDirectBodyState_get_space_state:
  206. - :ref:`PhysicsDirectSpaceState<class_PhysicsDirectSpaceState>` **get_space_state** **(** **)**
  207. .. _class_PhysicsDirectBodyState_integrate_forces:
  208. - void **integrate_forces** **(** **)**