public abstract static class BasicVehicle.NonAccelMovement extends Object implements BasicVehicle.Movement
| Modifier and Type | Field and Description |
|---|---|
protected double |
heading
The direction of the vehicle
|
protected Point2D |
position
The position of the vehicle, represented by the point at
the center of the front of the Vehicle.
|
protected VehicleSpec |
spec
The specification of the vehicle
|
protected double |
velocity
The velocity of the vehicle
|
| Constructor and Description |
|---|
BasicVehicle.NonAccelMovement(VehicleSpec spec,
Point2D position,
double heading,
double velocity)
Create a non-acceleration movement.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getHeading()
Get the heading of the vehicle
|
Point2D |
getPosition()
Get the position of the vehicle.
|
VehicleSpec |
getVehicleSpec()
Get the vehicle specification.
|
double |
getVelocity()
Get the velocity of the vehicle
|
protected void |
setVelocityWithBound(double velocity)
Set the velocity with respect to the physical limit of the vehicle.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitmoveprotected final VehicleSpec spec
protected Point2D position
protected double heading
protected double velocity
public BasicVehicle.NonAccelMovement(VehicleSpec spec, Point2D position, double heading, double velocity)
spec - the specification of the vehicleposition - the positionheading - the headingvelocity - the velocitypublic final VehicleSpec getVehicleSpec()
public Point2D getPosition()
getPosition in interface BasicVehicle.Movementpublic double getHeading()
getHeading in interface BasicVehicle.Movementpublic double getVelocity()
getVelocity in interface BasicVehicle.Movementprotected void setVelocityWithBound(double velocity)
velocity - the velocityCopyright © 2013. All rights reserved.