|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.spatial.bodies.Sphere
org.openmali.spatial.bounds.BoundingSphere
public class BoundingSphere
A spherical bounding volume. It has two associated values: the center point and the radius of the sphere.
| Constructor Summary | |
|---|---|
BoundingSphere()
Constructs a new BoundingShpere object. |
|
BoundingSphere(Bounds bo)
Constructs a new BoundingShpere object. |
|
BoundingSphere(Bounds[] bos)
Constructs a new BoundingShpere object. |
|
BoundingSphere(float centerX,
float centerY,
float centerZ,
float radius)
Constructs a new BoundingShpere object. |
|
BoundingSphere(Tuple3f center,
float radius)
Constructs a new BoundingShpere object. |
|
| Method Summary | |
|---|---|
Bounds |
closestIntersection(Bounds[] boundsObjects)
Finds closest bounding object that intersects this bounding object. |
void |
compute(java.util.List<Tuple3f> coords)
Routine to calculate tight bounding sphere over a set of points in 3D. |
void |
compute(Tuple3f[] coords)
Routine to calculate tight bounding sphere over a set of points in 3D. |
void |
compute(VertexContainer source)
Calculates a tight bounding sphere over a set of points in 3D. |
float |
getMaxDistance()
|
float |
getMaxSquaredDistance()
|
BoundsType |
getType()
|
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. |
static BoundingSphere |
newBoundingSphere(java.util.List<Tuple3f> coords)
Routine to calculate tight bounding sphere over a set of points in 3D. |
static BoundingSphere |
newBoundingSphere(Tuple3f[] coords)
Routine to calculate tight bounding sphere over a set of points in 3D. |
static BoundingSphere |
newBoundingSphere(VertexContainer source)
Routine to calculate tight bounding sphere over a set of points in 3D. |
void |
set(Bounds boundsObject)
Sets the the value of this Bounds object to enclode the specified bounding object |
void |
set(Bounds[] bos)
Sets this bounds to the comnination of all the specified bounds. |
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.Sphere |
|---|
combine, combine, combine, combine, combine, contains, contains, containsPlus, containsXYPlus, getCenter, getCenter, getCenterX, getCenterY, getCenterZ, getRadius, getRadiusSquared, setCenter, setCenter, setRadius |
| 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 |
| Methods inherited from interface org.openmali.spatial.bodies.Body |
|---|
combine, combine |
| Constructor Detail |
|---|
public BoundingSphere(float centerX,
float centerY,
float centerZ,
float radius)
centerX - centerY - centerZ - radius -
public BoundingSphere(Tuple3f center,
float radius)
public BoundingSphere()
public BoundingSphere(Bounds bo)
public BoundingSphere(Bounds[] bos)
| Method Detail |
|---|
public final BoundsType getType()
getType in interface Boundspublic final float getMaxSquaredDistance()
getMaxSquaredDistance in interface Boundspublic final float getMaxDistance()
getMaxDistance in interface Bounds
public boolean intersects(Point3f rayOrigin,
Vector3f rayDirection,
Tuple3f intersection)
intersects in interface Bounds
public boolean intersects(Ray3f ray,
Tuple3f intersection)
intersects in interface Bounds
public boolean intersects(Point3f rayOrigin,
Vector3f rayDirection)
intersects in interface Boundspublic boolean intersects(Ray3f ray)
intersects in interface Boundspublic boolean intersects(Bounds bo)
intersects in interface Boundspublic boolean intersects(Bounds[] bos)
intersects in interface Boundspublic Bounds closestIntersection(Bounds[] boundsObjects)
closestIntersection in interface Boundspublic void transform(Matrix4f trans)
transform in interface Bounds
public void transform(Bounds bounds,
Matrix4f trans)
transform in interface Boundspublic void set(Bounds boundsObject)
set in interface Boundspublic void set(Bounds[] bos)
set in interface Boundspublic void compute(VertexContainer source)
compute in interface Boundssource - the Vertex-sourcepublic void compute(java.util.List<Tuple3f> coords)
compute in interface Boundscoords - the Verticespublic void compute(Tuple3f[] coords)
compute in interface Boundscoords - the Verticespublic java.lang.String toString()
toString in class Spherepublic static BoundingSphere newBoundingSphere(VertexContainer source)
source - the Vertex-source
public static BoundingSphere newBoundingSphere(java.util.List<Tuple3f> coords)
coords - the vertex list
public static BoundingSphere newBoundingSphere(Tuple3f[] coords)
coords - the vertex list
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||