diff options
Diffstat (limited to 'modules/bullet/bullet_physics_server.cpp')
-rw-r--r-- | modules/bullet/bullet_physics_server.cpp | 426 |
1 files changed, 213 insertions, 213 deletions
diff --git a/modules/bullet/bullet_physics_server.cpp b/modules/bullet/bullet_physics_server.cpp index 89868babc6..2705c749a2 100644 --- a/modules/bullet/bullet_physics_server.cpp +++ b/modules/bullet/bullet_physics_server.cpp @@ -74,19 +74,19 @@ body->get_space()->add_constraint(joint, joint->is_disabled_collisions_between_bodies()); // <--------------- Joint creation asserts -void BulletPhysicsServer::_bind_methods() { - //ClassDB::bind_method(D_METHOD("DoTest"), &BulletPhysicsServer::DoTest); +void BulletPhysicsServer3D::_bind_methods() { + //ClassDB::bind_method(D_METHOD("DoTest"), &BulletPhysicsServer3D::DoTest); } -BulletPhysicsServer::BulletPhysicsServer() : - PhysicsServer(), +BulletPhysicsServer3D::BulletPhysicsServer3D() : + PhysicsServer3D(), active(true), active_spaces_count(0) {} -BulletPhysicsServer::~BulletPhysicsServer() {} +BulletPhysicsServer3D::~BulletPhysicsServer3D() {} -RID BulletPhysicsServer::shape_create(ShapeType p_shape) { - ShapeBullet *shape = NULL; +RID BulletPhysicsServer3D::shape_create(ShapeType p_shape) { + ShapeBullet *shape = nullptr; switch (p_shape) { case SHAPE_PLANE: { @@ -133,51 +133,51 @@ RID BulletPhysicsServer::shape_create(ShapeType p_shape) { CreateThenReturnRID(shape_owner, shape) } -void BulletPhysicsServer::shape_set_data(RID p_shape, const Variant &p_data) { +void BulletPhysicsServer3D::shape_set_data(RID p_shape, const Variant &p_data) { ShapeBullet *shape = shape_owner.getornull(p_shape); ERR_FAIL_COND(!shape); shape->set_data(p_data); } -void BulletPhysicsServer::shape_set_custom_solver_bias(RID p_shape, real_t p_bias) { +void BulletPhysicsServer3D::shape_set_custom_solver_bias(RID p_shape, real_t p_bias) { //WARN_PRINT("Bias not supported by Bullet physics engine"); } -PhysicsServer::ShapeType BulletPhysicsServer::shape_get_type(RID p_shape) const { +PhysicsServer3D::ShapeType BulletPhysicsServer3D::shape_get_type(RID p_shape) const { ShapeBullet *shape = shape_owner.getornull(p_shape); - ERR_FAIL_COND_V(!shape, PhysicsServer::SHAPE_CUSTOM); + ERR_FAIL_COND_V(!shape, PhysicsServer3D::SHAPE_CUSTOM); return shape->get_type(); } -Variant BulletPhysicsServer::shape_get_data(RID p_shape) const { +Variant BulletPhysicsServer3D::shape_get_data(RID p_shape) const { ShapeBullet *shape = shape_owner.getornull(p_shape); ERR_FAIL_COND_V(!shape, Variant()); return shape->get_data(); } -void BulletPhysicsServer::shape_set_margin(RID p_shape, real_t p_margin) { +void BulletPhysicsServer3D::shape_set_margin(RID p_shape, real_t p_margin) { ShapeBullet *shape = shape_owner.getornull(p_shape); ERR_FAIL_COND(!shape); shape->set_margin(p_margin); } -real_t BulletPhysicsServer::shape_get_margin(RID p_shape) const { +real_t BulletPhysicsServer3D::shape_get_margin(RID p_shape) const { ShapeBullet *shape = shape_owner.getornull(p_shape); ERR_FAIL_COND_V(!shape, 0.0); return shape->get_margin(); } -real_t BulletPhysicsServer::shape_get_custom_solver_bias(RID p_shape) const { +real_t BulletPhysicsServer3D::shape_get_custom_solver_bias(RID p_shape) const { //WARN_PRINT("Bias not supported by Bullet physics engine"); return 0.; } -RID BulletPhysicsServer::space_create() { +RID BulletPhysicsServer3D::space_create() { SpaceBullet *space = bulletnew(SpaceBullet); CreateThenReturnRID(space_owner, space); } -void BulletPhysicsServer::space_set_active(RID p_space, bool p_active) { +void BulletPhysicsServer3D::space_set_active(RID p_space, bool p_active) { SpaceBullet *space = space_owner.getornull(p_space); ERR_FAIL_COND(!space); @@ -195,64 +195,64 @@ void BulletPhysicsServer::space_set_active(RID p_space, bool p_active) { } } -bool BulletPhysicsServer::space_is_active(RID p_space) const { +bool BulletPhysicsServer3D::space_is_active(RID p_space) const { SpaceBullet *space = space_owner.getornull(p_space); ERR_FAIL_COND_V(!space, false); return -1 != active_spaces.find(space); } -void BulletPhysicsServer::space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) { +void BulletPhysicsServer3D::space_set_param(RID p_space, SpaceParameter p_param, real_t p_value) { SpaceBullet *space = space_owner.getornull(p_space); ERR_FAIL_COND(!space); space->set_param(p_param, p_value); } -real_t BulletPhysicsServer::space_get_param(RID p_space, SpaceParameter p_param) const { +real_t BulletPhysicsServer3D::space_get_param(RID p_space, SpaceParameter p_param) const { SpaceBullet *space = space_owner.getornull(p_space); ERR_FAIL_COND_V(!space, 0); return space->get_param(p_param); } -PhysicsDirectSpaceState *BulletPhysicsServer::space_get_direct_state(RID p_space) { +PhysicsDirectSpaceState3D *BulletPhysicsServer3D::space_get_direct_state(RID p_space) { SpaceBullet *space = space_owner.getornull(p_space); - ERR_FAIL_COND_V(!space, NULL); + ERR_FAIL_COND_V(!space, nullptr); return space->get_direct_state(); } -void BulletPhysicsServer::space_set_debug_contacts(RID p_space, int p_max_contacts) { +void BulletPhysicsServer3D::space_set_debug_contacts(RID p_space, int p_max_contacts) { SpaceBullet *space = space_owner.getornull(p_space); ERR_FAIL_COND(!space); space->set_debug_contacts(p_max_contacts); } -Vector<Vector3> BulletPhysicsServer::space_get_contacts(RID p_space) const { +Vector<Vector3> BulletPhysicsServer3D::space_get_contacts(RID p_space) const { SpaceBullet *space = space_owner.getornull(p_space); ERR_FAIL_COND_V(!space, Vector<Vector3>()); return space->get_debug_contacts(); } -int BulletPhysicsServer::space_get_contact_count(RID p_space) const { +int BulletPhysicsServer3D::space_get_contact_count(RID p_space) const { SpaceBullet *space = space_owner.getornull(p_space); ERR_FAIL_COND_V(!space, 0); return space->get_debug_contact_count(); } -RID BulletPhysicsServer::area_create() { +RID BulletPhysicsServer3D::area_create() { AreaBullet *area = bulletnew(AreaBullet); area->set_collision_layer(1); area->set_collision_mask(1); CreateThenReturnRID(area_owner, area) } -void BulletPhysicsServer::area_set_space(RID p_area, RID p_space) { +void BulletPhysicsServer3D::area_set_space(RID p_area, RID p_space) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); - SpaceBullet *space = NULL; + SpaceBullet *space = nullptr; if (p_space.is_valid()) { space = space_owner.getornull(p_space); ERR_FAIL_COND(!space); @@ -260,26 +260,26 @@ void BulletPhysicsServer::area_set_space(RID p_area, RID p_space) { area->set_space(space); } -RID BulletPhysicsServer::area_get_space(RID p_area) const { +RID BulletPhysicsServer3D::area_get_space(RID p_area) const { AreaBullet *area = area_owner.getornull(p_area); return area->get_space()->get_self(); } -void BulletPhysicsServer::area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) { +void BulletPhysicsServer3D::area_set_space_override_mode(RID p_area, AreaSpaceOverrideMode p_mode) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); area->set_spOv_mode(p_mode); } -PhysicsServer::AreaSpaceOverrideMode BulletPhysicsServer::area_get_space_override_mode(RID p_area) const { +PhysicsServer3D::AreaSpaceOverrideMode BulletPhysicsServer3D::area_get_space_override_mode(RID p_area) const { AreaBullet *area = area_owner.getornull(p_area); - ERR_FAIL_COND_V(!area, PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED); + ERR_FAIL_COND_V(!area, PhysicsServer3D::AREA_SPACE_OVERRIDE_DISABLED); return area->get_spOv_mode(); } -void BulletPhysicsServer::area_add_shape(RID p_area, RID p_shape, const Transform &p_transform, bool p_disabled) { +void BulletPhysicsServer3D::area_add_shape(RID p_area, RID p_shape, const Transform &p_transform, bool p_disabled) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); @@ -289,7 +289,7 @@ void BulletPhysicsServer::area_add_shape(RID p_area, RID p_shape, const Transfor area->add_shape(shape, p_transform, p_disabled); } -void BulletPhysicsServer::area_set_shape(RID p_area, int p_shape_idx, RID p_shape) { +void BulletPhysicsServer3D::area_set_shape(RID p_area, int p_shape_idx, RID p_shape) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); @@ -299,41 +299,41 @@ void BulletPhysicsServer::area_set_shape(RID p_area, int p_shape_idx, RID p_shap area->set_shape(p_shape_idx, shape); } -void BulletPhysicsServer::area_set_shape_transform(RID p_area, int p_shape_idx, const Transform &p_transform) { +void BulletPhysicsServer3D::area_set_shape_transform(RID p_area, int p_shape_idx, const Transform &p_transform) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); area->set_shape_transform(p_shape_idx, p_transform); } -int BulletPhysicsServer::area_get_shape_count(RID p_area) const { +int BulletPhysicsServer3D::area_get_shape_count(RID p_area) const { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND_V(!area, 0); return area->get_shape_count(); } -RID BulletPhysicsServer::area_get_shape(RID p_area, int p_shape_idx) const { +RID BulletPhysicsServer3D::area_get_shape(RID p_area, int p_shape_idx) const { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND_V(!area, RID()); return area->get_shape(p_shape_idx)->get_self(); } -Transform BulletPhysicsServer::area_get_shape_transform(RID p_area, int p_shape_idx) const { +Transform BulletPhysicsServer3D::area_get_shape_transform(RID p_area, int p_shape_idx) const { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND_V(!area, Transform()); return area->get_shape_transform(p_shape_idx); } -void BulletPhysicsServer::area_remove_shape(RID p_area, int p_shape_idx) { +void BulletPhysicsServer3D::area_remove_shape(RID p_area, int p_shape_idx) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); return area->remove_shape_full(p_shape_idx); } -void BulletPhysicsServer::area_clear_shapes(RID p_area) { +void BulletPhysicsServer3D::area_clear_shapes(RID p_area) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); @@ -341,14 +341,14 @@ void BulletPhysicsServer::area_clear_shapes(RID p_area) { area->remove_shape_full(0); } -void BulletPhysicsServer::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) { +void BulletPhysicsServer3D::area_set_shape_disabled(RID p_area, int p_shape_idx, bool p_disabled) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); area->set_shape_disabled(p_shape_idx, p_disabled); } -void BulletPhysicsServer::area_attach_object_instance_id(RID p_area, ObjectID p_id) { +void BulletPhysicsServer3D::area_attach_object_instance_id(RID p_area, ObjectID p_id) { if (space_owner.owns(p_area)) { return; } @@ -357,7 +357,7 @@ void BulletPhysicsServer::area_attach_object_instance_id(RID p_area, ObjectID p_ area->set_instance_id(p_id); } -ObjectID BulletPhysicsServer::area_get_object_instance_id(RID p_area) const { +ObjectID BulletPhysicsServer3D::area_get_object_instance_id(RID p_area) const { if (space_owner.owns(p_area)) { return ObjectID(); } @@ -366,7 +366,7 @@ ObjectID BulletPhysicsServer::area_get_object_instance_id(RID p_area) const { return area->get_instance_id(); } -void BulletPhysicsServer::area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) { +void BulletPhysicsServer3D::area_set_param(RID p_area, AreaParameter p_param, const Variant &p_value) { if (space_owner.owns(p_area)) { SpaceBullet *space = space_owner.getornull(p_area); if (space) { @@ -381,7 +381,7 @@ void BulletPhysicsServer::area_set_param(RID p_area, AreaParameter p_param, cons } } -Variant BulletPhysicsServer::area_get_param(RID p_area, AreaParameter p_param) const { +Variant BulletPhysicsServer3D::area_get_param(RID p_area, AreaParameter p_param) const { if (space_owner.owns(p_area)) { SpaceBullet *space = space_owner.getornull(p_area); return space->get_param(p_param); @@ -393,64 +393,64 @@ Variant BulletPhysicsServer::area_get_param(RID p_area, AreaParameter p_param) c } } -void BulletPhysicsServer::area_set_transform(RID p_area, const Transform &p_transform) { +void BulletPhysicsServer3D::area_set_transform(RID p_area, const Transform &p_transform) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); area->set_transform(p_transform); } -Transform BulletPhysicsServer::area_get_transform(RID p_area) const { +Transform BulletPhysicsServer3D::area_get_transform(RID p_area) const { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND_V(!area, Transform()); return area->get_transform(); } -void BulletPhysicsServer::area_set_collision_mask(RID p_area, uint32_t p_mask) { +void BulletPhysicsServer3D::area_set_collision_mask(RID p_area, uint32_t p_mask) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); area->set_collision_mask(p_mask); } -void BulletPhysicsServer::area_set_collision_layer(RID p_area, uint32_t p_layer) { +void BulletPhysicsServer3D::area_set_collision_layer(RID p_area, uint32_t p_layer) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); area->set_collision_layer(p_layer); } -void BulletPhysicsServer::area_set_monitorable(RID p_area, bool p_monitorable) { +void BulletPhysicsServer3D::area_set_monitorable(RID p_area, bool p_monitorable) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); area->set_monitorable(p_monitorable); } -void BulletPhysicsServer::area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) { +void BulletPhysicsServer3D::area_set_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); area->set_event_callback(CollisionObjectBullet::TYPE_RIGID_BODY, p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method); } -void BulletPhysicsServer::area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) { +void BulletPhysicsServer3D::area_set_area_monitor_callback(RID p_area, Object *p_receiver, const StringName &p_method) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); area->set_event_callback(CollisionObjectBullet::TYPE_AREA, p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method); } -void BulletPhysicsServer::area_set_ray_pickable(RID p_area, bool p_enable) { +void BulletPhysicsServer3D::area_set_ray_pickable(RID p_area, bool p_enable) { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND(!area); area->set_ray_pickable(p_enable); } -bool BulletPhysicsServer::area_is_ray_pickable(RID p_area) const { +bool BulletPhysicsServer3D::area_is_ray_pickable(RID p_area) const { AreaBullet *area = area_owner.getornull(p_area); ERR_FAIL_COND_V(!area, false); return area->is_ray_pickable(); } -RID BulletPhysicsServer::body_create(BodyMode p_mode, bool p_init_sleeping) { +RID BulletPhysicsServer3D::body_create(BodyMode p_mode, bool p_init_sleeping) { RigidBodyBullet *body = bulletnew(RigidBodyBullet); body->set_mode(p_mode); body->set_collision_layer(1); @@ -460,10 +460,10 @@ RID BulletPhysicsServer::body_create(BodyMode p_mode, bool p_init_sleeping) { CreateThenReturnRID(rigid_body_owner, body); } -void BulletPhysicsServer::body_set_space(RID p_body, RID p_space) { +void BulletPhysicsServer3D::body_set_space(RID p_body, RID p_space) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); - SpaceBullet *space = NULL; + SpaceBullet *space = nullptr; if (p_space.is_valid()) { space = space_owner.getornull(p_space); @@ -476,7 +476,7 @@ void BulletPhysicsServer::body_set_space(RID p_body, RID p_space) { body->set_space(space); } -RID BulletPhysicsServer::body_get_space(RID p_body) const { +RID BulletPhysicsServer3D::body_get_space(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, RID()); @@ -486,19 +486,19 @@ RID BulletPhysicsServer::body_get_space(RID p_body) const { return space->get_self(); } -void BulletPhysicsServer::body_set_mode(RID p_body, PhysicsServer::BodyMode p_mode) { +void BulletPhysicsServer3D::body_set_mode(RID p_body, PhysicsServer3D::BodyMode p_mode) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_mode(p_mode); } -PhysicsServer::BodyMode BulletPhysicsServer::body_get_mode(RID p_body) const { +PhysicsServer3D::BodyMode BulletPhysicsServer3D::body_get_mode(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, BODY_MODE_STATIC); return body->get_mode(); } -void BulletPhysicsServer::body_add_shape(RID p_body, RID p_shape, const Transform &p_transform, bool p_disabled) { +void BulletPhysicsServer3D::body_add_shape(RID p_body, RID p_shape, const Transform &p_transform, bool p_disabled) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); @@ -509,7 +509,7 @@ void BulletPhysicsServer::body_add_shape(RID p_body, RID p_shape, const Transfor body->add_shape(shape, p_transform, p_disabled); } -void BulletPhysicsServer::body_set_shape(RID p_body, int p_shape_idx, RID p_shape) { +void BulletPhysicsServer3D::body_set_shape(RID p_body, int p_shape_idx, RID p_shape) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); @@ -519,20 +519,20 @@ void BulletPhysicsServer::body_set_shape(RID p_body, int p_shape_idx, RID p_shap body->set_shape(p_shape_idx, shape); } -void BulletPhysicsServer::body_set_shape_transform(RID p_body, int p_shape_idx, const Transform &p_transform) { +void BulletPhysicsServer3D::body_set_shape_transform(RID p_body, int p_shape_idx, const Transform &p_transform) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_shape_transform(p_shape_idx, p_transform); } -int BulletPhysicsServer::body_get_shape_count(RID p_body) const { +int BulletPhysicsServer3D::body_get_shape_count(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_shape_count(); } -RID BulletPhysicsServer::body_get_shape(RID p_body, int p_shape_idx) const { +RID BulletPhysicsServer3D::body_get_shape(RID p_body, int p_shape_idx) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, RID()); @@ -542,113 +542,113 @@ RID BulletPhysicsServer::body_get_shape(RID p_body, int p_shape_idx) const { return shape->get_self(); } -Transform BulletPhysicsServer::body_get_shape_transform(RID p_body, int p_shape_idx) const { +Transform BulletPhysicsServer3D::body_get_shape_transform(RID p_body, int p_shape_idx) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, Transform()); return body->get_shape_transform(p_shape_idx); } -void BulletPhysicsServer::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) { +void BulletPhysicsServer3D::body_set_shape_disabled(RID p_body, int p_shape_idx, bool p_disabled) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_shape_disabled(p_shape_idx, p_disabled); } -void BulletPhysicsServer::body_remove_shape(RID p_body, int p_shape_idx) { +void BulletPhysicsServer3D::body_remove_shape(RID p_body, int p_shape_idx) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->remove_shape_full(p_shape_idx); } -void BulletPhysicsServer::body_clear_shapes(RID p_body) { +void BulletPhysicsServer3D::body_clear_shapes(RID p_body) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->remove_all_shapes(); } -void BulletPhysicsServer::body_attach_object_instance_id(RID p_body, ObjectID p_id) { +void BulletPhysicsServer3D::body_attach_object_instance_id(RID p_body, ObjectID p_id) { CollisionObjectBullet *body = get_collisin_object(p_body); ERR_FAIL_COND(!body); body->set_instance_id(p_id); } -ObjectID BulletPhysicsServer::body_get_object_instance_id(RID p_body) const { +ObjectID BulletPhysicsServer3D::body_get_object_instance_id(RID p_body) const { CollisionObjectBullet *body = get_collisin_object(p_body); ERR_FAIL_COND_V(!body, ObjectID()); return body->get_instance_id(); } -void BulletPhysicsServer::body_set_enable_continuous_collision_detection(RID p_body, bool p_enable) { +void BulletPhysicsServer3D::body_set_enable_continuous_collision_detection(RID p_body, bool p_enable) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_continuous_collision_detection(p_enable); } -bool BulletPhysicsServer::body_is_continuous_collision_detection_enabled(RID p_body) const { +bool BulletPhysicsServer3D::body_is_continuous_collision_detection_enabled(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, false); return body->is_continuous_collision_detection_enabled(); } -void BulletPhysicsServer::body_set_collision_layer(RID p_body, uint32_t p_layer) { +void BulletPhysicsServer3D::body_set_collision_layer(RID p_body, uint32_t p_layer) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_collision_layer(p_layer); } -uint32_t BulletPhysicsServer::body_get_collision_layer(RID p_body) const { +uint32_t BulletPhysicsServer3D::body_get_collision_layer(RID p_body) const { const RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_collision_layer(); } -void BulletPhysicsServer::body_set_collision_mask(RID p_body, uint32_t p_mask) { +void BulletPhysicsServer3D::body_set_collision_mask(RID p_body, uint32_t p_mask) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_collision_mask(p_mask); } -uint32_t BulletPhysicsServer::body_get_collision_mask(RID p_body) const { +uint32_t BulletPhysicsServer3D::body_get_collision_mask(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_collision_mask(); } -void BulletPhysicsServer::body_set_user_flags(RID p_body, uint32_t p_flags) { +void BulletPhysicsServer3D::body_set_user_flags(RID p_body, uint32_t p_flags) { // This function si not currently supported } -uint32_t BulletPhysicsServer::body_get_user_flags(RID p_body) const { +uint32_t BulletPhysicsServer3D::body_get_user_flags(RID p_body) const { // This function si not currently supported return 0; } -void BulletPhysicsServer::body_set_param(RID p_body, BodyParameter p_param, float p_value) { +void BulletPhysicsServer3D::body_set_param(RID p_body, BodyParameter p_param, float p_value) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_param(p_param, p_value); } -float BulletPhysicsServer::body_get_param(RID p_body, BodyParameter p_param) const { +float BulletPhysicsServer3D::body_get_param(RID p_body, BodyParameter p_param) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_param(p_param); } -void BulletPhysicsServer::body_set_kinematic_safe_margin(RID p_body, real_t p_margin) { +void BulletPhysicsServer3D::body_set_kinematic_safe_margin(RID p_body, real_t p_margin) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); @@ -658,7 +658,7 @@ void BulletPhysicsServer::body_set_kinematic_safe_margin(RID p_body, real_t p_ma } } -real_t BulletPhysicsServer::body_get_kinematic_safe_margin(RID p_body) const { +real_t BulletPhysicsServer3D::body_get_kinematic_safe_margin(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0); @@ -670,90 +670,90 @@ real_t BulletPhysicsServer::body_get_kinematic_safe_margin(RID p_body) const { return 0; } -void BulletPhysicsServer::body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) { +void BulletPhysicsServer3D::body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_state(p_state, p_variant); } -Variant BulletPhysicsServer::body_get_state(RID p_body, BodyState p_state) const { +Variant BulletPhysicsServer3D::body_get_state(RID p_body, BodyState p_state) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, Variant()); return body->get_state(p_state); } -void BulletPhysicsServer::body_set_applied_force(RID p_body, const Vector3 &p_force) { +void BulletPhysicsServer3D::body_set_applied_force(RID p_body, const Vector3 &p_force) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_applied_force(p_force); } -Vector3 BulletPhysicsServer::body_get_applied_force(RID p_body) const { +Vector3 BulletPhysicsServer3D::body_get_applied_force(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, Vector3()); return body->get_applied_force(); } -void BulletPhysicsServer::body_set_applied_torque(RID p_body, const Vector3 &p_torque) { +void BulletPhysicsServer3D::body_set_applied_torque(RID p_body, const Vector3 &p_torque) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_applied_torque(p_torque); } -Vector3 BulletPhysicsServer::body_get_applied_torque(RID p_body) const { +Vector3 BulletPhysicsServer3D::body_get_applied_torque(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, Vector3()); return body->get_applied_torque(); } -void BulletPhysicsServer::body_add_central_force(RID p_body, const Vector3 &p_force) { +void BulletPhysicsServer3D::body_add_central_force(RID p_body, const Vector3 &p_force) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->apply_central_force(p_force); } -void BulletPhysicsServer::body_add_force(RID p_body, const Vector3 &p_force, const Vector3 &p_pos) { +void BulletPhysicsServer3D::body_add_force(RID p_body, const Vector3 &p_force, const Vector3 &p_pos) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->apply_force(p_force, p_pos); } -void BulletPhysicsServer::body_add_torque(RID p_body, const Vector3 &p_torque) { +void BulletPhysicsServer3D::body_add_torque(RID p_body, const Vector3 &p_torque) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->apply_torque(p_torque); } -void BulletPhysicsServer::body_apply_central_impulse(RID p_body, const Vector3 &p_impulse) { +void BulletPhysicsServer3D::body_apply_central_impulse(RID p_body, const Vector3 &p_impulse) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->apply_central_impulse(p_impulse); } -void BulletPhysicsServer::body_apply_impulse(RID p_body, const Vector3 &p_pos, const Vector3 &p_impulse) { +void BulletPhysicsServer3D::body_apply_impulse(RID p_body, const Vector3 &p_pos, const Vector3 &p_impulse) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->apply_impulse(p_pos, p_impulse); } -void BulletPhysicsServer::body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse) { +void BulletPhysicsServer3D::body_apply_torque_impulse(RID p_body, const Vector3 &p_impulse) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->apply_torque_impulse(p_impulse); } -void BulletPhysicsServer::body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity) { +void BulletPhysicsServer3D::body_set_axis_velocity(RID p_body, const Vector3 &p_axis_velocity) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); @@ -764,19 +764,19 @@ void BulletPhysicsServer::body_set_axis_velocity(RID p_body, const Vector3 &p_ax body->set_linear_velocity(v); } -void BulletPhysicsServer::body_set_axis_lock(RID p_body, BodyAxis p_axis, bool p_lock) { +void BulletPhysicsServer3D::body_set_axis_lock(RID p_body, BodyAxis p_axis, bool p_lock) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_axis_lock(p_axis, p_lock); } -bool BulletPhysicsServer::body_is_axis_locked(RID p_body, BodyAxis p_axis) const { +bool BulletPhysicsServer3D::body_is_axis_locked(RID p_body, BodyAxis p_axis) const { const RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0); return body->is_axis_locked(p_axis); } -void BulletPhysicsServer::body_add_collision_exception(RID p_body, RID p_body_b) { +void BulletPhysicsServer3D::body_add_collision_exception(RID p_body, RID p_body_b) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); @@ -786,7 +786,7 @@ void BulletPhysicsServer::body_add_collision_exception(RID p_body, RID p_body_b) body->add_collision_exception(other_body); } -void BulletPhysicsServer::body_remove_collision_exception(RID p_body, RID p_body_b) { +void BulletPhysicsServer3D::body_remove_collision_exception(RID p_body, RID p_body_b) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); @@ -796,7 +796,7 @@ void BulletPhysicsServer::body_remove_collision_exception(RID p_body, RID p_body body->remove_collision_exception(other_body); } -void BulletPhysicsServer::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) { +void BulletPhysicsServer3D::body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); for (int i = 0; i < body->get_exceptions().size(); i++) { @@ -804,68 +804,68 @@ void BulletPhysicsServer::body_get_collision_exceptions(RID p_body, List<RID> *p } } -void BulletPhysicsServer::body_set_max_contacts_reported(RID p_body, int p_contacts) { +void BulletPhysicsServer3D::body_set_max_contacts_reported(RID p_body, int p_contacts) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_max_collisions_detection(p_contacts); } -int BulletPhysicsServer::body_get_max_contacts_reported(RID p_body) const { +int BulletPhysicsServer3D::body_get_max_contacts_reported(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_max_collisions_detection(); } -void BulletPhysicsServer::body_set_contacts_reported_depth_threshold(RID p_body, float p_threshold) { +void BulletPhysicsServer3D::body_set_contacts_reported_depth_threshold(RID p_body, float p_threshold) { // Not supported by bullet and even Godot } -float BulletPhysicsServer::body_get_contacts_reported_depth_threshold(RID p_body) const { +float BulletPhysicsServer3D::body_get_contacts_reported_depth_threshold(RID p_body) const { // Not supported by bullet and even Godot return 0.; } -void BulletPhysicsServer::body_set_omit_force_integration(RID p_body, bool p_omit) { +void BulletPhysicsServer3D::body_set_omit_force_integration(RID p_body, bool p_omit) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_omit_forces_integration(p_omit); } -bool BulletPhysicsServer::body_is_omitting_force_integration(RID p_body) const { +bool BulletPhysicsServer3D::body_is_omitting_force_integration(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, false); return body->get_omit_forces_integration(); } -void BulletPhysicsServer::body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata) { +void BulletPhysicsServer3D::body_set_force_integration_callback(RID p_body, Object *p_receiver, const StringName &p_method, const Variant &p_udata) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_force_integration_callback(p_receiver ? p_receiver->get_instance_id() : ObjectID(), p_method, p_udata); } -void BulletPhysicsServer::body_set_ray_pickable(RID p_body, bool p_enable) { +void BulletPhysicsServer3D::body_set_ray_pickable(RID p_body, bool p_enable) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_ray_pickable(p_enable); } -bool BulletPhysicsServer::body_is_ray_pickable(RID p_body) const { +bool BulletPhysicsServer3D::body_is_ray_pickable(RID p_body) const { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, false); return body->is_ray_pickable(); } -PhysicsDirectBodyState *BulletPhysicsServer::body_get_direct_state(RID p_body) { +PhysicsDirectBodyState3D *BulletPhysicsServer3D::body_get_direct_state(RID p_body) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); - ERR_FAIL_COND_V(!body, NULL); - return BulletPhysicsDirectBodyState::get_singleton(body); + ERR_FAIL_COND_V(!body, nullptr); + return BulletPhysicsDirectBodyState3D::get_singleton(body); } -bool BulletPhysicsServer::body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, MotionResult *r_result, bool p_exclude_raycast_shapes) { +bool BulletPhysicsServer3D::body_test_motion(RID p_body, const Transform &p_from, const Vector3 &p_motion, bool p_infinite_inertia, MotionResult *r_result, bool p_exclude_raycast_shapes) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, false); ERR_FAIL_COND_V(!body->get_space(), false); @@ -873,7 +873,7 @@ bool BulletPhysicsServer::body_test_motion(RID p_body, const Transform &p_from, return body->get_space()->test_body_motion(body, p_from, p_motion, p_infinite_inertia, r_result, p_exclude_raycast_shapes); } -int BulletPhysicsServer::body_test_ray_separation(RID p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin) { +int BulletPhysicsServer3D::body_test_ray_separation(RID p_body, const Transform &p_transform, bool p_infinite_inertia, Vector3 &r_recover_motion, SeparationResult *r_results, int p_result_max, float p_margin) { RigidBodyBullet *body = rigid_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0); ERR_FAIL_COND_V(!body->get_space(), 0); @@ -881,7 +881,7 @@ int BulletPhysicsServer::body_test_ray_separation(RID p_body, const Transform &p return body->get_space()->test_ray_separation(body, p_transform, p_infinite_inertia, r_recover_motion, r_results, p_result_max, p_margin); } -RID BulletPhysicsServer::soft_body_create(bool p_init_sleeping) { +RID BulletPhysicsServer3D::soft_body_create(bool p_init_sleeping) { SoftBodyBullet *body = bulletnew(SoftBodyBullet); body->set_collision_layer(1); body->set_collision_mask(1); @@ -890,17 +890,17 @@ RID BulletPhysicsServer::soft_body_create(bool p_init_sleeping) { CreateThenReturnRID(soft_body_owner, body); } -void BulletPhysicsServer::soft_body_update_visual_server(RID p_body, class SoftBodyVisualServerHandler *p_visual_server_handler) { +void BulletPhysicsServer3D::soft_body_update_rendering_server(RID p_body, class SoftBodyRenderingServerHandler *p_rendering_server_handler) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); - body->update_visual_server(p_visual_server_handler); + body->update_rendering_server(p_rendering_server_handler); } -void BulletPhysicsServer::soft_body_set_space(RID p_body, RID p_space) { +void BulletPhysicsServer3D::soft_body_set_space(RID p_body, RID p_space) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); - SpaceBullet *space = NULL; + SpaceBullet *space = nullptr; if (p_space.is_valid()) { space = space_owner.getornull(p_space); @@ -913,7 +913,7 @@ void BulletPhysicsServer::soft_body_set_space(RID p_body, RID p_space) { body->set_space(space); } -RID BulletPhysicsServer::soft_body_get_space(RID p_body) const { +RID BulletPhysicsServer3D::soft_body_get_space(RID p_body) const { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, RID()); @@ -923,42 +923,42 @@ RID BulletPhysicsServer::soft_body_get_space(RID p_body) const { return space->get_self(); } -void BulletPhysicsServer::soft_body_set_mesh(RID p_body, const REF &p_mesh) { +void BulletPhysicsServer3D::soft_body_set_mesh(RID p_body, const REF &p_mesh) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_soft_mesh(p_mesh); } -void BulletPhysicsServer::soft_body_set_collision_layer(RID p_body, uint32_t p_layer) { +void BulletPhysicsServer3D::soft_body_set_collision_layer(RID p_body, uint32_t p_layer) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_collision_layer(p_layer); } -uint32_t BulletPhysicsServer::soft_body_get_collision_layer(RID p_body) const { +uint32_t BulletPhysicsServer3D::soft_body_get_collision_layer(RID p_body) const { const SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_collision_layer(); } -void BulletPhysicsServer::soft_body_set_collision_mask(RID p_body, uint32_t p_mask) { +void BulletPhysicsServer3D::soft_body_set_collision_mask(RID p_body, uint32_t p_mask) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_collision_mask(p_mask); } -uint32_t BulletPhysicsServer::soft_body_get_collision_mask(RID p_body) const { +uint32_t BulletPhysicsServer3D::soft_body_get_collision_mask(RID p_body) const { const SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0); return body->get_collision_mask(); } -void BulletPhysicsServer::soft_body_add_collision_exception(RID p_body, RID p_body_b) { +void BulletPhysicsServer3D::soft_body_add_collision_exception(RID p_body, RID p_body_b) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); @@ -971,7 +971,7 @@ void BulletPhysicsServer::soft_body_add_collision_exception(RID p_body, RID p_bo body->add_collision_exception(other_body); } -void BulletPhysicsServer::soft_body_remove_collision_exception(RID p_body, RID p_body_b) { +void BulletPhysicsServer3D::soft_body_remove_collision_exception(RID p_body, RID p_body_b) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); @@ -984,7 +984,7 @@ void BulletPhysicsServer::soft_body_remove_collision_exception(RID p_body, RID p body->remove_collision_exception(other_body); } -void BulletPhysicsServer::soft_body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) { +void BulletPhysicsServer3D::soft_body_get_collision_exceptions(RID p_body, List<RID> *p_exceptions) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); for (int i = 0; i < body->get_exceptions().size(); i++) { @@ -992,25 +992,25 @@ void BulletPhysicsServer::soft_body_get_collision_exceptions(RID p_body, List<RI } } -void BulletPhysicsServer::soft_body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) { +void BulletPhysicsServer3D::soft_body_set_state(RID p_body, BodyState p_state, const Variant &p_variant) { // FIXME: Must be implemented. WARN_PRINT("soft_body_state is not implemented yet in Bullet backend."); } -Variant BulletPhysicsServer::soft_body_get_state(RID p_body, BodyState p_state) const { +Variant BulletPhysicsServer3D::soft_body_get_state(RID p_body, BodyState p_state) const { // FIXME: Must be implemented. WARN_PRINT("soft_body_state is not implemented yet in Bullet backend."); return Variant(); } -void BulletPhysicsServer::soft_body_set_transform(RID p_body, const Transform &p_transform) { +void BulletPhysicsServer3D::soft_body_set_transform(RID p_body, const Transform &p_transform) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_soft_transform(p_transform); } -Vector3 BulletPhysicsServer::soft_body_get_vertex_position(RID p_body, int vertex_index) const { +Vector3 BulletPhysicsServer3D::soft_body_get_vertex_position(RID p_body, int vertex_index) const { const SoftBodyBullet *body = soft_body_owner.getornull(p_body); Vector3 pos; ERR_FAIL_COND_V(!body, pos); @@ -1019,133 +1019,133 @@ Vector3 BulletPhysicsServer::soft_body_get_vertex_position(RID p_body, int verte return pos; } -void BulletPhysicsServer::soft_body_set_ray_pickable(RID p_body, bool p_enable) { +void BulletPhysicsServer3D::soft_body_set_ray_pickable(RID p_body, bool p_enable) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_ray_pickable(p_enable); } -bool BulletPhysicsServer::soft_body_is_ray_pickable(RID p_body) const { +bool BulletPhysicsServer3D::soft_body_is_ray_pickable(RID p_body) const { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, false); return body->is_ray_pickable(); } -void BulletPhysicsServer::soft_body_set_simulation_precision(RID p_body, int p_simulation_precision) { +void BulletPhysicsServer3D::soft_body_set_simulation_precision(RID p_body, int p_simulation_precision) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_simulation_precision(p_simulation_precision); } -int BulletPhysicsServer::soft_body_get_simulation_precision(RID p_body) { +int BulletPhysicsServer3D::soft_body_get_simulation_precision(RID p_body) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_simulation_precision(); } -void BulletPhysicsServer::soft_body_set_total_mass(RID p_body, real_t p_total_mass) { +void BulletPhysicsServer3D::soft_body_set_total_mass(RID p_body, real_t p_total_mass) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_total_mass(p_total_mass); } -real_t BulletPhysicsServer::soft_body_get_total_mass(RID p_body) { +real_t BulletPhysicsServer3D::soft_body_get_total_mass(RID p_body) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_total_mass(); } -void BulletPhysicsServer::soft_body_set_linear_stiffness(RID p_body, real_t p_stiffness) { +void BulletPhysicsServer3D::soft_body_set_linear_stiffness(RID p_body, real_t p_stiffness) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_linear_stiffness(p_stiffness); } -real_t BulletPhysicsServer::soft_body_get_linear_stiffness(RID p_body) { +real_t BulletPhysicsServer3D::soft_body_get_linear_stiffness(RID p_body) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_linear_stiffness(); } -void BulletPhysicsServer::soft_body_set_areaAngular_stiffness(RID p_body, real_t p_stiffness) { +void BulletPhysicsServer3D::soft_body_set_areaAngular_stiffness(RID p_body, real_t p_stiffness) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_areaAngular_stiffness(p_stiffness); } -real_t BulletPhysicsServer::soft_body_get_areaAngular_stiffness(RID p_body) { +real_t BulletPhysicsServer3D::soft_body_get_areaAngular_stiffness(RID p_body) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_areaAngular_stiffness(); } -void BulletPhysicsServer::soft_body_set_volume_stiffness(RID p_body, real_t p_stiffness) { +void BulletPhysicsServer3D::soft_body_set_volume_stiffness(RID p_body, real_t p_stiffness) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_volume_stiffness(p_stiffness); } -real_t BulletPhysicsServer::soft_body_get_volume_stiffness(RID p_body) { +real_t BulletPhysicsServer3D::soft_body_get_volume_stiffness(RID p_body) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_volume_stiffness(); } -void BulletPhysicsServer::soft_body_set_pressure_coefficient(RID p_body, real_t p_pressure_coefficient) { +void BulletPhysicsServer3D::soft_body_set_pressure_coefficient(RID p_body, real_t p_pressure_coefficient) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_pressure_coefficient(p_pressure_coefficient); } -real_t BulletPhysicsServer::soft_body_get_pressure_coefficient(RID p_body) { +real_t BulletPhysicsServer3D::soft_body_get_pressure_coefficient(RID p_body) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_pressure_coefficient(); } -void BulletPhysicsServer::soft_body_set_pose_matching_coefficient(RID p_body, real_t p_pose_matching_coefficient) { +void BulletPhysicsServer3D::soft_body_set_pose_matching_coefficient(RID p_body, real_t p_pose_matching_coefficient) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); return body->set_pose_matching_coefficient(p_pose_matching_coefficient); } -real_t BulletPhysicsServer::soft_body_get_pose_matching_coefficient(RID p_body) { +real_t BulletPhysicsServer3D::soft_body_get_pose_matching_coefficient(RID p_body) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_pose_matching_coefficient(); } -void BulletPhysicsServer::soft_body_set_damping_coefficient(RID p_body, real_t p_damping_coefficient) { +void BulletPhysicsServer3D::soft_body_set_damping_coefficient(RID p_body, real_t p_damping_coefficient) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_damping_coefficient(p_damping_coefficient); } -real_t BulletPhysicsServer::soft_body_get_damping_coefficient(RID p_body) { +real_t BulletPhysicsServer3D::soft_body_get_damping_coefficient(RID p_body) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_damping_coefficient(); } -void BulletPhysicsServer::soft_body_set_drag_coefficient(RID p_body, real_t p_drag_coefficient) { +void BulletPhysicsServer3D::soft_body_set_drag_coefficient(RID p_body, real_t p_drag_coefficient) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_drag_coefficient(p_drag_coefficient); } -real_t BulletPhysicsServer::soft_body_get_drag_coefficient(RID p_body) { +real_t BulletPhysicsServer3D::soft_body_get_drag_coefficient(RID p_body) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_drag_coefficient(); } -void BulletPhysicsServer::soft_body_move_point(RID p_body, int p_point_index, const Vector3 &p_global_position) { +void BulletPhysicsServer3D::soft_body_move_point(RID p_body, int p_point_index, const Vector3 &p_global_position) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_node_position(p_point_index, p_global_position); } -Vector3 BulletPhysicsServer::soft_body_get_point_global_position(RID p_body, int p_point_index) { +Vector3 BulletPhysicsServer3D::soft_body_get_point_global_position(RID p_body, int p_point_index) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, Vector3(0., 0., 0.)); Vector3 pos; @@ -1153,7 +1153,7 @@ Vector3 BulletPhysicsServer::soft_body_get_point_global_position(RID p_body, int return pos; } -Vector3 BulletPhysicsServer::soft_body_get_point_offset(RID p_body, int p_point_index) const { +Vector3 BulletPhysicsServer3D::soft_body_get_point_offset(RID p_body, int p_point_index) const { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, Vector3()); Vector3 res; @@ -1161,60 +1161,60 @@ Vector3 BulletPhysicsServer::soft_body_get_point_offset(RID p_body, int p_point_ return res; } -void BulletPhysicsServer::soft_body_remove_all_pinned_points(RID p_body) { +void BulletPhysicsServer3D::soft_body_remove_all_pinned_points(RID p_body) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->reset_all_node_mass(); } -void BulletPhysicsServer::soft_body_pin_point(RID p_body, int p_point_index, bool p_pin) { +void BulletPhysicsServer3D::soft_body_pin_point(RID p_body, int p_point_index, bool p_pin) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND(!body); body->set_node_mass(p_point_index, p_pin ? 0 : 1); } -bool BulletPhysicsServer::soft_body_is_point_pinned(RID p_body, int p_point_index) { +bool BulletPhysicsServer3D::soft_body_is_point_pinned(RID p_body, int p_point_index) { SoftBodyBullet *body = soft_body_owner.getornull(p_body); ERR_FAIL_COND_V(!body, 0.f); return body->get_node_mass(p_point_index); } -PhysicsServer::JointType BulletPhysicsServer::joint_get_type(RID p_joint) const { +PhysicsServer3D::JointType BulletPhysicsServer3D::joint_get_type(RID p_joint) const { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, JOINT_PIN); return joint->get_type(); } -void BulletPhysicsServer::joint_set_solver_priority(RID p_joint, int p_priority) { +void BulletPhysicsServer3D::joint_set_solver_priority(RID p_joint, int p_priority) { // Joint priority not supported by bullet } -int BulletPhysicsServer::joint_get_solver_priority(RID p_joint) const { +int BulletPhysicsServer3D::joint_get_solver_priority(RID p_joint) const { // Joint priority not supported by bullet return 0; } -void BulletPhysicsServer::joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) { +void BulletPhysicsServer3D::joint_disable_collisions_between_bodies(RID p_joint, const bool p_disable) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); joint->disable_collisions_between_bodies(p_disable); } -bool BulletPhysicsServer::joint_is_disabled_collisions_between_bodies(RID p_joint) const { +bool BulletPhysicsServer3D::joint_is_disabled_collisions_between_bodies(RID p_joint) const { JointBullet *joint(joint_owner.getornull(p_joint)); ERR_FAIL_COND_V(!joint, false); return joint->is_disabled_collisions_between_bodies(); } -RID BulletPhysicsServer::joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) { +RID BulletPhysicsServer3D::joint_create_pin(RID p_body_A, const Vector3 &p_local_A, RID p_body_B, const Vector3 &p_local_B) { RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); - RigidBodyBullet *body_B = NULL; + RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { body_B = rigid_body_owner.getornull(p_body_B); JointAssertSpace(body_B, "B", RID()); @@ -1229,7 +1229,7 @@ RID BulletPhysicsServer::joint_create_pin(RID p_body_A, const Vector3 &p_local_A CreateThenReturnRID(joint_owner, joint); } -void BulletPhysicsServer::pin_joint_set_param(RID p_joint, PinJointParam p_param, float p_value) { +void BulletPhysicsServer3D::pin_joint_set_param(RID p_joint, PinJointParam p_param, float p_value) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_PIN); @@ -1237,7 +1237,7 @@ void BulletPhysicsServer::pin_joint_set_param(RID p_joint, PinJointParam p_param pin_joint->set_param(p_param, p_value); } -float BulletPhysicsServer::pin_joint_get_param(RID p_joint, PinJointParam p_param) const { +float BulletPhysicsServer3D::pin_joint_get_param(RID p_joint, PinJointParam p_param) const { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, 0); ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, 0); @@ -1245,7 +1245,7 @@ float BulletPhysicsServer::pin_joint_get_param(RID p_joint, PinJointParam p_para return pin_joint->get_param(p_param); } -void BulletPhysicsServer::pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) { +void BulletPhysicsServer3D::pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_PIN); @@ -1253,7 +1253,7 @@ void BulletPhysicsServer::pin_joint_set_local_a(RID p_joint, const Vector3 &p_A) pin_joint->setPivotInA(p_A); } -Vector3 BulletPhysicsServer::pin_joint_get_local_a(RID p_joint) const { +Vector3 BulletPhysicsServer3D::pin_joint_get_local_a(RID p_joint) const { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, Vector3()); ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3()); @@ -1261,7 +1261,7 @@ Vector3 BulletPhysicsServer::pin_joint_get_local_a(RID p_joint) const { return pin_joint->getPivotInA(); } -void BulletPhysicsServer::pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) { +void BulletPhysicsServer3D::pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_PIN); @@ -1269,7 +1269,7 @@ void BulletPhysicsServer::pin_joint_set_local_b(RID p_joint, const Vector3 &p_B) pin_joint->setPivotInB(p_B); } -Vector3 BulletPhysicsServer::pin_joint_get_local_b(RID p_joint) const { +Vector3 BulletPhysicsServer3D::pin_joint_get_local_b(RID p_joint) const { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, Vector3()); ERR_FAIL_COND_V(joint->get_type() != JOINT_PIN, Vector3()); @@ -1277,12 +1277,12 @@ Vector3 BulletPhysicsServer::pin_joint_get_local_b(RID p_joint) const { return pin_joint->getPivotInB(); } -RID BulletPhysicsServer::joint_create_hinge(RID p_body_A, const Transform &p_hinge_A, RID p_body_B, const Transform &p_hinge_B) { +RID BulletPhysicsServer3D::joint_create_hinge(RID p_body_A, const Transform &p_hinge_A, RID p_body_B, const Transform &p_hinge_B) { RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); - RigidBodyBullet *body_B = NULL; + RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { body_B = rigid_body_owner.getornull(p_body_B); JointAssertSpace(body_B, "B", RID()); @@ -1297,12 +1297,12 @@ RID BulletPhysicsServer::joint_create_hinge(RID p_body_A, const Transform &p_hin CreateThenReturnRID(joint_owner, joint); } -RID BulletPhysicsServer::joint_create_hinge_simple(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) { +RID BulletPhysicsServer3D::joint_create_hinge_simple(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) { RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); - RigidBodyBullet *body_B = NULL; + RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { body_B = rigid_body_owner.getornull(p_body_B); JointAssertSpace(body_B, "B", RID()); @@ -1317,7 +1317,7 @@ RID BulletPhysicsServer::joint_create_hinge_simple(RID p_body_A, const Vector3 & CreateThenReturnRID(joint_owner, joint); } -void BulletPhysicsServer::hinge_joint_set_param(RID p_joint, HingeJointParam p_param, float p_value) { +void BulletPhysicsServer3D::hinge_joint_set_param(RID p_joint, HingeJointParam p_param, float p_value) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_HINGE); @@ -1325,7 +1325,7 @@ void BulletPhysicsServer::hinge_joint_set_param(RID p_joint, HingeJointParam p_p hinge_joint->set_param(p_param, p_value); } -float BulletPhysicsServer::hinge_joint_get_param(RID p_joint, HingeJointParam p_param) const { +float BulletPhysicsServer3D::hinge_joint_get_param(RID p_joint, HingeJointParam p_param) const { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, 0); ERR_FAIL_COND_V(joint->get_type() != JOINT_HINGE, 0); @@ -1333,7 +1333,7 @@ float BulletPhysicsServer::hinge_joint_get_param(RID p_joint, HingeJointParam p_ return hinge_joint->get_param(p_param); } -void BulletPhysicsServer::hinge_joint_set_flag(RID p_joint, HingeJointFlag p_flag, bool p_value) { +void BulletPhysicsServer3D::hinge_joint_set_flag(RID p_joint, HingeJointFlag p_flag, bool p_value) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_HINGE); @@ -1341,7 +1341,7 @@ void BulletPhysicsServer::hinge_joint_set_flag(RID p_joint, HingeJointFlag p_fla hinge_joint->set_flag(p_flag, p_value); } -bool BulletPhysicsServer::hinge_joint_get_flag(RID p_joint, HingeJointFlag p_flag) const { +bool BulletPhysicsServer3D::hinge_joint_get_flag(RID p_joint, HingeJointFlag p_flag) const { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, false); ERR_FAIL_COND_V(joint->get_type() != JOINT_HINGE, false); @@ -1349,12 +1349,12 @@ bool BulletPhysicsServer::hinge_joint_get_flag(RID p_joint, HingeJointFlag p_fla return hinge_joint->get_flag(p_flag); } -RID BulletPhysicsServer::joint_create_slider(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) { +RID BulletPhysicsServer3D::joint_create_slider(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) { RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); - RigidBodyBullet *body_B = NULL; + RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { body_B = rigid_body_owner.getornull(p_body_B); JointAssertSpace(body_B, "B", RID()); @@ -1369,7 +1369,7 @@ RID BulletPhysicsServer::joint_create_slider(RID p_body_A, const Transform &p_lo CreateThenReturnRID(joint_owner, joint); } -void BulletPhysicsServer::slider_joint_set_param(RID p_joint, SliderJointParam p_param, float p_value) { +void BulletPhysicsServer3D::slider_joint_set_param(RID p_joint, SliderJointParam p_param, float p_value) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_SLIDER); @@ -1377,7 +1377,7 @@ void BulletPhysicsServer::slider_joint_set_param(RID p_joint, SliderJointParam p slider_joint->set_param(p_param, p_value); } -float BulletPhysicsServer::slider_joint_get_param(RID p_joint, SliderJointParam p_param) const { +float BulletPhysicsServer3D::slider_joint_get_param(RID p_joint, SliderJointParam p_param) const { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, 0); ERR_FAIL_COND_V(joint->get_type() != JOINT_SLIDER, 0); @@ -1385,12 +1385,12 @@ float BulletPhysicsServer::slider_joint_get_param(RID p_joint, SliderJointParam return slider_joint->get_param(p_param); } -RID BulletPhysicsServer::joint_create_cone_twist(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) { +RID BulletPhysicsServer3D::joint_create_cone_twist(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) { RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); - RigidBodyBullet *body_B = NULL; + RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { body_B = rigid_body_owner.getornull(p_body_B); JointAssertSpace(body_B, "B", RID()); @@ -1403,7 +1403,7 @@ RID BulletPhysicsServer::joint_create_cone_twist(RID p_body_A, const Transform & CreateThenReturnRID(joint_owner, joint); } -void BulletPhysicsServer::cone_twist_joint_set_param(RID p_joint, ConeTwistJointParam p_param, float p_value) { +void BulletPhysicsServer3D::cone_twist_joint_set_param(RID p_joint, ConeTwistJointParam p_param, float p_value) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_CONE_TWIST); @@ -1411,7 +1411,7 @@ void BulletPhysicsServer::cone_twist_joint_set_param(RID p_joint, ConeTwistJoint coneTwist_joint->set_param(p_param, p_value); } -float BulletPhysicsServer::cone_twist_joint_get_param(RID p_joint, ConeTwistJointParam p_param) const { +float BulletPhysicsServer3D::cone_twist_joint_get_param(RID p_joint, ConeTwistJointParam p_param) const { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, 0.); ERR_FAIL_COND_V(joint->get_type() != JOINT_CONE_TWIST, 0.); @@ -1419,12 +1419,12 @@ float BulletPhysicsServer::cone_twist_joint_get_param(RID p_joint, ConeTwistJoin return coneTwist_joint->get_param(p_param); } -RID BulletPhysicsServer::joint_create_generic_6dof(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) { +RID BulletPhysicsServer3D::joint_create_generic_6dof(RID p_body_A, const Transform &p_local_frame_A, RID p_body_B, const Transform &p_local_frame_B) { RigidBodyBullet *body_A = rigid_body_owner.getornull(p_body_A); ERR_FAIL_COND_V(!body_A, RID()); JointAssertSpace(body_A, "A", RID()); - RigidBodyBullet *body_B = NULL; + RigidBodyBullet *body_B = nullptr; if (p_body_B.is_valid()) { body_B = rigid_body_owner.getornull(p_body_B); JointAssertSpace(body_B, "B", RID()); @@ -1439,7 +1439,7 @@ RID BulletPhysicsServer::joint_create_generic_6dof(RID p_body_A, const Transform CreateThenReturnRID(joint_owner, joint); } -void BulletPhysicsServer::generic_6dof_joint_set_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param, float p_value) { +void BulletPhysicsServer3D::generic_6dof_joint_set_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param, float p_value) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_6DOF); @@ -1447,7 +1447,7 @@ void BulletPhysicsServer::generic_6dof_joint_set_param(RID p_joint, Vector3::Axi generic_6dof_joint->set_param(p_axis, p_param, p_value); } -float BulletPhysicsServer::generic_6dof_joint_get_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param) { +float BulletPhysicsServer3D::generic_6dof_joint_get_param(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisParam p_param) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, 0); ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, 0); @@ -1455,7 +1455,7 @@ float BulletPhysicsServer::generic_6dof_joint_get_param(RID p_joint, Vector3::Ax return generic_6dof_joint->get_param(p_axis, p_param); } -void BulletPhysicsServer::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag, bool p_enable) { +void BulletPhysicsServer3D::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag, bool p_enable) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_6DOF); @@ -1463,7 +1463,7 @@ void BulletPhysicsServer::generic_6dof_joint_set_flag(RID p_joint, Vector3::Axis generic_6dof_joint->set_flag(p_axis, p_flag, p_enable); } -bool BulletPhysicsServer::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag) { +bool BulletPhysicsServer3D::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis p_axis, G6DOFJointAxisFlag p_flag) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, false); ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, false); @@ -1471,7 +1471,7 @@ bool BulletPhysicsServer::generic_6dof_joint_get_flag(RID p_joint, Vector3::Axis return generic_6dof_joint->get_flag(p_axis, p_flag); } -void BulletPhysicsServer::generic_6dof_joint_set_precision(RID p_joint, int p_precision) { +void BulletPhysicsServer3D::generic_6dof_joint_set_precision(RID p_joint, int p_precision) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND(!joint); ERR_FAIL_COND(joint->get_type() != JOINT_6DOF); @@ -1479,7 +1479,7 @@ void BulletPhysicsServer::generic_6dof_joint_set_precision(RID p_joint, int p_pr generic_6dof_joint->set_precision(p_precision); } -int BulletPhysicsServer::generic_6dof_joint_get_precision(RID p_joint) { +int BulletPhysicsServer3D::generic_6dof_joint_get_precision(RID p_joint) { JointBullet *joint = joint_owner.getornull(p_joint); ERR_FAIL_COND_V(!joint, 0); ERR_FAIL_COND_V(joint->get_type() != JOINT_6DOF, 0); @@ -1487,7 +1487,7 @@ int BulletPhysicsServer::generic_6dof_joint_get_precision(RID p_joint) { return generic_6dof_joint->get_precision(); } -void BulletPhysicsServer::free(RID p_rid) { +void BulletPhysicsServer3D::free(RID p_rid) { if (shape_owner.owns(p_rid)) { ShapeBullet *shape = shape_owner.getornull(p_rid); @@ -1503,7 +1503,7 @@ void BulletPhysicsServer::free(RID p_rid) { RigidBodyBullet *body = rigid_body_owner.getornull(p_rid); - body->set_space(NULL); + body->set_space(nullptr); body->remove_all_shapes(true, true); @@ -1514,7 +1514,7 @@ void BulletPhysicsServer::free(RID p_rid) { SoftBodyBullet *body = soft_body_owner.getornull(p_rid); - body->set_space(NULL); + body->set_space(nullptr); soft_body_owner.free(p_rid); bulletdelete(body); @@ -1523,7 +1523,7 @@ void BulletPhysicsServer::free(RID p_rid) { AreaBullet *area = area_owner.getornull(p_rid); - area->set_space(NULL); + area->set_space(nullptr); area->remove_all_shapes(true, true); @@ -1552,15 +1552,15 @@ void BulletPhysicsServer::free(RID p_rid) { } } -void BulletPhysicsServer::init() { - BulletPhysicsDirectBodyState::initSingleton(); +void BulletPhysicsServer3D::init() { + BulletPhysicsDirectBodyState3D::initSingleton(); } -void BulletPhysicsServer::step(float p_deltaTime) { +void BulletPhysicsServer3D::step(float p_deltaTime) { if (!active) return; - BulletPhysicsDirectBodyState::singleton_setDeltaTime(p_deltaTime); + BulletPhysicsDirectBodyState3D::singleton_setDeltaTime(p_deltaTime); for (int i = 0; i < active_spaces_count; ++i) { @@ -1568,21 +1568,21 @@ void BulletPhysicsServer::step(float p_deltaTime) { } } -void BulletPhysicsServer::sync() { +void BulletPhysicsServer3D::sync() { } -void BulletPhysicsServer::flush_queries() { +void BulletPhysicsServer3D::flush_queries() { } -void BulletPhysicsServer::finish() { - BulletPhysicsDirectBodyState::destroySingleton(); +void BulletPhysicsServer3D::finish() { + BulletPhysicsDirectBodyState3D::destroySingleton(); } -int BulletPhysicsServer::get_process_info(ProcessInfo p_info) { +int BulletPhysicsServer3D::get_process_info(ProcessInfo p_info) { return 0; } -CollisionObjectBullet *BulletPhysicsServer::get_collisin_object(RID p_object) const { +CollisionObjectBullet *BulletPhysicsServer3D::get_collisin_object(RID p_object) const { if (rigid_body_owner.owns(p_object)) { return rigid_body_owner.getornull(p_object); } @@ -1592,15 +1592,15 @@ CollisionObjectBullet *BulletPhysicsServer::get_collisin_object(RID p_object) co if (soft_body_owner.owns(p_object)) { return soft_body_owner.getornull(p_object); } - return NULL; + return nullptr; } -RigidCollisionObjectBullet *BulletPhysicsServer::get_rigid_collisin_object(RID p_object) const { +RigidCollisionObjectBullet *BulletPhysicsServer3D::get_rigid_collisin_object(RID p_object) const { if (rigid_body_owner.owns(p_object)) { return rigid_body_owner.getornull(p_object); } if (area_owner.owns(p_object)) { return area_owner.getornull(p_object); } - return NULL; + return nullptr; } |