Normand Briere
2019-08-04 0c85af6e46f48b7425d59fc776b193c06a4a1f52
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,125 +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++)
130
- {
131
- Object3D child = (Object3D) get(i);
132
- if (child == null)
133
- continue;
134
- blockloop = true;
135
- child.SaveSupports();
136
- blockloop = false;
137
- }
138
-}
139151
140
-void RestoreSupports()
141
-{
142
- if (blockloop)
143
- return;
152
+ void RestoreSupports()
153
+ {
154
+ if (blockloop)
155
+ return;
144156
145
- support = transientsupport;
146
- link2master = transientlink2master;
147
- transientsupport = null;
148
- transientlink2master = false;
149
-
150
- if (bRep != null)
151
- {
152
- bRep.RestoreSupports();
153
- }
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
-}
157
+ support = transientsupport;
158
+ link2master = transientlink2master;
159
+ transientsupport = null;
160
+ transientlink2master = false;
165161
166
-void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
167
-{
168
- if (hashtable.containsKey(GetUUID()))
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)
169179 {
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
+
170278 Object3D o = hashtable.get(GetUUID());
171279
172
- assert(this.bRep == o.bRep);
173
- if (this.bRep != null)
174
- assert(this.bRep.support == o.transientrep);
175
-
176
- return;
177
- }
178
-
179
- Object3D o = new Object3D();
180
- o.bRep = this.bRep;
181
- if (this.bRep != null)
182
- {
183
- o.transientrep = this.bRep.support;
184
- o.bRep.support = null;
185
- }
186
-
187
-// o.support = this.support;
188
-// o.fileparent = this.fileparent;
189
-// if (this.bRep != null)
190
-// o.bRep = this.bRep.support;
191
-
192
- hashtable.put(GetUUID(), o);
193
-
194
- this.bRep = null;
195
-// if (this.bRep != null)
196
-// this.bRep.support = null;
197
-// this.support = null;
198
-// this.fileparent = null;
199
-
200
- for (int i=0; i<Size(); i++)
201
- {
202
- get(i).ExtractBigData(hashtable);
203
- }
204
-}
280
+ RestoreBigData(o);
205281
206
-void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
207
-{
208
- if (!hashtable.containsKey(GetUUID()))
209
- return;
210
-
211
- Object3D o = hashtable.get(GetUUID());
212
-
213
- this.bRep = o.bRep;
214
- if (this.bRep != null)
215
- this.bRep.support = o.transientrep;
216
-// this.support = o.support;
217
-// this.fileparent = o.fileparent;
218
-
219
- hashtable.remove(GetUUID());
220
-
221
- for (int i=0; i<Size(); i++)
222
- {
223
- get(i).RestoreBigData(hashtable);
282
+ if (blockloop)
283
+ return;
284
+
285
+ blockloop = true;
286
+
287
+ //hashtable.remove(GetUUID());
288
+
289
+ for (int i=0; i<Size(); i++)
290
+ {
291
+ get(i).RestoreBigData(hashtable);
292
+ }
293
+
294
+ blockloop = false;
224295 }
225
-}
296
+
297
+ void RestoreBigData(Object3D o)
298
+ {
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;
313
+ }
226314
227315 // MOCAP SUPPORT
228316 double tx,ty,tz,rx,ry,rz;
....@@ -365,6 +453,7 @@
365453 }
366454
367455 boolean live = false;
456
+ transient boolean keepdontselect;
368457 boolean dontselect = false;
369458 boolean hide = false;
370459 boolean link2master = false; // performs reset support/master at each frame
....@@ -547,12 +636,14 @@
547636 toParent = LA.newMatrix();
548637 fromParent = LA.newMatrix();
549638 }
639
+
550640 if (toParentMarked == null)
551641 {
552642 if (maxcount != 1)
553643 {
554644 new Exception().printStackTrace();
555645 }
646
+
556647 toParentMarked = LA.newMatrix();
557648 fromParentMarked = LA.newMatrix();
558649 }
....@@ -863,7 +954,7 @@
863954
864955 if (marked && Globals.isLIVE() && live &&
865956 //TEMP21aug2018
866
- (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
957
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
867958 currentframe != Globals.framecount)
868959 {
869960 currentframe = Globals.framecount;
....@@ -875,7 +966,8 @@
875966
876967 boolean changedir = random && Math.random() < 0.01; // && !link2master;
877968
878
- if (transformcount*factor > maxcount || (step == 1 && changedir))
969
+ if (transformcount*factor >= maxcount && (rewind || random) ||
970
+ (step == 1 && changedir))
879971 {
880972 countdown = 1;
881973 delay = speedup?8:1;
....@@ -947,6 +1039,10 @@
9471039 if (material == null || material.multiply)
9481040 return true;
9491041
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.
9501046 return material.opacity > 0.99;
9511047 }
9521048
....@@ -1347,6 +1443,7 @@
13471443 toParent = LA.newMatrix();
13481444 fromParent = LA.newMatrix();
13491445 }
1446
+
13501447 LA.matCopy(other.toParent, toParent);
13511448 LA.matCopy(other.fromParent, fromParent);
13521449
....@@ -2368,6 +2465,10 @@
23682465 }
23692466 */
23702467 }
2468
+ else
2469
+ {
2470
+ //((ObjEditor)editWindow).SetupUI2(null);
2471
+ }
23712472 }
23722473
23732474 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2409,6 +2510,14 @@
24092510 {
24102511 editWindow.refreshContents();
24112512 }
2513
+ else
2514
+ {
2515
+ if (manipWindow != null)
2516
+ {
2517
+ manipWindow.refreshContents();
2518
+ }
2519
+ }
2520
+
24122521 //if (parent != null)
24132522 //parent.refreshEditWindow();
24142523 }
....@@ -2488,7 +2597,8 @@
24882597 private static final int editSelf = 1;
24892598 private static final int editChild = 2;
24902599
2491
- void drawEditHandles(ClickInfo info, int level)
2600
+ void drawEditHandles(//ClickInfo info,
2601
+ int level)
24922602 {
24932603 if (level == 0)
24942604 {
....@@ -2496,7 +2606,8 @@
24962606 return;
24972607
24982608 Object3D selectee;
2499
- 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))
25002611 {
25012612 selectee = (Object3D) e.nextElement();
25022613 }
....@@ -2504,19 +2615,22 @@
25042615 } else
25052616 {
25062617 //super.
2507
- drawEditHandles0(info, level + 1);
2618
+ drawEditHandles0(//info,
2619
+ level + 1);
25082620 }
25092621 }
25102622
2511
- boolean doEditClick(ClickInfo info, int level)
2623
+ boolean doEditClick(//ClickInfo info,
2624
+ int level)
25122625 {
25132626 doSomething = 0;
25142627 if (level == 0)
25152628 {
2516
- return doParentClick(info);
2629
+ return doParentClick(); //info);
25172630 }
25182631 if (//super.
2519
- doEditClick0(info, level))
2632
+ doEditClick0(//info,
2633
+ level))
25202634 {
25212635 doSomething = 1;
25222636 return true;
....@@ -2526,7 +2640,7 @@
25262640 }
25272641 }
25282642
2529
- boolean doParentClick(ClickInfo info)
2643
+ boolean doParentClick() //ClickInfo info)
25302644 {
25312645 if (selection == null)
25322646 {
....@@ -2539,7 +2653,8 @@
25392653 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
25402654 {
25412655 Object3D selectee = (Object3D) e.nextElement();
2542
- if (selectee.doEditClick(info, 1))
2656
+ if (selectee.doEditClick(//info,
2657
+ 1))
25432658 {
25442659 childToDrag = selectee;
25452660 doSomething = 2;
....@@ -2551,13 +2666,15 @@
25512666 return retval;
25522667 }
25532668
2554
- void doEditDrag(ClickInfo info, boolean opposite)
2669
+ void doEditDrag(//ClickInfo clickInfo,
2670
+ boolean opposite)
25552671 {
25562672 switch (doSomething)
25572673 {
25582674 case 1: // '\001'
25592675 //super.
2560
- doEditDrag0(info, opposite);
2676
+ doEditDrag0(//clickInfo,
2677
+ opposite);
25612678 break;
25622679
25632680 case 2: // '\002'
....@@ -2570,11 +2687,13 @@
25702687 {
25712688 //sel.hitSomething = childToDrag.hitSomething;
25722689 //childToDrag.doEditDrag(info);
2573
- sel.doEditDrag(info, opposite);
2690
+ sel.doEditDrag(//clickInfo,
2691
+ opposite);
25742692 } else
25752693 {
25762694 //super.
2577
- doEditDrag0(info, opposite);
2695
+ doEditDrag0(//clickInfo,
2696
+ opposite);
25782697 }
25792698 }
25802699 break;
....@@ -2592,6 +2711,9 @@
25922711 {
25932712 deselectAll();
25942713 }
2714
+
2715
+ new Exception().printStackTrace();
2716
+
25952717 ClickInfo newInfo = new ClickInfo();
25962718 newInfo.flags = info.flags;
25972719 newInfo.bounds = info.bounds;
....@@ -2684,6 +2806,18 @@
26842806 void GenNormalsS(boolean crease)
26852807 {
26862808 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();
26872821 // for (int i=0; i<selection.size(); i++)
26882822 // {
26892823 // Object3D selectee = (Object3D) selection.elementAt(i);
....@@ -2824,6 +2958,24 @@
28242958 if (child == null)
28252959 continue;
28262960 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();
28272979 // Children().release(i);
28282980 }
28292981 blockloop = false;
....@@ -2996,11 +3148,20 @@
29963148 }
29973149 }
29983150
3151
+ void GenNormalsMesh0()
3152
+ {
3153
+ if (bRep != null)
3154
+ {
3155
+ bRep.GenerateNormalsMesh();
3156
+ Touch();
3157
+ }
3158
+ }
3159
+
29993160 void GenNormalsMINE0()
30003161 {
30013162 if (bRep != null)
30023163 {
3003
- bRep.GenerateNormalsMINE();
3164
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
30043165 Touch();
30053166 }
30063167 }
....@@ -3446,7 +3607,8 @@
34463607 if (blockloop)
34473608 return;
34483609
3449
- if (marked || (bRep != null && material != null)) // borderline...
3610
+ if (//marked || // does not make sense
3611
+ (bRep != null || material != null)) // borderline...
34503612 live = h;
34513613
34523614 for (int i = 0; i < Size(); i++)
....@@ -3467,7 +3629,8 @@
34673629 return;
34683630
34693631 //if (bRep != null)
3470
- if (marked || (bRep != null && material != null)) // borderline...
3632
+ if (//marked || // does not make sense
3633
+ (bRep != null || material != null)) // borderline...
34713634 link2master = h;
34723635
34733636 for (int i = 0; i < Size(); i++)
....@@ -3487,7 +3650,8 @@
34873650 if (blockloop)
34883651 return;
34893652
3490
- if (marked || (bRep != null && material != null)) // borderline...
3653
+ if (//marked || // does not make sense
3654
+ (bRep != null || material != null)) // borderline...
34913655 hide = h;
34923656
34933657 for (int i = 0; i < Size(); i++)
....@@ -3507,7 +3671,7 @@
35073671 if (blockloop)
35083672 return;
35093673
3510
- if (bRep != null && material != null) // borderline...
3674
+ if (bRep != null || material != null) // borderline...
35113675 marked = h;
35123676
35133677 for (int i = 0; i < Size(); i++)
....@@ -3517,6 +3681,46 @@
35173681 continue;
35183682 blockloop = true;
35193683 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);
35203724 blockloop = false;
35213725 // release(i);
35223726 }
....@@ -4294,6 +4498,55 @@
42944498 }
42954499 }
42964500
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
+
42974550 void RepairTexture()
42984551 {
42994552 if (this instanceof FileObject || blockloop)
....@@ -4808,6 +5061,14 @@
48085061 }
48095062 }
48105063
5064
+ ObjEditor GetWindow()
5065
+ {
5066
+ if (editWindow != null)
5067
+ return editWindow;
5068
+
5069
+ return manipWindow;
5070
+ }
5071
+
48115072 cTreePath Select(int indexcount, boolean deselect)
48125073 {
48135074 if (hide || dontselect)
....@@ -4844,10 +5105,11 @@
48445105 if (leaf != null)
48455106 {
48465107 cTreePath tp = new cTreePath(this, leaf);
4847
- if (editWindow != null)
5108
+ ObjEditor window = GetWindow();
5109
+ if (window != null)
48485110 {
48495111 //System.out.println("editWindow = " + editWindow + " vs " + this);
4850
- editWindow.Select(tp, deselect, true);
5112
+ window.Select(tp, deselect, true);
48515113 }
48525114
48535115 return tp;
....@@ -4864,6 +5126,7 @@
48645126
48655127 if (child == null)
48665128 continue;
5129
+
48675130 if (child.HasTransparency() && child.size() != 0)
48685131 {
48695132 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -4873,9 +5136,10 @@
48735136 if (leaf != null)
48745137 {
48755138 cTreePath tp = new cTreePath(this, leaf);
4876
- if (editWindow != null)
5139
+ ObjEditor window = GetWindow();
5140
+ if (window != null)
48775141 {
4878
- editWindow.Select(tp, deselect, true);
5142
+ window.Select(tp, deselect, true);
48795143 }
48805144
48815145 return tp;
....@@ -5200,6 +5464,51 @@
52005464 blockloop = false;
52015465 }
52025466
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
+
52035512 boolean IsSelected()
52045513 {
52055514 if (parent == null)
....@@ -5509,6 +5818,38 @@
55095818 }
55105819 }
55115820
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
+
55125853 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55135854 {
55145855 Draw(display, root, selected, blocked);
....@@ -5517,12 +5858,23 @@
55175858 boolean NeedSupport()
55185859 {
55195860 return
5520
- CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
5861
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
55215862 // PROBLEM with CROWD!!
55225863 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
55235864 }
55245865
55255866 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
+ }
55265878
55275879 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55285880 {
....@@ -5584,8 +5936,10 @@
55845936 if (support != null)
55855937 support = support;
55865938
5587
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5588
- 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.
55895943
55905944 if (!usecalllists && bRep != null && bRep.displaylist > 0)
55915945 {
....@@ -5595,8 +5949,9 @@
55955949 // usecalllists &= !(parent instanceof RandomNode);
55965950 // usecalllists = false;
55975951
5598
- if (GetBRep() != null)
5599
- usecalllists = usecalllists;
5952
+ if (display.DrawMode() == display.SHADOW)
5953
+ //GetBRep() != null)
5954
+ usecalllists = !!usecalllists;
56005955 //System.out.println("draw " + this);
56015956 //new Exception().printStackTrace();
56025957
....@@ -5605,10 +5960,12 @@
56055960 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
56065961
56075962 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5608
- (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)))
56095965 {
56105966 Globals.lighttouched = true;
56115967 } // all panes...
5968
+
56125969 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
56135970 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
56145971 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5616,7 +5973,7 @@
56165973 if (!(this instanceof Composite))
56175974 touched = false;
56185975 //if (displaylist == -1 && usecalllists)
5619
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5976
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
56205977 {
56215978 bRep.displaylist = display.GenList();
56225979 assert(bRep.displaylist != 0);
....@@ -5627,7 +5984,7 @@
56275984
56285985 //System.out.println("\tnew list " + list);
56295986 //gl.glDrawBuffer(gl.GL_NONE);
5630
- if (usecalllists)
5987
+ if (usecalllists && bRep.displaylist > 0)
56315988 {
56325989 // System.err.println("new list " + bRep.displaylist + " for " + this);
56335990 display.NewList(bRep.displaylist);
....@@ -5636,7 +5993,7 @@
56365993 CallList(display, root, selected, blocked);
56375994
56385995 // compiled = true;
5639
- if (usecalllists)
5996
+ if (usecalllists && bRep.displaylist > 0)
56405997 {
56415998 // System.err.println("end list " + bRep.displaylist + " for " + this);
56425999 display.EndList();
....@@ -5736,6 +6093,7 @@
57366093 if (GetBRep() != null)
57376094 {
57386095 display.NextIndex();
6096
+
57396097 // vertex color conflict : gl.glCallList(list);
57406098 DrawNode(display, root, selected);
57416099 if (this instanceof BezierPatch)
....@@ -5776,16 +6134,27 @@
57766134 tex = GetTextures();
57776135 }
57786136
5779
- boolean failed = false;
6137
+ boolean failedPigment = false;
6138
+ boolean failedBump = false;
57806139
57816140 try
57826141 {
5783
- display.BindTextures(tex, texres);
6142
+ display.BindPigmentTexture(tex, texres);
57846143 }
57856144 catch (Exception e)
57866145 {
57876146 System.err.println("FAILED: " + this);
5788
- 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;
57896158 }
57906159
57916160 if (!compiled)
....@@ -5808,8 +6177,11 @@
58086177 }
58096178 }
58106179
5811
- if (!failed)
5812
- display.ReleaseTextures(tex);
6180
+ if (!failedBump)
6181
+ display.ReleaseBumpTexture(tex);
6182
+
6183
+ if (!failedPigment)
6184
+ display.ReleasePigmentTexture(tex);
58136185
58146186 display.PopMaterial(this, selected);
58156187 }
....@@ -6182,6 +6554,11 @@
61826554 // dec 2012
61836555 new Exception().printStackTrace();
61846556 return;
6557
+ }
6558
+
6559
+ if (dontselect)
6560
+ {
6561
+ //bRep.GenerateNormalsMINE();
61856562 }
61866563
61876564 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -6967,20 +7344,23 @@
69677344 }
69687345 }
69697346
6970
- 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)
69717351 {
6972
- int hc = info.bounds.x + info.bounds.width / 2;
6973
- int vc = info.bounds.y + info.bounds.height / 2;
6974
- 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;
69757355 if (toscreen == null)
69767356 {
6977
- toscreen = new Camera(info.camera.viewCode).toScreen;
7357
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
69787358 }
69797359 cVector vec = in;
69807360 LA.xformPos(in, toscreen, in);
69817361 //System.out.println("Distance = " + info.camera.Distance());
6982
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
6983
- 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();
69847364 outPt.x = hc + (int) vec.x;
69857365 outPt.y = vc - (int) vec.y;
69867366 outRec.x = outPt.x - 3;
....@@ -6988,15 +7368,18 @@
69887368 outRec.width = outRec.height = 6;
69897369 }
69907370
6991
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7371
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7372
+ )
69927373 {
69937374 Point pt = new Point(0, 0);
69947375 Rectangle rec = new Rectangle();
6995
- calcHotSpot(in, info, pt, rec);
7376
+ calcHotSpot(in, //clickInfo,
7377
+ pt, rec);
69967378 return rec;
69977379 }
69987380
6999
- void drawEditHandles0(ClickInfo info, int level)
7381
+ void drawEditHandles0(//ClickInfo clickInfo,
7382
+ int level)
70007383 {
70017384 if (level == 0)
70027385 {
....@@ -7005,16 +7388,19 @@
70057388 {
70067389 cVector origin = new cVector();
70077390 //LA.xformPos(origin, toParent, origin);
7008
- Rectangle spot = calcHotSpot(origin, info);
7391
+ if (this.clickInfo == null)
7392
+ this.clickInfo = new ClickInfo();
7393
+
7394
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
70097395 Rectangle boundary = new Rectangle();
70107396 boundary.x = spot.x - 30;
70117397 boundary.y = spot.y - 30;
70127398 boundary.width = spot.width + 60;
70137399 boundary.height = spot.height + 60;
7014
- info.g.setColor(Color.red);
7400
+ clickInfo.g.setColor(Color.red);
70157401 int spotw = spot.x + spot.width;
70167402 int spoth = spot.y + spot.height;
7017
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7403
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
70187404 // if (CameraPane.Xmin > spot.x)
70197405 // {
70207406 // CameraPane.Xmin = spot.x;
....@@ -7034,8 +7420,8 @@
70347420 spot.translate(32, 32);
70357421 spotw = spot.x + spot.width;
70367422 spoth = spot.y + spot.height;
7037
- info.g.setColor(Color.blue);
7038
- 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);
70397425 // if (CameraPane.Xmin > spot.x)
70407426 // {
70417427 // CameraPane.Xmin = spot.x;
....@@ -7052,11 +7438,12 @@
70527438 // {
70537439 // CameraPane.Ymax = spoth;
70547440 // }
7055
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7056
- //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
70577443 spot.translate(0, -32);
7058
- info.g.setColor(Color.green);
7059
- 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);
70607447 // if (CameraPane.Xmin > spot.x)
70617448 // {
70627449 // CameraPane.Xmin = spot.x;
....@@ -7073,8 +7460,8 @@
70737460 // {
70747461 // CameraPane.Ymax = spoth;
70757462 // }
7076
- info.g.drawArc(boundary.x, boundary.y,
7077
- 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);
70787465 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
70797466 // if (CameraPane.Xmin > boundary.x)
70807467 // {
....@@ -7096,7 +7483,8 @@
70967483 }
70977484 }
70987485
7099
- boolean doEditClick0(ClickInfo info, int level)
7486
+ boolean doEditClick0(//ClickInfo clickInfo,
7487
+ int level)
71007488 {
71017489 if (level == 0)
71027490 {
....@@ -7105,8 +7493,8 @@
71057493
71067494 boolean retval = false;
71077495
7108
- startX = info.x;
7109
- startY = info.y;
7496
+ startX = clickInfo.x;
7497
+ startY = clickInfo.y;
71107498
71117499 hitSomething = -1;
71127500 cVector origin = new cVector();
....@@ -7116,22 +7504,51 @@
71167504 {
71177505 centerPt = new Point(0, 0);
71187506 }
7119
- calcHotSpot(origin, info, centerPt, spot);
7120
- if (spot.contains(info.x, info.y))
7507
+ calcHotSpot(origin, //info,
7508
+ centerPt, spot);
7509
+ if (spot.contains(clickInfo.x, clickInfo.y))
71217510 {
71227511 hitSomething = hitCenter;
71237512 retval = true;
71247513 }
71257514 spot.translate(32, 0);
7126
- if (spot.contains(info.x, info.y))
7515
+ if (spot.contains(clickInfo.x, clickInfo.y))
71277516 {
71287517 hitSomething = hitRotate;
71297518 retval = true;
71307519 }
71317520 spot.translate(0, 32);
7132
- if (spot.contains(info.x, info.y))
7521
+ if (spot.contains(clickInfo.x, clickInfo.y))
71337522 {
71347523 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
+
71357552 retval = true;
71367553 }
71377554
....@@ -7141,7 +7558,7 @@
71417558 }
71427559
71437560 //System.out.println("info.modifiers = " + info.modifiers);
7144
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7561
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
71457562 //System.out.println("modified = " + modified);
71467563 //new Exception().printStackTrace();
71477564 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7169,7 +7586,8 @@
71697586 return true;
71707587 }
71717588
7172
- void doEditDrag0(ClickInfo info, boolean opposite)
7589
+ void doEditDrag0(//ClickInfo info,
7590
+ boolean opposite)
71737591 {
71747592 if (hitSomething == 0)
71757593 {
....@@ -7183,7 +7601,7 @@
71837601
71847602 //System.out.println("hitSomething = " + hitSomething);
71857603
7186
- double scale = 0.005f * info.camera.Distance();
7604
+ double scale = 0.005f * clickInfo.camera.Distance();
71877605
71887606 cVector xlate = new cVector();
71897607 //cVector xlate2 = new cVector();
....@@ -7217,8 +7635,8 @@
72177635 toParent[3][i] = xlate.get(i);
72187636 LA.matInvert(toParent, fromParent);
72197637 */
7220
- cVector delta = LA.newVector(0, 0, startY - info.y);
7221
- 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);
72227640
72237641 LA.matCopy(startMat, toParent);
72247642 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7227,7 +7645,7 @@
72277645 } else
72287646 {
72297647 //LA.xformDir(delta, info.camera.fromScreen, delta);
7230
- cVector up = new cVector(info.camera.up);
7648
+ cVector up = new cVector(clickInfo.camera.up);
72317649 cVector away = new cVector();
72327650 //cVector right2 = new cVector();
72337651 //LA.vecCross(up, cVector.Z, right);
....@@ -7244,19 +7662,19 @@
72447662 LA.xformDir(up, ClickInfo.matbuffer, up);
72457663 // if (!CameraPane.LOCALTRANSFORM)
72467664 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7247
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7665
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
72487666 // if (!CameraPane.LOCALTRANSFORM)
72497667 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
72507668 //LA.vecCross(up, cVector.Z, right2);
72517669
7252
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7670
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
72537671
72547672 //System.out.println("DELTA0 = " + delta);
72557673 //System.out.println("AWAY = " + info.camera.away);
72567674 //System.out.println("UP = " + info.camera.up);
72577675 if (away.z > 0)
72587676 {
7259
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7677
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
72607678 {
72617679 delta.x = -delta.x;
72627680 } else
....@@ -7271,7 +7689,7 @@
72717689 //System.out.println("DELTA1 = " + delta);
72727690 LA.xformDir(delta, ClickInfo.matbuffer, delta);
72737691 //System.out.println("DELTA2 = " + delta);
7274
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7692
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
72757693 LA.matCopy(startMat, toParent);
72767694 //System.out.println("DELTA3 = " + delta);
72777695 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7281,8 +7699,8 @@
72817699 break;
72827700
72837701 case hitRotate: // rotate
7284
- int dx = info.x - centerPt.x;
7285
- int dy = -(info.y - centerPt.y);
7702
+ int dx = clickInfo.x - centerPt.x;
7703
+ int dy = -(clickInfo.y - centerPt.y);
72867704 double angle = (double) Math.atan2(dx, dy);
72877705 angle = -(1.570796 - angle);
72887706
....@@ -7305,7 +7723,7 @@
73057723 }
73067724 /**/
73077725
7308
- switch (info.pane.RenderCamera().viewCode)
7726
+ switch (clickInfo.pane.RenderCamera().viewCode)
73097727 {
73107728 case 1: // '\001'
73117729 LA.matZRotate(toParent, angle);
....@@ -7332,7 +7750,7 @@
73327750 break;
73337751
73347752 case hitScale: // scale
7335
- double hScale = (double) (info.x - centerPt.x) / 32;
7753
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
73367754 double sign = 1;
73377755 if (hScale < 0)
73387756 {
....@@ -7344,7 +7762,7 @@
73447762 //hScale = 0.01;
73457763 }
73467764
7347
- double vScale = (double) (info.y - centerPt.y) / 32;
7765
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
73487766 sign = 1;
73497767 if (vScale < 0)
73507768 {
....@@ -7355,6 +7773,7 @@
73557773 {
73567774 //vScale = 0.01;
73577775 }
7776
+
73587777 LA.matCopy(startMat, toParent);
73597778 /**/
73607779 for (int i = 0; i < 3; i++)
....@@ -7364,29 +7783,30 @@
73647783 }
73657784 /**/
73667785
7367
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7786
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
73687787
73697788 if (totalScale < 0.01)
73707789 {
73717790 totalScale = 0.01;
73727791 }
73737792
7374
- switch (info.pane.RenderCamera().viewCode)
7793
+ switch (clickInfo.pane.RenderCamera().viewCode)
73757794 {
73767795 case 3: // '\001'
7377
- if (modified)
7796
+ if (modified || opposite)
73787797 {
73797798 //LA.matScale(toParent, 1, hScale, vScale);
73807799 LA.matScale(toParent, totalScale, 1, 1);
73817800 } // vScale, 1);
73827801 else
73837802 {
7803
+ // EXCEPTION!
73847804 LA.matScale(toParent, totalScale, totalScale, totalScale);
73857805 } // vScale, 1);
73867806 break;
73877807
73887808 case 2: // '\002'
7389
- if (modified)
7809
+ if (modified || opposite)
73907810 {
73917811 //LA.matScale(toParent, hScale, 1, vScale);
73927812 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7397,7 +7817,7 @@
73977817 break;
73987818
73997819 case 1: // '\003'
7400
- if (modified)
7820
+ if (modified || opposite)
74017821 {
74027822 //LA.matScale(toParent, hScale, vScale, 1);
74037823 LA.matScale(toParent, 1, 1, totalScale);
....@@ -7437,7 +7857,7 @@
74377857 } // NEW ...
74387858
74397859
7440
- info.pane.repaint();
7860
+ clickInfo.pane.repaint();
74417861 }
74427862
74437863 boolean overflow = false;
....@@ -7617,6 +8037,10 @@
76178037 editWindow = null;
76188038 } // ?
76198039 }
8040
+ else
8041
+ {
8042
+ //editWindow.closeUI();
8043
+ }
76208044 }
76218045
76228046 boolean root; // patch for edit windows
....@@ -7774,6 +8198,10 @@
77748198 }
77758199
77768200 transient ObjEditor editWindow;
8201
+ transient ObjEditor manipWindow;
8202
+
8203
+ transient boolean pinned;
8204
+
77778205 transient ObjectUI objectUI;
77788206 public static int povDepth = 0;
77798207 private static cVector tbMin = new cVector();