From d70a25ff6d53bab2cebeb19d3d132b95bd42390b Mon Sep 17 00:00:00 2001 From: johnmccutchan Date: Fri, 8 Feb 2008 19:56:46 +0000 Subject: [PATCH] Apply lsgmasa's fix for convex cast against collision world. --- src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp b/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp index fa7cd065f..42cbfc6f6 100644 --- a/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp +++ b/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp @@ -626,11 +626,14 @@ void btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btT convexFromTrans = convexFromWorld; convexToTrans = convexToWorld; btVector3 castShapeAabbMin, castShapeAabbMax; - /* Compute AABB that encompasses movement */ + /* Compute AABB that encompasses angular movement */ { btVector3 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,