Orientation of shape in convexSweepTest

shogun
Posts: 34
Joined: Tue Mar 04, 2008 3:16 pm

Orientation of shape in convexSweepTest

Post by shogun »

Hallo,

I'm doing something like

Code: Select all

btCollisionWorld::ClosestConvexResultCallback cb(rayFrom, rayTo);
btConvexShape *cylinderShape = new btCylinderShape(btVector3(r, 0.005f, r));
m_dynamicsWorld->convexSweepTest(cylinderShape, from, to, cb);
The problem is that the cylinder I use is always axis aligned. But often my "to" vector points to the right or any other direction other than up or down - so this axis alignment becomes a problem, because the callback's m_closestHitFraction is wrong now (at least wrong for me).
Is there any workaround for this, or another solution?

Regards,
shogun
shogun
Posts: 34
Joined: Tue Mar 04, 2008 3:16 pm

Re: Orientation of shape in convexSweepTest

Post by shogun »

I my problem unsovlable, or just not important? :(
S.Lundmark
Posts: 50
Joined: Thu Jul 09, 2009 1:46 pm

Re: Orientation of shape in convexSweepTest

Post by S.Lundmark »

btCylinderShapes are always axis aligned.
You could get them transformed/rotated using a btCompoundShape. See btCompoundShape::addChildShape.

Cheers.
Simon