Normand Briere
2019-08-22 0c7b833be7d86598a6813cd1c6db0ca9e1b17966
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
177
- assert(this.bRep == o.bRep);
178
- if (this.bRep != null)
179
- assert(this.bRep.support == o.transientrep);
188
+ Grafreed.Assert(this.bRep == o.bRep);
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
....@@ -563,12 +682,14 @@
563682 toParent = LA.newMatrix();
564683 fromParent = LA.newMatrix();
565684 }
685
+
566686 if (toParentMarked == null)
567687 {
568688 if (maxcount != 1)
569689 {
570690 new Exception().printStackTrace();
571691 }
692
+
572693 toParentMarked = LA.newMatrix();
573694 fromParentMarked = LA.newMatrix();
574695 }
....@@ -879,7 +1000,7 @@
8791000
8801001 if (marked && Globals.isLIVE() && live &&
8811002 //TEMP21aug2018
882
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
1003
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
8831004 currentframe != Globals.framecount)
8841005 {
8851006 currentframe = Globals.framecount;
....@@ -891,7 +1012,8 @@
8911012
8921013 boolean changedir = random && Math.random() < 0.01; // && !link2master;
8931014
894
- if (transformcount*factor > maxcount || (step == 1 && changedir))
1015
+ if (transformcount*factor >= maxcount && (rewind || random) ||
1016
+ (step == 1 && changedir))
8951017 {
8961018 countdown = 1;
8971019 delay = speedup?8:1;
....@@ -963,6 +1085,10 @@
9631085 if (material == null || material.multiply)
9641086 return true;
9651087
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.
9661092 return material.opacity > 0.99;
9671093 }
9681094
....@@ -1363,6 +1489,7 @@
13631489 toParent = LA.newMatrix();
13641490 fromParent = LA.newMatrix();
13651491 }
1492
+
13661493 LA.matCopy(other.toParent, toParent);
13671494 LA.matCopy(other.fromParent, fromParent);
13681495
....@@ -2384,6 +2511,15 @@
23842511 }
23852512 */
23862513 }
2514
+ else
2515
+ {
2516
+ //((ObjEditor)editWindow).SetupUI2(null);
2517
+ if (objectUI != null)
2518
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
2519
+ else
2520
+ //new Exception().printStackTrace();
2521
+ System.err.println("objectUI is null");
2522
+ }
23872523 }
23882524
23892525 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2425,6 +2561,14 @@
24252561 {
24262562 editWindow.refreshContents();
24272563 }
2564
+ else
2565
+ {
2566
+ if (manipWindow != null)
2567
+ {
2568
+ manipWindow.refreshContents();
2569
+ }
2570
+ }
2571
+
24282572 //if (parent != null)
24292573 //parent.refreshEditWindow();
24302574 }
....@@ -2504,7 +2648,8 @@
25042648 private static final int editSelf = 1;
25052649 private static final int editChild = 2;
25062650
2507
- void drawEditHandles(ClickInfo info, int level)
2651
+ void drawEditHandles(//ClickInfo info,
2652
+ int level)
25082653 {
25092654 if (level == 0)
25102655 {
....@@ -2512,7 +2657,8 @@
25122657 return;
25132658
25142659 Object3D selectee;
2515
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2660
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2661
+ level + 1))
25162662 {
25172663 selectee = (Object3D) e.nextElement();
25182664 }
....@@ -2520,19 +2666,22 @@
25202666 } else
25212667 {
25222668 //super.
2523
- drawEditHandles0(info, level + 1);
2669
+ drawEditHandles0(//info,
2670
+ level + 1);
25242671 }
25252672 }
25262673
2527
- boolean doEditClick(ClickInfo info, int level)
2674
+ boolean doEditClick(//ClickInfo info,
2675
+ int level)
25282676 {
25292677 doSomething = 0;
25302678 if (level == 0)
25312679 {
2532
- return doParentClick(info);
2680
+ return doParentClick(); //info);
25332681 }
25342682 if (//super.
2535
- doEditClick0(info, level))
2683
+ doEditClick0(//info,
2684
+ level))
25362685 {
25372686 doSomething = 1;
25382687 return true;
....@@ -2542,7 +2691,7 @@
25422691 }
25432692 }
25442693
2545
- boolean doParentClick(ClickInfo info)
2694
+ boolean doParentClick() //ClickInfo info)
25462695 {
25472696 if (selection == null)
25482697 {
....@@ -2555,7 +2704,8 @@
25552704 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
25562705 {
25572706 Object3D selectee = (Object3D) e.nextElement();
2558
- if (selectee.doEditClick(info, 1))
2707
+ if (selectee.doEditClick(//info,
2708
+ 1))
25592709 {
25602710 childToDrag = selectee;
25612711 doSomething = 2;
....@@ -2567,13 +2717,15 @@
25672717 return retval;
25682718 }
25692719
2570
- void doEditDrag(ClickInfo info, boolean opposite)
2720
+ void doEditDrag(//ClickInfo clickInfo,
2721
+ boolean opposite)
25712722 {
25722723 switch (doSomething)
25732724 {
25742725 case 1: // '\001'
25752726 //super.
2576
- doEditDrag0(info, opposite);
2727
+ doEditDrag0(//clickInfo,
2728
+ opposite);
25772729 break;
25782730
25792731 case 2: // '\002'
....@@ -2586,11 +2738,13 @@
25862738 {
25872739 //sel.hitSomething = childToDrag.hitSomething;
25882740 //childToDrag.doEditDrag(info);
2589
- sel.doEditDrag(info, opposite);
2741
+ sel.doEditDrag(//clickInfo,
2742
+ opposite);
25902743 } else
25912744 {
25922745 //super.
2593
- doEditDrag0(info, opposite);
2746
+ doEditDrag0(//clickInfo,
2747
+ opposite);
25942748 }
25952749 }
25962750 break;
....@@ -2608,6 +2762,9 @@
26082762 {
26092763 deselectAll();
26102764 }
2765
+
2766
+ new Exception().printStackTrace();
2767
+
26112768 ClickInfo newInfo = new ClickInfo();
26122769 newInfo.flags = info.flags;
26132770 newInfo.bounds = info.bounds;
....@@ -3055,7 +3212,7 @@
30553212 {
30563213 if (bRep != null)
30573214 {
3058
- bRep.GenerateNormalsMINE();
3215
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
30593216 Touch();
30603217 }
30613218 }
....@@ -3465,15 +3622,47 @@
34653622
34663623 void ClearMaterials()
34673624 {
3625
+ if (blockloop)
3626
+ return;
3627
+
3628
+ blockloop = true;
3629
+
34683630 ClearMaterial();
3469
- for (int i = 0; i < size(); i++)
3631
+ for (int i = 0; i < Size(); i++)
34703632 {
3471
- Object3D child = (Object3D) reserve(i);
3633
+ Object3D child = (Object3D) get(i);
34723634 if (child == null)
34733635 continue;
34743636 child.ClearMaterials();
3475
- release(i);
34763637 }
3638
+
3639
+ blockloop = false;
3640
+ }
3641
+
3642
+ void ClearVersionList()
3643
+ {
3644
+ this.versionlist = null;
3645
+ this.versionindex = -1;
3646
+ this.versiontable = null;
3647
+ }
3648
+
3649
+ void ClearVersions()
3650
+ {
3651
+ if (blockloop)
3652
+ return;
3653
+
3654
+ blockloop = true;
3655
+
3656
+ ClearVersionList();
3657
+ for (int i = 0; i < Size(); i++)
3658
+ {
3659
+ Object3D child = (Object3D) get(i);
3660
+ if (child == null)
3661
+ continue;
3662
+ child.ClearVersions();
3663
+ }
3664
+
3665
+ blockloop = false;
34773666 }
34783667
34793668 void FlipV(boolean flip)
....@@ -3501,7 +3690,8 @@
35013690 if (blockloop)
35023691 return;
35033692
3504
- if (marked || (bRep != null && material != null)) // borderline...
3693
+ if (//marked || // does not make sense
3694
+ (bRep != null || material != null)) // borderline...
35053695 live = h;
35063696
35073697 for (int i = 0; i < Size(); i++)
....@@ -3522,7 +3712,8 @@
35223712 return;
35233713
35243714 //if (bRep != null)
3525
- if (marked || (bRep != null && material != null)) // borderline...
3715
+ if (//marked || // does not make sense
3716
+ (bRep != null || material != null)) // borderline...
35263717 link2master = h;
35273718
35283719 for (int i = 0; i < Size(); i++)
....@@ -3542,7 +3733,8 @@
35423733 if (blockloop)
35433734 return;
35443735
3545
- if (marked || (bRep != null && material != null)) // borderline...
3736
+ if (//marked || // does not make sense
3737
+ (bRep != null || material != null)) // borderline...
35463738 hide = h;
35473739
35483740 for (int i = 0; i < Size(); i++)
....@@ -3562,7 +3754,7 @@
35623754 if (blockloop)
35633755 return;
35643756
3565
- if (bRep != null && material != null) // borderline...
3757
+ if (bRep != null || material != null) // borderline...
35663758 marked = h;
35673759
35683760 for (int i = 0; i < Size(); i++)
....@@ -3572,6 +3764,46 @@
35723764 continue;
35733765 blockloop = true;
35743766 child.MarkLeaves(h);
3767
+ blockloop = false;
3768
+ // release(i);
3769
+ }
3770
+ }
3771
+
3772
+ void RewindLeaves(boolean h)
3773
+ {
3774
+ if (blockloop)
3775
+ return;
3776
+
3777
+ if (bRep != null || material != null) // borderline...
3778
+ rewind = h;
3779
+
3780
+ for (int i = 0; i < Size(); i++)
3781
+ {
3782
+ Object3D child = (Object3D) get(i); // reserve(i);
3783
+ if (child == null)
3784
+ continue;
3785
+ blockloop = true;
3786
+ child.RewindLeaves(h);
3787
+ blockloop = false;
3788
+ // release(i);
3789
+ }
3790
+ }
3791
+
3792
+ void RandomLeaves(boolean h)
3793
+ {
3794
+ if (blockloop)
3795
+ return;
3796
+
3797
+ if (bRep != null || material != null) // borderline...
3798
+ random = h;
3799
+
3800
+ for (int i = 0; i < Size(); i++)
3801
+ {
3802
+ Object3D child = (Object3D) get(i); // reserve(i);
3803
+ if (child == null)
3804
+ continue;
3805
+ blockloop = true;
3806
+ child.RandomLeaves(h);
35753807 blockloop = false;
35763808 // release(i);
35773809 }
....@@ -4349,6 +4581,55 @@
43494581 }
43504582 }
43514583
4584
+ void RepairSOV()
4585
+ {
4586
+ if (blockloop)
4587
+ return;
4588
+
4589
+ String texname = this.GetPigmentTexture();
4590
+
4591
+ if (texname.startsWith("sov"))
4592
+ {
4593
+ String[] s = texname.split("/");
4594
+
4595
+ String[] sname = s[1].split("Color.pn");
4596
+
4597
+ texname = sname[0];
4598
+
4599
+ if (sname.length > 1)
4600
+ {
4601
+ texname += "Color.jpg";
4602
+ }
4603
+
4604
+ this.SetPigmentTexture("sov/" + texname);
4605
+ }
4606
+
4607
+ texname = this.GetBumpTexture();
4608
+
4609
+ if (texname.startsWith("sov"))
4610
+ {
4611
+ String[] s = texname.split("/");
4612
+
4613
+ String[] sname = s[1].split("Bump.pn");
4614
+
4615
+ texname = sname[0];
4616
+
4617
+ if (sname.length > 1)
4618
+ {
4619
+ texname += "Bump.jpg";
4620
+ }
4621
+
4622
+ this.SetBumpTexture("sov/" + texname);
4623
+ }
4624
+
4625
+ for (int i=0; i<Size(); i++)
4626
+ {
4627
+ blockloop = true;
4628
+ get(i).RepairSOV();
4629
+ blockloop = false;
4630
+ }
4631
+ }
4632
+
43524633 void RepairTexture()
43534634 {
43544635 if (this instanceof FileObject || blockloop)
....@@ -4863,6 +5144,14 @@
48635144 }
48645145 }
48655146
5147
+ ObjEditor GetWindow()
5148
+ {
5149
+ if (editWindow != null)
5150
+ return editWindow;
5151
+
5152
+ return manipWindow;
5153
+ }
5154
+
48665155 cTreePath Select(int indexcount, boolean deselect)
48675156 {
48685157 if (hide || dontselect)
....@@ -4899,10 +5188,11 @@
48995188 if (leaf != null)
49005189 {
49015190 cTreePath tp = new cTreePath(this, leaf);
4902
- if (editWindow != null)
5191
+ ObjEditor window = GetWindow();
5192
+ if (window != null)
49035193 {
49045194 //System.out.println("editWindow = " + editWindow + " vs " + this);
4905
- editWindow.Select(tp, deselect, true);
5195
+ window.Select(tp, deselect, true);
49065196 }
49075197
49085198 return tp;
....@@ -4919,6 +5209,7 @@
49195209
49205210 if (child == null)
49215211 continue;
5212
+
49225213 if (child.HasTransparency() && child.size() != 0)
49235214 {
49245215 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -4928,9 +5219,10 @@
49285219 if (leaf != null)
49295220 {
49305221 cTreePath tp = new cTreePath(this, leaf);
4931
- if (editWindow != null)
5222
+ ObjEditor window = GetWindow();
5223
+ if (window != null)
49325224 {
4933
- editWindow.Select(tp, deselect, true);
5225
+ window.Select(tp, deselect, true);
49345226 }
49355227
49365228 return tp;
....@@ -5255,6 +5547,51 @@
52555547 blockloop = false;
52565548 }
52575549
5550
+ void ResetSelectable()
5551
+ {
5552
+ if (blockloop)
5553
+ return;
5554
+
5555
+ blockloop = true;
5556
+
5557
+ keepdontselect = dontselect;
5558
+ dontselect = true;
5559
+
5560
+ Object3D child;
5561
+ int nb = Size();
5562
+ for (int i = 0; i < nb; i++)
5563
+ {
5564
+ child = (Object3D) get(i);
5565
+ if (child == null)
5566
+ continue;
5567
+ child.ResetSelectable();
5568
+ }
5569
+
5570
+ blockloop = false;
5571
+ }
5572
+
5573
+ void RestoreSelectable()
5574
+ {
5575
+ if (blockloop)
5576
+ return;
5577
+
5578
+ blockloop = true;
5579
+
5580
+ dontselect = keepdontselect;
5581
+
5582
+ Object3D child;
5583
+ int nb = Size();
5584
+ for (int i = 0; i < nb; i++)
5585
+ {
5586
+ child = (Object3D) get(i);
5587
+ if (child == null)
5588
+ continue;
5589
+ child.RestoreSelectable();
5590
+ }
5591
+
5592
+ blockloop = false;
5593
+ }
5594
+
52585595 boolean IsSelected()
52595596 {
52605597 if (parent == null)
....@@ -5315,6 +5652,11 @@
53155652 if (fullname == null)
53165653 return "";
53175654
5655
+ if (fullname.pigment != null)
5656
+ {
5657
+ return fullname.pigment;
5658
+ }
5659
+
53185660 // System.out.println("Fullname = " + fullname);
53195661
53205662 // Does not work on Windows due to C:
....@@ -5327,7 +5669,7 @@
53275669
53285670 if (split.length == 0)
53295671 {
5330
- return "";
5672
+ return fullname.pigment = "";
53315673 }
53325674
53335675 if (split.length <= 2)
....@@ -5335,22 +5677,27 @@
53355677 if (fullname.name.endsWith(":"))
53365678 {
53375679 // Windows
5338
- return fullname.name.substring(0, fullname.name.length()-1);
5680
+ return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1);
53395681 }
53405682
5341
- return split[0];
5683
+ return fullname.pigment = split[0];
53425684 }
53435685
53445686 // Windows
53455687 assert(split.length == 4);
53465688
5347
- return split[0] + ":" + split[1];
5689
+ return fullname.pigment = split[0] + ":" + split[1];
53485690 }
53495691
53505692 static String GetBump(cTexture fullname)
53515693 {
53525694 if (fullname == null)
53535695 return "";
5696
+
5697
+ if (fullname.bump != null)
5698
+ {
5699
+ return fullname.bump;
5700
+ }
53545701
53555702 // System.out.println("Fullname = " + fullname);
53565703 // Does not work on Windows due to C:
....@@ -5362,12 +5709,12 @@
53625709
53635710 if (split.length == 0)
53645711 {
5365
- return "";
5712
+ return fullname.bump = "";
53665713 }
53675714
53685715 if (split.length == 1)
53695716 {
5370
- return "";
5717
+ return fullname.bump = "";
53715718 }
53725719
53735720 if (split.length == 2)
....@@ -5375,16 +5722,16 @@
53755722 if (fullname.name.endsWith(":"))
53765723 {
53775724 // Windows
5378
- return "";
5725
+ return fullname.bump = "";
53795726 }
53805727
5381
- return split[1];
5728
+ return fullname.bump = split[1];
53825729 }
53835730
53845731 // Windows
53855732 assert(split.length == 4);
53865733
5387
- return split[2] + ":" + split[3];
5734
+ return fullname.bump = split[2] + ":" + split[3];
53885735 }
53895736
53905737 String GetPigmentTexture()
....@@ -5467,6 +5814,9 @@
54675814 texname = "";
54685815
54695816 GetTextures().name = texname + ":" + GetBump(GetTextures());
5817
+
5818
+ GetTextures().pigment = null;
5819
+
54705820 Touch();
54715821 }
54725822
....@@ -5540,6 +5890,8 @@
55405890
55415891 GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname;
55425892
5893
+ GetTextures().bump = null;
5894
+
55435895 Touch();
55445896 }
55455897
....@@ -5564,6 +5916,38 @@
55645916 }
55655917 }
55665918
5919
+ void EmbedTextures(boolean embed)
5920
+ {
5921
+ if (blockloop)
5922
+ return;
5923
+
5924
+ //if (GetTextures() != null)
5925
+ if (embed)
5926
+ CameraPane.EmbedTextures(GetTextures());
5927
+ else
5928
+ {
5929
+ GetTextures().pigmentdata = null;
5930
+ GetTextures().bumpdata = null;
5931
+ GetTextures().pw = 0;
5932
+ GetTextures().ph = 0;
5933
+ GetTextures().bw = 0;
5934
+ GetTextures().bh = 0;
5935
+ }
5936
+
5937
+ int nb = Size();
5938
+ for (int i = 0; i < nb; i++)
5939
+ {
5940
+ Object3D child = (Object3D) get(i);
5941
+
5942
+ if (child == null)
5943
+ continue;
5944
+
5945
+ blockloop = true;
5946
+ child.EmbedTextures(embed);
5947
+ blockloop = false;
5948
+ }
5949
+ }
5950
+
55675951 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55685952 {
55695953 Draw(display, root, selected, blocked);
....@@ -5572,12 +5956,23 @@
55725956 boolean NeedSupport()
55735957 {
55745958 return
5575
- CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
5959
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
55765960 // PROBLEM with CROWD!!
55775961 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
55785962 }
55795963
55805964 static boolean DEBUG_SELECTION = false;
5965
+
5966
+ boolean IsLive()
5967
+ {
5968
+ if (live)
5969
+ return true;
5970
+
5971
+ if (parent == null)
5972
+ return false;
5973
+
5974
+ return parent.IsLive();
5975
+ }
55815976
55825977 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55835978 {
....@@ -5639,8 +6034,10 @@
56396034 if (support != null)
56406035 support = support;
56416036
5642
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5643
- boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
6037
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
6038
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
6039
+
6040
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
56446041
56456042 if (!usecalllists && bRep != null && bRep.displaylist > 0)
56466043 {
....@@ -5650,8 +6047,9 @@
56506047 // usecalllists &= !(parent instanceof RandomNode);
56516048 // usecalllists = false;
56526049
5653
- if (GetBRep() != null)
5654
- usecalllists = usecalllists;
6050
+ if (display.DrawMode() == display.SHADOW)
6051
+ //GetBRep() != null)
6052
+ usecalllists = !!usecalllists;
56556053 //System.out.println("draw " + this);
56566054 //new Exception().printStackTrace();
56576055
....@@ -5660,10 +6058,12 @@
56606058 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
56616059
56626060 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5663
- (touched || (bRep != null && bRep.displaylist <= 0)))
6061
+ //(touched || (bRep != null && bRep.displaylist <= 0)))
6062
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
56646063 {
56656064 Globals.lighttouched = true;
56666065 } // all panes...
6066
+
56676067 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
56686068 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
56696069 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5671,7 +6071,7 @@
56716071 if (!(this instanceof Composite))
56726072 touched = false;
56736073 //if (displaylist == -1 && usecalllists)
5674
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
6074
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
56756075 {
56766076 bRep.displaylist = display.GenList();
56776077 assert(bRep.displaylist != 0);
....@@ -5682,7 +6082,7 @@
56826082
56836083 //System.out.println("\tnew list " + list);
56846084 //gl.glDrawBuffer(gl.GL_NONE);
5685
- if (usecalllists)
6085
+ if (usecalllists && bRep.displaylist > 0)
56866086 {
56876087 // System.err.println("new list " + bRep.displaylist + " for " + this);
56886088 display.NewList(bRep.displaylist);
....@@ -5691,7 +6091,7 @@
56916091 CallList(display, root, selected, blocked);
56926092
56936093 // compiled = true;
5694
- if (usecalllists)
6094
+ if (usecalllists && bRep.displaylist > 0)
56956095 {
56966096 // System.err.println("end list " + bRep.displaylist + " for " + this);
56976097 display.EndList();
....@@ -5791,6 +6191,7 @@
57916191 if (GetBRep() != null)
57926192 {
57936193 display.NextIndex();
6194
+
57946195 // vertex color conflict : gl.glCallList(list);
57956196 DrawNode(display, root, selected);
57966197 if (this instanceof BezierPatch)
....@@ -5831,16 +6232,27 @@
58316232 tex = GetTextures();
58326233 }
58336234
5834
- boolean failed = false;
6235
+ boolean failedPigment = false;
6236
+ boolean failedBump = false;
58356237
58366238 try
58376239 {
5838
- display.BindTextures(tex, texres);
6240
+ display.BindPigmentTexture(tex, texres);
58396241 }
58406242 catch (Exception e)
58416243 {
58426244 System.err.println("FAILED: " + this);
5843
- failed = true;
6245
+ failedPigment = true;
6246
+ }
6247
+
6248
+ try
6249
+ {
6250
+ display.BindBumpTexture(tex, texres);
6251
+ }
6252
+ catch (Exception e)
6253
+ {
6254
+ //System.err.println("FAILED: " + this);
6255
+ failedBump = true;
58446256 }
58456257
58466258 if (!compiled)
....@@ -5863,8 +6275,11 @@
58636275 }
58646276 }
58656277
5866
- if (!failed)
5867
- display.ReleaseTextures(tex);
6278
+ if (!failedBump)
6279
+ display.ReleaseBumpTexture(tex);
6280
+
6281
+ if (!failedPigment)
6282
+ display.ReleasePigmentTexture(tex);
58686283
58696284 display.PopMaterial(this, selected);
58706285 }
....@@ -6237,6 +6652,11 @@
62376652 // dec 2012
62386653 new Exception().printStackTrace();
62396654 return;
6655
+ }
6656
+
6657
+ if (dontselect)
6658
+ {
6659
+ //bRep.GenerateNormalsMINE();
62406660 }
62416661
62426662 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -7022,20 +7442,23 @@
70227442 }
70237443 }
70247444
7025
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7445
+ static ClickInfo clickInfo = new ClickInfo();
7446
+
7447
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7448
+ Point outPt, Rectangle outRec)
70267449 {
7027
- int hc = info.bounds.x + info.bounds.width / 2;
7028
- int vc = info.bounds.y + info.bounds.height / 2;
7029
- double[][] toscreen = info.toScreen;
7450
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7451
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7452
+ double[][] toscreen = clickInfo.toScreen;
70307453 if (toscreen == null)
70317454 {
7032
- toscreen = new Camera(info.camera.viewCode).toScreen;
7455
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
70337456 }
70347457 cVector vec = in;
70357458 LA.xformPos(in, toscreen, in);
70367459 //System.out.println("Distance = " + info.camera.Distance());
7037
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
7038
- vec.y *= 100 * info.camera.SCALE / info.camera.Distance();
7460
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7461
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
70397462 outPt.x = hc + (int) vec.x;
70407463 outPt.y = vc - (int) vec.y;
70417464 outRec.x = outPt.x - 3;
....@@ -7043,15 +7466,18 @@
70437466 outRec.width = outRec.height = 6;
70447467 }
70457468
7046
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7469
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7470
+ )
70477471 {
70487472 Point pt = new Point(0, 0);
70497473 Rectangle rec = new Rectangle();
7050
- calcHotSpot(in, info, pt, rec);
7474
+ calcHotSpot(in, //clickInfo,
7475
+ pt, rec);
70517476 return rec;
70527477 }
70537478
7054
- void drawEditHandles0(ClickInfo info, int level)
7479
+ void drawEditHandles0(//ClickInfo clickInfo,
7480
+ int level)
70557481 {
70567482 if (level == 0)
70577483 {
....@@ -7060,16 +7486,19 @@
70607486 {
70617487 cVector origin = new cVector();
70627488 //LA.xformPos(origin, toParent, origin);
7063
- Rectangle spot = calcHotSpot(origin, info);
7489
+ if (this.clickInfo == null)
7490
+ this.clickInfo = new ClickInfo();
7491
+
7492
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
70647493 Rectangle boundary = new Rectangle();
70657494 boundary.x = spot.x - 30;
70667495 boundary.y = spot.y - 30;
70677496 boundary.width = spot.width + 60;
70687497 boundary.height = spot.height + 60;
7069
- info.g.setColor(Color.red);
7498
+ clickInfo.g.setColor(Color.white);
70707499 int spotw = spot.x + spot.width;
70717500 int spoth = spot.y + spot.height;
7072
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7501
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
70737502 // if (CameraPane.Xmin > spot.x)
70747503 // {
70757504 // CameraPane.Xmin = spot.x;
....@@ -7086,11 +7515,33 @@
70867515 // {
70877516 // CameraPane.Ymax = spoth;
70887517 // }
7089
- spot.translate(32, 32);
7518
+// if (CameraPane.Xmin > spot.x)
7519
+// {
7520
+// CameraPane.Xmin = spot.x;
7521
+// }
7522
+// if (CameraPane.Xmax < spotw)
7523
+// {
7524
+// CameraPane.Xmax = spotw;
7525
+// }
7526
+// if (CameraPane.Ymin > spot.y)
7527
+// {
7528
+// CameraPane.Ymin = spot.y;
7529
+// }
7530
+// if (CameraPane.Ymax < spoth)
7531
+// {
7532
+// CameraPane.Ymax = spoth;
7533
+// }
7534
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7535
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
7536
+ spot.translate(32, 0);
7537
+ clickInfo.g.setColor(Color.yellow);
7538
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7539
+
7540
+ spot.translate(32, 64);
70907541 spotw = spot.x + spot.width;
70917542 spoth = spot.y + spot.height;
7092
- info.g.setColor(Color.blue);
7093
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7543
+ clickInfo.g.setColor(Color.cyan);
7544
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
70947545 // if (CameraPane.Xmin > spot.x)
70957546 // {
70967547 // CameraPane.Xmin = spot.x;
....@@ -7107,29 +7558,9 @@
71077558 // {
71087559 // CameraPane.Ymax = spoth;
71097560 // }
7110
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7111
- //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7112
- spot.translate(0, -32);
7113
- info.g.setColor(Color.green);
7114
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7115
-// if (CameraPane.Xmin > spot.x)
7116
-// {
7117
-// CameraPane.Xmin = spot.x;
7118
-// }
7119
-// if (CameraPane.Xmax < spotw)
7120
-// {
7121
-// CameraPane.Xmax = spotw;
7122
-// }
7123
-// if (CameraPane.Ymin > spot.y)
7124
-// {
7125
-// CameraPane.Ymin = spot.y;
7126
-// }
7127
-// if (CameraPane.Ymax < spoth)
7128
-// {
7129
-// CameraPane.Ymax = spoth;
7130
-// }
7131
- info.g.drawArc(boundary.x, boundary.y,
7132
- boundary.width, boundary.height, 0, 360);
7561
+ clickInfo.g.setColor(Color.green);
7562
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7563
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
71337564 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
71347565 // if (CameraPane.Xmin > boundary.x)
71357566 // {
....@@ -7151,7 +7582,8 @@
71517582 }
71527583 }
71537584
7154
- boolean doEditClick0(ClickInfo info, int level)
7585
+ boolean doEditClick0(//ClickInfo clickInfo,
7586
+ int level)
71557587 {
71567588 if (level == 0)
71577589 {
....@@ -7160,8 +7592,8 @@
71607592
71617593 boolean retval = false;
71627594
7163
- startX = info.x;
7164
- startY = info.y;
7595
+ startX = clickInfo.x;
7596
+ startY = clickInfo.y;
71657597
71667598 hitSomething = -1;
71677599 cVector origin = new cVector();
....@@ -7171,22 +7603,53 @@
71717603 {
71727604 centerPt = new Point(0, 0);
71737605 }
7174
- calcHotSpot(origin, info, centerPt, spot);
7175
- if (spot.contains(info.x, info.y))
7606
+ calcHotSpot(origin, //info,
7607
+ centerPt, spot);
7608
+ if (spot.contains(clickInfo.x, clickInfo.y))
71767609 {
71777610 hitSomething = hitCenter;
71787611 retval = true;
71797612 }
71807613 spot.translate(32, 0);
7181
- if (spot.contains(info.x, info.y))
7614
+ if (spot.contains(clickInfo.x, clickInfo.y))
71827615 {
71837616 hitSomething = hitRotate;
71847617 retval = true;
71857618 }
71867619 spot.translate(0, 32);
7187
- if (spot.contains(info.x, info.y))
7620
+ spot.translate(32, 0);
7621
+ spot.translate(0, 32);
7622
+ if (spot.contains(clickInfo.x, clickInfo.y))
71887623 {
71897624 hitSomething = hitScale;
7625
+
7626
+ double scale = 0.005f * clickInfo.camera.Distance();
7627
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
7628
+ double sign = 1;
7629
+ if (hScale < 0)
7630
+ {
7631
+ sign = -1;
7632
+ }
7633
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7634
+ if (hScale < 0.01)
7635
+ {
7636
+ //hScale = 0.01;
7637
+ }
7638
+
7639
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
7640
+ sign = 1;
7641
+ if (vScale < 0)
7642
+ {
7643
+ sign = -1;
7644
+ }
7645
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7646
+ if (vScale < 0.01)
7647
+ {
7648
+ //vScale = 0.01;
7649
+ }
7650
+
7651
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7652
+
71907653 retval = true;
71917654 }
71927655
....@@ -7196,7 +7659,7 @@
71967659 }
71977660
71987661 //System.out.println("info.modifiers = " + info.modifiers);
7199
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7662
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
72007663 //System.out.println("modified = " + modified);
72017664 //new Exception().printStackTrace();
72027665 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7224,7 +7687,8 @@
72247687 return true;
72257688 }
72267689
7227
- void doEditDrag0(ClickInfo info, boolean opposite)
7690
+ void doEditDrag0(//ClickInfo info,
7691
+ boolean opposite)
72287692 {
72297693 if (hitSomething == 0)
72307694 {
....@@ -7238,7 +7702,7 @@
72387702
72397703 //System.out.println("hitSomething = " + hitSomething);
72407704
7241
- double scale = 0.005f * info.camera.Distance();
7705
+ double scale = 0.005f * clickInfo.camera.Distance();
72427706
72437707 cVector xlate = new cVector();
72447708 //cVector xlate2 = new cVector();
....@@ -7272,8 +7736,8 @@
72727736 toParent[3][i] = xlate.get(i);
72737737 LA.matInvert(toParent, fromParent);
72747738 */
7275
- cVector delta = LA.newVector(0, 0, startY - info.y);
7276
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7739
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7740
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
72777741
72787742 LA.matCopy(startMat, toParent);
72797743 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7282,7 +7746,7 @@
72827746 } else
72837747 {
72847748 //LA.xformDir(delta, info.camera.fromScreen, delta);
7285
- cVector up = new cVector(info.camera.up);
7749
+ cVector up = new cVector(clickInfo.camera.up);
72867750 cVector away = new cVector();
72877751 //cVector right2 = new cVector();
72887752 //LA.vecCross(up, cVector.Z, right);
....@@ -7299,19 +7763,19 @@
72997763 LA.xformDir(up, ClickInfo.matbuffer, up);
73007764 // if (!CameraPane.LOCALTRANSFORM)
73017765 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7302
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7766
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
73037767 // if (!CameraPane.LOCALTRANSFORM)
73047768 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
73057769 //LA.vecCross(up, cVector.Z, right2);
73067770
7307
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7771
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
73087772
73097773 //System.out.println("DELTA0 = " + delta);
73107774 //System.out.println("AWAY = " + info.camera.away);
73117775 //System.out.println("UP = " + info.camera.up);
73127776 if (away.z > 0)
73137777 {
7314
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7778
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
73157779 {
73167780 delta.x = -delta.x;
73177781 } else
....@@ -7326,7 +7790,7 @@
73267790 //System.out.println("DELTA1 = " + delta);
73277791 LA.xformDir(delta, ClickInfo.matbuffer, delta);
73287792 //System.out.println("DELTA2 = " + delta);
7329
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7793
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
73307794 LA.matCopy(startMat, toParent);
73317795 //System.out.println("DELTA3 = " + delta);
73327796 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7336,8 +7800,8 @@
73367800 break;
73377801
73387802 case hitRotate: // rotate
7339
- int dx = info.x - centerPt.x;
7340
- int dy = -(info.y - centerPt.y);
7803
+ int dx = clickInfo.x - centerPt.x;
7804
+ int dy = -(clickInfo.y - centerPt.y);
73417805 double angle = (double) Math.atan2(dx, dy);
73427806 angle = -(1.570796 - angle);
73437807
....@@ -7360,7 +7824,7 @@
73607824 }
73617825 /**/
73627826
7363
- switch (info.pane.RenderCamera().viewCode)
7827
+ switch (clickInfo.pane.RenderCamera().viewCode)
73647828 {
73657829 case 1: // '\001'
73667830 LA.matZRotate(toParent, angle);
....@@ -7387,7 +7851,7 @@
73877851 break;
73887852
73897853 case hitScale: // scale
7390
- double hScale = (double) (info.x - centerPt.x) / 32;
7854
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
73917855 double sign = 1;
73927856 if (hScale < 0)
73937857 {
....@@ -7399,7 +7863,7 @@
73997863 //hScale = 0.01;
74007864 }
74017865
7402
- double vScale = (double) (info.y - centerPt.y) / 32;
7866
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
74037867 sign = 1;
74047868 if (vScale < 0)
74057869 {
....@@ -7410,6 +7874,7 @@
74107874 {
74117875 //vScale = 0.01;
74127876 }
7877
+
74137878 LA.matCopy(startMat, toParent);
74147879 /**/
74157880 for (int i = 0; i < 3; i++)
....@@ -7419,32 +7884,39 @@
74197884 }
74207885 /**/
74217886
7422
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7887
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
74237888
74247889 if (totalScale < 0.01)
74257890 {
74267891 totalScale = 0.01;
74277892 }
74287893
7429
- switch (info.pane.RenderCamera().viewCode)
7894
+ switch (clickInfo.pane.RenderCamera().viewCode)
74307895 {
74317896 case 3: // '\001'
7432
- if (modified)
7897
+ if (modified || opposite)
74337898 {
7899
+ if (modified && opposite)
7900
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
7901
+ else
74347902 //LA.matScale(toParent, 1, hScale, vScale);
7435
- LA.matScale(toParent, totalScale, 1, 1);
7903
+ LA.matScale(toParent, totalScale, 1, 1);
74367904 } // vScale, 1);
74377905 else
74387906 {
7439
- LA.matScale(toParent, totalScale, totalScale, totalScale);
7907
+ // EXCEPTION!
7908
+ LA.matScale(toParent, 1, totalScale, totalScale);
74407909 } // vScale, 1);
74417910 break;
74427911
74437912 case 2: // '\002'
7444
- if (modified)
7913
+ if (modified || opposite)
74457914 {
7446
- //LA.matScale(toParent, hScale, 1, vScale);
7447
- LA.matScale(toParent, 1, totalScale, 1);
7915
+ if (modified && opposite)
7916
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
7917
+ else
7918
+ //LA.matScale(toParent, hScale, 1, vScale);
7919
+ LA.matScale(toParent, 1, totalScale, 1);
74487920 } else
74497921 {
74507922 LA.matScale(toParent, totalScale, 1, totalScale);
....@@ -7452,10 +7924,13 @@
74527924 break;
74537925
74547926 case 1: // '\003'
7455
- if (modified)
7927
+ if (modified || opposite)
74567928 {
7457
- //LA.matScale(toParent, hScale, vScale, 1);
7458
- LA.matScale(toParent, 1, 1, totalScale);
7929
+ if (modified && opposite)
7930
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
7931
+ else
7932
+ //LA.matScale(toParent, hScale, vScale, 1);
7933
+ LA.matScale(toParent, 1, 1, totalScale);
74597934 } else
74607935 {
74617936 LA.matScale(toParent, totalScale, totalScale, 1);
....@@ -7492,7 +7967,7 @@
74927967 } // NEW ...
74937968
74947969
7495
- info.pane.repaint();
7970
+ clickInfo.pane.repaint();
74967971 }
74977972
74987973 boolean overflow = false;
....@@ -7672,6 +8147,10 @@
76728147 editWindow = null;
76738148 } // ?
76748149 }
8150
+ else
8151
+ {
8152
+ //editWindow.closeUI();
8153
+ }
76758154 }
76768155
76778156 boolean root; // patch for edit windows
....@@ -7829,6 +8308,10 @@
78298308 }
78308309
78318310 transient ObjEditor editWindow;
8311
+ transient ObjEditor manipWindow;
8312
+
8313
+ transient boolean pinned;
8314
+
78328315 transient ObjectUI objectUI;
78338316 public static int povDepth = 0;
78348317 private static cVector tbMin = new cVector();