.. | .. |
---|
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]; |
---|
.. | .. |
---|
495 | 501 | centroid.z = matrix[3][2]; |
---|
496 | 502 | // this.getCentroid(centroid, true); |
---|
497 | 503 | |
---|
| 504 | + CameraPane.CreateSelectedPoint(); |
---|
498 | 505 | CameraPane.debugpointG.name = ""; |
---|
499 | 506 | CameraPane.debugpointG.toParent[3][0] = mocaporigin.x; |
---|
500 | 507 | CameraPane.debugpointG.toParent[3][1] = mocaporigin.y; |
---|
.. | .. |
---|
638 | 645 | // transient // aout 2013 |
---|
639 | 646 | Object3D skeleton; |
---|
640 | 647 | |
---|
| 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 | + |
---|
641 | 666 | boolean smoothed; |
---|
642 | 667 | |
---|
643 | 668 | //boolean touched; |
---|
.. | .. |
---|
664 | 689 | double targetdirx; |
---|
665 | 690 | double targetdirz; |
---|
666 | 691 | |
---|
667 | | - double goalposx = -20; |
---|
668 | | - double goalposz = -10; |
---|
| 692 | + double goalposx = 0; // -20; |
---|
| 693 | + double goalposz = 0; // -10; |
---|
669 | 694 | |
---|
670 | 695 | boolean followpath; |
---|
671 | 696 | |
---|
.. | .. |
---|
921 | 946 | // //GetFileRoot(); |
---|
922 | 947 | |
---|
923 | 948 | // sept 2014: // |
---|
924 | | - GrafreeD.RENDERME = 3; // patch for Merge objects |
---|
| 949 | + Grafreed.RENDERME = 3; // patch for Merge objects |
---|
925 | 950 | float[] thedata = bvh.animation.getBoneData(0); |
---|
926 | 951 | |
---|
927 | 952 | os.x = (float) (path.get(i).toParent[3][0]); // - thedata[frame*6]); |
---|
.. | .. |
---|
1519 | 1544 | // mywave = currentwave++; |
---|
1520 | 1545 | // } |
---|
1521 | 1546 | // sound |
---|
1522 | | - cVector eye = CameraPane.theRenderer.eyeCamera.location; |
---|
| 1547 | + cVector eye = Globals.theRenderer.EyeCamera().location; |
---|
1523 | 1548 | |
---|
1524 | 1549 | // if (sourcenode.parent.parent != null) |
---|
1525 | 1550 | // sourcenode.parent.parent.TransformToWorld(floor, tmp); |
---|
.. | .. |
---|
1566 | 1591 | |
---|
1567 | 1592 | lastsoundtime = Globals.framecount; |
---|
1568 | 1593 | |
---|
1569 | | - GrafreeD.hassound = true; |
---|
| 1594 | + Grafreed.hassound = true; |
---|
1570 | 1595 | } |
---|
1571 | 1596 | // else |
---|
1572 | 1597 | // System.out.println("skipped"); |
---|
.. | .. |
---|
2267 | 2292 | } |
---|
2268 | 2293 | |
---|
2269 | 2294 | if (!smoothed) |
---|
2270 | | - for (int i=0; --i>=0;) |
---|
| 2295 | + for (int i=10; --i>=0;) |
---|
2271 | 2296 | SmoothAnimData(); // much reduces shakiness |
---|
2272 | 2297 | |
---|
2273 | 2298 | smoothed = true; |
---|
.. | .. |
---|
2797 | 2822 | //if (bone._rotationEnabled) |
---|
2798 | 2823 | if (//frame > 0 && |
---|
2799 | 2824 | !bone.skipmocap && |
---|
2800 | | - !bone.name.contains("head") // && |
---|
| 2825 | + !bone.name.contains("head") && |
---|
| 2826 | + !bone.name.contains("Head") // && |
---|
2801 | 2827 | // !bone.name.contains("rFoot") && |
---|
2802 | 2828 | // !bone.name.contains("lFoot") && |
---|
2803 | 2829 | // !bone.name.contains("Pinky") && |
---|
.. | .. |
---|
3233 | 3259 | |
---|
3234 | 3260 | // aout 2013 endframe = 0; // june 2013 |
---|
3235 | 3261 | |
---|
3236 | | - //ResetZero(); |
---|
3237 | | - setPose(frame); |
---|
| 3262 | + ResetZero(); |
---|
| 3263 | + //setPose(frame); |
---|
3238 | 3264 | } |
---|
3239 | 3265 | |
---|
3240 | 3266 | static int mocapsupport = 0; |
---|
.. | .. |
---|
3252 | 3278 | |
---|
3253 | 3279 | int step = 1; |
---|
3254 | 3280 | |
---|
| 3281 | + // patch for running hare |
---|
3255 | 3282 | if (speedup) // fev 2014 |
---|
3256 | 3283 | step *= 2; // 4; |
---|
3257 | 3284 | if (rewind) // mars 2014 |
---|
3258 | 3285 | step *= 4; |
---|
3259 | 3286 | |
---|
3260 | | - if (CameraPane.FAST) // && !CameraPane.HOLD) |
---|
| 3287 | + //if (CameraPane.FAST) // && !CameraPane.HOLD) |
---|
3261 | 3288 | step *= CameraPane.STEP; |
---|
3262 | 3289 | |
---|
3263 | 3290 | //System.err.println("Step Mocap frame # " + frame); |
---|
.. | .. |
---|
3298 | 3325 | // SetPositionDelta(false, true, false); // ?? false); |
---|
3299 | 3326 | { |
---|
3300 | 3327 | if (support == null) |
---|
3301 | | - 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 | + } |
---|
3302 | 3338 | else |
---|
3303 | 3339 | { |
---|
3304 | | - try |
---|
3305 | | - { |
---|
| 3340 | +// try |
---|
| 3341 | +// { |
---|
3306 | 3342 | bvh = ((Mocap)support.get(mocapsupport++ % support.Size())).bvh; |
---|
3307 | 3343 | |
---|
3308 | 3344 | // SetPositionDelta(false, true, true, true); |
---|
3309 | 3345 | LoadData(); |
---|
3310 | 3346 | Rewind(); |
---|
3311 | 3347 | Fade(); |
---|
3312 | | - } |
---|
3313 | | - catch (Exception e) |
---|
3314 | | - { |
---|
3315 | | - e.printStackTrace(); |
---|
3316 | | - ObjEditor.LoadBVHFile(fullname, this, false, beginframe, lastframetest); |
---|
3317 | | - } |
---|
| 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 | +// } |
---|
3318 | 3362 | } |
---|
3319 | 3363 | } |
---|
3320 | 3364 | |
---|
.. | .. |
---|
3496 | 3540 | // filters out bad input data |
---|
3497 | 3541 | void FilterAnimData() |
---|
3498 | 3542 | { |
---|
| 3543 | + new Exception().printStackTrace(); |
---|
3499 | 3544 | System.exit(0); |
---|
3500 | 3545 | |
---|
3501 | 3546 | float[] data; // = bvh.animation.getBoneData(0); |
---|
.. | .. |
---|
3853 | 3898 | |
---|
3854 | 3899 | transient boolean restarted; // CROWD issue? |
---|
3855 | 3900 | |
---|
3856 | | - void drawSelf(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
| 3901 | + void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
3857 | 3902 | { |
---|
3858 | 3903 | //System.err.println("drawSelf Mocap frame # " + frame); |
---|
3859 | 3904 | //System.err.println("drawSelf Mocap baseframe # " + baseframe); |
---|
.. | .. |
---|
3870 | 3915 | // if (firstframe) |
---|
3871 | 3916 | // return; |
---|
3872 | 3917 | |
---|
3873 | | - if (!restarted && /*display.restartframe &&*/ |
---|
3874 | | - Globals.isLIVE() && live && display.DrawMode() == display.SHADOW) // FUCK |
---|
| 3918 | + if (//!restarted && /*display.restartframe &&*/ |
---|
| 3919 | + Globals.isLIVE() && live && (display.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE)) |
---|
3875 | 3920 | { |
---|
3876 | 3921 | //display.restartframe = false; |
---|
3877 | 3922 | restarted = true; |
---|
| 3923 | + //System.err.println("restarted = true"); |
---|
3878 | 3924 | Step(); |
---|
3879 | 3925 | } |
---|
3880 | 3926 | else |
---|
3881 | 3927 | { |
---|
3882 | | - if (Globals.isLIVE() && live && display.DrawMode() != display.SHADOW) |
---|
| 3928 | + //System.err.println("restarted"); |
---|
| 3929 | + if (Globals.isLIVE() && live && display.DrawMode() != iCameraPane.SHADOW) |
---|
| 3930 | + { |
---|
3883 | 3931 | restarted = false; |
---|
| 3932 | + //System.err.println("restarted = false"); |
---|
| 3933 | + } |
---|
3884 | 3934 | } |
---|
3885 | 3935 | |
---|
3886 | 3936 | super.drawSelf(display, root, selected, blocked); |
---|