gumbo.graphic.math
Class AxisAngle3

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

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

A 3D spatial transform specifying rotation about an arbitrary axis, which is defined by a scalar angle and a rotation axis vector. Rotation about the axis uses the right-hand rule and is cummulative (like a transform).

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

Constructor Summary
AxisAngle3()
          Creates an instance with zero rotation, and a default unit vector axis.
AxisAngle3(AxisAngle3 target)
          Creates an instance with the same geometry as the target.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 double getAngle()
          Gets this axis-angle's rotation angle.
 UnitVector3 getAxis()
          Gets an immutable view of this axis-angle's rotation axis.
 AxisAngle3 getAxisAngle3()
          Gets a singleton immutable view of this object with the same identity (hashCode(), equals()) as this object.
 java.lang.Object getGraphic()
          Default implementation: Returns this (non-native implementation).
 SpaceNode getGraphicLocalSpace()
          Default implementation: Returns null (absolute reference space).
 void set(AxisAngle3 rotation)
          Sets this axis-angle to the value of another axis-angle.
 AxisAngle3 setAngle(double angle)
          Sets this axis-angle's rotation angle, in radians.
 AxisAngle3 setAxis(Vector3 axis)
          Sets this axis-angle's rotation axis.
 java.lang.String toString()
           
 void transformGraphic(Matrix4 matrix)
          Default implementation: Only affects the axis, not the angle.
 void transformGraphic(SpaceNode from, SpaceNode to)
          Default implementation: Only affects the axis, not the angle.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AxisAngle3

public AxisAngle3()
Creates an instance with zero rotation, and a default unit vector axis.


AxisAngle3

public AxisAngle3(AxisAngle3 target)
Creates an instance with the same geometry as the target.

Method Detail

set

public void set(AxisAngle3 rotation)
Sets this axis-angle to the value of another axis-angle.

Parameters:
rotation - Rotation to copy. Never null.

setAngle

public AxisAngle3 setAngle(double angle)
Sets this axis-angle's rotation angle, in radians. Master partial state mutator.


setAxis

public AxisAngle3 setAxis(Vector3 axis)
Sets this axis-angle's rotation axis. Master partial state mutator.


getAngle

public double getAngle()
Gets this axis-angle's rotation angle. Master partial state accessor.


getAxis

public UnitVector3 getAxis()
Gets an immutable view of this axis-angle's rotation axis. Master partial state accessor.


getAxisAngle3

public AxisAngle3 getAxisAngle3()
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: Only affects the axis, not the angle. Uses setAxis() 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: Only affects the axis, not the angle. Uses setAxis() 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