From 57c5b6cd8d12ffdaa3e0b099451e3c031012750a Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Thu, 03 Oct 2019 20:34:32 -0400
Subject: [PATCH] Fix lighttouched

---
 CameraPane.java |   37 ++++++++++++++++++++++++++-----------
 1 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/CameraPane.java b/CameraPane.java
index b558c23..b60cf14 100644
--- a/CameraPane.java
+++ b/CameraPane.java
@@ -124,7 +124,7 @@
 static    boolean LOCALTRANSFORM = false;
 static    boolean FULLSCREEN = false;
 static    boolean SUPPORT = true;
-static    boolean INERTIA = true;
+static    boolean INERTIA = false; // true;
 static    boolean FAST = false;
 static    boolean SLOWPOSE = false;
 static    boolean FOOTCONTACT = true;
@@ -250,7 +250,7 @@
     
     public javax.media.opengl.GL GetGL0()
     {
-            return null;
+            return currentGL;
     }
     
     public int GenList()
@@ -1530,7 +1530,7 @@
                 }
             }
             float b = 0;
-            if (obj.support != null && obj.link2master)
+            if (obj.support != null && obj.Link2Support())
             {
                 b = 1;
             }
@@ -10761,7 +10761,9 @@
         }
         /**/
 
-        if (selection)
+        boolean control = ((modifiers & CTRL) != 0);
+        
+        if (selection && (!Globals.isLIVE() || control))
         {
             selectbuffer.display();
             return;
@@ -14346,8 +14348,6 @@
 
     public void mousePressed(MouseEvent e)
     {
-        RigidBody.justclicked = true;
-        System.out.println("justclicked: " + e);
         //System.out.println("mousePressed: " + e);
         clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
     }
@@ -14655,7 +14655,7 @@
         boolean jump;
         boolean live;
         
-        boolean mute;
+        boolean mute = false;
         
 //        void JumpToTarget()
 //        {
@@ -14676,9 +14676,16 @@
             RigidBody.pos.z = 0;
             if (RigidBody.justclicked)
             {
-                RigidBody.pos.x = (float)manipCamera.lookAt.x;
-                RigidBody.pos.y = (float)manipCamera.lookAt.y;
-                RigidBody.pos.z = (float)manipCamera.lookAt.z;
+//                RigidBody.pos.x = (float)manipCamera.lookAt.x;
+//                RigidBody.pos.y = (float)manipCamera.lookAt.y;
+//                RigidBody.pos.z = (float)manipCamera.lookAt.z;
+                                 //       System.err.println("selected point = " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][1]) + " " + Trunk(selectedpoint.toParent[3][2]));
+                CreateSelectedPoint();
+                
+                RigidBody.pos.x = (float)selectedpoint.toParent[3][0];
+                RigidBody.pos.y = (float)selectedpoint.toParent[3][1];
+                RigidBody.pos.z = (float)selectedpoint.toParent[3][2];
+
                 RigidBody.wind.set(RigidBody.pos);
                 RigidBody.wind.x -= (float)manipCamera.location.x;
                 RigidBody.wind.y -= (float)manipCamera.location.y;
@@ -15367,6 +15374,12 @@
 
     public void mouseReleased(MouseEvent e)
     {
+        if (isRenderer && !movingcamera)
+        {
+            RigidBody.justclicked = true;
+            System.out.println("justclicked: " + e);
+        }
+        
         Globals.MOUSEDRAGGED = false;
         
         movingcamera = false;
@@ -17155,7 +17168,7 @@
             return;
         }
 
-        if (WIREFRAME)
+        //if (WIREFRAME)
             gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL);
         
         gl.glDisable(gl.GL_CULL_FACE);
@@ -17255,6 +17268,8 @@
 
         if (WIREFRAME)
             gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_LINE);
+        else
+            gl.glPolygonMode(gl.GL_FRONT_AND_BACK, gl.GL_FILL);
     }
 
     private void DrawChecker(GL gl)

--
Gitblit v1.6.2