MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / validateDepth

Function validateDepth

deps/physx/physx/source/geomutils/src/GuMTD.cpp:77–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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