From f924d3e00db476c06f55f3d5aaef307e17575340 Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Mon, 13 May 2019 07:29:08 -0400
Subject: [PATCH] Transform children

---
 Mocap.java |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/Mocap.java b/Mocap.java
index 54415a3..246c834 100644
--- a/Mocap.java
+++ b/Mocap.java
@@ -484,6 +484,12 @@
     {
         Object3D hip = get(0);
         
+        if (toParent == null)
+        {
+            toParent = LA.newMatrix();
+            fromParent = LA.newMatrix();
+        }
+        
         LA.matConcat(toParent, hip.get(0).toParent, matrix);
         
         mocaporigin.x = matrix[3][0];
@@ -664,8 +670,8 @@
     double targetdirx;
     double targetdirz;
     
-    double goalposx = -20;
-    double goalposz = -10;
+    double goalposx = 0; // -20;
+    double goalposz = 0; // -10;
     
     boolean followpath;
     
@@ -2797,7 +2803,8 @@
                 //if (bone._rotationEnabled)
                 if (//frame > 0 &&
                     !bone.skipmocap &&
-                    !bone.name.contains("head") // &&
+                    !bone.name.contains("head") &&
+                    !bone.name.contains("Head") // &&
                  //   !bone.name.contains("rFoot") &&
                  //   !bone.name.contains("lFoot") &&
 //                    !bone.name.contains("Pinky") &&
@@ -3233,8 +3240,8 @@
         
 // aout 2013        endframe = 0; // june 2013
         
-        //ResetZero();
-        setPose(frame);
+        ResetZero();
+        //setPose(frame);
     }
     
     static int mocapsupport = 0;
@@ -3300,7 +3307,7 @@
             {
                 if (support == null)
                 {
-                    if (new File(fullname).exists())
+                    if (bvh == null && new File(fullname).exists())
                             ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
                     else
                     {
@@ -3889,17 +3896,22 @@
      //   if (firstframe)
      //       return;
         
-        if (!restarted && /*display.restartframe &&*/
-                Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK
+        if (//!restarted && /*display.restartframe &&*/
+                Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW))
         {
             //display.restartframe = false;
             restarted = true;
+        //System.err.println("restarted = true");
             Step();
         }
         else
         {
-            if (Globals.isLIVE() && live && display.DrawMode() != display.SHADOW)
+        //System.err.println("restarted");
+            if (Globals.isLIVE() && live && display.DrawMode() != iCameraPane.SHADOW)
+            {
                 restarted = false;
+        //System.err.println("restarted = false");
+            }
         }
         
         super.drawSelf(display, root, selected, blocked);

--
Gitblit v1.6.2