Question about convexSweepTest. Help~

ocean2oo6
Posts: 18
Joined: Thu Nov 15, 2007 2:01 pm
Location: Sichuan province, China

Question about convexSweepTest. Help~

Post by ocean2oo6 »

hi all,
Today, I just want to integrated a character controller into my engine. I do this just like what's done in character demo. However, i encouter a problem when using convexSweepTest.
My character is just a box which looks like this: (15,80,15) accordnig to the graphic model. and i use Z-top Coordinate frame. So I just rotate it around X at 90 degree.
When i do a convexSweepTest from Point1 to Point2, let's say, it intersects a Ponit3.But i never get the correct result, so i step into the code and see what happen in convexSweepTest
/* Compute AABB that encompasses angular movement */
{
btVector3 linVel, angVel;
btTransformUtil::calculateVelocity (convexFromTrans, convexToTrans, 1.0, linVel, angVel);
btTransform R;
R.setIdentity ();
R.setRotation (convexFromTrans.getRotation());
castShape->calculateTemporalAabb (R, linVel, angVel, 1.0, castShapeAabbMin, castShapeAabbMax);
}
Here, castShapeAabbMin, castShapeAabbMax are not correct according my object
It looks like bullet don't know my object's transform (In my case, it's a rotation)

My question is , how to tell convexSweepTest that my object's rotation or other transformation? I Cannot find which param i should pass in:

btCollisionWorld::convexSweepTest(const btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, ConvexResultCallback& resultCallback) const

I think i just miss something to ask such abvious thing, but i just confused
Thx for reading, any input would be appreciated~ :D