Class Plane

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

public class Plane
extends Shape

A class representing a plane. A plane is specified by a point and a normal.


Constructor Summary
Plane()
           
Plane(javax.vecmath.Point3d point, javax.vecmath.Vector3d normal)
          Constructs a plane from a point and the plane's normal.
Plane(javax.vecmath.Point3d point, javax.vecmath.Vector3d v1, javax.vecmath.Vector3d v2)
          Constructs a plane from a point and two vectors laying in the plane.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of the object.
 boolean contains(javax.vecmath.Point3d point)
          Determines if a point is contained on the plane.
 void createPlaneFromVectors(javax.vecmath.Point3d point, javax.vecmath.Vector3d v1, javax.vecmath.Vector3d v2)
          Constructs a plane from a point and two vectors laying in the plane.
 javax.vecmath.Vector3d getNormal()
          Returns the plane's normal.
 javax.vecmath.Point3d getPoint()
          Returns the point on the plane.
 double nearestIntersectionTime(Ray3d ray)
          Gets the nearest intersection time between the specified ray and the shape.
 void setNormal(javax.vecmath.Vector3d normal)
          Sets the plane's normal.
 void setPoint(javax.vecmath.Point3d point)
          Sets the point on the plane.
 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, load, setSurfaceProperties
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Plane

public Plane()

Plane

public Plane(javax.vecmath.Point3d point,
             javax.vecmath.Vector3d normal)
Constructs a plane from a point and the plane's normal.

Parameters:
point - A point on the plane.
normal - The plane's normal.

Plane

public Plane(javax.vecmath.Point3d point,
             javax.vecmath.Vector3d v1,
             javax.vecmath.Vector3d v2)
Constructs a plane from a point and two vectors laying in the plane.

Parameters:
point - A point on the plane.
v1 - A vector on the plane.
v2 - A vector on the plane.
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.

createPlaneFromVectors

public void createPlaneFromVectors(javax.vecmath.Point3d point,
                                   javax.vecmath.Vector3d v1,
                                   javax.vecmath.Vector3d v2)
Constructs a plane from a point and two vectors laying in the plane.

Parameters:
point - A point on the plane.
v1 - A vector on the plane.
v2 - A vector on the plane.

contains

public boolean contains(javax.vecmath.Point3d point)
Determines if a point is contained on the plane.

Parameters:
point - The point to test.
Returns:
true if the point is on the plane, otherwise false.

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.

setPoint

public void setPoint(javax.vecmath.Point3d point)
Sets the point on the plane.

Parameters:
point - The point to set.

getPoint

public javax.vecmath.Point3d getPoint()
Returns the point on the plane.

Returns:
The point on the plane.

setNormal

public void setNormal(javax.vecmath.Vector3d normal)
Sets the plane's normal.

Parameters:
normal - The normal to set.

getNormal

public javax.vecmath.Vector3d getNormal()
Returns the plane's normal.

Returns:
The plane's normal.