Apply lsgmasa's fix for convex cast against collision world.

This commit is contained in:
johnmccutchan
2008-02-08 19:56:46 +00:00
parent 618263163c
commit d70a25ff6d

View File

@@ -626,11 +626,14 @@ void btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btT
convexFromTrans = convexFromWorld; convexFromTrans = convexFromWorld;
convexToTrans = convexToWorld; convexToTrans = convexToWorld;
btVector3 castShapeAabbMin, castShapeAabbMax; btVector3 castShapeAabbMin, castShapeAabbMax;
/* Compute AABB that encompasses movement */ /* Compute AABB that encompasses angular movement */
{ {
btVector3 linVel, angVel; btVector3 linVel, angVel;
btTransformUtil::calculateVelocity (convexFromTrans, convexToTrans, 1.0, linVel, angVel); btTransformUtil::calculateVelocity (convexFromTrans, convexToTrans, 1.0, linVel, angVel);
castShape->calculateTemporalAabb (convexFromTrans, linVel, angVel, 1.0, castShapeAabbMin, castShapeAabbMax); btTransform R;
R.setIdentity ();
R.setRotation (convexFromTrans.getRotation());
castShape->calculateTemporalAabb (R, linVel, angVel, 1.0, castShapeAabbMin, castShapeAabbMax);
} }
/// go over all objects, and if the ray intersects their aabb + cast shape aabb, /// go over all objects, and if the ray intersects their aabb + cast shape aabb,