net.jinx.physics
Class Universe

java.lang.Object
  extended by net.jinx.action.Actor
      extended by net.jinx.physics.Universe
All Implemented Interfaces:
ClockSensitive, OwnerListener, SceneListener

public class Universe
extends Actor
implements OwnerListener, ClockSensitive


Constructor Summary
Universe(Integrator integrator)
           
Universe(Integrator integrator, Universe parent)
           
 
Method Summary
 void actorAdded(Actor actor, Scene scene)
          Called when an Actor has been added to the Scene.
 void actorRemoved(Actor actor, Scene scene)
          Called when an Actor has been removed from the Scene.
 void addCollisionDetector(CollisionDetector cd)
           
 void addForce(Force f)
           
 void addObject(PhysicalObject obj)
           
 Vector getForce(PhysicalObject obj)
           
 Integrator getIntegrator()
           
 Universe getParent()
          Provides the Universe that is the parent of this Universe.
protected  void processEvent(ActorEvent event)
          Processes an ActorEvent.
 void removeCollisionDetector(CollisionDetector cd)
           
 void removeForce(Force f)
           
 void removeObject(PhysicalObject obj)
           
 void setParent(Universe parent)
          Sets the parent of this Universe.
 void step(float deltaTime)
           
 
Methods inherited from class net.jinx.action.Actor
checkAllowAdd, getName, getOwner, hashCode, ownerChanged, sendEvent, sendEvent, sendEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Universe

public Universe(Integrator integrator,
                Universe parent)

Universe

public Universe(Integrator integrator)
Method Detail

getParent

public Universe getParent()
Provides the Universe that is the parent of this Universe.

Returns:
the Universe. This will be null if this Universe has no parent.

setParent

public void setParent(Universe parent)
Sets the parent of this Universe.

Parameters:
parent - the Universe to set as parent to this on. Null indicates there will be no parent.
Throws:
java.lang.IllegalArgumentException - if you pass a Universe to itself with this method.

getIntegrator

public Integrator getIntegrator()

processEvent

protected void processEvent(ActorEvent event)
Description copied from class: Actor
Processes an ActorEvent. This is what most Actor objects exist for.

Specified by:
processEvent in class Actor
Parameters:
event - the ActorEvent to process.

actorAdded

public void actorAdded(Actor actor,
                       Scene scene)
Description copied from interface: SceneListener
Called when an Actor has been added to the Scene. It is also called once for each actor when the Listener is added to the Scene.

Specified by:
actorAdded in interface SceneListener
Parameters:
actor - the Actor that has been added.
scene - the Scene that this event came from.

addCollisionDetector

public void addCollisionDetector(CollisionDetector cd)

addObject

public void addObject(PhysicalObject obj)

addForce

public void addForce(Force f)

actorRemoved

public void actorRemoved(Actor actor,
                         Scene scene)
Description copied from interface: SceneListener
Called when an Actor has been removed from the Scene. It is also called once for each actor when the Listener is removed from the Scene.

Specified by:
actorRemoved in interface SceneListener
Parameters:
actor - the Actor that has been removed.
scene - the Scene that this event came from.

removeCollisionDetector

public void removeCollisionDetector(CollisionDetector cd)

removeObject

public void removeObject(PhysicalObject obj)

removeForce

public void removeForce(Force f)

getForce

public Vector getForce(PhysicalObject obj)

step

public void step(float deltaTime)