net.java.dev.joode.force
Class NewtonGravity

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.NewtonGravity
All Implemented Interfaces:
java.io.Serializable, Gravity, SimState

public class NewtonGravity
extends Force
implements Gravity

Applies a constant force in a constant direction to all bodies with their dxBodyGravity bit set

Author:
Harald Dietrich
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.java.dev.joode.WorldObject
data, tag, world
 
Constructor Summary
NewtonGravity(World world, Vector3 gravity)
           
 
Method Summary
 void applyForce(Body body)
          applies the force to a body that is in simulation, called by the stepper functions
 NewtonGravity 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
 

Constructor Detail

NewtonGravity

public NewtonGravity(World world,
                     Vector3 gravity)
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 NewtonGravity 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