I am trying to figure out how to calculate the thickness of an object i send a raytest into while taking into account the angle of the object. This should change depending on the angle of the ray and also the rotation of the collision object.
So for e.g i am doing this
Code: Select all
btCollisionWorld::ClosestRayResultCallback rayCallback(btRayFrom,btRayTo);
mCollisionWorld->rayTest(btRayFrom, btRayTo, rayCallback);
float thickness=100.0f;
if (rayCallback.hasHit())
{
btVector3 normal = rayCallback.m_hitNormalWorld;
float angle = btDegrees(normal.angle(btVector3(0,1,0)));
float actualThickness = thickness/btCos(angle);
}
Thanks,
Billy
*Edit*
Changed title to better reflect the problem. Please see last post.