PhysX - PxRigidDynamic clip through other actors (CCD enabled)

Started by
10 comments, last by Silverlan 10 years, 1 month ago

If I'm not mistaken, the character controller shouldn't automatically push objects around it (see documentation). Normally you would apply the pushing forces manually. There's onShapeHit -callback for this purpose. This way you have more control over the forces anyway. The character controller pushing objects in your previous build might have been a side effect caused by invalid scene configuration.

I don't know about the offset though, so I can't really help with that... Have you tried fixing that offset between ground and bottom with setFootPosition ?(e: nevermind, I don't think this is related to the actual issue).

Advertisement

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?

This topic is closed to new replies.

Advertisement