org.openmali.spatial.bounds
Class BoundingPolytope

java.lang.Object
  extended by org.openmali.spatial.bodies.Body
      extended by org.openmali.spatial.bodies.ConvexHull
          extended by org.openmali.spatial.bounds.BoundingPolytope
All Implemented Interfaces:
BodyInterface, Bounds

public class BoundingPolytope
extends ConvexHull
implements Bounds

A set of planes that prescribe a convex, closed polygonal bounding region.


Field Summary
 
Fields inherited from class org.openmali.spatial.bodies.ConvexHull
slabs
 
Fields inherited from class org.openmali.spatial.bodies.Body
centerX, centerY, centerZ, distComputed, maxCenterDist, maxCenterDistSquared
 
Constructor Summary
BoundingPolytope()
          Constructs a new BoundingPolytope object.
BoundingPolytope(Bounds bo)
          Constructs a new BoundingPolytope object.
BoundingPolytope(Bounds[] bos)
          Constructs a new BoundingPolytope object.
BoundingPolytope(Vector4f[] planes)
          Constructs a new BoundingPolytope object.
 
Method Summary
 Bounds closestIntersection(Bounds[] boundsObjects)
          Finds closest bounding object that intersects this bounding object.
 void compute(java.util.List<Tuple3f> coords)
          
 void compute(Tuple3f[] coords)
          
 void compute(VertexContainer source)
          
 void getPlanes(Vector4f[] into)
          Gets the bounding planes of this BoundingPolytope.
 BoundsType getType()
          
 BoundingPolytope intersectNew(Bounds bo)
          Computes a new BoundingPolytope that bounds the volume created by the intersection of this BoundingPolytope with another Bounds object
 BoundingPolytope intersectNew(Bounds[] bos)
          compute a new BoundingPolytope that bounds the volume created by the intersection of this BoundingPolytope with an array of Bounds objects
 boolean intersects(Bounds bo)
          Tests for intersection with another Bounds object.
 boolean intersects(Bounds[] bos)
          Tests for intersection with an array of Bounds objects.
 boolean intersects(Point3f rayOrigin, Vector3f rayDirection)
          Tests for intersection with a ray.
 boolean intersects(Point3f rayOrigin, Vector3f rayDirection, Tuple3f intersection)
          Tests for intersection with a ray.
 boolean intersects(Ray3f ray)
          Tests for intersection with a ray.
 boolean intersects(Ray3f ray, Tuple3f intersection)
          Tests for intersection with a ray.
 void set(Bounds boundsObject)
          Sets the the value of this Bounds object to enclode the specified bounding object
 void set(Bounds[] bounds)
          Sets this bounds to the comnination of all the specified bounds.
 void set(Box boundsObject)
          Sets the the value of this Bounds object to enclode the specified bounding object
 void set(Sphere boundsObject)
          Sets the the value of this Bounds object to enclode the specified bounding object
 void setPlanes(Vector4f[] planes)
          Sets the bounding planes of this BoundingPolytope.
 java.lang.String toString()
          
 void transform(Bounds bounds, Matrix4f trans)
          Transforms a Bounds object so that it bounds a volume that is the result of transforming the given bounding object by the given transform.
 void transform(Matrix4f trans)
          Transforms the Bounds object by the given transform.
 
Methods inherited from class org.openmali.spatial.bodies.ConvexHull
combine, combine, combine, combine, combine, contains, contains, intersect
 
Methods inherited from class org.openmali.spatial.bodies.Body
getCenter, getCenterX, getCenterY, getCenterZ, getMaxCenterDistance, getMaxCenterDistanceSquared, setCenter, setCenter, setMaxCenterDistanceSquared
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openmali.spatial.bounds.Bounds
combine, combine, combine, contains, contains, getCenter, getCenterX, getCenterY, getCenterZ, getMaxCenterDistance, getMaxCenterDistanceSquared
 
Methods inherited from interface org.openmali.spatial.bodies.BodyInterface
combine, combine
 

Constructor Detail

BoundingPolytope

public BoundingPolytope()
Constructs a new BoundingPolytope object.


BoundingPolytope

public BoundingPolytope(Vector4f[] planes)
Constructs a new BoundingPolytope object.


BoundingPolytope

public BoundingPolytope(Bounds bo)
Constructs a new BoundingPolytope object.


BoundingPolytope

public BoundingPolytope(Bounds[] bos)
Constructs a new BoundingPolytope object.

Method Detail

getType

public final BoundsType getType()

Specified by:
getType in interface Bounds
Returns:
the BoundsType of this Bounds instance.

intersects

public boolean intersects(Point3f rayOrigin,
                          Vector3f rayDirection,
                          Tuple3f intersection)
Tests for intersection with a ray.

Specified by:
intersects in interface Bounds

intersects

public boolean intersects(Ray3f ray,
                          Tuple3f intersection)
Tests for intersection with a ray.

Specified by:
intersects in interface Bounds

intersects

public boolean intersects(Point3f rayOrigin,
                          Vector3f rayDirection)
Tests for intersection with a ray.

Specified by:
intersects in interface Bounds

intersects

public boolean intersects(Ray3f ray)
Tests for intersection with a ray.

Specified by:
intersects in interface Bounds

intersects

public boolean intersects(Bounds bo)
Tests for intersection with another Bounds object.

Specified by:
intersects in interface Bounds

intersects

public boolean intersects(Bounds[] bos)
Tests for intersection with an array of Bounds objects.

Specified by:
intersects in interface Bounds

intersectNew

public BoundingPolytope intersectNew(Bounds bo)
Computes a new BoundingPolytope that bounds the volume created by the intersection of this BoundingPolytope with another Bounds object

Parameters:
bo -

intersectNew

public BoundingPolytope intersectNew(Bounds[] bos)
compute a new BoundingPolytope that bounds the volume created by the intersection of this BoundingPolytope with an array of Bounds objects

Parameters:
bos -

closestIntersection

public Bounds closestIntersection(Bounds[] boundsObjects)
Finds closest bounding object that intersects this bounding object.

Specified by:
closestIntersection in interface Bounds

transform

public void transform(Bounds bounds,
                      Matrix4f trans)
Transforms a Bounds object so that it bounds a volume that is the result of transforming the given bounding object by the given transform.

Specified by:
transform in interface Bounds

transform

public void transform(Matrix4f trans)
Transforms the Bounds object by the given transform.

Specified by:
transform in interface Bounds

setPlanes

public void setPlanes(Vector4f[] planes)
Sets the bounding planes of this BoundingPolytope.


getPlanes

public void getPlanes(Vector4f[] into)
Gets the bounding planes of this BoundingPolytope.


set

public void set(Box boundsObject)
Sets the the value of this Bounds object to enclode the specified bounding object

Specified by:
set in interface Bounds

set

public void set(Sphere boundsObject)
Sets the the value of this Bounds object to enclode the specified bounding object

Specified by:
set in interface Bounds

set

public void set(Bounds[] bounds)
Sets this bounds to the comnination of all the specified bounds. Any current bounds information is replaced with this new combination

Specified by:
set in interface Bounds

set

public void set(Bounds boundsObject)
Sets the the value of this Bounds object to enclode the specified bounding object

Specified by:
set in interface Bounds

compute

public void compute(VertexContainer source)

Specified by:
compute in interface Bounds

compute

public void compute(java.util.List<Tuple3f> coords)

Specified by:
compute in interface Bounds

compute

public void compute(Tuple3f[] coords)

Specified by:
compute in interface Bounds

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object