net.java.dev.joode.force
Class UniversalGravity
java.lang.Object
net.java.dev.joode.WorldObject
net.java.dev.joode.force.Force
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
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GRAVITATIONAL_CONSTANT
public static final float GRAVITATIONAL_CONSTANT
- See Also:
- Constant Field Values
UniversalGravity
public UniversalGravity(World world,
Body body)
- Parameters:
world - body - the body all other bodies are attracted toward
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