Jump to content
  • Advertisement
Sign in to follow this  
noatom

PhysX filter shader not getting called

This topic is 2072 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

PxFilterFlags TestFilterShader(
	PxFilterObjectAttributes attributes0, PxFilterData filterData0,
	PxFilterObjectAttributes attributes1, PxFilterData filterData1,
	PxPairFlags& pairFlags, const void* constantBlock, PxU32 constantBlockSize){

}


//before I create the scene:

desc.filterShader = &TestFilterShader;

I followed the example from the book,yet my shader function never gets called.Do I need to do something I don't know about?

Share this post


Link to post
Share on other sites
Advertisement

That should all that needs to be done..try removing the & and recheck..One point to note is that the filter shader won't be called unless you have a collision.

Share this post


Link to post
Share on other sites

Well,the thing is,my scene is filled with static objects,and I want to check collisions with a character controller...the character controller obviously doesn't go through the floor or the static shapes so there should be a collision.Or is there a different type of setup needed for a character controller?

Share this post


Link to post
Share on other sites

The character controller uses scene queries (sweeps, maybe raycasts). The filter shader won't get called, you'll need to work with PxFilterData (there is a section about filtering in the PhysX documentation under "Scene Queries").

Share this post


Link to post
Share on other sites

Nope,its not in there. Apparently character controllers have their own callback functions,and don't use PxFilterData at all.

 

If anyone is interested how to implement a contact callback for Character Controllers,I recommend examining the sample called "Sample Bridge",and read the Character Controller category in the physx Guide.

Share this post


Link to post
Share on other sites

Actually, they can use PxFilterData. You just need to pass it as an argument in the constructor of PxControllerFilters (which you pass to ::move)

Edited by Mona2000

Share this post


Link to post
Share on other sites

I'm confused, are you asking a question and answering it at the same time ? Your initial post didn't make mention that this is for a character controller, a few PhysX objects ( ex. particles ) can have their own custom filter shader separate from those pass to the scene descriptor. Character controllers uses a separate hit report callback which work in a similiar fashion as the other filter shaders...

Share this post


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

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!