Raycast not working?

Night Elf

07-09-2007 22:40:44

I'm using the RayCaster like this

NxOgre::RayCaster rayCaster(
src,
dir,
length,
NxOgre::RayCaster::RCT_ALL,
g_nxScene);

if (rayCaster.castShape(NxOgre::RayCaster::AF_NONE))
{
for (NxOgre::RayCastHit* aHit = &rayCaster.mReport._begin(); !rayCaster.mReport._atEnd(); aHit = &rayCaster.mReport._next())
{
...
}


But I'm getting an empty rayCaster.mReport. Should this work?

betajaen

08-09-2007 08:43:41

Some stupid questions before we check NxOgre; src at the correct pointer, you normalised the direction and length isn't zero?

What happens if you do -> "mScene->getActorsFromRayCast(src,dir,length);" are there actors then?

Night Elf

10-09-2007 14:50:57

Yes, I'm normalising the direction vector.

I'll try getActorsFromRayCast() and see what I get. But what I think is wrong is that castShape() is returning true, but then mReport is empty...

EDIT:
getActorsFromRaycast() returns an empty collection, too. So there must be something wrong with castShape()'s return value, I guess?

Night Elf

12-09-2007 14:23:32

Any ideas about this? I'm currently assuming castShape() is returning some false positives and testing for mReport.count() > 0 to sort them out, but I'm not really sure my guess is right...