Physics2DDirectBodyState.xml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Physics2DDirectBodyState" inherits="Object" category="Core" version="3.0.alpha.custom_build">
  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="get_angular_velocity" qualifiers="const">
  15. <return type="float">
  16. </return>
  17. <description>
  18. Return the angular velocity of the body.
  19. </description>
  20. </method>
  21. <method name="get_contact_collider" qualifiers="const">
  22. <return type="RID">
  23. </return>
  24. <argument index="0" name="contact_idx" type="int">
  25. </argument>
  26. <description>
  27. Return the [RID] of the collider.
  28. </description>
  29. </method>
  30. <method name="get_contact_collider_id" qualifiers="const">
  31. <return type="int">
  32. </return>
  33. <argument index="0" name="contact_idx" type="int">
  34. </argument>
  35. <description>
  36. Return the object id of the collider.
  37. </description>
  38. </method>
  39. <method name="get_contact_collider_object" qualifiers="const">
  40. <return type="Object">
  41. </return>
  42. <argument index="0" name="contact_idx" type="int">
  43. </argument>
  44. <description>
  45. Return the collider object, this depends on how it was created (will return a scene node if such was used to create it).
  46. </description>
  47. </method>
  48. <method name="get_contact_collider_position" qualifiers="const">
  49. <return type="Vector2">
  50. </return>
  51. <argument index="0" name="contact_idx" type="int">
  52. </argument>
  53. <description>
  54. Return the contact position in the collider.
  55. </description>
  56. </method>
  57. <method name="get_contact_collider_shape" qualifiers="const">
  58. <return type="int">
  59. </return>
  60. <argument index="0" name="contact_idx" type="int">
  61. </argument>
  62. <description>
  63. Return the collider shape index.
  64. </description>
  65. </method>
  66. <method name="get_contact_collider_shape_metadata" qualifiers="const">
  67. <return type="Variant">
  68. </return>
  69. <argument index="0" name="contact_idx" type="int">
  70. </argument>
  71. <description>
  72. 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].
  73. </description>
  74. </method>
  75. <method name="get_contact_collider_velocity_at_position" qualifiers="const">
  76. <return type="Vector2">
  77. </return>
  78. <argument index="0" name="contact_idx" type="int">
  79. </argument>
  80. <description>
  81. Return the linear velocity vector at contact point of the collider.
  82. </description>
  83. </method>
  84. <method name="get_contact_count" qualifiers="const">
  85. <return type="int">
  86. </return>
  87. <description>
  88. 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.
  89. </description>
  90. </method>
  91. <method name="get_contact_local_normal" qualifiers="const">
  92. <return type="Vector2">
  93. </return>
  94. <argument index="0" name="contact_idx" type="int">
  95. </argument>
  96. <description>
  97. Return the local normal (of this body) of the contact point.
  98. </description>
  99. </method>
  100. <method name="get_contact_local_position" qualifiers="const">
  101. <return type="Vector2">
  102. </return>
  103. <argument index="0" name="contact_idx" type="int">
  104. </argument>
  105. <description>
  106. Return the local position (of this body) of the contact point.
  107. </description>
  108. </method>
  109. <method name="get_contact_local_shape" qualifiers="const">
  110. <return type="int">
  111. </return>
  112. <argument index="0" name="contact_idx" type="int">
  113. </argument>
  114. <description>
  115. Return the local shape index of the collision.
  116. </description>
  117. </method>
  118. <method name="get_inverse_inertia" qualifiers="const">
  119. <return type="float">
  120. </return>
  121. <description>
  122. Return the inverse of the inertia of the body.
  123. </description>
  124. </method>
  125. <method name="get_inverse_mass" qualifiers="const">
  126. <return type="float">
  127. </return>
  128. <description>
  129. Return the inverse of the mass of the body.
  130. </description>
  131. </method>
  132. <method name="get_linear_velocity" qualifiers="const">
  133. <return type="Vector2">
  134. </return>
  135. <description>
  136. Return the current linear velocity of the body.
  137. </description>
  138. </method>
  139. <method name="get_space_state">
  140. <return type="Physics2DDirectSpaceState">
  141. </return>
  142. <description>
  143. Return the current state of space, useful for queries.
  144. </description>
  145. </method>
  146. <method name="get_step" qualifiers="const">
  147. <return type="float">
  148. </return>
  149. <description>
  150. Return the timestep (delta) used for the simulation.
  151. </description>
  152. </method>
  153. <method name="get_total_angular_damp" qualifiers="const">
  154. <return type="float">
  155. </return>
  156. <description>
  157. Return the rate at which the body stops rotating, if there are not any other forces moving it.
  158. </description>
  159. </method>
  160. <method name="get_total_gravity" qualifiers="const">
  161. <return type="Vector2">
  162. </return>
  163. <description>
  164. Return the total gravity vector being currently applied to this body.
  165. </description>
  166. </method>
  167. <method name="get_total_linear_damp" qualifiers="const">
  168. <return type="float">
  169. </return>
  170. <description>
  171. Return the rate at which the body stops moving, if there are not any other forces moving it.
  172. </description>
  173. </method>
  174. <method name="get_transform" qualifiers="const">
  175. <return type="Transform2D">
  176. </return>
  177. <description>
  178. Return the transform matrix of the body.
  179. </description>
  180. </method>
  181. <method name="integrate_forces">
  182. <return type="void">
  183. </return>
  184. <description>
  185. Call the built-in force integration code.
  186. </description>
  187. </method>
  188. <method name="is_sleeping" qualifiers="const">
  189. <return type="bool">
  190. </return>
  191. <description>
  192. Return true if this body is currently sleeping (not active).
  193. </description>
  194. </method>
  195. <method name="set_angular_velocity">
  196. <return type="void">
  197. </return>
  198. <argument index="0" name="velocity" type="float">
  199. </argument>
  200. <description>
  201. Change the angular velocity of the body.
  202. </description>
  203. </method>
  204. <method name="set_linear_velocity">
  205. <return type="void">
  206. </return>
  207. <argument index="0" name="velocity" type="Vector2">
  208. </argument>
  209. <description>
  210. Change the linear velocity of the body.
  211. </description>
  212. </method>
  213. <method name="set_sleep_state">
  214. <return type="void">
  215. </return>
  216. <argument index="0" name="enabled" type="bool">
  217. </argument>
  218. <description>
  219. Set the sleeping state of the body, only affects character/rigid bodies.
  220. </description>
  221. </method>
  222. <method name="set_transform">
  223. <return type="void">
  224. </return>
  225. <argument index="0" name="transform" type="Transform2D">
  226. </argument>
  227. <description>
  228. Change the transform matrix of the body.
  229. </description>
  230. </method>
  231. </methods>
  232. <constants>
  233. </constants>
  234. </class>