Sign in to follow this  

PhysX Raycast filtering

Recommended Posts

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:

NxActorDesc ActorDesc;
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?


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this