Normand Briere
2019-06-16 372b7fd481a476cd659713a4a01bf28bf6760cbe
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,124 @@
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.debugpointG.name = "";
505
+ CameraPane.debugpointG.toParent[3][0] = mocaporigin.x;
506
+ CameraPane.debugpointG.toParent[3][1] = mocaporigin.y;
507
+ CameraPane.debugpointG.toParent[3][2] = mocaporigin.z;
508
+
509
+ CameraPane.debugpointP.name = "";
510
+ CameraPane.debugpointP.toParent[3][0] = centroid.x;
511
+ CameraPane.debugpointP.toParent[3][1] = centroid.y;
512
+ CameraPane.debugpointP.toParent[3][2] = centroid.z;
513
+
514
+ cVector goal = GetGoal(centroid);
515
+ if (goal != null)
516
+ {
517
+ System.err.println("GOAL change (" + this + "): " + goal + " (was " + goalposx + ", " + goalposz + ")");
518
+
519
+ goalposx = goal.x;
520
+ goalposz = goal.z;
521
+ targetdirx = targetdirz = 0;
522
+ }
523
+
524
+ if (goalposx == 0 && goalposz == 0)
525
+ {
526
+ // No target
527
+ if (ScriptNode.speaker != null)
528
+ {
529
+ Object3D sourcenode = GetFileRoot();
530
+ Object3D speakernode = ScriptNode.speaker.GetFileRoot();
531
+
532
+ //System.err.println("speaker is " + speakernode + "; last was " + ScriptNode.lastspeaker);
533
+
534
+ Object3D speaker = ScriptNode.speaker;
535
+
536
+ if (speakernode == sourcenode)
537
+ {
538
+ if (ScriptNode.lastspeaker != null)
539
+ {
540
+ speakernode = ScriptNode.lastspeaker.GetFileRoot();
541
+ speaker = ScriptNode.lastspeaker;
542
+ }
543
+ else
544
+ return;
545
+ }
546
+
547
+ cVector dst = new cVector();
548
+
549
+ boolean success = speakernode.getCentroid(dst); // , true);
550
+
551
+ if (!success)
552
+ new Exception().printStackTrace();
553
+
554
+ //speakernode.parent.TransformToWorld(dst);
555
+ //sourcenode.parent.TransformToLocal(dst);
556
+ this.parent.TransformToLocal(dst);
557
+
558
+ goalposx = dst.x;
559
+ goalposz = dst.z;
560
+ }
561
+ else
562
+ return;
563
+ }
564
+
565
+ cVector temp = new cVector();
566
+
567
+ temp.x = 1;
568
+ temp.y = 0;
569
+ temp.z = 0;
570
+
571
+ LA.xformDir(temp, matrix, temp);
572
+
573
+ double angleYhip = Math.atan2(-temp.z, temp.x);
574
+
575
+ double angleYtarget = Math.atan2(goalposx - centroid.x, goalposz - centroid.z);
576
+
577
+ LA.matIdentity(matrix);
578
+ LA.matTranslate(matrix, -centroid.x, -centroid.y, -centroid.z);
579
+ double angle = CurveAngle(0, angleYtarget - angleYhip, 0.1f);
580
+ LA.matYRotate(matrix, angle);
581
+ LA.matTranslate(matrix, centroid.x, centroid.y, centroid.z);
582
+
583
+ LA.matConcat(matrix, toParent, toParent);
584
+
585
+ LA.matInvert(toParent, fromParent);
586
+
587
+ LA.matConcat(toParent, hip.get(0).toParent, matrix);
588
+
589
+ centroid.x = matrix[3][0];
590
+ centroid.y = matrix[3][1];
591
+ centroid.z = matrix[3][2];
592
+
593
+ double dist = LA.distance(centroid, mocaporigin);
594
+
595
+ CheckForAction(centroid);
596
+ }
479597
480598 void WriteTo(java.io.Writer writer) throws Exception
481599 {
....@@ -526,6 +644,24 @@
526644 // transient // aout 2013
527645 Object3D skeleton;
528646
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
+
529665 boolean smoothed;
530666
531667 //boolean touched;
....@@ -549,11 +685,11 @@
549685 double pinx;
550686 double pinz;
551687
552
- double targetx;
553
- double targetz;
688
+ double targetdirx;
689
+ double targetdirz;
554690
555
- double goalx;
556
- double goalz;
691
+ double goalposx = 0; // -20;
692
+ double goalposz = 0; // -10;
557693
558694 boolean followpath;
559695
....@@ -624,7 +760,7 @@
624760 scriptactions.clear();
625761 }
626762
627
- static double EPSACTION = 0.1; // 0.075; // 0.1;
763
+ static double EPSACTION = 0.1; // 0.075; // 0.1;Came
628764
629765 void AddFromTo(cVector from, cVector to)
630766 {
....@@ -809,7 +945,7 @@
809945 // //GetFileRoot();
810946
811947 // sept 2014: //
812
- GrafreeD.RENDERME = 3; // patch for Merge objects
948
+ Grafreed.RENDERME = 3; // patch for Merge objects
813949 float[] thedata = bvh.animation.getBoneData(0);
814950
815951 os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]);
....@@ -910,6 +1046,8 @@
9101046 testvect.set(from);
9111047 testvect.sub(fromto.from);
9121048
1049
+ testvect.y = 0; // PATCH
1050
+
9131051 int factor = 1;
9141052
9151053 //if (CameraPane.FAST)
....@@ -951,6 +1089,8 @@
9511089
9521090 testvect.set(from);
9531091 testvect.sub(fromto.from);
1092
+
1093
+ testvect.y = 0; // PATCH
9541094
9551095 int factor = 1;
9561096
....@@ -1186,6 +1326,7 @@
11861326
11871327 void SetPosition(Object3D sourcenode, cVector floor, long floorid, cVector centroid)
11881328 {
1329
+ assert(false);
11891330 //assert(CameraPane.drawMode == CameraPane.SHADOW);
11901331
11911332 Object3D transformnode = new Object3D();
....@@ -1389,9 +1530,9 @@
13891530 groundid = floorid;
13901531
13911532 // green
1392
- CameraPane.debugpoint.toParent[3][0] = groundx;
1393
- CameraPane.debugpoint.toParent[3][1] = floor.y;
1394
- CameraPane.debugpoint.toParent[3][2] = groundz;
1533
+ CameraPane.debugpointG.toParent[3][0] = groundx;
1534
+ CameraPane.debugpointG.toParent[3][1] = floor.y;
1535
+ CameraPane.debugpointG.toParent[3][2] = groundz;
13951536
13961537 if (true) // slow && stepout && onein)
13971538 {
....@@ -1402,7 +1543,7 @@
14021543 // mywave = currentwave++;
14031544 // }
14041545 // sound
1405
- cVector eye = CameraPane.theRenderer.eyeCamera.location;
1546
+ cVector eye = Globals.theRenderer.EyeCamera().location;
14061547
14071548 // if (sourcenode.parent.parent != null)
14081549 // sourcenode.parent.parent.TransformToWorld(floor, tmp);
....@@ -1447,9 +1588,9 @@
14471588 //GraphreeD.
14481589 wav.play(volume * usedvolume); //, mywave);
14491590
1450
- lastsoundtime = CameraPane.framecount;
1591
+ lastsoundtime = Globals.framecount;
14511592
1452
- GrafreeD.hassound = true;
1593
+ Grafreed.hassound = true;
14531594 }
14541595 // else
14551596 // System.out.println("skipped");
....@@ -1468,9 +1609,9 @@
14681609
14691610 // System.out.println("Allo " + sourcenode);
14701611 // 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;
1612
+ CameraPane.debugpointP.toParent[3][0] = floor.x;// + posx;
1613
+ CameraPane.debugpointP.toParent[3][1] = ground; // floor.y;// + sourcenode.parent.toParent[3][1];
1614
+ CameraPane.debugpointP.toParent[3][2] = floor.z;// + posz;
14741615
14751616
14761617 if (false) // dist2 > 0.1)
....@@ -1536,9 +1677,9 @@
15361677 this.get(0).TransformToWorld(v0);
15371678
15381679 // cyan
1539
- CameraPane.debugpoint3.toParent[3][0] = v0.x;
1540
- CameraPane.debugpoint3.toParent[3][1] = ground;
1541
- CameraPane.debugpoint3.toParent[3][2] = v0.z;
1680
+ CameraPane.debugpointC.toParent[3][0] = v0.x;
1681
+ CameraPane.debugpointC.toParent[3][1] = ground;
1682
+ CameraPane.debugpointC.toParent[3][2] = v0.z;
15421683
15431684 LA.matConcat(sourcenode.toParent, transformnode.toParent, sourcenode.toParent);
15441685 LA.matInvert(sourcenode.toParent, sourcenode.fromParent);
....@@ -1548,9 +1689,9 @@
15481689 this.get(0).TransformToWorld(v0);
15491690
15501691 // red
1551
- CameraPane.debugpoint4.toParent[3][0] = v0.x;
1552
- CameraPane.debugpoint4.toParent[3][1] = ground;
1553
- CameraPane.debugpoint4.toParent[3][2] = v0.z;
1692
+ CameraPane.debugpointR.toParent[3][0] = v0.x;
1693
+ CameraPane.debugpointR.toParent[3][1] = ground;
1694
+ CameraPane.debugpointR.toParent[3][2] = v0.z;
15541695 }
15551696 }
15561697
....@@ -1590,11 +1731,11 @@
15901731
15911732 if (goal != null)
15921733 {
1593
- System.err.println("GOAL change (" + sourcenode + "): " + goal + " (was " + goalx + ", " + goalz + ")");
1734
+ System.err.println("GOAL change (" + sourcenode + "): " + goal + " (was " + goalposx + ", " + goalposz + ")");
15941735 //sourcenode.parent.parent.Dump();
1595
- goalx = goal.x;
1596
- goalz = goal.z;
1597
- targetx = targetz = 0;
1736
+ goalposx = goal.x;
1737
+ goalposz = goal.z;
1738
+ targetdirx = targetdirz = 0;
15981739
15991740 followpath = true;
16001741 }
....@@ -1645,16 +1786,16 @@
16451786 // }
16461787 if (false) // !uselast)
16471788 {
1648
- CameraPane.debugpoint.toParent[3][0] = dst.x;
1649
- CameraPane.debugpoint.toParent[3][1] = dst.y;
1650
- CameraPane.debugpoint.toParent[3][2] = dst.z;
1789
+ CameraPane.debugpointG.toParent[3][0] = dst.x;
1790
+ CameraPane.debugpointG.toParent[3][1] = dst.y;
1791
+ CameraPane.debugpointG.toParent[3][2] = dst.z;
16511792 }
16521793 }
16531794
1654
- if (goalx != 0 || goalz != 0) // TODO
1795
+ if (goalposx != 0 || goalposz != 0) // TODO
16551796 {
16561797 // overwrite speaker orientation
1657
- dst.set(goalx,0,goalz);
1798
+ dst.set(goalposx,0,goalposz);
16581799 if (sourcenode.parent != null) // july 2014
16591800 sourcenode.parent.
16601801 TransformToLocal(dst);
....@@ -1706,26 +1847,26 @@
17061847 // mars 2014
17071848 if (false) // goalx != 0 || goalz != 0)
17081849 {
1709
- targetx = dst.x - src.x;
1710
- targetz = dst.z - src.z;
1850
+ targetdirx = dst.x - src.x;
1851
+ targetdirz = dst.z - src.z;
17111852
1712
- if (Math.abs(targetx) > 0.1 || Math.abs(targetz) > 0.1)
1853
+ if (Math.abs(targetdirx) > 0.1 || Math.abs(targetdirz) > 0.1)
17131854 {
17141855 // far enough from goal. keep the goal position.
1715
- targetx = 0;
1716
- targetz = 0;
1856
+ targetdirx = 0;
1857
+ targetdirz = 0;
17171858 }
17181859 else
17191860 {
17201861 // too close to goal. switch to target direction instead.
1721
- goalx = 0;
1722
- goalz = 0;
1862
+ goalposx = 0;
1863
+ goalposz = 0;
17231864 }
17241865 }
17251866
17261867 //sourcenode.getCentroid(src, true);
17271868
1728
- if (speakernode == sourcenode && goalx == 0 && goalz == 0)
1869
+ if (speakernode == sourcenode && goalposx == 0 && goalposz == 0)
17291870 {
17301871 if (ScriptNode.lastspeaker != null)
17311872 new Exception().printStackTrace();
....@@ -1734,13 +1875,13 @@
17341875
17351876 // LA.xformPos(src, fromParent, src);
17361877
1737
- if ((ScriptNode.speaker != null && CameraPane.SPEAKERMOCAP || goalx != 0 || goalz != 0) && targetx == 0 && targetz == 0)
1878
+ if ((ScriptNode.speaker != null && CameraPane.SPEAKERMOCAP || goalposx != 0 || goalposz != 0) && targetdirx == 0 && targetdirz == 0)
17381879 dst.sub(src);
17391880 else
17401881 // vector mode
17411882 {
1742
- dst.x = targetx;
1743
- dst.z = targetz;
1883
+ dst.x = targetdirx;
1884
+ dst.z = targetdirz;
17441885
17451886 // TEST TARGET
17461887 // dst.x = CameraPane.selectedpoint.toParent[3][0];
....@@ -2150,7 +2291,7 @@
21502291 }
21512292
21522293 if (!smoothed)
2153
- for (int i=0; --i>=0;)
2294
+ for (int i=10; --i>=0;)
21542295 SmoothAnimData(); // much reduces shakiness
21552296
21562297 smoothed = true;
....@@ -2188,9 +2329,16 @@
21882329 toVector.x = LA.cos(to);
21892330 toVector.y = LA.sin(to);
21902331
2332
+ double fromA = Math.atan2(fromVector.y, fromVector.x);
2333
+ double toA = Math.atan2(toVector.y, toVector.x);
2334
+
21912335 Vector2d currentVector = Slerp(fromVector, toVector, step);
21922336
2193
- return Math.atan2(currentVector.y, currentVector.x);
2337
+ double angle = Math.atan2(currentVector.y, currentVector.x);
2338
+
2339
+ double angle2 = (1-step) * fromA + step * toA;
2340
+
2341
+ return angle;
21942342 }
21952343
21962344 public static Vector2d Slerp(Vector2d from, Vector2d to, double step)
....@@ -2242,6 +2390,8 @@
22422390 {
22432391 e.printStackTrace();
22442392 }
2393
+
2394
+ SetHipOrientation();
22452395
22462396 if (true)
22472397 return;
....@@ -2670,8 +2820,9 @@
26702820 // set rotation
26712821 //if (bone._rotationEnabled)
26722822 if (//frame > 0 &&
2673
- !bone.skipmocap //&&
2674
- //!bone.name.contains("head") &&
2823
+ !bone.skipmocap &&
2824
+ !bone.name.contains("head") &&
2825
+ !bone.name.contains("Head") // &&
26752826 // !bone.name.contains("rFoot") &&
26762827 // !bone.name.contains("lFoot") &&
26772828 // !bone.name.contains("Pinky") &&
....@@ -3096,8 +3247,8 @@
30963247 // LA.matIdentity(rot.fromParent);
30973248
30983249 // july 2014
3099
- goalx = goalz = 0;
3100
- targetx = targetz = 0;
3250
+// goalx = goalz = 0;
3251
+ targetdirx = targetdirz = 0;
31013252
31023253 //SetPositionDelta(true, true, true, false);
31033254 // LoadData();
....@@ -3107,8 +3258,8 @@
31073258
31083259 // aout 2013 endframe = 0; // june 2013
31093260
3110
- //ResetZero();
3111
- setPose(frame);
3261
+ ResetZero();
3262
+ //setPose(frame);
31123263 }
31133264
31143265 static int mocapsupport = 0;
....@@ -3126,12 +3277,13 @@
31263277
31273278 int step = 1;
31283279
3280
+ // patch for running hare
31293281 if (speedup) // fev 2014
31303282 step *= 2; // 4;
31313283 if (rewind) // mars 2014
31323284 step *= 4;
31333285
3134
- if (CameraPane.FAST) // && !CameraPane.HOLD)
3286
+ //if (CameraPane.FAST) // && !CameraPane.HOLD)
31353287 step *= CameraPane.STEP;
31363288
31373289 //System.err.println("Step Mocap frame # " + frame);
....@@ -3163,7 +3315,7 @@
31633315 "; fullname = " + fullname);
31643316
31653317 //int delta = frame - baseframe;
3166
- if (CameraPane.CROWD)
3318
+ if (Globals.CROWD)
31673319 {
31683320 baseframe = GetFirstFrame(); // 0 initial point
31693321 }
....@@ -3172,23 +3324,40 @@
31723324 // SetPositionDelta(false, true, false); // ?? false);
31733325 {
31743326 if (support == null)
3175
- 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
+ }
31763337 else
31773338 {
3178
- try
3179
- {
3339
+// try
3340
+// {
31803341 bvh = ((Mocap)support.get(mocapsupport++ % support.Size())).bvh;
31813342
31823343 // SetPositionDelta(false, true, true, true);
31833344 LoadData();
31843345 Rewind();
31853346 Fade();
3186
- }
3187
- catch (Exception e)
3188
- {
3189
- e.printStackTrace();
3190
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3191
- }
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
+// }
31923361 }
31933362 }
31943363
....@@ -3370,6 +3539,7 @@
33703539 // filters out bad input data
33713540 void FilterAnimData()
33723541 {
3542
+ new Exception().printStackTrace();
33733543 System.exit(0);
33743544
33753545 float[] data; // = bvh.animation.getBoneData(0);
....@@ -3727,7 +3897,7 @@
37273897
37283898 transient boolean restarted; // CROWD issue?
37293899
3730
- void drawSelf(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
3900
+ void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
37313901 {
37323902 //System.err.println("drawSelf Mocap frame # " + frame);
37333903 //System.err.println("drawSelf Mocap baseframe # " + baseframe);
....@@ -3744,17 +3914,22 @@
37443914 // if (firstframe)
37453915 // return;
37463916
3747
- if (!restarted && /*display.restartframe &&*/
3748
- display.isLIVE() && live && display.drawMode == display.SHADOW) // FUCK
3917
+ if (//!restarted && /*display.restartframe &&*/
3918
+ Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW))
37493919 {
37503920 //display.restartframe = false;
37513921 restarted = true;
3922
+ //System.err.println("restarted = true");
37523923 Step();
37533924 }
37543925 else
37553926 {
3756
- if (display.isLIVE() && live && display.drawMode != display.SHADOW)
3927
+ //System.err.println("restarted");
3928
+ if (Globals.isLIVE() && live && display.DrawMode() != iCameraPane.SHADOW)
3929
+ {
37573930 restarted = false;
3931
+ //System.err.println("restarted = false");
3932
+ }
37583933 }
37593934
37603935 super.drawSelf(display, root, selected, blocked);