[SOLVED] RayTest

Charlie
Posts: 3
Joined: Tue Feb 02, 2010 2:15 pm

[SOLVED] RayTest

Post by Charlie »

Hi,

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;
}
It works if the object (with shapeSphere r=5.0f) is at 0 0 0. If not it doesn't...
Example where it doesn't but should work :evil: :
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! :D

++

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.