Normand Briere
2019-08-16 83d0c2fa0bd2e96448f776144e1a89cdb1bb6998
Object3D.java
....@@ -36,6 +36,8 @@
3636 Object3D versionlist[];
3737 int versionindex = -1;
3838
39
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>();
40
+
3941 ScriptNode scriptnode;
4042
4143 void InitOthers()
....@@ -2468,6 +2470,11 @@
24682470 else
24692471 {
24702472 //((ObjEditor)editWindow).SetupUI2(null);
2473
+ if (objectUI != null)
2474
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
2475
+ else
2476
+ //new Exception().printStackTrace();
2477
+ System.err.println("objectUI is null");
24712478 }
24722479 }
24732480
....@@ -5569,6 +5576,11 @@
55695576 if (fullname == null)
55705577 return "";
55715578
5579
+ if (fullname.pigment != null)
5580
+ {
5581
+ return fullname.pigment;
5582
+ }
5583
+
55725584 // System.out.println("Fullname = " + fullname);
55735585
55745586 // Does not work on Windows due to C:
....@@ -5581,7 +5593,7 @@
55815593
55825594 if (split.length == 0)
55835595 {
5584
- return "";
5596
+ return fullname.pigment = "";
55855597 }
55865598
55875599 if (split.length <= 2)
....@@ -5589,22 +5601,27 @@
55895601 if (fullname.name.endsWith(":"))
55905602 {
55915603 // Windows
5592
- return fullname.name.substring(0, fullname.name.length()-1);
5604
+ return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1);
55935605 }
55945606
5595
- return split[0];
5607
+ return fullname.pigment = split[0];
55965608 }
55975609
55985610 // Windows
55995611 assert(split.length == 4);
56005612
5601
- return split[0] + ":" + split[1];
5613
+ return fullname.pigment = split[0] + ":" + split[1];
56025614 }
56035615
56045616 static String GetBump(cTexture fullname)
56055617 {
56065618 if (fullname == null)
56075619 return "";
5620
+
5621
+ if (fullname.bump != null)
5622
+ {
5623
+ return fullname.bump;
5624
+ }
56085625
56095626 // System.out.println("Fullname = " + fullname);
56105627 // Does not work on Windows due to C:
....@@ -5616,12 +5633,12 @@
56165633
56175634 if (split.length == 0)
56185635 {
5619
- return "";
5636
+ return fullname.bump = "";
56205637 }
56215638
56225639 if (split.length == 1)
56235640 {
5624
- return "";
5641
+ return fullname.bump = "";
56255642 }
56265643
56275644 if (split.length == 2)
....@@ -5629,16 +5646,16 @@
56295646 if (fullname.name.endsWith(":"))
56305647 {
56315648 // Windows
5632
- return "";
5649
+ return fullname.bump = "";
56335650 }
56345651
5635
- return split[1];
5652
+ return fullname.bump = split[1];
56365653 }
56375654
56385655 // Windows
56395656 assert(split.length == 4);
56405657
5641
- return split[2] + ":" + split[3];
5658
+ return fullname.bump = split[2] + ":" + split[3];
56425659 }
56435660
56445661 String GetPigmentTexture()
....@@ -5721,6 +5738,9 @@
57215738 texname = "";
57225739
57235740 GetTextures().name = texname + ":" + GetBump(GetTextures());
5741
+
5742
+ GetTextures().pigment = null;
5743
+
57245744 Touch();
57255745 }
57265746
....@@ -5793,6 +5813,8 @@
57935813 texname = "";
57945814
57955815 GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname;
5816
+
5817
+ GetTextures().bump = null;
57965818
57975819 Touch();
57985820 }
....@@ -7397,7 +7419,7 @@
73977419 boundary.y = spot.y - 30;
73987420 boundary.width = spot.width + 60;
73997421 boundary.height = spot.height + 60;
7400
- clickInfo.g.setColor(Color.red);
7422
+ clickInfo.g.setColor(Color.white);
74017423 int spotw = spot.x + spot.width;
74027424 int spoth = spot.y + spot.height;
74037425 clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
....@@ -7417,7 +7439,29 @@
74177439 // {
74187440 // CameraPane.Ymax = spoth;
74197441 // }
7420
- 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);
74217465 spotw = spot.x + spot.width;
74227466 spoth = spot.y + spot.height;
74237467 clickInfo.g.setColor(Color.cyan);
....@@ -7438,28 +7482,7 @@
74387482 // {
74397483 // CameraPane.Ymax = spoth;
74407484 // }
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);
74467485 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
-// }
74637486 clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
74647487 (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
74657488 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
....@@ -7518,12 +7541,14 @@
75187541 retval = true;
75197542 }
75207543 spot.translate(0, 32);
7544
+ spot.translate(32, 0);
7545
+ spot.translate(0, 32);
75217546 if (spot.contains(clickInfo.x, clickInfo.y))
75227547 {
75237548 hitSomething = hitScale;
75247549
75257550 double scale = 0.005f * clickInfo.camera.Distance();
7526
- double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7551
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
75277552 double sign = 1;
75287553 if (hScale < 0)
75297554 {
....@@ -7535,7 +7560,7 @@
75357560 //hScale = 0.01;
75367561 }
75377562
7538
- double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7563
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
75397564 sign = 1;
75407565 if (vScale < 0)
75417566 {
....@@ -7750,7 +7775,7 @@
77507775 break;
77517776
77527777 case hitScale: // scale
7753
- double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7778
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
77547779 double sign = 1;
77557780 if (hScale < 0)
77567781 {
....@@ -7762,7 +7787,7 @@
77627787 //hScale = 0.01;
77637788 }
77647789
7765
- double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7790
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
77667791 sign = 1;
77677792 if (vScale < 0)
77687793 {
....@@ -7795,21 +7820,27 @@
77957820 case 3: // '\001'
77967821 if (modified || opposite)
77977822 {
7823
+ if (modified && opposite)
7824
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
7825
+ else
77987826 //LA.matScale(toParent, 1, hScale, vScale);
7799
- LA.matScale(toParent, totalScale, 1, 1);
7827
+ LA.matScale(toParent, totalScale, 1, 1);
78007828 } // vScale, 1);
78017829 else
78027830 {
78037831 // EXCEPTION!
7804
- LA.matScale(toParent, totalScale, totalScale, totalScale);
7832
+ LA.matScale(toParent, 1, totalScale, totalScale);
78057833 } // vScale, 1);
78067834 break;
78077835
78087836 case 2: // '\002'
78097837 if (modified || opposite)
78107838 {
7811
- //LA.matScale(toParent, hScale, 1, vScale);
7812
- 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);
78137844 } else
78147845 {
78157846 LA.matScale(toParent, totalScale, 1, totalScale);
....@@ -7819,8 +7850,11 @@
78197850 case 1: // '\003'
78207851 if (modified || opposite)
78217852 {
7822
- //LA.matScale(toParent, hScale, vScale, 1);
7823
- 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);
78247858 } else
78257859 {
78267860 LA.matScale(toParent, totalScale, totalScale, 1);