- // TODO(mcslee): find a cleaner way of representing this data, probably
- // serialized in some more neutral form. also figure out what's going on
- // with the indexing starting at 1 and some indices missing.
- ArrayList<Tower> towerList = new ArrayList<Tower>();
- ArrayList<Cube> tower;
- Cube[] cubes = new Cube[79];
- int cubeIndex = 1;
-
- tower = new ArrayList<Cube>();
- tower.add(cubes[cubeIndex++] = new Cube(0, 0, 0, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(5, Cube.EDGE_HEIGHT, -10, 0, 20, 0));
- tower.add(cubes[cubeIndex++] = new Cube(0, 2*Cube.EDGE_HEIGHT, -6, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(-5, 3*Cube.EDGE_HEIGHT, -2, 0, -20, 0));
- towerList.add(new Tower(tower));
-
- tower = new ArrayList<Cube>();
- tower.add(cubes[cubeIndex++] = new Cube(Cube.EDGE_WIDTH + 2, 0, 0, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(Cube.EDGE_WIDTH + 2, Cube.EDGE_HEIGHT, 5, 0, 10, 0));
- tower.add(cubes[cubeIndex++] = new Cube(Cube.EDGE_WIDTH + 2, 2*Cube.EDGE_HEIGHT, 2, 0, 20, 0));
- tower.add(cubes[cubeIndex++] = new Cube(Cube.EDGE_WIDTH + 2, 3*Cube.EDGE_HEIGHT, 0, 0, 30, 0));
- towerList.add(new Tower(tower));
-
- // Back Cubes behind DJ platform (in order of increasing x)
- tower = new ArrayList<Cube>();
- tower.add(cubes[cubeIndex++] = new Cube(50, 0, BASS_DEPTH, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(52, 5+Cube.EDGE_HEIGHT, BASS_DEPTH, 0, 20, 0));
- tower.add(cubes[cubeIndex++] = new Cube(48, 5+2*Cube.EDGE_HEIGHT, BASS_DEPTH + 10, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(45, 5+3*Cube.EDGE_HEIGHT, BASS_DEPTH + 15, 0, -20, 0));
- tower.add(cubes[cubeIndex++] = new Cube(48, 5+4*Cube.EDGE_HEIGHT, BASS_DEPTH + 13, 0, 0, 0));
- towerList.add(new Tower(tower));
-
- tower = new ArrayList<Cube>();
- tower.add(cubes[cubeIndex++] = new Cube(79, 0, BASS_DEPTH, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(81, 5+Cube.EDGE_HEIGHT, BASS_DEPTH, 0, 20, 0));
- tower.add(cubes[cubeIndex++] = new Cube(83, 5+2*Cube.EDGE_HEIGHT, BASS_DEPTH + 10, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(81, 5+3*Cube.EDGE_HEIGHT, BASS_DEPTH + 15, 0, -20, 0));
- tower.add(cubes[cubeIndex++] = new Cube(79, 5+4*Cube.EDGE_HEIGHT, BASS_DEPTH + 13, 0, 0, 0));
- towerList.add(new Tower(tower));
-
- tower = new ArrayList<Cube>();
- tower.add(cubes[cubeIndex++] = new Cube(107, 0, BASS_DEPTH, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(111, 5+Cube.EDGE_HEIGHT, BASS_DEPTH, 0, 20, 0));
- tower.add(cubes[cubeIndex++] = new Cube(113, 5+2*Cube.EDGE_HEIGHT, BASS_DEPTH + 10, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(110, 5+3*Cube.EDGE_HEIGHT, BASS_DEPTH + 15, 0, -20, 0));
- // tower.add(cubes[cubeIndex++] = new Cube(115, 5+4*Cube.EDGE_HEIGHT, BASS_DEPTH + 13, 0, 0, 0));
- towerList.add(new Tower(tower));
-
- tower = new ArrayList<Cube>();
- tower.add(cubes[cubeIndex++] = new Cube(133, 0, BASS_DEPTH, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(131, 5+Cube.EDGE_HEIGHT, BASS_DEPTH, 0, 20, 0));
- tower.add(cubes[cubeIndex++] = new Cube(133, 5+2*Cube.EDGE_HEIGHT, BASS_DEPTH + 10, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(135, 5+3*Cube.EDGE_HEIGHT, BASS_DEPTH + 15, 0, -20, 0));
- // tower.add(cubes[cubeIndex++] = new Cube(137, 5+4*Cube.EDGE_HEIGHT, BASS_DEPTH + 13, 0, 0, 0));
- towerList.add(new Tower(tower));
-
- tower = new ArrayList<Cube>();
- tower.add(cubes[cubeIndex++] = new Cube(165, 0, BASS_DEPTH, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(164, 5+Cube.EDGE_HEIGHT, BASS_DEPTH, 0, 20, 0));
- tower.add(cubes[cubeIndex++] = new Cube(167, 5+2*Cube.EDGE_HEIGHT, BASS_DEPTH + 10, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube(163, 5+3*Cube.EDGE_HEIGHT, BASS_DEPTH + 15, 0, -20, 0));
- tower.add(cubes[cubeIndex++] = new Cube(168, 5+4*Cube.EDGE_HEIGHT, BASS_DEPTH + 13, 0, 0, 0));
- towerList.add(new Tower(tower));
-
- // front DJ cubes
- tower = new ArrayList<Cube>();
- tower.add(cubes[cubeIndex++] = new Cube((TRAILER_WIDTH - BASS_WIDTH)/2, BASS_HEIGHT + 0, 10, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube((TRAILER_WIDTH - BASS_WIDTH)/2, BASS_HEIGHT + Cube.EDGE_HEIGHT, 0, 0, 20, 0));
- towerList.add(new Tower(tower));
-
- tower = new ArrayList<Cube>();
- tower.add(cubes[cubeIndex++] = new Cube((TRAILER_WIDTH - BASS_WIDTH)/2 + Cube.EDGE_HEIGHT + 2, BASS_HEIGHT+Cube.EDGE_HEIGHT, 0, 0, 20, 0));
- tower.add(cubes[cubeIndex++] = new Cube((TRAILER_WIDTH - BASS_WIDTH)/2 + Cube.EDGE_HEIGHT + 3, BASS_HEIGHT, 10, 0, 0, 0));
- towerList.add(new Tower(tower));
-
- tower = new ArrayList<Cube>();
- tower.add(cubes[cubeIndex++] = new Cube((TRAILER_WIDTH - BASS_WIDTH)/2 + 2*Cube.EDGE_HEIGHT + 5, BASS_HEIGHT + 0, 10, 0, 0, 0));
- tower.add(cubes[cubeIndex++] = new Cube((TRAILER_WIDTH - BASS_WIDTH)/2 + 2*Cube.EDGE_HEIGHT + 6, BASS_HEIGHT + Cube.EDGE_HEIGHT, 10, 0, 10, 0));
- towerList.add(new Tower(tower));
+
+
+ // Shorthand helpers for specifying wiring more quickly
+ final Cube.Wiring WFL = Cube.Wiring.FRONT_LEFT;
+ final Cube.Wiring WFR = Cube.Wiring.FRONT_RIGHT;
+ final Cube.Wiring WRL = Cube.Wiring.REAR_LEFT;
+ final Cube.Wiring WRR = Cube.Wiring.REAR_RIGHT;
+
+ // Utility value if you need the height of a cube shorthand
+ final float CH = Cube.EDGE_HEIGHT;
+
+ // Positions for the bass box
+ final float BBY = BassBox.EDGE_HEIGHT + BoothFloor.PLEXI_WIDTH;
+ final float BBX = 56;
+ final float BBZ = 2;
+
+
+ // The model is represented as an array of towers. The cubes in the tower
+ // are represenented relatively. Each tower has an x, y, z reference position,
+ // which is typically the base cube's bottom left corner.
+ //
+ // Following that is an array of floats. A 2-d array contains an x-offset
+ // and a z-offset from the previous reference position. Typically the first cube
+ // will just be {0, 0}. Each successive cube uses the position of the previous
+ // cube as its reference.
+ //
+ // A 3-d array contains an x-offset, a z-offset, and a rotation about the
+ // y-axis.
+ //
+ // The cubes automatically increment their y-position by Cube.EDGE_HEIGHT.
+
+ // To-Do: (Mark Slee, Alex Green, or Ben Morrow): The Cube # is determined by the order in this list. "raw object index" is serialized by running through towermapping and then individual cube mapping below.
+ // We can do better than this. The raw object index should be obvious from the code-- looking through the rendered simulation and counting through cubes in mapping mode is grossly inefficient.
+ TowerMapping[] towerCubes = new TowerMapping[] {
+
+
+
+ //back left cubes: temp Channel 1
+ new TowerMapping(0, 3*Cube.EDGE_HEIGHT, 72, new CubeMapping[] {
+ new CubeMapping(0, 14, -45 , WRL), // #1
+ new CubeMapping(10, -12, -20, WFL), //#2
+ new CubeMapping(5, 9, 45, WRR), //#3
+
+
+ }),
+ //back left cube tower: Channel 2
+ new TowerMapping(0, Cube.EDGE_HEIGHT, 70, new CubeMapping[] {
+ new CubeMapping(18, -2.5, 45, WRL), //#4
+ new CubeMapping(15, -6, 45, WFR), //#5
+ new CubeMapping(-6 , 7, 5, WRR), //#6
+ new CubeMapping(18, 11, -5, WFL)
+
+ }),
+
+ //second from left back tower: Channel 3
+ new TowerMapping(31, Cube.EDGE_HEIGHT, 73.5, new CubeMapping[] {
+ new CubeMapping( 12.5, 5.5 , 10 , WRR),
+ new CubeMapping( 16.5, 2.5 , 30, WRR),
+ new CubeMapping( 16.5, 3, 10, WRR),
+ new CubeMapping(.5, 4.5, -10 , WFL)
+ } ),
+
+ //center tower, Channel 4
+ new TowerMapping(106, Cube.EDGE_HEIGHT, 84, new CubeMapping[] {
+ new CubeMapping( -3.5, -2, 10, WFL),
+ new CubeMapping( -11, 5, 30, WFR),
+ new CubeMapping( 13.5, 2, 15, WRR),
+ new CubeMapping(20.75, -4, 35 , WRL)
+ } ),
+
+ //second from back right tower, Channel 5
+
+ new TowerMapping(160, Cube.EDGE_HEIGHT, 78, new CubeMapping[] {
+ new CubeMapping( -31.5, -.5 , 5 , WFR),
+ new CubeMapping( 7, -.5, 60, WRL),
+ new CubeMapping( -5.5, -3, 0, WFR),
+ new CubeMapping(22 , 2 , 30 , WRL)
+ }),
+
+
+ //back right cubes: temp Channel 6
+ new TowerMapping(201, Cube.EDGE_HEIGHT, 72, new CubeMapping[] {
+ new CubeMapping(7.5, 6, 25, WRL),
+ new CubeMapping(-4.5, -0.5, 18, WFR),
+ new CubeMapping(8.5, .5, 30, WRL),
+ new CubeMapping(-7, -14, 10, WFR)
+
+ }),
+
+
+
+
+
+ //tower to the right of BASS BOX
+ new TowerMapping (192, Cube.EDGE_HEIGHT, 40, new CubeMapping[] {
+ new CubeMapping(-6, 4, -10, WRL),
+ new CubeMapping(5 ,5 , 5, WFR ),
+ new CubeMapping(-2, .5 , -3, WFL),
+ new CubeMapping(-10, 5.5 , -20, WRR )
+ }),
+
+ //end right tower in middle, right of previous tower
+ //new TowerMapping (214, Cube.EDGE_HEIGHT, 37, new CubeMapping[] {
+ //new CubeMapping(10,0 , 50, WRR),
+ //new CubeMapping(5 ,5 , 65, WFL)
+ //}),
+// // DJ booth, from back left to back right
+
+ new TowerMapping(BBX, BBY, BBZ, new CubeMapping[] {
+ new CubeMapping(3, 28, 3, WFL),
+ new CubeMapping(-4, -8, 10, WFR),
+ new CubeMapping(-15, 8, 40, WFR)
+
+
+ }),
+
+