Raycasthit and raycastAllBounds

Xenomorph

09-05-2010 23:23:58

Hi there,
I have a little problem here. I'm using raycastAllBounds to detecth which RigidBody the ray hit. So, in my callback function I check to which mesh the hit body belongs to like:
if(hit.mRigidBody == (*iter)->getRigidBody())
For some reason the mRigidBody doesn't have a valid value. It is always 0xcccccccccc and all the other values of the ridigBody are invalid.
The other data of the "hit" is valid though. My question is why don't I get a RigidBody in my hit result?
The original idea is to exclude some actors from my ray, so I check against all the objects in the world in my callback function. That's why I need this to work. Am I doing something wrong. Here is how I inizialize the Ray:
NxOgre::Ray ray(startPosition, mDirection);
mScene->raycastAllBounds(ray, this, NxOgre::Enums::ShapesType_All);

Any ideas what is wrong?