summaryrefslogtreecommitdiff
path: root/modules/bullet
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bullet')
-rw-r--r--modules/bullet/bullet_physics_server.h2
-rw-r--r--modules/bullet/rigid_body_bullet.cpp16
2 files changed, 9 insertions, 9 deletions
diff --git a/modules/bullet/bullet_physics_server.h b/modules/bullet/bullet_physics_server.h
index 6df913ff80..d34d619ba2 100644
--- a/modules/bullet/bullet_physics_server.h
+++ b/modules/bullet/bullet_physics_server.h
@@ -166,7 +166,7 @@ public:
/* RIGID BODY API */
- virtual RID body_create(BodyMode p_mode = BODY_MODE_RIGID, bool p_init_sleeping = false) override;
+ virtual RID body_create(BodyMode p_mode = BODY_MODE_DYNAMIC, bool p_init_sleeping = false) override;
virtual void body_set_space(RID p_body, RID p_space) override;
virtual RID body_get_space(RID p_body) const override;
diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp
index def978cf14..ce39d4f0df 100644
--- a/modules/bullet/rigid_body_bullet.cpp
+++ b/modules/bullet/rigid_body_bullet.cpp
@@ -268,7 +268,7 @@ RigidBodyBullet::RigidBodyBullet() :
reload_shapes();
setupBulletCollisionObject(btBody);
- set_mode(PhysicsServer3D::BODY_MODE_RIGID);
+ set_mode(PhysicsServer3D::BODY_MODE_DYNAMIC);
reload_axis_lock();
areasWhereIam.resize(maxAreasWhereIam);
@@ -531,14 +531,14 @@ void RigidBodyBullet::set_mode(PhysicsServer3D::BodyMode p_mode) {
reload_axis_lock();
_internal_set_mass(0);
break;
- case PhysicsServer3D::BODY_MODE_RIGID:
- mode = PhysicsServer3D::BODY_MODE_RIGID;
+ case PhysicsServer3D::BODY_MODE_DYNAMIC:
+ mode = PhysicsServer3D::BODY_MODE_DYNAMIC;
reload_axis_lock();
_internal_set_mass(0 == mass ? 1 : mass);
scratch_space_override_modificator();
break;
- case PhysicsServer3D::BODY_MODE_CHARACTER:
- mode = PhysicsServer3D::BODY_MODE_CHARACTER;
+ case PhysicsServer3D::MODE_DYNAMIC_LOCKED:
+ mode = PhysicsServer3D::MODE_DYNAMIC_LOCKED;
reload_axis_lock();
_internal_set_mass(0 == mass ? 1 : mass);
scratch_space_override_modificator();
@@ -711,7 +711,7 @@ bool RigidBodyBullet::is_axis_locked(PhysicsServer3D::BodyAxis p_axis) const {
void RigidBodyBullet::reload_axis_lock() {
btBody->setLinearFactor(btVector3(btScalar(!is_axis_locked(PhysicsServer3D::BODY_AXIS_LINEAR_X)), btScalar(!is_axis_locked(PhysicsServer3D::BODY_AXIS_LINEAR_Y)), btScalar(!is_axis_locked(PhysicsServer3D::BODY_AXIS_LINEAR_Z))));
- if (PhysicsServer3D::BODY_MODE_CHARACTER == mode) {
+ if (PhysicsServer3D::MODE_DYNAMIC_LOCKED == mode) {
/// When character angular is always locked
btBody->setAngularFactor(btVector3(0., 0., 0.));
} else {
@@ -1006,7 +1006,7 @@ void RigidBodyBullet::_internal_set_mass(real_t p_mass) {
// Rigidbody is dynamic if and only if mass is non Zero, otherwise static
const bool isDynamic = p_mass != 0.f;
if (isDynamic) {
- if (PhysicsServer3D::BODY_MODE_RIGID != mode && PhysicsServer3D::BODY_MODE_CHARACTER != mode) {
+ if (PhysicsServer3D::BODY_MODE_DYNAMIC != mode && PhysicsServer3D::MODE_DYNAMIC_LOCKED != mode) {
return;
}
@@ -1015,7 +1015,7 @@ void RigidBodyBullet::_internal_set_mass(real_t p_mass) {
mainShape->calculateLocalInertia(p_mass, localInertia);
}
- if (PhysicsServer3D::BODY_MODE_RIGID == mode) {
+ if (PhysicsServer3D::BODY_MODE_DYNAMIC == mode) {
btBody->setCollisionFlags(clearedCurrentFlags); // Just set the flags without Kin and Static
} else {
btBody->setCollisionFlags(clearedCurrentFlags | btCollisionObject::CF_CHARACTER_OBJECT);