gumbo.graphic.math
Class Point3

java.lang.Object
  |
  +--gumbo.graphic.math.Tuple3
        |
        +--gumbo.graphic.math.Point3
All Implemented Interfaces:
Graphic, GraphicGeometry, java.io.Serializable, TransformableGraphic

public class Point3
extends Tuple3
implements TransformableGraphic

A 3D spatial element representing a point (vertex), which is used exclusively for spatial position.

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

Constructor Summary
Point3()
           
Point3(double[] val)
          Creates an instance using a mutator.
Point3(double x, double y, double z)
          Creates an instance using a mutator.
Point3(Tuple3 tuple)
          Creates an instance using a mutator.
 
Method Summary
 double distance(Point3 point)
          Returns the euclidean distance between this point and another.
 double distanceSquared(Point3 point)
          Returns the squared euclidean distance (sum of the difference squared) between this point and another.
 boolean equals(java.lang.Object obj)
           
 Point3 getPoint3()
          Gets a singleton immutable view of this object with the same identity (hashCode(), equals()) as this object.
protected  Point3 implGetPoint3()
          Master whole state accessor.
 void transformGraphic(Matrix4 matrix)
          Transforms this graphic's geometry by pre-multiplying it with the specified transform matrix.
 void transformGraphic(SpaceNode from, SpaceNode to)
          Transforms this graphic's geometry from one local reference space to another in a space tree.
 
Methods inherited from class gumbo.graphic.math.Tuple3
abs, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, clear, clearArray, div, div, get, get, getGraphic, getGraphicLocalSpace, getTuple3, getX, getY, getZ, implGetTuple3, implGetTuple3, implGetTuple3, implInitTuple3, implSetTuple3, implSetTuple3, isEqual, isEqual, isGreaterEqual, isInsideEqual, isLessEqual, isOutside, isZero, isZero, max, max, min, min, mult, mult, neg, noise, random, round, set, set, set, set, setArray, setX, setY, setZ, sub, sub, sum, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gumbo.graphic.space.GraphicGeometry
getGraphicLocalSpace
 
Methods inherited from interface gumbo.graphic.Graphic
getGraphic
 

Constructor Detail

Point3

public Point3()

Point3

public Point3(double x,
              double y,
              double z)
Creates an instance using a mutator.


Point3

public Point3(double[] val)
Creates an instance using a mutator.


Point3

public Point3(Tuple3 tuple)
Creates an instance using a mutator.

Method Detail

getPoint3

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

Returns:
The view. Never null.

distanceSquared

public final double distanceSquared(Point3 point)
Returns the squared euclidean distance (sum of the difference squared) between this point and another.


distance

public final double distance(Point3 point)
Returns the euclidean distance between this point and another.


implGetPoint3

protected Point3 implGetPoint3()
Master whole state accessor.


transformGraphic

public void transformGraphic(SpaceNode from,
                             SpaceNode to)
Description copied from interface: TransformableGraphic
Transforms this graphic's geometry from one local reference space to another in a space tree. Does not access or update this object's intrinsic reference space (which is returned by getGraphicLocalSpace()). If this graphic is spatially constrained some or all of the transformation may be ignored.

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)
Description copied from interface: TransformableGraphic
Transforms this graphic's geometry by pre-multiplying it with the specified transform matrix. As such, transformations are cumulative. If this graphic is spatially constrained some or all of the transformation may be ignored.

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

equals

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