org.openmali.spatial.bounds
Interface Bounds

All Superinterfaces:
BodyInterface
All Known Implementing Classes:
BoundingBox, BoundingPolytope, BoundingSphere

public interface Bounds
extends BodyInterface

Interface base for Bounds.


Method Summary
 Bounds closestIntersection(Bounds[] boundsObjects)
          Finds closest bounding object that intersects this bounding object.
 void combine(float x, float y, float z)
          Combines this Body with a point.
 void combine(Point3f point)
          Combines this Body with a point.
 void combine(Point3f[] points)
          Combine this Body with an array of points.
 void compute(java.util.List<Tuple3f> coords)
           
 void compute(Tuple3f[] coords)
           
 void compute(VertexContainer source)
           
 boolean contains(float px, float py, float pz)
          Tests, if the given point is inside of these Bounds.
 boolean contains(Point3f point)
          Tests, if the given point is inside of these Bounds.
<T extends Tuple3f>
T
getCenter(T center)
          Gets and returns the bodie's center.
 float getCenterX()
           
 float getCenterY()
           
 float getCenterZ()
           
 float getMaxCenterDistance()
           
 float getMaxCenterDistanceSquared()
           
 BoundsType getType()
           
 boolean intersects(Bounds bounds)
          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 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 interface org.openmali.spatial.bodies.BodyInterface
combine, combine
 

Method Detail

getType

BoundsType getType()
Returns:
the BoundsType of this Bounds instance.

getCenter

<T extends Tuple3f> T getCenter(T center)
Gets and returns the bodie's center.

Type Parameters:
T -
Parameters:
center -
Returns:
the center buffer back again.

getCenterX

float getCenterX()
Returns:
the center-point of this bounds instance.

getCenterY

float getCenterY()
Returns:
the center-point of this bounds instance.

getCenterZ

float getCenterZ()
Returns:
the center-point of this bounds instance.

getMaxCenterDistanceSquared

float getMaxCenterDistanceSquared()
Returns:
the largest distance (squared) from the center

getMaxCenterDistance

float getMaxCenterDistance()
Returns:
the largest distance from the center

intersects

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

Parameters:
rayOrigin -
rayDirection -
intersection -

intersects

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

Parameters:
ray -
intersection -

intersects

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

Parameters:
rayOrigin -
rayDirection -

intersects

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

Parameters:
ray -

intersects

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

Parameters:
bounds -

intersects

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

Parameters:
bos -

closestIntersection

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

Parameters:
boundsObjects -

transform

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

Parameters:
trans -

transform

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.

Parameters:
bounds -
trans -

contains

boolean contains(float px,
                 float py,
                 float pz)
Tests, if the given point is inside of these Bounds.

Specified by:
contains in interface BodyInterface
Parameters:
px -
py -
pz -
Returns:
true, if it is inside

contains

boolean contains(Point3f point)
Tests, if the given point is inside of these Bounds.

Specified by:
contains in interface BodyInterface
Parameters:
point -
Returns:
true, if it is inside

combine

void combine(float x,
             float y,
             float z)
Combines this Body with a point.

Specified by:
combine in interface BodyInterface
Parameters:
x -
y -
z -

combine

void combine(Point3f point)
Combines this Body with a point.

Specified by:
combine in interface BodyInterface
Parameters:
point -

combine

void combine(Point3f[] points)
Combine this Body with an array of points.

Specified by:
combine in interface BodyInterface
Parameters:
points -

set

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

Parameters:
boundsObject -

set

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

Parameters:
boundsObject -

set

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

Parameters:
boundsObject -

set

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

Parameters:
bounds -

compute

void compute(VertexContainer source)
Parameters:
source -

compute

void compute(java.util.List<Tuple3f> coords)
Parameters:
coords -

compute

void compute(Tuple3f[] coords)
Parameters:
coords -