Normand Briere
2019-11-21 ddb10cb84dddfeef1ef9946f2e13cef3c93e6cc4
GroupEditor.java
....@@ -2253,14 +2253,14 @@
22532253
22542254 private void GenerateMaze()
22552255 {
2256
- if (group.selection.size() == 4)
2256
+ if (group.selection.size() == 1 && group.selection.get(0).size() == 16)
22572257 {
22582258 final double scaleX = SelectionSizeX();
22592259 final double scaleZ = SelectionSizeZ();
22602260
22612261 final cGroup mazeGroup = new cGroup("Maze");
22622262
2263
- final int dim = 15;
2263
+ final int dim = 9;
22642264
22652265 Maze maze = new Maze(dim, dim);
22662266
....@@ -2272,38 +2272,60 @@
22722272 {
22732273 if ((i == 0 || i == dim-1) && j == dim/2)
22742274 {
2275
- return;
2275
+ //return;
22762276 }
22772277
22782278 int v = 0;
2279
+// if (north)
2280
+// {
2281
+// cGroup n = new cGroup("" + i + "," + j);
2282
+// n.Translate(-j * scaleX, 0, i * scaleZ);
2283
+// n.add(group.selection.get(0));
2284
+// mazeGroup.add(n);
2285
+// }
2286
+// if (east)
2287
+// {
2288
+// cGroup n = new cGroup("" + i + "," + j);
2289
+// n.Translate(-j * scaleX, 0, i * scaleZ);
2290
+// n.add(group.selection.get(1));
2291
+// mazeGroup.add(n);
2292
+// }
2293
+// if (south)
2294
+// {
2295
+// cGroup n = new cGroup("" + i + "," + j);
2296
+// n.Translate(-j * scaleX, 0, i * scaleZ);
2297
+// n.add(group.selection.get(2));
2298
+// mazeGroup.add(n);
2299
+// }
2300
+// if (west)
2301
+// {
2302
+// cGroup n = new cGroup("" + i + "," + j);
2303
+// n.Translate(-j * scaleX, 0, i * scaleZ);
2304
+// n.add(group.selection.get(3));
2305
+// mazeGroup.add(n);
2306
+// }
2307
+
22792308 if (north)
22802309 {
2281
- cGroup n = new cGroup("" + i + "," + j);
2282
- n.Translate(-j * scaleX, 0, i * scaleZ);
2283
- n.add(group.selection.get(0));
2284
- mazeGroup.add(n);
2310
+ v += 1;
22852311 }
2286
- if (east)
2312
+ if (east && (i != dim-1 || j != dim/2))
22872313 {
2288
- cGroup n = new cGroup("" + i + "," + j);
2289
- n.Translate(-j * scaleX, 0, i * scaleZ);
2290
- n.add(group.selection.get(1));
2291
- mazeGroup.add(n);
2314
+ v += 2;
22922315 }
22932316 if (south)
22942317 {
2295
- cGroup n = new cGroup("" + i + "," + j);
2296
- n.Translate(-j * scaleX, 0, i * scaleZ);
2297
- n.add(group.selection.get(2));
2298
- mazeGroup.add(n);
2318
+ v += 4;
22992319 }
2300
- if (west)
2320
+ if (west && (i != 0 || j != dim/2))
23012321 {
2302
- cGroup n = new cGroup("" + i + "," + j);
2303
- n.Translate(-j * scaleX, 0, i * scaleZ);
2304
- n.add(group.selection.get(3));
2305
- mazeGroup.add(n);
2322
+ v += 8;
23062323 }
2324
+
2325
+ cGroup n = new cGroup("" + i + "," + j);
2326
+ n.Translate(-j * scaleX, 0, i * scaleZ);
2327
+ n.add(group.selection.get(0).get(v));
2328
+ mazeGroup.add(n);
23072329 }
23082330 }
23092331 );
....@@ -2331,7 +2353,7 @@
23312353 cVector bbmin = new cVector();
23322354 cVector bbmax = new cVector();
23332355
2334
- group.selection.getBounds(bbmin, bbmax, true);
2356
+ group.selection.get(0).get(0).getBounds(bbmin, bbmax, true);
23352357
23362358 return bbmax.x - bbmin.x;
23372359 }
....@@ -2341,7 +2363,7 @@
23412363 cVector bbmin = new cVector();
23422364 cVector bbmax = new cVector();
23432365
2344
- group.selection.getBounds(bbmin, bbmax, true);
2366
+ group.selection.get(0).get(0).getBounds(bbmin, bbmax, true);
23452367
23462368 return bbmax.y - bbmin.y;
23472369 }
....@@ -2351,7 +2373,7 @@
23512373 cVector bbmin = new cVector();
23522374 cVector bbmax = new cVector();
23532375
2354
- group.selection.getBounds(bbmin, bbmax, true);
2376
+ group.selection.get(0).get(0).getBounds(bbmin, bbmax, true);
23552377
23562378 return bbmax.z - bbmin.z;
23572379 }