Thank you, most of my problems are solved now. Still don't have a clue what's causing the collision offset though, if anyone can shed some light on that it would be very much appreciated.
I'm also having another related problem.
I want to check whether the character can uncrouch, or if there's an obstacle preventing it.
The problem is, it reports an overlap even if the controller is just on the ground, but nothing above it. Here's an extract of the overlap-check:
physx::PxScene *scene = controller->getScene();
physx::PxReal r = controller->getRadius();
physx::PxCapsuleGeometry geom(r,m_standHeight *0.5f);
physx::PxExtendedVec3 posExt = controller->getFootPosition();
posExt.y += m_standHeight *0.5f;
physx::PxVec3 pos(posExt.x,posExt.y,posExt.z);
physx::PxOverlapBuffer hit;
PhysXPlayerControllerFilterCallback filterCall(controller->getActor());
if(scene->overlap(
geom,
physx::PxTransform(pos,controller->getActor()->getGlobalPose().q),
hit,
physx::PxQueryFilterData(physx::PxQueryFlag::eANY_HIT | physx::PxQueryFlag::eSTATIC | physx::PxQueryFlag::eDYNAMIC | physx::PxQueryFlag::ePREFILTER),
&filterCall
) && hit.hasBlock)
return false;
PhysXPlayerControllerFilterCallback returns physx::PxQueryHitType::Enum::eTOUCH for anything that isn't the controller's actor.
I've tried adding a minor offset upwards of several units to the position, but that didn't help.
Is there a way to visualize the overlap in the PVD?