Normand Briere
2019-05-05 f69d25e4682ca33edfc8cfad26187050f4eb558a
Mocap.java
....@@ -921,7 +921,7 @@
921921 // //GetFileRoot();
922922
923923 // sept 2014: //
924
- GrafreeD.RENDERME = 3; // patch for Merge objects
924
+ Grafreed.RENDERME = 3; // patch for Merge objects
925925 float[] thedata = bvh.animation.getBoneData(0);
926926
927927 os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]);
....@@ -1519,7 +1519,7 @@
15191519 // mywave = currentwave++;
15201520 // }
15211521 // sound
1522
- cVector eye = CameraPane.theRenderer.eyeCamera.location;
1522
+ cVector eye = Globals.theRenderer.EyeCamera().location;
15231523
15241524 // if (sourcenode.parent.parent != null)
15251525 // sourcenode.parent.parent.TransformToWorld(floor, tmp);
....@@ -1564,9 +1564,9 @@
15641564 //GraphreeD.
15651565 wav.play(volume * usedvolume); //, mywave);
15661566
1567
- lastsoundtime = CameraPane.framecount;
1567
+ lastsoundtime = Globals.framecount;
15681568
1569
- GrafreeD.hassound = true;
1569
+ Grafreed.hassound = true;
15701570 }
15711571 // else
15721572 // System.out.println("skipped");
....@@ -2267,7 +2267,7 @@
22672267 }
22682268
22692269 if (!smoothed)
2270
- for (int i=0; --i>=0;)
2270
+ for (int i=10; --i>=0;)
22712271 SmoothAnimData(); // much reduces shakiness
22722272
22732273 smoothed = true;
....@@ -3252,12 +3252,13 @@
32523252
32533253 int step = 1;
32543254
3255
+ // patch for running hare
32553256 if (speedup) // fev 2014
32563257 step *= 2; // 4;
32573258 if (rewind) // mars 2014
32583259 step *= 4;
32593260
3260
- if (CameraPane.FAST) // && !CameraPane.HOLD)
3261
+ //if (CameraPane.FAST) // && !CameraPane.HOLD)
32613262 step *= CameraPane.STEP;
32623263
32633264 //System.err.println("Step Mocap frame # " + frame);
....@@ -3289,7 +3290,7 @@
32893290 "; fullname = " + fullname);
32903291
32913292 //int delta = frame - baseframe;
3292
- if (CameraPane.CROWD)
3293
+ if (Globals.CROWD)
32933294 {
32943295 baseframe = GetFirstFrame(); // 0 initial point
32953296 }
....@@ -3298,23 +3299,40 @@
32983299 // SetPositionDelta(false, true, false); // ?? false);
32993300 {
33003301 if (support == null)
3301
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3302
+ {
3303
+ if (new File(fullname).exists())
3304
+ ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3305
+ else
3306
+ {
3307
+ SetGlobalTransform();
3308
+ Rewind();
3309
+ Fade();
3310
+ }
3311
+ }
33023312 else
33033313 {
3304
- try
3305
- {
3314
+// try
3315
+// {
33063316 bvh = ((Mocap)support.get(mocapsupport++ % support.Size())).bvh;
33073317
33083318 // SetPositionDelta(false, true, true, true);
33093319 LoadData();
33103320 Rewind();
33113321 Fade();
3312
- }
3313
- catch (Exception e)
3314
- {
3315
- e.printStackTrace();
3316
- ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3317
- }
3322
+// }
3323
+// catch (Exception e)
3324
+// {
3325
+// System.err.println("An error occured while loading data. Use fallback by loading the file.");
3326
+// //e.printStackTrace();
3327
+// try
3328
+// {
3329
+// ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest);
3330
+// }
3331
+// catch (Exception e2)
3332
+// {
3333
+// System.err.println("Motion file not found: " + fullname);
3334
+// }
3335
+// }
33183336 }
33193337 }
33203338
....@@ -3496,6 +3514,7 @@
34963514 // filters out bad input data
34973515 void FilterAnimData()
34983516 {
3517
+ new Exception().printStackTrace();
34993518 System.exit(0);
35003519
35013520 float[] data; // = bvh.animation.getBoneData(0);
....@@ -3853,7 +3872,7 @@
38533872
38543873 transient boolean restarted; // CROWD issue?
38553874
3856
- void drawSelf(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
3875
+ void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
38573876 {
38583877 //System.err.println("drawSelf Mocap frame # " + frame);
38593878 //System.err.println("drawSelf Mocap baseframe # " + baseframe);
....@@ -3871,7 +3890,7 @@
38713890 // return;
38723891
38733892 if (!restarted && /*display.restartframe &&*/
3874
- display.isLIVE() && live && display.drawMode == display.SHADOW) // FUCK
3893
+ Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK
38753894 {
38763895 //display.restartframe = false;
38773896 restarted = true;
....@@ -3879,7 +3898,7 @@
38793898 }
38803899 else
38813900 {
3882
- if (display.isLIVE() && live && display.drawMode != display.SHADOW)
3901
+ if (Globals.isLIVE() && live && display.DrawMode() != display.SHADOW)
38833902 restarted = false;
38843903 }
38853904