Jump to content
  • Advertisement
Sign in to follow this  
N01

[PhysX] filterData for character controller.

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

Hey, another problem with PhysX. What i'm trying to do is prevent Character Controller interacting with certain type of objects. So i thought, i can use filter data, it works for normal shapes. In order to provide filterData for PxController, i pass it while calling to PxController::move(...) with PxControllerFilters. So for a quick test i do it like this:

PxFilterData characterFilterData;
characterFilterData.word0 = 1;

PxControllerFilters characterControllerFilters;
characterControllerFilters.mFilterData = &characterFilterData;

mPlayerController->move(PxVec3(Player.moveOffset.x, Player.moveOffset.y, Player.moveOffset.z), 0.1f, deltaTime, characterControllerFilters, NULL);

and that's enough to cause mPlayerController to stop interacting with the world(it just falls through stuff).

the weird thing is the line that causes such behavior is "characterFilterData.word0 = 1;".

so i found out that it happens if i set any of characterFilterData member variables to value other than zero. can someone explain why?

and BTW, it happens even if i use simulation shader like this one:

PxFilterFlags PhysicsMainFilterShader(PxFilterObjectAttributes attributes0, PxFilterData filterData0,
                                      PxFilterObjectAttributes attributes1, PxFilterData filterData1,
                                      PxPairFlags& pairFlags, const void* constantBlock, PxU32 constantBlockSize)
{
    pairFlags = PxPairFlag::eCONTACT_DEFAULT;
    return PxFilterFlag::eDEFAULT;
}

Share this post


Link to post
Share on other sites
Advertisement

in case someone's wondering, here's source of basic, quick and dirty reproduction case: http://pastie.org/private/exnuwpr2qrez9tigslt3bq

you can watch simulation with PVD, and notice, that unless you comment line 114:  "mCharacterFilterData.word0 = 1", character controller will fall through the "floor".

i'd like someone to point out possible mistake.

Edited by N01

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!