class_physicalbone3d.rst 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. :github_url: hide
  2. .. meta::
  3. :keywords: ragdoll
  4. .. DO NOT EDIT THIS FILE!!!
  5. .. Generated automatically from Godot engine sources.
  6. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  7. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/PhysicalBone3D.xml.
  8. .. _class_PhysicalBone3D:
  9. PhysicalBone3D
  10. ==============
  11. **Inherits:** :ref:`PhysicsBody3D<class_PhysicsBody3D>` **<** :ref:`CollisionObject3D<class_CollisionObject3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  12. A physics body used to make bones in a :ref:`Skeleton3D<class_Skeleton3D>` react to physics.
  13. .. rst-class:: classref-introduction-group
  14. Description
  15. -----------
  16. The **PhysicalBone3D** node is a physics body that can be used to make bones in a :ref:`Skeleton3D<class_Skeleton3D>` react to physics.
  17. \ **Note:** In order to detect physical bones with raycasts, the :ref:`SkeletonModifier3D.active<class_SkeletonModifier3D_property_active>` property of the parent :ref:`PhysicalBoneSimulator3D<class_PhysicalBoneSimulator3D>` must be ``true`` and the :ref:`Skeleton3D<class_Skeleton3D>`'s bone must be assigned to **PhysicalBone3D** correctly; it means that :ref:`get_bone_id()<class_PhysicalBone3D_method_get_bone_id>` should return a valid id (``>= 0``).
  18. .. rst-class:: classref-introduction-group
  19. Tutorials
  20. ---------
  21. - :doc:`Ragdoll System <../tutorials/physics/ragdoll_system>`
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`angular_damp<class_PhysicalBone3D_property_angular_damp>` | ``0.0`` |
  29. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  30. | :ref:`DampMode<enum_PhysicalBone3D_DampMode>` | :ref:`angular_damp_mode<class_PhysicalBone3D_property_angular_damp_mode>` | ``0`` |
  31. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  32. | :ref:`Vector3<class_Vector3>` | :ref:`angular_velocity<class_PhysicalBone3D_property_angular_velocity>` | ``Vector3(0, 0, 0)`` |
  33. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  34. | :ref:`Transform3D<class_Transform3D>` | :ref:`body_offset<class_PhysicalBone3D_property_body_offset>` | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` |
  35. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  36. | :ref:`float<class_float>` | :ref:`bounce<class_PhysicalBone3D_property_bounce>` | ``0.0`` |
  37. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  38. | :ref:`bool<class_bool>` | :ref:`can_sleep<class_PhysicalBone3D_property_can_sleep>` | ``true`` |
  39. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  40. | :ref:`bool<class_bool>` | :ref:`custom_integrator<class_PhysicalBone3D_property_custom_integrator>` | ``false`` |
  41. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  42. | :ref:`float<class_float>` | :ref:`friction<class_PhysicalBone3D_property_friction>` | ``1.0`` |
  43. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  44. | :ref:`float<class_float>` | :ref:`gravity_scale<class_PhysicalBone3D_property_gravity_scale>` | ``1.0`` |
  45. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  46. | :ref:`Transform3D<class_Transform3D>` | :ref:`joint_offset<class_PhysicalBone3D_property_joint_offset>` | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` |
  47. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  48. | :ref:`Vector3<class_Vector3>` | :ref:`joint_rotation<class_PhysicalBone3D_property_joint_rotation>` | ``Vector3(0, 0, 0)`` |
  49. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  50. | :ref:`JointType<enum_PhysicalBone3D_JointType>` | :ref:`joint_type<class_PhysicalBone3D_property_joint_type>` | ``0`` |
  51. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  52. | :ref:`float<class_float>` | :ref:`linear_damp<class_PhysicalBone3D_property_linear_damp>` | ``0.0`` |
  53. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  54. | :ref:`DampMode<enum_PhysicalBone3D_DampMode>` | :ref:`linear_damp_mode<class_PhysicalBone3D_property_linear_damp_mode>` | ``0`` |
  55. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  56. | :ref:`Vector3<class_Vector3>` | :ref:`linear_velocity<class_PhysicalBone3D_property_linear_velocity>` | ``Vector3(0, 0, 0)`` |
  57. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  58. | :ref:`float<class_float>` | :ref:`mass<class_PhysicalBone3D_property_mass>` | ``1.0`` |
  59. +-------------------------------------------------+---------------------------------------------------------------------------+-----------------------------------------------------+
  60. .. rst-class:: classref-reftable-group
  61. Methods
  62. -------
  63. .. table::
  64. :widths: auto
  65. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | |void| | :ref:`_integrate_forces<class_PhysicalBone3D_private_method__integrate_forces>`\ (\ state\: :ref:`PhysicsDirectBodyState3D<class_PhysicsDirectBodyState3D>`\ ) |virtual| |
  67. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | |void| | :ref:`apply_central_impulse<class_PhysicalBone3D_method_apply_central_impulse>`\ (\ impulse\: :ref:`Vector3<class_Vector3>`\ ) |
  69. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | |void| | :ref:`apply_impulse<class_PhysicalBone3D_method_apply_impulse>`\ (\ impulse\: :ref:`Vector3<class_Vector3>`, position\: :ref:`Vector3<class_Vector3>` = Vector3(0, 0, 0)\ ) |
  71. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`int<class_int>` | :ref:`get_bone_id<class_PhysicalBone3D_method_get_bone_id>`\ (\ ) |const| |
  73. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`bool<class_bool>` | :ref:`get_simulate_physics<class_PhysicalBone3D_method_get_simulate_physics>`\ (\ ) |
  75. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`bool<class_bool>` | :ref:`is_simulating_physics<class_PhysicalBone3D_method_is_simulating_physics>`\ (\ ) |
  77. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. .. rst-class:: classref-section-separator
  79. ----
  80. .. rst-class:: classref-descriptions-group
  81. Enumerations
  82. ------------
  83. .. _enum_PhysicalBone3D_DampMode:
  84. .. rst-class:: classref-enumeration
  85. enum **DampMode**: :ref:`🔗<enum_PhysicalBone3D_DampMode>`
  86. .. _class_PhysicalBone3D_constant_DAMP_MODE_COMBINE:
  87. .. rst-class:: classref-enumeration-constant
  88. :ref:`DampMode<enum_PhysicalBone3D_DampMode>` **DAMP_MODE_COMBINE** = ``0``
  89. In this mode, the body's damping value is added to any value set in areas or the default value.
  90. .. _class_PhysicalBone3D_constant_DAMP_MODE_REPLACE:
  91. .. rst-class:: classref-enumeration-constant
  92. :ref:`DampMode<enum_PhysicalBone3D_DampMode>` **DAMP_MODE_REPLACE** = ``1``
  93. In this mode, the body's damping value replaces any value set in areas or the default value.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _enum_PhysicalBone3D_JointType:
  97. .. rst-class:: classref-enumeration
  98. enum **JointType**: :ref:`🔗<enum_PhysicalBone3D_JointType>`
  99. .. _class_PhysicalBone3D_constant_JOINT_TYPE_NONE:
  100. .. rst-class:: classref-enumeration-constant
  101. :ref:`JointType<enum_PhysicalBone3D_JointType>` **JOINT_TYPE_NONE** = ``0``
  102. No joint is applied to the PhysicsBone3D.
  103. .. _class_PhysicalBone3D_constant_JOINT_TYPE_PIN:
  104. .. rst-class:: classref-enumeration-constant
  105. :ref:`JointType<enum_PhysicalBone3D_JointType>` **JOINT_TYPE_PIN** = ``1``
  106. A pin joint is applied to the PhysicsBone3D.
  107. .. _class_PhysicalBone3D_constant_JOINT_TYPE_CONE:
  108. .. rst-class:: classref-enumeration-constant
  109. :ref:`JointType<enum_PhysicalBone3D_JointType>` **JOINT_TYPE_CONE** = ``2``
  110. A cone joint is applied to the PhysicsBone3D.
  111. .. _class_PhysicalBone3D_constant_JOINT_TYPE_HINGE:
  112. .. rst-class:: classref-enumeration-constant
  113. :ref:`JointType<enum_PhysicalBone3D_JointType>` **JOINT_TYPE_HINGE** = ``3``
  114. A hinge joint is applied to the PhysicsBone3D.
  115. .. _class_PhysicalBone3D_constant_JOINT_TYPE_SLIDER:
  116. .. rst-class:: classref-enumeration-constant
  117. :ref:`JointType<enum_PhysicalBone3D_JointType>` **JOINT_TYPE_SLIDER** = ``4``
  118. A slider joint is applied to the PhysicsBone3D.
  119. .. _class_PhysicalBone3D_constant_JOINT_TYPE_6DOF:
  120. .. rst-class:: classref-enumeration-constant
  121. :ref:`JointType<enum_PhysicalBone3D_JointType>` **JOINT_TYPE_6DOF** = ``5``
  122. A 6 degrees of freedom joint is applied to the PhysicsBone3D.
  123. .. rst-class:: classref-section-separator
  124. ----
  125. .. rst-class:: classref-descriptions-group
  126. Property Descriptions
  127. ---------------------
  128. .. _class_PhysicalBone3D_property_angular_damp:
  129. .. rst-class:: classref-property
  130. :ref:`float<class_float>` **angular_damp** = ``0.0`` :ref:`🔗<class_PhysicalBone3D_property_angular_damp>`
  131. .. rst-class:: classref-property-setget
  132. - |void| **set_angular_damp**\ (\ value\: :ref:`float<class_float>`\ )
  133. - :ref:`float<class_float>` **get_angular_damp**\ (\ )
  134. Damps the body's rotation. By default, the body will use the :ref:`ProjectSettings.physics/3d/default_angular_damp<class_ProjectSettings_property_physics/3d/default_angular_damp>` project setting or any value override set by an :ref:`Area3D<class_Area3D>` the body is in. Depending on :ref:`angular_damp_mode<class_PhysicalBone3D_property_angular_damp_mode>`, you can set :ref:`angular_damp<class_PhysicalBone3D_property_angular_damp>` to be added to or to replace the body's damping value.
  135. See :ref:`ProjectSettings.physics/3d/default_angular_damp<class_ProjectSettings_property_physics/3d/default_angular_damp>` for more details about damping.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_PhysicalBone3D_property_angular_damp_mode:
  139. .. rst-class:: classref-property
  140. :ref:`DampMode<enum_PhysicalBone3D_DampMode>` **angular_damp_mode** = ``0`` :ref:`🔗<class_PhysicalBone3D_property_angular_damp_mode>`
  141. .. rst-class:: classref-property-setget
  142. - |void| **set_angular_damp_mode**\ (\ value\: :ref:`DampMode<enum_PhysicalBone3D_DampMode>`\ )
  143. - :ref:`DampMode<enum_PhysicalBone3D_DampMode>` **get_angular_damp_mode**\ (\ )
  144. Defines how :ref:`angular_damp<class_PhysicalBone3D_property_angular_damp>` is applied.
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_PhysicalBone3D_property_angular_velocity:
  148. .. rst-class:: classref-property
  149. :ref:`Vector3<class_Vector3>` **angular_velocity** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_PhysicalBone3D_property_angular_velocity>`
  150. .. rst-class:: classref-property-setget
  151. - |void| **set_angular_velocity**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  152. - :ref:`Vector3<class_Vector3>` **get_angular_velocity**\ (\ )
  153. The PhysicalBone3D's rotational velocity in *radians* per second.
  154. .. rst-class:: classref-item-separator
  155. ----
  156. .. _class_PhysicalBone3D_property_body_offset:
  157. .. rst-class:: classref-property
  158. :ref:`Transform3D<class_Transform3D>` **body_offset** = ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` :ref:`🔗<class_PhysicalBone3D_property_body_offset>`
  159. .. rst-class:: classref-property-setget
  160. - |void| **set_body_offset**\ (\ value\: :ref:`Transform3D<class_Transform3D>`\ )
  161. - :ref:`Transform3D<class_Transform3D>` **get_body_offset**\ (\ )
  162. Sets the body's transform.
  163. .. rst-class:: classref-item-separator
  164. ----
  165. .. _class_PhysicalBone3D_property_bounce:
  166. .. rst-class:: classref-property
  167. :ref:`float<class_float>` **bounce** = ``0.0`` :ref:`🔗<class_PhysicalBone3D_property_bounce>`
  168. .. rst-class:: classref-property-setget
  169. - |void| **set_bounce**\ (\ value\: :ref:`float<class_float>`\ )
  170. - :ref:`float<class_float>` **get_bounce**\ (\ )
  171. The body's bounciness. Values range from ``0`` (no bounce) to ``1`` (full bounciness).
  172. \ **Note:** Even with :ref:`bounce<class_PhysicalBone3D_property_bounce>` set to ``1.0``, some energy will be lost over time due to linear and angular damping. To have a **PhysicalBone3D** that preserves all its energy over time, set :ref:`bounce<class_PhysicalBone3D_property_bounce>` to ``1.0``, :ref:`linear_damp_mode<class_PhysicalBone3D_property_linear_damp_mode>` to :ref:`DAMP_MODE_REPLACE<class_PhysicalBone3D_constant_DAMP_MODE_REPLACE>`, :ref:`linear_damp<class_PhysicalBone3D_property_linear_damp>` to ``0.0``, :ref:`angular_damp_mode<class_PhysicalBone3D_property_angular_damp_mode>` to :ref:`DAMP_MODE_REPLACE<class_PhysicalBone3D_constant_DAMP_MODE_REPLACE>`, and :ref:`angular_damp<class_PhysicalBone3D_property_angular_damp>` to ``0.0``.
  173. .. rst-class:: classref-item-separator
  174. ----
  175. .. _class_PhysicalBone3D_property_can_sleep:
  176. .. rst-class:: classref-property
  177. :ref:`bool<class_bool>` **can_sleep** = ``true`` :ref:`🔗<class_PhysicalBone3D_property_can_sleep>`
  178. .. rst-class:: classref-property-setget
  179. - |void| **set_can_sleep**\ (\ value\: :ref:`bool<class_bool>`\ )
  180. - :ref:`bool<class_bool>` **is_able_to_sleep**\ (\ )
  181. If ``true``, the body is deactivated when there is no movement, so it will not take part in the simulation until it is awakened by an external force.
  182. .. rst-class:: classref-item-separator
  183. ----
  184. .. _class_PhysicalBone3D_property_custom_integrator:
  185. .. rst-class:: classref-property
  186. :ref:`bool<class_bool>` **custom_integrator** = ``false`` :ref:`🔗<class_PhysicalBone3D_property_custom_integrator>`
  187. .. rst-class:: classref-property-setget
  188. - |void| **set_use_custom_integrator**\ (\ value\: :ref:`bool<class_bool>`\ )
  189. - :ref:`bool<class_bool>` **is_using_custom_integrator**\ (\ )
  190. If ``true``, the standard force integration (like gravity or damping) will be disabled for this body. Other than collision response, the body will only move as determined by the :ref:`_integrate_forces()<class_PhysicalBone3D_private_method__integrate_forces>` method, if that virtual method is overridden.
  191. Setting this property will call the method :ref:`PhysicsServer3D.body_set_omit_force_integration()<class_PhysicsServer3D_method_body_set_omit_force_integration>` internally.
  192. .. rst-class:: classref-item-separator
  193. ----
  194. .. _class_PhysicalBone3D_property_friction:
  195. .. rst-class:: classref-property
  196. :ref:`float<class_float>` **friction** = ``1.0`` :ref:`🔗<class_PhysicalBone3D_property_friction>`
  197. .. rst-class:: classref-property-setget
  198. - |void| **set_friction**\ (\ value\: :ref:`float<class_float>`\ )
  199. - :ref:`float<class_float>` **get_friction**\ (\ )
  200. The body's friction, from ``0`` (frictionless) to ``1`` (max friction).
  201. .. rst-class:: classref-item-separator
  202. ----
  203. .. _class_PhysicalBone3D_property_gravity_scale:
  204. .. rst-class:: classref-property
  205. :ref:`float<class_float>` **gravity_scale** = ``1.0`` :ref:`🔗<class_PhysicalBone3D_property_gravity_scale>`
  206. .. rst-class:: classref-property-setget
  207. - |void| **set_gravity_scale**\ (\ value\: :ref:`float<class_float>`\ )
  208. - :ref:`float<class_float>` **get_gravity_scale**\ (\ )
  209. This is multiplied by :ref:`ProjectSettings.physics/3d/default_gravity<class_ProjectSettings_property_physics/3d/default_gravity>` to produce this body's gravity. For example, a value of ``1.0`` will apply normal gravity, ``2.0`` will apply double the gravity, and ``0.5`` will apply half the gravity to this body.
  210. .. rst-class:: classref-item-separator
  211. ----
  212. .. _class_PhysicalBone3D_property_joint_offset:
  213. .. rst-class:: classref-property
  214. :ref:`Transform3D<class_Transform3D>` **joint_offset** = ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` :ref:`🔗<class_PhysicalBone3D_property_joint_offset>`
  215. .. rst-class:: classref-property-setget
  216. - |void| **set_joint_offset**\ (\ value\: :ref:`Transform3D<class_Transform3D>`\ )
  217. - :ref:`Transform3D<class_Transform3D>` **get_joint_offset**\ (\ )
  218. Sets the joint's transform.
  219. .. rst-class:: classref-item-separator
  220. ----
  221. .. _class_PhysicalBone3D_property_joint_rotation:
  222. .. rst-class:: classref-property
  223. :ref:`Vector3<class_Vector3>` **joint_rotation** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_PhysicalBone3D_property_joint_rotation>`
  224. .. rst-class:: classref-property-setget
  225. - |void| **set_joint_rotation**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  226. - :ref:`Vector3<class_Vector3>` **get_joint_rotation**\ (\ )
  227. Sets the joint's rotation in radians.
  228. .. rst-class:: classref-item-separator
  229. ----
  230. .. _class_PhysicalBone3D_property_joint_type:
  231. .. rst-class:: classref-property
  232. :ref:`JointType<enum_PhysicalBone3D_JointType>` **joint_type** = ``0`` :ref:`🔗<class_PhysicalBone3D_property_joint_type>`
  233. .. rst-class:: classref-property-setget
  234. - |void| **set_joint_type**\ (\ value\: :ref:`JointType<enum_PhysicalBone3D_JointType>`\ )
  235. - :ref:`JointType<enum_PhysicalBone3D_JointType>` **get_joint_type**\ (\ )
  236. Sets the joint type.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_PhysicalBone3D_property_linear_damp:
  240. .. rst-class:: classref-property
  241. :ref:`float<class_float>` **linear_damp** = ``0.0`` :ref:`🔗<class_PhysicalBone3D_property_linear_damp>`
  242. .. rst-class:: classref-property-setget
  243. - |void| **set_linear_damp**\ (\ value\: :ref:`float<class_float>`\ )
  244. - :ref:`float<class_float>` **get_linear_damp**\ (\ )
  245. Damps the body's movement. By default, the body will use :ref:`ProjectSettings.physics/3d/default_linear_damp<class_ProjectSettings_property_physics/3d/default_linear_damp>` or any value override set by an :ref:`Area3D<class_Area3D>` the body is in. Depending on :ref:`linear_damp_mode<class_PhysicalBone3D_property_linear_damp_mode>`, :ref:`linear_damp<class_PhysicalBone3D_property_linear_damp>` may be added to or replace the body's damping value.
  246. See :ref:`ProjectSettings.physics/3d/default_linear_damp<class_ProjectSettings_property_physics/3d/default_linear_damp>` for more details about damping.
  247. .. rst-class:: classref-item-separator
  248. ----
  249. .. _class_PhysicalBone3D_property_linear_damp_mode:
  250. .. rst-class:: classref-property
  251. :ref:`DampMode<enum_PhysicalBone3D_DampMode>` **linear_damp_mode** = ``0`` :ref:`🔗<class_PhysicalBone3D_property_linear_damp_mode>`
  252. .. rst-class:: classref-property-setget
  253. - |void| **set_linear_damp_mode**\ (\ value\: :ref:`DampMode<enum_PhysicalBone3D_DampMode>`\ )
  254. - :ref:`DampMode<enum_PhysicalBone3D_DampMode>` **get_linear_damp_mode**\ (\ )
  255. Defines how :ref:`linear_damp<class_PhysicalBone3D_property_linear_damp>` is applied.
  256. .. rst-class:: classref-item-separator
  257. ----
  258. .. _class_PhysicalBone3D_property_linear_velocity:
  259. .. rst-class:: classref-property
  260. :ref:`Vector3<class_Vector3>` **linear_velocity** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_PhysicalBone3D_property_linear_velocity>`
  261. .. rst-class:: classref-property-setget
  262. - |void| **set_linear_velocity**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  263. - :ref:`Vector3<class_Vector3>` **get_linear_velocity**\ (\ )
  264. The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use :ref:`_integrate_forces()<class_PhysicalBone3D_private_method__integrate_forces>` as your process loop for precise control of the body state.
  265. .. rst-class:: classref-item-separator
  266. ----
  267. .. _class_PhysicalBone3D_property_mass:
  268. .. rst-class:: classref-property
  269. :ref:`float<class_float>` **mass** = ``1.0`` :ref:`🔗<class_PhysicalBone3D_property_mass>`
  270. .. rst-class:: classref-property-setget
  271. - |void| **set_mass**\ (\ value\: :ref:`float<class_float>`\ )
  272. - :ref:`float<class_float>` **get_mass**\ (\ )
  273. The body's mass.
  274. .. rst-class:: classref-section-separator
  275. ----
  276. .. rst-class:: classref-descriptions-group
  277. Method Descriptions
  278. -------------------
  279. .. _class_PhysicalBone3D_private_method__integrate_forces:
  280. .. rst-class:: classref-method
  281. |void| **_integrate_forces**\ (\ state\: :ref:`PhysicsDirectBodyState3D<class_PhysicsDirectBodyState3D>`\ ) |virtual| :ref:`🔗<class_PhysicalBone3D_private_method__integrate_forces>`
  282. Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it is called before the standard force integration, but the :ref:`custom_integrator<class_PhysicalBone3D_property_custom_integrator>` property allows you to disable the standard force integration and do fully custom force integration for a body.
  283. .. rst-class:: classref-item-separator
  284. ----
  285. .. _class_PhysicalBone3D_method_apply_central_impulse:
  286. .. rst-class:: classref-method
  287. |void| **apply_central_impulse**\ (\ impulse\: :ref:`Vector3<class_Vector3>`\ ) :ref:`🔗<class_PhysicalBone3D_method_apply_central_impulse>`
  288. Applies a directional impulse without affecting rotation.
  289. 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 "_integrate_forces" functions otherwise).
  290. This is equivalent to using :ref:`apply_impulse()<class_PhysicalBone3D_method_apply_impulse>` at the body's center of mass.
  291. .. rst-class:: classref-item-separator
  292. ----
  293. .. _class_PhysicalBone3D_method_apply_impulse:
  294. .. rst-class:: classref-method
  295. |void| **apply_impulse**\ (\ impulse\: :ref:`Vector3<class_Vector3>`, position\: :ref:`Vector3<class_Vector3>` = Vector3(0, 0, 0)\ ) :ref:`🔗<class_PhysicalBone3D_method_apply_impulse>`
  296. Applies a positioned impulse to the PhysicsBone3D.
  297. 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 "_integrate_forces" functions otherwise).
  298. \ ``position`` is the offset from the PhysicsBone3D origin in global coordinates.
  299. .. rst-class:: classref-item-separator
  300. ----
  301. .. _class_PhysicalBone3D_method_get_bone_id:
  302. .. rst-class:: classref-method
  303. :ref:`int<class_int>` **get_bone_id**\ (\ ) |const| :ref:`🔗<class_PhysicalBone3D_method_get_bone_id>`
  304. Returns the unique identifier of the PhysicsBone3D.
  305. .. rst-class:: classref-item-separator
  306. ----
  307. .. _class_PhysicalBone3D_method_get_simulate_physics:
  308. .. rst-class:: classref-method
  309. :ref:`bool<class_bool>` **get_simulate_physics**\ (\ ) :ref:`🔗<class_PhysicalBone3D_method_get_simulate_physics>`
  310. Returns ``true`` if the PhysicsBone3D is allowed to simulate physics.
  311. .. rst-class:: classref-item-separator
  312. ----
  313. .. _class_PhysicalBone3D_method_is_simulating_physics:
  314. .. rst-class:: classref-method
  315. :ref:`bool<class_bool>` **is_simulating_physics**\ (\ ) :ref:`🔗<class_PhysicalBone3D_method_is_simulating_physics>`
  316. Returns ``true`` if the PhysicsBone3D is currently simulating physics.
  317. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  318. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  319. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  320. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  321. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  322. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  323. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  324. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  325. .. |void| replace:: :abbr:`void (No return value.)`