Normand Briere
2019-11-17 cb37a129d1adb403019c96e798e86e2da9667f15
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;
....@@ -501,6 +503,7 @@
501503 centroid.z = matrix[3][2];
502504 // this.getCentroid(centroid, true);
503505
506
+ CameraPane.CreateSelectedPoint();
504507 CameraPane.debugpointG.name = "";
505508 CameraPane.debugpointG.toParent[3][0] = mocaporigin.x;
506509 CameraPane.debugpointG.toParent[3][1] = mocaporigin.y;
....@@ -643,6 +646,24 @@
643646
644647 // transient // aout 2013
645648 Object3D skeleton;
649
+
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
+ }
646667
647668 boolean smoothed;
648669
....@@ -977,7 +998,7 @@
977998
978999 get(0).link2master = path.size() > 1; // hip orientation
9791000
980
- if (get(0).link2master)
1001
+ if (get(0).Link2Support())
9811002 {
9821003 rotateonce = 2;
9831004 }
....@@ -1406,7 +1427,7 @@
14061427 double w = 0.00015;
14071428
14081429 //if (!sourcenode.link2master) // strong pin on floor
1409
- if (parent.link2master) // strong pin on floor
1430
+ if (parent.Link2Support()) // strong pin on floor
14101431 {
14111432 w = 0.005; // .001;
14121433 }
....@@ -1620,7 +1641,7 @@
16201641 // sourcenode.parent.toParent[3][1] = ground - floor.y;
16211642 // sourcenode.parent.toParent[3][2] += groundz - floor.z;
16221643 // sourcenode.parent.toParent[3][1] = K * (ground - floor.y) + (1 - K) * oldposy;
1623
- if (footcontact && (sourcenode.parent != null && !sourcenode.parent.link2master)) // strong pin on floor
1644
+ if (footcontact && (sourcenode.parent != null && !sourcenode.parent.Link2Support())) // strong pin on floor
16241645 {
16251646 v0.x = groundx - floor.x;
16261647 v0.y = 0; // groundx - floor.x;
....@@ -1985,7 +2006,7 @@
19852006 // if (sourcenode.link2master)
19862007 // if (goalx != 0 || goalz != 0)
19872008 // K = 0.02; // .0625;
1988
- if (parent.link2master) // strong pin on floor
2009
+ if (parent.Link2Support()) // strong pin on floor
19892010 {
19902011 K = 0.05; // 0.02;
19912012 }
....@@ -2402,9 +2423,9 @@
24022423 // SetBreakPoint(get(0).toParent[0], 0);
24032424 // }
24042425
2405
- boolean setrotation = get(0).link2master && !firsttimeafterload && frame > 0;
2426
+ boolean setrotation = get(0).Link2Support() && !firsttimeafterload && frame > 0;
24062427 boolean setposition = sourcenode != null && // sourcenode.parent != null && // july 2014
2407
- sourcenode./*parent.*/link2master && !firsttimeafterload && frame > 0;
2428
+ sourcenode./*parent.*/Link2Support() && !firsttimeafterload && frame > 0;
24082429
24092430 // cVector centroid = new cVector();
24102431 // cVector floor = new cVector();
....@@ -2837,7 +2858,7 @@
28372858
28382859 // set translation
28392860 // (currently only possible for root bone! see mocapdata.com data)
2840
- if (bone._isRoot && link2master) // && !GetFileRoot().link2master)
2861
+ if (bone._isRoot && Link2Support()) // && !GetFileRoot().link2master)
28412862 {
28422863 if (hasTranslation) // && _translationEnabled)
28432864 {
....@@ -3897,12 +3918,14 @@
38973918 // return;
38983919
38993920 if (//!restarted && /*display.restartframe &&*/
3900
- Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW))
3921
+ Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE))
39013922 {
39023923 //display.restartframe = false;
39033924 restarted = true;
39043925 //System.err.println("restarted = true");
39053926 Step();
3927
+
3928
+ Globals.lighttouched = true;
39063929 }
39073930 else
39083931 {
....@@ -3971,6 +3994,11 @@
39713994 // GetObject().release(i);
39723995 }
39733996
3997
+ boolean HasBigData()
3998
+ {
3999
+ return skeleton != null;
4000
+ }
4001
+
39744002 public Object3D get(int i)
39754003 {
39764004 if (i != 0)