Normand Briere
2019-08-06 4ec7130da08861dc4aff0232dbce38f3471696a4
Object3D.java
....@@ -22,8 +22,20 @@
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
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
+
2739 ScriptNode scriptnode;
2840
2941 void InitOthers()
....@@ -104,117 +116,201 @@
104116
105117 // transient boolean reduced; // for morph reduction
106118
107
-transient com.bulletphysics.linearmath.Transform cache; // for fast merge
108
-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
109121
110
-transient Object3D transientsupport; // for cloning
111
-transient boolean transientlink2master;
122
+ transient Object3D transientsupport; // for cloning
123
+ transient boolean transientlink2master;
112124
113
-void SaveSupports()
114
-{
115
- if (blockloop)
116
- return;
117
-
118
- transientsupport = support;
119
- transientlink2master = link2master;
120
-
121
- support = null;
122
- link2master = false;
123
-
124
- if (bRep != null)
125
+ void SaveSupports()
125126 {
126
- 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
+ }
127150 }
128
-
129
- for (int i = 0; i < Size(); i++)
151
+
152
+ void RestoreSupports()
130153 {
131
- Object3D child = (Object3D) get(i);
132
- if (child == null)
133
- 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
+
134285 blockloop = true;
135
- child.SaveSupports();
286
+
287
+ //hashtable.remove(GetUUID());
288
+
289
+ for (int i=0; i<Size(); i++)
290
+ {
291
+ get(i).RestoreBigData(hashtable);
292
+ }
293
+
136294 blockloop = false;
137295 }
138
-}
139296
140
-void RestoreSupports()
141
-{
142
- if (blockloop)
143
- return;
144
-
145
- support = transientsupport;
146
- link2master = transientlink2master;
147
- transientsupport = null;
148
- transientlink2master = false;
149
-
150
- if (bRep != null)
297
+ void RestoreBigData(Object3D o)
151298 {
152
- 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;
153313 }
154
-
155
- for (int i = 0; i < Size(); i++)
156
- {
157
- Object3D child = (Object3D) get(i);
158
- if (child == null)
159
- continue;
160
- blockloop = true;
161
- child.RestoreSupports();
162
- blockloop = false;
163
- }
164
-}
165
-
166
-void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
167
-{
168
- if (hashtable.containsKey(GetUUID()))
169
- return;
170
-
171
- Object3D o = new Object3D();
172
- o.bRep = this.bRep;
173
- if (this.bRep != null)
174
- {
175
- o.transientrep = this.bRep.support;
176
- o.bRep.support = null;
177
- }
178
-
179
-// o.support = this.support;
180
-// o.fileparent = this.fileparent;
181
-// if (this.bRep != null)
182
-// o.bRep = this.bRep.support;
183
-
184
- hashtable.put(GetUUID(), o);
185
-
186
- this.bRep = null;
187
-// if (this.bRep != null)
188
-// this.bRep.support = null;
189
-// this.support = null;
190
-// this.fileparent = null;
191
-
192
- for (int i=0; i<Size(); i++)
193
- {
194
- get(i).ExtractBigData(hashtable);
195
- }
196
-}
197
-
198
-void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
199
-{
200
- if (!hashtable.containsKey(GetUUID()))
201
- return;
202
-
203
- Object3D o = hashtable.get(GetUUID());
204
-
205
- this.bRep = o.bRep;
206
- if (this.bRep != null)
207
- this.bRep.support = o.transientrep;
208
-// this.support = o.support;
209
-// this.fileparent = o.fileparent;
210
-
211
- hashtable.remove(GetUUID());
212
-
213
- for (int i=0; i<Size(); i++)
214
- {
215
- get(i).RestoreBigData(hashtable);
216
- }
217
-}
218314
219315 // MOCAP SUPPORT
220316 double tx,ty,tz,rx,ry,rz;
....@@ -357,6 +453,7 @@
357453 }
358454
359455 boolean live = false;
456
+ transient boolean keepdontselect;
360457 boolean dontselect = false;
361458 boolean hide = false;
362459 boolean link2master = false; // performs reset support/master at each frame
....@@ -539,12 +636,14 @@
539636 toParent = LA.newMatrix();
540637 fromParent = LA.newMatrix();
541638 }
639
+
542640 if (toParentMarked == null)
543641 {
544642 if (maxcount != 1)
545643 {
546644 new Exception().printStackTrace();
547645 }
646
+
548647 toParentMarked = LA.newMatrix();
549648 fromParentMarked = LA.newMatrix();
550649 }
....@@ -855,7 +954,7 @@
855954
856955 if (marked && Globals.isLIVE() && live &&
857956 //TEMP21aug2018
858
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
957
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
859958 currentframe != Globals.framecount)
860959 {
861960 currentframe = Globals.framecount;
....@@ -867,7 +966,8 @@
867966
868967 boolean changedir = random && Math.random() < 0.01; // && !link2master;
869968
870
- if (transformcount*factor > maxcount || (step == 1 && changedir))
969
+ if (transformcount*factor >= maxcount && (rewind || random) ||
970
+ (step == 1 && changedir))
871971 {
872972 countdown = 1;
873973 delay = speedup?8:1;
....@@ -939,6 +1039,10 @@
9391039 if (material == null || material.multiply)
9401040 return true;
9411041
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.
9421046 return material.opacity > 0.99;
9431047 }
9441048
....@@ -1339,6 +1443,7 @@
13391443 toParent = LA.newMatrix();
13401444 fromParent = LA.newMatrix();
13411445 }
1446
+
13421447 LA.matCopy(other.toParent, toParent);
13431448 LA.matCopy(other.fromParent, fromParent);
13441449
....@@ -2360,6 +2465,10 @@
23602465 }
23612466 */
23622467 }
2468
+ else
2469
+ {
2470
+ //((ObjEditor)editWindow).SetupUI2(null);
2471
+ }
23632472 }
23642473
23652474 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2401,6 +2510,14 @@
24012510 {
24022511 editWindow.refreshContents();
24032512 }
2513
+ else
2514
+ {
2515
+ if (manipWindow != null)
2516
+ {
2517
+ manipWindow.refreshContents();
2518
+ }
2519
+ }
2520
+
24042521 //if (parent != null)
24052522 //parent.refreshEditWindow();
24062523 }
....@@ -2480,7 +2597,8 @@
24802597 private static final int editSelf = 1;
24812598 private static final int editChild = 2;
24822599
2483
- void drawEditHandles(ClickInfo info, int level)
2600
+ void drawEditHandles(//ClickInfo info,
2601
+ int level)
24842602 {
24852603 if (level == 0)
24862604 {
....@@ -2488,7 +2606,8 @@
24882606 return;
24892607
24902608 Object3D selectee;
2491
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2609
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2610
+ level + 1))
24922611 {
24932612 selectee = (Object3D) e.nextElement();
24942613 }
....@@ -2496,19 +2615,22 @@
24962615 } else
24972616 {
24982617 //super.
2499
- drawEditHandles0(info, level + 1);
2618
+ drawEditHandles0(//info,
2619
+ level + 1);
25002620 }
25012621 }
25022622
2503
- boolean doEditClick(ClickInfo info, int level)
2623
+ boolean doEditClick(//ClickInfo info,
2624
+ int level)
25042625 {
25052626 doSomething = 0;
25062627 if (level == 0)
25072628 {
2508
- return doParentClick(info);
2629
+ return doParentClick(); //info);
25092630 }
25102631 if (//super.
2511
- doEditClick0(info, level))
2632
+ doEditClick0(//info,
2633
+ level))
25122634 {
25132635 doSomething = 1;
25142636 return true;
....@@ -2518,7 +2640,7 @@
25182640 }
25192641 }
25202642
2521
- boolean doParentClick(ClickInfo info)
2643
+ boolean doParentClick() //ClickInfo info)
25222644 {
25232645 if (selection == null)
25242646 {
....@@ -2531,7 +2653,8 @@
25312653 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
25322654 {
25332655 Object3D selectee = (Object3D) e.nextElement();
2534
- if (selectee.doEditClick(info, 1))
2656
+ if (selectee.doEditClick(//info,
2657
+ 1))
25352658 {
25362659 childToDrag = selectee;
25372660 doSomething = 2;
....@@ -2543,13 +2666,15 @@
25432666 return retval;
25442667 }
25452668
2546
- void doEditDrag(ClickInfo info, boolean opposite)
2669
+ void doEditDrag(//ClickInfo clickInfo,
2670
+ boolean opposite)
25472671 {
25482672 switch (doSomething)
25492673 {
25502674 case 1: // '\001'
25512675 //super.
2552
- doEditDrag0(info, opposite);
2676
+ doEditDrag0(//clickInfo,
2677
+ opposite);
25532678 break;
25542679
25552680 case 2: // '\002'
....@@ -2562,11 +2687,13 @@
25622687 {
25632688 //sel.hitSomething = childToDrag.hitSomething;
25642689 //childToDrag.doEditDrag(info);
2565
- sel.doEditDrag(info, opposite);
2690
+ sel.doEditDrag(//clickInfo,
2691
+ opposite);
25662692 } else
25672693 {
25682694 //super.
2569
- doEditDrag0(info, opposite);
2695
+ doEditDrag0(//clickInfo,
2696
+ opposite);
25702697 }
25712698 }
25722699 break;
....@@ -2584,6 +2711,9 @@
25842711 {
25852712 deselectAll();
25862713 }
2714
+
2715
+ new Exception().printStackTrace();
2716
+
25872717 ClickInfo newInfo = new ClickInfo();
25882718 newInfo.flags = info.flags;
25892719 newInfo.bounds = info.bounds;
....@@ -2676,6 +2806,18 @@
26762806 void GenNormalsS(boolean crease)
26772807 {
26782808 selection.GenNormals(crease);
2809
+// for (int i=0; i<selection.size(); i++)
2810
+// {
2811
+// Object3D selectee = (Object3D) selection.elementAt(i);
2812
+// selectee.GenNormals(crease);
2813
+// }
2814
+
2815
+ //Touch();
2816
+ }
2817
+
2818
+ void GenNormalsMeshS()
2819
+ {
2820
+ selection.GenNormalsMesh();
26792821 // for (int i=0; i<selection.size(); i++)
26802822 // {
26812823 // Object3D selectee = (Object3D) selection.elementAt(i);
....@@ -2816,6 +2958,24 @@
28162958 if (child == null)
28172959 continue;
28182960 child.GenNormals(crease);
2961
+// Children().release(i);
2962
+ }
2963
+ blockloop = false;
2964
+ }
2965
+
2966
+ void GenNormalsMesh()
2967
+ {
2968
+ if (blockloop)
2969
+ return;
2970
+
2971
+ blockloop = true;
2972
+ GenNormalsMesh0();
2973
+ for (int i = 0; i < Children().Size(); i++)
2974
+ {
2975
+ Object3D child = (Object3D) Children().get(i); // reserve(i);
2976
+ if (child == null)
2977
+ continue;
2978
+ child.GenNormalsMesh();
28192979 // Children().release(i);
28202980 }
28212981 blockloop = false;
....@@ -2988,11 +3148,20 @@
29883148 }
29893149 }
29903150
3151
+ void GenNormalsMesh0()
3152
+ {
3153
+ if (bRep != null)
3154
+ {
3155
+ bRep.GenerateNormalsMesh();
3156
+ Touch();
3157
+ }
3158
+ }
3159
+
29913160 void GenNormalsMINE0()
29923161 {
29933162 if (bRep != null)
29943163 {
2995
- bRep.GenerateNormalsMINE();
3164
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
29963165 Touch();
29973166 }
29983167 }
....@@ -3438,7 +3607,8 @@
34383607 if (blockloop)
34393608 return;
34403609
3441
- if (marked || (bRep != null && material != null)) // borderline...
3610
+ if (//marked || // does not make sense
3611
+ (bRep != null || material != null)) // borderline...
34423612 live = h;
34433613
34443614 for (int i = 0; i < Size(); i++)
....@@ -3459,7 +3629,8 @@
34593629 return;
34603630
34613631 //if (bRep != null)
3462
- if (marked || (bRep != null && material != null)) // borderline...
3632
+ if (//marked || // does not make sense
3633
+ (bRep != null || material != null)) // borderline...
34633634 link2master = h;
34643635
34653636 for (int i = 0; i < Size(); i++)
....@@ -3479,7 +3650,8 @@
34793650 if (blockloop)
34803651 return;
34813652
3482
- if (marked || (bRep != null && material != null)) // borderline...
3653
+ if (//marked || // does not make sense
3654
+ (bRep != null || material != null)) // borderline...
34833655 hide = h;
34843656
34853657 for (int i = 0; i < Size(); i++)
....@@ -3499,7 +3671,7 @@
34993671 if (blockloop)
35003672 return;
35013673
3502
- if (bRep != null && material != null) // borderline...
3674
+ if (bRep != null || material != null) // borderline...
35033675 marked = h;
35043676
35053677 for (int i = 0; i < Size(); i++)
....@@ -3509,6 +3681,46 @@
35093681 continue;
35103682 blockloop = true;
35113683 child.MarkLeaves(h);
3684
+ blockloop = false;
3685
+ // release(i);
3686
+ }
3687
+ }
3688
+
3689
+ void RewindLeaves(boolean h)
3690
+ {
3691
+ if (blockloop)
3692
+ return;
3693
+
3694
+ if (bRep != null || material != null) // borderline...
3695
+ rewind = h;
3696
+
3697
+ for (int i = 0; i < Size(); i++)
3698
+ {
3699
+ Object3D child = (Object3D) get(i); // reserve(i);
3700
+ if (child == null)
3701
+ continue;
3702
+ blockloop = true;
3703
+ child.RewindLeaves(h);
3704
+ blockloop = false;
3705
+ // release(i);
3706
+ }
3707
+ }
3708
+
3709
+ void RandomLeaves(boolean h)
3710
+ {
3711
+ if (blockloop)
3712
+ return;
3713
+
3714
+ if (bRep != null || material != null) // borderline...
3715
+ random = h;
3716
+
3717
+ for (int i = 0; i < Size(); i++)
3718
+ {
3719
+ Object3D child = (Object3D) get(i); // reserve(i);
3720
+ if (child == null)
3721
+ continue;
3722
+ blockloop = true;
3723
+ child.RandomLeaves(h);
35123724 blockloop = false;
35133725 // release(i);
35143726 }
....@@ -4286,6 +4498,55 @@
42864498 }
42874499 }
42884500
4501
+ void RepairSOV()
4502
+ {
4503
+ if (blockloop)
4504
+ return;
4505
+
4506
+ String texname = this.GetPigmentTexture();
4507
+
4508
+ if (texname.startsWith("sov"))
4509
+ {
4510
+ String[] s = texname.split("/");
4511
+
4512
+ String[] sname = s[1].split("Color.pn");
4513
+
4514
+ texname = sname[0];
4515
+
4516
+ if (sname.length > 1)
4517
+ {
4518
+ texname += "Color.jpg";
4519
+ }
4520
+
4521
+ this.SetPigmentTexture("sov/" + texname);
4522
+ }
4523
+
4524
+ texname = this.GetBumpTexture();
4525
+
4526
+ if (texname.startsWith("sov"))
4527
+ {
4528
+ String[] s = texname.split("/");
4529
+
4530
+ String[] sname = s[1].split("Bump.pn");
4531
+
4532
+ texname = sname[0];
4533
+
4534
+ if (sname.length > 1)
4535
+ {
4536
+ texname += "Bump.jpg";
4537
+ }
4538
+
4539
+ this.SetBumpTexture("sov/" + texname);
4540
+ }
4541
+
4542
+ for (int i=0; i<Size(); i++)
4543
+ {
4544
+ blockloop = true;
4545
+ get(i).RepairSOV();
4546
+ blockloop = false;
4547
+ }
4548
+ }
4549
+
42894550 void RepairTexture()
42904551 {
42914552 if (this instanceof FileObject || blockloop)
....@@ -4800,6 +5061,14 @@
48005061 }
48015062 }
48025063
5064
+ ObjEditor GetWindow()
5065
+ {
5066
+ if (editWindow != null)
5067
+ return editWindow;
5068
+
5069
+ return manipWindow;
5070
+ }
5071
+
48035072 cTreePath Select(int indexcount, boolean deselect)
48045073 {
48055074 if (hide || dontselect)
....@@ -4836,10 +5105,11 @@
48365105 if (leaf != null)
48375106 {
48385107 cTreePath tp = new cTreePath(this, leaf);
4839
- if (editWindow != null)
5108
+ ObjEditor window = GetWindow();
5109
+ if (window != null)
48405110 {
48415111 //System.out.println("editWindow = " + editWindow + " vs " + this);
4842
- editWindow.Select(tp, deselect, true);
5112
+ window.Select(tp, deselect, true);
48435113 }
48445114
48455115 return tp;
....@@ -4856,6 +5126,7 @@
48565126
48575127 if (child == null)
48585128 continue;
5129
+
48595130 if (child.HasTransparency() && child.size() != 0)
48605131 {
48615132 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -4865,9 +5136,10 @@
48655136 if (leaf != null)
48665137 {
48675138 cTreePath tp = new cTreePath(this, leaf);
4868
- if (editWindow != null)
5139
+ ObjEditor window = GetWindow();
5140
+ if (window != null)
48695141 {
4870
- editWindow.Select(tp, deselect, true);
5142
+ window.Select(tp, deselect, true);
48715143 }
48725144
48735145 return tp;
....@@ -5192,6 +5464,51 @@
51925464 blockloop = false;
51935465 }
51945466
5467
+ void ResetSelectable()
5468
+ {
5469
+ if (blockloop)
5470
+ return;
5471
+
5472
+ blockloop = true;
5473
+
5474
+ keepdontselect = dontselect;
5475
+ dontselect = true;
5476
+
5477
+ Object3D child;
5478
+ int nb = Size();
5479
+ for (int i = 0; i < nb; i++)
5480
+ {
5481
+ child = (Object3D) get(i);
5482
+ if (child == null)
5483
+ continue;
5484
+ child.ResetSelectable();
5485
+ }
5486
+
5487
+ blockloop = false;
5488
+ }
5489
+
5490
+ void RestoreSelectable()
5491
+ {
5492
+ if (blockloop)
5493
+ return;
5494
+
5495
+ blockloop = true;
5496
+
5497
+ dontselect = keepdontselect;
5498
+
5499
+ Object3D child;
5500
+ int nb = Size();
5501
+ for (int i = 0; i < nb; i++)
5502
+ {
5503
+ child = (Object3D) get(i);
5504
+ if (child == null)
5505
+ continue;
5506
+ child.RestoreSelectable();
5507
+ }
5508
+
5509
+ blockloop = false;
5510
+ }
5511
+
51955512 boolean IsSelected()
51965513 {
51975514 if (parent == null)
....@@ -5501,6 +5818,38 @@
55015818 }
55025819 }
55035820
5821
+ void EmbedTextures(boolean embed)
5822
+ {
5823
+ if (blockloop)
5824
+ return;
5825
+
5826
+ //if (GetTextures() != null)
5827
+ if (embed)
5828
+ CameraPane.EmbedTextures(GetTextures());
5829
+ else
5830
+ {
5831
+ GetTextures().pigmentdata = null;
5832
+ GetTextures().bumpdata = null;
5833
+ GetTextures().pw = 0;
5834
+ GetTextures().ph = 0;
5835
+ GetTextures().bw = 0;
5836
+ GetTextures().bh = 0;
5837
+ }
5838
+
5839
+ int nb = Size();
5840
+ for (int i = 0; i < nb; i++)
5841
+ {
5842
+ Object3D child = (Object3D) get(i);
5843
+
5844
+ if (child == null)
5845
+ continue;
5846
+
5847
+ blockloop = true;
5848
+ child.EmbedTextures(embed);
5849
+ blockloop = false;
5850
+ }
5851
+ }
5852
+
55045853 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55055854 {
55065855 Draw(display, root, selected, blocked);
....@@ -5509,12 +5858,23 @@
55095858 boolean NeedSupport()
55105859 {
55115860 return
5512
- CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
5861
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
55135862 // PROBLEM with CROWD!!
55145863 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
55155864 }
55165865
55175866 static boolean DEBUG_SELECTION = false;
5867
+
5868
+ boolean IsLive()
5869
+ {
5870
+ if (live)
5871
+ return true;
5872
+
5873
+ if (parent == null)
5874
+ return false;
5875
+
5876
+ return parent.IsLive();
5877
+ }
55185878
55195879 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55205880 {
....@@ -5576,8 +5936,10 @@
55765936 if (support != null)
55775937 support = support;
55785938
5579
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5580
- boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5939
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5940
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5941
+
5942
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
55815943
55825944 if (!usecalllists && bRep != null && bRep.displaylist > 0)
55835945 {
....@@ -5587,8 +5949,9 @@
55875949 // usecalllists &= !(parent instanceof RandomNode);
55885950 // usecalllists = false;
55895951
5590
- if (GetBRep() != null)
5591
- usecalllists = usecalllists;
5952
+ if (display.DrawMode() == display.SHADOW)
5953
+ //GetBRep() != null)
5954
+ usecalllists = !!usecalllists;
55925955 //System.out.println("draw " + this);
55935956 //new Exception().printStackTrace();
55945957
....@@ -5597,10 +5960,12 @@
55975960 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
55985961
55995962 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5600
- (touched || (bRep != null && bRep.displaylist <= 0)))
5963
+ //(touched || (bRep != null && bRep.displaylist <= 0)))
5964
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
56015965 {
56025966 Globals.lighttouched = true;
56035967 } // all panes...
5968
+
56045969 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
56055970 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
56065971 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5608,7 +5973,7 @@
56085973 if (!(this instanceof Composite))
56095974 touched = false;
56105975 //if (displaylist == -1 && usecalllists)
5611
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5976
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
56125977 {
56135978 bRep.displaylist = display.GenList();
56145979 assert(bRep.displaylist != 0);
....@@ -5619,7 +5984,7 @@
56195984
56205985 //System.out.println("\tnew list " + list);
56215986 //gl.glDrawBuffer(gl.GL_NONE);
5622
- if (usecalllists)
5987
+ if (usecalllists && bRep.displaylist > 0)
56235988 {
56245989 // System.err.println("new list " + bRep.displaylist + " for " + this);
56255990 display.NewList(bRep.displaylist);
....@@ -5628,7 +5993,7 @@
56285993 CallList(display, root, selected, blocked);
56295994
56305995 // compiled = true;
5631
- if (usecalllists)
5996
+ if (usecalllists && bRep.displaylist > 0)
56325997 {
56335998 // System.err.println("end list " + bRep.displaylist + " for " + this);
56345999 display.EndList();
....@@ -5728,6 +6093,7 @@
57286093 if (GetBRep() != null)
57296094 {
57306095 display.NextIndex();
6096
+
57316097 // vertex color conflict : gl.glCallList(list);
57326098 DrawNode(display, root, selected);
57336099 if (this instanceof BezierPatch)
....@@ -5768,16 +6134,27 @@
57686134 tex = GetTextures();
57696135 }
57706136
5771
- boolean failed = false;
6137
+ boolean failedPigment = false;
6138
+ boolean failedBump = false;
57726139
57736140 try
57746141 {
5775
- display.BindTextures(tex, texres);
6142
+ display.BindPigmentTexture(tex, texres);
57766143 }
57776144 catch (Exception e)
57786145 {
57796146 System.err.println("FAILED: " + this);
5780
- failed = true;
6147
+ failedPigment = true;
6148
+ }
6149
+
6150
+ try
6151
+ {
6152
+ display.BindBumpTexture(tex, texres);
6153
+ }
6154
+ catch (Exception e)
6155
+ {
6156
+ //System.err.println("FAILED: " + this);
6157
+ failedBump = true;
57816158 }
57826159
57836160 if (!compiled)
....@@ -5800,8 +6177,11 @@
58006177 }
58016178 }
58026179
5803
- if (!failed)
5804
- display.ReleaseTextures(tex);
6180
+ if (!failedBump)
6181
+ display.ReleaseBumpTexture(tex);
6182
+
6183
+ if (!failedPigment)
6184
+ display.ReleasePigmentTexture(tex);
58056185
58066186 display.PopMaterial(this, selected);
58076187 }
....@@ -6174,6 +6554,11 @@
61746554 // dec 2012
61756555 new Exception().printStackTrace();
61766556 return;
6557
+ }
6558
+
6559
+ if (dontselect)
6560
+ {
6561
+ //bRep.GenerateNormalsMINE();
61776562 }
61786563
61796564 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -6959,20 +7344,23 @@
69597344 }
69607345 }
69617346
6962
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7347
+ static ClickInfo clickInfo = new ClickInfo();
7348
+
7349
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7350
+ Point outPt, Rectangle outRec)
69637351 {
6964
- int hc = info.bounds.x + info.bounds.width / 2;
6965
- int vc = info.bounds.y + info.bounds.height / 2;
6966
- double[][] toscreen = info.toScreen;
7352
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7353
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7354
+ double[][] toscreen = clickInfo.toScreen;
69677355 if (toscreen == null)
69687356 {
6969
- toscreen = new Camera(info.camera.viewCode).toScreen;
7357
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
69707358 }
69717359 cVector vec = in;
69727360 LA.xformPos(in, toscreen, in);
69737361 //System.out.println("Distance = " + info.camera.Distance());
6974
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
6975
- vec.y *= 100 * info.camera.SCALE / info.camera.Distance();
7362
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7363
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
69767364 outPt.x = hc + (int) vec.x;
69777365 outPt.y = vc - (int) vec.y;
69787366 outRec.x = outPt.x - 3;
....@@ -6980,15 +7368,18 @@
69807368 outRec.width = outRec.height = 6;
69817369 }
69827370
6983
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7371
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7372
+ )
69847373 {
69857374 Point pt = new Point(0, 0);
69867375 Rectangle rec = new Rectangle();
6987
- calcHotSpot(in, info, pt, rec);
7376
+ calcHotSpot(in, //clickInfo,
7377
+ pt, rec);
69887378 return rec;
69897379 }
69907380
6991
- void drawEditHandles0(ClickInfo info, int level)
7381
+ void drawEditHandles0(//ClickInfo clickInfo,
7382
+ int level)
69927383 {
69937384 if (level == 0)
69947385 {
....@@ -6997,16 +7388,19 @@
69977388 {
69987389 cVector origin = new cVector();
69997390 //LA.xformPos(origin, toParent, origin);
7000
- Rectangle spot = calcHotSpot(origin, info);
7391
+ if (this.clickInfo == null)
7392
+ this.clickInfo = new ClickInfo();
7393
+
7394
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
70017395 Rectangle boundary = new Rectangle();
70027396 boundary.x = spot.x - 30;
70037397 boundary.y = spot.y - 30;
70047398 boundary.width = spot.width + 60;
70057399 boundary.height = spot.height + 60;
7006
- info.g.setColor(Color.red);
7400
+ clickInfo.g.setColor(Color.red);
70077401 int spotw = spot.x + spot.width;
70087402 int spoth = spot.y + spot.height;
7009
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7403
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
70107404 // if (CameraPane.Xmin > spot.x)
70117405 // {
70127406 // CameraPane.Xmin = spot.x;
....@@ -7026,8 +7420,8 @@
70267420 spot.translate(32, 32);
70277421 spotw = spot.x + spot.width;
70287422 spoth = spot.y + spot.height;
7029
- info.g.setColor(Color.blue);
7030
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7423
+ clickInfo.g.setColor(Color.cyan);
7424
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
70317425 // if (CameraPane.Xmin > spot.x)
70327426 // {
70337427 // CameraPane.Xmin = spot.x;
....@@ -7044,11 +7438,12 @@
70447438 // {
70457439 // CameraPane.Ymax = spoth;
70467440 // }
7047
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7048
- //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7441
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7442
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
70497443 spot.translate(0, -32);
7050
- info.g.setColor(Color.green);
7051
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7444
+ clickInfo.g.setColor(Color.yellow);
7445
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7446
+ clickInfo.g.setColor(Color.green);
70527447 // if (CameraPane.Xmin > spot.x)
70537448 // {
70547449 // CameraPane.Xmin = spot.x;
....@@ -7065,8 +7460,8 @@
70657460 // {
70667461 // CameraPane.Ymax = spoth;
70677462 // }
7068
- info.g.drawArc(boundary.x, boundary.y,
7069
- boundary.width, boundary.height, 0, 360);
7463
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7464
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
70707465 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
70717466 // if (CameraPane.Xmin > boundary.x)
70727467 // {
....@@ -7088,7 +7483,8 @@
70887483 }
70897484 }
70907485
7091
- boolean doEditClick0(ClickInfo info, int level)
7486
+ boolean doEditClick0(//ClickInfo clickInfo,
7487
+ int level)
70927488 {
70937489 if (level == 0)
70947490 {
....@@ -7097,8 +7493,8 @@
70977493
70987494 boolean retval = false;
70997495
7100
- startX = info.x;
7101
- startY = info.y;
7496
+ startX = clickInfo.x;
7497
+ startY = clickInfo.y;
71027498
71037499 hitSomething = -1;
71047500 cVector origin = new cVector();
....@@ -7108,22 +7504,51 @@
71087504 {
71097505 centerPt = new Point(0, 0);
71107506 }
7111
- calcHotSpot(origin, info, centerPt, spot);
7112
- if (spot.contains(info.x, info.y))
7507
+ calcHotSpot(origin, //info,
7508
+ centerPt, spot);
7509
+ if (spot.contains(clickInfo.x, clickInfo.y))
71137510 {
71147511 hitSomething = hitCenter;
71157512 retval = true;
71167513 }
71177514 spot.translate(32, 0);
7118
- if (spot.contains(info.x, info.y))
7515
+ if (spot.contains(clickInfo.x, clickInfo.y))
71197516 {
71207517 hitSomething = hitRotate;
71217518 retval = true;
71227519 }
71237520 spot.translate(0, 32);
7124
- if (spot.contains(info.x, info.y))
7521
+ if (spot.contains(clickInfo.x, clickInfo.y))
71257522 {
71267523 hitSomething = hitScale;
7524
+
7525
+ double scale = 0.005f * clickInfo.camera.Distance();
7526
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7527
+ double sign = 1;
7528
+ if (hScale < 0)
7529
+ {
7530
+ sign = -1;
7531
+ }
7532
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7533
+ if (hScale < 0.01)
7534
+ {
7535
+ //hScale = 0.01;
7536
+ }
7537
+
7538
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7539
+ sign = 1;
7540
+ if (vScale < 0)
7541
+ {
7542
+ sign = -1;
7543
+ }
7544
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7545
+ if (vScale < 0.01)
7546
+ {
7547
+ //vScale = 0.01;
7548
+ }
7549
+
7550
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7551
+
71277552 retval = true;
71287553 }
71297554
....@@ -7133,7 +7558,7 @@
71337558 }
71347559
71357560 //System.out.println("info.modifiers = " + info.modifiers);
7136
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7561
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
71377562 //System.out.println("modified = " + modified);
71387563 //new Exception().printStackTrace();
71397564 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7161,7 +7586,8 @@
71617586 return true;
71627587 }
71637588
7164
- void doEditDrag0(ClickInfo info, boolean opposite)
7589
+ void doEditDrag0(//ClickInfo info,
7590
+ boolean opposite)
71657591 {
71667592 if (hitSomething == 0)
71677593 {
....@@ -7175,7 +7601,7 @@
71757601
71767602 //System.out.println("hitSomething = " + hitSomething);
71777603
7178
- double scale = 0.005f * info.camera.Distance();
7604
+ double scale = 0.005f * clickInfo.camera.Distance();
71797605
71807606 cVector xlate = new cVector();
71817607 //cVector xlate2 = new cVector();
....@@ -7209,8 +7635,8 @@
72097635 toParent[3][i] = xlate.get(i);
72107636 LA.matInvert(toParent, fromParent);
72117637 */
7212
- cVector delta = LA.newVector(0, 0, startY - info.y);
7213
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7638
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7639
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
72147640
72157641 LA.matCopy(startMat, toParent);
72167642 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7219,7 +7645,7 @@
72197645 } else
72207646 {
72217647 //LA.xformDir(delta, info.camera.fromScreen, delta);
7222
- cVector up = new cVector(info.camera.up);
7648
+ cVector up = new cVector(clickInfo.camera.up);
72237649 cVector away = new cVector();
72247650 //cVector right2 = new cVector();
72257651 //LA.vecCross(up, cVector.Z, right);
....@@ -7236,19 +7662,19 @@
72367662 LA.xformDir(up, ClickInfo.matbuffer, up);
72377663 // if (!CameraPane.LOCALTRANSFORM)
72387664 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7239
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7665
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
72407666 // if (!CameraPane.LOCALTRANSFORM)
72417667 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
72427668 //LA.vecCross(up, cVector.Z, right2);
72437669
7244
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7670
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
72457671
72467672 //System.out.println("DELTA0 = " + delta);
72477673 //System.out.println("AWAY = " + info.camera.away);
72487674 //System.out.println("UP = " + info.camera.up);
72497675 if (away.z > 0)
72507676 {
7251
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7677
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
72527678 {
72537679 delta.x = -delta.x;
72547680 } else
....@@ -7263,7 +7689,7 @@
72637689 //System.out.println("DELTA1 = " + delta);
72647690 LA.xformDir(delta, ClickInfo.matbuffer, delta);
72657691 //System.out.println("DELTA2 = " + delta);
7266
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7692
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
72677693 LA.matCopy(startMat, toParent);
72687694 //System.out.println("DELTA3 = " + delta);
72697695 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7273,8 +7699,8 @@
72737699 break;
72747700
72757701 case hitRotate: // rotate
7276
- int dx = info.x - centerPt.x;
7277
- int dy = -(info.y - centerPt.y);
7702
+ int dx = clickInfo.x - centerPt.x;
7703
+ int dy = -(clickInfo.y - centerPt.y);
72787704 double angle = (double) Math.atan2(dx, dy);
72797705 angle = -(1.570796 - angle);
72807706
....@@ -7297,7 +7723,7 @@
72977723 }
72987724 /**/
72997725
7300
- switch (info.pane.RenderCamera().viewCode)
7726
+ switch (clickInfo.pane.RenderCamera().viewCode)
73017727 {
73027728 case 1: // '\001'
73037729 LA.matZRotate(toParent, angle);
....@@ -7324,7 +7750,7 @@
73247750 break;
73257751
73267752 case hitScale: // scale
7327
- double hScale = (double) (info.x - centerPt.x) / 32;
7753
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
73287754 double sign = 1;
73297755 if (hScale < 0)
73307756 {
....@@ -7336,7 +7762,7 @@
73367762 //hScale = 0.01;
73377763 }
73387764
7339
- double vScale = (double) (info.y - centerPt.y) / 32;
7765
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
73407766 sign = 1;
73417767 if (vScale < 0)
73427768 {
....@@ -7347,6 +7773,7 @@
73477773 {
73487774 //vScale = 0.01;
73497775 }
7776
+
73507777 LA.matCopy(startMat, toParent);
73517778 /**/
73527779 for (int i = 0; i < 3; i++)
....@@ -7356,29 +7783,30 @@
73567783 }
73577784 /**/
73587785
7359
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7786
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
73607787
73617788 if (totalScale < 0.01)
73627789 {
73637790 totalScale = 0.01;
73647791 }
73657792
7366
- switch (info.pane.RenderCamera().viewCode)
7793
+ switch (clickInfo.pane.RenderCamera().viewCode)
73677794 {
73687795 case 3: // '\001'
7369
- if (modified)
7796
+ if (modified || opposite)
73707797 {
73717798 //LA.matScale(toParent, 1, hScale, vScale);
73727799 LA.matScale(toParent, totalScale, 1, 1);
73737800 } // vScale, 1);
73747801 else
73757802 {
7803
+ // EXCEPTION!
73767804 LA.matScale(toParent, totalScale, totalScale, totalScale);
73777805 } // vScale, 1);
73787806 break;
73797807
73807808 case 2: // '\002'
7381
- if (modified)
7809
+ if (modified || opposite)
73827810 {
73837811 //LA.matScale(toParent, hScale, 1, vScale);
73847812 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7389,7 +7817,7 @@
73897817 break;
73907818
73917819 case 1: // '\003'
7392
- if (modified)
7820
+ if (modified || opposite)
73937821 {
73947822 //LA.matScale(toParent, hScale, vScale, 1);
73957823 LA.matScale(toParent, 1, 1, totalScale);
....@@ -7429,7 +7857,7 @@
74297857 } // NEW ...
74307858
74317859
7432
- info.pane.repaint();
7860
+ clickInfo.pane.repaint();
74337861 }
74347862
74357863 boolean overflow = false;
....@@ -7609,6 +8037,10 @@
76098037 editWindow = null;
76108038 } // ?
76118039 }
8040
+ else
8041
+ {
8042
+ //editWindow.closeUI();
8043
+ }
76128044 }
76138045
76148046 boolean root; // patch for edit windows
....@@ -7766,6 +8198,10 @@
77668198 }
77678199
77688200 transient ObjEditor editWindow;
8201
+ transient ObjEditor manipWindow;
8202
+
8203
+ transient boolean pinned;
8204
+
77698205 transient ObjectUI objectUI;
77708206 public static int povDepth = 0;
77718207 private static cVector tbMin = new cVector();