Пример #1
0
        /**
         * Transforms each corner of the specified axis-aligned bounding box and
         * returns a new bounding box which incloses the transformed corners.
         *
         * @param b original bounding box
         * @return a new BoundingBox object which encloses the transform version of
         *         b
         */
        public BoundingBox transform(BoundingBox b)
        {
            if (b.isEmpty())
            {
                return(new BoundingBox());
            }
            // special case extreme corners
            BoundingBox rb = new BoundingBox(transformP(b.getMinimum()));

            rb.include(transformP(b.getMaximum()));
            // do internal corners
            for (int i = 1; i < 7; i++)
            {
                rb.include(transformP(b.getCorner(i)));
            }
            return(rb);
        }
Пример #2
0
 /**
  * Transforms each corner of the specified axis-aligned bounding box and
  * returns a new bounding box which incloses the transformed corners.
  *
  * @param b original bounding box
  * @return a new BoundingBox object which encloses the transform version of
  *         b
  */
 public BoundingBox transform(BoundingBox b)
 {
     if (b.isEmpty())
         return new BoundingBox();
     // special case extreme corners
     BoundingBox rb = new BoundingBox(transformP(b.getMinimum()));
     rb.include(transformP(b.getMaximum()));
     // do internal corners
     for (int i = 1; i < 7; i++)
         rb.include(transformP(b.getCorner(i)));
     return rb;
 }