.. | .. |
---|
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() |
---|
.. | .. |
---|
5574 | 5576 | if (fullname == null) |
---|
5575 | 5577 | return ""; |
---|
5576 | 5578 | |
---|
| 5579 | + if (fullname.pigment != null) |
---|
| 5580 | + { |
---|
| 5581 | + return fullname.pigment; |
---|
| 5582 | + } |
---|
| 5583 | + |
---|
5577 | 5584 | // System.out.println("Fullname = " + fullname); |
---|
5578 | 5585 | |
---|
5579 | 5586 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5586 | 5593 | |
---|
5587 | 5594 | if (split.length == 0) |
---|
5588 | 5595 | { |
---|
5589 | | - return ""; |
---|
| 5596 | + return fullname.pigment = ""; |
---|
5590 | 5597 | } |
---|
5591 | 5598 | |
---|
5592 | 5599 | if (split.length <= 2) |
---|
.. | .. |
---|
5594 | 5601 | if (fullname.name.endsWith(":")) |
---|
5595 | 5602 | { |
---|
5596 | 5603 | // Windows |
---|
5597 | | - return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5604 | + return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1); |
---|
5598 | 5605 | } |
---|
5599 | 5606 | |
---|
5600 | | - return split[0]; |
---|
| 5607 | + return fullname.pigment = split[0]; |
---|
5601 | 5608 | } |
---|
5602 | 5609 | |
---|
5603 | 5610 | // Windows |
---|
5604 | 5611 | assert(split.length == 4); |
---|
5605 | 5612 | |
---|
5606 | | - return split[0] + ":" + split[1]; |
---|
| 5613 | + return fullname.pigment = split[0] + ":" + split[1]; |
---|
5607 | 5614 | } |
---|
5608 | 5615 | |
---|
5609 | 5616 | static String GetBump(cTexture fullname) |
---|
5610 | 5617 | { |
---|
5611 | 5618 | if (fullname == null) |
---|
5612 | 5619 | return ""; |
---|
| 5620 | + |
---|
| 5621 | + if (fullname.bump != null) |
---|
| 5622 | + { |
---|
| 5623 | + return fullname.bump; |
---|
| 5624 | + } |
---|
5613 | 5625 | |
---|
5614 | 5626 | // System.out.println("Fullname = " + fullname); |
---|
5615 | 5627 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5621 | 5633 | |
---|
5622 | 5634 | if (split.length == 0) |
---|
5623 | 5635 | { |
---|
5624 | | - return ""; |
---|
| 5636 | + return fullname.bump = ""; |
---|
5625 | 5637 | } |
---|
5626 | 5638 | |
---|
5627 | 5639 | if (split.length == 1) |
---|
5628 | 5640 | { |
---|
5629 | | - return ""; |
---|
| 5641 | + return fullname.bump = ""; |
---|
5630 | 5642 | } |
---|
5631 | 5643 | |
---|
5632 | 5644 | if (split.length == 2) |
---|
.. | .. |
---|
5634 | 5646 | if (fullname.name.endsWith(":")) |
---|
5635 | 5647 | { |
---|
5636 | 5648 | // Windows |
---|
5637 | | - return ""; |
---|
| 5649 | + return fullname.bump = ""; |
---|
5638 | 5650 | } |
---|
5639 | 5651 | |
---|
5640 | | - return split[1]; |
---|
| 5652 | + return fullname.bump = split[1]; |
---|
5641 | 5653 | } |
---|
5642 | 5654 | |
---|
5643 | 5655 | // Windows |
---|
5644 | 5656 | assert(split.length == 4); |
---|
5645 | 5657 | |
---|
5646 | | - return split[2] + ":" + split[3]; |
---|
| 5658 | + return fullname.bump = split[2] + ":" + split[3]; |
---|
5647 | 5659 | } |
---|
5648 | 5660 | |
---|
5649 | 5661 | String GetPigmentTexture() |
---|
.. | .. |
---|
5726 | 5738 | texname = ""; |
---|
5727 | 5739 | |
---|
5728 | 5740 | GetTextures().name = texname + ":" + GetBump(GetTextures()); |
---|
| 5741 | + |
---|
| 5742 | + GetTextures().pigment = null; |
---|
| 5743 | + |
---|
5729 | 5744 | Touch(); |
---|
5730 | 5745 | } |
---|
5731 | 5746 | |
---|
.. | .. |
---|
5798 | 5813 | texname = ""; |
---|
5799 | 5814 | |
---|
5800 | 5815 | GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname; |
---|
| 5816 | + |
---|
| 5817 | + GetTextures().bump = null; |
---|
5801 | 5818 | |
---|
5802 | 5819 | Touch(); |
---|
5803 | 5820 | } |
---|
.. | .. |
---|
7402 | 7419 | boundary.y = spot.y - 30; |
---|
7403 | 7420 | boundary.width = spot.width + 60; |
---|
7404 | 7421 | boundary.height = spot.height + 60; |
---|
7405 | | - clickInfo.g.setColor(Color.red); |
---|
| 7422 | + clickInfo.g.setColor(Color.white); |
---|
7406 | 7423 | int spotw = spot.x + spot.width; |
---|
7407 | 7424 | int spoth = spot.y + spot.height; |
---|
7408 | 7425 | clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
.. | .. |
---|
7422 | 7439 | // { |
---|
7423 | 7440 | // CameraPane.Ymax = spoth; |
---|
7424 | 7441 | // } |
---|
7425 | | - 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); |
---|
7426 | 7465 | spotw = spot.x + spot.width; |
---|
7427 | 7466 | spoth = spot.y + spot.height; |
---|
7428 | 7467 | clickInfo.g.setColor(Color.cyan); |
---|
.. | .. |
---|
7443 | 7482 | // { |
---|
7444 | 7483 | // CameraPane.Ymax = spoth; |
---|
7445 | 7484 | // } |
---|
7446 | | - // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
7447 | | - //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
7448 | | - spot.translate(0, -32); |
---|
7449 | | - clickInfo.g.setColor(Color.yellow); |
---|
7450 | | - clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
7451 | 7485 | clickInfo.g.setColor(Color.green); |
---|
7452 | | -// if (CameraPane.Xmin > spot.x) |
---|
7453 | | -// { |
---|
7454 | | -// CameraPane.Xmin = spot.x; |
---|
7455 | | -// } |
---|
7456 | | -// if (CameraPane.Xmax < spotw) |
---|
7457 | | -// { |
---|
7458 | | -// CameraPane.Xmax = spotw; |
---|
7459 | | -// } |
---|
7460 | | -// if (CameraPane.Ymin > spot.y) |
---|
7461 | | -// { |
---|
7462 | | -// CameraPane.Ymin = spot.y; |
---|
7463 | | -// } |
---|
7464 | | -// if (CameraPane.Ymax < spoth) |
---|
7465 | | -// { |
---|
7466 | | -// CameraPane.Ymax = spoth; |
---|
7467 | | -// } |
---|
7468 | 7486 | clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
7469 | 7487 | (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7470 | 7488 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
.. | .. |
---|
7523 | 7541 | retval = true; |
---|
7524 | 7542 | } |
---|
7525 | 7543 | spot.translate(0, 32); |
---|
| 7544 | + spot.translate(32, 0); |
---|
| 7545 | + spot.translate(0, 32); |
---|
7526 | 7546 | if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7527 | 7547 | { |
---|
7528 | 7548 | hitSomething = hitScale; |
---|
7529 | 7549 | |
---|
7530 | 7550 | double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7531 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7551 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7532 | 7552 | double sign = 1; |
---|
7533 | 7553 | if (hScale < 0) |
---|
7534 | 7554 | { |
---|
.. | .. |
---|
7540 | 7560 | //hScale = 0.01; |
---|
7541 | 7561 | } |
---|
7542 | 7562 | |
---|
7543 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7563 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7544 | 7564 | sign = 1; |
---|
7545 | 7565 | if (vScale < 0) |
---|
7546 | 7566 | { |
---|
.. | .. |
---|
7755 | 7775 | break; |
---|
7756 | 7776 | |
---|
7757 | 7777 | case hitScale: // scale |
---|
7758 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7778 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7759 | 7779 | double sign = 1; |
---|
7760 | 7780 | if (hScale < 0) |
---|
7761 | 7781 | { |
---|
.. | .. |
---|
7767 | 7787 | //hScale = 0.01; |
---|
7768 | 7788 | } |
---|
7769 | 7789 | |
---|
7770 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7790 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7771 | 7791 | sign = 1; |
---|
7772 | 7792 | if (vScale < 0) |
---|
7773 | 7793 | { |
---|
.. | .. |
---|
7800 | 7820 | case 3: // '\001' |
---|
7801 | 7821 | if (modified || opposite) |
---|
7802 | 7822 | { |
---|
| 7823 | + if (modified && opposite) |
---|
| 7824 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7825 | + else |
---|
7803 | 7826 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7804 | | - LA.matScale(toParent, totalScale, 1, 1); |
---|
| 7827 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7805 | 7828 | } // vScale, 1); |
---|
7806 | 7829 | else |
---|
7807 | 7830 | { |
---|
7808 | 7831 | // EXCEPTION! |
---|
7809 | | - LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
| 7832 | + LA.matScale(toParent, 1, totalScale, totalScale); |
---|
7810 | 7833 | } // vScale, 1); |
---|
7811 | 7834 | break; |
---|
7812 | 7835 | |
---|
7813 | 7836 | case 2: // '\002' |
---|
7814 | 7837 | if (modified || opposite) |
---|
7815 | 7838 | { |
---|
7816 | | - //LA.matScale(toParent, hScale, 1, vScale); |
---|
7817 | | - 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); |
---|
7818 | 7844 | } else |
---|
7819 | 7845 | { |
---|
7820 | 7846 | LA.matScale(toParent, totalScale, 1, totalScale); |
---|
.. | .. |
---|
7824 | 7850 | case 1: // '\003' |
---|
7825 | 7851 | if (modified || opposite) |
---|
7826 | 7852 | { |
---|
7827 | | - //LA.matScale(toParent, hScale, vScale, 1); |
---|
7828 | | - 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); |
---|
7829 | 7858 | } else |
---|
7830 | 7859 | { |
---|
7831 | 7860 | LA.matScale(toParent, totalScale, totalScale, 1); |
---|