Normand Briere
2019-07-23 cf7cfa1c792eebba606a48aa648893f6e4873263
Mocap.java
....@@ -261,6 +261,8 @@
261261
262262 // LA.matConcat(toParent, hip.get(0).toParent, toParent);
263263
264
+ CameraPane.CreateSelectedPoint();
265
+
264266 CameraPane.debugpointG.toParent[3][0] = poship.x;
265267 CameraPane.debugpointG.toParent[3][1] = poship.y;
266268 CameraPane.debugpointG.toParent[3][2] = poship.z;
....@@ -484,6 +486,12 @@
484486 {
485487 Object3D hip = get(0);
486488
489
+ if (toParent == null)
490
+ {
491
+ toParent = LA.newMatrix();
492
+ fromParent = LA.newMatrix();
493
+ }
494
+
487495 LA.matConcat(toParent, hip.get(0).toParent, matrix);
488496
489497 mocaporigin.x = matrix[3][0];
....@@ -495,6 +503,7 @@
495503 centroid.z = matrix[3][2];
496504 // this.getCentroid(centroid, true);
497505
506
+ CameraPane.CreateSelectedPoint();
498507 CameraPane.debugpointG.name = "";
499508 CameraPane.debugpointG.toParent[3][0] = mocaporigin.x;
500509 CameraPane.debugpointG.toParent[3][1] = mocaporigin.y;
....@@ -638,6 +647,24 @@
638647 // transient // aout 2013
639648 Object3D skeleton;
640649
650
+ void ExtractBigData(Object3D o)
651
+ {
652
+ super.ExtractBigData(o);
653
+
654
+ o.savebvh = this.bvh;
655
+ o.saveskeleton = this.skeleton;
656
+ this.bvh = null;
657
+ this.skeleton = null;
658
+ }
659
+
660
+ void RestoreBigData(Object3D o)
661
+ {
662
+ super.RestoreBigData(o);
663
+
664
+ this.bvh = o.savebvh;
665
+ this.skeleton = o.saveskeleton;
666
+ }
667
+
641668 boolean smoothed;
642669
643670 //boolean touched;
....@@ -664,8 +691,8 @@
664691 double targetdirx;
665692 double targetdirz;
666693
667
- double goalposx = -20;
668
- double goalposz = -10;
694
+ double goalposx = 0; // -20;
695
+ double goalposz = 0; // -10;
669696
670697 boolean followpath;
671698
....@@ -921,7 +948,7 @@
921948 // //GetFileRoot();
922949
923950 // sept 2014: //
924
- GrafreeD.RENDERME = 3; // patch for Merge objects
951
+ Grafreed.RENDERME = 3; // patch for Merge objects
925952 float[] thedata = bvh.animation.getBoneData(0);
926953
927954 os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]);
....@@ -1566,7 +1593,7 @@
15661593
15671594 lastsoundtime = Globals.framecount;
15681595
1569
- GrafreeD.hassound = true;
1596
+ Grafreed.hassound = true;
15701597 }
15711598 // else
15721599 // System.out.println("skipped");
....@@ -2797,7 +2824,8 @@
27972824 //if (bone._rotationEnabled)
27982825 if (//frame > 0 &&
27992826 !bone.skipmocap &&
2800
- !bone.name.contains("head") // &&
2827
+ !bone.name.contains("head") &&
2828
+ !bone.name.contains("Head") // &&
28012829 // !bone.name.contains("rFoot") &&
28022830 // !bone.name.contains("lFoot") &&
28032831 // !bone.name.contains("Pinky") &&
....@@ -3233,8 +3261,8 @@
32333261
32343262 // aout 2013 endframe = 0; // june 2013
32353263
3236
- //ResetZero();
3237
- setPose(frame);
3264
+ ResetZero();
3265
+ //setPose(frame);
32383266 }
32393267
32403268 static int mocapsupport = 0;
....@@ -3299,23 +3327,40 @@
32993327 // SetPositionDelta(false, true, false); // ?? false);
33003328 {
33013329 if (support == null)
3302
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3330
+ {
3331
+ if (bvh == null && new File(fullname).exists())
3332
+ ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3333
+ else
3334
+ {
3335
+ SetGlobalTransform();
3336
+ Rewind();
3337
+ Fade();
3338
+ }
3339
+ }
33033340 else
33043341 {
3305
- try
3306
- {
3342
+// try
3343
+// {
33073344 bvh = ((Mocap)support.get(mocapsupport++ % support.Size())).bvh;
33083345
33093346 // SetPositionDelta(false, true, true, true);
33103347 LoadData();
33113348 Rewind();
33123349 Fade();
3313
- }
3314
- catch (Exception e)
3315
- {
3316
- e.printStackTrace();
3317
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3318
- }
3350
+// }
3351
+// catch (Exception e)
3352
+// {
3353
+// System.err.println("An error occured while loading data. Use fallback by loading the file.");
3354
+// //e.printStackTrace();
3355
+// try
3356
+// {
3357
+// ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3358
+// }
3359
+// catch (Exception e2)
3360
+// {
3361
+// System.err.println("Motion file not found: " + fullname);
3362
+// }
3363
+// }
33193364 }
33203365 }
33213366
....@@ -3872,17 +3917,22 @@
38723917 // if (firstframe)
38733918 // return;
38743919
3875
- if (!restarted && /*display.restartframe &&*/
3876
- Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK
3920
+ if (//!restarted && /*display.restartframe &&*/
3921
+ Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE))
38773922 {
38783923 //display.restartframe = false;
38793924 restarted = true;
3925
+ //System.err.println("restarted = true");
38803926 Step();
38813927 }
38823928 else
38833929 {
3884
- if (Globals.isLIVE() && live && display.DrawMode() != display.SHADOW)
3930
+ //System.err.println("restarted");
3931
+ if (Globals.isLIVE() && live && display.DrawMode() != iCameraPane.SHADOW)
3932
+ {
38853933 restarted = false;
3934
+ //System.err.println("restarted = false");
3935
+ }
38863936 }
38873937
38883938 super.drawSelf(display, root, selected, blocked);