Interface Track
public interface Track
Interface for a track.
- Author:
- JayPi4c
-
Method Summary
Modifier and TypeMethodDescriptionvoid(Re-)builds the track.
Afterwards the track is ready to be used and the attribute getters can be called.Returns a list of boundries describing the checkpoints on the track.getStart()Returns a PVector containing the position on which the vehicles should start on the given track.Returns a PVector which points into the direction the vehicles should drive.Returns the name identifying the track.getWalls()Returns a list of boundries describing the walls of the track.
-
Method Details
-
buildTrack
void buildTrack()(Re-)builds the track.
Afterwards the track is ready to be used and the attribute getters can be called.
The track will be normalized in a square, which means, that the coordinates of the track will always be between 0 and 1.
This method must be called before any other function call in this class. -
getStart
PVector getStart()Returns a PVector containing the position on which the vehicles should start on the given track.- Returns:
- PVector containing the tracks start position
- See Also:
-
getCheckpoints
Returns a list of boundries describing the checkpoints on the track. The checkpoints are ordered and have to be reached after another.- Returns:
- a ordered list of all checkpoints for the generated track.
- See Also:
-
getWalls
Returns a list of boundries describing the walls of the track. The bounries may not be connected in any way. All boundries together form the track, meaning that the elements do build the inner and outer track limits. If the vehicle collides with any of these elements, it might be considered crashed.- Returns:
- a list of all boundries describing the track
- See Also:
-
getStartVelocity
PVector getStartVelocity()Returns a PVector which points into the direction the vehicles should drive. This normally is the direction orthogonally to the start/finish line pointing to the first checkpoint.
The returned vector must be normalized.- Returns:
- starting direction on the given startpoint.
- See Also:
-
getTrackName
String getTrackName()Returns the name identifying the track.- Returns:
- identifing name of the track
-