diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-04-26 10:01:46 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-04-26 10:01:46 +0400 |
commit | f9597df32d6ed03c1552e4049d16465b5abb675b (patch) | |
tree | e539dc4fbc60a898da67ac85eb8da770683f495b /source/gameengine/Ketsji | |
parent | 45d0123a591adc11925396ff915642c2d88b61e7 (diff) |
added Bullet rigidbodies that behave like Sumo 'dynamic', without rotations. Done using a special hinge constraint (no translational degrees of freedom removed)
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index 876a2ff5e81..ddf6c5bb321 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -1062,6 +1062,7 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, ci.m_collisionShape = bm; + ci.m_friction = smmaterial->m_friction;//tweak the friction a bit, so the default 0.5 works nice @@ -1088,6 +1089,25 @@ void KX_ConvertBulletObject( class KX_GameObject* gameobj, if (objprop->m_disableSleeping) physicscontroller->GetRigidBody()->SetActivationState(DISABLE_DEACTIVATION); + if (!objprop->m_angular_rigidbody) + { + /* + //setting the inertia could achieve similar results to constraint the up + //but it is prone to instability, so use special 'Angular' constraint + SimdVector3 inertia = physicscontroller->GetRigidBody()->getInvInertiaDiagLocal(); + inertia.setX(0.f); + inertia.setZ(0.f); + + physicscontroller->GetRigidBody()->setInvInertiaDiagLocal(inertia); + physicscontroller->GetRigidBody()->updateInertiaTensor(); + */ + + env->createConstraint(physicscontroller,0,PHY_ANGULAR_CONSTRAINT,0,0,0,0,0,1); + + + + } + bool isActor = objprop->m_isactor; gameobj->getClientInfo()->m_type = (isActor ? KX_ClientObjectInfo::ACTOR : KX_ClientObjectInfo::STATIC); // store materialname in auxinfo, needed for touchsensors |