Normand Briere
2019-06-09 3ae9b1de47e51e7c150412f2bb14383cb6a5f8f8
Mocap.java
....@@ -484,6 +484,12 @@
484484 {
485485 Object3D hip = get(0);
486486
487
+ if (toParent == null)
488
+ {
489
+ toParent = LA.newMatrix();
490
+ fromParent = LA.newMatrix();
491
+ }
492
+
487493 LA.matConcat(toParent, hip.get(0).toParent, matrix);
488494
489495 mocaporigin.x = matrix[3][0];
....@@ -664,8 +670,8 @@
664670 double targetdirx;
665671 double targetdirz;
666672
667
- double goalposx = -20;
668
- double goalposz = -10;
673
+ double goalposx = 0; // -20;
674
+ double goalposz = 0; // -10;
669675
670676 boolean followpath;
671677
....@@ -921,7 +927,7 @@
921927 // //GetFileRoot();
922928
923929 // sept 2014: //
924
- GrafreeD.RENDERME = 3; // patch for Merge objects
930
+ Grafreed.RENDERME = 3; // patch for Merge objects
925931 float[] thedata = bvh.animation.getBoneData(0);
926932
927933 os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]);
....@@ -1566,7 +1572,7 @@
15661572
15671573 lastsoundtime = Globals.framecount;
15681574
1569
- GrafreeD.hassound = true;
1575
+ Grafreed.hassound = true;
15701576 }
15711577 // else
15721578 // System.out.println("skipped");
....@@ -2797,7 +2803,8 @@
27972803 //if (bone._rotationEnabled)
27982804 if (//frame > 0 &&
27992805 !bone.skipmocap &&
2800
- !bone.name.contains("head") // &&
2806
+ !bone.name.contains("head") &&
2807
+ !bone.name.contains("Head") // &&
28012808 // !bone.name.contains("rFoot") &&
28022809 // !bone.name.contains("lFoot") &&
28032810 // !bone.name.contains("Pinky") &&
....@@ -3233,8 +3240,8 @@
32333240
32343241 // aout 2013 endframe = 0; // june 2013
32353242
3236
- //ResetZero();
3237
- setPose(frame);
3243
+ ResetZero();
3244
+ //setPose(frame);
32383245 }
32393246
32403247 static int mocapsupport = 0;
....@@ -3299,23 +3306,40 @@
32993306 // SetPositionDelta(false, true, false); // ?? false);
33003307 {
33013308 if (support == null)
3302
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3309
+ {
3310
+ if (bvh == null && new File(fullname).exists())
3311
+ ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3312
+ else
3313
+ {
3314
+ SetGlobalTransform();
3315
+ Rewind();
3316
+ Fade();
3317
+ }
3318
+ }
33033319 else
33043320 {
3305
- try
3306
- {
3321
+// try
3322
+// {
33073323 bvh = ((Mocap)support.get(mocapsupport++ % support.Size())).bvh;
33083324
33093325 // SetPositionDelta(false, true, true, true);
33103326 LoadData();
33113327 Rewind();
33123328 Fade();
3313
- }
3314
- catch (Exception e)
3315
- {
3316
- e.printStackTrace();
3317
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3318
- }
3329
+// }
3330
+// catch (Exception e)
3331
+// {
3332
+// System.err.println("An error occured while loading data. Use fallback by loading the file.");
3333
+// //e.printStackTrace();
3334
+// try
3335
+// {
3336
+// ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3337
+// }
3338
+// catch (Exception e2)
3339
+// {
3340
+// System.err.println("Motion file not found: " + fullname);
3341
+// }
3342
+// }
33193343 }
33203344 }
33213345
....@@ -3872,17 +3896,22 @@
38723896 // if (firstframe)
38733897 // return;
38743898
3875
- if (!restarted && /*display.restartframe &&*/
3876
- Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK
3899
+ if (//!restarted && /*display.restartframe &&*/
3900
+ Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW))
38773901 {
38783902 //display.restartframe = false;
38793903 restarted = true;
3904
+ //System.err.println("restarted = true");
38803905 Step();
38813906 }
38823907 else
38833908 {
3884
- if (Globals.isLIVE() && live && display.DrawMode() != display.SHADOW)
3909
+ //System.err.println("restarted");
3910
+ if (Globals.isLIVE() && live && display.DrawMode() != iCameraPane.SHADOW)
3911
+ {
38853912 restarted = false;
3913
+ //System.err.println("restarted = false");
3914
+ }
38863915 }
38873916
38883917 super.drawSelf(display, root, selected, blocked);