class_physicsdirectbodystate3d.rst 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/PhysicsDirectBodyState3D.xml.
  6. .. _class_PhysicsDirectBodyState3D:
  7. PhysicsDirectBodyState3D
  8. ========================
  9. **Inherits:** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`PhysicsDirectBodyState3DExtension<class_PhysicsDirectBodyState3DExtension>`
  11. Direct access object to a physics body in the :ref:`PhysicsServer3D<class_PhysicsServer3D>`.
  12. Description
  13. -----------
  14. Provides direct access to a physics body in the :ref:`PhysicsServer3D<class_PhysicsServer3D>`, allowing safe changes to physics properties. This object is passed via the direct state callback of dynamic bodies, and is intended for changing the direct state of that body. See :ref:`RigidDynamicBody3D._integrate_forces<class_RigidDynamicBody3D_method__integrate_forces>`.
  15. Tutorials
  16. ---------
  17. - :doc:`Physics introduction <../tutorials/physics/physics_introduction>`
  18. - :doc:`Ray-casting <../tutorials/physics/ray-casting>`
  19. Properties
  20. ----------
  21. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  22. | :ref:`Vector3<class_Vector3>` | :ref:`angular_velocity<class_PhysicsDirectBodyState3D_property_angular_velocity>` |
  23. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  24. | :ref:`Vector3<class_Vector3>` | :ref:`center_of_mass<class_PhysicsDirectBodyState3D_property_center_of_mass>` |
  25. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  26. | :ref:`Vector3<class_Vector3>` | :ref:`center_of_mass_local<class_PhysicsDirectBodyState3D_property_center_of_mass_local>` |
  27. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  28. | :ref:`Vector3<class_Vector3>` | :ref:`inverse_inertia<class_PhysicsDirectBodyState3D_property_inverse_inertia>` |
  29. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`inverse_mass<class_PhysicsDirectBodyState3D_property_inverse_mass>` |
  31. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  32. | :ref:`Vector3<class_Vector3>` | :ref:`linear_velocity<class_PhysicsDirectBodyState3D_property_linear_velocity>` |
  33. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  34. | :ref:`Basis<class_Basis>` | :ref:`principal_inertia_axes<class_PhysicsDirectBodyState3D_property_principal_inertia_axes>` |
  35. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  36. | :ref:`bool<class_bool>` | :ref:`sleeping<class_PhysicsDirectBodyState3D_property_sleeping>` |
  37. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`step<class_PhysicsDirectBodyState3D_property_step>` |
  39. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  40. | :ref:`float<class_float>` | :ref:`total_angular_damp<class_PhysicsDirectBodyState3D_property_total_angular_damp>` |
  41. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  42. | :ref:`Vector3<class_Vector3>` | :ref:`total_gravity<class_PhysicsDirectBodyState3D_property_total_gravity>` |
  43. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  44. | :ref:`float<class_float>` | :ref:`total_linear_damp<class_PhysicsDirectBodyState3D_property_total_linear_damp>` |
  45. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  46. | :ref:`Transform3D<class_Transform3D>` | :ref:`transform<class_PhysicsDirectBodyState3D_property_transform>` |
  47. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  48. Methods
  49. -------
  50. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`add_constant_central_force<class_PhysicsDirectBodyState3D_method_add_constant_central_force>` **(** :ref:`Vector3<class_Vector3>` force=Vector3(0, 0, 0) **)** |
  52. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`add_constant_force<class_PhysicsDirectBodyState3D_method_add_constant_force>` **(** :ref:`Vector3<class_Vector3>` force, :ref:`Vector3<class_Vector3>` position=Vector3(0, 0, 0) **)** |
  54. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | void | :ref:`add_constant_torque<class_PhysicsDirectBodyState3D_method_add_constant_torque>` **(** :ref:`Vector3<class_Vector3>` torque **)** |
  56. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`apply_central_force<class_PhysicsDirectBodyState3D_method_apply_central_force>` **(** :ref:`Vector3<class_Vector3>` force=Vector3(0, 0, 0) **)** |
  58. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`apply_central_impulse<class_PhysicsDirectBodyState3D_method_apply_central_impulse>` **(** :ref:`Vector3<class_Vector3>` impulse=Vector3(0, 0, 0) **)** |
  60. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | void | :ref:`apply_force<class_PhysicsDirectBodyState3D_method_apply_force>` **(** :ref:`Vector3<class_Vector3>` force, :ref:`Vector3<class_Vector3>` position=Vector3(0, 0, 0) **)** |
  62. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`apply_impulse<class_PhysicsDirectBodyState3D_method_apply_impulse>` **(** :ref:`Vector3<class_Vector3>` impulse, :ref:`Vector3<class_Vector3>` position=Vector3(0, 0, 0) **)** |
  64. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | void | :ref:`apply_torque<class_PhysicsDirectBodyState3D_method_apply_torque>` **(** :ref:`Vector3<class_Vector3>` torque **)** |
  66. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`apply_torque_impulse<class_PhysicsDirectBodyState3D_method_apply_torque_impulse>` **(** :ref:`Vector3<class_Vector3>` impulse **)** |
  68. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`Vector3<class_Vector3>` | :ref:`get_constant_force<class_PhysicsDirectBodyState3D_method_get_constant_force>` **(** **)** |const| |
  70. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`Vector3<class_Vector3>` | :ref:`get_constant_torque<class_PhysicsDirectBodyState3D_method_get_constant_torque>` **(** **)** |const| |
  72. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`RID<class_RID>` | :ref:`get_contact_collider<class_PhysicsDirectBodyState3D_method_get_contact_collider>` **(** :ref:`int<class_int>` contact_idx **)** |const| |
  74. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`int<class_int>` | :ref:`get_contact_collider_id<class_PhysicsDirectBodyState3D_method_get_contact_collider_id>` **(** :ref:`int<class_int>` contact_idx **)** |const| |
  76. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`Object<class_Object>` | :ref:`get_contact_collider_object<class_PhysicsDirectBodyState3D_method_get_contact_collider_object>` **(** :ref:`int<class_int>` contact_idx **)** |const| |
  78. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`Vector3<class_Vector3>` | :ref:`get_contact_collider_position<class_PhysicsDirectBodyState3D_method_get_contact_collider_position>` **(** :ref:`int<class_int>` contact_idx **)** |const| |
  80. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`int<class_int>` | :ref:`get_contact_collider_shape<class_PhysicsDirectBodyState3D_method_get_contact_collider_shape>` **(** :ref:`int<class_int>` contact_idx **)** |const| |
  82. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`Vector3<class_Vector3>` | :ref:`get_contact_collider_velocity_at_position<class_PhysicsDirectBodyState3D_method_get_contact_collider_velocity_at_position>` **(** :ref:`int<class_int>` contact_idx **)** |const| |
  84. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`int<class_int>` | :ref:`get_contact_count<class_PhysicsDirectBodyState3D_method_get_contact_count>` **(** **)** |const| |
  86. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`float<class_float>` | :ref:`get_contact_impulse<class_PhysicsDirectBodyState3D_method_get_contact_impulse>` **(** :ref:`int<class_int>` contact_idx **)** |const| |
  88. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`Vector3<class_Vector3>` | :ref:`get_contact_local_normal<class_PhysicsDirectBodyState3D_method_get_contact_local_normal>` **(** :ref:`int<class_int>` contact_idx **)** |const| |
  90. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`Vector3<class_Vector3>` | :ref:`get_contact_local_position<class_PhysicsDirectBodyState3D_method_get_contact_local_position>` **(** :ref:`int<class_int>` contact_idx **)** |const| |
  92. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`int<class_int>` | :ref:`get_contact_local_shape<class_PhysicsDirectBodyState3D_method_get_contact_local_shape>` **(** :ref:`int<class_int>` contact_idx **)** |const| |
  94. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`PhysicsDirectSpaceState3D<class_PhysicsDirectSpaceState3D>` | :ref:`get_space_state<class_PhysicsDirectBodyState3D_method_get_space_state>` **(** **)** |
  96. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`Vector3<class_Vector3>` | :ref:`get_velocity_at_local_position<class_PhysicsDirectBodyState3D_method_get_velocity_at_local_position>` **(** :ref:`Vector3<class_Vector3>` local_position **)** |const| |
  98. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | void | :ref:`integrate_forces<class_PhysicsDirectBodyState3D_method_integrate_forces>` **(** **)** |
  100. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | void | :ref:`set_constant_force<class_PhysicsDirectBodyState3D_method_set_constant_force>` **(** :ref:`Vector3<class_Vector3>` force **)** |
  102. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`set_constant_torque<class_PhysicsDirectBodyState3D_method_set_constant_torque>` **(** :ref:`Vector3<class_Vector3>` torque **)** |
  104. +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. Property Descriptions
  106. ---------------------
  107. .. _class_PhysicsDirectBodyState3D_property_angular_velocity:
  108. - :ref:`Vector3<class_Vector3>` **angular_velocity**
  109. +----------+-----------------------------+
  110. | *Setter* | set_angular_velocity(value) |
  111. +----------+-----------------------------+
  112. | *Getter* | get_angular_velocity() |
  113. +----------+-----------------------------+
  114. The body's rotational velocity in *radians* per second.
  115. ----
  116. .. _class_PhysicsDirectBodyState3D_property_center_of_mass:
  117. - :ref:`Vector3<class_Vector3>` **center_of_mass**
  118. +----------+----------------------+
  119. | *Getter* | get_center_of_mass() |
  120. +----------+----------------------+
  121. The body's center of mass position relative to the body's center in the global coordinate system.
  122. ----
  123. .. _class_PhysicsDirectBodyState3D_property_center_of_mass_local:
  124. - :ref:`Vector3<class_Vector3>` **center_of_mass_local**
  125. +----------+----------------------------+
  126. | *Getter* | get_center_of_mass_local() |
  127. +----------+----------------------------+
  128. The body's center of mass position in the body's local coordinate system.
  129. ----
  130. .. _class_PhysicsDirectBodyState3D_property_inverse_inertia:
  131. - :ref:`Vector3<class_Vector3>` **inverse_inertia**
  132. +----------+-----------------------+
  133. | *Getter* | get_inverse_inertia() |
  134. +----------+-----------------------+
  135. The inverse of the inertia of the body.
  136. ----
  137. .. _class_PhysicsDirectBodyState3D_property_inverse_mass:
  138. - :ref:`float<class_float>` **inverse_mass**
  139. +----------+--------------------+
  140. | *Getter* | get_inverse_mass() |
  141. +----------+--------------------+
  142. The inverse of the mass of the body.
  143. ----
  144. .. _class_PhysicsDirectBodyState3D_property_linear_velocity:
  145. - :ref:`Vector3<class_Vector3>` **linear_velocity**
  146. +----------+----------------------------+
  147. | *Setter* | set_linear_velocity(value) |
  148. +----------+----------------------------+
  149. | *Getter* | get_linear_velocity() |
  150. +----------+----------------------------+
  151. The body's linear velocity in units per second.
  152. ----
  153. .. _class_PhysicsDirectBodyState3D_property_principal_inertia_axes:
  154. - :ref:`Basis<class_Basis>` **principal_inertia_axes**
  155. +----------+------------------------------+
  156. | *Getter* | get_principal_inertia_axes() |
  157. +----------+------------------------------+
  158. ----
  159. .. _class_PhysicsDirectBodyState3D_property_sleeping:
  160. - :ref:`bool<class_bool>` **sleeping**
  161. +----------+------------------------+
  162. | *Setter* | set_sleep_state(value) |
  163. +----------+------------------------+
  164. | *Getter* | is_sleeping() |
  165. +----------+------------------------+
  166. If ``true``, this body is currently sleeping (not active).
  167. ----
  168. .. _class_PhysicsDirectBodyState3D_property_step:
  169. - :ref:`float<class_float>` **step**
  170. +----------+------------+
  171. | *Getter* | get_step() |
  172. +----------+------------+
  173. The timestep (delta) used for the simulation.
  174. ----
  175. .. _class_PhysicsDirectBodyState3D_property_total_angular_damp:
  176. - :ref:`float<class_float>` **total_angular_damp**
  177. +----------+--------------------------+
  178. | *Getter* | get_total_angular_damp() |
  179. +----------+--------------------------+
  180. The rate at which the body stops rotating, if there are not any other forces moving it.
  181. ----
  182. .. _class_PhysicsDirectBodyState3D_property_total_gravity:
  183. - :ref:`Vector3<class_Vector3>` **total_gravity**
  184. +----------+---------------------+
  185. | *Getter* | get_total_gravity() |
  186. +----------+---------------------+
  187. The total gravity vector being currently applied to this body.
  188. ----
  189. .. _class_PhysicsDirectBodyState3D_property_total_linear_damp:
  190. - :ref:`float<class_float>` **total_linear_damp**
  191. +----------+-------------------------+
  192. | *Getter* | get_total_linear_damp() |
  193. +----------+-------------------------+
  194. The rate at which the body stops moving, if there are not any other forces moving it.
  195. ----
  196. .. _class_PhysicsDirectBodyState3D_property_transform:
  197. - :ref:`Transform3D<class_Transform3D>` **transform**
  198. +----------+----------------------+
  199. | *Setter* | set_transform(value) |
  200. +----------+----------------------+
  201. | *Getter* | get_transform() |
  202. +----------+----------------------+
  203. The body's transformation matrix.
  204. Method Descriptions
  205. -------------------
  206. .. _class_PhysicsDirectBodyState3D_method_add_constant_central_force:
  207. - void **add_constant_central_force** **(** :ref:`Vector3<class_Vector3>` force=Vector3(0, 0, 0) **)**
  208. Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with ``constant_force = Vector3(0, 0, 0)``.
  209. This is equivalent to using :ref:`add_constant_force<class_PhysicsDirectBodyState3D_method_add_constant_force>` at the body's center of mass.
  210. ----
  211. .. _class_PhysicsDirectBodyState3D_method_add_constant_force:
  212. - void **add_constant_force** **(** :ref:`Vector3<class_Vector3>` force, :ref:`Vector3<class_Vector3>` position=Vector3(0, 0, 0) **)**
  213. Adds a constant positioned force to the body that keeps being applied over time until cleared with ``constant_force = Vector3(0, 0, 0)``.
  214. \ ``position`` is the offset from the body origin in global coordinates.
  215. ----
  216. .. _class_PhysicsDirectBodyState3D_method_add_constant_torque:
  217. - void **add_constant_torque** **(** :ref:`Vector3<class_Vector3>` torque **)**
  218. Adds a constant rotational force without affecting position that keeps being applied over time until cleared with ``constant_torque = Vector3(0, 0, 0)``.
  219. ----
  220. .. _class_PhysicsDirectBodyState3D_method_apply_central_force:
  221. - void **apply_central_force** **(** :ref:`Vector3<class_Vector3>` force=Vector3(0, 0, 0) **)**
  222. Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update.
  223. This is equivalent to using :ref:`apply_force<class_PhysicsDirectBodyState3D_method_apply_force>` at the body's center of mass.
  224. ----
  225. .. _class_PhysicsDirectBodyState3D_method_apply_central_impulse:
  226. - void **apply_central_impulse** **(** :ref:`Vector3<class_Vector3>` impulse=Vector3(0, 0, 0) **)**
  227. Applies a directional impulse without affecting rotation.
  228. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
  229. This is equivalent to using :ref:`apply_impulse<class_PhysicsDirectBodyState3D_method_apply_impulse>` at the body's center of mass.
  230. ----
  231. .. _class_PhysicsDirectBodyState3D_method_apply_force:
  232. - void **apply_force** **(** :ref:`Vector3<class_Vector3>` force, :ref:`Vector3<class_Vector3>` position=Vector3(0, 0, 0) **)**
  233. Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update.
  234. \ ``position`` is the offset from the body origin in global coordinates.
  235. ----
  236. .. _class_PhysicsDirectBodyState3D_method_apply_impulse:
  237. - void **apply_impulse** **(** :ref:`Vector3<class_Vector3>` impulse, :ref:`Vector3<class_Vector3>` position=Vector3(0, 0, 0) **)**
  238. Applies a positioned impulse to the body.
  239. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
  240. \ ``position`` is the offset from the body origin in global coordinates.
  241. ----
  242. .. _class_PhysicsDirectBodyState3D_method_apply_torque:
  243. - void **apply_torque** **(** :ref:`Vector3<class_Vector3>` torque **)**
  244. Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update.
  245. ----
  246. .. _class_PhysicsDirectBodyState3D_method_apply_torque_impulse:
  247. - void **apply_torque_impulse** **(** :ref:`Vector3<class_Vector3>` impulse **)**
  248. Applies a rotational impulse to the body without affecting the position.
  249. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise).
  250. ----
  251. .. _class_PhysicsDirectBodyState3D_method_get_constant_force:
  252. - :ref:`Vector3<class_Vector3>` **get_constant_force** **(** **)** |const|
  253. Returns the body's total constant positional forces applied during each physics update.
  254. See :ref:`add_constant_force<class_PhysicsDirectBodyState3D_method_add_constant_force>` and :ref:`add_constant_central_force<class_PhysicsDirectBodyState3D_method_add_constant_central_force>`.
  255. ----
  256. .. _class_PhysicsDirectBodyState3D_method_get_constant_torque:
  257. - :ref:`Vector3<class_Vector3>` **get_constant_torque** **(** **)** |const|
  258. Returns the body's total constant rotational forces applied during each physics update.
  259. See :ref:`add_constant_torque<class_PhysicsDirectBodyState3D_method_add_constant_torque>`.
  260. ----
  261. .. _class_PhysicsDirectBodyState3D_method_get_contact_collider:
  262. - :ref:`RID<class_RID>` **get_contact_collider** **(** :ref:`int<class_int>` contact_idx **)** |const|
  263. Returns the collider's :ref:`RID<class_RID>`.
  264. ----
  265. .. _class_PhysicsDirectBodyState3D_method_get_contact_collider_id:
  266. - :ref:`int<class_int>` **get_contact_collider_id** **(** :ref:`int<class_int>` contact_idx **)** |const|
  267. Returns the collider's object id.
  268. ----
  269. .. _class_PhysicsDirectBodyState3D_method_get_contact_collider_object:
  270. - :ref:`Object<class_Object>` **get_contact_collider_object** **(** :ref:`int<class_int>` contact_idx **)** |const|
  271. Returns the collider object.
  272. ----
  273. .. _class_PhysicsDirectBodyState3D_method_get_contact_collider_position:
  274. - :ref:`Vector3<class_Vector3>` **get_contact_collider_position** **(** :ref:`int<class_int>` contact_idx **)** |const|
  275. Returns the contact position in the collider.
  276. ----
  277. .. _class_PhysicsDirectBodyState3D_method_get_contact_collider_shape:
  278. - :ref:`int<class_int>` **get_contact_collider_shape** **(** :ref:`int<class_int>` contact_idx **)** |const|
  279. Returns the collider's shape index.
  280. ----
  281. .. _class_PhysicsDirectBodyState3D_method_get_contact_collider_velocity_at_position:
  282. - :ref:`Vector3<class_Vector3>` **get_contact_collider_velocity_at_position** **(** :ref:`int<class_int>` contact_idx **)** |const|
  283. Returns the linear velocity vector at the collider's contact point.
  284. ----
  285. .. _class_PhysicsDirectBodyState3D_method_get_contact_count:
  286. - :ref:`int<class_int>` **get_contact_count** **(** **)** |const|
  287. Returns the number of contacts this body has with other bodies.
  288. \ **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See :ref:`RigidDynamicBody3D.contact_monitor<class_RigidDynamicBody3D_property_contact_monitor>`.
  289. ----
  290. .. _class_PhysicsDirectBodyState3D_method_get_contact_impulse:
  291. - :ref:`float<class_float>` **get_contact_impulse** **(** :ref:`int<class_int>` contact_idx **)** |const|
  292. Impulse created by the contact. Only implemented for Bullet physics.
  293. ----
  294. .. _class_PhysicsDirectBodyState3D_method_get_contact_local_normal:
  295. - :ref:`Vector3<class_Vector3>` **get_contact_local_normal** **(** :ref:`int<class_int>` contact_idx **)** |const|
  296. Returns the local normal at the contact point.
  297. ----
  298. .. _class_PhysicsDirectBodyState3D_method_get_contact_local_position:
  299. - :ref:`Vector3<class_Vector3>` **get_contact_local_position** **(** :ref:`int<class_int>` contact_idx **)** |const|
  300. Returns the local position of the contact point.
  301. ----
  302. .. _class_PhysicsDirectBodyState3D_method_get_contact_local_shape:
  303. - :ref:`int<class_int>` **get_contact_local_shape** **(** :ref:`int<class_int>` contact_idx **)** |const|
  304. Returns the local shape index of the collision.
  305. ----
  306. .. _class_PhysicsDirectBodyState3D_method_get_space_state:
  307. - :ref:`PhysicsDirectSpaceState3D<class_PhysicsDirectSpaceState3D>` **get_space_state** **(** **)**
  308. Returns the current state of the space, useful for queries.
  309. ----
  310. .. _class_PhysicsDirectBodyState3D_method_get_velocity_at_local_position:
  311. - :ref:`Vector3<class_Vector3>` **get_velocity_at_local_position** **(** :ref:`Vector3<class_Vector3>` local_position **)** |const|
  312. Returns the body's velocity at the given relative position, including both translation and rotation.
  313. ----
  314. .. _class_PhysicsDirectBodyState3D_method_integrate_forces:
  315. - void **integrate_forces** **(** **)**
  316. Calls the built-in force integration code.
  317. ----
  318. .. _class_PhysicsDirectBodyState3D_method_set_constant_force:
  319. - void **set_constant_force** **(** :ref:`Vector3<class_Vector3>` force **)**
  320. Sets the body's total constant positional forces applied during each physics update.
  321. See :ref:`add_constant_force<class_PhysicsDirectBodyState3D_method_add_constant_force>` and :ref:`add_constant_central_force<class_PhysicsDirectBodyState3D_method_add_constant_central_force>`.
  322. ----
  323. .. _class_PhysicsDirectBodyState3D_method_set_constant_torque:
  324. - void **set_constant_torque** **(** :ref:`Vector3<class_Vector3>` torque **)**
  325. Sets the body's total constant rotational forces applied during each physics update.
  326. See :ref:`add_constant_torque<class_PhysicsDirectBodyState3D_method_add_constant_torque>`.
  327. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  328. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  329. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  330. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  331. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  332. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`