.. | .. |
---|
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() |
---|
.. | .. |
---|
2468 | 2470 | else |
---|
2469 | 2471 | { |
---|
2470 | 2472 | //((ObjEditor)editWindow).SetupUI2(null); |
---|
2471 | | - ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
| 2473 | + if (objectUI != null) |
---|
| 2474 | + ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
| 2475 | + else |
---|
| 2476 | + //new Exception().printStackTrace(); |
---|
| 2477 | + System.err.println("objectUI is null"); |
---|
2472 | 2478 | } |
---|
2473 | 2479 | } |
---|
2474 | 2480 | |
---|
.. | .. |
---|
5570 | 5576 | if (fullname == null) |
---|
5571 | 5577 | return ""; |
---|
5572 | 5578 | |
---|
| 5579 | + if (fullname.pigment != null) |
---|
| 5580 | + { |
---|
| 5581 | + return fullname.pigment; |
---|
| 5582 | + } |
---|
| 5583 | + |
---|
5573 | 5584 | // System.out.println("Fullname = " + fullname); |
---|
5574 | 5585 | |
---|
5575 | 5586 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5582 | 5593 | |
---|
5583 | 5594 | if (split.length == 0) |
---|
5584 | 5595 | { |
---|
5585 | | - return ""; |
---|
| 5596 | + return fullname.pigment = ""; |
---|
5586 | 5597 | } |
---|
5587 | 5598 | |
---|
5588 | 5599 | if (split.length <= 2) |
---|
.. | .. |
---|
5590 | 5601 | if (fullname.name.endsWith(":")) |
---|
5591 | 5602 | { |
---|
5592 | 5603 | // Windows |
---|
5593 | | - return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5604 | + return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1); |
---|
5594 | 5605 | } |
---|
5595 | 5606 | |
---|
5596 | | - return split[0]; |
---|
| 5607 | + return fullname.pigment = split[0]; |
---|
5597 | 5608 | } |
---|
5598 | 5609 | |
---|
5599 | 5610 | // Windows |
---|
5600 | 5611 | assert(split.length == 4); |
---|
5601 | 5612 | |
---|
5602 | | - return split[0] + ":" + split[1]; |
---|
| 5613 | + return fullname.pigment = split[0] + ":" + split[1]; |
---|
5603 | 5614 | } |
---|
5604 | 5615 | |
---|
5605 | 5616 | static String GetBump(cTexture fullname) |
---|
5606 | 5617 | { |
---|
5607 | 5618 | if (fullname == null) |
---|
5608 | 5619 | return ""; |
---|
| 5620 | + |
---|
| 5621 | + if (fullname.bump != null) |
---|
| 5622 | + { |
---|
| 5623 | + return fullname.bump; |
---|
| 5624 | + } |
---|
5609 | 5625 | |
---|
5610 | 5626 | // System.out.println("Fullname = " + fullname); |
---|
5611 | 5627 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5617 | 5633 | |
---|
5618 | 5634 | if (split.length == 0) |
---|
5619 | 5635 | { |
---|
5620 | | - return ""; |
---|
| 5636 | + return fullname.bump = ""; |
---|
5621 | 5637 | } |
---|
5622 | 5638 | |
---|
5623 | 5639 | if (split.length == 1) |
---|
5624 | 5640 | { |
---|
5625 | | - return ""; |
---|
| 5641 | + return fullname.bump = ""; |
---|
5626 | 5642 | } |
---|
5627 | 5643 | |
---|
5628 | 5644 | if (split.length == 2) |
---|
.. | .. |
---|
5630 | 5646 | if (fullname.name.endsWith(":")) |
---|
5631 | 5647 | { |
---|
5632 | 5648 | // Windows |
---|
5633 | | - return ""; |
---|
| 5649 | + return fullname.bump = ""; |
---|
5634 | 5650 | } |
---|
5635 | 5651 | |
---|
5636 | | - return split[1]; |
---|
| 5652 | + return fullname.bump = split[1]; |
---|
5637 | 5653 | } |
---|
5638 | 5654 | |
---|
5639 | 5655 | // Windows |
---|
5640 | 5656 | assert(split.length == 4); |
---|
5641 | 5657 | |
---|
5642 | | - return split[2] + ":" + split[3]; |
---|
| 5658 | + return fullname.bump = split[2] + ":" + split[3]; |
---|
5643 | 5659 | } |
---|
5644 | 5660 | |
---|
5645 | 5661 | String GetPigmentTexture() |
---|
.. | .. |
---|
5722 | 5738 | texname = ""; |
---|
5723 | 5739 | |
---|
5724 | 5740 | GetTextures().name = texname + ":" + GetBump(GetTextures()); |
---|
| 5741 | + |
---|
| 5742 | + GetTextures().pigment = null; |
---|
| 5743 | + |
---|
5725 | 5744 | Touch(); |
---|
5726 | 5745 | } |
---|
5727 | 5746 | |
---|
.. | .. |
---|
5794 | 5813 | texname = ""; |
---|
5795 | 5814 | |
---|
5796 | 5815 | GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname; |
---|
| 5816 | + |
---|
| 5817 | + GetTextures().bump = null; |
---|
5797 | 5818 | |
---|
5798 | 5819 | Touch(); |
---|
5799 | 5820 | } |
---|
.. | .. |
---|
7398 | 7419 | boundary.y = spot.y - 30; |
---|
7399 | 7420 | boundary.width = spot.width + 60; |
---|
7400 | 7421 | boundary.height = spot.height + 60; |
---|
7401 | | - clickInfo.g.setColor(Color.red); |
---|
| 7422 | + clickInfo.g.setColor(Color.white); |
---|
7402 | 7423 | int spotw = spot.x + spot.width; |
---|
7403 | 7424 | int spoth = spot.y + spot.height; |
---|
7404 | 7425 | clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
.. | .. |
---|
7418 | 7439 | // { |
---|
7419 | 7440 | // CameraPane.Ymax = spoth; |
---|
7420 | 7441 | // } |
---|
7421 | | - spot.translate(32, 32); |
---|
| 7442 | +// if (CameraPane.Xmin > spot.x) |
---|
| 7443 | +// { |
---|
| 7444 | +// CameraPane.Xmin = spot.x; |
---|
| 7445 | +// } |
---|
| 7446 | +// if (CameraPane.Xmax < spotw) |
---|
| 7447 | +// { |
---|
| 7448 | +// CameraPane.Xmax = spotw; |
---|
| 7449 | +// } |
---|
| 7450 | +// if (CameraPane.Ymin > spot.y) |
---|
| 7451 | +// { |
---|
| 7452 | +// CameraPane.Ymin = spot.y; |
---|
| 7453 | +// } |
---|
| 7454 | +// if (CameraPane.Ymax < spoth) |
---|
| 7455 | +// { |
---|
| 7456 | +// CameraPane.Ymax = spoth; |
---|
| 7457 | +// } |
---|
| 7458 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7459 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
| 7460 | + spot.translate(32, 0); |
---|
| 7461 | + clickInfo.g.setColor(Color.yellow); |
---|
| 7462 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7463 | + |
---|
| 7464 | + spot.translate(32, 64); |
---|
7422 | 7465 | spotw = spot.x + spot.width; |
---|
7423 | 7466 | spoth = spot.y + spot.height; |
---|
7424 | 7467 | clickInfo.g.setColor(Color.cyan); |
---|
.. | .. |
---|
7439 | 7482 | // { |
---|
7440 | 7483 | // CameraPane.Ymax = spoth; |
---|
7441 | 7484 | // } |
---|
7442 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
7443 | | - //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7444 | | - spot.translate(0, -32); |
---|
7445 | | - clickInfo.g.setColor(Color.yellow); |
---|
7446 | | - clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7447 | 7485 | clickInfo.g.setColor(Color.green); |
---|
7448 | | -// if (CameraPane.Xmin > spot.x) |
---|
7449 | | -// { |
---|
7450 | | -// CameraPane.Xmin = spot.x; |
---|
7451 | | -// } |
---|
7452 | | -// if (CameraPane.Xmax < spotw) |
---|
7453 | | -// { |
---|
7454 | | -// CameraPane.Xmax = spotw; |
---|
7455 | | -// } |
---|
7456 | | -// if (CameraPane.Ymin > spot.y) |
---|
7457 | | -// { |
---|
7458 | | -// CameraPane.Ymin = spot.y; |
---|
7459 | | -// } |
---|
7460 | | -// if (CameraPane.Ymax < spoth) |
---|
7461 | | -// { |
---|
7462 | | -// CameraPane.Ymax = spoth; |
---|
7463 | | -// } |
---|
7464 | 7486 | clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
7465 | 7487 | (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7466 | 7488 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
.. | .. |
---|
7519 | 7541 | retval = true; |
---|
7520 | 7542 | } |
---|
7521 | 7543 | spot.translate(0, 32); |
---|
| 7544 | + spot.translate(32, 0); |
---|
| 7545 | + spot.translate(0, 32); |
---|
7522 | 7546 | if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7523 | 7547 | { |
---|
7524 | 7548 | hitSomething = hitScale; |
---|
7525 | 7549 | |
---|
7526 | 7550 | double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7527 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7551 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7528 | 7552 | double sign = 1; |
---|
7529 | 7553 | if (hScale < 0) |
---|
7530 | 7554 | { |
---|
.. | .. |
---|
7536 | 7560 | //hScale = 0.01; |
---|
7537 | 7561 | } |
---|
7538 | 7562 | |
---|
7539 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7563 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7540 | 7564 | sign = 1; |
---|
7541 | 7565 | if (vScale < 0) |
---|
7542 | 7566 | { |
---|
.. | .. |
---|
7751 | 7775 | break; |
---|
7752 | 7776 | |
---|
7753 | 7777 | case hitScale: // scale |
---|
7754 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7778 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7755 | 7779 | double sign = 1; |
---|
7756 | 7780 | if (hScale < 0) |
---|
7757 | 7781 | { |
---|
.. | .. |
---|
7763 | 7787 | //hScale = 0.01; |
---|
7764 | 7788 | } |
---|
7765 | 7789 | |
---|
7766 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7790 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7767 | 7791 | sign = 1; |
---|
7768 | 7792 | if (vScale < 0) |
---|
7769 | 7793 | { |
---|
.. | .. |
---|
7796 | 7820 | case 3: // '\001' |
---|
7797 | 7821 | if (modified || opposite) |
---|
7798 | 7822 | { |
---|
| 7823 | + if (modified && opposite) |
---|
| 7824 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7825 | + else |
---|
7799 | 7826 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7800 | | - LA.matScale(toParent, totalScale, 1, 1); |
---|
| 7827 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7801 | 7828 | } // vScale, 1); |
---|
7802 | 7829 | else |
---|
7803 | 7830 | { |
---|
7804 | 7831 | // EXCEPTION! |
---|
7805 | | - LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7832 | + LA.matScale(toParent, 1, totalScale, totalScale); |
---|
7806 | 7833 | } // vScale, 1); |
---|
7807 | 7834 | break; |
---|
7808 | 7835 | |
---|
7809 | 7836 | case 2: // '\002' |
---|
7810 | 7837 | if (modified || opposite) |
---|
7811 | 7838 | { |
---|
7812 | | - //LA.matScale(toParent, hScale, 1, vScale); |
---|
7813 | | - LA.matScale(toParent, 1, totalScale, 1); |
---|
| 7839 | + if (modified && opposite) |
---|
| 7840 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7841 | + else |
---|
| 7842 | + //LA.matScale(toParent, hScale, 1, vScale); |
---|
| 7843 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7814 | 7844 | } else |
---|
7815 | 7845 | { |
---|
7816 | 7846 | LA.matScale(toParent, totalScale, 1, totalScale); |
---|
.. | .. |
---|
7820 | 7850 | case 1: // '\003' |
---|
7821 | 7851 | if (modified || opposite) |
---|
7822 | 7852 | { |
---|
7823 | | - //LA.matScale(toParent, hScale, vScale, 1); |
---|
7824 | | - LA.matScale(toParent, 1, 1, totalScale); |
---|
| 7853 | + if (modified && opposite) |
---|
| 7854 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7855 | + else |
---|
| 7856 | + //LA.matScale(toParent, hScale, vScale, 1); |
---|
| 7857 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7825 | 7858 | } else |
---|
7826 | 7859 | { |
---|
7827 | 7860 | LA.matScale(toParent, totalScale, totalScale, 1); |
---|