Normand Briere
2019-08-07 59de607850161a26863f92961d53caae7a2dabc8
Object3D.java
....@@ -14,12 +14,28 @@
1414 import //weka.core.
1515 matrix.Matrix;
1616
17
+import java.util.UUID;
18
+
1719 //import net.sourceforge.sizeof.SizeOf;
1820 public class Object3D extends Vector<Object3D> implements java.io.Serializable, iSendInfo //, aurelienribon.tweenengine.TweenAccessor<Object3D>
1921 {
2022 //static final long serialVersionUID = -607422624994562685L;
2123 static final long serialVersionUID = 5022536242724664900L;
2224
25
+ // Use GetUUID for backward compatibility with null.
26
+ private UUID uuid = UUID.randomUUID();
27
+
28
+ // TEMPORARY for mocap undo. No need to be transient.
29
+ mocap.reader.BVHReader.BVHResult savebvh;
30
+ Object3D saveskeleton;
31
+ //
32
+
33
+ String skyboxname;
34
+ String skyboxext;
35
+
36
+ Object3D versionlist[];
37
+ int versionindex = -1;
38
+
2339 ScriptNode scriptnode;
2440
2541 void InitOthers()
....@@ -100,64 +116,201 @@
100116
101117 // transient boolean reduced; // for morph reduction
102118
103
-transient com.bulletphysics.linearmath.Transform cache; // for fast merge
104
-transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge
119
+ transient com.bulletphysics.linearmath.Transform cache; // for fast merge
120
+ transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge
105121
106
-transient Object3D transientsupport; // for cloning
107
-transient boolean transientlink2master;
122
+ transient Object3D transientsupport; // for cloning
123
+ transient boolean transientlink2master;
108124
109
-void SaveSupports()
110
-{
111
- if (blockloop)
112
- return;
113
-
114
- transientsupport = support;
115
- transientlink2master = link2master;
116
-
117
- support = null;
118
- link2master = false;
119
-
120
- if (bRep != null)
125
+ void SaveSupports()
121126 {
122
- bRep.SaveSupports();
127
+ if (blockloop)
128
+ return;
129
+
130
+ transientsupport = support;
131
+ transientlink2master = link2master;
132
+
133
+ support = null;
134
+ link2master = false;
135
+
136
+ if (bRep != null)
137
+ {
138
+ bRep.SaveSupports();
139
+ }
140
+
141
+ for (int i = 0; i < Size(); i++)
142
+ {
143
+ Object3D child = (Object3D) get(i);
144
+ if (child == null)
145
+ continue;
146
+ blockloop = true;
147
+ child.SaveSupports();
148
+ blockloop = false;
149
+ }
123150 }
124
-
125
- for (int i = 0; i < Size(); i++)
151
+
152
+ void RestoreSupports()
126153 {
127
- Object3D child = (Object3D) get(i);
128
- if (child == null)
129
- continue;
154
+ if (blockloop)
155
+ return;
156
+
157
+ support = transientsupport;
158
+ link2master = transientlink2master;
159
+ transientsupport = null;
160
+ transientlink2master = false;
161
+
162
+ if (bRep != null)
163
+ {
164
+ bRep.RestoreSupports();
165
+ }
166
+
167
+ for (int i = 0; i < Size(); i++)
168
+ {
169
+ Object3D child = (Object3D) get(i);
170
+ if (child == null)
171
+ continue;
172
+ blockloop = true;
173
+ child.RestoreSupports();
174
+ blockloop = false;
175
+ }
176
+ }
177
+
178
+ void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
179
+ {
180
+ Object3D o;
181
+
182
+ if (hashtable.containsKey(GetUUID()))
183
+ {
184
+ o = hashtable.get(GetUUID());
185
+
186
+ Grafreed.Assert(this.bRep == o.bRep);
187
+ //if (this.bRep != null)
188
+ // assert(this.bRep.support == o.transientrep);
189
+ if (this.support != null)
190
+ assert(this.support.bRep == o.transientrep);
191
+ }
192
+ else
193
+ {
194
+ o = new Object3D("copy of " + this.name);
195
+
196
+ hashtable.put(GetUUID(), o);
197
+ }
198
+
199
+ if (!blockloop)
200
+ {
201
+ blockloop = true;
202
+
203
+ for (int i=0; i<Size(); i++)
204
+ {
205
+ get(i).ExtractBigData(hashtable);
206
+ }
207
+
208
+ blockloop = false;
209
+ }
210
+
211
+ ExtractBigData(o);
212
+ }
213
+
214
+ void ExtractBigData(Object3D o)
215
+ {
216
+ if (o.bRep != null)
217
+ Grafreed.Assert(o.bRep == this.bRep);
218
+
219
+ o.bRep = this.bRep;
220
+// July 2019 if (this.bRep != null)
221
+// {
222
+// o.transientrep = this.bRep.support;
223
+// o.bRep.support = null;
224
+// }
225
+ o.selection = this.selection;
226
+ o.versionlist = this.versionlist;
227
+ o.versionindex = this.versionindex;
228
+
229
+ if (this.support != null)
230
+ {
231
+ if (o.transientrep != null)
232
+ Grafreed.Assert(o.transientrep == this.support.bRep);
233
+
234
+ o.transientrep = this.support.bRep;
235
+ this.support.bRep = null;
236
+ }
237
+
238
+ // o.support = this.support;
239
+ // o.fileparent = this.fileparent;
240
+ // if (this.bRep != null)
241
+ // o.bRep = this.bRep.support;
242
+
243
+ this.bRep = null;
244
+ // if (this.bRep != null)
245
+ // this.bRep.support = null;
246
+ // this.support = null;
247
+ // this.fileparent = null;
248
+ }
249
+
250
+// Object3D GetObject(java.util.UUID uuid)
251
+// {
252
+// if (this.uuid.equals(uuid))
253
+// return this;
254
+//
255
+// if (blockloop)
256
+// return null;
257
+//
258
+// blockloop = true;
259
+//
260
+// for (int i=0; i<Size(); i++)
261
+// {
262
+// Object3D o = get(i).GetObject(uuid);
263
+//
264
+// if (o != null)
265
+// return o;
266
+// }
267
+//
268
+// blockloop = false;
269
+//
270
+// return null;
271
+// }
272
+
273
+ void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
274
+ {
275
+ if (!hashtable.containsKey(GetUUID()))
276
+ return;
277
+
278
+ Object3D o = hashtable.get(GetUUID());
279
+
280
+ RestoreBigData(o);
281
+
282
+ if (blockloop)
283
+ return;
284
+
130285 blockloop = true;
131
- child.SaveSupports();
286
+
287
+ //hashtable.remove(GetUUID());
288
+
289
+ for (int i=0; i<Size(); i++)
290
+ {
291
+ get(i).RestoreBigData(hashtable);
292
+ }
293
+
132294 blockloop = false;
133295 }
134
-}
135296
136
-void RestoreSupports()
137
-{
138
- if (blockloop)
139
- return;
140
-
141
- support = transientsupport;
142
- link2master = transientlink2master;
143
- transientsupport = null;
144
- transientlink2master = false;
145
-
146
- if (bRep != null)
297
+ void RestoreBigData(Object3D o)
147298 {
148
- bRep.RestoreSupports();
299
+ this.bRep = o.bRep;
300
+ if (this.support != null && o.transientrep != null)
301
+ {
302
+ this.support.bRep = o.transientrep;
303
+ }
304
+
305
+ this.selection = o.selection;
306
+
307
+ this.versionlist = o.versionlist;
308
+ this.versionindex = o.versionindex;
309
+// July 2019 if (this.bRep != null)
310
+// this.bRep.support = o.transientrep;
311
+ // this.support = o.support;
312
+ // this.fileparent = o.fileparent;
149313 }
150
-
151
- for (int i = 0; i < Size(); i++)
152
- {
153
- Object3D child = (Object3D) get(i);
154
- if (child == null)
155
- continue;
156
- blockloop = true;
157
- child.RestoreSupports();
158
- blockloop = false;
159
- }
160
-}
161314
162315 // MOCAP SUPPORT
163316 double tx,ty,tz,rx,ry,rz;
....@@ -300,6 +453,7 @@
300453 }
301454
302455 boolean live = false;
456
+ transient boolean keepdontselect;
303457 boolean dontselect = false;
304458 boolean hide = false;
305459 boolean link2master = false; // performs reset support/master at each frame
....@@ -482,12 +636,14 @@
482636 toParent = LA.newMatrix();
483637 fromParent = LA.newMatrix();
484638 }
639
+
485640 if (toParentMarked == null)
486641 {
487642 if (maxcount != 1)
488643 {
489644 new Exception().printStackTrace();
490645 }
646
+
491647 toParentMarked = LA.newMatrix();
492648 fromParentMarked = LA.newMatrix();
493649 }
....@@ -798,7 +954,7 @@
798954
799955 if (marked && Globals.isLIVE() && live &&
800956 //TEMP21aug2018
801
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
957
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
802958 currentframe != Globals.framecount)
803959 {
804960 currentframe = Globals.framecount;
....@@ -810,7 +966,8 @@
810966
811967 boolean changedir = random && Math.random() < 0.01; // && !link2master;
812968
813
- if (transformcount*factor > maxcount || (step == 1 && changedir))
969
+ if (transformcount*factor >= maxcount && (rewind || random) ||
970
+ (step == 1 && changedir))
814971 {
815972 countdown = 1;
816973 delay = speedup?8:1;
....@@ -882,6 +1039,10 @@
8821039 if (material == null || material.multiply)
8831040 return true;
8841041
1042
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1043
+ return false;
1044
+
1045
+ // Transparent objects are dynamic because we have to sort the triangles.
8851046 return material.opacity > 0.99;
8861047 }
8871048
....@@ -1282,6 +1443,7 @@
12821443 toParent = LA.newMatrix();
12831444 fromParent = LA.newMatrix();
12841445 }
1446
+
12851447 LA.matCopy(other.toParent, toParent);
12861448 LA.matCopy(other.fromParent, fromParent);
12871449
....@@ -2303,6 +2465,11 @@
23032465 }
23042466 */
23052467 }
2468
+ else
2469
+ {
2470
+ //((ObjEditor)editWindow).SetupUI2(null);
2471
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
2472
+ }
23062473 }
23072474
23082475 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2344,6 +2511,14 @@
23442511 {
23452512 editWindow.refreshContents();
23462513 }
2514
+ else
2515
+ {
2516
+ if (manipWindow != null)
2517
+ {
2518
+ manipWindow.refreshContents();
2519
+ }
2520
+ }
2521
+
23472522 //if (parent != null)
23482523 //parent.refreshEditWindow();
23492524 }
....@@ -2423,7 +2598,8 @@
24232598 private static final int editSelf = 1;
24242599 private static final int editChild = 2;
24252600
2426
- void drawEditHandles(ClickInfo info, int level)
2601
+ void drawEditHandles(//ClickInfo info,
2602
+ int level)
24272603 {
24282604 if (level == 0)
24292605 {
....@@ -2431,7 +2607,8 @@
24312607 return;
24322608
24332609 Object3D selectee;
2434
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2610
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2611
+ level + 1))
24352612 {
24362613 selectee = (Object3D) e.nextElement();
24372614 }
....@@ -2439,19 +2616,22 @@
24392616 } else
24402617 {
24412618 //super.
2442
- drawEditHandles0(info, level + 1);
2619
+ drawEditHandles0(//info,
2620
+ level + 1);
24432621 }
24442622 }
24452623
2446
- boolean doEditClick(ClickInfo info, int level)
2624
+ boolean doEditClick(//ClickInfo info,
2625
+ int level)
24472626 {
24482627 doSomething = 0;
24492628 if (level == 0)
24502629 {
2451
- return doParentClick(info);
2630
+ return doParentClick(); //info);
24522631 }
24532632 if (//super.
2454
- doEditClick0(info, level))
2633
+ doEditClick0(//info,
2634
+ level))
24552635 {
24562636 doSomething = 1;
24572637 return true;
....@@ -2461,7 +2641,7 @@
24612641 }
24622642 }
24632643
2464
- boolean doParentClick(ClickInfo info)
2644
+ boolean doParentClick() //ClickInfo info)
24652645 {
24662646 if (selection == null)
24672647 {
....@@ -2474,7 +2654,8 @@
24742654 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
24752655 {
24762656 Object3D selectee = (Object3D) e.nextElement();
2477
- if (selectee.doEditClick(info, 1))
2657
+ if (selectee.doEditClick(//info,
2658
+ 1))
24782659 {
24792660 childToDrag = selectee;
24802661 doSomething = 2;
....@@ -2486,13 +2667,15 @@
24862667 return retval;
24872668 }
24882669
2489
- void doEditDrag(ClickInfo info, boolean opposite)
2670
+ void doEditDrag(//ClickInfo clickInfo,
2671
+ boolean opposite)
24902672 {
24912673 switch (doSomething)
24922674 {
24932675 case 1: // '\001'
24942676 //super.
2495
- doEditDrag0(info, opposite);
2677
+ doEditDrag0(//clickInfo,
2678
+ opposite);
24962679 break;
24972680
24982681 case 2: // '\002'
....@@ -2505,11 +2688,13 @@
25052688 {
25062689 //sel.hitSomething = childToDrag.hitSomething;
25072690 //childToDrag.doEditDrag(info);
2508
- sel.doEditDrag(info, opposite);
2691
+ sel.doEditDrag(//clickInfo,
2692
+ opposite);
25092693 } else
25102694 {
25112695 //super.
2512
- doEditDrag0(info, opposite);
2696
+ doEditDrag0(//clickInfo,
2697
+ opposite);
25132698 }
25142699 }
25152700 break;
....@@ -2527,6 +2712,9 @@
25272712 {
25282713 deselectAll();
25292714 }
2715
+
2716
+ new Exception().printStackTrace();
2717
+
25302718 ClickInfo newInfo = new ClickInfo();
25312719 newInfo.flags = info.flags;
25322720 newInfo.bounds = info.bounds;
....@@ -2619,6 +2807,18 @@
26192807 void GenNormalsS(boolean crease)
26202808 {
26212809 selection.GenNormals(crease);
2810
+// for (int i=0; i<selection.size(); i++)
2811
+// {
2812
+// Object3D selectee = (Object3D) selection.elementAt(i);
2813
+// selectee.GenNormals(crease);
2814
+// }
2815
+
2816
+ //Touch();
2817
+ }
2818
+
2819
+ void GenNormalsMeshS()
2820
+ {
2821
+ selection.GenNormalsMesh();
26222822 // for (int i=0; i<selection.size(); i++)
26232823 // {
26242824 // Object3D selectee = (Object3D) selection.elementAt(i);
....@@ -2759,6 +2959,24 @@
27592959 if (child == null)
27602960 continue;
27612961 child.GenNormals(crease);
2962
+// Children().release(i);
2963
+ }
2964
+ blockloop = false;
2965
+ }
2966
+
2967
+ void GenNormalsMesh()
2968
+ {
2969
+ if (blockloop)
2970
+ return;
2971
+
2972
+ blockloop = true;
2973
+ GenNormalsMesh0();
2974
+ for (int i = 0; i < Children().Size(); i++)
2975
+ {
2976
+ Object3D child = (Object3D) Children().get(i); // reserve(i);
2977
+ if (child == null)
2978
+ continue;
2979
+ child.GenNormalsMesh();
27622980 // Children().release(i);
27632981 }
27642982 blockloop = false;
....@@ -2931,11 +3149,20 @@
29313149 }
29323150 }
29333151
3152
+ void GenNormalsMesh0()
3153
+ {
3154
+ if (bRep != null)
3155
+ {
3156
+ bRep.GenerateNormalsMesh();
3157
+ Touch();
3158
+ }
3159
+ }
3160
+
29343161 void GenNormalsMINE0()
29353162 {
29363163 if (bRep != null)
29373164 {
2938
- bRep.GenerateNormalsMINE();
3165
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
29393166 Touch();
29403167 }
29413168 }
....@@ -3381,7 +3608,8 @@
33813608 if (blockloop)
33823609 return;
33833610
3384
- if (marked || (bRep != null && material != null)) // borderline...
3611
+ if (//marked || // does not make sense
3612
+ (bRep != null || material != null)) // borderline...
33853613 live = h;
33863614
33873615 for (int i = 0; i < Size(); i++)
....@@ -3402,7 +3630,8 @@
34023630 return;
34033631
34043632 //if (bRep != null)
3405
- if (marked || (bRep != null && material != null)) // borderline...
3633
+ if (//marked || // does not make sense
3634
+ (bRep != null || material != null)) // borderline...
34063635 link2master = h;
34073636
34083637 for (int i = 0; i < Size(); i++)
....@@ -3422,7 +3651,8 @@
34223651 if (blockloop)
34233652 return;
34243653
3425
- if (marked || (bRep != null && material != null)) // borderline...
3654
+ if (//marked || // does not make sense
3655
+ (bRep != null || material != null)) // borderline...
34263656 hide = h;
34273657
34283658 for (int i = 0; i < Size(); i++)
....@@ -3442,7 +3672,7 @@
34423672 if (blockloop)
34433673 return;
34443674
3445
- if (bRep != null && material != null) // borderline...
3675
+ if (bRep != null || material != null) // borderline...
34463676 marked = h;
34473677
34483678 for (int i = 0; i < Size(); i++)
....@@ -3452,6 +3682,46 @@
34523682 continue;
34533683 blockloop = true;
34543684 child.MarkLeaves(h);
3685
+ blockloop = false;
3686
+ // release(i);
3687
+ }
3688
+ }
3689
+
3690
+ void RewindLeaves(boolean h)
3691
+ {
3692
+ if (blockloop)
3693
+ return;
3694
+
3695
+ if (bRep != null || material != null) // borderline...
3696
+ rewind = h;
3697
+
3698
+ for (int i = 0; i < Size(); i++)
3699
+ {
3700
+ Object3D child = (Object3D) get(i); // reserve(i);
3701
+ if (child == null)
3702
+ continue;
3703
+ blockloop = true;
3704
+ child.RewindLeaves(h);
3705
+ blockloop = false;
3706
+ // release(i);
3707
+ }
3708
+ }
3709
+
3710
+ void RandomLeaves(boolean h)
3711
+ {
3712
+ if (blockloop)
3713
+ return;
3714
+
3715
+ if (bRep != null || material != null) // borderline...
3716
+ random = h;
3717
+
3718
+ for (int i = 0; i < Size(); i++)
3719
+ {
3720
+ Object3D child = (Object3D) get(i); // reserve(i);
3721
+ if (child == null)
3722
+ continue;
3723
+ blockloop = true;
3724
+ child.RandomLeaves(h);
34553725 blockloop = false;
34563726 // release(i);
34573727 }
....@@ -4229,6 +4499,55 @@
42294499 }
42304500 }
42314501
4502
+ void RepairSOV()
4503
+ {
4504
+ if (blockloop)
4505
+ return;
4506
+
4507
+ String texname = this.GetPigmentTexture();
4508
+
4509
+ if (texname.startsWith("sov"))
4510
+ {
4511
+ String[] s = texname.split("/");
4512
+
4513
+ String[] sname = s[1].split("Color.pn");
4514
+
4515
+ texname = sname[0];
4516
+
4517
+ if (sname.length > 1)
4518
+ {
4519
+ texname += "Color.jpg";
4520
+ }
4521
+
4522
+ this.SetPigmentTexture("sov/" + texname);
4523
+ }
4524
+
4525
+ texname = this.GetBumpTexture();
4526
+
4527
+ if (texname.startsWith("sov"))
4528
+ {
4529
+ String[] s = texname.split("/");
4530
+
4531
+ String[] sname = s[1].split("Bump.pn");
4532
+
4533
+ texname = sname[0];
4534
+
4535
+ if (sname.length > 1)
4536
+ {
4537
+ texname += "Bump.jpg";
4538
+ }
4539
+
4540
+ this.SetBumpTexture("sov/" + texname);
4541
+ }
4542
+
4543
+ for (int i=0; i<Size(); i++)
4544
+ {
4545
+ blockloop = true;
4546
+ get(i).RepairSOV();
4547
+ blockloop = false;
4548
+ }
4549
+ }
4550
+
42324551 void RepairTexture()
42334552 {
42344553 if (this instanceof FileObject || blockloop)
....@@ -4743,6 +5062,14 @@
47435062 }
47445063 }
47455064
5065
+ ObjEditor GetWindow()
5066
+ {
5067
+ if (editWindow != null)
5068
+ return editWindow;
5069
+
5070
+ return manipWindow;
5071
+ }
5072
+
47465073 cTreePath Select(int indexcount, boolean deselect)
47475074 {
47485075 if (hide || dontselect)
....@@ -4779,10 +5106,11 @@
47795106 if (leaf != null)
47805107 {
47815108 cTreePath tp = new cTreePath(this, leaf);
4782
- if (editWindow != null)
5109
+ ObjEditor window = GetWindow();
5110
+ if (window != null)
47835111 {
47845112 //System.out.println("editWindow = " + editWindow + " vs " + this);
4785
- editWindow.Select(tp, deselect, true);
5113
+ window.Select(tp, deselect, true);
47865114 }
47875115
47885116 return tp;
....@@ -4799,6 +5127,7 @@
47995127
48005128 if (child == null)
48015129 continue;
5130
+
48025131 if (child.HasTransparency() && child.size() != 0)
48035132 {
48045133 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -4808,9 +5137,10 @@
48085137 if (leaf != null)
48095138 {
48105139 cTreePath tp = new cTreePath(this, leaf);
4811
- if (editWindow != null)
5140
+ ObjEditor window = GetWindow();
5141
+ if (window != null)
48125142 {
4813
- editWindow.Select(tp, deselect, true);
5143
+ window.Select(tp, deselect, true);
48145144 }
48155145
48165146 return tp;
....@@ -5135,6 +5465,51 @@
51355465 blockloop = false;
51365466 }
51375467
5468
+ void ResetSelectable()
5469
+ {
5470
+ if (blockloop)
5471
+ return;
5472
+
5473
+ blockloop = true;
5474
+
5475
+ keepdontselect = dontselect;
5476
+ dontselect = true;
5477
+
5478
+ Object3D child;
5479
+ int nb = Size();
5480
+ for (int i = 0; i < nb; i++)
5481
+ {
5482
+ child = (Object3D) get(i);
5483
+ if (child == null)
5484
+ continue;
5485
+ child.ResetSelectable();
5486
+ }
5487
+
5488
+ blockloop = false;
5489
+ }
5490
+
5491
+ void RestoreSelectable()
5492
+ {
5493
+ if (blockloop)
5494
+ return;
5495
+
5496
+ blockloop = true;
5497
+
5498
+ dontselect = keepdontselect;
5499
+
5500
+ Object3D child;
5501
+ int nb = Size();
5502
+ for (int i = 0; i < nb; i++)
5503
+ {
5504
+ child = (Object3D) get(i);
5505
+ if (child == null)
5506
+ continue;
5507
+ child.RestoreSelectable();
5508
+ }
5509
+
5510
+ blockloop = false;
5511
+ }
5512
+
51385513 boolean IsSelected()
51395514 {
51405515 if (parent == null)
....@@ -5371,6 +5746,43 @@
53715746 }
53725747 }
53735748
5749
+ UUID GetUUID()
5750
+ {
5751
+ if (uuid == null)
5752
+ {
5753
+ // Serial
5754
+ uuid = UUID.randomUUID();
5755
+ }
5756
+
5757
+ return uuid;
5758
+ }
5759
+
5760
+ Object3D GetObject(UUID uid)
5761
+ {
5762
+ if (blockloop)
5763
+ return null;
5764
+
5765
+ if (GetUUID().equals(uid))
5766
+ return this;
5767
+
5768
+ int nb = Size();
5769
+ for (int i = 0; i < nb; i++)
5770
+ {
5771
+ Object3D child = (Object3D) get(i);
5772
+
5773
+ if (child == null)
5774
+ continue;
5775
+
5776
+ blockloop = true;
5777
+ Object3D obj = child.GetObject(uid);
5778
+ blockloop = false;
5779
+ if (obj != null)
5780
+ return obj;
5781
+ }
5782
+
5783
+ return null;
5784
+ }
5785
+
53745786 void SetBumpTexture(String tex)
53755787 {
53765788 if (GetTextures() == null)
....@@ -5407,6 +5819,38 @@
54075819 }
54085820 }
54095821
5822
+ void EmbedTextures(boolean embed)
5823
+ {
5824
+ if (blockloop)
5825
+ return;
5826
+
5827
+ //if (GetTextures() != null)
5828
+ if (embed)
5829
+ CameraPane.EmbedTextures(GetTextures());
5830
+ else
5831
+ {
5832
+ GetTextures().pigmentdata = null;
5833
+ GetTextures().bumpdata = null;
5834
+ GetTextures().pw = 0;
5835
+ GetTextures().ph = 0;
5836
+ GetTextures().bw = 0;
5837
+ GetTextures().bh = 0;
5838
+ }
5839
+
5840
+ int nb = Size();
5841
+ for (int i = 0; i < nb; i++)
5842
+ {
5843
+ Object3D child = (Object3D) get(i);
5844
+
5845
+ if (child == null)
5846
+ continue;
5847
+
5848
+ blockloop = true;
5849
+ child.EmbedTextures(embed);
5850
+ blockloop = false;
5851
+ }
5852
+ }
5853
+
54105854 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
54115855 {
54125856 Draw(display, root, selected, blocked);
....@@ -5415,12 +5859,23 @@
54155859 boolean NeedSupport()
54165860 {
54175861 return
5418
- CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
5862
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
54195863 // PROBLEM with CROWD!!
54205864 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
54215865 }
54225866
54235867 static boolean DEBUG_SELECTION = false;
5868
+
5869
+ boolean IsLive()
5870
+ {
5871
+ if (live)
5872
+ return true;
5873
+
5874
+ if (parent == null)
5875
+ return false;
5876
+
5877
+ return parent.IsLive();
5878
+ }
54245879
54255880 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
54265881 {
....@@ -5482,8 +5937,10 @@
54825937 if (support != null)
54835938 support = support;
54845939
5485
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5486
- boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5940
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5941
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5942
+
5943
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
54875944
54885945 if (!usecalllists && bRep != null && bRep.displaylist > 0)
54895946 {
....@@ -5493,8 +5950,9 @@
54935950 // usecalllists &= !(parent instanceof RandomNode);
54945951 // usecalllists = false;
54955952
5496
- if (GetBRep() != null)
5497
- usecalllists = usecalllists;
5953
+ if (display.DrawMode() == display.SHADOW)
5954
+ //GetBRep() != null)
5955
+ usecalllists = !!usecalllists;
54985956 //System.out.println("draw " + this);
54995957 //new Exception().printStackTrace();
55005958
....@@ -5503,10 +5961,12 @@
55035961 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
55045962
55055963 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5506
- (touched || (bRep != null && bRep.displaylist <= 0)))
5964
+ //(touched || (bRep != null && bRep.displaylist <= 0)))
5965
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
55075966 {
55085967 Globals.lighttouched = true;
55095968 } // all panes...
5969
+
55105970 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
55115971 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
55125972 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5514,7 +5974,7 @@
55145974 if (!(this instanceof Composite))
55155975 touched = false;
55165976 //if (displaylist == -1 && usecalllists)
5517
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5977
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
55185978 {
55195979 bRep.displaylist = display.GenList();
55205980 assert(bRep.displaylist != 0);
....@@ -5525,7 +5985,7 @@
55255985
55265986 //System.out.println("\tnew list " + list);
55275987 //gl.glDrawBuffer(gl.GL_NONE);
5528
- if (usecalllists)
5988
+ if (usecalllists && bRep.displaylist > 0)
55295989 {
55305990 // System.err.println("new list " + bRep.displaylist + " for " + this);
55315991 display.NewList(bRep.displaylist);
....@@ -5534,7 +5994,7 @@
55345994 CallList(display, root, selected, blocked);
55355995
55365996 // compiled = true;
5537
- if (usecalllists)
5997
+ if (usecalllists && bRep.displaylist > 0)
55385998 {
55395999 // System.err.println("end list " + bRep.displaylist + " for " + this);
55406000 display.EndList();
....@@ -5634,6 +6094,7 @@
56346094 if (GetBRep() != null)
56356095 {
56366096 display.NextIndex();
6097
+
56376098 // vertex color conflict : gl.glCallList(list);
56386099 DrawNode(display, root, selected);
56396100 if (this instanceof BezierPatch)
....@@ -5674,16 +6135,27 @@
56746135 tex = GetTextures();
56756136 }
56766137
5677
- boolean failed = false;
6138
+ boolean failedPigment = false;
6139
+ boolean failedBump = false;
56786140
56796141 try
56806142 {
5681
- display.BindTextures(tex, texres);
6143
+ display.BindPigmentTexture(tex, texres);
56826144 }
56836145 catch (Exception e)
56846146 {
56856147 System.err.println("FAILED: " + this);
5686
- failed = true;
6148
+ failedPigment = true;
6149
+ }
6150
+
6151
+ try
6152
+ {
6153
+ display.BindBumpTexture(tex, texres);
6154
+ }
6155
+ catch (Exception e)
6156
+ {
6157
+ //System.err.println("FAILED: " + this);
6158
+ failedBump = true;
56876159 }
56886160
56896161 if (!compiled)
....@@ -5706,8 +6178,11 @@
57066178 }
57076179 }
57086180
5709
- if (!failed)
5710
- display.ReleaseTextures(tex);
6181
+ if (!failedBump)
6182
+ display.ReleaseBumpTexture(tex);
6183
+
6184
+ if (!failedPigment)
6185
+ display.ReleasePigmentTexture(tex);
57116186
57126187 display.PopMaterial(this, selected);
57136188 }
....@@ -6080,6 +6555,11 @@
60806555 // dec 2012
60816556 new Exception().printStackTrace();
60826557 return;
6558
+ }
6559
+
6560
+ if (dontselect)
6561
+ {
6562
+ //bRep.GenerateNormalsMINE();
60836563 }
60846564
60856565 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -6865,20 +7345,23 @@
68657345 }
68667346 }
68677347
6868
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7348
+ static ClickInfo clickInfo = new ClickInfo();
7349
+
7350
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7351
+ Point outPt, Rectangle outRec)
68697352 {
6870
- int hc = info.bounds.x + info.bounds.width / 2;
6871
- int vc = info.bounds.y + info.bounds.height / 2;
6872
- double[][] toscreen = info.toScreen;
7353
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7354
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7355
+ double[][] toscreen = clickInfo.toScreen;
68737356 if (toscreen == null)
68747357 {
6875
- toscreen = new Camera(info.camera.viewCode).toScreen;
7358
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
68767359 }
68777360 cVector vec = in;
68787361 LA.xformPos(in, toscreen, in);
68797362 //System.out.println("Distance = " + info.camera.Distance());
6880
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
6881
- vec.y *= 100 * info.camera.SCALE / info.camera.Distance();
7363
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7364
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
68827365 outPt.x = hc + (int) vec.x;
68837366 outPt.y = vc - (int) vec.y;
68847367 outRec.x = outPt.x - 3;
....@@ -6886,15 +7369,18 @@
68867369 outRec.width = outRec.height = 6;
68877370 }
68887371
6889
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7372
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7373
+ )
68907374 {
68917375 Point pt = new Point(0, 0);
68927376 Rectangle rec = new Rectangle();
6893
- calcHotSpot(in, info, pt, rec);
7377
+ calcHotSpot(in, //clickInfo,
7378
+ pt, rec);
68947379 return rec;
68957380 }
68967381
6897
- void drawEditHandles0(ClickInfo info, int level)
7382
+ void drawEditHandles0(//ClickInfo clickInfo,
7383
+ int level)
68987384 {
68997385 if (level == 0)
69007386 {
....@@ -6903,16 +7389,19 @@
69037389 {
69047390 cVector origin = new cVector();
69057391 //LA.xformPos(origin, toParent, origin);
6906
- Rectangle spot = calcHotSpot(origin, info);
7392
+ if (this.clickInfo == null)
7393
+ this.clickInfo = new ClickInfo();
7394
+
7395
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
69077396 Rectangle boundary = new Rectangle();
69087397 boundary.x = spot.x - 30;
69097398 boundary.y = spot.y - 30;
69107399 boundary.width = spot.width + 60;
69117400 boundary.height = spot.height + 60;
6912
- info.g.setColor(Color.red);
7401
+ clickInfo.g.setColor(Color.red);
69137402 int spotw = spot.x + spot.width;
69147403 int spoth = spot.y + spot.height;
6915
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7404
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
69167405 // if (CameraPane.Xmin > spot.x)
69177406 // {
69187407 // CameraPane.Xmin = spot.x;
....@@ -6932,8 +7421,8 @@
69327421 spot.translate(32, 32);
69337422 spotw = spot.x + spot.width;
69347423 spoth = spot.y + spot.height;
6935
- info.g.setColor(Color.blue);
6936
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7424
+ clickInfo.g.setColor(Color.cyan);
7425
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
69377426 // if (CameraPane.Xmin > spot.x)
69387427 // {
69397428 // CameraPane.Xmin = spot.x;
....@@ -6950,11 +7439,12 @@
69507439 // {
69517440 // CameraPane.Ymax = spoth;
69527441 // }
6953
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
6954
- //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7442
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7443
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
69557444 spot.translate(0, -32);
6956
- info.g.setColor(Color.green);
6957
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7445
+ clickInfo.g.setColor(Color.yellow);
7446
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7447
+ clickInfo.g.setColor(Color.green);
69587448 // if (CameraPane.Xmin > spot.x)
69597449 // {
69607450 // CameraPane.Xmin = spot.x;
....@@ -6971,8 +7461,8 @@
69717461 // {
69727462 // CameraPane.Ymax = spoth;
69737463 // }
6974
- info.g.drawArc(boundary.x, boundary.y,
6975
- boundary.width, boundary.height, 0, 360);
7464
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7465
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
69767466 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
69777467 // if (CameraPane.Xmin > boundary.x)
69787468 // {
....@@ -6994,7 +7484,8 @@
69947484 }
69957485 }
69967486
6997
- boolean doEditClick0(ClickInfo info, int level)
7487
+ boolean doEditClick0(//ClickInfo clickInfo,
7488
+ int level)
69987489 {
69997490 if (level == 0)
70007491 {
....@@ -7003,8 +7494,8 @@
70037494
70047495 boolean retval = false;
70057496
7006
- startX = info.x;
7007
- startY = info.y;
7497
+ startX = clickInfo.x;
7498
+ startY = clickInfo.y;
70087499
70097500 hitSomething = -1;
70107501 cVector origin = new cVector();
....@@ -7014,22 +7505,51 @@
70147505 {
70157506 centerPt = new Point(0, 0);
70167507 }
7017
- calcHotSpot(origin, info, centerPt, spot);
7018
- if (spot.contains(info.x, info.y))
7508
+ calcHotSpot(origin, //info,
7509
+ centerPt, spot);
7510
+ if (spot.contains(clickInfo.x, clickInfo.y))
70197511 {
70207512 hitSomething = hitCenter;
70217513 retval = true;
70227514 }
70237515 spot.translate(32, 0);
7024
- if (spot.contains(info.x, info.y))
7516
+ if (spot.contains(clickInfo.x, clickInfo.y))
70257517 {
70267518 hitSomething = hitRotate;
70277519 retval = true;
70287520 }
70297521 spot.translate(0, 32);
7030
- if (spot.contains(info.x, info.y))
7522
+ if (spot.contains(clickInfo.x, clickInfo.y))
70317523 {
70327524 hitSomething = hitScale;
7525
+
7526
+ double scale = 0.005f * clickInfo.camera.Distance();
7527
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7528
+ double sign = 1;
7529
+ if (hScale < 0)
7530
+ {
7531
+ sign = -1;
7532
+ }
7533
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7534
+ if (hScale < 0.01)
7535
+ {
7536
+ //hScale = 0.01;
7537
+ }
7538
+
7539
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7540
+ sign = 1;
7541
+ if (vScale < 0)
7542
+ {
7543
+ sign = -1;
7544
+ }
7545
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7546
+ if (vScale < 0.01)
7547
+ {
7548
+ //vScale = 0.01;
7549
+ }
7550
+
7551
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7552
+
70337553 retval = true;
70347554 }
70357555
....@@ -7039,7 +7559,7 @@
70397559 }
70407560
70417561 //System.out.println("info.modifiers = " + info.modifiers);
7042
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7562
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
70437563 //System.out.println("modified = " + modified);
70447564 //new Exception().printStackTrace();
70457565 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7067,7 +7587,8 @@
70677587 return true;
70687588 }
70697589
7070
- void doEditDrag0(ClickInfo info, boolean opposite)
7590
+ void doEditDrag0(//ClickInfo info,
7591
+ boolean opposite)
70717592 {
70727593 if (hitSomething == 0)
70737594 {
....@@ -7081,7 +7602,7 @@
70817602
70827603 //System.out.println("hitSomething = " + hitSomething);
70837604
7084
- double scale = 0.005f * info.camera.Distance();
7605
+ double scale = 0.005f * clickInfo.camera.Distance();
70857606
70867607 cVector xlate = new cVector();
70877608 //cVector xlate2 = new cVector();
....@@ -7115,8 +7636,8 @@
71157636 toParent[3][i] = xlate.get(i);
71167637 LA.matInvert(toParent, fromParent);
71177638 */
7118
- cVector delta = LA.newVector(0, 0, startY - info.y);
7119
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7639
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7640
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
71207641
71217642 LA.matCopy(startMat, toParent);
71227643 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7125,7 +7646,7 @@
71257646 } else
71267647 {
71277648 //LA.xformDir(delta, info.camera.fromScreen, delta);
7128
- cVector up = new cVector(info.camera.up);
7649
+ cVector up = new cVector(clickInfo.camera.up);
71297650 cVector away = new cVector();
71307651 //cVector right2 = new cVector();
71317652 //LA.vecCross(up, cVector.Z, right);
....@@ -7142,19 +7663,19 @@
71427663 LA.xformDir(up, ClickInfo.matbuffer, up);
71437664 // if (!CameraPane.LOCALTRANSFORM)
71447665 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7145
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7666
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
71467667 // if (!CameraPane.LOCALTRANSFORM)
71477668 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
71487669 //LA.vecCross(up, cVector.Z, right2);
71497670
7150
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7671
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
71517672
71527673 //System.out.println("DELTA0 = " + delta);
71537674 //System.out.println("AWAY = " + info.camera.away);
71547675 //System.out.println("UP = " + info.camera.up);
71557676 if (away.z > 0)
71567677 {
7157
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7678
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
71587679 {
71597680 delta.x = -delta.x;
71607681 } else
....@@ -7169,7 +7690,7 @@
71697690 //System.out.println("DELTA1 = " + delta);
71707691 LA.xformDir(delta, ClickInfo.matbuffer, delta);
71717692 //System.out.println("DELTA2 = " + delta);
7172
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7693
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
71737694 LA.matCopy(startMat, toParent);
71747695 //System.out.println("DELTA3 = " + delta);
71757696 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7179,8 +7700,8 @@
71797700 break;
71807701
71817702 case hitRotate: // rotate
7182
- int dx = info.x - centerPt.x;
7183
- int dy = -(info.y - centerPt.y);
7703
+ int dx = clickInfo.x - centerPt.x;
7704
+ int dy = -(clickInfo.y - centerPt.y);
71847705 double angle = (double) Math.atan2(dx, dy);
71857706 angle = -(1.570796 - angle);
71867707
....@@ -7203,7 +7724,7 @@
72037724 }
72047725 /**/
72057726
7206
- switch (info.pane.RenderCamera().viewCode)
7727
+ switch (clickInfo.pane.RenderCamera().viewCode)
72077728 {
72087729 case 1: // '\001'
72097730 LA.matZRotate(toParent, angle);
....@@ -7230,7 +7751,7 @@
72307751 break;
72317752
72327753 case hitScale: // scale
7233
- double hScale = (double) (info.x - centerPt.x) / 32;
7754
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
72347755 double sign = 1;
72357756 if (hScale < 0)
72367757 {
....@@ -7242,7 +7763,7 @@
72427763 //hScale = 0.01;
72437764 }
72447765
7245
- double vScale = (double) (info.y - centerPt.y) / 32;
7766
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
72467767 sign = 1;
72477768 if (vScale < 0)
72487769 {
....@@ -7253,6 +7774,7 @@
72537774 {
72547775 //vScale = 0.01;
72557776 }
7777
+
72567778 LA.matCopy(startMat, toParent);
72577779 /**/
72587780 for (int i = 0; i < 3; i++)
....@@ -7262,29 +7784,30 @@
72627784 }
72637785 /**/
72647786
7265
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7787
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
72667788
72677789 if (totalScale < 0.01)
72687790 {
72697791 totalScale = 0.01;
72707792 }
72717793
7272
- switch (info.pane.RenderCamera().viewCode)
7794
+ switch (clickInfo.pane.RenderCamera().viewCode)
72737795 {
72747796 case 3: // '\001'
7275
- if (modified)
7797
+ if (modified || opposite)
72767798 {
72777799 //LA.matScale(toParent, 1, hScale, vScale);
72787800 LA.matScale(toParent, totalScale, 1, 1);
72797801 } // vScale, 1);
72807802 else
72817803 {
7804
+ // EXCEPTION!
72827805 LA.matScale(toParent, totalScale, totalScale, totalScale);
72837806 } // vScale, 1);
72847807 break;
72857808
72867809 case 2: // '\002'
7287
- if (modified)
7810
+ if (modified || opposite)
72887811 {
72897812 //LA.matScale(toParent, hScale, 1, vScale);
72907813 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7295,7 +7818,7 @@
72957818 break;
72967819
72977820 case 1: // '\003'
7298
- if (modified)
7821
+ if (modified || opposite)
72997822 {
73007823 //LA.matScale(toParent, hScale, vScale, 1);
73017824 LA.matScale(toParent, 1, 1, totalScale);
....@@ -7335,7 +7858,7 @@
73357858 } // NEW ...
73367859
73377860
7338
- info.pane.repaint();
7861
+ clickInfo.pane.repaint();
73397862 }
73407863
73417864 boolean overflow = false;
....@@ -7515,6 +8038,10 @@
75158038 editWindow = null;
75168039 } // ?
75178040 }
8041
+ else
8042
+ {
8043
+ //editWindow.closeUI();
8044
+ }
75188045 }
75198046
75208047 boolean root; // patch for edit windows
....@@ -7526,7 +8053,7 @@
75268053 /*transient*/ cVector2[] projectedVertices = new cVector2[0];
75278054
75288055 Object3D /*Composite*/ parent;
7529
- Object3D /*Composite*/ fileparent;
8056
+ Object3D /*Composite*/ fileparent; // In the case of FileObject
75308057
75318058 double[][] toParent; // dynamic matrix
75328059 double[][] fromParent;
....@@ -7672,6 +8199,10 @@
76728199 }
76738200
76748201 transient ObjEditor editWindow;
8202
+ transient ObjEditor manipWindow;
8203
+
8204
+ transient boolean pinned;
8205
+
76758206 transient ObjectUI objectUI;
76768207 public static int povDepth = 0;
76778208 private static cVector tbMin = new cVector();