org.jagatoo.datatypes.impl
Class PlaceableImpl

java.lang.Object
  extended by org.jagatoo.datatypes.impl.PlaceableImpl
All Implemented Interfaces:
Placeable

public abstract class PlaceableImpl
extends java.lang.Object
implements Placeable

A small, GC-friendly implementation of the Placeable interface. Extend it when you need Placeable without much hassle and you don't already have a superclass.

Author:
Amos Wenger (aka BlueSky)

Field Summary
protected  org.openmali.vecmath2.Point3f position
           
protected  org.openmali.vecmath2.Matrix3f rotation
           
 
Constructor Summary
PlaceableImpl()
          Creation a new PlaceableImpl with pos (0,0,0) and no rotation.
 
Method Summary
 org.openmali.vecmath2.Tuple3f getPosition()
           
 void getPosition(org.openmali.vecmath2.Tuple3f pos)
          Writes the position of this Placeable object to the given Tuple3f.
 float getPositionX()
           
 float getPositionY()
           
 float getPositionZ()
           
 org.openmali.vecmath2.Tuple3f getRotation()
           
 void getRotation(org.openmali.vecmath2.Tuple3f rot)
          Writes the rotation, in Euler angles (degrees) of this Placeable object in the given Tuple3f.
 org.openmali.vecmath2.Matrix3f getRotationMatrix()
           
 void getRotationMatrix(org.openmali.vecmath2.Matrix3f rot)
          Writes the rotation, as a 3x3 rotation Matrix, of this Placeable object in the given Matrix3f.
 float getRotationX()
           
 float getRotationY()
           
 float getRotationZ()
           
abstract  void onPositionChanged()
           
abstract  void onRotationChanged()
           
 void setPosition(float posX, float posY, float posZ)
          Sets the position of this Placeable object.
 void setPosition(org.openmali.vecmath2.Tuple3f pos)
          Sets the position of this Placeable object.
 void setPositionX(float v)
           
 void setPositionY(float v)
           
 void setPositionZ(float v)
           
 void setRotation(float rotX, float rotY, float rotZ)
          Sets the rotation of this object, in Euler angles.
 void setRotation(org.openmali.vecmath2.Tuple3f rot)
          Sets the rotation of this object, in Euler angles (degrees)
 void setRotationMatrix(org.openmali.vecmath2.Matrix3f rot)
          Sets the rotation Matrix of this object.
 void setRotationX(float v)
           
 void setRotationY(float v)
           
 void setRotationZ(float v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

position

protected org.openmali.vecmath2.Point3f position

rotation

protected org.openmali.vecmath2.Matrix3f rotation
Constructor Detail

PlaceableImpl

public PlaceableImpl()
Creation a new PlaceableImpl with pos (0,0,0) and no rotation.

Method Detail

getPosition

public org.openmali.vecmath2.Tuple3f getPosition()
Specified by:
getPosition in interface Placeable
Returns:
The position of this Placeable object

getPosition

public void getPosition(org.openmali.vecmath2.Tuple3f pos)
Description copied from interface: Placeable
Writes the position of this Placeable object to the given Tuple3f.

Specified by:
getPosition in interface Placeable
Parameters:
pos - The Tuple3f to put the pos into

getRotation

public org.openmali.vecmath2.Tuple3f getRotation()
Specified by:
getRotation in interface Placeable
Returns:
The rotation, in Euler angles (degrees) of this Placeable object.

getRotation

public void getRotation(org.openmali.vecmath2.Tuple3f rot)
Description copied from interface: Placeable
Writes the rotation, in Euler angles (degrees) of this Placeable object in the given Tuple3f.

Specified by:
getRotation in interface Placeable

getRotationMatrix

public org.openmali.vecmath2.Matrix3f getRotationMatrix()
Specified by:
getRotationMatrix in interface Placeable
Returns:
The rotation, as a 3x3 rotation Matrix, of this Placeable object.

getRotationMatrix

public void getRotationMatrix(org.openmali.vecmath2.Matrix3f rot)
Description copied from interface: Placeable
Writes the rotation, as a 3x3 rotation Matrix, of this Placeable object in the given Matrix3f.

Specified by:
getRotationMatrix in interface Placeable

setPosition

public void setPosition(org.openmali.vecmath2.Tuple3f pos)
Description copied from interface: Placeable
Sets the position of this Placeable object.

Specified by:
setPosition in interface Placeable

setPosition

public void setPosition(float posX,
                        float posY,
                        float posZ)
Description copied from interface: Placeable
Sets the position of this Placeable object.

Specified by:
setPosition in interface Placeable

setRotation

public void setRotation(org.openmali.vecmath2.Tuple3f rot)
Description copied from interface: Placeable
Sets the rotation of this object, in Euler angles (degrees)

Specified by:
setRotation in interface Placeable
Parameters:
rot - The rotation, in Euler angles (degrees) of this Placeable object

setRotation

public void setRotation(float rotX,
                        float rotY,
                        float rotZ)
Description copied from interface: Placeable
Sets the rotation of this object, in Euler angles.

Specified by:
setRotation in interface Placeable
Parameters:
rotX - The x-rotation of this object
rotY - The y-rotation of this object
rotZ - The z-rotation of this object

setRotationMatrix

public void setRotationMatrix(org.openmali.vecmath2.Matrix3f rot)
Description copied from interface: Placeable
Sets the rotation Matrix of this object.

Specified by:
setRotationMatrix in interface Placeable
Parameters:
rot - The rotation, as a 3x3 rotation Matrix, of this Placeable object

getPositionX

public float getPositionX()

getPositionY

public float getPositionY()

getPositionZ

public float getPositionZ()

getRotationX

public float getRotationX()

getRotationY

public float getRotationY()

getRotationZ

public float getRotationZ()

setPositionX

public void setPositionX(float v)

setPositionY

public void setPositionY(float v)

setPositionZ

public void setPositionZ(float v)

setRotationX

public void setRotationX(float v)

setRotationY

public void setRotationY(float v)

setRotationZ

public void setRotationZ(float v)

onPositionChanged

public abstract void onPositionChanged()

onRotationChanged

public abstract void onRotationChanged()