diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-04-26 07:20:28 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-04-26 07:20:28 +0400 |
commit | 45d0123a591adc11925396ff915642c2d88b61e7 (patch) | |
tree | a2c7cb00d0bcc67996cab59a2306b8d6da4c92de /source | |
parent | 94dd1085e3db245601c6e0f09a128d39560e3bed (diff) |
fixed several internal Bullet rigidbody dynamics bugs:
- broadphase had bugs in removing objects,
- persistent manifold renamed value,
- cylinder penetration depth fixed,
- memory leak for persistent manifold
Diffstat (limited to 'source')
4 files changed, 11 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index f35ba115e2c..876a2ff5e81 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -679,8 +679,10 @@ void KX_ConvertODEEngineObject(KX_GameObject* gameobj, #ifdef WIN32 #if _MSC_VER >= 1310 //only use SIMD Hull code under Win32 +//#define TEST_HULL 1 #ifdef TEST_HULL #define USE_HULL 1 +//#define TEST_SIMD_HULL 1 #include "NarrowPhaseCollision/Hull.h" #endif //#ifdef TEST_HULL diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 8eaaefe60b4..3cd5097ebb7 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -142,6 +142,7 @@ void KX_TouchSensor::ReParent(SCA_IObject* parent) KX_ClientObjectInfo *client_info = gameobj->getClientInfo(); client_info->m_gameobject = gameobj; client_info->m_auxilary_info = NULL; + client_info->m_sensors.push_back(this); SCA_ISensor::ReParent(parent); } diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index cbe7961773d..68010b85180 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -328,6 +328,10 @@ void CcdPhysicsController::SetAngularVelocity(float ang_velX,float ang_velY,flo SimdVector3 angvel(ang_velX,ang_velY,ang_velZ); if (angvel.length2() > (SIMD_EPSILON*SIMD_EPSILON)) { + m_body->activate(); + } + + { SimdTransform xform = m_body->getCenterOfMassTransform(); if (local) { @@ -345,6 +349,9 @@ void CcdPhysicsController::SetLinearVelocity(float lin_velX,float lin_velY,floa if (linVel.length2() > (SIMD_EPSILON*SIMD_EPSILON)) { m_body->activate(); + } + + { SimdTransform xform = m_body->getCenterOfMassTransform(); if (local) { diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 2c5e01dd4b0..e670755b1f2 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -29,6 +29,7 @@ struct CcdConstructionInfo : m_gravity(0,0,0), m_mass(0.f), m_restitution(0.1f), + m_friction(0.5f), m_linearDamping(0.1f), m_angularDamping(0.1f), m_MotionState(0), |