gumbo.graphic.math
Class Plane3

java.lang.Object
  |
  +--gumbo.graphic.math.Plane3
All Implemented Interfaces:
Graphic, GraphicGeometry, java.io.Serializable, TransformableGraphic
Direct Known Subclasses:
Polygon3

public class Plane3
extends java.lang.Object
implements java.io.Serializable, TransformableGraphic

A 3D spatial element representing a plane of infinite extent, which is defined by a normal vector and a (possibly negative) distance from the origin along the vector. A plane, as defined here, has an inside (back side) and an outside (front side), with the outside (front side) being in the direction of the normal.

Version:
$Revision: 1.9 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.
See Also:
Serialized Form

Constructor Summary
Plane3()
          Creates an instance, with zero distance, and a default unit vector normal.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 double getDistance()
          Gets the distance from the origin to this plane.
 java.lang.Object getGraphic()
          Default implementation: Returns this (non-native implementation).
 SpaceNode getGraphicLocalSpace()
          Default implementation: Returns null (absolute reference space).
 UnitVector3 getNormal()
          Gets an immutable view of the normal vector for this plane.
 Plane3 getPlane3()
          Gets a singleton immutable view of this object with the same identity (hashCode(), equals()) as this object.
 Plane3 setDistance(double dist)
          Sets the distance from the origin to this plane along its normal vector.
 Plane3 setNormal(UnitVector3 vector)
          Sets the normal vector for this plane.
 java.lang.String toString()
           
 void transformGraphic(Matrix4 matrix)
          Default implementation: Uses setPosition() and setDirection() for subclass compatibility.
 void transformGraphic(SpaceNode from, SpaceNode to)
          Default implementation: Uses setPosition() and setDirection() for subclass compatibility.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Plane3

public Plane3()
Creates an instance, with zero distance, and a default unit vector normal.

Method Detail

setDistance

public Plane3 setDistance(double dist)
Sets the distance from the origin to this plane along its normal vector. Master partial state mutator.


setNormal

public Plane3 setNormal(UnitVector3 vector)
Sets the normal vector for this plane. Master partial state mutator.


getDistance

public double getDistance()
Gets the distance from the origin to this plane. Master partial state accessor.


getNormal

public UnitVector3 getNormal()
Gets an immutable view of the normal vector for this plane. Master partial state accessor.


getPlane3

public Plane3 getPlane3()
Gets a singleton immutable view of this object with the same identity (hashCode(), equals()) as this object.

Returns:
The view. Never null.

transformGraphic

public void transformGraphic(SpaceNode from,
                             SpaceNode to)
Default implementation: Uses setPosition() and setDirection() for subclass compatibility.

Specified by:
transformGraphic in interface TransformableGraphic
Parameters:
from - The current reference space. Never null.
to - The new reference space. Never null.

transformGraphic

public void transformGraphic(Matrix4 matrix)
Default implementation: Uses setPosition() and setDirection() for subclass compatibility.

Specified by:
transformGraphic in interface TransformableGraphic
Parameters:
matrix - Value of the transform matrix. Never null.

getGraphicLocalSpace

public SpaceNode getGraphicLocalSpace()
Default implementation: Returns null (absolute reference space).

Specified by:
getGraphicLocalSpace in interface GraphicGeometry
Returns:
Reference to the space. If null, absolute space.

getGraphic

public java.lang.Object getGraphic()
Default implementation: Returns this (non-native implementation).

Specified by:
getGraphic in interface Graphic
Returns:
The target graphic object. Possibly this object (self-proxy, direct implementation), but never null.

toString

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

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object