|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jbotrace.base.Track
Description: Track contains the information about a track and it's parts.
Constructor Summary | |
Track()
Build a new track with empty lists for cars and parts |
Method Summary | |
void |
addSegment(Segment segment)
Adds a part to the track |
Vec[] |
getBoundingBox()
Returns a box bounding the whole track |
double |
getDistanceFromStart(int segmentNum,
Vec pos)
Returns the distance of the given point from the start line. |
Line |
getFinishLine()
Returns the finish line |
double |
getHeight()
Returns the height of the track calculate from boundingBox |
double |
getLength()
Returns the length of the track |
double |
getLength(int firstSegment,
int lastSegment)
Returns the length of the given range of segments |
Segment |
getSegment(int num)
Returns the segment specified by the number |
java.util.List |
getSegmentList()
Returns the list of segments |
Segment |
getSegmentNextTo(Vec pos)
Returns the segment next to the given position |
int |
getSegmentNumNextTo(Vec position)
Returns the number of the nearest segment to the given position |
double |
getWidth()
Returns the width of the track calculate from boundingBox |
boolean |
isOnSegment(Vec pos,
int segmentNum)
Returns true if the given position is on the specified segment |
boolean |
isOnTrack(Vec pos)
Returns true if the given position is on a part of the track and false otherwise. |
void |
moveToOrigin()
Moves the track to let the boundingBox begin in 0, 0 |
void |
setFinishFraction(double finishFraction)
Sets the fraction of 1st segment to finish line |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Track()
Method Detail |
public void addSegment(Segment segment)
public Vec[] getBoundingBox()
public double getDistanceFromStart(int segmentNum, Vec pos)
public double getLength()
public double getLength(int firstSegment, int lastSegment)
public Segment getSegmentNextTo(Vec pos)
public int getSegmentNumNextTo(Vec position)
public Segment getSegment(int num)
public java.util.List getSegmentList()
public boolean isOnSegment(Vec pos, int segmentNum)
public boolean isOnTrack(Vec pos)
public Line getFinishLine()
public double getHeight()
public double getWidth()
public void moveToOrigin()
public void setFinishFraction(double finishFraction)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |