From 44b1501b5c4cd60ea67cc3d0971ed53f53b594e6 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Sun, 05 May 2019 10:19:33 -0400
Subject: [PATCH] Support for right click.

---
 Mocap.java |   43 +++++++++++++++++++++++++++++++------------
 1 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/Mocap.java b/Mocap.java
index acb3fd0..fc0ff2e 100644
--- a/Mocap.java
+++ b/Mocap.java
@@ -1519,7 +1519,7 @@
 //            mywave = currentwave++;
 //        }
                     // sound
-                    cVector eye = CameraPane.theRenderer.eyeCamera.location;
+                    cVector eye = Globals.theRenderer.EyeCamera().location;
 
 //                    if (sourcenode.parent.parent != null)
 //                        sourcenode.parent.parent.TransformToWorld(floor, tmp);
@@ -2267,7 +2267,7 @@
             }
 
             if (!smoothed)
-                for (int i=0; --i>=0;)
+                for (int i=10; --i>=0;)
                     SmoothAnimData(); // much reduces shakiness
 
             smoothed = true;
@@ -3252,12 +3252,13 @@
         
         int step = 1;
         
+        // patch for running hare
         if (speedup) // fev 2014
             step *= 2; // 4;
         if (rewind) // mars 2014
             step *= 4;
 
-        if (CameraPane.FAST) // && !CameraPane.HOLD)
+        //if (CameraPane.FAST) // && !CameraPane.HOLD)
             step *= CameraPane.STEP;
         
         //System.err.println("Step Mocap frame # " + frame);
@@ -3298,23 +3299,40 @@
 //            SetPositionDelta(false, true, false); // ?? false);
             {
                 if (support == null)
-                    ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
+                {
+                    if (new File(fullname).exists())
+                            ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
+                    else
+                    {
+                            SetGlobalTransform();
+                            Rewind();
+                            Fade();
+                    }
+                }
                 else
                 {
-                    try
-                    {
+//                    try
+//                    {
                         bvh = ((Mocap)support.get(mocapsupport++ % support.Size())).bvh;
 
                         // SetPositionDelta(false, true, true, true);
                         LoadData();
                         Rewind();
                         Fade();
-                    }
-                    catch (Exception e)
-                    {
-                        e.printStackTrace();
-                        ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
-                    }
+//                    }
+//                    catch (Exception e)
+//                    {
+//                            System.err.println("An error occured while loading data. Use fallback by loading the file.");
+//                        //e.printStackTrace();
+//                            try
+//                            {
+//                                    ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
+//                            }
+//                            catch (Exception e2)
+//                            {
+//                                    System.err.println("Motion file not found: " + fullname);
+//                            }
+//                    }
                 }
             }
             
@@ -3496,6 +3514,7 @@
     // filters out bad input data
     void FilterAnimData()
     {
+                new Exception().printStackTrace();
         System.exit(0);
         
         float[] data; // = bvh.animation.getBoneData(0);

--
Gitblit v1.6.2