Normand Briere
2019-06-27 1807e7752960ac229cddd34b100e92cadbac9459
Mocap.java
....@@ -261,9 +261,9 @@
261261
262262 // LA.matConcat(toParent, hip.get(0).toParent, toParent);
263263
264
- CameraPane.debugpoint.toParent[3][0] = poship.x;
265
- CameraPane.debugpoint.toParent[3][1] = poship.y;
266
- CameraPane.debugpoint.toParent[3][2] = poship.z;
264
+ CameraPane.debugpointG.toParent[3][0] = poship.x;
265
+ CameraPane.debugpointG.toParent[3][1] = poship.y;
266
+ CameraPane.debugpointG.toParent[3][2] = poship.z;
267267
268268 LA.matInvert(toParent, fromParent);
269269
....@@ -283,28 +283,28 @@
283283 poship.x = hip.get(0).toParent[3][0];
284284 poship.y = hip.get(0).toParent[3][1];
285285 poship.z = hip.get(0).toParent[3][2];
286
+
287
+ temp.x = 1;
288
+ temp.y = 0;
289
+ temp.z = 0;
290
+
291
+ LA.xformDir(temp, hip.get(0).toParent, temp);
292
+
293
+ angleYhip = Math.atan2(-temp.z, temp.x);
286294
287
- // AT*AR = A'T*BT*A'R*BR
288
- //
289
- LA.matInvert(hip.get(0).toParent, matrix);
295
+ LA.matIdentity(matrix);
296
+ LA.matYRotate(matrix, angleYhip);
297
+ LA.matTranslate(matrix, poship.x, poship.y, poship.z);
298
+
299
+ //LA.matInvert(hip.get(0).toParent, matrix);
300
+ LA.matInvert(matrix, matrix);
290301
291302 //LA.matIdentity(matrix);
292303 //LA.matTranslate(matrix, -poship.x, -poship.y, -poship.z);
293304
294305 LA.matConcat(toParent, matrix, toParent);
295306
296
-// poship.x = hip.get(0).toParent[3][0];
297
-// poship.y = hip.get(0).toParent[3][1];
298
-// poship.z = hip.get(0).toParent[3][2];
299
-//
300
-// temp.x = 1;
301
-// temp.y = 0;
302
-// temp.z = 0;
303
-//
304
-// LA.xformDir(temp, hip.get(0).toParent, temp);
305
-//
306
-// angleYhip = Math.atan2(-temp.z, temp.x);
307
-
307
+
308308 LA.matConcat(toParent, hip.get(0).toParent, matrix);
309309 pos.x = hip.get(0).toParent[3][0];
310310 pos.y = hip.get(0).toParent[3][1];
....@@ -324,21 +324,21 @@
324324 // LA.matYRotate(toParent, angleY - angleYhip);
325325 // LA.matTranslate(toParent, pos.x - poship.x, pos.y - poship.y, pos.z - poship.z);
326326
327
- CameraPane.debugpoint2.toParent[3][0] = pos.x;
328
- CameraPane.debugpoint2.toParent[3][1] = pos.y;
329
- CameraPane.debugpoint2.toParent[3][2] = pos.z;
327
+ CameraPane.debugpointP.toParent[3][0] = pos.x;
328
+ CameraPane.debugpointP.toParent[3][1] = pos.y;
329
+ CameraPane.debugpointP.toParent[3][2] = pos.z;
330330
331
- CameraPane.debugpoint3.toParent[3][0] = poship.x;
332
- CameraPane.debugpoint3.toParent[3][1] = poship.y;
333
- CameraPane.debugpoint3.toParent[3][2] = poship.z;
331
+ CameraPane.debugpointC.toParent[3][0] = poship.x;
332
+ CameraPane.debugpointC.toParent[3][1] = poship.y;
333
+ CameraPane.debugpointC.toParent[3][2] = poship.z;
334334
335335 poship.x = toParent[3][0];
336336 poship.y = toParent[3][1];
337337 poship.z = toParent[3][2];
338338
339
- CameraPane.debugpoint4.toParent[3][0] = poship.x;
340
- CameraPane.debugpoint4.toParent[3][1] = poship.y;
341
- CameraPane.debugpoint4.toParent[3][2] = poship.z;
339
+ CameraPane.debugpointR.toParent[3][0] = poship.x;
340
+ CameraPane.debugpointR.toParent[3][1] = poship.y;
341
+ CameraPane.debugpointR.toParent[3][2] = poship.z;
342342
343343 LA.matInvert(toParent, fromParent);
344344 }
....@@ -476,6 +476,125 @@
476476 currenthip[i] = data[frame3 + i];
477477 }
478478 }
479
+
480
+ static cVector centroid = new cVector();
481
+ static cVector mocaporigin = new cVector();
482
+
483
+ void SetHipOrientation()
484
+ {
485
+ Object3D hip = get(0);
486
+
487
+ if (toParent == null)
488
+ {
489
+ toParent = LA.newMatrix();
490
+ fromParent = LA.newMatrix();
491
+ }
492
+
493
+ LA.matConcat(toParent, hip.get(0).toParent, matrix);
494
+
495
+ mocaporigin.x = matrix[3][0];
496
+ mocaporigin.y = matrix[3][1];
497
+ mocaporigin.z = matrix[3][2];
498
+
499
+ centroid.x = matrix[3][0];
500
+ centroid.y = matrix[3][1];
501
+ centroid.z = matrix[3][2];
502
+// this.getCentroid(centroid, true);
503
+
504
+ CameraPane.CreateSelectedPoint();
505
+ CameraPane.debugpointG.name = "";
506
+ CameraPane.debugpointG.toParent[3][0] = mocaporigin.x;
507
+ CameraPane.debugpointG.toParent[3][1] = mocaporigin.y;
508
+ CameraPane.debugpointG.toParent[3][2] = mocaporigin.z;
509
+
510
+ CameraPane.debugpointP.name = "";
511
+ CameraPane.debugpointP.toParent[3][0] = centroid.x;
512
+ CameraPane.debugpointP.toParent[3][1] = centroid.y;
513
+ CameraPane.debugpointP.toParent[3][2] = centroid.z;
514
+
515
+ cVector goal = GetGoal(centroid);
516
+ if (goal != null)
517
+ {
518
+ System.err.println("GOAL change (" + this + "): " + goal + " (was " + goalposx + ", " + goalposz + ")");
519
+
520
+ goalposx = goal.x;
521
+ goalposz = goal.z;
522
+ targetdirx = targetdirz = 0;
523
+ }
524
+
525
+ if (goalposx == 0 && goalposz == 0)
526
+ {
527
+ // No target
528
+ if (ScriptNode.speaker != null)
529
+ {
530
+ Object3D sourcenode = GetFileRoot();
531
+ Object3D speakernode = ScriptNode.speaker.GetFileRoot();
532
+
533
+ //System.err.println("speaker is " + speakernode + "; last was " + ScriptNode.lastspeaker);
534
+
535
+ Object3D speaker = ScriptNode.speaker;
536
+
537
+ if (speakernode == sourcenode)
538
+ {
539
+ if (ScriptNode.lastspeaker != null)
540
+ {
541
+ speakernode = ScriptNode.lastspeaker.GetFileRoot();
542
+ speaker = ScriptNode.lastspeaker;
543
+ }
544
+ else
545
+ return;
546
+ }
547
+
548
+ cVector dst = new cVector();
549
+
550
+ boolean success = speakernode.getCentroid(dst); // , true);
551
+
552
+ if (!success)
553
+ new Exception().printStackTrace();
554
+
555
+ //speakernode.parent.TransformToWorld(dst);
556
+ //sourcenode.parent.TransformToLocal(dst);
557
+ this.parent.TransformToLocal(dst);
558
+
559
+ goalposx = dst.x;
560
+ goalposz = dst.z;
561
+ }
562
+ else
563
+ return;
564
+ }
565
+
566
+ cVector temp = new cVector();
567
+
568
+ temp.x = 1;
569
+ temp.y = 0;
570
+ temp.z = 0;
571
+
572
+ LA.xformDir(temp, matrix, temp);
573
+
574
+ double angleYhip = Math.atan2(-temp.z, temp.x);
575
+
576
+ double angleYtarget = Math.atan2(goalposx - centroid.x, goalposz - centroid.z);
577
+
578
+ LA.matIdentity(matrix);
579
+ LA.matTranslate(matrix, -centroid.x, -centroid.y, -centroid.z);
580
+ double angle = CurveAngle(0, angleYtarget - angleYhip, 0.1f);
581
+ LA.matYRotate(matrix, angle);
582
+ LA.matTranslate(matrix, centroid.x, centroid.y, centroid.z);
583
+
584
+ LA.matConcat(matrix, toParent, toParent);
585
+
586
+ LA.matInvert(toParent, fromParent);
587
+
588
+ LA.matConcat(toParent, hip.get(0).toParent, matrix);
589
+
590
+ centroid.x = matrix[3][0];
591
+ centroid.y = matrix[3][1];
592
+ centroid.z = matrix[3][2];
593
+
594
+ double dist = LA.distance(centroid, mocaporigin);
595
+
596
+ CheckForAction(centroid);
597
+ }
479598
480599 void WriteTo(java.io.Writer writer) throws Exception
481600 {
....@@ -526,6 +645,24 @@
526645 // transient // aout 2013
527646 Object3D skeleton;
528647
648
+ void ExtractBigData(Object3D o)
649
+ {
650
+ super.ExtractBigData(o);
651
+
652
+ o.bvh = this.bvh;
653
+ o.skeleton = this.skeleton;
654
+ this.bvh = null;
655
+ this.skeleton = null;
656
+ }
657
+
658
+ void RestoreBigData(Object3D o)
659
+ {
660
+ super.RestoreBigData(o);
661
+
662
+ this.bvh = o.bvh;
663
+ this.skeleton = o.skeleton;
664
+ }
665
+
529666 boolean smoothed;
530667
531668 //boolean touched;
....@@ -549,11 +686,11 @@
549686 double pinx;
550687 double pinz;
551688
552
- double targetx;
553
- double targetz;
689
+ double targetdirx;
690
+ double targetdirz;
554691
555
- double goalx;
556
- double goalz;
692
+ double goalposx = 0; // -20;
693
+ double goalposz = 0; // -10;
557694
558695 boolean followpath;
559696
....@@ -624,7 +761,7 @@
624761 scriptactions.clear();
625762 }
626763
627
- static double EPSACTION = 0.1; // 0.075; // 0.1;
764
+ static double EPSACTION = 0.1; // 0.075; // 0.1;Came
628765
629766 void AddFromTo(cVector from, cVector to)
630767 {
....@@ -809,7 +946,7 @@
809946 // //GetFileRoot();
810947
811948 // sept 2014: //
812
- GrafreeD.RENDERME = 3; // patch for Merge objects
949
+ Grafreed.RENDERME = 3; // patch for Merge objects
813950 float[] thedata = bvh.animation.getBoneData(0);
814951
815952 os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]);
....@@ -910,6 +1047,8 @@
9101047 testvect.set(from);
9111048 testvect.sub(fromto.from);
9121049
1050
+ testvect.y = 0; // PATCH
1051
+
9131052 int factor = 1;
9141053
9151054 //if (CameraPane.FAST)
....@@ -951,6 +1090,8 @@
9511090
9521091 testvect.set(from);
9531092 testvect.sub(fromto.from);
1093
+
1094
+ testvect.y = 0; // PATCH
9541095
9551096 int factor = 1;
9561097
....@@ -1186,6 +1327,7 @@
11861327
11871328 void SetPosition(Object3D sourcenode, cVector floor, long floorid, cVector centroid)
11881329 {
1330
+ assert(false);
11891331 //assert(CameraPane.drawMode == CameraPane.SHADOW);
11901332
11911333 Object3D transformnode = new Object3D();
....@@ -1389,9 +1531,9 @@
13891531 groundid = floorid;
13901532
13911533 // green
1392
- CameraPane.debugpoint.toParent[3][0] = groundx;
1393
- CameraPane.debugpoint.toParent[3][1] = floor.y;
1394
- CameraPane.debugpoint.toParent[3][2] = groundz;
1534
+ CameraPane.debugpointG.toParent[3][0] = groundx;
1535
+ CameraPane.debugpointG.toParent[3][1] = floor.y;
1536
+ CameraPane.debugpointG.toParent[3][2] = groundz;
13951537
13961538 if (true) // slow && stepout && onein)
13971539 {
....@@ -1402,7 +1544,7 @@
14021544 // mywave = currentwave++;
14031545 // }
14041546 // sound
1405
- cVector eye = CameraPane.theRenderer.eyeCamera.location;
1547
+ cVector eye = Globals.theRenderer.EyeCamera().location;
14061548
14071549 // if (sourcenode.parent.parent != null)
14081550 // sourcenode.parent.parent.TransformToWorld(floor, tmp);
....@@ -1447,9 +1589,9 @@
14471589 //GraphreeD.
14481590 wav.play(volume * usedvolume); //, mywave);
14491591
1450
- lastsoundtime = CameraPane.framecount;
1592
+ lastsoundtime = Globals.framecount;
14511593
1452
- GrafreeD.hassound = true;
1594
+ Grafreed.hassound = true;
14531595 }
14541596 // else
14551597 // System.out.println("skipped");
....@@ -1468,9 +1610,9 @@
14681610
14691611 // System.out.println("Allo " + sourcenode);
14701612 // purple
1471
- CameraPane.debugpoint2.toParent[3][0] = floor.x;// + posx;
1472
- CameraPane.debugpoint2.toParent[3][1] = ground; // floor.y;// + sourcenode.parent.toParent[3][1];
1473
- CameraPane.debugpoint2.toParent[3][2] = floor.z;// + posz;
1613
+ CameraPane.debugpointP.toParent[3][0] = floor.x;// + posx;
1614
+ CameraPane.debugpointP.toParent[3][1] = ground; // floor.y;// + sourcenode.parent.toParent[3][1];
1615
+ CameraPane.debugpointP.toParent[3][2] = floor.z;// + posz;
14741616
14751617
14761618 if (false) // dist2 > 0.1)
....@@ -1536,9 +1678,9 @@
15361678 this.get(0).TransformToWorld(v0);
15371679
15381680 // cyan
1539
- CameraPane.debugpoint3.toParent[3][0] = v0.x;
1540
- CameraPane.debugpoint3.toParent[3][1] = ground;
1541
- CameraPane.debugpoint3.toParent[3][2] = v0.z;
1681
+ CameraPane.debugpointC.toParent[3][0] = v0.x;
1682
+ CameraPane.debugpointC.toParent[3][1] = ground;
1683
+ CameraPane.debugpointC.toParent[3][2] = v0.z;
15421684
15431685 LA.matConcat(sourcenode.toParent, transformnode.toParent, sourcenode.toParent);
15441686 LA.matInvert(sourcenode.toParent, sourcenode.fromParent);
....@@ -1548,9 +1690,9 @@
15481690 this.get(0).TransformToWorld(v0);
15491691
15501692 // red
1551
- CameraPane.debugpoint4.toParent[3][0] = v0.x;
1552
- CameraPane.debugpoint4.toParent[3][1] = ground;
1553
- CameraPane.debugpoint4.toParent[3][2] = v0.z;
1693
+ CameraPane.debugpointR.toParent[3][0] = v0.x;
1694
+ CameraPane.debugpointR.toParent[3][1] = ground;
1695
+ CameraPane.debugpointR.toParent[3][2] = v0.z;
15541696 }
15551697 }
15561698
....@@ -1590,11 +1732,11 @@
15901732
15911733 if (goal != null)
15921734 {
1593
- System.err.println("GOAL change (" + sourcenode + "): " + goal + " (was " + goalx + ", " + goalz + ")");
1735
+ System.err.println("GOAL change (" + sourcenode + "): " + goal + " (was " + goalposx + ", " + goalposz + ")");
15941736 //sourcenode.parent.parent.Dump();
1595
- goalx = goal.x;
1596
- goalz = goal.z;
1597
- targetx = targetz = 0;
1737
+ goalposx = goal.x;
1738
+ goalposz = goal.z;
1739
+ targetdirx = targetdirz = 0;
15981740
15991741 followpath = true;
16001742 }
....@@ -1645,16 +1787,16 @@
16451787 // }
16461788 if (false) // !uselast)
16471789 {
1648
- CameraPane.debugpoint.toParent[3][0] = dst.x;
1649
- CameraPane.debugpoint.toParent[3][1] = dst.y;
1650
- CameraPane.debugpoint.toParent[3][2] = dst.z;
1790
+ CameraPane.debugpointG.toParent[3][0] = dst.x;
1791
+ CameraPane.debugpointG.toParent[3][1] = dst.y;
1792
+ CameraPane.debugpointG.toParent[3][2] = dst.z;
16511793 }
16521794 }
16531795
1654
- if (goalx != 0 || goalz != 0) // TODO
1796
+ if (goalposx != 0 || goalposz != 0) // TODO
16551797 {
16561798 // overwrite speaker orientation
1657
- dst.set(goalx,0,goalz);
1799
+ dst.set(goalposx,0,goalposz);
16581800 if (sourcenode.parent != null) // july 2014
16591801 sourcenode.parent.
16601802 TransformToLocal(dst);
....@@ -1706,26 +1848,26 @@
17061848 // mars 2014
17071849 if (false) // goalx != 0 || goalz != 0)
17081850 {
1709
- targetx = dst.x - src.x;
1710
- targetz = dst.z - src.z;
1851
+ targetdirx = dst.x - src.x;
1852
+ targetdirz = dst.z - src.z;
17111853
1712
- if (Math.abs(targetx) > 0.1 || Math.abs(targetz) > 0.1)
1854
+ if (Math.abs(targetdirx) > 0.1 || Math.abs(targetdirz) > 0.1)
17131855 {
17141856 // far enough from goal. keep the goal position.
1715
- targetx = 0;
1716
- targetz = 0;
1857
+ targetdirx = 0;
1858
+ targetdirz = 0;
17171859 }
17181860 else
17191861 {
17201862 // too close to goal. switch to target direction instead.
1721
- goalx = 0;
1722
- goalz = 0;
1863
+ goalposx = 0;
1864
+ goalposz = 0;
17231865 }
17241866 }
17251867
17261868 //sourcenode.getCentroid(src, true);
17271869
1728
- if (speakernode == sourcenode && goalx == 0 && goalz == 0)
1870
+ if (speakernode == sourcenode && goalposx == 0 && goalposz == 0)
17291871 {
17301872 if (ScriptNode.lastspeaker != null)
17311873 new Exception().printStackTrace();
....@@ -1734,13 +1876,13 @@
17341876
17351877 // LA.xformPos(src, fromParent, src);
17361878
1737
- if ((ScriptNode.speaker != null && CameraPane.SPEAKERMOCAP || goalx != 0 || goalz != 0) && targetx == 0 && targetz == 0)
1879
+ if ((ScriptNode.speaker != null && CameraPane.SPEAKERMOCAP || goalposx != 0 || goalposz != 0) && targetdirx == 0 && targetdirz == 0)
17381880 dst.sub(src);
17391881 else
17401882 // vector mode
17411883 {
1742
- dst.x = targetx;
1743
- dst.z = targetz;
1884
+ dst.x = targetdirx;
1885
+ dst.z = targetdirz;
17441886
17451887 // TEST TARGET
17461888 // dst.x = CameraPane.selectedpoint.toParent[3][0];
....@@ -2150,7 +2292,7 @@
21502292 }
21512293
21522294 if (!smoothed)
2153
- for (int i=0; --i>=0;)
2295
+ for (int i=10; --i>=0;)
21542296 SmoothAnimData(); // much reduces shakiness
21552297
21562298 smoothed = true;
....@@ -2188,9 +2330,16 @@
21882330 toVector.x = LA.cos(to);
21892331 toVector.y = LA.sin(to);
21902332
2333
+ double fromA = Math.atan2(fromVector.y, fromVector.x);
2334
+ double toA = Math.atan2(toVector.y, toVector.x);
2335
+
21912336 Vector2d currentVector = Slerp(fromVector, toVector, step);
21922337
2193
- return Math.atan2(currentVector.y, currentVector.x);
2338
+ double angle = Math.atan2(currentVector.y, currentVector.x);
2339
+
2340
+ double angle2 = (1-step) * fromA + step * toA;
2341
+
2342
+ return angle;
21942343 }
21952344
21962345 public static Vector2d Slerp(Vector2d from, Vector2d to, double step)
....@@ -2242,6 +2391,8 @@
22422391 {
22432392 e.printStackTrace();
22442393 }
2394
+
2395
+ SetHipOrientation();
22452396
22462397 if (true)
22472398 return;
....@@ -2670,8 +2821,9 @@
26702821 // set rotation
26712822 //if (bone._rotationEnabled)
26722823 if (//frame > 0 &&
2673
- !bone.skipmocap //&&
2674
- //!bone.name.contains("head") &&
2824
+ !bone.skipmocap &&
2825
+ !bone.name.contains("head") &&
2826
+ !bone.name.contains("Head") // &&
26752827 // !bone.name.contains("rFoot") &&
26762828 // !bone.name.contains("lFoot") &&
26772829 // !bone.name.contains("Pinky") &&
....@@ -3056,8 +3208,8 @@
30563208
30573209 void Reset()
30583210 {
3059
- if (fullname != null)
3060
- ReadBVH();
3211
+// if (fullname != null)
3212
+// ReadBVH();
30613213
30623214 Object3D hip = get(0);
30633215
....@@ -3096,8 +3248,8 @@
30963248 // LA.matIdentity(rot.fromParent);
30973249
30983250 // july 2014
3099
- goalx = goalz = 0;
3100
- targetx = targetz = 0;
3251
+// goalx = goalz = 0;
3252
+ targetdirx = targetdirz = 0;
31013253
31023254 //SetPositionDelta(true, true, true, false);
31033255 // LoadData();
....@@ -3107,8 +3259,8 @@
31073259
31083260 // aout 2013 endframe = 0; // june 2013
31093261
3110
- //ResetZero();
3111
- setPose(frame);
3262
+ ResetZero();
3263
+ //setPose(frame);
31123264 }
31133265
31143266 static int mocapsupport = 0;
....@@ -3126,12 +3278,13 @@
31263278
31273279 int step = 1;
31283280
3281
+ // patch for running hare
31293282 if (speedup) // fev 2014
31303283 step *= 2; // 4;
31313284 if (rewind) // mars 2014
31323285 step *= 4;
31333286
3134
- if (CameraPane.FAST) // && !CameraPane.HOLD)
3287
+ //if (CameraPane.FAST) // && !CameraPane.HOLD)
31353288 step *= CameraPane.STEP;
31363289
31373290 //System.err.println("Step Mocap frame # " + frame);
....@@ -3163,7 +3316,7 @@
31633316 "; fullname = " + fullname);
31643317
31653318 //int delta = frame - baseframe;
3166
- if (CameraPane.CROWD)
3319
+ if (Globals.CROWD)
31673320 {
31683321 baseframe = GetFirstFrame(); // 0 initial point
31693322 }
....@@ -3172,23 +3325,40 @@
31723325 // SetPositionDelta(false, true, false); // ?? false);
31733326 {
31743327 if (support == null)
3175
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3328
+ {
3329
+ if (bvh == null && new File(fullname).exists())
3330
+ ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3331
+ else
3332
+ {
3333
+ SetGlobalTransform();
3334
+ Rewind();
3335
+ Fade();
3336
+ }
3337
+ }
31763338 else
31773339 {
3178
- try
3179
- {
3340
+// try
3341
+// {
31803342 bvh = ((Mocap)support.get(mocapsupport++ % support.Size())).bvh;
31813343
31823344 // SetPositionDelta(false, true, true, true);
31833345 LoadData();
31843346 Rewind();
31853347 Fade();
3186
- }
3187
- catch (Exception e)
3188
- {
3189
- e.printStackTrace();
3190
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3191
- }
3348
+// }
3349
+// catch (Exception e)
3350
+// {
3351
+// System.err.println("An error occured while loading data. Use fallback by loading the file.");
3352
+// //e.printStackTrace();
3353
+// try
3354
+// {
3355
+// ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3356
+// }
3357
+// catch (Exception e2)
3358
+// {
3359
+// System.err.println("Motion file not found: " + fullname);
3360
+// }
3361
+// }
31923362 }
31933363 }
31943364
....@@ -3370,6 +3540,7 @@
33703540 // filters out bad input data
33713541 void FilterAnimData()
33723542 {
3543
+ new Exception().printStackTrace();
33733544 System.exit(0);
33743545
33753546 float[] data; // = bvh.animation.getBoneData(0);
....@@ -3727,7 +3898,7 @@
37273898
37283899 transient boolean restarted; // CROWD issue?
37293900
3730
- void drawSelf(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
3901
+ void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
37313902 {
37323903 //System.err.println("drawSelf Mocap frame # " + frame);
37333904 //System.err.println("drawSelf Mocap baseframe # " + baseframe);
....@@ -3744,17 +3915,22 @@
37443915 // if (firstframe)
37453916 // return;
37463917
3747
- if (!restarted && /*display.restartframe &&*/
3748
- display.isLIVE() && live && display.drawMode == display.SHADOW) // FUCK
3918
+ if (//!restarted && /*display.restartframe &&*/
3919
+ Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE))
37493920 {
37503921 //display.restartframe = false;
37513922 restarted = true;
3923
+ //System.err.println("restarted = true");
37523924 Step();
37533925 }
37543926 else
37553927 {
3756
- if (display.isLIVE() && live && display.drawMode != display.SHADOW)
3928
+ //System.err.println("restarted");
3929
+ if (Globals.isLIVE() && live && display.DrawMode() != iCameraPane.SHADOW)
3930
+ {
37573931 restarted = false;
3932
+ //System.err.println("restarted = false");
3933
+ }
37583934 }
37593935
37603936 super.drawSelf(display, root, selected, blocked);