org.openmali.spatial.bounds
Interface Bounds

All Superinterfaces:
Body
All Known Implementing Classes:
BoundingBox, BoundingPolytope, BoundingSphere, OcNode

public interface Bounds
extends Body

Interface base for Bounds.

Author:
David Yazel, Marvin Froehlich (aka Qudus)

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.
 Point3f getCenter()
           
 float getMaxDistance()
           
 float getMaxSquaredDistance()
           
 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 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.Body
combine, combine
 

Method Detail

getType

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

getCenter

Point3f getCenter()
Returns:
the center-point of this bounds instance.

getMaxSquaredDistance

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

getMaxDistance

float getMaxDistance()
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 Body
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 Body
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 Body
Parameters:
x -
y -
z -

combine

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

Specified by:
combine in interface Body
Parameters:
point -

combine

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

Specified by:
combine in interface Body
Parameters:
points -

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 -