Make yMin correct with unlit bassBox on model
authorMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Fri, 27 Sep 2013 00:31:48 +0000 (17:31 -0700)
committerMark Slee <mcslee@Mark-Slees-MacBook-Pro.local>
Fri, 27 Sep 2013 00:32:13 +0000 (17:32 -0700)
_Internals.pde
_Mappings.pde
code/GLucose.jar

index 091bde491d0a25866002efdbc394c44a8566eba5..c86ff963f2bb1cabb94810a89ab19e9ec49a504e 100644 (file)
@@ -217,10 +217,12 @@ void draw() {
   popMatrix();
   
   noStroke();
-//  drawBassBox(glucose.model.bassBox);
-//  for (Speaker s : glucose.model.speakers) {
-//    drawSpeaker(s);
-//  }
+  if (glucose.model.bassBox.exists) {
+    drawBassBox(glucose.model.bassBox, false);
+  }
+  for (Speaker speaker : glucose.model.speakers) {
+    drawSpeaker(speaker);
+  }
   for (Cube c : glucose.model.cubes) {
     drawCube(c);
   }
@@ -228,13 +230,9 @@ void draw() {
   noFill();
   strokeWeight(2);
   beginShape(POINTS);
-  // TODO(mcslee): restore when bassBox/speakers are right again
-  // for (Point p : glucose.model.points) {
-  for (Cube cube : glucose.model.cubes) {
-    for (Point p : cube.points) {
-      stroke(colors[p.index]);
-      vertex(p.fx, p.fy, p.fz);
-    }
+  for (Point p : glucose.model.points) {
+    stroke(colors[p.index]);
+    vertex(p.fx, p.fy, p.fz);
   }
   endShape();
   
@@ -264,15 +262,18 @@ void draw() {
   }
 }
 
-void drawBassBox(BassBox b) {
+void drawBassBox(BassBox b, boolean hasSub) {
+  
   float in = .15;
-
-  noStroke();
-  fill(#191919);
-  pushMatrix();
-  translate(b.x + BassBox.EDGE_WIDTH/2., b.y + BassBox.EDGE_HEIGHT/2, b.z + BassBox.EDGE_DEPTH/2.);
-  box(BassBox.EDGE_WIDTH-20*in, BassBox.EDGE_HEIGHT-20*in, BassBox.EDGE_DEPTH-20*in);
-  popMatrix();
+  
+  if (hasSub) {
+    noStroke();
+    fill(#191919);
+    pushMatrix();
+    translate(b.x + BassBox.EDGE_WIDTH/2., b.y + BassBox.EDGE_HEIGHT/2, b.z + BassBox.EDGE_DEPTH/2.);
+    box(BassBox.EDGE_WIDTH-20*in, BassBox.EDGE_HEIGHT-20*in, BassBox.EDGE_DEPTH-20*in);
+    popMatrix();
+  }
 
   noStroke();
   fill(#393939);
index 2c28b450d6a3fae1b28485f93afaa46e82cb1810..5daf703331ffcfd86212e0c917772d219698b303 100644 (file)
@@ -255,7 +255,9 @@ public Model buildModel() {
   };
 
   // The bass box!
-  BassBox bassBox = new BassBox(BBX, 0, BBZ);
+  BassBox bassBox = BassBox.unlitBassBox(BBX, 0, BBZ); // frame exists, no lights
+  // BassBox bassBox = BassBox.noBassBox(); // no bass box at all
+  // BassBox bassBox = new BassBox(BBX, 0, BBZ); // bass box with lights
  
   // The speakers!
   List<Speaker> speakers = Arrays.asList(new Speaker[] {
index 41841a9c171bf826ce9e4df2584a3db5758a35f1..9e48133c23f3ede8fa2b3d5495549688d69f9582 100755 (executable)
Binary files a/code/GLucose.jar and b/code/GLucose.jar differ