.. | .. |
---|
36 | 36 | Object3D versionlist[]; |
---|
37 | 37 | int versionindex = -1; |
---|
38 | 38 | |
---|
| 39 | + java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>(); |
---|
| 40 | + |
---|
39 | 41 | ScriptNode scriptnode; |
---|
40 | 42 | |
---|
41 | 43 | void InitOthers() |
---|
.. | .. |
---|
269 | 271 | // |
---|
270 | 272 | // return null; |
---|
271 | 273 | // } |
---|
| 274 | + |
---|
| 275 | + transient boolean tag; |
---|
| 276 | + |
---|
| 277 | + void TagObjects(Object3D o, boolean tag) |
---|
| 278 | + { |
---|
| 279 | + if (blockloop) |
---|
| 280 | + return; |
---|
| 281 | + |
---|
| 282 | + o.tag = tag; |
---|
| 283 | + |
---|
| 284 | + if (o == this) |
---|
| 285 | + return; |
---|
| 286 | + |
---|
| 287 | + blockloop = true; |
---|
| 288 | + |
---|
| 289 | + for (int i=0; i<Size(); i++) |
---|
| 290 | + { |
---|
| 291 | + get(i).TagObjects(o, tag); |
---|
| 292 | + } |
---|
| 293 | + |
---|
| 294 | + blockloop = false; |
---|
| 295 | + } |
---|
| 296 | + |
---|
| 297 | + boolean HasTags() |
---|
| 298 | + { |
---|
| 299 | + if (blockloop) |
---|
| 300 | + return false; |
---|
| 301 | + |
---|
| 302 | + blockloop = true; |
---|
| 303 | + |
---|
| 304 | + boolean hasTags = false; |
---|
| 305 | + |
---|
| 306 | + for (int i=0; i<Size(); i++) |
---|
| 307 | + { |
---|
| 308 | + hasTags |= get(i).tag || get(i).HasTags(); |
---|
| 309 | + |
---|
| 310 | + if (hasTags) |
---|
| 311 | + break; |
---|
| 312 | + } |
---|
| 313 | + |
---|
| 314 | + blockloop = false; |
---|
| 315 | + |
---|
| 316 | + return hasTags; |
---|
| 317 | + } |
---|
272 | 318 | |
---|
273 | 319 | void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
274 | 320 | { |
---|
.. | .. |
---|
2468 | 2514 | else |
---|
2469 | 2515 | { |
---|
2470 | 2516 | //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2517 | + if (objectUI != null) |
---|
| 2518 | + ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
| 2519 | + else |
---|
| 2520 | + //new Exception().printStackTrace(); |
---|
| 2521 | + System.err.println("objectUI is null"); |
---|
2471 | 2522 | } |
---|
2472 | 2523 | } |
---|
2473 | 2524 | |
---|
.. | .. |
---|
5569 | 5620 | if (fullname == null) |
---|
5570 | 5621 | return ""; |
---|
5571 | 5622 | |
---|
| 5623 | + if (fullname.pigment != null) |
---|
| 5624 | + { |
---|
| 5625 | + return fullname.pigment; |
---|
| 5626 | + } |
---|
| 5627 | + |
---|
5572 | 5628 | // System.out.println("Fullname = " + fullname); |
---|
5573 | 5629 | |
---|
5574 | 5630 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5581 | 5637 | |
---|
5582 | 5638 | if (split.length == 0) |
---|
5583 | 5639 | { |
---|
5584 | | - return ""; |
---|
| 5640 | + return fullname.pigment = ""; |
---|
5585 | 5641 | } |
---|
5586 | 5642 | |
---|
5587 | 5643 | if (split.length <= 2) |
---|
.. | .. |
---|
5589 | 5645 | if (fullname.name.endsWith(":")) |
---|
5590 | 5646 | { |
---|
5591 | 5647 | // Windows |
---|
5592 | | - return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5648 | + return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1); |
---|
5593 | 5649 | } |
---|
5594 | 5650 | |
---|
5595 | | - return split[0]; |
---|
| 5651 | + return fullname.pigment = split[0]; |
---|
5596 | 5652 | } |
---|
5597 | 5653 | |
---|
5598 | 5654 | // Windows |
---|
5599 | 5655 | assert(split.length == 4); |
---|
5600 | 5656 | |
---|
5601 | | - return split[0] + ":" + split[1]; |
---|
| 5657 | + return fullname.pigment = split[0] + ":" + split[1]; |
---|
5602 | 5658 | } |
---|
5603 | 5659 | |
---|
5604 | 5660 | static String GetBump(cTexture fullname) |
---|
5605 | 5661 | { |
---|
5606 | 5662 | if (fullname == null) |
---|
5607 | 5663 | return ""; |
---|
| 5664 | + |
---|
| 5665 | + if (fullname.bump != null) |
---|
| 5666 | + { |
---|
| 5667 | + return fullname.bump; |
---|
| 5668 | + } |
---|
5608 | 5669 | |
---|
5609 | 5670 | // System.out.println("Fullname = " + fullname); |
---|
5610 | 5671 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5616 | 5677 | |
---|
5617 | 5678 | if (split.length == 0) |
---|
5618 | 5679 | { |
---|
5619 | | - return ""; |
---|
| 5680 | + return fullname.bump = ""; |
---|
5620 | 5681 | } |
---|
5621 | 5682 | |
---|
5622 | 5683 | if (split.length == 1) |
---|
5623 | 5684 | { |
---|
5624 | | - return ""; |
---|
| 5685 | + return fullname.bump = ""; |
---|
5625 | 5686 | } |
---|
5626 | 5687 | |
---|
5627 | 5688 | if (split.length == 2) |
---|
.. | .. |
---|
5629 | 5690 | if (fullname.name.endsWith(":")) |
---|
5630 | 5691 | { |
---|
5631 | 5692 | // Windows |
---|
5632 | | - return ""; |
---|
| 5693 | + return fullname.bump = ""; |
---|
5633 | 5694 | } |
---|
5634 | 5695 | |
---|
5635 | | - return split[1]; |
---|
| 5696 | + return fullname.bump = split[1]; |
---|
5636 | 5697 | } |
---|
5637 | 5698 | |
---|
5638 | 5699 | // Windows |
---|
5639 | 5700 | assert(split.length == 4); |
---|
5640 | 5701 | |
---|
5641 | | - return split[2] + ":" + split[3]; |
---|
| 5702 | + return fullname.bump = split[2] + ":" + split[3]; |
---|
5642 | 5703 | } |
---|
5643 | 5704 | |
---|
5644 | 5705 | String GetPigmentTexture() |
---|
.. | .. |
---|
5721 | 5782 | texname = ""; |
---|
5722 | 5783 | |
---|
5723 | 5784 | GetTextures().name = texname + ":" + GetBump(GetTextures()); |
---|
| 5785 | + |
---|
| 5786 | + GetTextures().pigment = null; |
---|
| 5787 | + |
---|
5724 | 5788 | Touch(); |
---|
5725 | 5789 | } |
---|
5726 | 5790 | |
---|
.. | .. |
---|
5793 | 5857 | texname = ""; |
---|
5794 | 5858 | |
---|
5795 | 5859 | GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname; |
---|
| 5860 | + |
---|
| 5861 | + GetTextures().bump = null; |
---|
5796 | 5862 | |
---|
5797 | 5863 | Touch(); |
---|
5798 | 5864 | } |
---|
.. | .. |
---|
7397 | 7463 | boundary.y = spot.y - 30; |
---|
7398 | 7464 | boundary.width = spot.width + 60; |
---|
7399 | 7465 | boundary.height = spot.height + 60; |
---|
7400 | | - clickInfo.g.setColor(Color.red); |
---|
| 7466 | + clickInfo.g.setColor(Color.white); |
---|
7401 | 7467 | int spotw = spot.x + spot.width; |
---|
7402 | 7468 | int spoth = spot.y + spot.height; |
---|
7403 | 7469 | clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
.. | .. |
---|
7417 | 7483 | // { |
---|
7418 | 7484 | // CameraPane.Ymax = spoth; |
---|
7419 | 7485 | // } |
---|
7420 | | - spot.translate(32, 32); |
---|
| 7486 | +// if (CameraPane.Xmin > spot.x) |
---|
| 7487 | +// { |
---|
| 7488 | +// CameraPane.Xmin = spot.x; |
---|
| 7489 | +// } |
---|
| 7490 | +// if (CameraPane.Xmax < spotw) |
---|
| 7491 | +// { |
---|
| 7492 | +// CameraPane.Xmax = spotw; |
---|
| 7493 | +// } |
---|
| 7494 | +// if (CameraPane.Ymin > spot.y) |
---|
| 7495 | +// { |
---|
| 7496 | +// CameraPane.Ymin = spot.y; |
---|
| 7497 | +// } |
---|
| 7498 | +// if (CameraPane.Ymax < spoth) |
---|
| 7499 | +// { |
---|
| 7500 | +// CameraPane.Ymax = spoth; |
---|
| 7501 | +// } |
---|
| 7502 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7503 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
| 7504 | + spot.translate(32, 0); |
---|
| 7505 | + clickInfo.g.setColor(Color.yellow); |
---|
| 7506 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7507 | + |
---|
| 7508 | + spot.translate(32, 64); |
---|
7421 | 7509 | spotw = spot.x + spot.width; |
---|
7422 | 7510 | spoth = spot.y + spot.height; |
---|
7423 | 7511 | clickInfo.g.setColor(Color.cyan); |
---|
.. | .. |
---|
7438 | 7526 | // { |
---|
7439 | 7527 | // CameraPane.Ymax = spoth; |
---|
7440 | 7528 | // } |
---|
7441 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
7442 | | - //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7443 | | - spot.translate(0, -32); |
---|
7444 | | - clickInfo.g.setColor(Color.yellow); |
---|
7445 | | - clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7446 | 7529 | clickInfo.g.setColor(Color.green); |
---|
7447 | | -// if (CameraPane.Xmin > spot.x) |
---|
7448 | | -// { |
---|
7449 | | -// CameraPane.Xmin = spot.x; |
---|
7450 | | -// } |
---|
7451 | | -// if (CameraPane.Xmax < spotw) |
---|
7452 | | -// { |
---|
7453 | | -// CameraPane.Xmax = spotw; |
---|
7454 | | -// } |
---|
7455 | | -// if (CameraPane.Ymin > spot.y) |
---|
7456 | | -// { |
---|
7457 | | -// CameraPane.Ymin = spot.y; |
---|
7458 | | -// } |
---|
7459 | | -// if (CameraPane.Ymax < spoth) |
---|
7460 | | -// { |
---|
7461 | | -// CameraPane.Ymax = spoth; |
---|
7462 | | -// } |
---|
7463 | 7530 | clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
7464 | 7531 | (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7465 | 7532 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
.. | .. |
---|
7518 | 7585 | retval = true; |
---|
7519 | 7586 | } |
---|
7520 | 7587 | spot.translate(0, 32); |
---|
| 7588 | + spot.translate(32, 0); |
---|
| 7589 | + spot.translate(0, 32); |
---|
7521 | 7590 | if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7522 | 7591 | { |
---|
7523 | 7592 | hitSomething = hitScale; |
---|
7524 | 7593 | |
---|
7525 | 7594 | double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7526 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7595 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7527 | 7596 | double sign = 1; |
---|
7528 | 7597 | if (hScale < 0) |
---|
7529 | 7598 | { |
---|
.. | .. |
---|
7535 | 7604 | //hScale = 0.01; |
---|
7536 | 7605 | } |
---|
7537 | 7606 | |
---|
7538 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7607 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7539 | 7608 | sign = 1; |
---|
7540 | 7609 | if (vScale < 0) |
---|
7541 | 7610 | { |
---|
.. | .. |
---|
7750 | 7819 | break; |
---|
7751 | 7820 | |
---|
7752 | 7821 | case hitScale: // scale |
---|
7753 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7822 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7754 | 7823 | double sign = 1; |
---|
7755 | 7824 | if (hScale < 0) |
---|
7756 | 7825 | { |
---|
.. | .. |
---|
7762 | 7831 | //hScale = 0.01; |
---|
7763 | 7832 | } |
---|
7764 | 7833 | |
---|
7765 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7834 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7766 | 7835 | sign = 1; |
---|
7767 | 7836 | if (vScale < 0) |
---|
7768 | 7837 | { |
---|
.. | .. |
---|
7795 | 7864 | case 3: // '\001' |
---|
7796 | 7865 | if (modified || opposite) |
---|
7797 | 7866 | { |
---|
| 7867 | + if (modified && opposite) |
---|
| 7868 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7869 | + else |
---|
7798 | 7870 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7799 | | - LA.matScale(toParent, totalScale, 1, 1); |
---|
| 7871 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7800 | 7872 | } // vScale, 1); |
---|
7801 | 7873 | else |
---|
7802 | 7874 | { |
---|
7803 | 7875 | // EXCEPTION! |
---|
7804 | | - LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7876 | + LA.matScale(toParent, 1, totalScale, totalScale); |
---|
7805 | 7877 | } // vScale, 1); |
---|
7806 | 7878 | break; |
---|
7807 | 7879 | |
---|
7808 | 7880 | case 2: // '\002' |
---|
7809 | 7881 | if (modified || opposite) |
---|
7810 | 7882 | { |
---|
7811 | | - //LA.matScale(toParent, hScale, 1, vScale); |
---|
7812 | | - LA.matScale(toParent, 1, totalScale, 1); |
---|
| 7883 | + if (modified && opposite) |
---|
| 7884 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7885 | + else |
---|
| 7886 | + //LA.matScale(toParent, hScale, 1, vScale); |
---|
| 7887 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7813 | 7888 | } else |
---|
7814 | 7889 | { |
---|
7815 | 7890 | LA.matScale(toParent, totalScale, 1, totalScale); |
---|
.. | .. |
---|
7819 | 7894 | case 1: // '\003' |
---|
7820 | 7895 | if (modified || opposite) |
---|
7821 | 7896 | { |
---|
7822 | | - //LA.matScale(toParent, hScale, vScale, 1); |
---|
7823 | | - LA.matScale(toParent, 1, 1, totalScale); |
---|
| 7897 | + if (modified && opposite) |
---|
| 7898 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7899 | + else |
---|
| 7900 | + //LA.matScale(toParent, hScale, vScale, 1); |
---|
| 7901 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7824 | 7902 | } else |
---|
7825 | 7903 | { |
---|
7826 | 7904 | LA.matScale(toParent, totalScale, totalScale, 1); |
---|