org.odejava.display
Class BoundDisplayObject

java.lang.Object
  extended by org.odejava.display.BoundDisplayObject

public class BoundDisplayObject
extends Object

Represents an abstract Display Object that is bound to an Ode Body or Geom (the OdeTransformable).

Author:
William Denniss

Field Summary
protected  DisplayTransformable displayObject
          The abstract display object.
protected  Placeable odeObject
          The abstract ODE object.
 
Constructor Summary
BoundDisplayObject(DisplayTransformable displayObject, Placeable odeObject)
          Creates a new binding of a transform-capable Display object and a transform-capable Ode object.
 
Method Summary
 void forceUpdate()
          Forces an update of the display object's position next time update() is called
 DisplayTransformable getDisplayTransformable()
          Returns the bound DisplayTransformable
 Placeable getOdeTransformable()
          Returns the bound OdeTransformable
 void setDisplayTransformable(DisplayTransformable displayObject)
          Changes the display object that is kept in sync with the ODE Placeable.
 void setOdeTransformable(Placeable odeObject)
          Changes the Placeable which the display object keeps in sync with.
 void update()
          Updates the transform of the Display Object, synching it to that of the ODE object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

displayObject

protected DisplayTransformable displayObject
The abstract display object.


odeObject

protected Placeable odeObject
The abstract ODE object.

Constructor Detail

BoundDisplayObject

public BoundDisplayObject(DisplayTransformable displayObject,
                          Placeable odeObject)
Creates a new binding of a transform-capable Display object and a transform-capable Ode object. The typical use is for the Ode object to be updated by the ODE engine and for the Display object to be synched to that (using BoundDisplayObjectS).

Method Detail

update

public void update()
Updates the transform of the Display Object, synching it to that of the ODE object.


getDisplayTransformable

public DisplayTransformable getDisplayTransformable()
Returns the bound DisplayTransformable

Returns:
the bound DisplayTransformable

setDisplayTransformable

public void setDisplayTransformable(DisplayTransformable displayObject)
Changes the display object that is kept in sync with the ODE Placeable. Note: This does NOT alter the 3d scene in any way. The given DisplayTransformable should already be visible in the scene if this is desired.

Parameters:
displayObject - The displayObject to set.

getOdeTransformable

public Placeable getOdeTransformable()
Returns the bound OdeTransformable

Returns:
the bound OdeTransformable

setOdeTransformable

public void setOdeTransformable(Placeable odeObject)
Changes the Placeable which the display object keeps in sync with.

Parameters:
odeObject - The new Placeable object to use.

forceUpdate

public void forceUpdate()
Forces an update of the display object's position next time update() is called