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

Function PxcTestAxis

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

Source from the content-addressed store, hash-verified

311}
312
313static bool PxcTestAxis(const PxVec3& axis, const Segment& segment, PxReal radius, const Box& box, PxReal& depth)
314{
315 // Project capsule
316 PxReal min0 = segment.p0.dot(axis);
317 PxReal max0 = segment.p1.dot(axis);
318 if(min0>max0) Ps::swap(min0, max0);
319 min0 -= radius;
320 max0 += radius;
321
322 // Project box
323 PxReal Min1, Max1;
324 projectBox(Min1, Max1, axis, box);
325
326 // Test projections
327 if(max0<Min1 || Max1<min0)
328 return false;
329
330 const PxReal d0 = max0 - Min1;
331 PX_ASSERT(d0>=0.0f);
332 const PxReal d1 = Max1 - min0;
333 PX_ASSERT(d1>=0.0f);
334 depth = physx::intrinsics::selectMin(d0, d1);
335 return true;
336}
337
338static bool PxcCapsuleOBBOverlap3(const Segment& segment, PxReal radius, const Box& box, PxReal* t=NULL, PxVec3* pp=NULL)
339{

Callers 2

PxcCapsuleOBBOverlap3Function · 0.70
testBoxBoxAxisFunction · 0.70

Calls 4

projectBoxFunction · 0.70
swapFunction · 0.50
selectMinFunction · 0.50
dotMethod · 0.45

Tested by

no test coverage detected