X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=_Mappings.pde;h=15b440bc6342474f4893d0f7fc260684dd3d691b;hb=45acdbc0a9eeae34ce1d8beeb10d4f12448f9aed;hp=94d50bbf449f522688c222315dfb47eefc89b7de;hpb=b30f14fdacdcccafe123e00f20a4d6df46e6995c;p=SugarCubes.git diff --git a/_Mappings.pde b/_Mappings.pde index 94d50bb..15b440b 100644 --- a/_Mappings.pde +++ b/_Mappings.pde @@ -51,12 +51,31 @@ public Model buildModel() { // 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. + + //////////////////////////////////////////////////////////////////////// + // dan's proposed lattice + ArrayList scubes = new ArrayList(); + if (NumBackTowers != 9) exit(); + for (int i=0; i dcubes = new ArrayList(); + for (int i=1; i<6; i++) { + if (i>1) dcubes.add(new Cube(-6+CW*4/3*i , 0, 0, 0, 0, 0, WRR)); + dcubes.add(new Cube(-6+CW*4/3*i+CW*2/3., CH*.5, 0, 0, 0, 0, WRR)); + } + + TowerMapping[] towerCubes = new TowerMapping[] {}; // Single cubes can be constructed directly here if you need them Cube[] singleCubes = new Cube[] { // new Cube(15, int( Cube.EDGE_HEIGHT), 39, 0, 10, 0, WRL), // Back left channel behind speaker - //new Cube(0, 0, 0, 0, 45, rz, wiring), + //new Cube(x, y, z, rx, ry, rz, wiring), + new Cube(0,0,0,0,-135,0, WRR), }; // The bass box! @@ -70,23 +89,6 @@ public Model buildModel() { // new Speaker(TRAILER_WIDTH - Speaker.EDGE_WIDTH + 8, 6, 3, -15) }); - - //////////////////////////////////////////////////////////////////////// - // dan's proposed lattice - ArrayList scubes = new ArrayList(); - if (NumBackTowers != 9) exit(); - for (int i=0; i dcubes = new ArrayList(); - for (int i=1; i<6; i++) { - if (i>1) dcubes.add(new Cube(-6+CW*4/3*i , 0, 0, 0, 0, 0, WRR)); - dcubes.add(new Cube(-6+CW*4/3*i+CW*2/3., CH*.5, 0, 0, 0, 0, WRR)); - } - ////////////////////////////////////////////////////////////////////// // BENEATH HERE SHOULD NOT REQUIRE ANY MODIFICATION!!!! // ////////////////////////////////////////////////////////////////////// @@ -109,17 +111,17 @@ public Model buildModel() { towerList.add(new Tower(tower)); } - for (StaggeredTower st : scubes) { + + for (Cube cube : singleCubes) cubes[cubeIndex++] = cube; + for (Cube cube : dcubes) cubes[cubeIndex++] = cube; +for (StaggeredTower st : scubes) { tower = new ArrayList(); for (int i=0; i < st.n; i++) tower.add(cubes[cubeIndex++] = new Cube(st.x, st.y + CH* 4/3.*i, st.z, 0, st.r, 0, WRR)); towerList.add(new Tower(tower)); } - for (Cube cube : singleCubes) cubes[cubeIndex++] = cube; - for (Cube cube : dcubes) cubes[cubeIndex++] = cube; - - return new Model(towerList, cubes, bassBox, speakers); + return new Model(towerList, cubes, bassBox, speakers); } /**