kenny.bsp
16-06-2007 16:58:18
I know it works with for example cube .. but if I try to cast a ray from sphere it stops immediately because it finds the sphere from the inside ...
Is there a solution ? Except not doing it
betajaen
16-06-2007 18:19:45
Not doing it? You could try filtering the actor of the sphere out, you'd have to do it directly with PhysX though.
What exactly are you trying to do though?
kenny.bsp
16-06-2007 21:12:17
I'm trying to get the value of how high my object is above another or the ground ..
I need it for character to jump.
Here's a pic :
If i set the origin right below the sphere it goes through the ground or whatever and gives me wrong heigh.
ok .. there are of course tutorials on filtering on ageia's dev site, because I dont know how to do it at all
?
there's my solution for such things:
ok, ur character have NxOgre-physical class (NxOgre::Character or NxOgre::Body)
//----------------------------
in first case u can do:
NxShape * characterShape = MyNxOgreCharacterObject->getNxController()->getActor()->getShapes()[0];
characterShape->setFlag(NX_SF_DISABLE_RAYCASTING, true);
bool bCastResult = m_pRayCaster->castShape(NxOgre::RayCaster::AF_NONE); // for example
characterShape->setFlag(NX_SF_DISABLE_RAYCASTING, false);
//----------------------------
in second case -
NxShape * bodyShape = MyNxOgreBodyObject->getNxActor()->getShapes()[0];
bodyShape->setFlag(NX_SF_DISABLE_RAYCASTING, true);
bool bCastResult = m_pRayCaster->castShape(NxOgre::RayCaster::AF_NONE); // for example
bodyShape->setFlag(NX_SF_DISABLE_RAYCASTING, false);
//----------------------------
this thing can be usefull, but be aware with "getShapes()[0]", coz ur body-object can have more than one shape
kenny.bsp
21-06-2007 00:36:13
Lexx thanks so much, it works perfectly now