|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aim4.vehicle.BasicVehicle.PhysicalMovement
public static class BasicVehicle.PhysicalMovement
The physical movement.
Field Summary | |
---|---|
protected VehicleSpec |
spec
The specification of the vehicle |
Constructor Summary | |
---|---|
BasicVehicle.PhysicalMovement(BasicVehicle.NonAccelMovement nonAccelMovement,
double acceleration)
Create the physical movement. |
Method Summary | |
---|---|
void |
coast()
Maintain the speed of the vehicle. |
double |
getAcceleration()
Get the acceleration of the vehicle |
double |
getHeading()
Get the heading of the vehicle |
BasicVehicle.NonAccelMovement |
getNonAccelMovement()
Get the non acceleration movement. |
Point2D |
getPosition()
Get the position of the vehicle. |
double |
getVelocity()
Get the velocity of the vehicle |
void |
move(double currentTime,
double timeStep)
Move the vehicle for a given period of time. |
protected void |
moveWithoutAcceleration(double currentTime,
double timeStep)
Move the vehicle while holding all vehicle properties, including the acceleration, constant. |
void |
setAccelerationWithBound(double acceleration)
Set the acceleration with respect to the physical limit of the vehicle. |
protected void |
setVelocityWithBound(double velocity)
Set the velocity with respect to the physical limit of the vehicle. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final VehicleSpec spec
Constructor Detail |
---|
public BasicVehicle.PhysicalMovement(BasicVehicle.NonAccelMovement nonAccelMovement, double acceleration)
nonAccelMovement
- the non-acceleration movementacceleration
- the accelerationMethod Detail |
---|
public Point2D getPosition()
getPosition
in interface BasicVehicle.Movement
public double getHeading()
getHeading
in interface BasicVehicle.Movement
public double getVelocity()
getVelocity
in interface BasicVehicle.Movement
public double getAcceleration()
getAcceleration
in interface BasicVehicle.MovementWithAccel
public BasicVehicle.NonAccelMovement getNonAccelMovement()
public void setAccelerationWithBound(double acceleration)
setAccelerationWithBound
in interface BasicVehicle.MovementWithAccel
acceleration
- the accelerationpublic void coast()
public void move(double currentTime, double timeStep)
move
in interface BasicVehicle.Movement
currentTime
- the current timetimeStep
- the period of time for which the vehicle moves.protected void moveWithoutAcceleration(double currentTime, double timeStep)
currentTime
- the current timetimeStep
- the length of time for which to move the Vehicleprotected void setVelocityWithBound(double velocity)
velocity
- the velocitypublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |