class_physics2dserver.rst 76 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_Physics2DServer:
  4. Physics2DServer
  5. ===============
  6. **Inherits:** :ref:`Object<class_object>`
  7. **Inherited By:** :ref:`Physics2DServerSW<class_physics2dserversw>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Physics 2D Server.
  12. Member Functions
  13. ----------------
  14. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`RID<class_rid>` | :ref:`shape_create<class_Physics2DServer_shape_create>` **(** :ref:`int<class_int>` type **)** |
  16. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`shape_set_data<class_Physics2DServer_shape_set_data>` **(** :ref:`RID<class_rid>` shape, var data **)** |
  18. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`int<class_int>` | :ref:`shape_get_type<class_Physics2DServer_shape_get_type>` **(** :ref:`RID<class_rid>` shape **)** const |
  20. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`shape_get_data<class_Physics2DServer_shape_get_data>` **(** :ref:`RID<class_rid>` shape **)** const |
  22. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`RID<class_rid>` | :ref:`space_create<class_Physics2DServer_space_create>` **(** **)** |
  24. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  25. | void | :ref:`space_set_active<class_Physics2DServer_space_set_active>` **(** :ref:`RID<class_rid>` space, :ref:`bool<class_bool>` active **)** |
  26. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`space_is_active<class_Physics2DServer_space_is_active>` **(** :ref:`RID<class_rid>` space **)** const |
  28. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`space_set_param<class_Physics2DServer_space_set_param>` **(** :ref:`RID<class_rid>` space, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)** |
  30. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`float<class_float>` | :ref:`space_get_param<class_Physics2DServer_space_get_param>` **(** :ref:`RID<class_rid>` space, :ref:`int<class_int>` param **)** const |
  32. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`Physics2DDirectSpaceState<class_physics2ddirectspacestate>` | :ref:`space_get_direct_state<class_Physics2DServer_space_get_direct_state>` **(** :ref:`RID<class_rid>` space **)** |
  34. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`RID<class_rid>` | :ref:`area_create<class_Physics2DServer_area_create>` **(** **)** |
  36. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`area_set_space<class_Physics2DServer_area_set_space>` **(** :ref:`RID<class_rid>` area, :ref:`RID<class_rid>` space **)** |
  38. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`RID<class_rid>` | :ref:`area_get_space<class_Physics2DServer_area_get_space>` **(** :ref:`RID<class_rid>` area **)** const |
  40. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`area_set_space_override_mode<class_Physics2DServer_area_set_space_override_mode>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mode **)** |
  42. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`int<class_int>` | :ref:`area_get_space_override_mode<class_Physics2DServer_area_get_space_override_mode>` **(** :ref:`RID<class_rid>` area **)** const |
  44. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`area_add_shape<class_Physics2DServer_area_add_shape>` **(** :ref:`RID<class_rid>` area, :ref:`RID<class_rid>` shape, :ref:`Matrix32<class_matrix32>` transform=1,0, 0,1, 0,0 **)** |
  46. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`area_set_shape<class_Physics2DServer_area_set_shape>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx, :ref:`RID<class_rid>` shape **)** |
  48. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | void | :ref:`area_set_shape_transform<class_Physics2DServer_area_set_shape_transform>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx, :ref:`Matrix32<class_matrix32>` transform **)** |
  50. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`int<class_int>` | :ref:`area_get_shape_count<class_Physics2DServer_area_get_shape_count>` **(** :ref:`RID<class_rid>` area **)** const |
  52. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`RID<class_rid>` | :ref:`area_get_shape<class_Physics2DServer_area_get_shape>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)** const |
  54. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`Matrix32<class_matrix32>` | :ref:`area_get_shape_transform<class_Physics2DServer_area_get_shape_transform>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)** const |
  56. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | void | :ref:`area_remove_shape<class_Physics2DServer_area_remove_shape>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)** |
  58. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | void | :ref:`area_clear_shapes<class_Physics2DServer_area_clear_shapes>` **(** :ref:`RID<class_rid>` area **)** |
  60. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | void | :ref:`area_set_layer_mask<class_Physics2DServer_area_set_layer_mask>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mask **)** |
  62. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | void | :ref:`area_set_collision_mask<class_Physics2DServer_area_set_collision_mask>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mask **)** |
  64. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | void | :ref:`area_set_param<class_Physics2DServer_area_set_param>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` param, var value **)** |
  66. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`area_set_transform<class_Physics2DServer_area_set_transform>` **(** :ref:`RID<class_rid>` area, :ref:`Matrix32<class_matrix32>` transform **)** |
  68. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`area_get_param<class_Physics2DServer_area_get_param>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` param **)** const |
  70. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`Matrix32<class_matrix32>` | :ref:`area_get_transform<class_Physics2DServer_area_get_transform>` **(** :ref:`RID<class_rid>` area **)** const |
  72. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`area_attach_object_instance_ID<class_Physics2DServer_area_attach_object_instance_ID>` **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` id **)** |
  74. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`int<class_int>` | :ref:`area_get_object_instance_ID<class_Physics2DServer_area_get_object_instance_ID>` **(** :ref:`RID<class_rid>` area **)** const |
  76. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`area_set_monitor_callback<class_Physics2DServer_area_set_monitor_callback>` **(** :ref:`RID<class_rid>` area, :ref:`Object<class_object>` receiver, :ref:`String<class_string>` method **)** |
  78. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`RID<class_rid>` | :ref:`body_create<class_Physics2DServer_body_create>` **(** :ref:`int<class_int>` mode=2, :ref:`bool<class_bool>` init_sleeping=false **)** |
  80. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | void | :ref:`body_set_space<class_Physics2DServer_body_set_space>` **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` space **)** |
  82. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`RID<class_rid>` | :ref:`body_get_space<class_Physics2DServer_body_get_space>` **(** :ref:`RID<class_rid>` body **)** const |
  84. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | void | :ref:`body_set_mode<class_Physics2DServer_body_set_mode>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mode **)** |
  86. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`int<class_int>` | :ref:`body_get_mode<class_Physics2DServer_body_get_mode>` **(** :ref:`RID<class_rid>` body **)** const |
  88. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | void | :ref:`body_add_shape<class_Physics2DServer_body_add_shape>` **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` shape, :ref:`Matrix32<class_matrix32>` transform=1,0, 0,1, 0,0 **)** |
  90. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | void | :ref:`body_set_shape<class_Physics2DServer_body_set_shape>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`RID<class_rid>` shape **)** |
  92. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | void | :ref:`body_set_shape_transform<class_Physics2DServer_body_set_shape_transform>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`Matrix32<class_matrix32>` transform **)** |
  94. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | void | :ref:`body_set_shape_metadata<class_Physics2DServer_body_set_shape_metadata>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, var metadata **)** |
  96. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`int<class_int>` | :ref:`body_get_shape_count<class_Physics2DServer_body_get_shape_count>` **(** :ref:`RID<class_rid>` body **)** const |
  98. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | :ref:`RID<class_rid>` | :ref:`body_get_shape<class_Physics2DServer_body_get_shape>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const |
  100. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | :ref:`Matrix32<class_matrix32>` | :ref:`body_get_shape_transform<class_Physics2DServer_body_get_shape_transform>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const |
  102. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | void | :ref:`body_get_shape_metadata<class_Physics2DServer_body_get_shape_metadata>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const |
  104. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | void | :ref:`body_remove_shape<class_Physics2DServer_body_remove_shape>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** |
  106. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | void | :ref:`body_clear_shapes<class_Physics2DServer_body_clear_shapes>` **(** :ref:`RID<class_rid>` body **)** |
  108. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | void | :ref:`body_set_shape_as_trigger<class_Physics2DServer_body_set_shape_as_trigger>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`bool<class_bool>` enable **)** |
  110. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | :ref:`bool<class_bool>` | :ref:`body_is_shape_set_as_trigger<class_Physics2DServer_body_is_shape_set_as_trigger>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const |
  112. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | void | :ref:`body_attach_object_instance_ID<class_Physics2DServer_body_attach_object_instance_ID>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` id **)** |
  114. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | :ref:`int<class_int>` | :ref:`body_get_object_instance_ID<class_Physics2DServer_body_get_object_instance_ID>` **(** :ref:`RID<class_rid>` body **)** const |
  116. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | void | :ref:`body_set_continuous_collision_detection_mode<class_Physics2DServer_body_set_continuous_collision_detection_mode>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mode **)** |
  118. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. | :ref:`int<class_int>` | :ref:`body_get_continuous_collision_detection_mode<class_Physics2DServer_body_get_continuous_collision_detection_mode>` **(** :ref:`RID<class_rid>` body **)** const |
  120. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  121. | void | :ref:`body_set_layer_mask<class_Physics2DServer_body_set_layer_mask>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mask **)** |
  122. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  123. | :ref:`int<class_int>` | :ref:`body_get_layer_mask<class_Physics2DServer_body_get_layer_mask>` **(** :ref:`RID<class_rid>` body **)** const |
  124. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  125. | void | :ref:`body_set_collision_mask<class_Physics2DServer_body_set_collision_mask>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mask **)** |
  126. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  127. | :ref:`int<class_int>` | :ref:`body_get_collision_mask<class_Physics2DServer_body_get_collision_mask>` **(** :ref:`RID<class_rid>` body **)** const |
  128. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  129. | void | :ref:`body_set_param<class_Physics2DServer_body_set_param>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)** |
  130. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  131. | :ref:`float<class_float>` | :ref:`body_get_param<class_Physics2DServer_body_get_param>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` param **)** const |
  132. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  133. | void | :ref:`body_set_state<class_Physics2DServer_body_set_state>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` state, var value **)** |
  134. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  135. | void | :ref:`body_get_state<class_Physics2DServer_body_get_state>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` state **)** const |
  136. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  137. | void | :ref:`body_apply_impulse<class_Physics2DServer_body_apply_impulse>` **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` pos, :ref:`Vector2<class_vector2>` impulse **)** |
  138. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  139. | void | :ref:`body_set_axis_velocity<class_Physics2DServer_body_set_axis_velocity>` **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` axis_velocity **)** |
  140. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  141. | void | :ref:`body_add_collision_exception<class_Physics2DServer_body_add_collision_exception>` **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` excepted_body **)** |
  142. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  143. | void | :ref:`body_remove_collision_exception<class_Physics2DServer_body_remove_collision_exception>` **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` excepted_body **)** |
  144. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  145. | void | :ref:`body_set_max_contacts_reported<class_Physics2DServer_body_set_max_contacts_reported>` **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` amount **)** |
  146. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  147. | :ref:`int<class_int>` | :ref:`body_get_max_contacts_reported<class_Physics2DServer_body_get_max_contacts_reported>` **(** :ref:`RID<class_rid>` body **)** const |
  148. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  149. | void | :ref:`body_set_one_way_collision_direction<class_Physics2DServer_body_set_one_way_collision_direction>` **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` normal **)** |
  150. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  151. | :ref:`Vector2<class_vector2>` | :ref:`body_get_one_way_collision_direction<class_Physics2DServer_body_get_one_way_collision_direction>` **(** :ref:`RID<class_rid>` body **)** const |
  152. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  153. | void | :ref:`body_set_one_way_collision_max_depth<class_Physics2DServer_body_set_one_way_collision_max_depth>` **(** :ref:`RID<class_rid>` body, :ref:`float<class_float>` depth **)** |
  154. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  155. | :ref:`float<class_float>` | :ref:`body_get_one_way_collision_max_depth<class_Physics2DServer_body_get_one_way_collision_max_depth>` **(** :ref:`RID<class_rid>` body **)** const |
  156. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  157. | void | :ref:`body_set_omit_force_integration<class_Physics2DServer_body_set_omit_force_integration>` **(** :ref:`RID<class_rid>` body, :ref:`bool<class_bool>` enable **)** |
  158. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  159. | :ref:`bool<class_bool>` | :ref:`body_is_omitting_force_integration<class_Physics2DServer_body_is_omitting_force_integration>` **(** :ref:`RID<class_rid>` body **)** const |
  160. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  161. | void | :ref:`body_set_force_integration_callback<class_Physics2DServer_body_set_force_integration_callback>` **(** :ref:`RID<class_rid>` body, :ref:`Object<class_object>` receiver, :ref:`String<class_string>` method, var userdata=NULL **)** |
  162. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  163. | :ref:`bool<class_bool>` | :ref:`body_test_motion<class_Physics2DServer_body_test_motion>` **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` motion, :ref:`float<class_float>` margin=0.08, :ref:`Physics2DTestMotionResult<class_physics2dtestmotionresult>` result=NULL **)** |
  164. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  165. | void | :ref:`joint_set_param<class_Physics2DServer_joint_set_param>` **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)** |
  166. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  167. | :ref:`float<class_float>` | :ref:`joint_get_param<class_Physics2DServer_joint_get_param>` **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param **)** const |
  168. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  169. | :ref:`RID<class_rid>` | :ref:`pin_joint_create<class_Physics2DServer_pin_joint_create>` **(** :ref:`Vector2<class_vector2>` anchor, :ref:`RID<class_rid>` body_a, :ref:`RID<class_rid>` body_b=RID() **)** |
  170. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  171. | :ref:`RID<class_rid>` | :ref:`groove_joint_create<class_Physics2DServer_groove_joint_create>` **(** :ref:`Vector2<class_vector2>` groove1_a, :ref:`Vector2<class_vector2>` groove2_a, :ref:`Vector2<class_vector2>` anchor_b, :ref:`RID<class_rid>` body_a=RID(), :ref:`RID<class_rid>` body_b=RID() **)** |
  172. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  173. | :ref:`RID<class_rid>` | :ref:`damped_spring_joint_create<class_Physics2DServer_damped_spring_joint_create>` **(** :ref:`Vector2<class_vector2>` anchor_a, :ref:`Vector2<class_vector2>` anchor_b, :ref:`RID<class_rid>` body_a, :ref:`RID<class_rid>` body_b=RID() **)** |
  174. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  175. | void | :ref:`damped_string_joint_set_param<class_Physics2DServer_damped_string_joint_set_param>` **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)** |
  176. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  177. | :ref:`float<class_float>` | :ref:`damped_string_joint_get_param<class_Physics2DServer_damped_string_joint_get_param>` **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param **)** const |
  178. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  179. | :ref:`int<class_int>` | :ref:`joint_get_type<class_Physics2DServer_joint_get_type>` **(** :ref:`RID<class_rid>` joint **)** const |
  180. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  181. | void | :ref:`free_rid<class_Physics2DServer_free_rid>` **(** :ref:`RID<class_rid>` rid **)** |
  182. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  183. | void | :ref:`set_active<class_Physics2DServer_set_active>` **(** :ref:`bool<class_bool>` active **)** |
  184. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  185. | :ref:`int<class_int>` | :ref:`get_process_info<class_Physics2DServer_get_process_info>` **(** :ref:`int<class_int>` process_info **)** |
  186. +--------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  187. Numeric Constants
  188. -----------------
  189. - **SHAPE_LINE** = **0**
  190. - **SHAPE_SEGMENT** = **2**
  191. - **SHAPE_CIRCLE** = **3**
  192. - **SHAPE_RECTANGLE** = **4**
  193. - **SHAPE_CAPSULE** = **5**
  194. - **SHAPE_CONVEX_POLYGON** = **6**
  195. - **SHAPE_CONCAVE_POLYGON** = **7**
  196. - **SHAPE_CUSTOM** = **8**
  197. - **AREA_PARAM_GRAVITY** = **0**
  198. - **AREA_PARAM_GRAVITY_VECTOR** = **1**
  199. - **AREA_PARAM_GRAVITY_IS_POINT** = **2**
  200. - **AREA_PARAM_GRAVITY_DISTANCE_SCALE** = **3**
  201. - **AREA_PARAM_GRAVITY_POINT_ATTENUATION** = **4**
  202. - **AREA_PARAM_LINEAR_DAMP** = **5**
  203. - **AREA_PARAM_ANGULAR_DAMP** = **6**
  204. - **AREA_PARAM_PRIORITY** = **7**
  205. - **AREA_SPACE_OVERRIDE_DISABLED** = **0** --- This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
  206. - **AREA_SPACE_OVERRIDE_COMBINE** = **1** --- This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects.
  207. - **AREA_SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one.
  208. - **AREA_SPACE_OVERRIDE_REPLACE** = **3** --- This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.
  209. - **AREA_SPACE_OVERRIDE_REPLACE_COMBINE** = **4** --- This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
  210. - **BODY_MODE_STATIC** = **0**
  211. - **BODY_MODE_KINEMATIC** = **1**
  212. - **BODY_MODE_RIGID** = **2**
  213. - **BODY_MODE_CHARACTER** = **3**
  214. - **BODY_PARAM_BOUNCE** = **0**
  215. - **BODY_PARAM_FRICTION** = **1**
  216. - **BODY_PARAM_MASS** = **2**
  217. - **BODY_PARAM_GRAVITY_SCALE** = **3**
  218. - **BODY_PARAM_LINEAR_DAMP** = **4**
  219. - **BODY_PARAM_ANGULAR_DAMP** = **5**
  220. - **BODY_PARAM_MAX** = **6**
  221. - **BODY_STATE_TRANSFORM** = **0**
  222. - **BODY_STATE_LINEAR_VELOCITY** = **1**
  223. - **BODY_STATE_ANGULAR_VELOCITY** = **2**
  224. - **BODY_STATE_SLEEPING** = **3**
  225. - **BODY_STATE_CAN_SLEEP** = **4**
  226. - **JOINT_PIN** = **0**
  227. - **JOINT_GROOVE** = **1**
  228. - **JOINT_DAMPED_SPRING** = **2**
  229. - **DAMPED_STRING_REST_LENGTH** = **0**
  230. - **DAMPED_STRING_STIFFNESS** = **1**
  231. - **DAMPED_STRING_DAMPING** = **2**
  232. - **CCD_MODE_DISABLED** = **0**
  233. - **CCD_MODE_CAST_RAY** = **1**
  234. - **CCD_MODE_CAST_SHAPE** = **2**
  235. - **AREA_BODY_ADDED** = **0**
  236. - **AREA_BODY_REMOVED** = **1**
  237. - **INFO_ACTIVE_OBJECTS** = **0**
  238. - **INFO_COLLISION_PAIRS** = **1**
  239. - **INFO_ISLAND_COUNT** = **2**
  240. Description
  241. -----------
  242. Physics 2D Server is the server responsible for all 2D physics.
  243. Member Function Description
  244. ---------------------------
  245. .. _class_Physics2DServer_shape_create:
  246. - :ref:`RID<class_rid>` **shape_create** **(** :ref:`int<class_int>` type **)**
  247. .. _class_Physics2DServer_shape_set_data:
  248. - void **shape_set_data** **(** :ref:`RID<class_rid>` shape, var data **)**
  249. .. _class_Physics2DServer_shape_get_type:
  250. - :ref:`int<class_int>` **shape_get_type** **(** :ref:`RID<class_rid>` shape **)** const
  251. .. _class_Physics2DServer_shape_get_data:
  252. - void **shape_get_data** **(** :ref:`RID<class_rid>` shape **)** const
  253. .. _class_Physics2DServer_space_create:
  254. - :ref:`RID<class_rid>` **space_create** **(** **)**
  255. .. _class_Physics2DServer_space_set_active:
  256. - void **space_set_active** **(** :ref:`RID<class_rid>` space, :ref:`bool<class_bool>` active **)**
  257. .. _class_Physics2DServer_space_is_active:
  258. - :ref:`bool<class_bool>` **space_is_active** **(** :ref:`RID<class_rid>` space **)** const
  259. .. _class_Physics2DServer_space_set_param:
  260. - void **space_set_param** **(** :ref:`RID<class_rid>` space, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)**
  261. .. _class_Physics2DServer_space_get_param:
  262. - :ref:`float<class_float>` **space_get_param** **(** :ref:`RID<class_rid>` space, :ref:`int<class_int>` param **)** const
  263. .. _class_Physics2DServer_space_get_direct_state:
  264. - :ref:`Physics2DDirectSpaceState<class_physics2ddirectspacestate>` **space_get_direct_state** **(** :ref:`RID<class_rid>` space **)**
  265. .. _class_Physics2DServer_area_create:
  266. - :ref:`RID<class_rid>` **area_create** **(** **)**
  267. .. _class_Physics2DServer_area_set_space:
  268. - void **area_set_space** **(** :ref:`RID<class_rid>` area, :ref:`RID<class_rid>` space **)**
  269. .. _class_Physics2DServer_area_get_space:
  270. - :ref:`RID<class_rid>` **area_get_space** **(** :ref:`RID<class_rid>` area **)** const
  271. .. _class_Physics2DServer_area_set_space_override_mode:
  272. - void **area_set_space_override_mode** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mode **)**
  273. .. _class_Physics2DServer_area_get_space_override_mode:
  274. - :ref:`int<class_int>` **area_get_space_override_mode** **(** :ref:`RID<class_rid>` area **)** const
  275. .. _class_Physics2DServer_area_add_shape:
  276. - void **area_add_shape** **(** :ref:`RID<class_rid>` area, :ref:`RID<class_rid>` shape, :ref:`Matrix32<class_matrix32>` transform=1,0, 0,1, 0,0 **)**
  277. .. _class_Physics2DServer_area_set_shape:
  278. - void **area_set_shape** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx, :ref:`RID<class_rid>` shape **)**
  279. .. _class_Physics2DServer_area_set_shape_transform:
  280. - void **area_set_shape_transform** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx, :ref:`Matrix32<class_matrix32>` transform **)**
  281. .. _class_Physics2DServer_area_get_shape_count:
  282. - :ref:`int<class_int>` **area_get_shape_count** **(** :ref:`RID<class_rid>` area **)** const
  283. .. _class_Physics2DServer_area_get_shape:
  284. - :ref:`RID<class_rid>` **area_get_shape** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)** const
  285. .. _class_Physics2DServer_area_get_shape_transform:
  286. - :ref:`Matrix32<class_matrix32>` **area_get_shape_transform** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)** const
  287. .. _class_Physics2DServer_area_remove_shape:
  288. - void **area_remove_shape** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` shape_idx **)**
  289. .. _class_Physics2DServer_area_clear_shapes:
  290. - void **area_clear_shapes** **(** :ref:`RID<class_rid>` area **)**
  291. .. _class_Physics2DServer_area_set_layer_mask:
  292. - void **area_set_layer_mask** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mask **)**
  293. .. _class_Physics2DServer_area_set_collision_mask:
  294. - void **area_set_collision_mask** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` mask **)**
  295. .. _class_Physics2DServer_area_set_param:
  296. - void **area_set_param** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` param, var value **)**
  297. .. _class_Physics2DServer_area_set_transform:
  298. - void **area_set_transform** **(** :ref:`RID<class_rid>` area, :ref:`Matrix32<class_matrix32>` transform **)**
  299. .. _class_Physics2DServer_area_get_param:
  300. - void **area_get_param** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` param **)** const
  301. .. _class_Physics2DServer_area_get_transform:
  302. - :ref:`Matrix32<class_matrix32>` **area_get_transform** **(** :ref:`RID<class_rid>` area **)** const
  303. .. _class_Physics2DServer_area_attach_object_instance_ID:
  304. - void **area_attach_object_instance_ID** **(** :ref:`RID<class_rid>` area, :ref:`int<class_int>` id **)**
  305. .. _class_Physics2DServer_area_get_object_instance_ID:
  306. - :ref:`int<class_int>` **area_get_object_instance_ID** **(** :ref:`RID<class_rid>` area **)** const
  307. .. _class_Physics2DServer_area_set_monitor_callback:
  308. - void **area_set_monitor_callback** **(** :ref:`RID<class_rid>` area, :ref:`Object<class_object>` receiver, :ref:`String<class_string>` method **)**
  309. .. _class_Physics2DServer_body_create:
  310. - :ref:`RID<class_rid>` **body_create** **(** :ref:`int<class_int>` mode=2, :ref:`bool<class_bool>` init_sleeping=false **)**
  311. .. _class_Physics2DServer_body_set_space:
  312. - void **body_set_space** **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` space **)**
  313. .. _class_Physics2DServer_body_get_space:
  314. - :ref:`RID<class_rid>` **body_get_space** **(** :ref:`RID<class_rid>` body **)** const
  315. .. _class_Physics2DServer_body_set_mode:
  316. - void **body_set_mode** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mode **)**
  317. .. _class_Physics2DServer_body_get_mode:
  318. - :ref:`int<class_int>` **body_get_mode** **(** :ref:`RID<class_rid>` body **)** const
  319. .. _class_Physics2DServer_body_add_shape:
  320. - void **body_add_shape** **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` shape, :ref:`Matrix32<class_matrix32>` transform=1,0, 0,1, 0,0 **)**
  321. .. _class_Physics2DServer_body_set_shape:
  322. - void **body_set_shape** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`RID<class_rid>` shape **)**
  323. .. _class_Physics2DServer_body_set_shape_transform:
  324. - void **body_set_shape_transform** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`Matrix32<class_matrix32>` transform **)**
  325. .. _class_Physics2DServer_body_set_shape_metadata:
  326. - void **body_set_shape_metadata** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, var metadata **)**
  327. .. _class_Physics2DServer_body_get_shape_count:
  328. - :ref:`int<class_int>` **body_get_shape_count** **(** :ref:`RID<class_rid>` body **)** const
  329. .. _class_Physics2DServer_body_get_shape:
  330. - :ref:`RID<class_rid>` **body_get_shape** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const
  331. .. _class_Physics2DServer_body_get_shape_transform:
  332. - :ref:`Matrix32<class_matrix32>` **body_get_shape_transform** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const
  333. .. _class_Physics2DServer_body_get_shape_metadata:
  334. - void **body_get_shape_metadata** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const
  335. .. _class_Physics2DServer_body_remove_shape:
  336. - void **body_remove_shape** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)**
  337. .. _class_Physics2DServer_body_clear_shapes:
  338. - void **body_clear_shapes** **(** :ref:`RID<class_rid>` body **)**
  339. .. _class_Physics2DServer_body_set_shape_as_trigger:
  340. - void **body_set_shape_as_trigger** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx, :ref:`bool<class_bool>` enable **)**
  341. .. _class_Physics2DServer_body_is_shape_set_as_trigger:
  342. - :ref:`bool<class_bool>` **body_is_shape_set_as_trigger** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` shape_idx **)** const
  343. .. _class_Physics2DServer_body_attach_object_instance_ID:
  344. - void **body_attach_object_instance_ID** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` id **)**
  345. .. _class_Physics2DServer_body_get_object_instance_ID:
  346. - :ref:`int<class_int>` **body_get_object_instance_ID** **(** :ref:`RID<class_rid>` body **)** const
  347. .. _class_Physics2DServer_body_set_continuous_collision_detection_mode:
  348. - void **body_set_continuous_collision_detection_mode** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mode **)**
  349. .. _class_Physics2DServer_body_get_continuous_collision_detection_mode:
  350. - :ref:`int<class_int>` **body_get_continuous_collision_detection_mode** **(** :ref:`RID<class_rid>` body **)** const
  351. .. _class_Physics2DServer_body_set_layer_mask:
  352. - void **body_set_layer_mask** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mask **)**
  353. .. _class_Physics2DServer_body_get_layer_mask:
  354. - :ref:`int<class_int>` **body_get_layer_mask** **(** :ref:`RID<class_rid>` body **)** const
  355. .. _class_Physics2DServer_body_set_collision_mask:
  356. - void **body_set_collision_mask** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` mask **)**
  357. .. _class_Physics2DServer_body_get_collision_mask:
  358. - :ref:`int<class_int>` **body_get_collision_mask** **(** :ref:`RID<class_rid>` body **)** const
  359. .. _class_Physics2DServer_body_set_param:
  360. - void **body_set_param** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)**
  361. .. _class_Physics2DServer_body_get_param:
  362. - :ref:`float<class_float>` **body_get_param** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` param **)** const
  363. .. _class_Physics2DServer_body_set_state:
  364. - void **body_set_state** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` state, var value **)**
  365. .. _class_Physics2DServer_body_get_state:
  366. - void **body_get_state** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` state **)** const
  367. .. _class_Physics2DServer_body_apply_impulse:
  368. - void **body_apply_impulse** **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` pos, :ref:`Vector2<class_vector2>` impulse **)**
  369. .. _class_Physics2DServer_body_set_axis_velocity:
  370. - void **body_set_axis_velocity** **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` axis_velocity **)**
  371. .. _class_Physics2DServer_body_add_collision_exception:
  372. - void **body_add_collision_exception** **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` excepted_body **)**
  373. .. _class_Physics2DServer_body_remove_collision_exception:
  374. - void **body_remove_collision_exception** **(** :ref:`RID<class_rid>` body, :ref:`RID<class_rid>` excepted_body **)**
  375. .. _class_Physics2DServer_body_set_max_contacts_reported:
  376. - void **body_set_max_contacts_reported** **(** :ref:`RID<class_rid>` body, :ref:`int<class_int>` amount **)**
  377. .. _class_Physics2DServer_body_get_max_contacts_reported:
  378. - :ref:`int<class_int>` **body_get_max_contacts_reported** **(** :ref:`RID<class_rid>` body **)** const
  379. .. _class_Physics2DServer_body_set_one_way_collision_direction:
  380. - void **body_set_one_way_collision_direction** **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` normal **)**
  381. .. _class_Physics2DServer_body_get_one_way_collision_direction:
  382. - :ref:`Vector2<class_vector2>` **body_get_one_way_collision_direction** **(** :ref:`RID<class_rid>` body **)** const
  383. .. _class_Physics2DServer_body_set_one_way_collision_max_depth:
  384. - void **body_set_one_way_collision_max_depth** **(** :ref:`RID<class_rid>` body, :ref:`float<class_float>` depth **)**
  385. .. _class_Physics2DServer_body_get_one_way_collision_max_depth:
  386. - :ref:`float<class_float>` **body_get_one_way_collision_max_depth** **(** :ref:`RID<class_rid>` body **)** const
  387. .. _class_Physics2DServer_body_set_omit_force_integration:
  388. - void **body_set_omit_force_integration** **(** :ref:`RID<class_rid>` body, :ref:`bool<class_bool>` enable **)**
  389. .. _class_Physics2DServer_body_is_omitting_force_integration:
  390. - :ref:`bool<class_bool>` **body_is_omitting_force_integration** **(** :ref:`RID<class_rid>` body **)** const
  391. .. _class_Physics2DServer_body_set_force_integration_callback:
  392. - void **body_set_force_integration_callback** **(** :ref:`RID<class_rid>` body, :ref:`Object<class_object>` receiver, :ref:`String<class_string>` method, var userdata=NULL **)**
  393. .. _class_Physics2DServer_body_test_motion:
  394. - :ref:`bool<class_bool>` **body_test_motion** **(** :ref:`RID<class_rid>` body, :ref:`Vector2<class_vector2>` motion, :ref:`float<class_float>` margin=0.08, :ref:`Physics2DTestMotionResult<class_physics2dtestmotionresult>` result=NULL **)**
  395. .. _class_Physics2DServer_joint_set_param:
  396. - void **joint_set_param** **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)**
  397. .. _class_Physics2DServer_joint_get_param:
  398. - :ref:`float<class_float>` **joint_get_param** **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param **)** const
  399. .. _class_Physics2DServer_pin_joint_create:
  400. - :ref:`RID<class_rid>` **pin_joint_create** **(** :ref:`Vector2<class_vector2>` anchor, :ref:`RID<class_rid>` body_a, :ref:`RID<class_rid>` body_b=RID() **)**
  401. .. _class_Physics2DServer_groove_joint_create:
  402. - :ref:`RID<class_rid>` **groove_joint_create** **(** :ref:`Vector2<class_vector2>` groove1_a, :ref:`Vector2<class_vector2>` groove2_a, :ref:`Vector2<class_vector2>` anchor_b, :ref:`RID<class_rid>` body_a=RID(), :ref:`RID<class_rid>` body_b=RID() **)**
  403. .. _class_Physics2DServer_damped_spring_joint_create:
  404. - :ref:`RID<class_rid>` **damped_spring_joint_create** **(** :ref:`Vector2<class_vector2>` anchor_a, :ref:`Vector2<class_vector2>` anchor_b, :ref:`RID<class_rid>` body_a, :ref:`RID<class_rid>` body_b=RID() **)**
  405. .. _class_Physics2DServer_damped_string_joint_set_param:
  406. - void **damped_string_joint_set_param** **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param, :ref:`float<class_float>` value **)**
  407. .. _class_Physics2DServer_damped_string_joint_get_param:
  408. - :ref:`float<class_float>` **damped_string_joint_get_param** **(** :ref:`RID<class_rid>` joint, :ref:`int<class_int>` param **)** const
  409. .. _class_Physics2DServer_joint_get_type:
  410. - :ref:`int<class_int>` **joint_get_type** **(** :ref:`RID<class_rid>` joint **)** const
  411. .. _class_Physics2DServer_free_rid:
  412. - void **free_rid** **(** :ref:`RID<class_rid>` rid **)**
  413. .. _class_Physics2DServer_set_active:
  414. - void **set_active** **(** :ref:`bool<class_bool>` active **)**
  415. .. _class_Physics2DServer_get_process_info:
  416. - :ref:`int<class_int>` **get_process_info** **(** :ref:`int<class_int>` process_info **)**