Physx PxRigidStatic and Character Controller collision problem

Started by
1 comment, last by Mbrpistoni 9 years ago

Hi! I'm Bruno, new here.

I'm having trouble setting up filters for my Character Controller to interact with other elements.

filterData.word0 = FilterGroup::ePLAYER;
filterData.word1 = FilterGroup::eENEMYALIVE | FilterGroup::eBULLETS;
controllerFilters.mFilterCallback = NULL;
controllerFilters.mFilterData = &filterData;
controllerFilters.mFilterFlags = physx::PxQueryFlag::eSTATIC | physx::PxQueryFlag::eDYNAMIC;

Then, in move() function

physx::PxControllerCollisionFlags collisionFlags = capsuleController->move(
Physics.XMVECTORToPxVec3(gravityVector),
0.01f,
physx::PxF32(elapsed),
controllerFilters,
NULL);

As you can see I'm using a capsule controler.

My scene (meaning the wall, ground and ceilling) is a PxRigidStatic which shape is made from a vertex and an index array.

So far so good. Problem comes when I run It and character controller wont collide with the scene, so it falls to the infinite.

My question is, should I build some kind of filter on the scene side to controll the collision so It happends?

Any answer will be apreciated

Thanks

Advertisement

Ok, fixed. Funny thing, I 've been working on that for 3h, I just posted here, and bam! found the solution.

Apparently I wasn't doing that to the triangleMesh that represents my scene

filterData.word0 = FilterGroup::eSCENARIO_AND_PROPS;
filterData.word1 = FilterGroup::eENEMYALIVE | FilterGroup::eBULLETS | FilterGroup::eENEMYDEAD | FilterGroup::ePLAYER;

triangleMeshSape->setQueryFilterData(filterData);

Nvidia answered! That's what they told me

I asked the engineer who wrote the character controller, and he said:

"This is probably due to a large gravity. Gravity in CCT-parlance is just the length of the user-provided displacement vector, in the “up” direction. So if the CCT does not move, the given displacement might be for example (0, -10, 0). We compute the temporal bounding volume (TBV) using this vector, i.e. we take the AABB around the capsule at its start position, the AABB around the capsule at its expected end position, and compute the AABB enclosing both. If the displacement is large in the negative up direction, this can give a long AABB similar to the one in the screenshot. Then IIRC this AABB can further be enlarged depending on other CCT parameters like the “max jump height” or things like this. It is fairly normal for these boxes to be larger than the capsule."

This topic is closed to new replies.

Advertisement