| 372 | } |
| 373 | |
| 374 | inline 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 | |
| 392 | inline F32 Box3F::getDistanceToPoint(const Point3F& refPt) const |
| 393 | { |