Hey. 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;
}
and Character Controller is initialized like that:
PxBoxControllerDesc playerBoxDesc;
playerBoxDesc.material = mCharacterMaterial;
playerBoxDesc.density = 100.0f;
playerBoxDesc.halfHeight = 0.75f;
playerBoxDesc.halfSideExtent = 0.24f;
playerBoxDesc.halfForwardExtent = 0.225f;
playerBoxDesc.contactOffset = 0.01f;
playerBoxDesc.contactOffset = 0.05f;
playerBoxDesc.slopeLimit = 0.2f;
playerBoxDesc.stepOffset = 0.175f;
mPlayerController = (mControllerManager->createController(*mPhysics, mScene, playerBoxDesc));
mPlayerController->setFootPosition(PxExtendedVec3(Player.position.x, Player.position.y, Player.position.z));
can anybody point out anything wrong with it? i fail to come up with any valid logical reason for it to happen, so is suspect it may be a bug.
i’m using PhysX 3.2.4.