Normand Briere
2019-08-15 33504fc9a180903aace77613264550754fba5706
Object3D.java
....@@ -2468,6 +2468,11 @@
24682468 else
24692469 {
24702470 //((ObjEditor)editWindow).SetupUI2(null);
2471
+ if (objectUI != null)
2472
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
2473
+ else
2474
+ //new Exception().printStackTrace();
2475
+ System.err.println("objectUI is null");
24712476 }
24722477 }
24732478
....@@ -5569,6 +5574,11 @@
55695574 if (fullname == null)
55705575 return "";
55715576
5577
+ if (fullname.pigment != null)
5578
+ {
5579
+ return fullname.pigment;
5580
+ }
5581
+
55725582 // System.out.println("Fullname = " + fullname);
55735583
55745584 // Does not work on Windows due to C:
....@@ -5581,7 +5591,7 @@
55815591
55825592 if (split.length == 0)
55835593 {
5584
- return "";
5594
+ return fullname.pigment = "";
55855595 }
55865596
55875597 if (split.length <= 2)
....@@ -5589,22 +5599,27 @@
55895599 if (fullname.name.endsWith(":"))
55905600 {
55915601 // Windows
5592
- return fullname.name.substring(0, fullname.name.length()-1);
5602
+ return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1);
55935603 }
55945604
5595
- return split[0];
5605
+ return fullname.pigment = split[0];
55965606 }
55975607
55985608 // Windows
55995609 assert(split.length == 4);
56005610
5601
- return split[0] + ":" + split[1];
5611
+ return fullname.pigment = split[0] + ":" + split[1];
56025612 }
56035613
56045614 static String GetBump(cTexture fullname)
56055615 {
56065616 if (fullname == null)
56075617 return "";
5618
+
5619
+ if (fullname.bump != null)
5620
+ {
5621
+ return fullname.bump;
5622
+ }
56085623
56095624 // System.out.println("Fullname = " + fullname);
56105625 // Does not work on Windows due to C:
....@@ -5616,12 +5631,12 @@
56165631
56175632 if (split.length == 0)
56185633 {
5619
- return "";
5634
+ return fullname.bump = "";
56205635 }
56215636
56225637 if (split.length == 1)
56235638 {
5624
- return "";
5639
+ return fullname.bump = "";
56255640 }
56265641
56275642 if (split.length == 2)
....@@ -5629,16 +5644,16 @@
56295644 if (fullname.name.endsWith(":"))
56305645 {
56315646 // Windows
5632
- return "";
5647
+ return fullname.bump = "";
56335648 }
56345649
5635
- return split[1];
5650
+ return fullname.bump = split[1];
56365651 }
56375652
56385653 // Windows
56395654 assert(split.length == 4);
56405655
5641
- return split[2] + ":" + split[3];
5656
+ return fullname.bump = split[2] + ":" + split[3];
56425657 }
56435658
56445659 String GetPigmentTexture()
....@@ -5721,6 +5736,9 @@
57215736 texname = "";
57225737
57235738 GetTextures().name = texname + ":" + GetBump(GetTextures());
5739
+
5740
+ GetTextures().pigment = null;
5741
+
57245742 Touch();
57255743 }
57265744
....@@ -5793,6 +5811,8 @@
57935811 texname = "";
57945812
57955813 GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname;
5814
+
5815
+ GetTextures().bump = null;
57965816
57975817 Touch();
57985818 }
....@@ -7417,7 +7437,29 @@
74177437 // {
74187438 // CameraPane.Ymax = spoth;
74197439 // }
7420
- 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);
74217463 spotw = spot.x + spot.width;
74227464 spoth = spot.y + spot.height;
74237465 clickInfo.g.setColor(Color.cyan);
....@@ -7438,28 +7480,7 @@
74387480 // {
74397481 // CameraPane.Ymax = spoth;
74407482 // }
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);
74467483 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
-// }
74637484 clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
74647485 (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
74657486 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
....@@ -7518,12 +7539,14 @@
75187539 retval = true;
75197540 }
75207541 spot.translate(0, 32);
7542
+ spot.translate(32, 0);
7543
+ spot.translate(0, 32);
75217544 if (spot.contains(clickInfo.x, clickInfo.y))
75227545 {
75237546 hitSomething = hitScale;
75247547
75257548 double scale = 0.005f * clickInfo.camera.Distance();
7526
- double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7549
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
75277550 double sign = 1;
75287551 if (hScale < 0)
75297552 {
....@@ -7535,7 +7558,7 @@
75357558 //hScale = 0.01;
75367559 }
75377560
7538
- double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7561
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
75397562 sign = 1;
75407563 if (vScale < 0)
75417564 {
....@@ -7750,7 +7773,7 @@
77507773 break;
77517774
77527775 case hitScale: // scale
7753
- double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7776
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
77547777 double sign = 1;
77557778 if (hScale < 0)
77567779 {
....@@ -7762,7 +7785,7 @@
77627785 //hScale = 0.01;
77637786 }
77647787
7765
- double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7788
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
77667789 sign = 1;
77677790 if (vScale < 0)
77687791 {