MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / getClosestPoint

Method getClosestPoint

Engine/source/math/mBox.h:374–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374inline Point3F Box3F::getClosestPoint(const Point3F& refPt) const
375{
376 Point3F closest;
377 if (refPt.x <= minExtents.x) closest.x = minExtents.x;
378 else if (refPt.x > maxExtents.x) closest.x = maxExtents.x;
379 else closest.x = refPt.x;
380
381 if (refPt.y <= minExtents.y) closest.y = minExtents.y;
382 else if (refPt.y > maxExtents.y) closest.y = maxExtents.y;
383 else closest.y = refPt.y;
384
385 if (refPt.z <= minExtents.z) closest.z = minExtents.z;
386 else if (refPt.z > maxExtents.z) closest.z = maxExtents.z;
387 else closest.z = refPt.z;
388
389 return closest;
390}
391
392inline F32 Box3F::getDistanceToPoint(const Point3F& refPt) const
393{

Callers 1

_prepRenderImageMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected