Class Ellipsoid

java.lang.Object
  extended by Shape
      extended by Ellipsoid
All Implemented Interfaces:
CloneableEx, java.lang.Cloneable, Persistent

public class Ellipsoid
extends Shape

Represents an ellipsoid An {code Ellipsoid} is specified by an origin point and a vector for each of it's semi-axes.


Constructor Summary
Ellipsoid()
          Constructs an Ellipsoid at the origin, with unit length semi-axes (a sphere).
Ellipsoid(javax.vecmath.Point3d origin, javax.vecmath.Vector3d semiaxisA, javax.vecmath.Vector3d semiaxisB, javax.vecmath.Vector3d semiaxisC, SurfaceProperties sp)
          Constructs an Ellipsoid with the specified parameters.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of the object.
 javax.vecmath.Point3d getOrigin()
          Returns the origin of the ellipsoid.
 javax.vecmath.Vector3d getSemiAxisX()
          Returns the semi-axis corresponding to the X axis in object space.
 javax.vecmath.Vector3d getSemiAxisY()
          Returns the semi-axis corresponding to the Y axis in object space.
 javax.vecmath.Vector3d getSemiAxisZ()
          Returns the semi-axis corresponding to the Z axis in object space.
 javax.vecmath.Matrix3d getTransform()
          Returns the matrix that transforms the ellipsoid from world space to a sphere centered on the origin.
 void load(DataParser dataParser)
          Loads data using the DataParser object.
 double nearestIntersectionTime(Ray3d ray)
          Gets the nearest intersection time between the specified ray and the shape.
 void setOrigin(javax.vecmath.Point3d origin)
          Sets the origin of the ellipsoid.
 void setSemiAxisX(javax.vecmath.Vector3d semiAxisX)
          Sets the semi-axis corresponding to the X axis in object space.
 void setSemiAxisY(javax.vecmath.Vector3d semiAxisY)
          Sets the semi-axis corresponding to the Y axis in object space.
 void setSemiAxisZ(javax.vecmath.Vector3d semiAxisZ)
          Sets the semi-axis corresponding to the Z axis in object space.
 javax.vecmath.Vector3d surfaceNormal(javax.vecmath.Point3d point)
          Gets the surface normal at the specified point on the shape.
 
Methods inherited from class Shape
getSurfaceProperties, setSurfaceProperties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ellipsoid

public Ellipsoid()
Constructs an Ellipsoid at the origin, with unit length semi-axes (a sphere).


Ellipsoid

public Ellipsoid(javax.vecmath.Point3d origin,
                 javax.vecmath.Vector3d semiaxisA,
                 javax.vecmath.Vector3d semiaxisB,
                 javax.vecmath.Vector3d semiaxisC,
                 SurfaceProperties sp)
Constructs an Ellipsoid with the specified parameters.

Parameters:
origin - The origin of the ellipsoid.
semiaxisA - The semi-axis along the X axis in object space.
semiaxisB - The semi-axis along the Y axis in object space.
semiaxisC - The semi-axis along the Z axis in object space.
sp - The surface properties of the ellipsoid.
Method Detail

clone

public java.lang.Object clone()
Description copied from interface: CloneableEx
Returns a copy of the object.

Specified by:
clone in interface CloneableEx
Specified by:
clone in class Shape
Returns:
A copy of the object.

nearestIntersectionTime

public double nearestIntersectionTime(Ray3d ray)
Description copied from class: Shape
Gets the nearest intersection time between the specified ray and the shape.

Specified by:
nearestIntersectionTime in class Shape
Parameters:
ray - The ray to intersect with the shape.
Returns:
The nearest time of intersection.

surfaceNormal

public javax.vecmath.Vector3d surfaceNormal(javax.vecmath.Point3d point)
Description copied from class: Shape
Gets the surface normal at the specified point on the shape.

Specified by:
surfaceNormal in class Shape
Parameters:
point - The point on the surface of the shape.
Returns:
The surface normal of the point on the shape.

load

public void load(DataParser dataParser)
Description copied from interface: Persistent
Loads data using the DataParser object.

A class overrides this function to load data that has been parsed.

Specified by:
load in interface Persistent
Overrides:
load in class Shape
Parameters:
dataParser - The DataParser to load data from.

setOrigin

public void setOrigin(javax.vecmath.Point3d origin)
Sets the origin of the ellipsoid.

Parameters:
origin - The new origin point.

getOrigin

public javax.vecmath.Point3d getOrigin()
Returns the origin of the ellipsoid.

Returns:
The origin point.

setSemiAxisX

public void setSemiAxisX(javax.vecmath.Vector3d semiAxisX)
Sets the semi-axis corresponding to the X axis in object space.

Parameters:
semiAxisX - The new X semi-axis.

getSemiAxisX

public javax.vecmath.Vector3d getSemiAxisX()
Returns the semi-axis corresponding to the X axis in object space.

Returns:
The X semi-axis.

setSemiAxisY

public void setSemiAxisY(javax.vecmath.Vector3d semiAxisY)
Sets the semi-axis corresponding to the Y axis in object space.

Parameters:
semiAxisY - The new Y semi-axis.

getSemiAxisY

public javax.vecmath.Vector3d getSemiAxisY()
Returns the semi-axis corresponding to the Y axis in object space.

Returns:
The Y semi-axis.

setSemiAxisZ

public void setSemiAxisZ(javax.vecmath.Vector3d semiAxisZ)
Sets the semi-axis corresponding to the Z axis in object space.

Parameters:
semiAxisZ - The new Z semi-axis.

getSemiAxisZ

public javax.vecmath.Vector3d getSemiAxisZ()
Returns the semi-axis corresponding to the Z axis in object space.

Returns:
The Z semi-axis.

getTransform

public javax.vecmath.Matrix3d getTransform()
Returns the matrix that transforms the ellipsoid from world space to a sphere centered on the origin.

Returns:
The transformation matrix.