net.java.dev.joode.force
Class UniversalGravity

java.lang.Object
  extended by net.java.dev.joode.WorldObject
      extended by net.java.dev.joode.force.Force
          extended by net.java.dev.joode.force.UniversalGravity
All Implemented Interfaces:
java.io.Serializable, Gravity, SimState

public class UniversalGravity
extends Force
implements Gravity

Attract all bodies in simulation with the dxBodyGravity bit set toward a single body

Author:
Harald Dietrich
See Also:
Serialized Form

Field Summary
static float GRAVITATIONAL_CONSTANT
           
 
Fields inherited from class net.java.dev.joode.WorldObject
data, tag, world
 
Constructor Summary
UniversalGravity(World world, Body body)
           
 
Method Summary
 void applyForce(Body body)
          applies the force to a body that is in simulation, called by the stepper functions
 UniversalGravity cloneState(ClonedReferences util)
           deep clones the state object, any references to other SimState objects should be cloned and assigned to the clone via the ClonedReferences util object.
 
Methods inherited from class net.java.dev.joode.force.Force
destroy
 
Methods inherited from class net.java.dev.joode.WorldObject
partialCloneWorldObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRAVITATIONAL_CONSTANT

public static final float GRAVITATIONAL_CONSTANT
See Also:
Constant Field Values
Constructor Detail

UniversalGravity

public UniversalGravity(World world,
                        Body body)
Parameters:
world -
body - the body all other bodies are attracted toward
Method Detail

applyForce

public void applyForce(Body body)
Description copied from class: Force
applies the force to a body that is in simulation, called by the stepper functions

Specified by:
applyForce in class Force

cloneState

public UniversalGravity cloneState(ClonedReferences util)
Description copied from interface: SimState

deep clones the state object, any references to other SimState objects should be cloned and assigned to the clone via the ClonedReferences util object. The util object ensures that multiple clones of the same object are not performed during a clone operation.

Specified by:
cloneState in interface SimState
Parameters:
util - instanciate a new one if top level cloning