diff --git a/lib/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp b/lib/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp index 60187b106..9a3a58592 100644 --- a/lib/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp +++ b/lib/bullet/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp @@ -20,7 +20,6 @@ subject to the following restrictions: #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/CollisionDispatch/btManifoldResult.h" #include "BulletCollision/CollisionShapes/btTriangleShape.h" -#include "BulletDynamics/Dynamics/btRigidBody.h" SphereTriangleDetector::SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle,btScalar contactBreakingThreshold) @@ -59,15 +58,15 @@ void SphereTriangleDetector::getClosestPoints(const ClosestPointInput& input,Res if(mani) { // Find the triangle: - const btCollisionObject *b = mani->getBody0Internal(); - const btTriangleShape *tri = dynamic_cast(b->getCollisionShape()); + const btCollisionObject *co = mani->getBody0Internal(); + const btTriangleShape *tri = dynamic_cast(co->getCollisionShape()); if(!tri) { - b = mani->getBody1Internal(); - tri = dynamic_cast(b->getCollisionShape()); + co = mani->getBody1Internal(); + tri = dynamic_cast(co->getCollisionShape()); } - // If we have a triangle and it is static (mass=0), recompute the normal - if(tri && btRigidBody::upcast(b)->getInvMass()==0) + // If we have a triangle and it is static, recompute the normal + if(tri && co->isStaticOrKinematicObject()) { normal = (tri->m_vertices1[1]-tri->m_vertices1[0]) .cross(tri->m_vertices1[2]-tri->m_vertices1[0]); diff --git a/lib/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp b/lib/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp index 3dcf58515..5f7552a11 100644 --- a/lib/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp +++ b/lib/bullet/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp @@ -20,7 +20,6 @@ subject to the following restrictions: #include "BulletCollision/CollisionDispatch/btManifoldResult.h" #include "BulletCollision/CollisionDispatch/btCollisionObject.h" #include "BulletCollision/CollisionShapes/btTriangleShape.h" -#include "BulletDynamics/Dynamics/btRigidBody.h" @@ -456,15 +455,15 @@ void btGjkPairDetector::getClosestPointsNonVirtual(const ClosestPointInput& inpu if(mani) { // Find the triangle: - const btCollisionObject *b = mani->getBody0Internal(); - const btTriangleShape *tri = dynamic_cast(b->getCollisionShape()); + const btCollisionObject *co = mani->getBody0Internal(); + const btTriangleShape *tri = dynamic_cast(co->getCollisionShape()); if(!tri) { - b = mani->getBody1Internal(); - tri = dynamic_cast(b->getCollisionShape()); + co = mani->getBody1Internal(); + tri = dynamic_cast(co->getCollisionShape()); } - // If we have a triangle and it is static (mass=0), recompute the normal - if(tri && btRigidBody::upcast(b)->getInvMass()==0) + // If we have a triangle and it is static, recompute the normal + if(tri && co->isStaticOrKinematicObject()) { normalInB = (tri->m_vertices1[1]-tri->m_vertices1[0]) .cross(tri->m_vertices1[2]-tri->m_vertices1[0]);