org.xith3d.physics.util
Class PlaceableImpl

java.lang.Object
  extended by org.xith3d.physics.util.PlaceableImpl
All Implemented Interfaces:
ListeningPlaceable, Placeable
Direct Known Subclasses:
Body

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

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.


Field Summary
protected  org.openmali.vecmath2.Point3f position
           
protected  org.openmali.vecmath2.Matrix3f rotation
           
protected  boolean valueCheckedBeforeChanged
           
 
Constructor Summary
PlaceableImpl()
          Creation a new PlaceableImpl with pos (0, 0, 0) and no rotation.
 
Method Summary
 void addRepositionListener(org.jagatoo.datatypes.RepositionListener3f l)
          
 org.openmali.vecmath2.Point3f 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()
           
protected  void onPositionChanged()
           
protected  void onRotationChanged()
           
 void removeRepositionListener(org.jagatoo.datatypes.RepositionListener3f l)
          
 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

valueCheckedBeforeChanged

protected boolean valueCheckedBeforeChanged

position

protected final org.openmali.vecmath2.Point3f position

rotation

protected final org.openmali.vecmath2.Matrix3f rotation
Constructor Detail

PlaceableImpl

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

Method Detail

addRepositionListener

public void addRepositionListener(org.jagatoo.datatypes.RepositionListener3f l)

Specified by:
addRepositionListener in interface ListeningPlaceable

removeRepositionListener

public void removeRepositionListener(org.jagatoo.datatypes.RepositionListener3f l)

Specified by:
removeRepositionListener in interface ListeningPlaceable

onPositionChanged

protected void onPositionChanged()

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

setPosition

public final 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

getPosition

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

getPosition

public final 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

onRotationChanged

protected void onRotationChanged()

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

setRotation

public final 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

getRotation

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

getRotation

public final 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

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

getRotationMatrix

public final 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 final 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

setPositionX

public final void setPositionX(float v)

setPositionY

public final void setPositionY(float v)

setPositionZ

public final void setPositionZ(float v)

getPositionX

public final float getPositionX()

getPositionY

public final float getPositionY()

getPositionZ

public final float getPositionZ()

setRotationX

public final void setRotationX(float v)

setRotationY

public final void setRotationY(float v)

setRotationZ

public final void setRotationZ(float v)

getRotationX

public final float getRotationX()

getRotationY

public final float getRotationY()

getRotationZ

public final float getRotationZ()