Example #1
0
 public BoundingBox getWorldBounds(Matrix4 o2w) {
   BoundingBox bounds = new BoundingBox();
   if (o2w == null) {
     for (int i = 0; i < points.length; i += 3)
       bounds.include(points[i], points[i + 1], points[i + 2]);
   } else {
     for (int i = 0; i < points.length; i += 3) {
       float x = points[i];
       float y = points[i + 1];
       float z = points[i + 2];
       float wx = o2w.transformPX(x, y, z);
       float wy = o2w.transformPY(x, y, z);
       float wz = o2w.transformPZ(x, y, z);
       bounds.include(wx, wy, wz);
     }
   }
   return bounds;
 }
Example #2
0
 public BoundingBox getWorldBounds(Matrix4 o2w) {
   BoundingBox bounds = new BoundingBox(-ro - ri, -ro - ri, -ri);
   bounds.include(ro + ri, ro + ri, ri);
   if (o2w != null) bounds = o2w.transform(bounds);
   return bounds;
 }