sim.physics2D.forceGenerator
Class ForceEngine

java.lang.Object
  extended by sim.physics2D.forceGenerator.ForceEngine

public class ForceEngine
extends java.lang.Object

The ForceEngine manages the application of forces and torques to objects.


Method Summary
 void addForceField(Double2D forceField)
          Adds a force that is applied to every object at every timestep.
 void addForces()
          Causes all force generators that are registered with the dynamics engine to add their forces to the appropriate objects
 void clearForceField()
          Clear all force fields
static ForceEngine getInstance()
           
 void registerForceGenerator(ForceGenerator forceGenerator)
          Registers a force generator with the force engine.
 void registerMobileObject(MobileObject2D objMO)
          Registers a mobile object with the force generator.
static ForceEngine reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ForceEngine getInstance()

reset

public static ForceEngine reset()

registerForceGenerator

public void registerForceGenerator(ForceGenerator forceGenerator)
Registers a force generator with the force engine.


registerMobileObject

public void registerMobileObject(MobileObject2D objMO)
Registers a mobile object with the force generator. All mobile objects to whom force fields or friction should be applied need to be registered with the force engine.


addForceField

public void addForceField(Double2D forceField)
Adds a force that is applied to every object at every timestep. An example of a force field is gravity.


clearForceField

public void clearForceField()
Clear all force fields


addForces

public void addForces()
Causes all force generators that are registered with the dynamics engine to add their forces to the appropriate objects