|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--jbotrace.base.Segment
|
+--jbotrace.base.Straight
Description: Represent a straight in the track.
| Field Summary |
| Fields inherited from class jbotrace.base.Segment |
CURVE, STRAIGHT |
| Constructor Summary | |
Straight(Line line,
double startWidth,
double endWidth)
Creates a new straight with the given points: 0 and 1 build the first line, 2 and 3 the second. |
|
| Method Summary | |
Vec[] |
getBoundingBox()
Returns the upper left and lower right corners of a bow bounding the segment |
Vec[] |
getCorners()
Returns the four edges of the quad. |
double |
getDirection()
Returns the direction of the straight |
double |
getDistanceToEnd(Vec pos)
Returns the distance to the end of the straight from the given position |
double |
getDistanceToLeft(Vec pos)
Returns the distance to the left side of the straight at the given position |
double |
getDistanceToMiddle(Vec pos)
Returns the distance to the middle of the track |
double |
getDistanceToRight(Vec pos)
Returns the distance to the right side of the straight at the given position |
double |
getDistanceToSide(Vec pos)
Returns the distance of the given point to the side of the track or the maximum value for double, if the point is not beside the straight |
double |
getEndWidth()
Returns the width at the end of the track part. |
double |
getLength()
Returns the length of the straight |
Vec |
getMiddle()
Returns the middle of the part |
Vec[] |
getPoints()
Returns the array of points that build the straight |
double |
getRadius()
This it a straight, we return 0. |
double |
getStartWidth()
Returns the width at the start of the track part |
int |
getType()
Returns the type number of the segment. |
Vec |
getVector()
Returns a vector in the direction and with the lenght of the straight. |
double |
getWidth(Vec pos)
Return the width of the curve at the given position |
boolean |
isOnSegment(Vec pos)
Returns true if the given position is on the part and false otherwise. |
void |
move(Vec moveVec)
Moves the segment |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Straight(Line line,
double startWidth,
double endWidth)
| Method Detail |
public boolean isOnSegment(Vec pos)
isOnSegment in class Segmentpublic Vec[] getBoundingBox()
getBoundingBox in class Segmentpublic Vec[] getCorners()
public double getDirection()
public double getDistanceToEnd(Vec pos)
getDistanceToEnd in class Segmentpublic double getDistanceToLeft(Vec pos)
getDistanceToLeft in class Segmentpublic double getDistanceToMiddle(Vec pos)
getDistanceToMiddle in class Segmentpublic double getDistanceToRight(Vec pos)
getDistanceToRight in class Segmentpublic double getDistanceToSide(Vec pos)
getDistanceToSide in class Segmentpublic double getEndWidth()
getEndWidth in class Segmentpublic double getLength()
getLength in class Segmentpublic Vec getMiddle()
getMiddle in class Segmentpublic double getRadius()
getRadius in class Segmentpublic int getType()
getType in class Segmentpublic Vec[] getPoints()
public double getStartWidth()
getStartWidth in class Segmentpublic Vec getVector()
public double getWidth(Vec pos)
public void move(Vec moveVec)
move in class Segment
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||