From ddb10cb84dddfeef1ef9946f2e13cef3c93e6cc4 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Wed, 20 Nov 2019 20:49:12 -0500
Subject: [PATCH] New maze

---
 CameraPane.java  |   67 +++++++++++++++------
 Box.java         |    3 
 GroupEditor.java |   70 +++++++++++++++--------
 RagDoll.java     |    8 +-
 4 files changed, 99 insertions(+), 49 deletions(-)

diff --git a/Box.java b/Box.java
index b1c9f3b..adc8032 100644
--- a/Box.java
+++ b/Box.java
@@ -1,6 +1,7 @@
 public class Box extends Object3D implements java.io.Serializable
 {
-    static final long serialVersionUID = -8881546880864755550L; // 0;
+    static final long serialVersionUID = //-8881546880864755550L; // old
+                                        0; // new 2019
 
     boolean open;
     
diff --git a/CameraPane.java b/CameraPane.java
index 472bc2f..3edc07b 100644
--- a/CameraPane.java
+++ b/CameraPane.java
@@ -9688,7 +9688,7 @@
     {
         options1[0] = 100;
         options1[1] = 0.01f; // .025f;
-        options1[2] = 10f;
+        options1[2] = 3f;
         options1[3] = 0;
         options1[4] = 0;
         
@@ -15987,8 +15987,11 @@
 //                kompactbit = 6;
 //                break;
             case ' ':
-                capsLocked ^= true;
-                repaint();
+                if (manipCamera != lightCamera)
+                {
+                    capsLocked ^= true;
+                    repaint();
+                }
                 break;
             case 'l':
                 lightMode ^= true;
@@ -16187,24 +16190,48 @@
                 }
                 else
                 {
-                    switch (e.getKeyCode())
+                    if (manipCamera == lightCamera)
                     {
-                        case DOWN_ARROW:
-                            GoDown(e.getModifiersEx());
-                            break;
-                        case UP_ARROW:
-                            GoUp(e.getModifiersEx());
-                            break;
-                        case LEFT_ARROW:
-                            GoLeft(e.getModifiersEx());
-                            break;
-                        case RIGHT_ARROW:
-                            GoRight(e.getModifiersEx());
-                            break;
-                        default:
-                            modifiers = e.getModifiersEx();
-                            keyPressed(e.getKeyChar(), modifiers);
-                            break;
+                        switch (e.getKeyCode())
+                        {
+                            case DOWN_ARROW:
+                                lightCamera.DECAL /= 2;
+                                break;
+                            case UP_ARROW:
+                                lightCamera.DECAL *= 2;
+                                break;
+                            case LEFT_ARROW:
+                                lightCamera.SCALE /= 2;
+                                break;
+                            case RIGHT_ARROW:
+                                lightCamera.SCALE *= 2;
+                                break;
+                            default:
+                                break;
+                        }
+
+                        System.out.println("DECAL = " + lightCamera.DECAL + "; SCALE = " + lightCamera.SCALE);
+                    } else
+                    {
+                        switch (e.getKeyCode())
+                        {
+                            case DOWN_ARROW:
+                                GoDown(e.getModifiersEx());
+                                break;
+                            case UP_ARROW:
+                                GoUp(e.getModifiersEx());
+                                break;
+                            case LEFT_ARROW:
+                                GoLeft(e.getModifiersEx());
+                                break;
+                            case RIGHT_ARROW:
+                                GoRight(e.getModifiersEx());
+                                break;
+                            default:
+                                modifiers = e.getModifiersEx();
+                                keyPressed(e.getKeyChar(), modifiers);
+                                break;
+                        }
                     }
                 }
                 
diff --git a/GroupEditor.java b/GroupEditor.java
index f47872a..1cbbe20 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -2253,14 +2253,14 @@
 
     private void GenerateMaze()
     {
-        if (group.selection.size() == 4)
+        if (group.selection.size() == 1 && group.selection.get(0).size() == 16)
         {
                final double scaleX = SelectionSizeX();
                final double scaleZ = SelectionSizeZ();
                
                final cGroup mazeGroup = new cGroup("Maze");
                
-               final int dim = 15;
+               final int dim = 9;
                 
                Maze maze = new Maze(dim, dim);
                
@@ -2272,38 +2272,60 @@
                    {
                        if ((i == 0 || i == dim-1) && j == dim/2)
                        {
-                           return;
+                           //return;
                        }
                        
                        int v = 0;
+//                       if (north)
+//                       {
+//                            cGroup n = new cGroup("" + i + "," + j);
+//                            n.Translate(-j * scaleX, 0, i * scaleZ);
+//                            n.add(group.selection.get(0));
+//                            mazeGroup.add(n);
+//                       }
+//                       if (east)
+//                       {
+//                            cGroup n = new cGroup("" + i + "," + j);
+//                            n.Translate(-j * scaleX, 0, i * scaleZ);
+//                            n.add(group.selection.get(1));
+//                            mazeGroup.add(n);
+//                       }
+//                       if (south)
+//                       {
+//                            cGroup n = new cGroup("" + i + "," + j);
+//                            n.Translate(-j * scaleX, 0, i * scaleZ);
+//                            n.add(group.selection.get(2));
+//                            mazeGroup.add(n);
+//                       }
+//                       if (west)
+//                       {
+//                            cGroup n = new cGroup("" + i + "," + j);
+//                            n.Translate(-j * scaleX, 0, i * scaleZ);
+//                            n.add(group.selection.get(3));
+//                            mazeGroup.add(n);
+//                       }
+                       
                        if (north)
                        {
-                            cGroup n = new cGroup("" + i + "," + j);
-                            n.Translate(-j * scaleX, 0, i * scaleZ);
-                            n.add(group.selection.get(0));
-                            mazeGroup.add(n);
+                           v += 1;
                        }
-                       if (east)
+                       if (east && (i != dim-1 || j != dim/2))
                        {
-                            cGroup n = new cGroup("" + i + "," + j);
-                            n.Translate(-j * scaleX, 0, i * scaleZ);
-                            n.add(group.selection.get(1));
-                            mazeGroup.add(n);
+                           v += 2;
                        }
                        if (south)
                        {
-                            cGroup n = new cGroup("" + i + "," + j);
-                            n.Translate(-j * scaleX, 0, i * scaleZ);
-                            n.add(group.selection.get(2));
-                            mazeGroup.add(n);
+                           v += 4;
                        }
-                       if (west)
+                       if (west && (i != 0 || j != dim/2))
                        {
-                            cGroup n = new cGroup("" + i + "," + j);
-                            n.Translate(-j * scaleX, 0, i * scaleZ);
-                            n.add(group.selection.get(3));
-                            mazeGroup.add(n);
+                           v += 8;
                        }
+                       
+                       cGroup n = new cGroup("" + i + "," + j);
+                       n.Translate(-j * scaleX, 0, i * scaleZ);
+                       n.add(group.selection.get(0).get(v));
+                       mazeGroup.add(n);
                    }
                }
                );
@@ -2331,7 +2353,7 @@
         cVector bbmin = new cVector();
         cVector bbmax = new cVector();
         
-        group.selection.getBounds(bbmin, bbmax, true);
+        group.selection.get(0).get(0).getBounds(bbmin, bbmax, true);
         
         return bbmax.x - bbmin.x;
     }
@@ -2341,7 +2363,7 @@
         cVector bbmin = new cVector();
         cVector bbmax = new cVector();
         
-        group.selection.getBounds(bbmin, bbmax, true);
+        group.selection.get(0).get(0).getBounds(bbmin, bbmax, true);
         
         return bbmax.y - bbmin.y;
     }
@@ -2351,7 +2373,7 @@
         cVector bbmin = new cVector();
         cVector bbmax = new cVector();
         
-        group.selection.getBounds(bbmin, bbmax, true);
+        group.selection.get(0).get(0).getBounds(bbmin, bbmax, true);
         
         return bbmax.z - bbmin.z;
     }
diff --git a/RagDoll.java b/RagDoll.java
index a2de06b..c7c19e7 100644
--- a/RagDoll.java
+++ b/RagDoll.java
@@ -321,8 +321,8 @@
 		transform.setIdentity();
 		if ((body = bodies[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()]) == null)
                     body = bodies[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()] = localCreateRigidBody(1f, 0, transform, shapes[BodyPart.BODYPART_LEFT_LOWER_ARM.ordinal()]);
-		transform.origin.set(-(lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset);
-		MatrixUtil.setEulerZYX(transform.basis, 0, 0, BulletGlobals.SIMD_HALF_PI);
+		transform.origin.set(-(lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset + scale_ragdoll * lowerarmlength / 2 * 0.5f);
+		MatrixUtil.setEulerZYX(transform.basis, BulletGlobals.SIMD_HALF_PI/4, 0, BulletGlobals.SIMD_HALF_PI);
 		tmpTrans.mul(offset, transform);
 		body.worldTransform.set(tmpTrans);
                 body.getMotionState().setWorldTransform(tmpTrans);
@@ -351,8 +351,8 @@
 		transform.setIdentity();
 		if ((body = bodies[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()]) == null)
                     body = bodies[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()] = localCreateRigidBody(1f, 0, transform, shapes[BodyPart.BODYPART_RIGHT_LOWER_ARM.ordinal()]);
-		transform.origin.set((lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset);
-		MatrixUtil.setEulerZYX(transform.basis, 0, 0, -BulletGlobals.SIMD_HALF_PI);
+		transform.origin.set((lowerarmlength/2 + upperarmlength + upperarmdist) * scale_ragdoll, 1.325f * scale_ragdoll, depth + zoffset + scale_ragdoll * lowerarmlength / 2 * 0.5f);
+		MatrixUtil.setEulerZYX(transform.basis, BulletGlobals.SIMD_HALF_PI/4, 0, -BulletGlobals.SIMD_HALF_PI);
 		tmpTrans.mul(offset, transform);
 		body.worldTransform.set(tmpTrans);
                 body.getMotionState().setWorldTransform(tmpTrans);

--
Gitblit v1.6.2