net.rim.device.api.math
Interface Bounds

All Known Implementing Classes:
BoundingBox, BoundingSphere

public interface Bounds

Defines an interface for the bounds of a 3-dimensional object.

Since:
BlackBerry API 6.0.0

Method Summary
 boolean equals(Object obj)
          Returns true if the specified object is equal to this bounding object.
 int hashCode()
          Returns a hash code based on the elements of this bounding object.
 boolean intersects(Bounds bounds)
          Tests whether this bounding object intersects the specified bounding object.
 boolean intersects(Frustum frustum)
          Tests whether this bounding object intersects the specified frustum.
 float intersects(Plane plane)
          Tests whether this bounding object intersects the specified plane.
 float intersects(Ray ray)
          Tests whether this bounding object intersects the specified ray.
 boolean isEmpty()
          Determines if this bounding object is empty.
 void merge(Bounds bounds)
          Sets this bounding object to the smallest bounding object that contains both this bounding object and the specified bounds.
 void set(Bounds bounds)
          Sets this bounding object to the specified bounding object.
 String toString()
          Returns a String representation of this bounding object.
 void transform(Matrix4f matrix)
          Transforms the bounding object by the given transformation matrix.
 



Method Detail

intersects

boolean intersects(Bounds bounds)
Tests whether this bounding object intersects the specified bounding object.

Parameters:
bounds - The bounding object to test intersection with.
Returns:
true if the specified bounding object intersects this bounding object; false otherwise.
Throws:
NullPointerException - If bounds is null.
Since:
BlackBerry API 6.0.0

intersects

boolean intersects(Frustum frustum)
Tests whether this bounding object intersects the specified frustum.

Parameters:
frustum - The frustum to test intersection with.
Returns:
true if this bounding object intersects the specified frustum; false otherwise.
Throws:
NullPointerException - If frustum is null.
Since:
BlackBerry API 6.0.0

intersects

float intersects(Plane plane)
Tests whether this bounding object intersects the specified plane.

Parameters:
plane - The plane to test intersection with.
Returns:
INTERSECTS_BACK if this bounding object is in the negative half-space of the plane, INTERSECTS_FRONT if it is in the positive half-space of the plane; and INTERSECTS_INTERSECTING if it intersects the plane.
Throws:
NullPointerException - If plane is null.
Since:
BlackBerry API 6.0.0

intersects

float intersects(Ray ray)
Tests whether this bounding object intersects the specified ray.

Parameters:
ray - The ray to test intersection with.
Returns:
The distance from the origin of the ray to this bounding object or INTERSECTS_NONE if the ray does not intersect this bounding object.
Throws:
NullPointerException - If ray is null.
Since:
BlackBerry API 6.0.0

isEmpty

boolean isEmpty()
Determines if this bounding object is empty.

Returns:
true if this bounding object is empty;false otherwise.
Since:
BlackBerry API 6.0.0

merge

void merge(Bounds bounds)
Sets this bounding object to the smallest bounding object that contains both this bounding object and the specified bounds.

Parameters:
bounds - The bounding object to merge with.
Throws:
NullPointerException - If bounds is null.
Since:
BlackBerry API 6.0.0

set

void set(Bounds bounds)
Sets this bounding object to the specified bounding object.

Parameters:
bounds - The bounding object to set to.
Throws:
IllegalArgumentException - If this bounding object's type does not match the type of bounds.
NullPointerException - If bounds is null.
Since:
BlackBerry API 6.0.0

transform

void transform(Matrix4f matrix)
Transforms the bounding object by the given transformation matrix.

Parameters:
matrix - The transformation matrix to transform by.
Throws:
NullPointerException - If matrix is null.
Since:
BlackBerry API 6.0.0

equals

boolean equals(Object obj)
Returns true if the specified object is equal to this bounding object.

Overrides:
equals in class Object
Parameters:
obj - The object to compare.
Returns:
true if this bounding object is equal to obj; false otherwise.
Throws:
NullPointerException - If obj is null.
See Also:
Boolean.hashCode(), Hashtable
Since:
BlackBerry API 6.0.0

hashCode

int hashCode()
Returns a hash code based on the elements of this bounding object.

Overrides:
hashCode in class Object
Returns:
The hash code for this bounding object.
See Also:
Object.equals(java.lang.Object), Hashtable
Since:
BlackBerry API 6.0.0

toString

String toString()
Returns a String representation of this bounding object.

Overrides:
toString in class Object
Returns:
A String representation of this bounding object.
Since:
BlackBerry API 6.0.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal