shanefarris
14-07-2011 17:25:20
I'm having some problems filtering my raycasts. I am using the "SampleRaycast" example that comes with the PhysX SDK, and I am trying to get the horizontal raycast to ignore the terrain. What I've done is set the shape group to the terrain to 1 inside the "InitTerrain()" function like so:
And I've set my raycast to group 2 like so: (RaycastAllShapes())
Now I've been able to filter the cubes to pass right through the terrain, but I am having problems with the raycast and the terrain. Any ideas?
Thanks.
NxActorDesc ActorDesc;
ActorDesc.shapes.pushBack(&terrainShapeDesc);
ActorDesc.shapes[0]->group = 1;
gScene->createActor(ActorDesc)->userData = (void*)0;
And I've set my raycast to group 2 like so: (RaycastAllShapes())
gScene->raycastAllShapes(worldRay, gMyReport, NX_ALL_SHAPES, 2);
Now I've been able to filter the cubes to pass right through the terrain, but I am having problems with the raycast and the terrain. Any ideas?
Thanks.