diff options
Diffstat (limited to 'src/RaceTrack.java')
-rw-r--r-- | src/RaceTrack.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/RaceTrack.java b/src/RaceTrack.java index 630e58a..d2bcaa5 100644 --- a/src/RaceTrack.java +++ b/src/RaceTrack.java @@ -82,11 +82,11 @@ class RaceTrack extends BetterBase { /** * Returns the position of the curve at 0 <= {@code t} <= 1 and - * 1 <= laneNo <= (number of robots). + * the center of a lane at lane 1 <= laneNo <= (number of robots). */ public Vector getPointForLane(double t, double laneNo) { Vector p = getPoint(t); - Vector lanes_len = new Vector(p.x(), p.y(), 0).normalized().scale(laneNo); + Vector lanes_len = new Vector(p.x(), p.y(), 0).normalized().scale(laneNo + .5); return p.add(lanes_len); } @@ -135,7 +135,9 @@ class RaceTrack extends BetterBase { for (double i = 0; i <= SEGMENTS; ++i) { double t = i / SEGMENTS; Vector point_C = getPoint(t); - Vector point_D = getPointForLane(t, 4); + // the outer side is located on the number of lanes (4) shifted from + // the center to the side (minus 0.5). + Vector point_D = getPointForLane(t, 3.5); // Z=1 to Z=-1 Vector point_F = point_C.subtract(new Vector(0, 0, 2)); Vector point_H = point_D.subtract(new Vector(0, 0, 2)); |