Heyo, i'm not 100% sure if this is the right snippet, but looks like. :P
Code:
// check if player can straighten up, in case if there is something above his head he will not be able to stop proning
bool force_prone = false;
if(pl->bProne)
{
PxBoxGeometry bbox(0.2f, 0.9f, 0.2f);
PxTransform pose(PxVec3(pl->GetPosition().x, pl->GetPosition().y+1.1f, pl->GetPosition().z), PxQuat(0,0,0,1));
PxSceneQueryFilterData filter(PxFilterData(COLLIDABLE_STATIC_MASK, 0, 0, 0), PxSceneQueryFilterFlag::eSTATIC);
PxShape* shape;
force_prone = g_pPhysicsWorld->PhysXScene->overlapAny(bbox, pose, shape, filter);
}
bool wasProning = pl->bProne;
bool proning = pl->bProne;
if(pl->fHeightAboveGround < 0.5f)
{
if(InputMappingMngr->wasPressed(r3dInputMappingMngr::KS_PRONE) && !disablePlayerMovement && pl->proneTime+1 < r3dGetTime())
proning = !proning;
}
else
proning = false;
if(force_prone)
proning = true;