Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2010-01-06 11:46:04 +0300
committerBenoit Bolsee <benoit.bolsee@online.be>2010-01-06 11:46:04 +0300
commitb38a727da3ec458a4dc8be1fc1fffb89115b69d3 (patch)
tree376659e0d0adb70a4678b79f6dd6c90a2c7a8e6d /extern/bullet2/src/BulletCollision
parent042c2b2aa56fcaaff3204572676125c3085e6a14 (diff)
Bullet: rework softbody raytest patch after approval by Erwin.
Diffstat (limited to 'extern/bullet2/src/BulletCollision')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp25
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h2
2 files changed, 1 insertions, 26 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
index 7159f552829..5c645f82a45 100644
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
+++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
@@ -412,31 +412,6 @@ void btCollisionWorld::rayTestSingle(const btTransform& rayFromTrans,const btTra
// restore
collisionObject->internalSetTemporaryCollisionShape(saveCollisionShape);
}
- } else {
- if (collisionShape->isSoftBody()) {
- btSoftBody* softBody = static_cast<btSoftBody*>(collisionObject);
- btSoftBody::sRayCast softResult;
- if (softBody->rayTest(rayFromTrans.getOrigin(), rayToTrans.getOrigin(), softResult))
- {
- btCollisionWorld::LocalShapeInfo shapeInfo;
- 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;
- }
- btCollisionWorld::LocalRayResult rayResult
- (collisionObject,
- &shapeInfo,
- normal,
- softResult.fraction);
- bool normalInWorldSpace = true;
- resultCallback.addSingleResult(rayResult,normalInWorldSpace);
- }
- }
}
}
}
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
index 87f7137a55b..24343938e5c 100644
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
+++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
@@ -354,7 +354,7 @@ public:
/// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback
/// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.
- void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const;
+ virtual void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const;
// convexTest performs a swept convex cast on all objects in the btCollisionWorld, and calls the resultCallback
// This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.