.. | .. |
---|
5574 | 5574 | if (fullname == null) |
---|
5575 | 5575 | return ""; |
---|
5576 | 5576 | |
---|
| 5577 | + if (fullname.pigment != null) |
---|
| 5578 | + { |
---|
| 5579 | + return fullname.pigment; |
---|
| 5580 | + } |
---|
| 5581 | + |
---|
5577 | 5582 | // System.out.println("Fullname = " + fullname); |
---|
5578 | 5583 | |
---|
5579 | 5584 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5586 | 5591 | |
---|
5587 | 5592 | if (split.length == 0) |
---|
5588 | 5593 | { |
---|
5589 | | - return ""; |
---|
| 5594 | + return fullname.pigment = ""; |
---|
5590 | 5595 | } |
---|
5591 | 5596 | |
---|
5592 | 5597 | if (split.length <= 2) |
---|
.. | .. |
---|
5594 | 5599 | if (fullname.name.endsWith(":")) |
---|
5595 | 5600 | { |
---|
5596 | 5601 | // Windows |
---|
5597 | | - return fullname.name.substring(0, fullname.name.length()-1); |
---|
| 5602 | + return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1); |
---|
5598 | 5603 | } |
---|
5599 | 5604 | |
---|
5600 | | - return split[0]; |
---|
| 5605 | + return fullname.pigment = split[0]; |
---|
5601 | 5606 | } |
---|
5602 | 5607 | |
---|
5603 | 5608 | // Windows |
---|
5604 | 5609 | assert(split.length == 4); |
---|
5605 | 5610 | |
---|
5606 | | - return split[0] + ":" + split[1]; |
---|
| 5611 | + return fullname.pigment = split[0] + ":" + split[1]; |
---|
5607 | 5612 | } |
---|
5608 | 5613 | |
---|
5609 | 5614 | static String GetBump(cTexture fullname) |
---|
5610 | 5615 | { |
---|
5611 | 5616 | if (fullname == null) |
---|
5612 | 5617 | return ""; |
---|
| 5618 | + |
---|
| 5619 | + if (fullname.bump != null) |
---|
| 5620 | + { |
---|
| 5621 | + return fullname.bump; |
---|
| 5622 | + } |
---|
5613 | 5623 | |
---|
5614 | 5624 | // System.out.println("Fullname = " + fullname); |
---|
5615 | 5625 | // Does not work on Windows due to C: |
---|
.. | .. |
---|
5621 | 5631 | |
---|
5622 | 5632 | if (split.length == 0) |
---|
5623 | 5633 | { |
---|
5624 | | - return ""; |
---|
| 5634 | + return fullname.bump = ""; |
---|
5625 | 5635 | } |
---|
5626 | 5636 | |
---|
5627 | 5637 | if (split.length == 1) |
---|
5628 | 5638 | { |
---|
5629 | | - return ""; |
---|
| 5639 | + return fullname.bump = ""; |
---|
5630 | 5640 | } |
---|
5631 | 5641 | |
---|
5632 | 5642 | if (split.length == 2) |
---|
.. | .. |
---|
5634 | 5644 | if (fullname.name.endsWith(":")) |
---|
5635 | 5645 | { |
---|
5636 | 5646 | // Windows |
---|
5637 | | - return ""; |
---|
| 5647 | + return fullname.bump = ""; |
---|
5638 | 5648 | } |
---|
5639 | 5649 | |
---|
5640 | | - return split[1]; |
---|
| 5650 | + return fullname.bump = split[1]; |
---|
5641 | 5651 | } |
---|
5642 | 5652 | |
---|
5643 | 5653 | // Windows |
---|
5644 | 5654 | assert(split.length == 4); |
---|
5645 | 5655 | |
---|
5646 | | - return split[2] + ":" + split[3]; |
---|
| 5656 | + return fullname.bump = split[2] + ":" + split[3]; |
---|
5647 | 5657 | } |
---|
5648 | 5658 | |
---|
5649 | 5659 | String GetPigmentTexture() |
---|
.. | .. |
---|
5726 | 5736 | texname = ""; |
---|
5727 | 5737 | |
---|
5728 | 5738 | GetTextures().name = texname + ":" + GetBump(GetTextures()); |
---|
| 5739 | + |
---|
| 5740 | + GetTextures().pigment = null; |
---|
| 5741 | + |
---|
5729 | 5742 | Touch(); |
---|
5730 | 5743 | } |
---|
5731 | 5744 | |
---|
.. | .. |
---|
5798 | 5811 | texname = ""; |
---|
5799 | 5812 | |
---|
5800 | 5813 | GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname; |
---|
| 5814 | + |
---|
| 5815 | + GetTextures().bump = null; |
---|
5801 | 5816 | |
---|
5802 | 5817 | Touch(); |
---|
5803 | 5818 | } |
---|
.. | .. |
---|
7422 | 7437 | // { |
---|
7423 | 7438 | // CameraPane.Ymax = spoth; |
---|
7424 | 7439 | // } |
---|
7425 | | - spot.translate(32, 32); |
---|
| 7440 | +// if (CameraPane.Xmin > spot.x) |
---|
| 7441 | +// { |
---|
| 7442 | +// CameraPane.Xmin = spot.x; |
---|
| 7443 | +// } |
---|
| 7444 | +// if (CameraPane.Xmax < spotw) |
---|
| 7445 | +// { |
---|
| 7446 | +// CameraPane.Xmax = spotw; |
---|
| 7447 | +// } |
---|
| 7448 | +// if (CameraPane.Ymin > spot.y) |
---|
| 7449 | +// { |
---|
| 7450 | +// CameraPane.Ymin = spot.y; |
---|
| 7451 | +// } |
---|
| 7452 | +// if (CameraPane.Ymax < spoth) |
---|
| 7453 | +// { |
---|
| 7454 | +// CameraPane.Ymax = spoth; |
---|
| 7455 | +// } |
---|
| 7456 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7457 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
| 7458 | + spot.translate(32, 0); |
---|
| 7459 | + clickInfo.g.setColor(Color.yellow); |
---|
| 7460 | + clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7461 | + |
---|
| 7462 | + spot.translate(32, 64); |
---|
7426 | 7463 | spotw = spot.x + spot.width; |
---|
7427 | 7464 | spoth = spot.y + spot.height; |
---|
7428 | 7465 | clickInfo.g.setColor(Color.cyan); |
---|
.. | .. |
---|
7443 | 7480 | // { |
---|
7444 | 7481 | // CameraPane.Ymax = spoth; |
---|
7445 | 7482 | // } |
---|
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 | 7483 | 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 | 7484 | clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY, |
---|
7469 | 7485 | (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360); |
---|
7470 | 7486 | //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360); |
---|
.. | .. |
---|
7523 | 7539 | retval = true; |
---|
7524 | 7540 | } |
---|
7525 | 7541 | spot.translate(0, 32); |
---|
| 7542 | + spot.translate(32, 0); |
---|
| 7543 | + spot.translate(0, 32); |
---|
7526 | 7544 | if (spot.contains(clickInfo.x, clickInfo.y)) |
---|
7527 | 7545 | { |
---|
7528 | 7546 | hitSomething = hitScale; |
---|
7529 | 7547 | |
---|
7530 | 7548 | double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7531 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7549 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7532 | 7550 | double sign = 1; |
---|
7533 | 7551 | if (hScale < 0) |
---|
7534 | 7552 | { |
---|
.. | .. |
---|
7540 | 7558 | //hScale = 0.01; |
---|
7541 | 7559 | } |
---|
7542 | 7560 | |
---|
7543 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7561 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7544 | 7562 | sign = 1; |
---|
7545 | 7563 | if (vScale < 0) |
---|
7546 | 7564 | { |
---|
.. | .. |
---|
7755 | 7773 | break; |
---|
7756 | 7774 | |
---|
7757 | 7775 | case hitScale: // scale |
---|
7758 | | - double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
| 7776 | + double hScale = (double) (clickInfo.x - centerPt.x) / 64; |
---|
7759 | 7777 | double sign = 1; |
---|
7760 | 7778 | if (hScale < 0) |
---|
7761 | 7779 | { |
---|
.. | .. |
---|
7767 | 7785 | //hScale = 0.01; |
---|
7768 | 7786 | } |
---|
7769 | 7787 | |
---|
7770 | | - double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
| 7788 | + double vScale = (double) (clickInfo.y - centerPt.y) / 64; |
---|
7771 | 7789 | sign = 1; |
---|
7772 | 7790 | if (vScale < 0) |
---|
7773 | 7791 | { |
---|