Normand Briere
2019-06-23 f1382bc839a74ef1d1534c61ea94e53cf54716df
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];
....@@ -638,6 +644,24 @@
638644 // transient // aout 2013
639645 Object3D skeleton;
640646
647
+ void ExtractBigData(Object3D o)
648
+ {
649
+ super.ExtractBigData(o);
650
+
651
+ o.bvh = this.bvh;
652
+ o.skeleton = this.skeleton;
653
+ this.bvh = null;
654
+ this.skeleton = null;
655
+ }
656
+
657
+ void RestoreBigData(Object3D o)
658
+ {
659
+ super.RestoreBigData(o);
660
+
661
+ this.bvh = o.bvh;
662
+ this.skeleton = o.skeleton;
663
+ }
664
+
641665 boolean smoothed;
642666
643667 //boolean touched;
....@@ -664,8 +688,8 @@
664688 double targetdirx;
665689 double targetdirz;
666690
667
- double goalposx = -20;
668
- double goalposz = -10;
691
+ double goalposx = 0; // -20;
692
+ double goalposz = 0; // -10;
669693
670694 boolean followpath;
671695
....@@ -921,7 +945,7 @@
921945 // //GetFileRoot();
922946
923947 // sept 2014: //
924
- GrafreeD.RENDERME = 3; // patch for Merge objects
948
+ Grafreed.RENDERME = 3; // patch for Merge objects
925949 float[] thedata = bvh.animation.getBoneData(0);
926950
927951 os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]);
....@@ -1566,7 +1590,7 @@
15661590
15671591 lastsoundtime = Globals.framecount;
15681592
1569
- GrafreeD.hassound = true;
1593
+ Grafreed.hassound = true;
15701594 }
15711595 // else
15721596 // System.out.println("skipped");
....@@ -2797,7 +2821,8 @@
27972821 //if (bone._rotationEnabled)
27982822 if (//frame > 0 &&
27992823 !bone.skipmocap &&
2800
- !bone.name.contains("head") // &&
2824
+ !bone.name.contains("head") &&
2825
+ !bone.name.contains("Head") // &&
28012826 // !bone.name.contains("rFoot") &&
28022827 // !bone.name.contains("lFoot") &&
28032828 // !bone.name.contains("Pinky") &&
....@@ -3233,8 +3258,8 @@
32333258
32343259 // aout 2013 endframe = 0; // june 2013
32353260
3236
- //ResetZero();
3237
- setPose(frame);
3261
+ ResetZero();
3262
+ //setPose(frame);
32383263 }
32393264
32403265 static int mocapsupport = 0;
....@@ -3299,23 +3324,40 @@
32993324 // SetPositionDelta(false, true, false); // ?? false);
33003325 {
33013326 if (support == null)
3302
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3327
+ {
3328
+ if (bvh == null && new File(fullname).exists())
3329
+ ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3330
+ else
3331
+ {
3332
+ SetGlobalTransform();
3333
+ Rewind();
3334
+ Fade();
3335
+ }
3336
+ }
33033337 else
33043338 {
3305
- try
3306
- {
3339
+// try
3340
+// {
33073341 bvh = ((Mocap)support.get(mocapsupport++ % support.Size())).bvh;
33083342
33093343 // SetPositionDelta(false, true, true, true);
33103344 LoadData();
33113345 Rewind();
33123346 Fade();
3313
- }
3314
- catch (Exception e)
3315
- {
3316
- e.printStackTrace();
3317
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3318
- }
3347
+// }
3348
+// catch (Exception e)
3349
+// {
3350
+// System.err.println("An error occured while loading data. Use fallback by loading the file.");
3351
+// //e.printStackTrace();
3352
+// try
3353
+// {
3354
+// ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3355
+// }
3356
+// catch (Exception e2)
3357
+// {
3358
+// System.err.println("Motion file not found: " + fullname);
3359
+// }
3360
+// }
33193361 }
33203362 }
33213363
....@@ -3872,17 +3914,22 @@
38723914 // if (firstframe)
38733915 // return;
38743916
3875
- if (!restarted && /*display.restartframe &&*/
3876
- Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK
3917
+ if (//!restarted && /*display.restartframe &&*/
3918
+ Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW))
38773919 {
38783920 //display.restartframe = false;
38793921 restarted = true;
3922
+ //System.err.println("restarted = true");
38803923 Step();
38813924 }
38823925 else
38833926 {
3884
- if (Globals.isLIVE() && live && display.DrawMode() != display.SHADOW)
3927
+ //System.err.println("restarted");
3928
+ if (Globals.isLIVE() && live && display.DrawMode() != iCameraPane.SHADOW)
3929
+ {
38853930 restarted = false;
3931
+ //System.err.println("restarted = false");
3932
+ }
38863933 }
38873934
38883935 super.drawSelf(display, root, selected, blocked);