physics_server_3d_dummy.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. /**************************************************************************/
  2. /* physics_server_3d_dummy.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_3D_DUMMY_H
  31. #define PHYSICS_SERVER_3D_DUMMY_H
  32. #include "servers/physics_server_3d.h"
  33. class PhysicsDirectBodyState3DDummy : public PhysicsDirectBodyState3D {
  34. GDCLASS(PhysicsDirectBodyState3DDummy, PhysicsDirectBodyState3D);
  35. PhysicsDirectSpaceState3D *space_state_dummy = nullptr;
  36. public:
  37. virtual Vector3 get_total_gravity() const override { return Vector3(); }
  38. virtual real_t get_total_angular_damp() const override { return 0; }
  39. virtual real_t get_total_linear_damp() const override { return 0; }
  40. virtual Vector3 get_center_of_mass() const override { return Vector3(); }
  41. virtual Vector3 get_center_of_mass_local() const override { return Vector3(); }
  42. virtual Basis get_principal_inertia_axes() const override { return Basis(); }
  43. virtual real_t get_inverse_mass() const override { return 0; }
  44. virtual Vector3 get_inverse_inertia() const override { return Vector3(); }
  45. virtual Basis get_inverse_inertia_tensor() const override { return Basis(); }
  46. virtual void set_linear_velocity(const Vector3 &p_velocity) override {}
  47. virtual Vector3 get_linear_velocity() const override { return Vector3(); }
  48. virtual void set_angular_velocity(const Vector3 &p_velocity) override {}
  49. virtual Vector3 get_angular_velocity() const override { return Vector3(); }
  50. virtual void set_transform(const Transform3D &p_transform) override {}
  51. virtual Transform3D get_transform() const override { return Transform3D(); }
  52. virtual Vector3 get_velocity_at_local_position(const Vector3 &p_position) const override { return Vector3(); }
  53. virtual void apply_central_impulse(const Vector3 &p_impulse) override {}
  54. virtual void apply_impulse(const Vector3 &p_impulse, const Vector3 &p_position = Vector3()) override {}
  55. virtual void apply_torque_impulse(const Vector3 &p_impulse) override {}
  56. virtual void apply_central_force(const Vector3 &p_force) override {}
  57. virtual void apply_force(const Vector3 &p_force, const Vector3 &p_position = Vector3()) override {}
  58. virtual void apply_torque(const Vector3 &p_torque) override {}
  59. virtual void add_constant_central_force(const Vector3 &p_force) override {}
  60. virtual void add_constant_force(const Vector3 &p_force, const Vector3 &p_position = Vector3()) override {}
  61. virtual void add_constant_torque(const Vector3 &p_torque) override {}
  62. virtual void set_constant_force(const Vector3 &p_force) override {}
  63. virtual Vector3 get_constant_force() const override { return Vector3(); }
  64. virtual void set_constant_torque(const Vector3 &p_torque) override {}
  65. virtual Vector3 get_constant_torque() const override { return Vector3(); }
  66. virtual void set_sleep_state(bool p_sleep) override {}
  67. virtual bool is_sleeping() const override { return false; }
  68. virtual int get_contact_count() const override { return 0; }
  69. virtual Vector3 get_contact_local_position(int p_contact_idx) const override { return Vector3(); }
  70. virtual Vector3 get_contact_local_normal(int p_contact_idx) const override { return Vector3(); }
  71. virtual Vector3 get_contact_impulse(int p_contact_idx) const override { return Vector3(); }
  72. virtual int get_contact_local_shape(int p_contact_idx) const override { return 0; }
  73. virtual Vector3 get_contact_local_velocity_at_position(int p_contact_idx) const override { return Vector3(); }
  74. virtual RID get_contact_collider(int p_contact_idx) const override { return RID(); }
  75. virtual Vector3 get_contact_collider_position(int p_contact_idx) const override { return Vector3(); }
  76. virtual ObjectID get_contact_collider_id(int p_contact_idx) const override { return ObjectID(); }
  77. virtual Object *get_contact_collider_object(int p_contact_idx) const override { return nullptr; }
  78. virtual int get_contact_collider_shape(int p_contact_idx) const override { return 0; }
  79. virtual Vector3 get_contact_collider_velocity_at_position(int p_contact_idx) const override { return Vector3(); }
  80. virtual real_t get_step() const override { return 0; }
  81. virtual void integrate_forces() override {}
  82. virtual PhysicsDirectSpaceState3D *get_space_state() override { return space_state_dummy; }
  83. PhysicsDirectBodyState3DDummy(PhysicsDirectSpaceState3D *p_space_state_dummy) {
  84. space_state_dummy = p_space_state_dummy;
  85. }
  86. };
  87. class PhysicsDirectSpaceState3DDummy : public PhysicsDirectSpaceState3D {
  88. GDCLASS(PhysicsDirectSpaceState3DDummy, PhysicsDirectSpaceState3D);
  89. public:
  90. virtual bool intersect_ray(const RayParameters &p_parameters, RayResult &r_result) override { return false; }
  91. virtual int intersect_point(const PointParameters &p_parameters, ShapeResult *r_results, int p_result_max) override { return 0; }
  92. virtual int intersect_shape(const ShapeParameters &p_parameters, ShapeResult *r_results, int p_result_max) override { return 0; }
  93. virtual bool cast_motion(const ShapeParameters &p_parameters, real_t &p_closest_safe, real_t &p_closest_unsafe, ShapeRestInfo *r_info = nullptr) override { return false; }
  94. virtual bool collide_shape(const ShapeParameters &p_parameters, Vector3 *r_results, int p_result_max, int &r_result_count) override { return false; }
  95. virtual bool rest_info(const ShapeParameters &p_parameters, ShapeRestInfo *r_info) override { return false; }
  96. virtual Vector3 get_closest_point_to_object_volume(RID p_object, const Vector3 p_point) const override { return Vector3(); }
  97. };
  98. class PhysicsServer3DDummy : public PhysicsServer3D {
  99. GDCLASS(PhysicsServer3DDummy, PhysicsServer3D);
  100. PhysicsDirectBodyState3DDummy *body_state_dummy = nullptr;
  101. PhysicsDirectSpaceState3DDummy *space_state_dummy = nullptr;
  102. public:
  103. virtual RID world_boundary_shape_create() override { return RID(); }
  104. virtual RID separation_ray_shape_create() override { return RID(); }
  105. virtual RID sphere_shape_create() override { return RID(); }
  106. virtual RID box_shape_create() override { return RID(); }
  107. virtual RID capsule_shape_create() override { return RID(); }
  108. virtual RID cylinder_shape_create() override { return RID(); }
  109. virtual RID convex_polygon_shape_create() override { return RID(); }
  110. virtual RID concave_polygon_shape_create() override { return RID(); }
  111. virtual RID heightmap_shape_create() override { return RID(); }
  112. virtual RID custom_shape_create() override { return RID(); }
  113. virtual void shape_set_data(RID p_shape, const Variant &p_data) override {}
  114. virtual void shape_set_custom_solver_bias(RID p_shape, real_t p_bias) override {}
  115. virtual ShapeType shape_get_type(RID p_shape) const override { return SHAPE_SPHERE; }
  116. virtual Variant shape_get_data(RID p_shape) const override { return Variant(); }
  117. virtual void shape_set_margin(RID p_shape, real_t p_margin) override {}
  118. virtual real_t shape_get_margin(RID p_shape) const override { return 0; }
  119. virtual real_t shape_get_custom_solver_bias(RID p_shape) const override { return 0; }
  120. /* SPACE API */
  121. virtual RID space_create() override { return RID(); }
  122. virtual void space_set_active(RID p_space, bool p_active) override {}
  123. virtual bool space_is_active(RID p_space) const override { return false; }
  124. virtual void space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) override {}
  125. virtual real_t space_get_param(RID p_space, SpaceParameter p_param) const override { return 0; }
  126. virtual PhysicsDirectSpaceState3D *space_get_direct_state(RID p_space) override { return space_state_dummy; }
  127. virtual void space_set_debug_contacts(RID p_space, int p_max_contacts) override {}
  128. virtual Vector<Vector3> space_get_contacts(RID p_space) const override { return Vector<Vector3>(); }
  129. virtual int space_get_contact_count(RID p_space) const override { return 0; }
  130. /* AREA API */
  131. virtual RID area_create() override { return RID(); }
  132. virtual void area_set_space(RID p_area, RID p_space) override {}
  133. virtual RID area_get_space(RID p_area) const override { return RID(); }
  134. virtual void area_add_shape(RID p_area, RID p_shape, const Transform3D &p_transform = Transform3D(), bool p_disabled = false) override {}
  135. virtual void area_set_shape(RID p_area, int p_shape_idx, RID p_shape) override {}
  136. virtual void area_set_shape_transform(RID p_area, int p_shape_idx, const Transform3D &p_transform) override {}
  137. virtual int area_get_shape_count(RID p_area) const override { return 0; }
  138. virtual RID area_get_shape(RID p_area, int p_shape_idx) const override { return RID(); }
  139. virtual Transform3D area_get_shape_transform(RID p_area, int p_shape_idx) const override { return Transform3D(); }
  140. virtual void area_remove_shape(RID p_area, int p_shape_idx) override {}
  141. virtual void area_clear_shapes(RID p_area) override {}
  142. virtual void area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) override {}
  143. virtual void area_attach_object_instance_id(RID p_area, ObjectID p_id) override {}
  144. virtual ObjectID area_get_object_instance_id(RID p_area) const override { return ObjectID(); }
  145. virtual void area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) override {}
  146. virtual void area_set_transform(RID p_area, const Transform3D &p_transform) override {}
  147. virtual Variant area_get_param(RID p_parea, AreaParameter p_param) const override { return Variant(); }
  148. virtual Transform3D area_get_transform(RID p_area) const override { return Transform3D(); }
  149. virtual void area_set_collision_layer(RID p_area, uint32_t p_layer) override {}
  150. virtual uint32_t area_get_collision_layer(RID p_area) const override { return 0; }
  151. virtual void area_set_collision_mask(RID p_area, uint32_t p_mask) override {}
  152. virtual uint32_t area_get_collision_mask(RID p_area) const override { return 0; }
  153. virtual void area_set_monitorable(RID p_area, bool p_monitorable) override {}
  154. virtual void area_set_monitor_callback(RID p_area, const Callable &p_callback) override {}
  155. virtual void area_set_area_monitor_callback(RID p_area, const Callable &p_callback) override {}
  156. virtual void area_set_ray_pickable(RID p_area, bool p_enable) override {}
  157. /* BODY API */
  158. virtual RID body_create() override { return RID(); }
  159. virtual void body_set_space(RID p_body, RID p_space) override {}
  160. virtual RID body_get_space(RID p_body) const override { return RID(); }
  161. virtual void body_set_mode(RID p_body, BodyMode p_mode) override {}
  162. virtual BodyMode body_get_mode(RID p_body) const override { return BodyMode::BODY_MODE_STATIC; }
  163. virtual void body_add_shape(RID p_body, RID p_shape, const Transform3D &p_transform = Transform3D(), bool p_disabled = false) override {}
  164. virtual void body_set_shape(RID p_body, int p_shape_idx, RID p_shape) override {}
  165. virtual void body_set_shape_transform(RID p_body, int p_shape_idx, const Transform3D &p_transform) override {}
  166. virtual int body_get_shape_count(RID p_body) const override { return 0; }
  167. virtual RID body_get_shape(RID p_body, int p_shape_idx) const override { return RID(); }
  168. virtual Transform3D body_get_shape_transform(RID p_body, int p_shape_idx) const override { return Transform3D(); }
  169. virtual void body_remove_shape(RID p_body, int p_shape_idx) override {}
  170. virtual void body_clear_shapes(RID p_body) override {}
  171. virtual void body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) override {}
  172. virtual void body_attach_object_instance_id(RID p_body, ObjectID p_id) override {}
  173. virtual ObjectID body_get_object_instance_id(RID p_body) const override { return ObjectID(); }
  174. virtual void body_set_enable_continuous_collision_detection(RID p_body, bool p_enable) override {}
  175. virtual bool body_is_continuous_collision_detection_enabled(RID p_body) const override { return false; }
  176. virtual void body_set_collision_layer(RID p_body, uint32_t p_layer) override {}
  177. virtual uint32_t body_get_collision_layer(RID p_body) const override { return 0; }
  178. virtual void body_set_collision_mask(RID p_body, uint32_t p_mask) override {}
  179. virtual uint32_t body_get_collision_mask(RID p_body) const override { return 0; }
  180. virtual void body_set_collision_priority(RID p_body, real_t p_priority) override {}
  181. virtual real_t body_get_collision_priority(RID p_body) const override { return 0; }
  182. virtual void body_set_user_flags(RID p_body, uint32_t p_flags) override {}
  183. virtual uint32_t body_get_user_flags(RID p_body) const override { return 0; }
  184. virtual void body_set_param(RID p_body, BodyParameter p_param, const Variant &p_value) override {}
  185. virtual Variant body_get_param(RID p_body, BodyParameter p_param) const override { return Variant(); }
  186. virtual void body_reset_mass_properties(RID p_body) override {}
  187. virtual void body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) override {}
  188. virtual Variant body_get_state(RID p_body, BodyState p_state) const override { return Variant(); }
  189. virtual void body_apply_central_impulse(RID p_body, const Vector3 &p_impulse) override {}
  190. virtual void body_apply_impulse(RID p_body, const Vector3 &p_impulse, const Vector3 &p_position = Vector3()) override {}
  191. virtual void body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse) override {}
  192. virtual void body_apply_central_force(RID p_body, const Vector3 &p_force) override {}
  193. virtual void body_apply_force(RID p_body, const Vector3 &p_force, const Vector3 &p_position = Vector3()) override {}
  194. virtual void body_apply_torque(RID p_body, const Vector3 &p_torque) override {}
  195. virtual void body_add_constant_central_force(RID p_body, const Vector3 &p_force) override {}
  196. virtual void body_add_constant_force(RID p_body, const Vector3 &p_force, const Vector3 &p_position = Vector3()) override {}
  197. virtual void body_add_constant_torque(RID p_body, const Vector3 &p_torque) override {}
  198. virtual void body_set_constant_force(RID p_body, const Vector3 &p_force) override {}
  199. virtual Vector3 body_get_constant_force(RID p_body) const override { return Vector3(); }
  200. virtual void body_set_constant_torque(RID p_body, const Vector3 &p_torque) override {}
  201. virtual Vector3 body_get_constant_torque(RID p_body) const override { return Vector3(); }
  202. virtual void body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity) override {}
  203. virtual void body_set_axis_lock(RID p_body, BodyAxis p_axis, bool p_lock) override {}
  204. virtual bool body_is_axis_locked(RID p_body, BodyAxis p_axis) const override { return false; }
  205. virtual void body_add_collision_exception(RID p_body, RID p_body_b) override {}
  206. virtual void body_remove_collision_exception(RID p_body, RID p_body_b) override {}
  207. virtual void body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) override {}
  208. virtual void body_set_max_contacts_reported(RID p_body, int p_contacts) override {}
  209. virtual int body_get_max_contacts_reported(RID p_body) const override { return 0; }
  210. virtual void body_set_contacts_reported_depth_threshold(RID p_body, real_t p_threshold) override {}
  211. virtual real_t body_get_contacts_reported_depth_threshold(RID p_body) const override { return 0; }
  212. virtual void body_set_omit_force_integration(RID p_body, bool p_omit) override {}
  213. virtual bool body_is_omitting_force_integration(RID p_body) const override { return false; }
  214. virtual void body_set_state_sync_callback(RID p_body, const Callable &p_callable) override {}
  215. virtual void body_set_force_integration_callback(RID p_body, const Callable &p_callable, const Variant &p_udata = Variant()) override {}
  216. virtual void body_set_ray_pickable(RID p_body, bool p_enable) override {}
  217. virtual PhysicsDirectBodyState3D *body_get_direct_state(RID p_body) override { return body_state_dummy; }
  218. virtual bool body_test_motion(RID p_body, const MotionParameters &p_parameters, MotionResult *r_result = nullptr) override { return false; }
  219. /* SOFT BODY */
  220. virtual RID soft_body_create() override { return RID(); }
  221. virtual void soft_body_update_rendering_server(RID p_body, PhysicsServer3DRenderingServerHandler *p_rendering_server_handler) override {}
  222. virtual void soft_body_set_space(RID p_body, RID p_space) override {}
  223. virtual RID soft_body_get_space(RID p_body) const override { return RID(); }
  224. virtual void soft_body_set_mesh(RID p_body, RID p_mesh) override {}
  225. virtual AABB soft_body_get_bounds(RID p_body) const override { return AABB(); }
  226. virtual void soft_body_set_collision_layer(RID p_body, uint32_t p_layer) override {}
  227. virtual uint32_t soft_body_get_collision_layer(RID p_body) const override { return 0; }
  228. virtual void soft_body_set_collision_mask(RID p_body, uint32_t p_mask) override {}
  229. virtual uint32_t soft_body_get_collision_mask(RID p_body) const override { return 0; }
  230. virtual void soft_body_add_collision_exception(RID p_body, RID p_body_b) override {}
  231. virtual void soft_body_remove_collision_exception(RID p_body, RID p_body_b) override {}
  232. virtual void soft_body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) override {}
  233. virtual void soft_body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) override {}
  234. virtual Variant soft_body_get_state(RID p_body, BodyState p_state) const override { return Variant(); }
  235. virtual void soft_body_set_transform(RID p_body, const Transform3D &p_transform) override {}
  236. virtual void soft_body_set_ray_pickable(RID p_body, bool p_enable) override {}
  237. virtual void soft_body_set_simulation_precision(RID p_body, int p_simulation_precision) override {}
  238. virtual int soft_body_get_simulation_precision(RID p_body) const override { return 0; }
  239. virtual void soft_body_set_total_mass(RID p_body, real_t p_total_mass) override {}
  240. virtual real_t soft_body_get_total_mass(RID p_body) const override { return 0; }
  241. virtual void soft_body_set_linear_stiffness(RID p_body, real_t p_stiffness) override {}
  242. virtual real_t soft_body_get_linear_stiffness(RID p_body) const override { return 0; }
  243. virtual void soft_body_set_pressure_coefficient(RID p_body, real_t p_pressure_coefficient) override {}
  244. virtual real_t soft_body_get_pressure_coefficient(RID p_body) const override { return 0; }
  245. virtual void soft_body_set_damping_coefficient(RID p_body, real_t p_damping_coefficient) override {}
  246. virtual real_t soft_body_get_damping_coefficient(RID p_body) const override { return 0; }
  247. virtual void soft_body_set_drag_coefficient(RID p_body, real_t p_drag_coefficient) override {}
  248. virtual real_t soft_body_get_drag_coefficient(RID p_body) const override { return 0; }
  249. virtual void soft_body_move_point(RID p_body, int p_point_index, const Vector3 &p_global_position) override {}
  250. virtual Vector3 soft_body_get_point_global_position(RID p_body, int p_point_index) const override { return Vector3(); }
  251. virtual void soft_body_remove_all_pinned_points(RID p_body) override {}
  252. virtual void soft_body_pin_point(RID p_body, int p_point_index, bool p_pin) override {}
  253. virtual bool soft_body_is_point_pinned(RID p_body, int p_point_index) const override { return false; }
  254. /* JOINT API */
  255. virtual RID joint_create() override { return RID(); }
  256. virtual void joint_clear(RID p_joint) override {}
  257. virtual JointType joint_get_type(RID p_joint) const override { return JointType::JOINT_TYPE_PIN; }
  258. virtual void joint_set_solver_priority(RID p_joint, int p_priority) override {}
  259. virtual int joint_get_solver_priority(RID p_joint) const override { return 0; }
  260. virtual void joint_disable_collisions_between_bodies(RID p_joint, bool p_disable) override {}
  261. virtual bool joint_is_disabled_collisions_between_bodies(RID p_joint) const override { return false; }
  262. virtual void joint_make_pin(RID p_joint, RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) override {}
  263. virtual void pin_joint_set_param(RID p_joint, PinJointParam p_param, real_t p_value) override {}
  264. virtual real_t pin_joint_get_param(RID p_joint, PinJointParam p_param) const override { return 0; }
  265. virtual void pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) override {}
  266. virtual Vector3 pin_joint_get_local_a(RID p_joint) const override { return Vector3(); }
  267. virtual void pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) override {}
  268. virtual Vector3 pin_joint_get_local_b(RID p_joint) const override { return Vector3(); }
  269. virtual void joint_make_hinge(RID p_joint, RID p_body_A, const Transform3D &p_hinge_A, RID p_body_B, const Transform3D &p_hinge_B) override {}
  270. virtual void joint_make_hinge_simple(RID p_joint, RID p_body_A, const Vector3 &p_pivot_A, const Vector3 &p_axis_A, RID p_body_B, const Vector3 &p_pivot_B, const Vector3 &p_axis_B) override {}
  271. virtual void hinge_joint_set_param(RID p_joint, HingeJointParam p_param, real_t p_value) override {}
  272. virtual real_t hinge_joint_get_param(RID p_joint, HingeJointParam p_param) const override { return 0; }
  273. virtual void hinge_joint_set_flag(RID p_joint, HingeJointFlag p_flag, bool p_enabled) override {}
  274. virtual bool hinge_joint_get_flag(RID p_joint, HingeJointFlag p_flag) const override { return false; }
  275. virtual void joint_make_slider(RID p_joint, RID p_body_A, const Transform3D &p_local_frame_A, RID p_body_B, const Transform3D &p_local_frame_B) override {}
  276. virtual void slider_joint_set_param(RID p_joint, SliderJointParam p_param, real_t p_value) override {}
  277. virtual real_t slider_joint_get_param(RID p_joint, SliderJointParam p_param) const override { return 0; }
  278. virtual void joint_make_cone_twist(RID p_joint, RID p_body_A, const Transform3D &p_local_frame_A, RID p_body_B, const Transform3D &p_local_frame_B) override {}
  279. virtual void cone_twist_joint_set_param(RID p_joint, ConeTwistJointParam p_param, real_t p_value) override {}
  280. virtual real_t cone_twist_joint_get_param(RID p_joint, ConeTwistJointParam p_param) const override { return 0; }
  281. virtual void joint_make_generic_6dof(RID p_joint, RID p_body_A, const Transform3D &p_local_frame_A, RID p_body_B, const Transform3D &p_local_frame_B) override {}
  282. virtual void generic_6dof_joint_set_param(RID p_joint, Vector3::Axis, G6DOFJointAxisParam p_param, real_t p_value) override {}
  283. virtual real_t generic_6dof_joint_get_param(RID p_joint, Vector3::Axis, G6DOFJointAxisParam p_param) const override { return 0; }
  284. virtual void generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis, G6DOFJointAxisFlag p_flag, bool p_enable) override {}
  285. virtual bool generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis, G6DOFJointAxisFlag p_flag) const override { return false; }
  286. /* MISC */
  287. virtual void free(RID p_rid) override {}
  288. virtual void set_active(bool p_active) override {}
  289. virtual void init() override {
  290. space_state_dummy = memnew(PhysicsDirectSpaceState3DDummy);
  291. body_state_dummy = memnew(PhysicsDirectBodyState3DDummy(space_state_dummy));
  292. }
  293. virtual void step(real_t p_step) override {}
  294. virtual void sync() override {}
  295. virtual void flush_queries() override {}
  296. virtual void end_sync() override {}
  297. virtual void finish() override {
  298. memdelete(body_state_dummy);
  299. memdelete(space_state_dummy);
  300. }
  301. virtual bool is_flushing_queries() const override { return false; }
  302. virtual int get_process_info(ProcessInfo p_info) override { return 0; }
  303. };
  304. #endif // PHYSICS_SERVER_3D_DUMMY_H