Normand Briere
2019-08-23 60cec91731a350fe67e9b5ffe7a00d70e9026314
Object3D.java
....@@ -22,12 +22,21 @@
2222 //static final long serialVersionUID = -607422624994562685L;
2323 static final long serialVersionUID = 5022536242724664900L;
2424
25
+ // Use GetUUID for backward compatibility with null.
2526 private UUID uuid = UUID.randomUUID();
2627
27
- // TEMPORARY for mocap undo
28
- mocap.reader.BVHReader.BVHResult bvh;
29
- Object3D skeleton;
28
+ // TEMPORARY for mocap undo. No need to be transient.
29
+ mocap.reader.BVHReader.BVHResult savebvh;
30
+ Object3D saveskeleton;
3031 //
32
+
33
+ String skyboxname;
34
+ String skyboxext;
35
+
36
+ Object3D versionlist[];
37
+ int versionindex = -1;
38
+
39
+ java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>();
3140
3241 ScriptNode scriptnode;
3342
....@@ -170,24 +179,35 @@
170179
171180 void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
172181 {
182
+ Object3D o;
183
+
173184 if (hashtable.containsKey(GetUUID()))
174185 {
175
- Object3D o = hashtable.get(GetUUID());
186
+ o = hashtable.get(GetUUID());
176187
177188 Grafreed.Assert(this.bRep == o.bRep);
178
- if (this.bRep != null)
179
- assert(this.bRep.support == o.transientrep);
189
+ //if (this.bRep != null)
190
+ // assert(this.bRep.support == o.transientrep);
191
+ if (this.support != null)
192
+ assert(this.support.bRep == o.transientrep);
193
+ }
194
+ else
195
+ {
196
+ o = new Object3D("copy of " + this.name);
180197
181
- return;
198
+ hashtable.put(GetUUID(), o);
182199 }
183200
184
- Object3D o = new Object3D();
185
-
186
- hashtable.put(GetUUID(), o);
187
-
188
- for (int i=0; i<Size(); i++)
201
+ if (!blockloop)
189202 {
190
- get(i).ExtractBigData(hashtable);
203
+ blockloop = true;
204
+
205
+ for (int i=0; i<Size(); i++)
206
+ {
207
+ get(i).ExtractBigData(hashtable);
208
+ }
209
+
210
+ blockloop = false;
191211 }
192212
193213 ExtractBigData(o);
....@@ -195,11 +215,26 @@
195215
196216 void ExtractBigData(Object3D o)
197217 {
218
+ if (o.bRep != null)
219
+ Grafreed.Assert(o.bRep == this.bRep);
220
+
198221 o.bRep = this.bRep;
199
- if (this.bRep != null)
222
+// July 2019 if (this.bRep != null)
223
+// {
224
+// o.transientrep = this.bRep.support;
225
+// o.bRep.support = null;
226
+// }
227
+ o.selection = this.selection;
228
+ o.versionlist = this.versionlist;
229
+ o.versionindex = this.versionindex;
230
+
231
+ if (this.support != null)
200232 {
201
- o.transientrep = this.bRep.support;
202
- o.bRep.support = null;
233
+ if (o.transientrep != null)
234
+ Grafreed.Assert(o.transientrep == this.support.bRep);
235
+
236
+ o.transientrep = this.support.bRep;
237
+ this.support.bRep = null;
203238 }
204239
205240 // o.support = this.support;
....@@ -214,6 +249,73 @@
214249 // this.fileparent = null;
215250 }
216251
252
+// Object3D GetObject(java.util.UUID uuid)
253
+// {
254
+// if (this.uuid.equals(uuid))
255
+// return this;
256
+//
257
+// if (blockloop)
258
+// return null;
259
+//
260
+// blockloop = true;
261
+//
262
+// for (int i=0; i<Size(); i++)
263
+// {
264
+// Object3D o = get(i).GetObject(uuid);
265
+//
266
+// if (o != null)
267
+// return o;
268
+// }
269
+//
270
+// blockloop = false;
271
+//
272
+// return null;
273
+// }
274
+
275
+ transient boolean tag;
276
+
277
+ void TagObjects(Object3D o, boolean tag)
278
+ {
279
+ if (blockloop)
280
+ return;
281
+
282
+ o.tag = tag;
283
+
284
+ if (o == this)
285
+ return;
286
+
287
+ blockloop = true;
288
+
289
+ for (int i=0; i<Size(); i++)
290
+ {
291
+ get(i).TagObjects(o, tag);
292
+ }
293
+
294
+ blockloop = false;
295
+ }
296
+
297
+ boolean HasTags()
298
+ {
299
+ if (blockloop)
300
+ return false;
301
+
302
+ blockloop = true;
303
+
304
+ boolean hasTags = false;
305
+
306
+ for (int i=0; i<Size(); i++)
307
+ {
308
+ hasTags |= get(i).tag || get(i).HasTags();
309
+
310
+ if (hasTags)
311
+ break;
312
+ }
313
+
314
+ blockloop = false;
315
+
316
+ return hasTags;
317
+ }
318
+
217319 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
218320 {
219321 if (!hashtable.containsKey(GetUUID()))
....@@ -223,19 +325,35 @@
223325
224326 RestoreBigData(o);
225327
226
- hashtable.remove(GetUUID());
328
+ if (blockloop)
329
+ return;
330
+
331
+ blockloop = true;
332
+
333
+ //hashtable.remove(GetUUID());
227334
228335 for (int i=0; i<Size(); i++)
229336 {
230337 get(i).RestoreBigData(hashtable);
231338 }
339
+
340
+ blockloop = false;
232341 }
233342
234343 void RestoreBigData(Object3D o)
235344 {
236345 this.bRep = o.bRep;
237
- if (this.bRep != null)
238
- this.bRep.support = o.transientrep;
346
+ if (this.support != null && o.transientrep != null)
347
+ {
348
+ this.support.bRep = o.transientrep;
349
+ }
350
+
351
+ this.selection = o.selection;
352
+
353
+ this.versionlist = o.versionlist;
354
+ this.versionindex = o.versionindex;
355
+// July 2019 if (this.bRep != null)
356
+// this.bRep.support = o.transientrep;
239357 // this.support = o.support;
240358 // this.fileparent = o.fileparent;
241359 }
....@@ -381,6 +499,7 @@
381499 }
382500
383501 boolean live = false;
502
+ transient boolean keepdontselect;
384503 boolean dontselect = false;
385504 boolean hide = false;
386505 boolean link2master = false; // performs reset support/master at each frame
....@@ -568,7 +687,7 @@
568687 {
569688 if (maxcount != 1)
570689 {
571
- new Exception().printStackTrace();
690
+ //new Exception().printStackTrace();
572691 }
573692
574693 toParentMarked = LA.newMatrix();
....@@ -881,7 +1000,7 @@
8811000
8821001 if (marked && Globals.isLIVE() && live &&
8831002 //TEMP21aug2018
884
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
1003
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
8851004 currentframe != Globals.framecount)
8861005 {
8871006 currentframe = Globals.framecount;
....@@ -893,7 +1012,8 @@
8931012
8941013 boolean changedir = random && Math.random() < 0.01; // && !link2master;
8951014
896
- if (transformcount*factor > maxcount || (step == 1 && changedir))
1015
+ if (transformcount*factor >= maxcount && (rewind || random) ||
1016
+ (step == 1 && changedir))
8971017 {
8981018 countdown = 1;
8991019 delay = speedup?8:1;
....@@ -965,6 +1085,10 @@
9651085 if (material == null || material.multiply)
9661086 return true;
9671087
1088
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1089
+ return false;
1090
+
1091
+ // Transparent objects are dynamic because we have to sort the triangles.
9681092 return material.opacity > 0.99;
9691093 }
9701094
....@@ -1365,6 +1489,7 @@
13651489 toParent = LA.newMatrix();
13661490 fromParent = LA.newMatrix();
13671491 }
1492
+
13681493 LA.matCopy(other.toParent, toParent);
13691494 LA.matCopy(other.fromParent, fromParent);
13701495
....@@ -2244,11 +2369,6 @@
22442369
22452370 InitOthers();
22462371
2247
- if (this instanceof Camera)
2248
- {
2249
- material.shift = 90;
2250
- }
2251
-
22522372 material.multiply = multiply;
22532373
22542374 if (multiply)
....@@ -2386,6 +2506,15 @@
23862506 }
23872507 */
23882508 }
2509
+ else
2510
+ {
2511
+ //((ObjEditor)editWindow).SetupUI2(null);
2512
+ if (objectUI != null)
2513
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
2514
+ else
2515
+ //new Exception().printStackTrace();
2516
+ System.err.println("objectUI is null");
2517
+ }
23892518 }
23902519
23912520 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2427,6 +2556,14 @@
24272556 {
24282557 editWindow.refreshContents();
24292558 }
2559
+ else
2560
+ {
2561
+ if (manipWindow != null)
2562
+ {
2563
+ manipWindow.refreshContents();
2564
+ }
2565
+ }
2566
+
24302567 //if (parent != null)
24312568 //parent.refreshEditWindow();
24322569 }
....@@ -2506,7 +2643,8 @@
25062643 private static final int editSelf = 1;
25072644 private static final int editChild = 2;
25082645
2509
- void drawEditHandles(ClickInfo info, int level)
2646
+ void drawEditHandles(//ClickInfo info,
2647
+ int level)
25102648 {
25112649 if (level == 0)
25122650 {
....@@ -2514,7 +2652,8 @@
25142652 return;
25152653
25162654 Object3D selectee;
2517
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2655
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2656
+ level + 1))
25182657 {
25192658 selectee = (Object3D) e.nextElement();
25202659 }
....@@ -2522,19 +2661,22 @@
25222661 } else
25232662 {
25242663 //super.
2525
- drawEditHandles0(info, level + 1);
2664
+ drawEditHandles0(//info,
2665
+ level + 1);
25262666 }
25272667 }
25282668
2529
- boolean doEditClick(ClickInfo info, int level)
2669
+ boolean doEditClick(//ClickInfo info,
2670
+ int level)
25302671 {
25312672 doSomething = 0;
25322673 if (level == 0)
25332674 {
2534
- return doParentClick(info);
2675
+ return doParentClick(); //info);
25352676 }
25362677 if (//super.
2537
- doEditClick0(info, level))
2678
+ doEditClick0(//info,
2679
+ level))
25382680 {
25392681 doSomething = 1;
25402682 return true;
....@@ -2544,7 +2686,7 @@
25442686 }
25452687 }
25462688
2547
- boolean doParentClick(ClickInfo info)
2689
+ boolean doParentClick() //ClickInfo info)
25482690 {
25492691 if (selection == null)
25502692 {
....@@ -2557,7 +2699,8 @@
25572699 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
25582700 {
25592701 Object3D selectee = (Object3D) e.nextElement();
2560
- if (selectee.doEditClick(info, 1))
2702
+ if (selectee.doEditClick(//info,
2703
+ 1))
25612704 {
25622705 childToDrag = selectee;
25632706 doSomething = 2;
....@@ -2569,13 +2712,15 @@
25692712 return retval;
25702713 }
25712714
2572
- void doEditDrag(ClickInfo info, boolean opposite)
2715
+ void doEditDrag(//ClickInfo clickInfo,
2716
+ boolean opposite)
25732717 {
25742718 switch (doSomething)
25752719 {
25762720 case 1: // '\001'
25772721 //super.
2578
- doEditDrag0(info, opposite);
2722
+ doEditDrag0(//clickInfo,
2723
+ opposite);
25792724 break;
25802725
25812726 case 2: // '\002'
....@@ -2588,11 +2733,13 @@
25882733 {
25892734 //sel.hitSomething = childToDrag.hitSomething;
25902735 //childToDrag.doEditDrag(info);
2591
- sel.doEditDrag(info, opposite);
2736
+ sel.doEditDrag(//clickInfo,
2737
+ opposite);
25922738 } else
25932739 {
25942740 //super.
2595
- doEditDrag0(info, opposite);
2741
+ doEditDrag0(//clickInfo,
2742
+ opposite);
25962743 }
25972744 }
25982745 break;
....@@ -2610,6 +2757,9 @@
26102757 {
26112758 deselectAll();
26122759 }
2760
+
2761
+ new Exception().printStackTrace();
2762
+
26132763 ClickInfo newInfo = new ClickInfo();
26142764 newInfo.flags = info.flags;
26152765 newInfo.bounds = info.bounds;
....@@ -3057,7 +3207,7 @@
30573207 {
30583208 if (bRep != null)
30593209 {
3060
- bRep.GenerateNormalsMINE();
3210
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
30613211 Touch();
30623212 }
30633213 }
....@@ -3467,15 +3617,47 @@
34673617
34683618 void ClearMaterials()
34693619 {
3620
+ if (blockloop)
3621
+ return;
3622
+
3623
+ blockloop = true;
3624
+
34703625 ClearMaterial();
3471
- for (int i = 0; i < size(); i++)
3626
+ for (int i = 0; i < Size(); i++)
34723627 {
3473
- Object3D child = (Object3D) reserve(i);
3628
+ Object3D child = (Object3D) get(i);
34743629 if (child == null)
34753630 continue;
34763631 child.ClearMaterials();
3477
- release(i);
34783632 }
3633
+
3634
+ blockloop = false;
3635
+ }
3636
+
3637
+ void ClearVersionList()
3638
+ {
3639
+ this.versionlist = null;
3640
+ this.versionindex = -1;
3641
+ this.versiontable = null;
3642
+ }
3643
+
3644
+ void ClearVersions()
3645
+ {
3646
+ if (blockloop)
3647
+ return;
3648
+
3649
+ blockloop = true;
3650
+
3651
+ ClearVersionList();
3652
+ for (int i = 0; i < Size(); i++)
3653
+ {
3654
+ Object3D child = (Object3D) get(i);
3655
+ if (child == null)
3656
+ continue;
3657
+ child.ClearVersions();
3658
+ }
3659
+
3660
+ blockloop = false;
34793661 }
34803662
34813663 void FlipV(boolean flip)
....@@ -3503,7 +3685,8 @@
35033685 if (blockloop)
35043686 return;
35053687
3506
- if (marked || (bRep != null && material != null)) // borderline...
3688
+ if (//marked || // does not make sense
3689
+ (bRep != null || material != null)) // borderline...
35073690 live = h;
35083691
35093692 for (int i = 0; i < Size(); i++)
....@@ -3524,7 +3707,8 @@
35243707 return;
35253708
35263709 //if (bRep != null)
3527
- if (marked || (bRep != null && material != null)) // borderline...
3710
+ if (//marked || // does not make sense
3711
+ (bRep != null || material != null)) // borderline...
35283712 link2master = h;
35293713
35303714 for (int i = 0; i < Size(); i++)
....@@ -3544,7 +3728,8 @@
35443728 if (blockloop)
35453729 return;
35463730
3547
- if (marked || (bRep != null && material != null)) // borderline...
3731
+ if (//marked || // does not make sense
3732
+ (bRep != null || material != null)) // borderline...
35483733 hide = h;
35493734
35503735 for (int i = 0; i < Size(); i++)
....@@ -3564,7 +3749,7 @@
35643749 if (blockloop)
35653750 return;
35663751
3567
- if (bRep != null && material != null) // borderline...
3752
+ if (bRep != null || material != null) // borderline...
35683753 marked = h;
35693754
35703755 for (int i = 0; i < Size(); i++)
....@@ -3574,6 +3759,46 @@
35743759 continue;
35753760 blockloop = true;
35763761 child.MarkLeaves(h);
3762
+ blockloop = false;
3763
+ // release(i);
3764
+ }
3765
+ }
3766
+
3767
+ void RewindLeaves(boolean h)
3768
+ {
3769
+ if (blockloop)
3770
+ return;
3771
+
3772
+ if (bRep != null || material != null) // borderline...
3773
+ rewind = h;
3774
+
3775
+ for (int i = 0; i < Size(); i++)
3776
+ {
3777
+ Object3D child = (Object3D) get(i); // reserve(i);
3778
+ if (child == null)
3779
+ continue;
3780
+ blockloop = true;
3781
+ child.RewindLeaves(h);
3782
+ blockloop = false;
3783
+ // release(i);
3784
+ }
3785
+ }
3786
+
3787
+ void RandomLeaves(boolean h)
3788
+ {
3789
+ if (blockloop)
3790
+ return;
3791
+
3792
+ if (bRep != null || material != null) // borderline...
3793
+ random = h;
3794
+
3795
+ for (int i = 0; i < Size(); i++)
3796
+ {
3797
+ Object3D child = (Object3D) get(i); // reserve(i);
3798
+ if (child == null)
3799
+ continue;
3800
+ blockloop = true;
3801
+ child.RandomLeaves(h);
35773802 blockloop = false;
35783803 // release(i);
35793804 }
....@@ -4351,6 +4576,55 @@
43514576 }
43524577 }
43534578
4579
+ void RepairSOV()
4580
+ {
4581
+ if (blockloop)
4582
+ return;
4583
+
4584
+ String texname = this.GetPigmentTexture();
4585
+
4586
+ if (texname.startsWith("sov"))
4587
+ {
4588
+ String[] s = texname.split("/");
4589
+
4590
+ String[] sname = s[1].split("Color.pn");
4591
+
4592
+ texname = sname[0];
4593
+
4594
+ if (sname.length > 1)
4595
+ {
4596
+ texname += "Color.jpg";
4597
+ }
4598
+
4599
+ this.SetPigmentTexture("sov/" + texname);
4600
+ }
4601
+
4602
+ texname = this.GetBumpTexture();
4603
+
4604
+ if (texname.startsWith("sov"))
4605
+ {
4606
+ String[] s = texname.split("/");
4607
+
4608
+ String[] sname = s[1].split("Bump.pn");
4609
+
4610
+ texname = sname[0];
4611
+
4612
+ if (sname.length > 1)
4613
+ {
4614
+ texname += "Bump.jpg";
4615
+ }
4616
+
4617
+ this.SetBumpTexture("sov/" + texname);
4618
+ }
4619
+
4620
+ for (int i=0; i<Size(); i++)
4621
+ {
4622
+ blockloop = true;
4623
+ get(i).RepairSOV();
4624
+ blockloop = false;
4625
+ }
4626
+ }
4627
+
43544628 void RepairTexture()
43554629 {
43564630 if (this instanceof FileObject || blockloop)
....@@ -4865,6 +5139,14 @@
48655139 }
48665140 }
48675141
5142
+ ObjEditor GetWindow()
5143
+ {
5144
+ if (editWindow != null)
5145
+ return editWindow;
5146
+
5147
+ return manipWindow;
5148
+ }
5149
+
48685150 cTreePath Select(int indexcount, boolean deselect)
48695151 {
48705152 if (hide || dontselect)
....@@ -4901,10 +5183,11 @@
49015183 if (leaf != null)
49025184 {
49035185 cTreePath tp = new cTreePath(this, leaf);
4904
- if (editWindow != null)
5186
+ ObjEditor window = GetWindow();
5187
+ if (window != null)
49055188 {
49065189 //System.out.println("editWindow = " + editWindow + " vs " + this);
4907
- editWindow.Select(tp, deselect, true);
5190
+ window.Select(tp, deselect, true);
49085191 }
49095192
49105193 return tp;
....@@ -4921,6 +5204,7 @@
49215204
49225205 if (child == null)
49235206 continue;
5207
+
49245208 if (child.HasTransparency() && child.size() != 0)
49255209 {
49265210 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -4930,9 +5214,10 @@
49305214 if (leaf != null)
49315215 {
49325216 cTreePath tp = new cTreePath(this, leaf);
4933
- if (editWindow != null)
5217
+ ObjEditor window = GetWindow();
5218
+ if (window != null)
49345219 {
4935
- editWindow.Select(tp, deselect, true);
5220
+ window.Select(tp, deselect, true);
49365221 }
49375222
49385223 return tp;
....@@ -5257,6 +5542,51 @@
52575542 blockloop = false;
52585543 }
52595544
5545
+ void ResetSelectable()
5546
+ {
5547
+ if (blockloop)
5548
+ return;
5549
+
5550
+ blockloop = true;
5551
+
5552
+ keepdontselect = dontselect;
5553
+ dontselect = true;
5554
+
5555
+ Object3D child;
5556
+ int nb = Size();
5557
+ for (int i = 0; i < nb; i++)
5558
+ {
5559
+ child = (Object3D) get(i);
5560
+ if (child == null)
5561
+ continue;
5562
+ child.ResetSelectable();
5563
+ }
5564
+
5565
+ blockloop = false;
5566
+ }
5567
+
5568
+ void RestoreSelectable()
5569
+ {
5570
+ if (blockloop)
5571
+ return;
5572
+
5573
+ blockloop = true;
5574
+
5575
+ dontselect = keepdontselect;
5576
+
5577
+ Object3D child;
5578
+ int nb = Size();
5579
+ for (int i = 0; i < nb; i++)
5580
+ {
5581
+ child = (Object3D) get(i);
5582
+ if (child == null)
5583
+ continue;
5584
+ child.RestoreSelectable();
5585
+ }
5586
+
5587
+ blockloop = false;
5588
+ }
5589
+
52605590 boolean IsSelected()
52615591 {
52625592 if (parent == null)
....@@ -5317,6 +5647,11 @@
53175647 if (fullname == null)
53185648 return "";
53195649
5650
+ if (fullname.pigment != null)
5651
+ {
5652
+ return fullname.pigment;
5653
+ }
5654
+
53205655 // System.out.println("Fullname = " + fullname);
53215656
53225657 // Does not work on Windows due to C:
....@@ -5329,7 +5664,7 @@
53295664
53305665 if (split.length == 0)
53315666 {
5332
- return "";
5667
+ return fullname.pigment = "";
53335668 }
53345669
53355670 if (split.length <= 2)
....@@ -5337,22 +5672,27 @@
53375672 if (fullname.name.endsWith(":"))
53385673 {
53395674 // Windows
5340
- return fullname.name.substring(0, fullname.name.length()-1);
5675
+ return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1);
53415676 }
53425677
5343
- return split[0];
5678
+ return fullname.pigment = split[0];
53445679 }
53455680
53465681 // Windows
53475682 assert(split.length == 4);
53485683
5349
- return split[0] + ":" + split[1];
5684
+ return fullname.pigment = split[0] + ":" + split[1];
53505685 }
53515686
53525687 static String GetBump(cTexture fullname)
53535688 {
53545689 if (fullname == null)
53555690 return "";
5691
+
5692
+ if (fullname.bump != null)
5693
+ {
5694
+ return fullname.bump;
5695
+ }
53565696
53575697 // System.out.println("Fullname = " + fullname);
53585698 // Does not work on Windows due to C:
....@@ -5364,12 +5704,12 @@
53645704
53655705 if (split.length == 0)
53665706 {
5367
- return "";
5707
+ return fullname.bump = "";
53685708 }
53695709
53705710 if (split.length == 1)
53715711 {
5372
- return "";
5712
+ return fullname.bump = "";
53735713 }
53745714
53755715 if (split.length == 2)
....@@ -5377,16 +5717,16 @@
53775717 if (fullname.name.endsWith(":"))
53785718 {
53795719 // Windows
5380
- return "";
5720
+ return fullname.bump = "";
53815721 }
53825722
5383
- return split[1];
5723
+ return fullname.bump = split[1];
53845724 }
53855725
53865726 // Windows
53875727 assert(split.length == 4);
53885728
5389
- return split[2] + ":" + split[3];
5729
+ return fullname.bump = split[2] + ":" + split[3];
53905730 }
53915731
53925732 String GetPigmentTexture()
....@@ -5469,6 +5809,9 @@
54695809 texname = "";
54705810
54715811 GetTextures().name = texname + ":" + GetBump(GetTextures());
5812
+
5813
+ GetTextures().pigment = null;
5814
+
54725815 Touch();
54735816 }
54745817
....@@ -5542,6 +5885,8 @@
55425885
55435886 GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname;
55445887
5888
+ GetTextures().bump = null;
5889
+
55455890 Touch();
55465891 }
55475892
....@@ -5562,6 +5907,38 @@
55625907
55635908 blockloop = true;
55645909 child.ResetBumpTexture();
5910
+ blockloop = false;
5911
+ }
5912
+ }
5913
+
5914
+ void EmbedTextures(boolean embed)
5915
+ {
5916
+ if (blockloop)
5917
+ return;
5918
+
5919
+ //if (GetTextures() != null)
5920
+ if (embed)
5921
+ CameraPane.EmbedTextures(GetTextures());
5922
+ else
5923
+ {
5924
+ GetTextures().pigmentdata = null;
5925
+ GetTextures().bumpdata = null;
5926
+ GetTextures().pw = 0;
5927
+ GetTextures().ph = 0;
5928
+ GetTextures().bw = 0;
5929
+ GetTextures().bh = 0;
5930
+ }
5931
+
5932
+ int nb = Size();
5933
+ for (int i = 0; i < nb; i++)
5934
+ {
5935
+ Object3D child = (Object3D) get(i);
5936
+
5937
+ if (child == null)
5938
+ continue;
5939
+
5940
+ blockloop = true;
5941
+ child.EmbedTextures(embed);
55655942 blockloop = false;
55665943 }
55675944 }
....@@ -5652,8 +6029,10 @@
56526029 if (support != null)
56536030 support = support;
56546031
5655
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5656
- boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
6032
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
6033
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
6034
+
6035
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
56576036
56586037 if (!usecalllists && bRep != null && bRep.displaylist > 0)
56596038 {
....@@ -5663,8 +6042,9 @@
56636042 // usecalllists &= !(parent instanceof RandomNode);
56646043 // usecalllists = false;
56656044
5666
- if (GetBRep() != null)
5667
- usecalllists = usecalllists;
6045
+ if (display.DrawMode() == display.SHADOW)
6046
+ //GetBRep() != null)
6047
+ usecalllists = !!usecalllists;
56686048 //System.out.println("draw " + this);
56696049 //new Exception().printStackTrace();
56706050
....@@ -5674,7 +6054,7 @@
56746054
56756055 if (!selectmode && //display.DrawMode() != display.SELECTION &&
56766056 //(touched || (bRep != null && bRep.displaylist <= 0)))
5677
- (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0)))
6057
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
56786058 {
56796059 Globals.lighttouched = true;
56806060 } // all panes...
....@@ -5686,7 +6066,7 @@
56866066 if (!(this instanceof Composite))
56876067 touched = false;
56886068 //if (displaylist == -1 && usecalllists)
5689
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
6069
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
56906070 {
56916071 bRep.displaylist = display.GenList();
56926072 assert(bRep.displaylist != 0);
....@@ -5697,7 +6077,7 @@
56976077
56986078 //System.out.println("\tnew list " + list);
56996079 //gl.glDrawBuffer(gl.GL_NONE);
5700
- if (usecalllists)
6080
+ if (usecalllists && bRep.displaylist > 0)
57016081 {
57026082 // System.err.println("new list " + bRep.displaylist + " for " + this);
57036083 display.NewList(bRep.displaylist);
....@@ -5706,7 +6086,7 @@
57066086 CallList(display, root, selected, blocked);
57076087
57086088 // compiled = true;
5709
- if (usecalllists)
6089
+ if (usecalllists && bRep.displaylist > 0)
57106090 {
57116091 // System.err.println("end list " + bRep.displaylist + " for " + this);
57126092 display.EndList();
....@@ -5806,6 +6186,7 @@
58066186 if (GetBRep() != null)
58076187 {
58086188 display.NextIndex();
6189
+
58096190 // vertex color conflict : gl.glCallList(list);
58106191 DrawNode(display, root, selected);
58116192 if (this instanceof BezierPatch)
....@@ -5846,16 +6227,27 @@
58466227 tex = GetTextures();
58476228 }
58486229
5849
- boolean failed = false;
6230
+ boolean failedPigment = false;
6231
+ boolean failedBump = false;
58506232
58516233 try
58526234 {
5853
- display.BindTextures(tex, texres);
6235
+ display.BindPigmentTexture(tex, texres);
58546236 }
58556237 catch (Exception e)
58566238 {
58576239 System.err.println("FAILED: " + this);
5858
- failed = true;
6240
+ failedPigment = true;
6241
+ }
6242
+
6243
+ try
6244
+ {
6245
+ display.BindBumpTexture(tex, texres);
6246
+ }
6247
+ catch (Exception e)
6248
+ {
6249
+ //System.err.println("FAILED: " + this);
6250
+ failedBump = true;
58596251 }
58606252
58616253 if (!compiled)
....@@ -5878,8 +6270,11 @@
58786270 }
58796271 }
58806272
5881
- if (!failed)
5882
- display.ReleaseTextures(tex);
6273
+ if (!failedBump)
6274
+ display.ReleaseBumpTexture(tex);
6275
+
6276
+ if (!failedPigment)
6277
+ display.ReleasePigmentTexture(tex);
58836278
58846279 display.PopMaterial(this, selected);
58856280 }
....@@ -6252,6 +6647,11 @@
62526647 // dec 2012
62536648 new Exception().printStackTrace();
62546649 return;
6650
+ }
6651
+
6652
+ if (dontselect)
6653
+ {
6654
+ //bRep.GenerateNormalsMINE();
62556655 }
62566656
62576657 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -7037,20 +7437,23 @@
70377437 }
70387438 }
70397439
7040
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7440
+ static ClickInfo clickInfo = new ClickInfo();
7441
+
7442
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7443
+ Point outPt, Rectangle outRec)
70417444 {
7042
- int hc = info.bounds.x + info.bounds.width / 2;
7043
- int vc = info.bounds.y + info.bounds.height / 2;
7044
- double[][] toscreen = info.toScreen;
7445
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7446
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7447
+ double[][] toscreen = clickInfo.toScreen;
70457448 if (toscreen == null)
70467449 {
7047
- toscreen = new Camera(info.camera.viewCode).toScreen;
7450
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
70487451 }
70497452 cVector vec = in;
70507453 LA.xformPos(in, toscreen, in);
70517454 //System.out.println("Distance = " + info.camera.Distance());
7052
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
7053
- vec.y *= 100 * info.camera.SCALE / info.camera.Distance();
7455
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7456
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
70547457 outPt.x = hc + (int) vec.x;
70557458 outPt.y = vc - (int) vec.y;
70567459 outRec.x = outPt.x - 3;
....@@ -7058,15 +7461,18 @@
70587461 outRec.width = outRec.height = 6;
70597462 }
70607463
7061
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7464
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7465
+ )
70627466 {
70637467 Point pt = new Point(0, 0);
70647468 Rectangle rec = new Rectangle();
7065
- calcHotSpot(in, info, pt, rec);
7469
+ calcHotSpot(in, //clickInfo,
7470
+ pt, rec);
70667471 return rec;
70677472 }
70687473
7069
- void drawEditHandles0(ClickInfo info, int level)
7474
+ void drawEditHandles0(//ClickInfo clickInfo,
7475
+ int level)
70707476 {
70717477 if (level == 0)
70727478 {
....@@ -7075,16 +7481,19 @@
70757481 {
70767482 cVector origin = new cVector();
70777483 //LA.xformPos(origin, toParent, origin);
7078
- Rectangle spot = calcHotSpot(origin, info);
7484
+ if (this.clickInfo == null)
7485
+ this.clickInfo = new ClickInfo();
7486
+
7487
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
70797488 Rectangle boundary = new Rectangle();
70807489 boundary.x = spot.x - 30;
70817490 boundary.y = spot.y - 30;
70827491 boundary.width = spot.width + 60;
70837492 boundary.height = spot.height + 60;
7084
- info.g.setColor(Color.red);
7493
+ clickInfo.g.setColor(Color.white);
70857494 int spotw = spot.x + spot.width;
70867495 int spoth = spot.y + spot.height;
7087
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7496
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
70887497 // if (CameraPane.Xmin > spot.x)
70897498 // {
70907499 // CameraPane.Xmin = spot.x;
....@@ -7101,11 +7510,6 @@
71017510 // {
71027511 // CameraPane.Ymax = spoth;
71037512 // }
7104
- spot.translate(32, 32);
7105
- spotw = spot.x + spot.width;
7106
- spoth = spot.y + spot.height;
7107
- info.g.setColor(Color.cyan);
7108
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
71097513 // if (CameraPane.Xmin > spot.x)
71107514 // {
71117515 // CameraPane.Xmin = spot.x;
....@@ -7124,10 +7528,15 @@
71247528 // }
71257529 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
71267530 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
7127
- spot.translate(0, -32);
7128
- info.g.setColor(Color.yellow);
7129
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7130
- info.g.setColor(Color.green);
7531
+ spot.translate(32, 0);
7532
+ clickInfo.g.setColor(Color.yellow);
7533
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7534
+
7535
+ spot.translate(32, 64);
7536
+ spotw = spot.x + spot.width;
7537
+ spoth = spot.y + spot.height;
7538
+ clickInfo.g.setColor(Color.cyan);
7539
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
71317540 // if (CameraPane.Xmin > spot.x)
71327541 // {
71337542 // CameraPane.Xmin = spot.x;
....@@ -7144,8 +7553,9 @@
71447553 // {
71457554 // CameraPane.Ymax = spoth;
71467555 // }
7147
- info.g.drawArc(boundary.x, boundary.y,
7148
- boundary.width, boundary.height, 0, 360);
7556
+ clickInfo.g.setColor(Color.green);
7557
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7558
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
71497559 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
71507560 // if (CameraPane.Xmin > boundary.x)
71517561 // {
....@@ -7167,7 +7577,8 @@
71677577 }
71687578 }
71697579
7170
- boolean doEditClick0(ClickInfo info, int level)
7580
+ boolean doEditClick0(//ClickInfo clickInfo,
7581
+ int level)
71717582 {
71727583 if (level == 0)
71737584 {
....@@ -7176,8 +7587,8 @@
71767587
71777588 boolean retval = false;
71787589
7179
- startX = info.x;
7180
- startY = info.y;
7590
+ startX = clickInfo.x;
7591
+ startY = clickInfo.y;
71817592
71827593 hitSomething = -1;
71837594 cVector origin = new cVector();
....@@ -7187,22 +7598,53 @@
71877598 {
71887599 centerPt = new Point(0, 0);
71897600 }
7190
- calcHotSpot(origin, info, centerPt, spot);
7191
- if (spot.contains(info.x, info.y))
7601
+ calcHotSpot(origin, //info,
7602
+ centerPt, spot);
7603
+ if (spot.contains(clickInfo.x, clickInfo.y))
71927604 {
71937605 hitSomething = hitCenter;
71947606 retval = true;
71957607 }
71967608 spot.translate(32, 0);
7197
- if (spot.contains(info.x, info.y))
7609
+ if (spot.contains(clickInfo.x, clickInfo.y))
71987610 {
71997611 hitSomething = hitRotate;
72007612 retval = true;
72017613 }
72027614 spot.translate(0, 32);
7203
- if (spot.contains(info.x, info.y))
7615
+ spot.translate(32, 0);
7616
+ spot.translate(0, 32);
7617
+ if (spot.contains(clickInfo.x, clickInfo.y))
72047618 {
72057619 hitSomething = hitScale;
7620
+
7621
+ double scale = 0.005f * clickInfo.camera.Distance();
7622
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
7623
+ double sign = 1;
7624
+ if (hScale < 0)
7625
+ {
7626
+ sign = -1;
7627
+ }
7628
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7629
+ if (hScale < 0.01)
7630
+ {
7631
+ //hScale = 0.01;
7632
+ }
7633
+
7634
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
7635
+ sign = 1;
7636
+ if (vScale < 0)
7637
+ {
7638
+ sign = -1;
7639
+ }
7640
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7641
+ if (vScale < 0.01)
7642
+ {
7643
+ //vScale = 0.01;
7644
+ }
7645
+
7646
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7647
+
72067648 retval = true;
72077649 }
72087650
....@@ -7212,7 +7654,7 @@
72127654 }
72137655
72147656 //System.out.println("info.modifiers = " + info.modifiers);
7215
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7657
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
72167658 //System.out.println("modified = " + modified);
72177659 //new Exception().printStackTrace();
72187660 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7240,7 +7682,8 @@
72407682 return true;
72417683 }
72427684
7243
- void doEditDrag0(ClickInfo info, boolean opposite)
7685
+ void doEditDrag0(//ClickInfo info,
7686
+ boolean opposite)
72447687 {
72457688 if (hitSomething == 0)
72467689 {
....@@ -7254,7 +7697,7 @@
72547697
72557698 //System.out.println("hitSomething = " + hitSomething);
72567699
7257
- double scale = 0.005f * info.camera.Distance();
7700
+ double scale = 0.005f * clickInfo.camera.Distance();
72587701
72597702 cVector xlate = new cVector();
72607703 //cVector xlate2 = new cVector();
....@@ -7268,7 +7711,9 @@
72687711
72697712 scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
72707713
7271
- if (modified || opposite)
7714
+ // Modified could snap
7715
+ if (//modified ||
7716
+ opposite)
72727717 {
72737718 //assert(false);
72747719 /*
....@@ -7288,8 +7733,8 @@
72887733 toParent[3][i] = xlate.get(i);
72897734 LA.matInvert(toParent, fromParent);
72907735 */
7291
- cVector delta = LA.newVector(0, 0, startY - info.y);
7292
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7736
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7737
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
72937738
72947739 LA.matCopy(startMat, toParent);
72957740 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7298,7 +7743,7 @@
72987743 } else
72997744 {
73007745 //LA.xformDir(delta, info.camera.fromScreen, delta);
7301
- cVector up = new cVector(info.camera.up);
7746
+ cVector up = new cVector(clickInfo.camera.up);
73027747 cVector away = new cVector();
73037748 //cVector right2 = new cVector();
73047749 //LA.vecCross(up, cVector.Z, right);
....@@ -7315,19 +7760,19 @@
73157760 LA.xformDir(up, ClickInfo.matbuffer, up);
73167761 // if (!CameraPane.LOCALTRANSFORM)
73177762 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7318
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7763
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
73197764 // if (!CameraPane.LOCALTRANSFORM)
73207765 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
73217766 //LA.vecCross(up, cVector.Z, right2);
73227767
7323
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7768
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
73247769
73257770 //System.out.println("DELTA0 = " + delta);
73267771 //System.out.println("AWAY = " + info.camera.away);
73277772 //System.out.println("UP = " + info.camera.up);
73287773 if (away.z > 0)
73297774 {
7330
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7775
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
73317776 {
73327777 delta.x = -delta.x;
73337778 } else
....@@ -7342,7 +7787,7 @@
73427787 //System.out.println("DELTA1 = " + delta);
73437788 LA.xformDir(delta, ClickInfo.matbuffer, delta);
73447789 //System.out.println("DELTA2 = " + delta);
7345
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7790
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
73467791 LA.matCopy(startMat, toParent);
73477792 //System.out.println("DELTA3 = " + delta);
73487793 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7352,8 +7797,8 @@
73527797 break;
73537798
73547799 case hitRotate: // rotate
7355
- int dx = info.x - centerPt.x;
7356
- int dy = -(info.y - centerPt.y);
7800
+ int dx = clickInfo.x - centerPt.x;
7801
+ int dy = -(clickInfo.y - centerPt.y);
73577802 double angle = (double) Math.atan2(dx, dy);
73587803 angle = -(1.570796 - angle);
73597804
....@@ -7362,7 +7807,7 @@
73627807
73637808 if (modified)
73647809 {
7365
- // Rotate 90 degrees
7810
+ // Rotate 45 degrees
73667811 angle /= (Math.PI / 4);
73677812 angle = Math.floor(angle + 0.5);
73687813 angle *= (Math.PI / 4);
....@@ -7376,7 +7821,7 @@
73767821 }
73777822 /**/
73787823
7379
- switch (info.pane.RenderCamera().viewCode)
7824
+ switch (clickInfo.pane.RenderCamera().viewCode)
73807825 {
73817826 case 1: // '\001'
73827827 LA.matZRotate(toParent, angle);
....@@ -7403,7 +7848,7 @@
74037848 break;
74047849
74057850 case hitScale: // scale
7406
- double hScale = (double) (info.x - centerPt.x) / 32;
7851
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
74077852 double sign = 1;
74087853 if (hScale < 0)
74097854 {
....@@ -7415,7 +7860,7 @@
74157860 //hScale = 0.01;
74167861 }
74177862
7418
- double vScale = (double) (info.y - centerPt.y) / 32;
7863
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
74197864 sign = 1;
74207865 if (vScale < 0)
74217866 {
....@@ -7426,6 +7871,7 @@
74267871 {
74277872 //vScale = 0.01;
74287873 }
7874
+
74297875 LA.matCopy(startMat, toParent);
74307876 /**/
74317877 for (int i = 0; i < 3; i++)
....@@ -7435,33 +7881,39 @@
74357881 }
74367882 /**/
74377883
7438
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7884
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
74397885
74407886 if (totalScale < 0.01)
74417887 {
74427888 totalScale = 0.01;
74437889 }
74447890
7445
- switch (info.pane.RenderCamera().viewCode)
7891
+ switch (clickInfo.pane.RenderCamera().viewCode)
74467892 {
74477893 case 3: // '\001'
74487894 if (modified || opposite)
74497895 {
7896
+ if (modified) // && opposite)
7897
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
7898
+ else
74507899 //LA.matScale(toParent, 1, hScale, vScale);
7451
- LA.matScale(toParent, totalScale, 1, 1);
7900
+ LA.matScale(toParent, totalScale, 1, 1);
74527901 } // vScale, 1);
74537902 else
74547903 {
74557904 // EXCEPTION!
7456
- LA.matScale(toParent, totalScale, totalScale, totalScale);
7905
+ LA.matScale(toParent, 1, totalScale, totalScale);
74577906 } // vScale, 1);
74587907 break;
74597908
74607909 case 2: // '\002'
74617910 if (modified || opposite)
74627911 {
7463
- //LA.matScale(toParent, hScale, 1, vScale);
7464
- LA.matScale(toParent, 1, totalScale, 1);
7912
+ if (modified) // && opposite)
7913
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
7914
+ else
7915
+ //LA.matScale(toParent, hScale, 1, vScale);
7916
+ LA.matScale(toParent, 1, totalScale, 1);
74657917 } else
74667918 {
74677919 LA.matScale(toParent, totalScale, 1, totalScale);
....@@ -7471,8 +7923,11 @@
74717923 case 1: // '\003'
74727924 if (modified || opposite)
74737925 {
7474
- //LA.matScale(toParent, hScale, vScale, 1);
7475
- LA.matScale(toParent, 1, 1, totalScale);
7926
+ if (modified) // && opposite)
7927
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
7928
+ else
7929
+ //LA.matScale(toParent, hScale, vScale, 1);
7930
+ LA.matScale(toParent, 1, 1, totalScale);
74767931 } else
74777932 {
74787933 LA.matScale(toParent, totalScale, totalScale, 1);
....@@ -7509,7 +7964,7 @@
75097964 } // NEW ...
75107965
75117966
7512
- info.pane.repaint();
7967
+ clickInfo.pane.repaint();
75137968 }
75147969
75157970 boolean overflow = false;
....@@ -7689,6 +8144,10 @@
76898144 editWindow = null;
76908145 } // ?
76918146 }
8147
+ else
8148
+ {
8149
+ //editWindow.closeUI();
8150
+ }
76928151 }
76938152
76948153 boolean root; // patch for edit windows
....@@ -7846,6 +8305,10 @@
78468305 }
78478306
78488307 transient ObjEditor editWindow;
8308
+ transient ObjEditor manipWindow;
8309
+
8310
+ transient boolean pinned;
8311
+
78498312 transient ObjectUI objectUI;
78508313 public static int povDepth = 0;
78518314 private static cVector tbMin = new cVector();