summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <lekensteyn@gmail.com>2014-01-17 16:48:07 +0100
committerPeter Wu <lekensteyn@gmail.com>2014-01-17 16:48:07 +0100
commit6f03dae6b5ca8073584f76c2cced14d2cdcddc92 (patch)
tree9bba50ed95cf22e876269acf2e9d1de7f36f769b
parentfd845f0539ee309d3dac8096b9d7cc3fb8722ac8 (diff)
download2iv60-robots-6f03dae6b5ca8073584f76c2cced14d2cdcddc92.tar.gz
Implement L track correctly
-rw-r--r--src/RaceTrack.java77
1 files changed, 41 insertions, 36 deletions
diff --git a/src/RaceTrack.java b/src/RaceTrack.java
index aa02518..9d2c42b 100644
--- a/src/RaceTrack.java
+++ b/src/RaceTrack.java
@@ -89,43 +89,48 @@ class RaceTrack extends BetterBase {
new Vector( 15, -8, 1),
};
+ // the control points are grouped per 3. The last of the array and the
+ // first two form such a group for an edge. The track starts on the top
+ // edge and goes counter-clockwise. Most of the edges have been
+ // determined as follows: take a point p (the edge), a slope s. Then the
+ // vertices for this edge group are p - ax and p+ax where x is usually
+ // -3 or 3 and the slope s -1 or 1 (depending on the direction).
controlPointsLTrack = new Vector[] {
- /// FAIL
- // top-right curve to bottom
- new Vector( -4, 15, 1),
-
- new Vector( -2.5, 15, 1),
- new Vector( -1, 15, 1),
-
- new Vector( -1, 12, 1),
-
-
- new Vector( -1, -5, 1),
- new Vector( -1, -6.5, 1),
- new Vector( 0.5, -8, 1),
- new Vector( 2, -8, 1),
-
-
- new Vector( 8, -8, 1),
- new Vector( 9.5, -8, 1),
- new Vector( 11, -9.5, 1),
- new Vector( 11, -11, 1),
-
- new Vector( 11, -12.5, 1),
- new Vector( 9.5, -14, 1),
- new Vector( 8, -14, 1),
-
-
- new Vector ( -4, -14, 1),
- new Vector ( -5.5, -14, 1),
- new Vector ( -7, -12.5, 1),
- new Vector ( -7, -11, 1),
-
- new Vector ( -7, 12, 1),
- new Vector ( -7, 13.5, 1),
- new Vector ( -5.5, 15, 1),
- new Vector ( -4, 15, 1),
-
+ // (on the bottom, there is a vertex belonging to the top group)
+ // top
+ new Vector( -3, 11, 1),
+ new Vector( -6, 14, 1),
+
+ new Vector( -7, 14, 1),
+ // left
+ new Vector( -11, 11, 1),
+ new Vector( -14, 8, 1),
+
+ new Vector( -14, -8, 1),
+ // bottom
+ new Vector( -11, -11, 1),
+ new Vector( -7, -14, 1),
+
+ new Vector( 8, -14, 1),
+ // right of L foot (bottom)
+ new Vector( 11, -11, 1),
+ //new Vector( 14, -8, 1),
+ new Vector( 13, -9, 1), // more weight downwards
+
+ //new Vector( 14, -8, 1),
+ new Vector( 13, -7, 1), // more weight upwards
+ // top of L foot
+ new Vector( 11, -5, 1),
+ //new Vector( 8, -2, 1),
+ new Vector( 9, -3, 1), // more weight downwards
+
+ new Vector( 0, -10, 1),
+ // right (top)
+ new Vector( -3, -7, 1),
+ new Vector( -6, -4, 1),
+
+ new Vector( 0, 8, 1),
+ // ^-- belongs to top edge
};
controlPointsCTrack = new Vector[] {