Exemplo n.º 1
0
 private Vector3 findFarthestIntersection(
     final List<? extends ReadOnlyVector3> wallUpperPoints,
     final ReadOnlyVector3 center,
     final Vector3 p) {
   double farthestDistance = 0;
   Vector3 farthestIntersection = null;
   final int n = wallUpperPoints.size();
   for (int i = 0; i < n; i++) {
     final Vector3 intersect =
         Util.intersectLineSegments(
             center, p, wallUpperPoints.get(i), wallUpperPoints.get((i + 1) % n));
     if (intersect != null) {
       final double d = intersect.distanceSquared(center);
       if (d > farthestDistance) {
         farthestDistance = d;
         farthestIntersection = intersect;
       }
     }
   }
   return farthestIntersection;
 }
Exemplo n.º 2
0
 /**
  * Find the squared distance from the center of this Bounding Volume to the given point.
  *
  * @param point The point to get the distance to
  * @return distance
  */
 public final double distanceSquaredTo(final ReadOnlyVector3 point) {
   return _center.distanceSquared(point);
 }