MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / validateDepth

Function validateDepth

physx/source/geomutils/src/GuMTD.cpp:76–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76static PX_FORCE_INLINE float validateDepth(float depth)
77{
78 // PT: penetration depth must always be positive or null, but FPU accuracy being what it is, we sometimes
79 // end up with very small, epsilon-sized negative depths. We clamp those to zero, since they don't indicate
80 // real bugs in the MTD functions. However anything larger than epsilon is wrong, and caught with an assert.
81 const float epsilon = 1.e-3f;
82
83 //ML: because we are shrunking the shape in this moment, so the depth might be larger than eps, this condition is no longer valid
84 //PX_ASSERT(depth>=-epsilon);
85 PX_UNUSED(epsilon);
86 return PxMax(depth, 0.0f);
87}
88
89///////////////////////////////////////////////////////////////////////////////
90

Callers 15

computeMTD_SphereSphereFunction · 0.85
computeMTD_SphereCapsuleFunction · 0.85
computeMTD_SphereBoxFunction · 0.85
PxcCapsuleOBBOverlap3Function · 0.85
computeMTD_CapsuleBoxFunction · 0.85
computeMTD_BoxBoxFunction · 0.85
computeMTD_SphereConvexFunction · 0.85
computeMTD_CapsuleConvexFunction · 0.85
computeMTD_BoxConvexFunction · 0.85
computeMTD_ConvexConvexFunction · 0.85
computeMTD_SpherePlaneFunction · 0.85

Calls 2

PX_UNUSEDFunction · 0.85
PxMaxFunction · 0.85

Tested by

no test coverage detected