org.jdesktop.wonderland.common.cell
Class CellTransform

java.lang.Object
  extended by org.jdesktop.wonderland.common.cell.CellTransform
All Implemented Interfaces:
java.io.Serializable

public class CellTransform
extends java.lang.Object
implements java.io.Serializable

The transform for a cell.

Author:
paulby
See Also:
Serialized Form

Constructor Summary
CellTransform()
          Create an identity transform
CellTransform(com.jme.math.Quaternion rotate, com.jme.math.Vector3f translation)
          Create a cell transform.
CellTransform(com.jme.math.Quaternion rotate, com.jme.math.Vector3f translate, float scale)
          Constructor that takes translation, rotation, and scaling.
CellTransform(com.jme.math.Quaternion rotate, com.jme.math.Vector3f translate, com.jme.math.Vector3f scale)
          Deprecated. Non uniform scale are not supported
 
Method Summary
 CellTransform clone(CellTransform result)
           
 boolean epsilonEquals(CellTransform o)
          Determine if all values from this transform are within epsilon of the values from the given transform.
 boolean equals(java.lang.Object o)
           
 void getLookAt(com.jme.math.Vector3f position, com.jme.math.Vector3f look)
          Return the position and current look direction
 com.jme.math.Quaternion getRotation(com.jme.math.Quaternion rotation)
          Get the rotation portion of this transform.
 float getScaling()
          Return the uniform scale of this transform.
 com.jme.math.Vector3f getScaling(com.jme.math.Vector3f scale)
          Returns the scaling vector as an array of doubles to scale each axis.
 com.jme.math.Vector3f getTranslation(com.jme.math.Vector3f translation)
          Populates translation with the translation of this CellTransform, if translation is null, a new Vector3f will be created and returned
 int hashCode()
           
 CellTransform invert()
          Invert the transform, this object is inverted and returned.
 CellTransform mul(CellTransform in)
          Multiply this transform by t1.
 CellTransform mul(CellTransform t1, CellTransform t2)
          Multiply t1 * t2 and put the result in this.
 void setRotation(com.jme.math.Quaternion rotation)
          Set the rotation portion of this transform
 void setScaling(float scale)
          Sets the scaling factor for this cell transform
 void setTranslation(com.jme.math.Vector3f translation)
          Set the translation.
 CellTransform sub(CellTransform t1)
          Subtract t1 from this transform, modifying this transform and returning this transform.
 java.lang.String toString()
           
 void transform(com.jme.bounding.BoundingVolume ret)
          Transform the BoundingVolume
 com.jme.math.Vector3f transform(com.jme.math.Vector3f ret)
          Transform the vector ret by this transform.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CellTransform

public CellTransform()
Create an identity transform


CellTransform

public CellTransform(com.jme.math.Quaternion rotate,
                     com.jme.math.Vector3f translate,
                     float scale)
Constructor that takes translation, rotation, and scaling. Any/all of the three arguments may be null.


CellTransform

public CellTransform(com.jme.math.Quaternion rotate,
                     com.jme.math.Vector3f translate,
                     com.jme.math.Vector3f scale)
Deprecated. Non uniform scale are not supported

Parameters:
rotate -
translate -
scale -

CellTransform

public CellTransform(com.jme.math.Quaternion rotate,
                     com.jme.math.Vector3f translation)
Create a cell transform. Either (or both) values may be null

Parameters:
quat -
translation -
Method Detail

clone

public CellTransform clone(CellTransform result)

transform

public void transform(com.jme.bounding.BoundingVolume ret)
Transform the BoundingVolume

Parameters:
ret -

transform

public com.jme.math.Vector3f transform(com.jme.math.Vector3f ret)
Transform the vector ret by this transform. ret is modified and returned.

Parameters:
ret -

getLookAt

public void getLookAt(com.jme.math.Vector3f position,
                      com.jme.math.Vector3f look)
Return the position and current look direction

Parameters:
position -
look -

mul

public CellTransform mul(CellTransform in)
Multiply this transform by t1. This transform will be update and the result returned

Parameters:
transform -
Returns:
this

mul

public CellTransform mul(CellTransform t1,
                         CellTransform t2)
Multiply t1 * t2 and put the result in this. Also return this

Parameters:
t1 -
t2 -
Returns:

sub

public CellTransform sub(CellTransform t1)
Subtract t1 from this transform, modifying this transform and returning this transform.

Parameters:
t1 -
Returns:

getTranslation

public com.jme.math.Vector3f getTranslation(com.jme.math.Vector3f translation)
Populates translation with the translation of this CellTransform, if translation is null, a new Vector3f will be created and returned

Parameters:
translation - object to return (to avoid gc)
Returns:
the translation for this transform

setTranslation

public void setTranslation(com.jme.math.Vector3f translation)
Set the translation.

Parameters:
translation - set the translation for this transform

getRotation

public com.jme.math.Quaternion getRotation(com.jme.math.Quaternion rotation)
Get the rotation portion of this transform. Populates the rotation paramter with the current rotation and returns it, if rotation is null a new Quaternion is returned.

Parameters:
rotation - object to return (to avoid gc)
Returns:
the rotation quaternion for this transform

setRotation

public void setRotation(com.jme.math.Quaternion rotation)
Set the rotation portion of this transform

Parameters:
rotation - set the rotation for this transform

getScaling

public com.jme.math.Vector3f getScaling(com.jme.math.Vector3f scale)
Returns the scaling vector as an array of doubles to scale each axis. Sets the value of the scale into the argument (if given). If a null argument is passed, then this method creates and returns a new Vector3f object. The scale is uniform, this is a convenience function as JME expects a vector

Parameters:
scale - Populate this object with the scale if non-null
Returns:
The scaling factors

getScaling

public float getScaling()
Return the uniform scale of this transform.

Returns:

setScaling

public void setScaling(float scale)
Sets the scaling factor for this cell transform

Parameters:
scale - The new scaling factor

invert

public CellTransform invert()
Invert the transform, this object is inverted and returned.

Returns:
return this

epsilonEquals

public boolean epsilonEquals(CellTransform o)
Determine if all values from this transform are within epsilon of the values from the given transform.


equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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


Open Wonderland - http://openwonderland.org