Jump to content
  • Advertisement
Sign in to follow this  
TheMac

PhysX Raycast filtering

This topic is 2565 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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.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.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!