diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-05-11 21:58:23 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-05-11 21:58:23 +0400 |
commit | ede20c166a4fcaedaaf5c5392d00e3a99ecc8ad2 (patch) | |
tree | d3aa15cd27cffd73bb970ea58c898ddc56c21532 /extern/bullet | |
parent | d3dd1da8d429ea72ad42afe4b34692c345ef8c78 (diff) |
- Charlie provided a work-around for some armature related crashes
- fixed some Bullet raycasting (hitfraction was not properly updated for static meshes)
- removed some cvs tags in Bullet's BMF _Font files (they keep on conflicting when duplicated in different repositories)
- set default linearsleepingtreshold explicitly
Diffstat (limited to 'extern/bullet')
7 files changed, 19 insertions, 11 deletions
diff --git a/extern/bullet/Bullet/CollisionDispatch/CollisionWorld.cpp b/extern/bullet/Bullet/CollisionDispatch/CollisionWorld.cpp index 812ffa391dd..4775db1b1c1 100644 --- a/extern/bullet/Bullet/CollisionDispatch/CollisionWorld.cpp +++ b/extern/bullet/Bullet/CollisionDispatch/CollisionWorld.cpp @@ -258,19 +258,20 @@ void CollisionWorld::RayTest(const SimdVector3& rayFromWorld, const SimdVector3& } - virtual void ReportHit(const SimdVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) + virtual float ReportHit(const SimdVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) { - LocalShapeInfo shapeInfo; + CollisionWorld::LocalShapeInfo shapeInfo; shapeInfo.m_shapePart = partId; shapeInfo.m_triangleIndex = triangleIndex; - LocalRayResult rayResult + CollisionWorld::LocalRayResult rayResult (m_collisionObject, &shapeInfo, hitNormalLocal, hitFraction); - m_resultCallback->AddSingleResult(rayResult); + return m_resultCallback->AddSingleResult(rayResult); + } @@ -294,4 +295,4 @@ void CollisionWorld::RayTest(const SimdVector3& rayFromWorld, const SimdVector3& } } -}
\ No newline at end of file +} diff --git a/extern/bullet/Bullet/CollisionDispatch/CollisionWorld.h b/extern/bullet/Bullet/CollisionDispatch/CollisionWorld.h index 22e82082c65..1d1249ec88e 100644 --- a/extern/bullet/Bullet/CollisionDispatch/CollisionWorld.h +++ b/extern/bullet/Bullet/CollisionDispatch/CollisionWorld.h @@ -94,6 +94,9 @@ public: ///RayResultCallback is used to report new raycast results struct RayResultCallback { + virtual ~RayResultCallback() + { + } float m_closestHitFraction; bool HasHit() { diff --git a/extern/bullet/Bullet/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp b/extern/bullet/Bullet/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp index 36764ac3191..7032a863a54 100644 --- a/extern/bullet/Bullet/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp +++ b/extern/bullet/Bullet/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp @@ -194,8 +194,10 @@ float ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(BroadphaseProxy* ,B { } - virtual void ReportHit(const SimdVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) + virtual float ReportHit(const SimdVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) { + //todo: handle ccd here + return 0.f; } }; diff --git a/extern/bullet/Bullet/NarrowPhaseCollision/RaycastCallback.cpp b/extern/bullet/Bullet/NarrowPhaseCollision/RaycastCallback.cpp index fc4a533b225..209d9612bfd 100644 --- a/extern/bullet/Bullet/NarrowPhaseCollision/RaycastCallback.cpp +++ b/extern/bullet/Bullet/NarrowPhaseCollision/RaycastCallback.cpp @@ -87,11 +87,11 @@ void TriangleRaycastCallback::ProcessTriangle(SimdVector3* triangle,int partId, if ( dist_a > 0 ) { - ReportHit(triangleNormal,distance,partId,triangleIndex); + m_hitFraction = ReportHit(triangleNormal,distance,partId,triangleIndex); } else { - ReportHit(-triangleNormal,distance,partId,triangleIndex); + m_hitFraction = ReportHit(-triangleNormal,distance,partId,triangleIndex); } } } diff --git a/extern/bullet/Bullet/NarrowPhaseCollision/RaycastCallback.h b/extern/bullet/Bullet/NarrowPhaseCollision/RaycastCallback.h index c58fa202fc8..463c576c57e 100644 --- a/extern/bullet/Bullet/NarrowPhaseCollision/RaycastCallback.h +++ b/extern/bullet/Bullet/NarrowPhaseCollision/RaycastCallback.h @@ -34,7 +34,7 @@ public: virtual void ProcessTriangle(SimdVector3* triangle, int partId, int triangleIndex); - virtual void ReportHit(const SimdVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) = 0; + virtual float ReportHit(const SimdVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) = 0; }; diff --git a/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp b/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp index b8ce09729c2..043d5be802e 100644 --- a/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp +++ b/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsController.cpp @@ -31,7 +31,7 @@ class BP_Proxy; float gDeactivationTime = 2.f; bool gDisableDeactivation = false; -float gLinearSleepingTreshold = 0.4f; +float gLinearSleepingTreshold = 0.8f; float gAngularSleepingTreshold = 1.0f; #include "Dynamics/MassProps.h" diff --git a/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp b/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp index 7afd7bf8fc5..cb4adc77d76 100644 --- a/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp +++ b/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp @@ -1529,7 +1529,9 @@ void CcdPhysicsEnvironment::UpdateAabbs(float timeStep) shapeinterface->CalculateTemporalAabb(body->getCenterOfMassTransform(), - body->getLinearVelocity(),body->getAngularVelocity(), + body->getLinearVelocity(), + //body->getAngularVelocity(), + SimdVector3(0.f,0.f,0.f),//no angular effect for now //body->getAngularVelocity(), timeStep,minAabb,maxAabb); |