jme.geometry.bounding
Class BoundingEllipsoid

java.lang.Object
  extended byjme.geometry.bounding.BoundingEllipsoid
All Implemented Interfaces:
BoundingVolume

public class BoundingEllipsoid
extends java.lang.Object
implements BoundingVolume

BoundingEllipsoid is defined as x^2/a^2 + y^2/b^2 + z^2/c^2 = 1 with a center of (0, 0, 0). The ellipsoid can also be expressed as the center matrix form (and will be in this class) as: (X-C)^T A (X-C) = 1.

Version:
$Id: BoundingEllipsoid.java,v 1.3 2003/09/08 20:29:28 mojomonkey Exp $
Author:
Mark Powell

Constructor Summary
BoundingEllipsoid()
          Constructor instantiates a new BoundingEllipsoid with default attributes.
BoundingEllipsoid(Vector center, Matrix a, Matrix inverseA)
          Constructor instantiates a new BoundingEllipsoid with given parameters.
 
Method Summary
 float distance(BoundingVolume volume)
           
 void gaussianDistribution(Vector[] points)
          gaussianDistribution creates an ellipsoid using the mean of the points for the center and the eigenvectors for the axes.
 boolean hasCollision(BoundingVolume volume)
           
 boolean isVisible(Frustum frustum)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundingEllipsoid

public BoundingEllipsoid()
Constructor instantiates a new BoundingEllipsoid with default attributes.


BoundingEllipsoid

public BoundingEllipsoid(Vector center,
                         Matrix a,
                         Matrix inverseA)
Constructor instantiates a new BoundingEllipsoid with given parameters.

Parameters:
center - the center of the ellipsoid.
a - the matrix A from (X-C)^T A (X-C) = 1.
inverseA - the inverse of A.
Method Detail

gaussianDistribution

public void gaussianDistribution(Vector[] points)
gaussianDistribution creates an ellipsoid using the mean of the points for the center and the eigenvectors for the axes.

Parameters:
points - the points to contain.

hasCollision

public boolean hasCollision(BoundingVolume volume)
Specified by:
hasCollision in interface BoundingVolume

distance

public float distance(BoundingVolume volume)
Specified by:
distance in interface BoundingVolume

isVisible

public boolean isVisible(Frustum frustum)
Specified by:
isVisible in interface BoundingVolume