diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2012-06-08 20:13:01 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2012-06-08 20:13:01 +0400 |
commit | 82d3d9f2ba47bbf2f868b5a970d1fe149eba13e2 (patch) | |
tree | e99d947080f8e787059d86500f01dd6c1ad616e4 /extern/bullet2/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp | |
parent | 221a7878223e983372ba830e4ca1a17067abf2ba (diff) |
Update Bullet to version 2.80 (bullet svn revision 2537)
Remove Jamfiles and other unused files that stuck around during previous updates.
Add patches for local changes to the patches directory.
Update readme.txt, it had outdated infromation.
Diffstat (limited to 'extern/bullet2/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp')
-rw-r--r-- | extern/bullet2/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/extern/bullet2/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp b/extern/bullet2/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp index 1b9b5e392a1..8f4be231c13 100644 --- a/extern/bullet2/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp +++ b/extern/bullet2/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp @@ -165,7 +165,7 @@ void btSoftRigidDynamicsWorld::debugDrawWorld() for ( i=0;i<this->m_softBodies.size();i++) { btSoftBody* psb=(btSoftBody*)this->m_softBodies[i]; - if (getDebugDrawer() && getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe)) + if (getDebugDrawer() && (getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe))) { btSoftBodyHelpers::DrawFrame(psb,m_debugDrawer); btSoftBodyHelpers::Draw(psb,m_debugDrawer,m_drawFlags); @@ -300,12 +300,19 @@ void btSoftRigidDynamicsWorld::rayTestSingle(const btTransform& rayFromTrans,con shapeInfo.m_shapePart = 0; shapeInfo.m_triangleIndex = softResult.index; // get the normal - btVector3 normal = softBody->m_faces[softResult.index].m_normal; btVector3 rayDir = rayToTrans.getOrigin() - rayFromTrans.getOrigin(); - if (normal.dot(rayDir) > 0) { - // normal always point toward origin of the ray - normal = -normal; + btVector3 normal=-rayDir; + normal.normalize(); + + if (softResult.feature == btSoftBody::eFeature::Face) + { + normal = softBody->m_faces[softResult.index].m_normal; + if (normal.dot(rayDir) > 0) { + // normal always point toward origin of the ray + normal = -normal; + } } + btCollisionWorld::LocalRayResult rayResult (collisionObject, &shapeInfo, |