diff options
author | Andrea Catania <info@andreacatania.com> | 2018-02-27 08:41:17 +0100 |
---|---|---|
committer | Andrea Catania <info@andreacatania.com> | 2018-02-27 08:41:17 +0100 |
commit | e1e78a51aa755a4e22d0ff7278185f6501ba3aa7 (patch) | |
tree | 2ac3499ab2f7c136a8eaf1694e8766cd7c7dc5f6 /modules/bullet/bullet_physics_server.cpp | |
parent | 1bd0fd90cc40349df9951b24244c1cfb6d3c494b (diff) | |
download | redot-engine-e1e78a51aa755a4e22d0ff7278185f6501ba3aa7.tar.gz |
Implemented Bullet method omit forces
Diffstat (limited to 'modules/bullet/bullet_physics_server.cpp')
-rw-r--r-- | modules/bullet/bullet_physics_server.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/modules/bullet/bullet_physics_server.cpp b/modules/bullet/bullet_physics_server.cpp index 61ce26e9fd..4a0c7499b4 100644 --- a/modules/bullet/bullet_physics_server.cpp +++ b/modules/bullet/bullet_physics_server.cpp @@ -619,11 +619,11 @@ uint32_t BulletPhysicsServer::body_get_collision_mask(RID p_body) const { } void BulletPhysicsServer::body_set_user_flags(RID p_body, uint32_t p_flags) { - WARN_PRINT("This function si not currently supported by bullet and Godot"); + // This function si not currently supported } uint32_t BulletPhysicsServer::body_get_user_flags(RID p_body) const { - WARN_PRINT("This function si not currently supported by bullet and Godot"); + // This function si not currently supported return 0; } @@ -784,21 +784,26 @@ int BulletPhysicsServer::body_get_max_contacts_reported(RID p_body) const { } void BulletPhysicsServer::body_set_contacts_reported_depth_threshold(RID p_body, float p_threshold) { - WARN_PRINT("Not supported by bullet and even Godot"); + // Not supported by bullet and even Godot } float BulletPhysicsServer::body_get_contacts_reported_depth_threshold(RID p_body) const { - WARN_PRINT("Not supported by bullet and even Godot"); + // Not supported by bullet and even Godot return 0.; } void BulletPhysicsServer::body_set_omit_force_integration(RID p_body, bool p_omit) { - WARN_PRINT("Not supported by bullet"); + RigidBodyBullet *body = rigid_body_owner.get(p_body); + ERR_FAIL_COND(!body); + + body->set_omit_forces_integration(p_omit); } bool BulletPhysicsServer::body_is_omitting_force_integration(RID p_body) const { - WARN_PRINT("Not supported by bullet"); - return false; + RigidBodyBullet *body = rigid_body_owner.get(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) { @@ -979,11 +984,11 @@ PhysicsServer::JointType BulletPhysicsServer::joint_get_type(RID p_joint) const } void BulletPhysicsServer::joint_set_solver_priority(RID p_joint, int p_priority) { - //WARN_PRINTS("Joint priority not supported by bullet"); + // Joint priority not supported by bullet } int BulletPhysicsServer::joint_get_solver_priority(RID p_joint) const { - //WARN_PRINTS("Joint priority not supported by bullet"); + // Joint priority not supported by bullet return 0; } |