diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-12-25 05:02:13 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-12-25 05:02:13 +0300 |
commit | e820cdf6a0ab757cd83ffafd0ea04d736c3faa63 (patch) | |
tree | c412336bc8dcee4fad535e46205ddffd905ac37e /source | |
parent | 0e094ffcab8ae40ce06584c02292102d53ece77d (diff) |
fixing some issues: force needs to wake up objects, property sensor issue, island activation issue
Diffstat (limited to 'source')
4 files changed, 16 insertions, 2 deletions
diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index 979ce51ab5e..09332b870c9 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -268,7 +268,7 @@ bool SCA_PropertySensor::CheckPropertyCondition() m_recentresult=result; } else { - m_recentresult=true; + m_recentresult=result;//true; } return result; } diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index 67f4fb69e72..a01673f569f 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -90,7 +90,8 @@ bool KX_NetworkMessageSensor::Evaluate(CValue* event) bool result = false; bool WasUp = m_IsUp; - m_IsUp = false; +// m_IsUp = false; + if (m_BodyList) { m_BodyList->Release(); m_BodyList = NULL; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 3ddac72618d..d3eb4db6f35 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -379,6 +379,10 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torque { btVector3 torque(torqueX,torqueY,torqueZ); btTransform xform = m_body->getCenterOfMassTransform(); + if (torque.length2() > (SIMD_EPSILON*SIMD_EPSILON)) + { + m_body->activate(); + } if (local) { torque = xform.getBasis()*torque; @@ -389,6 +393,13 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torque void CcdPhysicsController::ApplyForce(float forceX,float forceY,float forceZ,bool local) { btVector3 force(forceX,forceY,forceZ); + + if (force.length2() > (SIMD_EPSILON*SIMD_EPSILON)) + { + m_body->activate(); + } + + btTransform xform = m_body->getCenterOfMassTransform(); if (local) { diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 57fe533825e..bb6b62c7edc 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -653,6 +653,8 @@ void CcdPhysicsEnvironment::removeConstraint(int constraintId) btTypedConstraint* constraint = m_dynamicsWorld->getConstraint(i); if (constraint->getUserConstraintId() == constraintId) { + constraint->getRigidBodyA().activate(); + constraint->getRigidBodyB().activate(); m_dynamicsWorld->removeConstraint(constraint); break; } |