net.jinx.physics.gravity
Class Gravity

java.lang.Object
  extended by net.jinx.action.Actor
      extended by net.jinx.physics.gravity.Gravity
All Implemented Interfaces:
Force

public class Gravity
extends Actor
implements Force


Field Summary
static float GCU
          The gravitational constant of the universe.
 
Constructor Summary
Gravity()
           
 
Method Summary
 void added(PhysicalObject obj)
          Called by Universe to notify this Force that a PhysicalObject has been added to the simulation.
 void applyForce(PhysicalObject o1)
          Provides the force acting on object due to this Force.
protected static Vector getForce(PhysicalObject o1, PhysicalObject o2)
           
static Vector getObjectCOG(PhysicalObject obj)
          Provides the center of gravity of object in object coordinates.
static Vector getWorldCOG(PhysicalObject obj)
           
 boolean isBigMass(PhysicalObject obj)
          Determines if obj is a gravitationally significant mass.
protected  void processEvent(ActorEvent event)
          Does nothing.
 void removed(PhysicalObject obj)
          Called by Universe to notify this Force that a PhysicalObject has been removed from the simulation.
 
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
 

Field Detail

GCU

public static final float GCU
The gravitational constant of the universe.

See Also:
Constant Field Values
Constructor Detail

Gravity

public Gravity()
Method Detail

getObjectCOG

public static Vector getObjectCOG(PhysicalObject obj)
Provides the center of gravity of object in object coordinates.

Parameters:
obj - the PhysicalObject.
Returns:
the center of gravity of object in object coordinates.

getWorldCOG

public static Vector getWorldCOG(PhysicalObject obj)

isBigMass

public boolean isBigMass(PhysicalObject obj)
Determines if obj is a gravitationally significant mass.

Parameters:
obj - the PhysicalObject.
Returns:
true if it's been tagged with a BigMassTag.

added

public void added(PhysicalObject obj)
Description copied from interface: Force
Called by Universe to notify this Force that a PhysicalObject has been added to the simulation.

Specified by:
added in interface Force
Parameters:
obj - the PhysicalObject that was added.

removed

public void removed(PhysicalObject obj)
Description copied from interface: Force
Called by Universe to notify this Force that a PhysicalObject has been removed from the simulation.

Specified by:
removed in interface Force
Parameters:
obj - the PhysicalObject that was removed.

applyForce

public void applyForce(PhysicalObject o1)
Description copied from interface: Force
Provides the force acting on object due to this Force.

Specified by:
applyForce in interface Force
Parameters:
o1 - the PhysicalObject.

getForce

protected static Vector getForce(PhysicalObject o1,
                                 PhysicalObject o2)

processEvent

protected void processEvent(ActorEvent event)
Does nothing. Required for extending Actor.

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