.. | .. |
---|
484 | 484 | { |
---|
485 | 485 | Object3D hip = get(0); |
---|
486 | 486 | |
---|
| 487 | + if (toParent == null) |
---|
| 488 | + { |
---|
| 489 | + toParent = LA.newMatrix(); |
---|
| 490 | + fromParent = LA.newMatrix(); |
---|
| 491 | + } |
---|
| 492 | + |
---|
487 | 493 | LA.matConcat(toParent, hip.get(0).toParent, matrix); |
---|
488 | 494 | |
---|
489 | 495 | mocaporigin.x = matrix[3][0]; |
---|
.. | .. |
---|
638 | 644 | // transient // aout 2013 |
---|
639 | 645 | Object3D skeleton; |
---|
640 | 646 | |
---|
| 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 | + |
---|
641 | 665 | boolean smoothed; |
---|
642 | 666 | |
---|
643 | 667 | //boolean touched; |
---|
.. | .. |
---|
664 | 688 | double targetdirx; |
---|
665 | 689 | double targetdirz; |
---|
666 | 690 | |
---|
667 | | - double goalposx = -20; |
---|
668 | | - double goalposz = -10; |
---|
| 691 | + double goalposx = 0; // -20; |
---|
| 692 | + double goalposz = 0; // -10; |
---|
669 | 693 | |
---|
670 | 694 | boolean followpath; |
---|
671 | 695 | |
---|
.. | .. |
---|
921 | 945 | // //GetFileRoot(); |
---|
922 | 946 | |
---|
923 | 947 | // sept 2014: // |
---|
924 | | - GrafreeD.RENDERME = 3; // patch for Merge objects |
---|
| 948 | + Grafreed.RENDERME = 3; // patch for Merge objects |
---|
925 | 949 | float[] thedata = bvh.animation.getBoneData(0); |
---|
926 | 950 | |
---|
927 | 951 | os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]); |
---|
.. | .. |
---|
1566 | 1590 | |
---|
1567 | 1591 | lastsoundtime = Globals.framecount; |
---|
1568 | 1592 | |
---|
1569 | | - GrafreeD.hassound = true; |
---|
| 1593 | + Grafreed.hassound = true; |
---|
1570 | 1594 | } |
---|
1571 | 1595 | // else |
---|
1572 | 1596 | // System.out.println("skipped"); |
---|
.. | .. |
---|
2267 | 2291 | } |
---|
2268 | 2292 | |
---|
2269 | 2293 | if (!smoothed) |
---|
2270 | | - for (int i=1; --i>=0;) |
---|
| 2294 | + for (int i=10; --i>=0;) |
---|
2271 | 2295 | SmoothAnimData(); // much reduces shakiness |
---|
2272 | 2296 | |
---|
2273 | 2297 | smoothed = true; |
---|
.. | .. |
---|
2797 | 2821 | //if (bone._rotationEnabled) |
---|
2798 | 2822 | if (//frame > 0 && |
---|
2799 | 2823 | !bone.skipmocap && |
---|
2800 | | - !bone.name.contains("head") // && |
---|
| 2824 | + !bone.name.contains("head") && |
---|
| 2825 | + !bone.name.contains("Head") // && |
---|
2801 | 2826 | // !bone.name.contains("rFoot") && |
---|
2802 | 2827 | // !bone.name.contains("lFoot") && |
---|
2803 | 2828 | // !bone.name.contains("Pinky") && |
---|
.. | .. |
---|
3233 | 3258 | |
---|
3234 | 3259 | // aout 2013 endframe = 0; // june 2013 |
---|
3235 | 3260 | |
---|
3236 | | - //ResetZero(); |
---|
3237 | | - setPose(frame); |
---|
| 3261 | + ResetZero(); |
---|
| 3262 | + //setPose(frame); |
---|
3238 | 3263 | } |
---|
3239 | 3264 | |
---|
3240 | 3265 | static int mocapsupport = 0; |
---|
.. | .. |
---|
3252 | 3277 | |
---|
3253 | 3278 | int step = 1; |
---|
3254 | 3279 | |
---|
| 3280 | + // patch for running hare |
---|
3255 | 3281 | if (speedup) // fev 2014 |
---|
3256 | 3282 | step *= 2; // 4; |
---|
3257 | 3283 | if (rewind) // mars 2014 |
---|
3258 | 3284 | step *= 4; |
---|
3259 | 3285 | |
---|
3260 | | - if (CameraPane.FAST) // && !CameraPane.HOLD) |
---|
| 3286 | + //if (CameraPane.FAST) // && !CameraPane.HOLD) |
---|
3261 | 3287 | step *= CameraPane.STEP; |
---|
3262 | 3288 | |
---|
3263 | 3289 | //System.err.println("Step Mocap frame # " + frame); |
---|
.. | .. |
---|
3298 | 3324 | // SetPositionDelta(false, true, false); // ?? false); |
---|
3299 | 3325 | { |
---|
3300 | 3326 | if (support == null) |
---|
3301 | | - 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 | + } |
---|
3302 | 3337 | else |
---|
3303 | 3338 | { |
---|
3304 | | - try |
---|
3305 | | - { |
---|
| 3339 | +// try |
---|
| 3340 | +// { |
---|
3306 | 3341 | bvh = ((Mocap)support.get(mocapsupport++ % support.Size())).bvh; |
---|
3307 | 3342 | |
---|
3308 | 3343 | // SetPositionDelta(false, true, true, true); |
---|
3309 | 3344 | LoadData(); |
---|
3310 | 3345 | Rewind(); |
---|
3311 | 3346 | Fade(); |
---|
3312 | | - } |
---|
3313 | | - catch (Exception e) |
---|
3314 | | - { |
---|
3315 | | - e.printStackTrace(); |
---|
3316 | | - ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest); |
---|
3317 | | - } |
---|
| 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 | +// } |
---|
3318 | 3361 | } |
---|
3319 | 3362 | } |
---|
3320 | 3363 | |
---|
.. | .. |
---|
3871 | 3914 | // if (firstframe) |
---|
3872 | 3915 | // return; |
---|
3873 | 3916 | |
---|
3874 | | - if (!restarted && /*display.restartframe &&*/ |
---|
3875 | | - Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK |
---|
| 3917 | + if (//!restarted && /*display.restartframe &&*/ |
---|
| 3918 | + Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW)) |
---|
3876 | 3919 | { |
---|
3877 | 3920 | //display.restartframe = false; |
---|
3878 | 3921 | restarted = true; |
---|
| 3922 | + //System.err.println("restarted = true"); |
---|
3879 | 3923 | Step(); |
---|
3880 | 3924 | } |
---|
3881 | 3925 | else |
---|
3882 | 3926 | { |
---|
3883 | | - if (Globals.isLIVE() && live && display.DrawMode() != display.SHADOW) |
---|
| 3927 | + //System.err.println("restarted"); |
---|
| 3928 | + if (Globals.isLIVE() && live && display.DrawMode() != iCameraPane.SHADOW) |
---|
| 3929 | + { |
---|
3884 | 3930 | restarted = false; |
---|
| 3931 | + //System.err.println("restarted = false"); |
---|
| 3932 | + } |
---|
3885 | 3933 | } |
---|
3886 | 3934 | |
---|
3887 | 3935 | super.drawSelf(display, root, selected, blocked); |
---|