Use helpers from new GLucose for points per cube
[SugarCubes.git] / _Internals.pde
index 7dcf1757e8e9b138969df17d62dfe44fe5e5123f..d51463c7c070373c6167decca7d2fa6bc927a1d6 100644 (file)
@@ -95,10 +95,9 @@ void setup() {
   // Build output driver
   int[][] frontChannels = glucose.mapping.buildFrontChannelList();
   int[][] rearChannels = glucose.mapping.buildRearChannelList();
-  int[][] flippedRGB = glucose.mapping.buildFlippedRGBList();
   mappingTool = new MappingTool(glucose, frontChannels, rearChannels);
-  pandaFront = new PandaDriver(new NetAddress("192.168.1.28", 9001), glucose.model, frontChannels, flippedRGB);
-  pandaRear = new PandaDriver(new NetAddress("192.168.1.29", 9001), glucose.model, rearChannels, flippedRGB);
+  pandaFront = new PandaDriver(new NetAddress("10.200.1.28", 9001), glucose.model, frontChannels);
+  pandaRear = new PandaDriver(new NetAddress("10.200.1.29", 9001), glucose.model, rearChannels);
   logTime("Build PandaDriver");
   
   // Build overlay UI
@@ -214,13 +213,14 @@ void draw() {
   
   // TODO(mcslee): move into GLucose engine
   if (pandaBoardsEnabled) {
-    pandaFront.send(colors);
+    // pandaFront.send(colors);
     pandaRear.send(colors);
   }
 }
 
 void drawCube(Cube c) {
-  drawBox(c.x, c.y, c.z, c.rx, c.ry, c.rz, Cube.EDGE_WIDTH, Cube.EDGE_HEIGHT, Cube.EDGE_WIDTH, Cube.CHANNEL_WIDTH);
+  float in = .15;
+  drawBox(c.x+in, c.y+in, c.z+in, c.rx, c.ry, c.rz, Cube.EDGE_WIDTH-in*2, Cube.EDGE_HEIGHT-in*2, Cube.EDGE_WIDTH-in*2, Cube.CHANNEL_WIDTH-in);
 }
 
 void drawBox(float x, float y, float z, float rx, float ry, float rz, float xd, float yd, float zd, float sw) {
@@ -348,8 +348,12 @@ void mouseReleased() {
 }
  
 void mouseWheel(int delta) {
-  eyeR = constrain(eyeR - delta, -500, -80);
-  eyeX = midX + eyeR*sin(eyeA);
-  eyeZ = midZ + eyeR*cos(eyeA);
+  if (mouseX > ui.leftPos) {
+    ui.mouseWheel(delta);
+  } else {
+    eyeR = constrain(eyeR - delta, -500, -80);
+    eyeX = midX + eyeR*sin(eyeA);
+    eyeZ = midZ + eyeR*cos(eyeA);
+  }
 }