I'm facing with a weird thing about getManifolds functionality.
I wanted to print position and radius info of my colliding cylinder shaped rigidbodies.
This is the code where obA and obB are the bodies of the contact point.
Code: Select all
btTransform transA = obA->getWorldTransform();
btTransform transB = obB->getWorldTransform();
btCylinderShapeZ* cylShape = (btCylinderShapeZ*) obA->getCollisionShape();
float radiusA = cylShape->getRadius();
cylShape = (btCylinderShapeZ*) obB->getCollisionShape();
float radiusB = cylShape->getRadius();
NSLog(@"ob0 x: %.3f \ty: %.3f \t radius: %.3f\n",transA.getOrigin().getX(),transA.getOrigin().getY(),radiusA);
NSLog(@"ob1 x: %.3f \ty: %.3f radius: %.3f",transB.getOrigin().getX(),transB.getOrigin().getY(),radiusB);
ob0 x: 218.746 y: 234.662 radius: 16.000
ob1 x: 259.522 y: 234.645 radius: 16.000
Strange thing here is that, bodies have a radius of 16 unit, so they have to be at least 32 unit close to each other. But as can be seen, their distance on x axis is nearly 41 units.
How it could be, what's the situation that i couldn't figured out?