anl.aida.viz3d
Class BoundingSphere

java.lang.Object
  extended by anl.aida.viz3d.BoundingSphere

public class BoundingSphere
extends java.lang.Object

A bounding sphere.


Field Summary
private  javax.vecmath.Point3f center
           
private  float radius
           
 
Constructor Summary
BoundingSphere(BoundingSphere sphere)
           
BoundingSphere(javax.vecmath.Point3f center, float radius)
          Creates a BoundingSphere with the specified center and radius.
 
Method Summary
 javax.vecmath.Point3f getCenterRef()
           
 float getRadius()
           
 boolean intersects(javax.vecmath.Point3f rayOrigin, javax.vecmath.Vector3f rayDirection)
          Whether or not the specified ray intersects with this BoundingSphere.
 BoundingSphere merge(BoundingSphere sphere)
          Merge this BoudingSphere with the specified BoudingSphere storing the results in this BoundingSphere.
 java.lang.String toString()
           
 BoundingSphere transform(float scale, javax.vecmath.Quat4f rotate, javax.vecmath.Vector3f translate)
          Transform this bounding sphere.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

center

private javax.vecmath.Point3f center

radius

private float radius
Constructor Detail

BoundingSphere

public BoundingSphere(javax.vecmath.Point3f center,
                      float radius)
Creates a BoundingSphere with the specified center and radius.

Parameters:
center -
radius -

BoundingSphere

public BoundingSphere(BoundingSphere sphere)
Method Detail

getCenterRef

public javax.vecmath.Point3f getCenterRef()

getRadius

public float getRadius()

intersects

public boolean intersects(javax.vecmath.Point3f rayOrigin,
                          javax.vecmath.Vector3f rayDirection)
Whether or not the specified ray intersects with this BoundingSphere.

Parameters:
rayOrigin - the ray's origin
rayDirection - the ray's direction
Returns:
true if the ray intersects otherwise false.

transform

public BoundingSphere transform(float scale,
                                javax.vecmath.Quat4f rotate,
                                javax.vecmath.Vector3f translate)
Transform this bounding sphere.

Parameters:
scale -
rotate -
translate -
Returns:
this BoundingSphere post transform

merge

public BoundingSphere merge(BoundingSphere sphere)
Merge this BoudingSphere with the specified BoudingSphere storing the results in this BoundingSphere.

Parameters:
sphere - the sphere to merge with
out - the box to store the result in.
Returns:
this BoundingSphere post-merge

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object