I try to do a simple ray test but I'm just going crazy >_<.
So I do that :
Code: Select all
btCollisionWorld::ClosestRayResultCallback result(origin, target);
DeviceManager::GetSingleton().GetCollisionWorld()->rayTest(origin, target, result);
if(result.hasHit())
{
return result.m_collisionObject;
}
Example where it doesn't but should work
origin = -24.56 ; 49.00 ; 0.00
target = -25.24 ; -50.99 ; 0.00
positionObject = -25.00 ; 2.50 ; 0.00
The object is part of the world. I didn't touch anything else (apart from companionID but I think it can't come from that).
I don't do any update for btCollisionWorld but I don't think it's necesary either.
Any idea of where the problem could come from??
Thanks for your help!
++
Charlie
Edit : I found the solution. I didn't updated the btCollisionWorld (updateAabbs()). Thought that, as a static world, there wasn't need for an update.