Physics2DDirectBodyState.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Physics2DDirectBodyState" inherits="Object" category="Core" version="3.1">
  3. <brief_description>
  4. Direct access object to a physics body in the [Physics2DServer].
  5. </brief_description>
  6. <description>
  7. Direct access object to a physics body in the [Physics2DServer]. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <demos>
  12. </demos>
  13. <methods>
  14. <method name="add_central_force">
  15. <return type="void">
  16. </return>
  17. <argument index="0" name="force" type="Vector2">
  18. </argument>
  19. <description>
  20. </description>
  21. </method>
  22. <method name="add_force">
  23. <return type="void">
  24. </return>
  25. <argument index="0" name="offset" type="Vector2">
  26. </argument>
  27. <argument index="1" name="force" type="Vector2">
  28. </argument>
  29. <description>
  30. </description>
  31. </method>
  32. <method name="add_torque">
  33. <return type="void">
  34. </return>
  35. <argument index="0" name="torque" type="float">
  36. </argument>
  37. <description>
  38. </description>
  39. </method>
  40. <method name="apply_central_impulse">
  41. <return type="void">
  42. </return>
  43. <argument index="0" name="impulse" type="Vector2">
  44. </argument>
  45. <description>
  46. </description>
  47. </method>
  48. <method name="apply_impulse">
  49. <return type="void">
  50. </return>
  51. <argument index="0" name="offset" type="Vector2">
  52. </argument>
  53. <argument index="1" name="impulse" type="Vector2">
  54. </argument>
  55. <description>
  56. </description>
  57. </method>
  58. <method name="apply_torque_impulse">
  59. <return type="void">
  60. </return>
  61. <argument index="0" name="impulse" type="float">
  62. </argument>
  63. <description>
  64. </description>
  65. </method>
  66. <method name="get_contact_collider" qualifiers="const">
  67. <return type="RID">
  68. </return>
  69. <argument index="0" name="contact_idx" type="int">
  70. </argument>
  71. <description>
  72. Return the [RID] of the collider.
  73. </description>
  74. </method>
  75. <method name="get_contact_collider_id" qualifiers="const">
  76. <return type="int">
  77. </return>
  78. <argument index="0" name="contact_idx" type="int">
  79. </argument>
  80. <description>
  81. Return the object id of the collider.
  82. </description>
  83. </method>
  84. <method name="get_contact_collider_object" qualifiers="const">
  85. <return type="Object">
  86. </return>
  87. <argument index="0" name="contact_idx" type="int">
  88. </argument>
  89. <description>
  90. Return the collider object, this depends on how it was created (will return a scene node if such was used to create it).
  91. </description>
  92. </method>
  93. <method name="get_contact_collider_position" qualifiers="const">
  94. <return type="Vector2">
  95. </return>
  96. <argument index="0" name="contact_idx" type="int">
  97. </argument>
  98. <description>
  99. Return the contact position in the collider.
  100. </description>
  101. </method>
  102. <method name="get_contact_collider_shape" qualifiers="const">
  103. <return type="int">
  104. </return>
  105. <argument index="0" name="contact_idx" type="int">
  106. </argument>
  107. <description>
  108. Return the collider shape index.
  109. </description>
  110. </method>
  111. <method name="get_contact_collider_shape_metadata" qualifiers="const">
  112. <return type="Variant">
  113. </return>
  114. <argument index="0" name="contact_idx" type="int">
  115. </argument>
  116. <description>
  117. Return the metadata of the collided shape. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
  118. </description>
  119. </method>
  120. <method name="get_contact_collider_velocity_at_position" qualifiers="const">
  121. <return type="Vector2">
  122. </return>
  123. <argument index="0" name="contact_idx" type="int">
  124. </argument>
  125. <description>
  126. Return the linear velocity vector at contact point of the collider.
  127. </description>
  128. </method>
  129. <method name="get_contact_count" qualifiers="const">
  130. <return type="int">
  131. </return>
  132. <description>
  133. Return the amount of contacts this body has with other bodies. Note that by default this returns 0 unless bodies are configured to log contacts.
  134. </description>
  135. </method>
  136. <method name="get_contact_local_normal" qualifiers="const">
  137. <return type="Vector2">
  138. </return>
  139. <argument index="0" name="contact_idx" type="int">
  140. </argument>
  141. <description>
  142. Return the local normal (of this body) of the contact point.
  143. </description>
  144. </method>
  145. <method name="get_contact_local_position" qualifiers="const">
  146. <return type="Vector2">
  147. </return>
  148. <argument index="0" name="contact_idx" type="int">
  149. </argument>
  150. <description>
  151. Return the local position (of this body) of the contact point.
  152. </description>
  153. </method>
  154. <method name="get_contact_local_shape" qualifiers="const">
  155. <return type="int">
  156. </return>
  157. <argument index="0" name="contact_idx" type="int">
  158. </argument>
  159. <description>
  160. Return the local shape index of the collision.
  161. </description>
  162. </method>
  163. <method name="get_space_state">
  164. <return type="Physics2DDirectSpaceState">
  165. </return>
  166. <description>
  167. Return the current state of space, useful for queries.
  168. </description>
  169. </method>
  170. <method name="integrate_forces">
  171. <return type="void">
  172. </return>
  173. <description>
  174. Call the built-in force integration code.
  175. </description>
  176. </method>
  177. </methods>
  178. <members>
  179. <member name="angular_velocity" type="float" setter="set_angular_velocity" getter="get_angular_velocity">
  180. The angular velocity of the body.
  181. </member>
  182. <member name="inverse_inertia" type="float" setter="" getter="get_inverse_inertia">
  183. The inverse of the inertia of the body.
  184. </member>
  185. <member name="inverse_mass" type="float" setter="" getter="get_inverse_mass">
  186. The inverse of the mass of the body.
  187. </member>
  188. <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity">
  189. The linear velocity of the body.
  190. </member>
  191. <member name="sleeping" type="bool" setter="set_sleep_state" getter="is_sleeping">
  192. [code]true[/code] if this body is currently sleeping (not active).
  193. </member>
  194. <member name="step" type="float" setter="" getter="get_step">
  195. The timestep (delta) used for the simulation.
  196. </member>
  197. <member name="total_angular_damp" type="float" setter="" getter="get_total_angular_damp">
  198. The rate at which the body stops rotating, if there are not any other forces moving it.
  199. </member>
  200. <member name="total_gravity" type="Vector2" setter="" getter="get_total_gravity">
  201. The total gravity vector being currently applied to this body.
  202. </member>
  203. <member name="total_linear_damp" type="float" setter="" getter="get_total_linear_damp">
  204. The rate at which the body stops moving, if there are not any other forces moving it.
  205. </member>
  206. <member name="transform" type="Transform2D" setter="set_transform" getter="get_transform">
  207. The transformation matrix of the body.
  208. </member>
  209. </members>
  210. <constants>
  211. </constants>
  212. </class>