|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jbotrace.base.Car
Description: This class represents the standard racecode-car. It contains all functions to set the state of the car and to calculate it's movement.
Field Summary | |
static double |
BASEMASS
The weight of the car without fuel |
static double |
DELTAT
|
static double |
MAXSTEERINGANGLE
The maximum angle, that the frontwheels can be turned to either side. |
static double |
MAXSTEERINGCHANGE
The maximum amount that the steeringangle can change in one timestep |
Constructor Summary | |
Car()
Constructs a new car with all values set to zero. |
Method Summary | |
void |
changeSteering(double wantedSteering)
Changes the angle of the frontwheels. |
double |
getAcceleration()
Returns the currently set acceleration. |
double |
getAngle()
Returns the orientation of the car |
int |
getBestLapTime()
Returns bestLapTime: The time of the best lap the car drove |
int |
getCurrentLap()
Returns the current lap |
Driver |
getDriver()
Return the driver of the car |
int |
getLastLapTime()
Returns the time of the last lap |
double |
getMass()
Returns the current mass of the car |
Vec |
getPosition()
Returns the Vec of the current position of the car. |
double |
getSteeringAngle()
Returns the angle between front wheels and car direction. |
int |
getTimeTo(Car car)
Returns the time distance in ms to the given Car |
double |
getVelocity()
Returns the speed of the car in its last move. |
double |
getWeight()
Returns the current weight of the car |
double |
getWeightOnWheel(int wheel)
Returns the weight on the given wheel during the last calculation step |
double |
getWheelAngle(int wheel)
Returns the "absolute" angle of a specified wheel. |
Vec |
getWheelPosition(int wheel)
Returns the absolute position of a specified wheel |
boolean |
isAhead(Car car)
Returns true, if the car is ahead the other car. |
void |
move()
This method moves the car for one timestep. |
void |
setBrake(double brake)
Sets the brake as factor |
void |
setDriver(Driver driver)
Sets the driver that is asked for instructions. |
void |
setPosition(Vec position)
Sets the position of the car |
void |
setRace(Race race)
Sets the race in which the car drives. |
void |
setSteeringAngle(double steeringAngle)
Sets the angle between the direction of the car and the front wheels. |
void |
setThrottle(double throttle)
Sets the throttle as factor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final double DELTAT
public static final double BASEMASS
public static final double MAXSTEERINGANGLE
public static final double MAXSTEERINGCHANGE
Constructor Detail |
public Car()
Method Detail |
public void changeSteering(double wantedSteering)
public double getAcceleration()
public double getAngle()
public int getBestLapTime()
public int getCurrentLap()
public Driver getDriver()
public int getTimeTo(Car car)
public int getLastLapTime()
public double getMass()
public Vec getPosition()
public double getSteeringAngle()
public double getVelocity()
public double getWeight()
public double getWeightOnWheel(int wheel)
public double getWheelAngle(int wheel)
public Vec getWheelPosition(int wheel)
public boolean isAhead(Car car)
public void move()
public void setBrake(double brake)
public void setDriver(Driver driver)
public void setPosition(Vec position)
public void setRace(Race race)
public void setSteeringAngle(double steeringAngle)
public void setThrottle(double throttle)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |