Normand Briere
2019-11-21 ddb10cb84dddfeef1ef9946f2e13cef3c93e6cc4
New maze
4 files modified
148 ■■■■■ changed files
Box.java 3 ●●●● patch | view | raw | blame | history
CameraPane.java 67 ●●●● patch | view | raw | blame | history
GroupEditor.java 70 ●●●●● patch | view | raw | blame | history
RagDoll.java 8 ●●●● patch | view | raw | blame | history
Box.java
....@@ -1,6 +1,7 @@
11 public class Box extends Object3D implements java.io.Serializable
22 {
3
- static final long serialVersionUID = -8881546880864755550L; // 0;
3
+ static final long serialVersionUID = //-8881546880864755550L; // old
4
+ 0; // new 2019
45
56 boolean open;
67
CameraPane.java
....@@ -9688,7 +9688,7 @@
96889688 {
96899689 options1[0] = 100;
96909690 options1[1] = 0.01f; // .025f;
9691
- options1[2] = 10f;
9691
+ options1[2] = 3f;
96929692 options1[3] = 0;
96939693 options1[4] = 0;
96949694
....@@ -15987,8 +15987,11 @@
1598715987 // kompactbit = 6;
1598815988 // break;
1598915989 case ' ':
15990
- capsLocked ^= true;
15991
- repaint();
15990
+ if (manipCamera != lightCamera)
15991
+ {
15992
+ capsLocked ^= true;
15993
+ repaint();
15994
+ }
1599215995 break;
1599315996 case 'l':
1599415997 lightMode ^= true;
....@@ -16187,24 +16190,48 @@
1618716190 }
1618816191 else
1618916192 {
16190
- switch (e.getKeyCode())
16193
+ if (manipCamera == lightCamera)
1619116194 {
16192
- case DOWN_ARROW:
16193
- GoDown(e.getModifiersEx());
16194
- break;
16195
- case UP_ARROW:
16196
- GoUp(e.getModifiersEx());
16197
- break;
16198
- case LEFT_ARROW:
16199
- GoLeft(e.getModifiersEx());
16200
- break;
16201
- case RIGHT_ARROW:
16202
- GoRight(e.getModifiersEx());
16203
- break;
16204
- default:
16205
- modifiers = e.getModifiersEx();
16206
- keyPressed(e.getKeyChar(), modifiers);
16207
- break;
16195
+ switch (e.getKeyCode())
16196
+ {
16197
+ case DOWN_ARROW:
16198
+ lightCamera.DECAL /= 2;
16199
+ break;
16200
+ case UP_ARROW:
16201
+ lightCamera.DECAL *= 2;
16202
+ break;
16203
+ case LEFT_ARROW:
16204
+ lightCamera.SCALE /= 2;
16205
+ break;
16206
+ case RIGHT_ARROW:
16207
+ lightCamera.SCALE *= 2;
16208
+ break;
16209
+ default:
16210
+ break;
16211
+ }
16212
+
16213
+ System.out.println("DECAL = " + lightCamera.DECAL + "; SCALE = " + lightCamera.SCALE);
16214
+ } else
16215
+ {
16216
+ switch (e.getKeyCode())
16217
+ {
16218
+ case DOWN_ARROW:
16219
+ GoDown(e.getModifiersEx());
16220
+ break;
16221
+ case UP_ARROW:
16222
+ GoUp(e.getModifiersEx());
16223
+ break;
16224
+ case LEFT_ARROW:
16225
+ GoLeft(e.getModifiersEx());
16226
+ break;
16227
+ case RIGHT_ARROW:
16228
+ GoRight(e.getModifiersEx());
16229
+ break;
16230
+ default:
16231
+ modifiers = e.getModifiersEx();
16232
+ keyPressed(e.getKeyChar(), modifiers);
16233
+ break;
16234
+ }
1620816235 }
1620916236 }
1621016237
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 }
RagDoll.java
....@@ -321,8 +321,8 @@
321321 transform.setIdentity();
322322 if ((body = bodies[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()]) == null)
323323 body = bodies[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()] = localCreateRigidBody(1f, 0, transform, shapes[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()]);
324
- transform.origin.set(-(lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset);
325
- MatrixUtil.setEulerZYX(transform.basis, 0, 0, BulletGlobals.SIMD_HALF_PI);
324
+ transform.origin.set(-(lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset + scale_ragdoll * lowerarmlength / 2 * 0.5f);
325
+ MatrixUtil.setEulerZYX(transform.basis, BulletGlobals.SIMD_HALF_PI/4, 0, BulletGlobals.SIMD_HALF_PI);
326326 tmpTrans.mul(offset, transform);
327327 body.worldTransform.set(tmpTrans);
328328 body.getMotionState().setWorldTransform(tmpTrans);
....@@ -351,8 +351,8 @@
351351 transform.setIdentity();
352352 if ((body = bodies[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()]) == null)
353353 body = bodies[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()] = localCreateRigidBody(1f, 0, transform, shapes[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()]);
354
- transform.origin.set((lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset);
355
- MatrixUtil.setEulerZYX(transform.basis, 0, 0, -BulletGlobals.SIMD_HALF_PI);
354
+ transform.origin.set((lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset + scale_ragdoll * lowerarmlength / 2 * 0.5f);
355
+ MatrixUtil.setEulerZYX(transform.basis, BulletGlobals.SIMD_HALF_PI/4, 0, -BulletGlobals.SIMD_HALF_PI);
356356 tmpTrans.mul(offset, transform);
357357 body.worldTransform.set(tmpTrans);
358358 body.getMotionState().setWorldTransform(tmpTrans);