.. | .. |
---|
174 | 174 | { |
---|
175 | 175 | Object3D o = hashtable.get(GetUUID()); |
---|
176 | 176 | |
---|
177 | | - assert(this.bRep == o.bRep); |
---|
| 177 | + Grafreed.Assert(this.bRep == o.bRep); |
---|
178 | 178 | if (this.bRep != null) |
---|
179 | 179 | assert(this.bRep.support == o.transientrep); |
---|
180 | 180 | |
---|
.. | .. |
---|
563 | 563 | toParent = LA.newMatrix(); |
---|
564 | 564 | fromParent = LA.newMatrix(); |
---|
565 | 565 | } |
---|
| 566 | + |
---|
566 | 567 | if (toParentMarked == null) |
---|
567 | 568 | { |
---|
568 | 569 | if (maxcount != 1) |
---|
569 | 570 | { |
---|
570 | 571 | new Exception().printStackTrace(); |
---|
571 | 572 | } |
---|
| 573 | + |
---|
572 | 574 | toParentMarked = LA.newMatrix(); |
---|
573 | 575 | fromParentMarked = LA.newMatrix(); |
---|
574 | 576 | } |
---|
.. | .. |
---|
891 | 893 | |
---|
892 | 894 | boolean changedir = random && Math.random() < 0.01; // && !link2master; |
---|
893 | 895 | |
---|
894 | | - if (transformcount*factor > maxcount || (step == 1 && changedir)) |
---|
| 896 | + if (transformcount*factor >= maxcount && (rewind || random) || |
---|
| 897 | + (step == 1 && changedir)) |
---|
895 | 898 | { |
---|
896 | 899 | countdown = 1; |
---|
897 | 900 | delay = speedup?8:1; |
---|
.. | .. |
---|
3501 | 3504 | if (blockloop) |
---|
3502 | 3505 | return; |
---|
3503 | 3506 | |
---|
3504 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3507 | + if (//marked || // does not make sense |
---|
| 3508 | + (bRep != null || material != null)) // borderline... |
---|
3505 | 3509 | live = h; |
---|
3506 | 3510 | |
---|
3507 | 3511 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3522 | 3526 | return; |
---|
3523 | 3527 | |
---|
3524 | 3528 | //if (bRep != null) |
---|
3525 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3529 | + if (//marked || // does not make sense |
---|
| 3530 | + (bRep != null || material != null)) // borderline... |
---|
3526 | 3531 | link2master = h; |
---|
3527 | 3532 | |
---|
3528 | 3533 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3542 | 3547 | if (blockloop) |
---|
3543 | 3548 | return; |
---|
3544 | 3549 | |
---|
3545 | | - if (marked || (bRep != null && material != null)) // borderline... |
---|
| 3550 | + if (//marked || // does not make sense |
---|
| 3551 | + (bRep != null || material != null)) // borderline... |
---|
3546 | 3552 | hide = h; |
---|
3547 | 3553 | |
---|
3548 | 3554 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3562 | 3568 | if (blockloop) |
---|
3563 | 3569 | return; |
---|
3564 | 3570 | |
---|
3565 | | - if (bRep != null && material != null) // borderline... |
---|
| 3571 | + if (bRep != null || material != null) // borderline... |
---|
3566 | 3572 | marked = h; |
---|
3567 | 3573 | |
---|
3568 | 3574 | for (int i = 0; i < Size(); i++) |
---|
.. | .. |
---|
3572 | 3578 | continue; |
---|
3573 | 3579 | blockloop = true; |
---|
3574 | 3580 | child.MarkLeaves(h); |
---|
| 3581 | + blockloop = false; |
---|
| 3582 | + // release(i); |
---|
| 3583 | + } |
---|
| 3584 | + } |
---|
| 3585 | + |
---|
| 3586 | + void RewindLeaves(boolean h) |
---|
| 3587 | + { |
---|
| 3588 | + if (blockloop) |
---|
| 3589 | + return; |
---|
| 3590 | + |
---|
| 3591 | + if (bRep != null || material != null) // borderline... |
---|
| 3592 | + rewind = h; |
---|
| 3593 | + |
---|
| 3594 | + for (int i = 0; i < Size(); i++) |
---|
| 3595 | + { |
---|
| 3596 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3597 | + if (child == null) |
---|
| 3598 | + continue; |
---|
| 3599 | + blockloop = true; |
---|
| 3600 | + child.RewindLeaves(h); |
---|
| 3601 | + blockloop = false; |
---|
| 3602 | + // release(i); |
---|
| 3603 | + } |
---|
| 3604 | + } |
---|
| 3605 | + |
---|
| 3606 | + void RandomLeaves(boolean h) |
---|
| 3607 | + { |
---|
| 3608 | + if (blockloop) |
---|
| 3609 | + return; |
---|
| 3610 | + |
---|
| 3611 | + if (bRep != null || material != null) // borderline... |
---|
| 3612 | + random = h; |
---|
| 3613 | + |
---|
| 3614 | + for (int i = 0; i < Size(); i++) |
---|
| 3615 | + { |
---|
| 3616 | + Object3D child = (Object3D) get(i); // reserve(i); |
---|
| 3617 | + if (child == null) |
---|
| 3618 | + continue; |
---|
| 3619 | + blockloop = true; |
---|
| 3620 | + child.RandomLeaves(h); |
---|
3575 | 3621 | blockloop = false; |
---|
3576 | 3622 | // release(i); |
---|
3577 | 3623 | } |
---|
.. | .. |
---|
4345 | 4391 | { |
---|
4346 | 4392 | blockloop = true; |
---|
4347 | 4393 | get(i).RepairShadow(); |
---|
| 4394 | + blockloop = false; |
---|
| 4395 | + } |
---|
| 4396 | + } |
---|
| 4397 | + |
---|
| 4398 | + void RepairSOV() |
---|
| 4399 | + { |
---|
| 4400 | + if (blockloop) |
---|
| 4401 | + return; |
---|
| 4402 | + |
---|
| 4403 | + String texname = this.GetPigmentTexture(); |
---|
| 4404 | + |
---|
| 4405 | + if (texname.startsWith("sov")) |
---|
| 4406 | + { |
---|
| 4407 | + String[] s = texname.split("/"); |
---|
| 4408 | + |
---|
| 4409 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4410 | + |
---|
| 4411 | + texname = sname[0]; |
---|
| 4412 | + |
---|
| 4413 | + if (sname.length > 1) |
---|
| 4414 | + { |
---|
| 4415 | + texname += "Color.jpg"; |
---|
| 4416 | + } |
---|
| 4417 | + |
---|
| 4418 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4419 | + } |
---|
| 4420 | + |
---|
| 4421 | + texname = this.GetBumpTexture(); |
---|
| 4422 | + |
---|
| 4423 | + if (texname.startsWith("sov")) |
---|
| 4424 | + { |
---|
| 4425 | + String[] s = texname.split("/"); |
---|
| 4426 | + |
---|
| 4427 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4428 | + |
---|
| 4429 | + texname = sname[0]; |
---|
| 4430 | + |
---|
| 4431 | + if (sname.length > 1) |
---|
| 4432 | + { |
---|
| 4433 | + texname += "Bump.jpg"; |
---|
| 4434 | + } |
---|
| 4435 | + |
---|
| 4436 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4437 | + } |
---|
| 4438 | + |
---|
| 4439 | + for (int i=0; i<Size(); i++) |
---|
| 4440 | + { |
---|
| 4441 | + blockloop = true; |
---|
| 4442 | + get(i).RepairSOV(); |
---|
4348 | 4443 | blockloop = false; |
---|
4349 | 4444 | } |
---|
4350 | 4445 | } |
---|
.. | .. |
---|
5572 | 5667 | boolean NeedSupport() |
---|
5573 | 5668 | { |
---|
5574 | 5669 | return |
---|
5575 | | - CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null |
---|
| 5670 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5576 | 5671 | // PROBLEM with CROWD!! |
---|
5577 | 5672 | && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5578 | 5673 | } |
---|
5579 | 5674 | |
---|
5580 | 5675 | static boolean DEBUG_SELECTION = false; |
---|
| 5676 | + |
---|
| 5677 | + boolean IsLive() |
---|
| 5678 | + { |
---|
| 5679 | + if (live) |
---|
| 5680 | + return true; |
---|
| 5681 | + |
---|
| 5682 | + if (parent == null) |
---|
| 5683 | + return false; |
---|
| 5684 | + |
---|
| 5685 | + return parent.IsLive(); |
---|
| 5686 | + } |
---|
5581 | 5687 | |
---|
5582 | 5688 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5583 | 5689 | { |
---|
.. | .. |
---|
5640 | 5746 | support = support; |
---|
5641 | 5747 | |
---|
5642 | 5748 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5643 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5749 | + boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5644 | 5750 | |
---|
5645 | 5751 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5646 | 5752 | { |
---|
.. | .. |
---|
5660 | 5766 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5661 | 5767 | |
---|
5662 | 5768 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5663 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5769 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5770 | + (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
5664 | 5771 | { |
---|
5665 | 5772 | Globals.lighttouched = true; |
---|
5666 | 5773 | } // all panes... |
---|
| 5774 | + |
---|
5667 | 5775 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5668 | 5776 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5669 | 5777 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5831 | 5939 | tex = GetTextures(); |
---|
5832 | 5940 | } |
---|
5833 | 5941 | |
---|
5834 | | - boolean failed = false; |
---|
| 5942 | + boolean failedPigment = false; |
---|
| 5943 | + boolean failedBump = false; |
---|
5835 | 5944 | |
---|
5836 | 5945 | try |
---|
5837 | 5946 | { |
---|
5838 | | - display.BindTextures(tex, texres); |
---|
| 5947 | + display.BindPigmentTexture(tex, texres); |
---|
5839 | 5948 | } |
---|
5840 | 5949 | catch (Exception e) |
---|
5841 | 5950 | { |
---|
5842 | 5951 | System.err.println("FAILED: " + this); |
---|
5843 | | - failed = true; |
---|
| 5952 | + failedPigment = true; |
---|
| 5953 | + } |
---|
| 5954 | + |
---|
| 5955 | + try |
---|
| 5956 | + { |
---|
| 5957 | + display.BindBumpTexture(tex, texres); |
---|
| 5958 | + } |
---|
| 5959 | + catch (Exception e) |
---|
| 5960 | + { |
---|
| 5961 | + //System.err.println("FAILED: " + this); |
---|
| 5962 | + failedBump = true; |
---|
5844 | 5963 | } |
---|
5845 | 5964 | |
---|
5846 | 5965 | if (!compiled) |
---|
.. | .. |
---|
5863 | 5982 | } |
---|
5864 | 5983 | } |
---|
5865 | 5984 | |
---|
5866 | | - if (!failed) |
---|
5867 | | - display.ReleaseTextures(tex); |
---|
| 5985 | + if (!failedBump) |
---|
| 5986 | + display.ReleaseBumpTexture(tex); |
---|
| 5987 | + |
---|
| 5988 | + if (!failedPigment) |
---|
| 5989 | + display.ReleasePigmentTexture(tex); |
---|
5868 | 5990 | |
---|
5869 | 5991 | display.PopMaterial(this, selected); |
---|
5870 | 5992 | } |
---|
.. | .. |
---|
7089 | 7211 | spot.translate(32, 32); |
---|
7090 | 7212 | spotw = spot.x + spot.width; |
---|
7091 | 7213 | spoth = spot.y + spot.height; |
---|
7092 | | - info.g.setColor(Color.blue); |
---|
| 7214 | + info.g.setColor(Color.cyan); |
---|
7093 | 7215 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7094 | 7216 | // if (CameraPane.Xmin > spot.x) |
---|
7095 | 7217 | // { |
---|
.. | .. |
---|
7107 | 7229 | // { |
---|
7108 | 7230 | // CameraPane.Ymax = spoth; |
---|
7109 | 7231 | // } |
---|
7110 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
7111 | | - //info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7232 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7233 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7112 | 7234 | spot.translate(0, -32); |
---|
7113 | | - info.g.setColor(Color.green); |
---|
| 7235 | + info.g.setColor(Color.yellow); |
---|
7114 | 7236 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7237 | + info.g.setColor(Color.green); |
---|
7115 | 7238 | // if (CameraPane.Xmin > spot.x) |
---|
7116 | 7239 | // { |
---|
7117 | 7240 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7429 | 7552 | switch (info.pane.RenderCamera().viewCode) |
---|
7430 | 7553 | { |
---|
7431 | 7554 | case 3: // '\001' |
---|
7432 | | - if (modified) |
---|
| 7555 | + if (modified || opposite) |
---|
7433 | 7556 | { |
---|
7434 | 7557 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7435 | 7558 | LA.matScale(toParent, totalScale, 1, 1); |
---|
7436 | 7559 | } // vScale, 1); |
---|
7437 | 7560 | else |
---|
7438 | 7561 | { |
---|
| 7562 | + // EXCEPTION! |
---|
7439 | 7563 | LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7440 | 7564 | } // vScale, 1); |
---|
7441 | 7565 | break; |
---|
7442 | 7566 | |
---|
7443 | 7567 | case 2: // '\002' |
---|
7444 | | - if (modified) |
---|
| 7568 | + if (modified || opposite) |
---|
7445 | 7569 | { |
---|
7446 | 7570 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7447 | 7571 | LA.matScale(toParent, 1, totalScale, 1); |
---|
.. | .. |
---|
7452 | 7576 | break; |
---|
7453 | 7577 | |
---|
7454 | 7578 | case 1: // '\003' |
---|
7455 | | - if (modified) |
---|
| 7579 | + if (modified || opposite) |
---|
7456 | 7580 | { |
---|
7457 | 7581 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7458 | 7582 | LA.matScale(toParent, 1, 1, totalScale); |
---|