hit cloth with rayCaster

Grom

14-03-2007 06:20:10

how could I hit a cloth with a rayCaster? Basically I want to be able to make my gun shoot the hanging cloth I've got like all those demos do so well

betajaen

14-03-2007 09:54:29

Not through the usual methods. Get the instance of NxCloth and through the non-NxOgre way:-


raycast(const NxRay& worldRay, NxVec3 &hit, NxU32 &vertexId);


You can find out how to create a NxRay through the RayCaster or via the Ageia PhysX documentation, the other two arguments are passed back, saying what was hit.