physics_server_2d_extension.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. /**************************************************************************/
  2. /* physics_server_2d_extension.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef PHYSICS_SERVER_2D_EXTENSION_H
  31. #define PHYSICS_SERVER_2D_EXTENSION_H
  32. #include "core/extension/ext_wrappers.gen.inc"
  33. #include "core/object/gdvirtual.gen.inc"
  34. #include "core/variant/native_ptr.h"
  35. #include "core/variant/type_info.h"
  36. #include "core/variant/typed_array.h"
  37. #include "servers/physics_server_2d.h"
  38. class PhysicsDirectBodyState2DExtension : public PhysicsDirectBodyState2D {
  39. GDCLASS(PhysicsDirectBodyState2DExtension, PhysicsDirectBodyState2D);
  40. protected:
  41. static void _bind_methods();
  42. public:
  43. // The warning is valid, but unavoidable. If the function is not overridden it will error anyway.
  44. EXBIND0RC(Vector2, get_total_gravity)
  45. EXBIND0RC(real_t, get_total_angular_damp)
  46. EXBIND0RC(real_t, get_total_linear_damp)
  47. EXBIND0RC(Vector2, get_center_of_mass)
  48. EXBIND0RC(Vector2, get_center_of_mass_local)
  49. EXBIND0RC(real_t, get_inverse_mass)
  50. EXBIND0RC(real_t, get_inverse_inertia)
  51. EXBIND1(set_linear_velocity, const Vector2 &)
  52. EXBIND0RC(Vector2, get_linear_velocity)
  53. EXBIND1(set_angular_velocity, real_t)
  54. EXBIND0RC(real_t, get_angular_velocity)
  55. EXBIND1(set_transform, const Transform2D &)
  56. EXBIND0RC(Transform2D, get_transform)
  57. EXBIND1RC(Vector2, get_velocity_at_local_position, const Vector2 &)
  58. EXBIND1(apply_central_impulse, const Vector2 &)
  59. EXBIND1(apply_torque_impulse, real_t)
  60. EXBIND2(apply_impulse, const Vector2 &, const Vector2 &)
  61. EXBIND1(apply_central_force, const Vector2 &)
  62. EXBIND2(apply_force, const Vector2 &, const Vector2 &)
  63. EXBIND1(apply_torque, real_t)
  64. EXBIND1(add_constant_central_force, const Vector2 &)
  65. EXBIND2(add_constant_force, const Vector2 &, const Vector2 &)
  66. EXBIND1(add_constant_torque, real_t)
  67. EXBIND1(set_constant_force, const Vector2 &)
  68. EXBIND0RC(Vector2, get_constant_force)
  69. EXBIND1(set_constant_torque, real_t)
  70. EXBIND0RC(real_t, get_constant_torque)
  71. EXBIND1(set_sleep_state, bool)
  72. EXBIND0RC(bool, is_sleeping)
  73. EXBIND0RC(int, get_contact_count)
  74. EXBIND1RC(Vector2, get_contact_local_position, int)
  75. EXBIND1RC(Vector2, get_contact_local_normal, int)
  76. EXBIND1RC(Vector2, get_contact_local_velocity_at_position, int)
  77. EXBIND1RC(int, get_contact_local_shape, int)
  78. EXBIND1RC(RID, get_contact_collider, int)
  79. EXBIND1RC(Vector2, get_contact_collider_position, int)
  80. EXBIND1RC(ObjectID, get_contact_collider_id, int)
  81. EXBIND1RC(Object *, get_contact_collider_object, int)
  82. EXBIND1RC(int, get_contact_collider_shape, int)
  83. EXBIND1RC(Vector2, get_contact_collider_velocity_at_position, int)
  84. EXBIND1RC(Vector2, get_contact_impulse, int)
  85. EXBIND0RC(real_t, get_step)
  86. EXBIND0(integrate_forces)
  87. EXBIND0R(PhysicsDirectSpaceState2D *, get_space_state)
  88. PhysicsDirectBodyState2DExtension();
  89. };
  90. typedef PhysicsDirectSpaceState2D::RayResult PhysicsServer2DExtensionRayResult;
  91. typedef PhysicsDirectSpaceState2D::ShapeResult PhysicsServer2DExtensionShapeResult;
  92. typedef PhysicsDirectSpaceState2D::ShapeRestInfo PhysicsServer2DExtensionShapeRestInfo;
  93. GDVIRTUAL_NATIVE_PTR(PhysicsServer2DExtensionRayResult)
  94. GDVIRTUAL_NATIVE_PTR(PhysicsServer2DExtensionShapeResult)
  95. GDVIRTUAL_NATIVE_PTR(PhysicsServer2DExtensionShapeRestInfo)
  96. class PhysicsDirectSpaceState2DExtension : public PhysicsDirectSpaceState2D {
  97. GDCLASS(PhysicsDirectSpaceState2DExtension, PhysicsDirectSpaceState2D);
  98. thread_local static const HashSet<RID> *exclude;
  99. protected:
  100. static void _bind_methods();
  101. bool is_body_excluded_from_query(const RID &p_body) const;
  102. GDVIRTUAL7R(bool, _intersect_ray, const Vector2 &, const Vector2 &, uint32_t, bool, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionRayResult>)
  103. GDVIRTUAL7R(int, _intersect_point, const Vector2 &, ObjectID, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionShapeResult>, int)
  104. GDVIRTUAL9R(int, _intersect_shape, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionShapeResult>, int)
  105. GDVIRTUAL9R(bool, _cast_motion, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<real_t>, GDExtensionPtr<real_t>)
  106. GDVIRTUAL10R(bool, _collide_shape, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<Vector2>, int, GDExtensionPtr<int>)
  107. GDVIRTUAL8R(bool, _rest_info, RID, const Transform2D &, const Vector2 &, real_t, uint32_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionShapeRestInfo>)
  108. public:
  109. virtual bool intersect_ray(const RayParameters &p_parameters, RayResult &r_result) override {
  110. exclude = &p_parameters.exclude;
  111. bool ret = false;
  112. GDVIRTUAL_REQUIRED_CALL(_intersect_ray, p_parameters.from, p_parameters.to, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, p_parameters.hit_from_inside, &r_result, ret);
  113. exclude = nullptr;
  114. return ret;
  115. }
  116. virtual int intersect_point(const PointParameters &p_parameters, ShapeResult *r_results, int p_result_max) override {
  117. exclude = &p_parameters.exclude;
  118. int ret = false;
  119. GDVIRTUAL_REQUIRED_CALL(_intersect_point, p_parameters.position, p_parameters.canvas_instance_id, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, ret);
  120. exclude = nullptr;
  121. return ret;
  122. }
  123. virtual int intersect_shape(const ShapeParameters &p_parameters, ShapeResult *r_results, int p_result_max) override {
  124. exclude = &p_parameters.exclude;
  125. int ret = 0;
  126. GDVIRTUAL_REQUIRED_CALL(_intersect_shape, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, ret);
  127. exclude = nullptr;
  128. return ret;
  129. }
  130. virtual bool cast_motion(const ShapeParameters &p_parameters, real_t &p_closest_safe, real_t &p_closest_unsafe) override {
  131. exclude = &p_parameters.exclude;
  132. bool ret = false;
  133. GDVIRTUAL_REQUIRED_CALL(_cast_motion, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, &p_closest_safe, &p_closest_unsafe, ret);
  134. exclude = nullptr;
  135. return ret;
  136. }
  137. virtual bool collide_shape(const ShapeParameters &p_parameters, Vector2 *r_results, int p_result_max, int &r_result_count) override {
  138. exclude = &p_parameters.exclude;
  139. bool ret = false;
  140. GDVIRTUAL_REQUIRED_CALL(_collide_shape, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_results, p_result_max, &r_result_count, ret);
  141. exclude = nullptr;
  142. return ret;
  143. }
  144. virtual bool rest_info(const ShapeParameters &p_parameters, ShapeRestInfo *r_info) override {
  145. exclude = &p_parameters.exclude;
  146. bool ret = false;
  147. GDVIRTUAL_REQUIRED_CALL(_rest_info, p_parameters.shape_rid, p_parameters.transform, p_parameters.motion, p_parameters.margin, p_parameters.collision_mask, p_parameters.collide_with_bodies, p_parameters.collide_with_areas, r_info, ret);
  148. exclude = nullptr;
  149. return ret;
  150. }
  151. PhysicsDirectSpaceState2DExtension();
  152. };
  153. typedef PhysicsServer2D::MotionResult PhysicsServer2DExtensionMotionResult;
  154. GDVIRTUAL_NATIVE_PTR(PhysicsServer2DExtensionMotionResult)
  155. class PhysicsServer2DExtension : public PhysicsServer2D {
  156. GDCLASS(PhysicsServer2DExtension, PhysicsServer2D);
  157. protected:
  158. static void _bind_methods();
  159. GDVIRTUAL9R(bool, _shape_collide, RID, const Transform2D &, const Vector2 &, RID, const Transform2D &, const Vector2 &, GDExtensionPtr<Vector2>, int, GDExtensionPtr<int>)
  160. GDVIRTUAL8R(bool, _body_collide_shape, RID, int, RID, const Transform2D &, const Vector2 &, GDExtensionPtr<Vector2>, int, GDExtensionPtr<int>)
  161. public:
  162. // The warning is valid, but unavoidable. If the function is not overridden it will error anyway.
  163. /* SHAPE API */
  164. EXBIND0R(RID, world_boundary_shape_create)
  165. EXBIND0R(RID, separation_ray_shape_create)
  166. EXBIND0R(RID, segment_shape_create)
  167. EXBIND0R(RID, circle_shape_create)
  168. EXBIND0R(RID, rectangle_shape_create)
  169. EXBIND0R(RID, capsule_shape_create)
  170. EXBIND0R(RID, convex_polygon_shape_create)
  171. EXBIND0R(RID, concave_polygon_shape_create)
  172. EXBIND2(shape_set_data, RID, const Variant &)
  173. EXBIND2(shape_set_custom_solver_bias, RID, real_t)
  174. EXBIND1RC(ShapeType, shape_get_type, RID)
  175. EXBIND1RC(Variant, shape_get_data, RID)
  176. EXBIND1RC(real_t, shape_get_custom_solver_bias, RID)
  177. virtual bool shape_collide(RID p_shape_A, const Transform2D &p_xform_A, const Vector2 &p_motion_A, RID p_shape_B, const Transform2D &p_xform_B, const Vector2 &p_motion_B, Vector2 *r_results, int p_result_max, int &r_result_count) override {
  178. bool ret = false;
  179. GDVIRTUAL_REQUIRED_CALL(_shape_collide, p_shape_A, p_xform_A, p_motion_A, p_shape_B, p_xform_B, p_motion_B, r_results, p_result_max, &r_result_count, ret);
  180. return ret;
  181. }
  182. /* SPACE API */
  183. EXBIND0R(RID, space_create)
  184. EXBIND2(space_set_active, RID, bool)
  185. EXBIND1RC(bool, space_is_active, RID)
  186. EXBIND3(space_set_param, RID, SpaceParameter, real_t)
  187. EXBIND2RC(real_t, space_get_param, RID, SpaceParameter)
  188. EXBIND1R(PhysicsDirectSpaceState2D *, space_get_direct_state, RID)
  189. EXBIND2(space_set_debug_contacts, RID, int)
  190. EXBIND1RC(Vector<Vector2>, space_get_contacts, RID)
  191. EXBIND1RC(int, space_get_contact_count, RID)
  192. /* AREA API */
  193. //EXBIND0RID(area);
  194. EXBIND0R(RID, area_create)
  195. EXBIND2(area_set_space, RID, RID)
  196. EXBIND1RC(RID, area_get_space, RID)
  197. EXBIND4(area_add_shape, RID, RID, const Transform2D &, bool)
  198. EXBIND3(area_set_shape, RID, int, RID)
  199. EXBIND3(area_set_shape_transform, RID, int, const Transform2D &)
  200. EXBIND3(area_set_shape_disabled, RID, int, bool)
  201. EXBIND1RC(int, area_get_shape_count, RID)
  202. EXBIND2RC(RID, area_get_shape, RID, int)
  203. EXBIND2RC(Transform2D, area_get_shape_transform, RID, int)
  204. EXBIND2(area_remove_shape, RID, int)
  205. EXBIND1(area_clear_shapes, RID)
  206. EXBIND2(area_attach_object_instance_id, RID, ObjectID)
  207. EXBIND1RC(ObjectID, area_get_object_instance_id, RID)
  208. EXBIND2(area_attach_canvas_instance_id, RID, ObjectID)
  209. EXBIND1RC(ObjectID, area_get_canvas_instance_id, RID)
  210. EXBIND3(area_set_param, RID, AreaParameter, const Variant &)
  211. EXBIND2(area_set_transform, RID, const Transform2D &)
  212. EXBIND2RC(Variant, area_get_param, RID, AreaParameter)
  213. EXBIND1RC(Transform2D, area_get_transform, RID)
  214. EXBIND2(area_set_collision_layer, RID, uint32_t)
  215. EXBIND1RC(uint32_t, area_get_collision_layer, RID)
  216. EXBIND2(area_set_collision_mask, RID, uint32_t)
  217. EXBIND1RC(uint32_t, area_get_collision_mask, RID)
  218. EXBIND2(area_set_monitorable, RID, bool)
  219. EXBIND2(area_set_pickable, RID, bool)
  220. EXBIND2(area_set_monitor_callback, RID, const Callable &)
  221. EXBIND2(area_set_area_monitor_callback, RID, const Callable &)
  222. /* BODY API */
  223. //EXBIND2RID(body,BodyMode,bool);
  224. EXBIND0R(RID, body_create)
  225. EXBIND2(body_set_space, RID, RID)
  226. EXBIND1RC(RID, body_get_space, RID)
  227. EXBIND2(body_set_mode, RID, BodyMode)
  228. EXBIND1RC(BodyMode, body_get_mode, RID)
  229. EXBIND4(body_add_shape, RID, RID, const Transform2D &, bool)
  230. EXBIND3(body_set_shape, RID, int, RID)
  231. EXBIND3(body_set_shape_transform, RID, int, const Transform2D &)
  232. EXBIND1RC(int, body_get_shape_count, RID)
  233. EXBIND2RC(RID, body_get_shape, RID, int)
  234. EXBIND2RC(Transform2D, body_get_shape_transform, RID, int)
  235. EXBIND3(body_set_shape_disabled, RID, int, bool)
  236. EXBIND4(body_set_shape_as_one_way_collision, RID, int, bool, real_t)
  237. EXBIND2(body_remove_shape, RID, int)
  238. EXBIND1(body_clear_shapes, RID)
  239. EXBIND2(body_attach_object_instance_id, RID, ObjectID)
  240. EXBIND1RC(ObjectID, body_get_object_instance_id, RID)
  241. EXBIND2(body_attach_canvas_instance_id, RID, ObjectID)
  242. EXBIND1RC(ObjectID, body_get_canvas_instance_id, RID)
  243. EXBIND2(body_set_continuous_collision_detection_mode, RID, CCDMode)
  244. EXBIND1RC(CCDMode, body_get_continuous_collision_detection_mode, RID)
  245. EXBIND2(body_set_collision_layer, RID, uint32_t)
  246. EXBIND1RC(uint32_t, body_get_collision_layer, RID)
  247. EXBIND2(body_set_collision_mask, RID, uint32_t)
  248. EXBIND1RC(uint32_t, body_get_collision_mask, RID)
  249. EXBIND2(body_set_collision_priority, RID, real_t)
  250. EXBIND1RC(real_t, body_get_collision_priority, RID)
  251. EXBIND3(body_set_param, RID, BodyParameter, const Variant &)
  252. EXBIND2RC(Variant, body_get_param, RID, BodyParameter)
  253. EXBIND1(body_reset_mass_properties, RID)
  254. EXBIND3(body_set_state, RID, BodyState, const Variant &)
  255. EXBIND2RC(Variant, body_get_state, RID, BodyState)
  256. EXBIND2(body_apply_central_impulse, RID, const Vector2 &)
  257. EXBIND2(body_apply_torque_impulse, RID, real_t)
  258. EXBIND3(body_apply_impulse, RID, const Vector2 &, const Vector2 &)
  259. EXBIND2(body_apply_central_force, RID, const Vector2 &)
  260. EXBIND3(body_apply_force, RID, const Vector2 &, const Vector2 &)
  261. EXBIND2(body_apply_torque, RID, real_t)
  262. EXBIND2(body_add_constant_central_force, RID, const Vector2 &)
  263. EXBIND3(body_add_constant_force, RID, const Vector2 &, const Vector2 &)
  264. EXBIND2(body_add_constant_torque, RID, real_t)
  265. EXBIND2(body_set_constant_force, RID, const Vector2 &)
  266. EXBIND1RC(Vector2, body_get_constant_force, RID)
  267. EXBIND2(body_set_constant_torque, RID, real_t)
  268. EXBIND1RC(real_t, body_get_constant_torque, RID)
  269. EXBIND2(body_set_axis_velocity, RID, const Vector2 &)
  270. EXBIND2(body_add_collision_exception, RID, RID)
  271. EXBIND2(body_remove_collision_exception, RID, RID)
  272. GDVIRTUAL1RC(TypedArray<RID>, _body_get_collision_exceptions, RID)
  273. void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) override {
  274. TypedArray<RID> ret;
  275. GDVIRTUAL_REQUIRED_CALL(_body_get_collision_exceptions, p_body, ret);
  276. for (int i = 0; i < ret.size(); i++) {
  277. p_exceptions->push_back(ret[i]);
  278. }
  279. }
  280. EXBIND2(body_set_max_contacts_reported, RID, int)
  281. EXBIND1RC(int, body_get_max_contacts_reported, RID)
  282. EXBIND2(body_set_contacts_reported_depth_threshold, RID, real_t)
  283. EXBIND1RC(real_t, body_get_contacts_reported_depth_threshold, RID)
  284. EXBIND2(body_set_omit_force_integration, RID, bool)
  285. EXBIND1RC(bool, body_is_omitting_force_integration, RID)
  286. EXBIND2(body_set_state_sync_callback, RID, const Callable &)
  287. EXBIND3(body_set_force_integration_callback, RID, const Callable &, const Variant &)
  288. virtual bool body_collide_shape(RID p_body, int p_body_shape, RID p_shape, const Transform2D &p_shape_xform, const Vector2 &p_motion, Vector2 *r_results, int p_result_max, int &r_result_count) override {
  289. bool ret = false;
  290. GDVIRTUAL_REQUIRED_CALL(_body_collide_shape, p_body, p_body_shape, p_shape, p_shape_xform, p_motion, r_results, p_result_max, &r_result_count, ret);
  291. return ret;
  292. }
  293. EXBIND2(body_set_pickable, RID, bool)
  294. EXBIND1R(PhysicsDirectBodyState2D *, body_get_direct_state, RID)
  295. GDVIRTUAL7RC(bool, _body_test_motion, RID, const Transform2D &, const Vector2 &, real_t, bool, bool, GDExtensionPtr<PhysicsServer2DExtensionMotionResult>)
  296. thread_local static const HashSet<RID> *exclude_bodies;
  297. thread_local static const HashSet<ObjectID> *exclude_objects;
  298. bool body_test_motion_is_excluding_body(RID p_body) const;
  299. bool body_test_motion_is_excluding_object(ObjectID p_object) const;
  300. bool body_test_motion(RID p_body, const MotionParameters &p_parameters, MotionResult *r_result = nullptr) override {
  301. bool ret = false;
  302. exclude_bodies = &p_parameters.exclude_bodies;
  303. exclude_objects = &p_parameters.exclude_objects;
  304. GDVIRTUAL_REQUIRED_CALL(_body_test_motion, p_body, p_parameters.from, p_parameters.motion, p_parameters.margin, p_parameters.collide_separation_ray, p_parameters.recovery_as_collision, r_result, ret);
  305. exclude_bodies = nullptr;
  306. exclude_objects = nullptr;
  307. return ret;
  308. }
  309. /* JOINT API */
  310. EXBIND0R(RID, joint_create)
  311. EXBIND1(joint_clear, RID)
  312. EXBIND3(joint_set_param, RID, JointParam, real_t)
  313. EXBIND2RC(real_t, joint_get_param, RID, JointParam)
  314. EXBIND2(joint_disable_collisions_between_bodies, RID, bool)
  315. EXBIND1RC(bool, joint_is_disabled_collisions_between_bodies, RID)
  316. EXBIND4(joint_make_pin, RID, const Vector2 &, RID, RID)
  317. EXBIND6(joint_make_groove, RID, const Vector2 &, const Vector2 &, const Vector2 &, RID, RID)
  318. EXBIND5(joint_make_damped_spring, RID, const Vector2 &, const Vector2 &, RID, RID)
  319. EXBIND3(pin_joint_set_flag, RID, PinJointFlag, bool)
  320. EXBIND2RC(bool, pin_joint_get_flag, RID, PinJointFlag)
  321. EXBIND3(pin_joint_set_param, RID, PinJointParam, real_t)
  322. EXBIND2RC(real_t, pin_joint_get_param, RID, PinJointParam)
  323. EXBIND3(damped_spring_joint_set_param, RID, DampedSpringParam, real_t)
  324. EXBIND2RC(real_t, damped_spring_joint_get_param, RID, DampedSpringParam)
  325. EXBIND1RC(JointType, joint_get_type, RID)
  326. /* MISC */
  327. GDVIRTUAL1(_free_rid, RID)
  328. virtual void free(RID p_rid) override {
  329. GDVIRTUAL_REQUIRED_CALL(_free_rid, p_rid);
  330. }
  331. EXBIND1(set_active, bool)
  332. EXBIND0(init)
  333. EXBIND1(step, real_t)
  334. EXBIND0(sync)
  335. EXBIND0(flush_queries)
  336. EXBIND0(end_sync)
  337. EXBIND0(finish)
  338. EXBIND0RC(bool, is_flushing_queries)
  339. EXBIND1R(int, get_process_info, ProcessInfo)
  340. PhysicsServer2DExtension();
  341. ~PhysicsServer2DExtension();
  342. };
  343. #endif // PHYSICS_SERVER_2D_EXTENSION_H