| 1 | /**************************************************************************/ |
| 2 | /* physics_server_3d_extension.cpp */ |
| 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 | |
| 31 | #include "physics_server_3d_extension.h" |
| 32 | |
| 33 | bool PhysicsDirectSpaceState3DExtension::is_body_excluded_from_query(const RID &p_body) const { |
| 34 | return exclude && exclude->has(p_body); |
| 35 | } |
| 36 | |
| 37 | thread_local const HashSet<RID> *PhysicsDirectSpaceState3DExtension::exclude = nullptr; |
| 38 | |
| 39 | void PhysicsDirectSpaceState3DExtension::_bind_methods() { |
| 40 | ClassDB::bind_method(D_METHOD("is_body_excluded_from_query" , "body" ), &PhysicsDirectSpaceState3DExtension::is_body_excluded_from_query); |
| 41 | |
| 42 | GDVIRTUAL_BIND(_intersect_ray, "from" , "to" , "collision_mask" , "collide_with_bodies" , "collide_with_areas" , "hit_from_inside" , "hit_back_faces" , "pick_ray" , "result" ); |
| 43 | GDVIRTUAL_BIND(_intersect_point, "position" , "collision_mask" , "collide_with_bodies" , "collide_with_areas" , "results" , "max_results" ); |
| 44 | GDVIRTUAL_BIND(_intersect_shape, "shape_rid" , "transform" , "motion" , "margin" , "collision_mask" , "collide_with_bodies" , "collide_with_areas" , "result_count" , "max_results" ); |
| 45 | GDVIRTUAL_BIND(_cast_motion, "shape_rid" , "transform" , "motion" , "margin" , "collision_mask" , "collide_with_bodies" , "collide_with_areas" , "closest_safe" , "closest_unsafe" , "info" ); |
| 46 | GDVIRTUAL_BIND(_collide_shape, "shape_rid" , "transform" , "motion" , "margin" , "collision_mask" , "collide_with_bodies" , "collide_with_areas" , "results" , "max_results" , "result_count" ); |
| 47 | GDVIRTUAL_BIND(_rest_info, "shape_rid" , "transform" , "motion" , "margin" , "collision_mask" , "collide_with_bodies" , "collide_with_areas" , "rest_info" ); |
| 48 | GDVIRTUAL_BIND(_get_closest_point_to_object_volume, "object" , "point" ); |
| 49 | } |
| 50 | |
| 51 | PhysicsDirectSpaceState3DExtension::PhysicsDirectSpaceState3DExtension() { |
| 52 | } |
| 53 | |
| 54 | void PhysicsDirectBodyState3DExtension::_bind_methods() { |
| 55 | GDVIRTUAL_BIND(_get_total_gravity); |
| 56 | GDVIRTUAL_BIND(_get_total_linear_damp); |
| 57 | GDVIRTUAL_BIND(_get_total_angular_damp); |
| 58 | |
| 59 | GDVIRTUAL_BIND(_get_center_of_mass); |
| 60 | GDVIRTUAL_BIND(_get_center_of_mass_local); |
| 61 | GDVIRTUAL_BIND(_get_principal_inertia_axes); |
| 62 | |
| 63 | GDVIRTUAL_BIND(_get_inverse_mass); |
| 64 | GDVIRTUAL_BIND(_get_inverse_inertia); |
| 65 | GDVIRTUAL_BIND(_get_inverse_inertia_tensor); |
| 66 | |
| 67 | GDVIRTUAL_BIND(_set_linear_velocity, "velocity" ); |
| 68 | GDVIRTUAL_BIND(_get_linear_velocity); |
| 69 | |
| 70 | GDVIRTUAL_BIND(_set_angular_velocity, "velocity" ); |
| 71 | GDVIRTUAL_BIND(_get_angular_velocity); |
| 72 | |
| 73 | GDVIRTUAL_BIND(_set_transform, "transform" ); |
| 74 | GDVIRTUAL_BIND(_get_transform); |
| 75 | |
| 76 | GDVIRTUAL_BIND(_get_velocity_at_local_position, "local_position" ); |
| 77 | |
| 78 | GDVIRTUAL_BIND(_apply_central_impulse, "impulse" ); |
| 79 | GDVIRTUAL_BIND(_apply_impulse, "impulse" , "position" ); |
| 80 | GDVIRTUAL_BIND(_apply_torque_impulse, "impulse" ); |
| 81 | |
| 82 | GDVIRTUAL_BIND(_apply_central_force, "force" ); |
| 83 | GDVIRTUAL_BIND(_apply_force, "force" , "position" ); |
| 84 | GDVIRTUAL_BIND(_apply_torque, "torque" ); |
| 85 | |
| 86 | GDVIRTUAL_BIND(_add_constant_central_force, "force" ); |
| 87 | GDVIRTUAL_BIND(_add_constant_force, "force" , "position" ); |
| 88 | GDVIRTUAL_BIND(_add_constant_torque, "torque" ); |
| 89 | |
| 90 | GDVIRTUAL_BIND(_set_constant_force, "force" ); |
| 91 | GDVIRTUAL_BIND(_get_constant_force); |
| 92 | |
| 93 | GDVIRTUAL_BIND(_set_constant_torque, "torque" ); |
| 94 | GDVIRTUAL_BIND(_get_constant_torque); |
| 95 | |
| 96 | GDVIRTUAL_BIND(_set_sleep_state, "enabled" ); |
| 97 | GDVIRTUAL_BIND(_is_sleeping); |
| 98 | |
| 99 | GDVIRTUAL_BIND(_get_contact_count); |
| 100 | |
| 101 | GDVIRTUAL_BIND(_get_contact_local_position, "contact_idx" ); |
| 102 | GDVIRTUAL_BIND(_get_contact_local_normal, "contact_idx" ); |
| 103 | GDVIRTUAL_BIND(_get_contact_impulse, "contact_idx" ); |
| 104 | GDVIRTUAL_BIND(_get_contact_local_shape, "contact_idx" ); |
| 105 | GDVIRTUAL_BIND(_get_contact_local_velocity_at_position, "contact_idx" ); |
| 106 | GDVIRTUAL_BIND(_get_contact_collider, "contact_idx" ); |
| 107 | GDVIRTUAL_BIND(_get_contact_collider_position, "contact_idx" ); |
| 108 | GDVIRTUAL_BIND(_get_contact_collider_id, "contact_idx" ); |
| 109 | GDVIRTUAL_BIND(_get_contact_collider_object, "contact_idx" ); |
| 110 | GDVIRTUAL_BIND(_get_contact_collider_shape, "contact_idx" ); |
| 111 | GDVIRTUAL_BIND(_get_contact_collider_velocity_at_position, "contact_idx" ); |
| 112 | GDVIRTUAL_BIND(_get_step); |
| 113 | GDVIRTUAL_BIND(_integrate_forces); |
| 114 | GDVIRTUAL_BIND(_get_space_state); |
| 115 | } |
| 116 | |
| 117 | PhysicsDirectBodyState3DExtension::PhysicsDirectBodyState3DExtension() { |
| 118 | } |
| 119 | |
| 120 | thread_local const HashSet<RID> *PhysicsServer3DExtension::exclude_bodies = nullptr; |
| 121 | thread_local const HashSet<ObjectID> *PhysicsServer3DExtension::exclude_objects = nullptr; |
| 122 | |
| 123 | bool PhysicsServer3DExtension::body_test_motion_is_excluding_body(RID p_body) const { |
| 124 | return exclude_bodies && exclude_bodies->has(p_body); |
| 125 | } |
| 126 | |
| 127 | bool PhysicsServer3DExtension::body_test_motion_is_excluding_object(ObjectID p_object) const { |
| 128 | return exclude_objects && exclude_objects->has(p_object); |
| 129 | } |
| 130 | |
| 131 | void PhysicsServer3DExtension::_bind_methods() { |
| 132 | /* SHAPE API */ |
| 133 | |
| 134 | GDVIRTUAL_BIND(_world_boundary_shape_create); |
| 135 | GDVIRTUAL_BIND(_separation_ray_shape_create); |
| 136 | GDVIRTUAL_BIND(_sphere_shape_create); |
| 137 | GDVIRTUAL_BIND(_box_shape_create); |
| 138 | GDVIRTUAL_BIND(_capsule_shape_create); |
| 139 | GDVIRTUAL_BIND(_cylinder_shape_create); |
| 140 | GDVIRTUAL_BIND(_convex_polygon_shape_create); |
| 141 | GDVIRTUAL_BIND(_concave_polygon_shape_create); |
| 142 | GDVIRTUAL_BIND(_heightmap_shape_create); |
| 143 | GDVIRTUAL_BIND(_custom_shape_create); |
| 144 | |
| 145 | GDVIRTUAL_BIND(_shape_set_data, "shape" , "data" ); |
| 146 | GDVIRTUAL_BIND(_shape_set_custom_solver_bias, "shape" , "bias" ); |
| 147 | |
| 148 | GDVIRTUAL_BIND(_shape_set_margin, "shape" , "margin" ); |
| 149 | GDVIRTUAL_BIND(_shape_get_margin, "shape" ); |
| 150 | |
| 151 | GDVIRTUAL_BIND(_shape_get_type, "shape" ); |
| 152 | GDVIRTUAL_BIND(_shape_get_data, "shape" ); |
| 153 | GDVIRTUAL_BIND(_shape_get_custom_solver_bias, "shape" ); |
| 154 | |
| 155 | /* SPACE API */ |
| 156 | |
| 157 | GDVIRTUAL_BIND(_space_create); |
| 158 | GDVIRTUAL_BIND(_space_set_active, "space" , "active" ); |
| 159 | GDVIRTUAL_BIND(_space_is_active, "space" ); |
| 160 | |
| 161 | GDVIRTUAL_BIND(_space_set_param, "space" , "param" , "value" ); |
| 162 | GDVIRTUAL_BIND(_space_get_param, "space" , "param" ); |
| 163 | |
| 164 | GDVIRTUAL_BIND(_space_get_direct_state, "space" ); |
| 165 | |
| 166 | GDVIRTUAL_BIND(_space_set_debug_contacts, "space" , "max_contacts" ); |
| 167 | GDVIRTUAL_BIND(_space_get_contacts, "space" ); |
| 168 | GDVIRTUAL_BIND(_space_get_contact_count, "space" ); |
| 169 | |
| 170 | /* AREA API */ |
| 171 | |
| 172 | GDVIRTUAL_BIND(_area_create); |
| 173 | |
| 174 | GDVIRTUAL_BIND(_area_set_space, "area" , "space" ); |
| 175 | GDVIRTUAL_BIND(_area_get_space, "area" ); |
| 176 | |
| 177 | GDVIRTUAL_BIND(_area_add_shape, "area" , "shape" , "transform" , "disabled" ); |
| 178 | GDVIRTUAL_BIND(_area_set_shape, "area" , "shape_idx" , "shape" ); |
| 179 | GDVIRTUAL_BIND(_area_set_shape_transform, "area" , "shape_idx" , "transform" ); |
| 180 | GDVIRTUAL_BIND(_area_set_shape_disabled, "area" , "shape_idx" , "disabled" ); |
| 181 | |
| 182 | GDVIRTUAL_BIND(_area_get_shape_count, "area" ); |
| 183 | GDVIRTUAL_BIND(_area_get_shape, "area" , "shape_idx" ); |
| 184 | GDVIRTUAL_BIND(_area_get_shape_transform, "area" , "shape_idx" ); |
| 185 | |
| 186 | GDVIRTUAL_BIND(_area_remove_shape, "area" , "shape_idx" ); |
| 187 | GDVIRTUAL_BIND(_area_clear_shapes, "area" ); |
| 188 | |
| 189 | GDVIRTUAL_BIND(_area_attach_object_instance_id, "area" , "id" ); |
| 190 | GDVIRTUAL_BIND(_area_get_object_instance_id, "area" ); |
| 191 | |
| 192 | GDVIRTUAL_BIND(_area_set_param, "area" , "param" , "value" ); |
| 193 | GDVIRTUAL_BIND(_area_set_transform, "area" , "transform" ); |
| 194 | |
| 195 | GDVIRTUAL_BIND(_area_get_param, "area" , "param" ); |
| 196 | GDVIRTUAL_BIND(_area_get_transform, "area" ); |
| 197 | |
| 198 | GDVIRTUAL_BIND(_area_set_collision_layer, "area" , "layer" ); |
| 199 | GDVIRTUAL_BIND(_area_get_collision_layer, "area" ); |
| 200 | |
| 201 | GDVIRTUAL_BIND(_area_set_collision_mask, "area" , "mask" ); |
| 202 | GDVIRTUAL_BIND(_area_get_collision_mask, "area" ); |
| 203 | |
| 204 | GDVIRTUAL_BIND(_area_set_monitorable, "area" , "monitorable" ); |
| 205 | GDVIRTUAL_BIND(_area_set_ray_pickable, "area" , "enable" ); |
| 206 | |
| 207 | GDVIRTUAL_BIND(_area_set_monitor_callback, "area" , "callback" ); |
| 208 | GDVIRTUAL_BIND(_area_set_area_monitor_callback, "area" , "callback" ); |
| 209 | |
| 210 | /* BODY API */ |
| 211 | |
| 212 | ClassDB::bind_method(D_METHOD("body_test_motion_is_excluding_body" , "body" ), &PhysicsServer3DExtension::body_test_motion_is_excluding_body); |
| 213 | ClassDB::bind_method(D_METHOD("body_test_motion_is_excluding_object" , "object" ), &PhysicsServer3DExtension::body_test_motion_is_excluding_object); |
| 214 | |
| 215 | GDVIRTUAL_BIND(_body_create); |
| 216 | |
| 217 | GDVIRTUAL_BIND(_body_set_space, "body" , "space" ); |
| 218 | GDVIRTUAL_BIND(_body_get_space, "body" ); |
| 219 | |
| 220 | GDVIRTUAL_BIND(_body_set_mode, "body" , "mode" ); |
| 221 | GDVIRTUAL_BIND(_body_get_mode, "body" ); |
| 222 | |
| 223 | GDVIRTUAL_BIND(_body_add_shape, "body" , "shape" , "transform" , "disabled" ); |
| 224 | GDVIRTUAL_BIND(_body_set_shape, "body" , "shape_idx" , "shape" ); |
| 225 | GDVIRTUAL_BIND(_body_set_shape_transform, "body" , "shape_idx" , "transform" ); |
| 226 | GDVIRTUAL_BIND(_body_set_shape_disabled, "body" , "shape_idx" , "disabled" ); |
| 227 | |
| 228 | GDVIRTUAL_BIND(_body_get_shape_count, "body" ); |
| 229 | GDVIRTUAL_BIND(_body_get_shape, "body" , "shape_idx" ); |
| 230 | GDVIRTUAL_BIND(_body_get_shape_transform, "body" , "shape_idx" ); |
| 231 | |
| 232 | GDVIRTUAL_BIND(_body_remove_shape, "body" , "shape_idx" ); |
| 233 | GDVIRTUAL_BIND(_body_clear_shapes, "body" ); |
| 234 | |
| 235 | GDVIRTUAL_BIND(_body_attach_object_instance_id, "body" , "id" ); |
| 236 | GDVIRTUAL_BIND(_body_get_object_instance_id, "body" ); |
| 237 | |
| 238 | GDVIRTUAL_BIND(_body_set_enable_continuous_collision_detection, "body" , "enable" ); |
| 239 | GDVIRTUAL_BIND(_body_is_continuous_collision_detection_enabled, "body" ); |
| 240 | |
| 241 | GDVIRTUAL_BIND(_body_set_collision_layer, "body" , "layer" ); |
| 242 | GDVIRTUAL_BIND(_body_get_collision_layer, "body" ); |
| 243 | |
| 244 | GDVIRTUAL_BIND(_body_set_collision_mask, "body" , "mask" ); |
| 245 | GDVIRTUAL_BIND(_body_get_collision_mask, "body" ); |
| 246 | |
| 247 | GDVIRTUAL_BIND(_body_set_collision_priority, "body" , "priority" ); |
| 248 | GDVIRTUAL_BIND(_body_get_collision_priority, "body" ); |
| 249 | |
| 250 | GDVIRTUAL_BIND(_body_set_user_flags, "body" , "flags" ); |
| 251 | GDVIRTUAL_BIND(_body_get_user_flags, "body" ); |
| 252 | |
| 253 | GDVIRTUAL_BIND(_body_set_param, "body" , "param" , "value" ); |
| 254 | GDVIRTUAL_BIND(_body_get_param, "body" , "param" ); |
| 255 | |
| 256 | GDVIRTUAL_BIND(_body_reset_mass_properties, "body" ); |
| 257 | |
| 258 | GDVIRTUAL_BIND(_body_set_state, "body" , "state" , "value" ); |
| 259 | GDVIRTUAL_BIND(_body_get_state, "body" , "state" ); |
| 260 | |
| 261 | GDVIRTUAL_BIND(_body_apply_central_impulse, "body" , "impulse" ); |
| 262 | GDVIRTUAL_BIND(_body_apply_impulse, "body" , "impulse" , "position" ); |
| 263 | GDVIRTUAL_BIND(_body_apply_torque_impulse, "body" , "impulse" ); |
| 264 | |
| 265 | GDVIRTUAL_BIND(_body_apply_central_force, "body" , "force" ); |
| 266 | GDVIRTUAL_BIND(_body_apply_force, "body" , "force" , "position" ); |
| 267 | GDVIRTUAL_BIND(_body_apply_torque, "body" , "torque" ); |
| 268 | |
| 269 | GDVIRTUAL_BIND(_body_add_constant_central_force, "body" , "force" ); |
| 270 | GDVIRTUAL_BIND(_body_add_constant_force, "body" , "force" , "position" ); |
| 271 | GDVIRTUAL_BIND(_body_add_constant_torque, "body" , "torque" ); |
| 272 | |
| 273 | GDVIRTUAL_BIND(_body_set_constant_force, "body" , "force" ); |
| 274 | GDVIRTUAL_BIND(_body_get_constant_force, "body" ); |
| 275 | |
| 276 | GDVIRTUAL_BIND(_body_set_constant_torque, "body" , "torque" ); |
| 277 | GDVIRTUAL_BIND(_body_get_constant_torque, "body" ); |
| 278 | |
| 279 | GDVIRTUAL_BIND(_body_set_axis_velocity, "body" , "axis_velocity" ); |
| 280 | |
| 281 | GDVIRTUAL_BIND(_body_set_axis_lock, "body" , "axis" , "lock" ); |
| 282 | GDVIRTUAL_BIND(_body_is_axis_locked, "body" , "axis" ); |
| 283 | |
| 284 | GDVIRTUAL_BIND(_body_add_collision_exception, "body" , "excepted_body" ); |
| 285 | GDVIRTUAL_BIND(_body_remove_collision_exception, "body" , "excepted_body" ); |
| 286 | GDVIRTUAL_BIND(_body_get_collision_exceptions, "body" ); |
| 287 | |
| 288 | GDVIRTUAL_BIND(_body_set_max_contacts_reported, "body" , "amount" ); |
| 289 | GDVIRTUAL_BIND(_body_get_max_contacts_reported, "body" ); |
| 290 | |
| 291 | GDVIRTUAL_BIND(_body_set_contacts_reported_depth_threshold, "body" , "threshold" ); |
| 292 | GDVIRTUAL_BIND(_body_get_contacts_reported_depth_threshold, "body" ); |
| 293 | |
| 294 | GDVIRTUAL_BIND(_body_set_omit_force_integration, "body" , "enable" ); |
| 295 | GDVIRTUAL_BIND(_body_is_omitting_force_integration, "body" ); |
| 296 | |
| 297 | GDVIRTUAL_BIND(_body_set_state_sync_callback, "body" , "callable" ); |
| 298 | GDVIRTUAL_BIND(_body_set_force_integration_callback, "body" , "callable" , "userdata" ); |
| 299 | |
| 300 | GDVIRTUAL_BIND(_body_set_ray_pickable, "body" , "enable" ); |
| 301 | |
| 302 | GDVIRTUAL_BIND(_body_test_motion, "body" , "from" , "motion" , "margin" , "max_collisions" , "collide_separation_ray" , "recovery_as_collision" , "result" ); |
| 303 | |
| 304 | GDVIRTUAL_BIND(_body_get_direct_state, "body" ); |
| 305 | |
| 306 | /* SOFT BODY API */ |
| 307 | |
| 308 | GDVIRTUAL_BIND(_soft_body_create); |
| 309 | |
| 310 | GDVIRTUAL_BIND(_soft_body_update_rendering_server, "body" , "rendering_server_handler" ); |
| 311 | |
| 312 | GDVIRTUAL_BIND(_soft_body_set_space, "body" , "space" ); |
| 313 | GDVIRTUAL_BIND(_soft_body_get_space, "body" ); |
| 314 | |
| 315 | GDVIRTUAL_BIND(_soft_body_set_ray_pickable, "body" , "enable" ); |
| 316 | |
| 317 | GDVIRTUAL_BIND(_soft_body_set_collision_layer, "body" , "layer" ); |
| 318 | GDVIRTUAL_BIND(_soft_body_get_collision_layer, "body" ); |
| 319 | |
| 320 | GDVIRTUAL_BIND(_soft_body_set_collision_mask, "body" , "mask" ); |
| 321 | GDVIRTUAL_BIND(_soft_body_get_collision_mask, "body" ); |
| 322 | |
| 323 | GDVIRTUAL_BIND(_soft_body_add_collision_exception, "body" , "body_b" ); |
| 324 | GDVIRTUAL_BIND(_soft_body_remove_collision_exception, "body" , "body_b" ); |
| 325 | GDVIRTUAL_BIND(_soft_body_get_collision_exceptions, "body" ); |
| 326 | |
| 327 | GDVIRTUAL_BIND(_soft_body_set_state, "body" , "state" , "variant" ); |
| 328 | GDVIRTUAL_BIND(_soft_body_get_state, "body" , "state" ); |
| 329 | |
| 330 | GDVIRTUAL_BIND(_soft_body_set_transform, "body" , "transform" ); |
| 331 | |
| 332 | GDVIRTUAL_BIND(_soft_body_set_simulation_precision, "body" , "simulation_precision" ); |
| 333 | GDVIRTUAL_BIND(_soft_body_get_simulation_precision, "body" ); |
| 334 | |
| 335 | GDVIRTUAL_BIND(_soft_body_set_total_mass, "body" , "total_mass" ); |
| 336 | GDVIRTUAL_BIND(_soft_body_get_total_mass, "body" ); |
| 337 | |
| 338 | GDVIRTUAL_BIND(_soft_body_set_linear_stiffness, "body" , "linear_stiffness" ); |
| 339 | GDVIRTUAL_BIND(_soft_body_get_linear_stiffness, "body" ); |
| 340 | |
| 341 | GDVIRTUAL_BIND(_soft_body_set_pressure_coefficient, "body" , "pressure_coefficient" ); |
| 342 | GDVIRTUAL_BIND(_soft_body_get_pressure_coefficient, "body" ); |
| 343 | |
| 344 | GDVIRTUAL_BIND(_soft_body_set_damping_coefficient, "body" , "damping_coefficient" ); |
| 345 | GDVIRTUAL_BIND(_soft_body_get_damping_coefficient, "body" ); |
| 346 | |
| 347 | GDVIRTUAL_BIND(_soft_body_set_drag_coefficient, "body" , "drag_coefficient" ); |
| 348 | GDVIRTUAL_BIND(_soft_body_get_drag_coefficient, "body" ); |
| 349 | |
| 350 | GDVIRTUAL_BIND(_soft_body_set_mesh, "body" , "mesh" ); |
| 351 | |
| 352 | GDVIRTUAL_BIND(_soft_body_get_bounds, "body" ); |
| 353 | |
| 354 | GDVIRTUAL_BIND(_soft_body_move_point, "body" , "point_index" , "global_position" ); |
| 355 | GDVIRTUAL_BIND(_soft_body_get_point_global_position, "body" , "point_index" ); |
| 356 | |
| 357 | GDVIRTUAL_BIND(_soft_body_remove_all_pinned_points, "body" ); |
| 358 | GDVIRTUAL_BIND(_soft_body_pin_point, "body" , "point_index" , "pin" ); |
| 359 | GDVIRTUAL_BIND(_soft_body_is_point_pinned, "body" , "point_index" ); |
| 360 | |
| 361 | /* JOINT API */ |
| 362 | |
| 363 | GDVIRTUAL_BIND(_joint_create); |
| 364 | GDVIRTUAL_BIND(_joint_clear, "joint" ); |
| 365 | |
| 366 | GDVIRTUAL_BIND(_joint_make_pin, "joint" , "body_A" , "local_A" , "body_B" , "local_B" ); |
| 367 | |
| 368 | GDVIRTUAL_BIND(_pin_joint_set_param, "joint" , "param" , "value" ); |
| 369 | GDVIRTUAL_BIND(_pin_joint_get_param, "joint" , "param" ); |
| 370 | |
| 371 | GDVIRTUAL_BIND(_pin_joint_set_local_a, "joint" , "local_A" ); |
| 372 | GDVIRTUAL_BIND(_pin_joint_get_local_a, "joint" ); |
| 373 | |
| 374 | GDVIRTUAL_BIND(_pin_joint_set_local_b, "joint" , "local_B" ); |
| 375 | GDVIRTUAL_BIND(_pin_joint_get_local_b, "joint" ); |
| 376 | |
| 377 | GDVIRTUAL_BIND(_joint_make_hinge, "joint" , "body_A" , "hinge_A" , "body_B" , "hinge_B" ); |
| 378 | GDVIRTUAL_BIND(_joint_make_hinge_simple, "joint" , "body_A" , "pivot_A" , "axis_A" , "body_B" , "pivot_B" , "axis_B" ); |
| 379 | |
| 380 | GDVIRTUAL_BIND(_hinge_joint_set_param, "joint" , "param" , "value" ); |
| 381 | GDVIRTUAL_BIND(_hinge_joint_get_param, "joint" , "param" ); |
| 382 | |
| 383 | GDVIRTUAL_BIND(_hinge_joint_set_flag, "joint" , "flag" , "enabled" ); |
| 384 | GDVIRTUAL_BIND(_hinge_joint_get_flag, "joint" , "flag" ); |
| 385 | |
| 386 | GDVIRTUAL_BIND(_joint_make_slider, "joint" , "body_A" , "local_ref_A" , "body_B" , "local_ref_B" ); |
| 387 | |
| 388 | GDVIRTUAL_BIND(_slider_joint_set_param, "joint" , "param" , "value" ); |
| 389 | GDVIRTUAL_BIND(_slider_joint_get_param, "joint" , "param" ); |
| 390 | |
| 391 | GDVIRTUAL_BIND(_joint_make_cone_twist, "joint" , "body_A" , "local_ref_A" , "body_B" , "local_ref_B" ); |
| 392 | |
| 393 | GDVIRTUAL_BIND(_cone_twist_joint_set_param, "joint" , "param" , "value" ); |
| 394 | GDVIRTUAL_BIND(_cone_twist_joint_get_param, "joint" , "param" ); |
| 395 | |
| 396 | GDVIRTUAL_BIND(_joint_make_generic_6dof, "joint" , "body_A" , "local_ref_A" , "body_B" , "local_ref_B" ); |
| 397 | |
| 398 | GDVIRTUAL_BIND(_generic_6dof_joint_set_param, "joint" , "axis" , "param" , "value" ); |
| 399 | GDVIRTUAL_BIND(_generic_6dof_joint_get_param, "joint" , "axis" , "param" ); |
| 400 | |
| 401 | GDVIRTUAL_BIND(_generic_6dof_joint_set_flag, "joint" , "axis" , "flag" , "enable" ); |
| 402 | GDVIRTUAL_BIND(_generic_6dof_joint_get_flag, "joint" , "axis" , "flag" ); |
| 403 | |
| 404 | GDVIRTUAL_BIND(_joint_get_type, "joint" ); |
| 405 | |
| 406 | GDVIRTUAL_BIND(_joint_set_solver_priority, "joint" , "priority" ); |
| 407 | GDVIRTUAL_BIND(_joint_get_solver_priority, "joint" ); |
| 408 | |
| 409 | GDVIRTUAL_BIND(_joint_disable_collisions_between_bodies, "joint" , "disable" ); |
| 410 | GDVIRTUAL_BIND(_joint_is_disabled_collisions_between_bodies, "joint" ); |
| 411 | |
| 412 | GDVIRTUAL_BIND(_free_rid, "rid" ); |
| 413 | |
| 414 | GDVIRTUAL_BIND(_set_active, "active" ); |
| 415 | |
| 416 | GDVIRTUAL_BIND(_init); |
| 417 | GDVIRTUAL_BIND(_step, "step" ); |
| 418 | GDVIRTUAL_BIND(_sync); |
| 419 | GDVIRTUAL_BIND(_flush_queries); |
| 420 | GDVIRTUAL_BIND(_end_sync); |
| 421 | GDVIRTUAL_BIND(_finish); |
| 422 | |
| 423 | GDVIRTUAL_BIND(_is_flushing_queries); |
| 424 | GDVIRTUAL_BIND(_get_process_info, "process_info" ); |
| 425 | } |
| 426 | |
| 427 | PhysicsServer3DExtension::PhysicsServer3DExtension() { |
| 428 | } |
| 429 | |
| 430 | PhysicsServer3DExtension::~PhysicsServer3DExtension() { |
| 431 | } |
| 432 | |