Mapping for Asana hackathon
[SugarCubes.git] / _PandaDriver.pde
index 2d28cd693e12bea5c300d0c604dcfbe0ba07f40a..5d8ad249bbe3171446033c720c1d15f60cfda226 100644 (file)
@@ -84,10 +84,17 @@ public static class PandaDriver {
    * corner of the cube the data wire comes in.
    */
   private final static int[][] CUBE_STRIP_ORDERINGS = new int[][] {
+//    {  2,  1,  0,  3, 13, 12, 15, 14,  4,  7,  6,  5, 11, 10,  9,  8 }, // FRONT_LEFT
+//    {  6,  5,  4,  7,  1,  0,  3,  2,  8, 11, 10,  9, 15, 14, 13, 12 }, // FRONT_RIGHT
+//    { 14, 13, 12, 15,  9,  8, 11, 10,  0,  3,  2,  1,  7,  6,  5,  4 }, // REAR_LEFT
+//    { 10,  9,  8, 11,  5,  4,  7,  6, 12, 15, 14, 13,  3,  2,  1,  0 }, // REAR_RIGHT
+
+
     {  2,  1,  0,  3, 13, 12, 15, 14,  4,  7,  6,  5, 11, 10,  9,  8 }, // FRONT_LEFT
     {  6,  5,  4,  7,  1,  0,  3,  2,  8, 11, 10,  9, 15, 14, 13, 12 }, // FRONT_RIGHT
     { 14, 13, 12, 15,  9,  8, 11, 10,  0,  3,  2,  1,  7,  6,  5,  4 }, // REAR_LEFT
-    { 10,  9,  8, 11,  5,  4,  7,  6, 12, 15, 14, 13,  3,  2,  1,  0 }, // REAR_RIGHT
+    {  9,  8, 11,  5,  4,  7,  6, 10, 14,  2,  1,  0,  3, 13, 12, 15 }, // REAR_RIGHT
+
   };
   
   private final static int[][] BASS_STRIP_ORDERING = {
@@ -264,7 +271,7 @@ public static class PandaDriver {
   
   private int mapStrip(Strip s, int direction, int[] points, int pi) {
     if (direction == FORWARD) {
-      for (Point p : s.points) {
+      for (LXPoint p : s.points) {
         points[pi++] = p.index;
       }
     } else if (direction == BACKWARD) {
@@ -291,6 +298,10 @@ public static class PandaDriver {
       }
     }
   }
+  
+  public boolean isEnabled() {
+    return this.enabled;
+  }
 
   public void disable() {
     setEnabled(false);