.. | .. |
---|
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 | } |
---|
.. | .. |
---|
4349 | 4351 | } |
---|
4350 | 4352 | } |
---|
4351 | 4353 | |
---|
| 4354 | + void RepairSOV() |
---|
| 4355 | + { |
---|
| 4356 | + if (blockloop) |
---|
| 4357 | + return; |
---|
| 4358 | + |
---|
| 4359 | + String texname = this.GetPigmentTexture(); |
---|
| 4360 | + |
---|
| 4361 | + if (texname.startsWith("sov")) |
---|
| 4362 | + { |
---|
| 4363 | + String[] s = texname.split("/"); |
---|
| 4364 | + |
---|
| 4365 | + String[] sname = s[1].split("Color.pn"); |
---|
| 4366 | + |
---|
| 4367 | + texname = sname[0]; |
---|
| 4368 | + |
---|
| 4369 | + if (sname.length > 1) |
---|
| 4370 | + { |
---|
| 4371 | + texname += "Color.jpg"; |
---|
| 4372 | + } |
---|
| 4373 | + |
---|
| 4374 | + this.SetPigmentTexture("sov/" + texname); |
---|
| 4375 | + } |
---|
| 4376 | + |
---|
| 4377 | + texname = this.GetBumpTexture(); |
---|
| 4378 | + |
---|
| 4379 | + if (texname.startsWith("sov")) |
---|
| 4380 | + { |
---|
| 4381 | + String[] s = texname.split("/"); |
---|
| 4382 | + |
---|
| 4383 | + String[] sname = s[1].split("Bump.pn"); |
---|
| 4384 | + |
---|
| 4385 | + texname = sname[0]; |
---|
| 4386 | + |
---|
| 4387 | + if (sname.length > 1) |
---|
| 4388 | + { |
---|
| 4389 | + texname += "Bump.jpg"; |
---|
| 4390 | + } |
---|
| 4391 | + |
---|
| 4392 | + this.SetBumpTexture("sov/" + texname); |
---|
| 4393 | + } |
---|
| 4394 | + |
---|
| 4395 | + for (int i=0; i<Size(); i++) |
---|
| 4396 | + { |
---|
| 4397 | + blockloop = true; |
---|
| 4398 | + get(i).RepairSOV(); |
---|
| 4399 | + blockloop = false; |
---|
| 4400 | + } |
---|
| 4401 | + } |
---|
| 4402 | + |
---|
4352 | 4403 | void RepairTexture() |
---|
4353 | 4404 | { |
---|
4354 | 4405 | if (this instanceof FileObject || blockloop) |
---|
.. | .. |
---|
5572 | 5623 | boolean NeedSupport() |
---|
5573 | 5624 | { |
---|
5574 | 5625 | return |
---|
5575 | | - CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null |
---|
| 5626 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5576 | 5627 | // PROBLEM with CROWD!! |
---|
5577 | 5628 | && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5578 | 5629 | } |
---|
5579 | 5630 | |
---|
5580 | 5631 | static boolean DEBUG_SELECTION = false; |
---|
| 5632 | + |
---|
| 5633 | + boolean IsLive() |
---|
| 5634 | + { |
---|
| 5635 | + if (live) |
---|
| 5636 | + return true; |
---|
| 5637 | + |
---|
| 5638 | + if (parent == null) |
---|
| 5639 | + return false; |
---|
| 5640 | + |
---|
| 5641 | + return parent.IsLive(); |
---|
| 5642 | + } |
---|
5581 | 5643 | |
---|
5582 | 5644 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5583 | 5645 | { |
---|
.. | .. |
---|
5640 | 5702 | support = support; |
---|
5641 | 5703 | |
---|
5642 | 5704 | //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); |
---|
| 5705 | + boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5644 | 5706 | |
---|
5645 | 5707 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5646 | 5708 | { |
---|
.. | .. |
---|
5660 | 5722 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5661 | 5723 | |
---|
5662 | 5724 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5663 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5725 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5726 | + (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
5664 | 5727 | { |
---|
5665 | 5728 | Globals.lighttouched = true; |
---|
5666 | 5729 | } // all panes... |
---|
| 5730 | + |
---|
5667 | 5731 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5668 | 5732 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5669 | 5733 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
5831 | 5895 | tex = GetTextures(); |
---|
5832 | 5896 | } |
---|
5833 | 5897 | |
---|
5834 | | - boolean failed = false; |
---|
| 5898 | + boolean failedPigment = false; |
---|
| 5899 | + boolean failedBump = false; |
---|
5835 | 5900 | |
---|
5836 | 5901 | try |
---|
5837 | 5902 | { |
---|
5838 | | - display.BindTextures(tex, texres); |
---|
| 5903 | + display.BindPigmentTexture(tex, texres); |
---|
5839 | 5904 | } |
---|
5840 | 5905 | catch (Exception e) |
---|
5841 | 5906 | { |
---|
5842 | 5907 | System.err.println("FAILED: " + this); |
---|
5843 | | - failed = true; |
---|
| 5908 | + failedPigment = true; |
---|
| 5909 | + } |
---|
| 5910 | + |
---|
| 5911 | + try |
---|
| 5912 | + { |
---|
| 5913 | + display.BindBumpTexture(tex, texres); |
---|
| 5914 | + } |
---|
| 5915 | + catch (Exception e) |
---|
| 5916 | + { |
---|
| 5917 | + //System.err.println("FAILED: " + this); |
---|
| 5918 | + failedBump = true; |
---|
5844 | 5919 | } |
---|
5845 | 5920 | |
---|
5846 | 5921 | if (!compiled) |
---|
.. | .. |
---|
5863 | 5938 | } |
---|
5864 | 5939 | } |
---|
5865 | 5940 | |
---|
5866 | | - if (!failed) |
---|
5867 | | - display.ReleaseTextures(tex); |
---|
| 5941 | + if (!failedBump) |
---|
| 5942 | + display.ReleaseBumpTexture(tex); |
---|
| 5943 | + |
---|
| 5944 | + if (!failedPigment) |
---|
| 5945 | + display.ReleasePigmentTexture(tex); |
---|
5868 | 5946 | |
---|
5869 | 5947 | display.PopMaterial(this, selected); |
---|
5870 | 5948 | } |
---|
.. | .. |
---|
7089 | 7167 | spot.translate(32, 32); |
---|
7090 | 7168 | spotw = spot.x + spot.width; |
---|
7091 | 7169 | spoth = spot.y + spot.height; |
---|
7092 | | - info.g.setColor(Color.blue); |
---|
| 7170 | + info.g.setColor(Color.cyan); |
---|
7093 | 7171 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7094 | 7172 | // if (CameraPane.Xmin > spot.x) |
---|
7095 | 7173 | // { |
---|
.. | .. |
---|
7107 | 7185 | // { |
---|
7108 | 7186 | // CameraPane.Ymax = spoth; |
---|
7109 | 7187 | // } |
---|
7110 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
7111 | | - //info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7188 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7189 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7112 | 7190 | spot.translate(0, -32); |
---|
7113 | | - info.g.setColor(Color.green); |
---|
| 7191 | + info.g.setColor(Color.yellow); |
---|
7114 | 7192 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7193 | + info.g.setColor(Color.green); |
---|
7115 | 7194 | // if (CameraPane.Xmin > spot.x) |
---|
7116 | 7195 | // { |
---|
7117 | 7196 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7429 | 7508 | switch (info.pane.RenderCamera().viewCode) |
---|
7430 | 7509 | { |
---|
7431 | 7510 | case 3: // '\001' |
---|
7432 | | - if (modified) |
---|
| 7511 | + if (modified || opposite) |
---|
7433 | 7512 | { |
---|
7434 | 7513 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7435 | 7514 | LA.matScale(toParent, totalScale, 1, 1); |
---|
7436 | 7515 | } // vScale, 1); |
---|
7437 | 7516 | else |
---|
7438 | 7517 | { |
---|
| 7518 | + // EXCEPTION! |
---|
7439 | 7519 | LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7440 | 7520 | } // vScale, 1); |
---|
7441 | 7521 | break; |
---|
7442 | 7522 | |
---|
7443 | 7523 | case 2: // '\002' |
---|
7444 | | - if (modified) |
---|
| 7524 | + if (modified || opposite) |
---|
7445 | 7525 | { |
---|
7446 | 7526 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7447 | 7527 | LA.matScale(toParent, 1, totalScale, 1); |
---|
.. | .. |
---|
7452 | 7532 | break; |
---|
7453 | 7533 | |
---|
7454 | 7534 | case 1: // '\003' |
---|
7455 | | - if (modified) |
---|
| 7535 | + if (modified || opposite) |
---|
7456 | 7536 | { |
---|
7457 | 7537 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7458 | 7538 | LA.matScale(toParent, 1, 1, totalScale); |
---|