game.physics
Class MovingBody

java.lang.Object
  extended bygame.physics.Body
      extended bygame.physics.MovingBody
Direct Known Subclasses:
Projectile, Unit

public abstract class MovingBody
extends Body


Constructor Summary
MovingBody(int playerID, double radius, double mass, double maxSpeed, double acceleration, double maxAngularVelocity, double angularAcceleration)
           
 
Method Summary
 void applyForce(double fx, double fy)
           
 void collide(Body body)
           
 double getDensityEffect(double density)
           
 double getMaxAngularVelocity()
           
 double getMaxSpeed()
           
 double getVelocity()
           
 boolean integrate(double timestep, double density)
           
 boolean integrate(double timestep, Map map)
           
 Vector2D predictPosition(double velocity, double timestep)
           
 double predictVelocity(double timestep, double density)
           
 void reportMotionStatus(java.io.PrintStream out)
           
 void setTargetHeading(double targetHeading)
           
 void setTargetVelocity(double targetVelocity)
           
 void setVelocity(double newvelocity)
           
 
Methods inherited from class game.physics.Body
findBearing, findHeading, findHeading, getBounds, getColor, getHeading, getPlayer, getPlayerID, getPosition, init, init, isColliding, isDead, normalize, setHeading, setPosition, setPosition
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MovingBody

public MovingBody(int playerID,
                  double radius,
                  double mass,
                  double maxSpeed,
                  double acceleration,
                  double maxAngularVelocity,
                  double angularAcceleration)
Method Detail

collide

public void collide(Body body)
Specified by:
collide in class Body
See Also:
Body.collide(game.physics.Body)

getMaxSpeed

public double getMaxSpeed()

getMaxAngularVelocity

public double getMaxAngularVelocity()

getVelocity

public double getVelocity()

setVelocity

public void setVelocity(double newvelocity)

setTargetVelocity

public void setTargetVelocity(double targetVelocity)

setTargetHeading

public void setTargetHeading(double targetHeading)

applyForce

public final void applyForce(double fx,
                             double fy)

integrate

public boolean integrate(double timestep,
                         Map map)

integrate

public boolean integrate(double timestep,
                         double density)

getDensityEffect

public double getDensityEffect(double density)

predictPosition

public Vector2D predictPosition(double velocity,
                                double timestep)

predictVelocity

public double predictVelocity(double timestep,
                              double density)

reportMotionStatus

public void reportMotionStatus(java.io.PrintStream out)