From 8768a855af9ccc482a9520ce708ef32e0e6e0e7d Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Fri, 04 Oct 2019 20:06:36 -0400
Subject: [PATCH] Block multiple download.

---
 ObjEditor.java                            |   18 +++++++--
 CameraPane.java                           |   25 ++++++------
 GroupEditor.java                          |    4 +-
 com/bulletphysics/dynamics/RigidBody.java |   24 ++++++------
 Grafreed.java                             |    5 ++
 5 files changed, 46 insertions(+), 30 deletions(-)

diff --git a/CameraPane.java b/CameraPane.java
index b60cf14..3f97ee4 100644
--- a/CameraPane.java
+++ b/CameraPane.java
@@ -14676,21 +14676,22 @@
             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;
-                RigidBody.wind.z -= (float)manipCamera.location.z;
-                RigidBody.wind.normalize();
+//                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.lookAt.x;
+//                RigidBody.wind.y -= (float)manipCamera.lookAt.y;
+//                RigidBody.wind.z -= (float)manipCamera.lookAt.z;
+//                RigidBody.wind.scale(-1);
+//                RigidBody.wind.normalize();
             }
                     
             if (mute)
diff --git a/Grafreed.java b/Grafreed.java
index 28064c8..155cae5 100644
--- a/Grafreed.java
+++ b/Grafreed.java
@@ -60,6 +60,11 @@
         }
     }
 
+    static void Beep()
+    {
+        java.awt.Toolkit.getDefaultToolkit().beep();
+    }
+    
     public static String RemovePrefix(String s, String prefix)
     {
         if (s != null && prefix != null && s.startsWith(prefix))
diff --git a/GroupEditor.java b/GroupEditor.java
index 008fb31..2ec45ad 100644
--- a/GroupEditor.java
+++ b/GroupEditor.java
@@ -2835,7 +2835,7 @@
 		{
                         // Go to previous version
 			//if (!Undo())
-                            //java.awt.Toolkit.getDefaultToolkit().beep();
+                            //Grafreed.Beep();
 			PreviousVersion();
 		} else
 		if (source == restoreButton)
@@ -2859,7 +2859,7 @@
 		{
                         // Save a new version
 			if (!DuplicateVersion()) //true))
-                            java.awt.Toolkit.getDefaultToolkit().beep();
+                            Grafreed.Beep();
 		} else
 		if (source == deleteVersionButton)
 		{
diff --git a/ObjEditor.java b/ObjEditor.java
index 05fa7cb..af5b921 100644
--- a/ObjEditor.java
+++ b/ObjEditor.java
@@ -5090,7 +5090,7 @@
         
         if (copy.versionindex == 0)
         {
-            java.awt.Toolkit.getDefaultToolkit().beep();
+            Grafreed.Beep();
             return false;
         }
 
@@ -5126,7 +5126,7 @@
         
         if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
         {
-            java.awt.Toolkit.getDefaultToolkit().beep();
+            Grafreed.Beep();
             return false;
         }
 
@@ -5149,7 +5149,7 @@
         // < 0 means == -2 || == -1
         if (copy.versionindex < 0 || copy.versionlist[copy.versionindex] == null)
         {
-            // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
+            // No version yet. OK. Grafreed.Beep();
             return false;
         }
 
@@ -5167,7 +5167,7 @@
         
         if (copy.versionlist[copy.versionindex + 1] == null)
         {
-            java.awt.Toolkit.getDefaultToolkit().beep();
+            Grafreed.Beep();
             return;
         }
 
@@ -6104,6 +6104,8 @@
         //String filename;
         //iCallBack callback;
 
+        boolean running;
+            
         java.util.Stack stack;
 
         LoadGFDThread(/*String fullname, iCallBack cb*/)
@@ -6133,6 +6135,7 @@
                 };
                 if (!stack.empty())
                 {
+                    running = true;
                     frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                     iCallBack callback = (iCallBack) stack.pop();
                     String filename = (String) stack.pop();
@@ -6140,6 +6143,7 @@
                     callback.Callback(ReadGFD(filename));
                     System.gc();
                     wasbusy = true;
+                    running = false;
                 } else
                 {
                     if (wasbusy)
@@ -6162,6 +6166,12 @@
             loadGFDThread.start();
         }
 
+        if (loadGFDThread.running)
+        {
+            Grafreed.Beep();
+            return;
+        }
+        
         loadGFDThread.add(fullname, cb);
     }
 
diff --git a/com/bulletphysics/dynamics/RigidBody.java b/com/bulletphysics/dynamics/RigidBody.java
index 4d96feb..e7d2735 100755
--- a/com/bulletphysics/dynamics/RigidBody.java
+++ b/com/bulletphysics/dynamics/RigidBody.java
@@ -237,19 +237,19 @@
                 
                 justclicked = false;
                 
-//                wind.set(pos);
-//                wind.x -= worldTransform.origin.x;
-//                wind.y -= worldTransform.origin.y;
-//                wind.z -= worldTransform.origin.z;
+                wind.set(pos);
+                wind.x -= worldTransform.origin.x;
+                wind.y -= worldTransform.origin.y;
+                wind.z -= worldTransform.origin.z;
                 
-                this.collisionShape.getAabb(worldTransform, min, max);
-
-                if (pos.x < min.x || pos.x > max.x)
-                    return;
-                if (pos.y < min.y || pos.y > max.y)
-                    return;
-                if (pos.z < min.z || pos.z > max.z)
-                    return;
+//                this.collisionShape.getAabb(worldTransform, min, max);
+//
+//                if (pos.x < min.x || pos.x > max.x)
+//                    return;
+//                if (pos.y < min.y || pos.y > max.y)
+//                    return;
+//                if (pos.z < min.z || pos.z > max.z)
+//                    return;
                     
                 float dot = pos.x * wind.x + pos.y * wind.y + pos.z * wind.z;
                 

--
Gitblit v1.6.2