daedar
21-05-2007 09:41:42
Hi,
here is my code for a raycast (to get the closest actor, after a bullet shot):
Sometimes, actor is NULL whereas I really got an actor targeted and closest enought to be < length (and when this happens, nearlly every raycast after that fails). What's really strange is that even when actor is NULL, caster.getClosestRaycastHit().mActor can be != NULL
All I've got in my world for the moment are static geometries...
Any idea?
Thx a lot
here is my code for a raycast (to get the closest actor, after a bullet shot):
NxOgre::RayCaster caster = NxOgre::RayCaster(pos, dir, length, NxOgre::RayCaster::RCT_CLOSEST, nxScene);
if( caster.castShape(NxOgre::RayCaster::AF_NONE) )
actor = caster.getClosestActor();
Sometimes, actor is NULL whereas I really got an actor targeted and closest enought to be < length (and when this happens, nearlly every raycast after that fails). What's really strange is that even when actor is NULL, caster.getClosestRaycastHit().mActor can be != NULL
All I've got in my world for the moment are static geometries...
Any idea?
Thx a lot