Normand Briere
2019-08-07 59de607850161a26863f92961d53caae7a2dabc8
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,11 @@
23682465 }
23692466 */
23702467 }
2468
+ else
2469
+ {
2470
+ //((ObjEditor)editWindow).SetupUI2(null);
2471
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
2472
+ }
23712473 }
23722474
23732475 void createEditWindow(GroupEditor callee, boolean newWindow) //, boolean root)
....@@ -2409,6 +2511,14 @@
24092511 {
24102512 editWindow.refreshContents();
24112513 }
2514
+ else
2515
+ {
2516
+ if (manipWindow != null)
2517
+ {
2518
+ manipWindow.refreshContents();
2519
+ }
2520
+ }
2521
+
24122522 //if (parent != null)
24132523 //parent.refreshEditWindow();
24142524 }
....@@ -2488,7 +2598,8 @@
24882598 private static final int editSelf = 1;
24892599 private static final int editChild = 2;
24902600
2491
- void drawEditHandles(ClickInfo info, int level)
2601
+ void drawEditHandles(//ClickInfo info,
2602
+ int level)
24922603 {
24932604 if (level == 0)
24942605 {
....@@ -2496,7 +2607,8 @@
24962607 return;
24972608
24982609 Object3D selectee;
2499
- 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))
25002612 {
25012613 selectee = (Object3D) e.nextElement();
25022614 }
....@@ -2504,19 +2616,22 @@
25042616 } else
25052617 {
25062618 //super.
2507
- drawEditHandles0(info, level + 1);
2619
+ drawEditHandles0(//info,
2620
+ level + 1);
25082621 }
25092622 }
25102623
2511
- boolean doEditClick(ClickInfo info, int level)
2624
+ boolean doEditClick(//ClickInfo info,
2625
+ int level)
25122626 {
25132627 doSomething = 0;
25142628 if (level == 0)
25152629 {
2516
- return doParentClick(info);
2630
+ return doParentClick(); //info);
25172631 }
25182632 if (//super.
2519
- doEditClick0(info, level))
2633
+ doEditClick0(//info,
2634
+ level))
25202635 {
25212636 doSomething = 1;
25222637 return true;
....@@ -2526,7 +2641,7 @@
25262641 }
25272642 }
25282643
2529
- boolean doParentClick(ClickInfo info)
2644
+ boolean doParentClick() //ClickInfo info)
25302645 {
25312646 if (selection == null)
25322647 {
....@@ -2539,7 +2654,8 @@
25392654 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
25402655 {
25412656 Object3D selectee = (Object3D) e.nextElement();
2542
- if (selectee.doEditClick(info, 1))
2657
+ if (selectee.doEditClick(//info,
2658
+ 1))
25432659 {
25442660 childToDrag = selectee;
25452661 doSomething = 2;
....@@ -2551,13 +2667,15 @@
25512667 return retval;
25522668 }
25532669
2554
- void doEditDrag(ClickInfo info, boolean opposite)
2670
+ void doEditDrag(//ClickInfo clickInfo,
2671
+ boolean opposite)
25552672 {
25562673 switch (doSomething)
25572674 {
25582675 case 1: // '\001'
25592676 //super.
2560
- doEditDrag0(info, opposite);
2677
+ doEditDrag0(//clickInfo,
2678
+ opposite);
25612679 break;
25622680
25632681 case 2: // '\002'
....@@ -2570,11 +2688,13 @@
25702688 {
25712689 //sel.hitSomething = childToDrag.hitSomething;
25722690 //childToDrag.doEditDrag(info);
2573
- sel.doEditDrag(info, opposite);
2691
+ sel.doEditDrag(//clickInfo,
2692
+ opposite);
25742693 } else
25752694 {
25762695 //super.
2577
- doEditDrag0(info, opposite);
2696
+ doEditDrag0(//clickInfo,
2697
+ opposite);
25782698 }
25792699 }
25802700 break;
....@@ -2592,6 +2712,9 @@
25922712 {
25932713 deselectAll();
25942714 }
2715
+
2716
+ new Exception().printStackTrace();
2717
+
25952718 ClickInfo newInfo = new ClickInfo();
25962719 newInfo.flags = info.flags;
25972720 newInfo.bounds = info.bounds;
....@@ -2684,6 +2807,18 @@
26842807 void GenNormalsS(boolean crease)
26852808 {
26862809 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();
26872822 // for (int i=0; i<selection.size(); i++)
26882823 // {
26892824 // Object3D selectee = (Object3D) selection.elementAt(i);
....@@ -2824,6 +2959,24 @@
28242959 if (child == null)
28252960 continue;
28262961 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();
28272980 // Children().release(i);
28282981 }
28292982 blockloop = false;
....@@ -2996,11 +3149,20 @@
29963149 }
29973150 }
29983151
3152
+ void GenNormalsMesh0()
3153
+ {
3154
+ if (bRep != null)
3155
+ {
3156
+ bRep.GenerateNormalsMesh();
3157
+ Touch();
3158
+ }
3159
+ }
3160
+
29993161 void GenNormalsMINE0()
30003162 {
30013163 if (bRep != null)
30023164 {
3003
- bRep.GenerateNormalsMINE();
3165
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
30043166 Touch();
30053167 }
30063168 }
....@@ -3446,7 +3608,8 @@
34463608 if (blockloop)
34473609 return;
34483610
3449
- if (marked || (bRep != null && material != null)) // borderline...
3611
+ if (//marked || // does not make sense
3612
+ (bRep != null || material != null)) // borderline...
34503613 live = h;
34513614
34523615 for (int i = 0; i < Size(); i++)
....@@ -3467,7 +3630,8 @@
34673630 return;
34683631
34693632 //if (bRep != null)
3470
- if (marked || (bRep != null && material != null)) // borderline...
3633
+ if (//marked || // does not make sense
3634
+ (bRep != null || material != null)) // borderline...
34713635 link2master = h;
34723636
34733637 for (int i = 0; i < Size(); i++)
....@@ -3487,7 +3651,8 @@
34873651 if (blockloop)
34883652 return;
34893653
3490
- if (marked || (bRep != null && material != null)) // borderline...
3654
+ if (//marked || // does not make sense
3655
+ (bRep != null || material != null)) // borderline...
34913656 hide = h;
34923657
34933658 for (int i = 0; i < Size(); i++)
....@@ -3507,7 +3672,7 @@
35073672 if (blockloop)
35083673 return;
35093674
3510
- if (bRep != null && material != null) // borderline...
3675
+ if (bRep != null || material != null) // borderline...
35113676 marked = h;
35123677
35133678 for (int i = 0; i < Size(); i++)
....@@ -3517,6 +3682,46 @@
35173682 continue;
35183683 blockloop = true;
35193684 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);
35203725 blockloop = false;
35213726 // release(i);
35223727 }
....@@ -4294,6 +4499,55 @@
42944499 }
42954500 }
42964501
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
+
42974551 void RepairTexture()
42984552 {
42994553 if (this instanceof FileObject || blockloop)
....@@ -4808,6 +5062,14 @@
48085062 }
48095063 }
48105064
5065
+ ObjEditor GetWindow()
5066
+ {
5067
+ if (editWindow != null)
5068
+ return editWindow;
5069
+
5070
+ return manipWindow;
5071
+ }
5072
+
48115073 cTreePath Select(int indexcount, boolean deselect)
48125074 {
48135075 if (hide || dontselect)
....@@ -4844,10 +5106,11 @@
48445106 if (leaf != null)
48455107 {
48465108 cTreePath tp = new cTreePath(this, leaf);
4847
- if (editWindow != null)
5109
+ ObjEditor window = GetWindow();
5110
+ if (window != null)
48485111 {
48495112 //System.out.println("editWindow = " + editWindow + " vs " + this);
4850
- editWindow.Select(tp, deselect, true);
5113
+ window.Select(tp, deselect, true);
48515114 }
48525115
48535116 return tp;
....@@ -4864,6 +5127,7 @@
48645127
48655128 if (child == null)
48665129 continue;
5130
+
48675131 if (child.HasTransparency() && child.size() != 0)
48685132 {
48695133 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -4873,9 +5137,10 @@
48735137 if (leaf != null)
48745138 {
48755139 cTreePath tp = new cTreePath(this, leaf);
4876
- if (editWindow != null)
5140
+ ObjEditor window = GetWindow();
5141
+ if (window != null)
48775142 {
4878
- editWindow.Select(tp, deselect, true);
5143
+ window.Select(tp, deselect, true);
48795144 }
48805145
48815146 return tp;
....@@ -5200,6 +5465,51 @@
52005465 blockloop = false;
52015466 }
52025467
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
+
52035513 boolean IsSelected()
52045514 {
52055515 if (parent == null)
....@@ -5509,6 +5819,38 @@
55095819 }
55105820 }
55115821
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
+
55125854 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55135855 {
55145856 Draw(display, root, selected, blocked);
....@@ -5517,12 +5859,23 @@
55175859 boolean NeedSupport()
55185860 {
55195861 return
5520
- CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
5862
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
55215863 // PROBLEM with CROWD!!
55225864 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
55235865 }
55245866
55255867 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
+ }
55265879
55275880 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55285881 {
....@@ -5584,8 +5937,10 @@
55845937 if (support != null)
55855938 support = support;
55865939
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);
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.
55895944
55905945 if (!usecalllists && bRep != null && bRep.displaylist > 0)
55915946 {
....@@ -5595,8 +5950,9 @@
55955950 // usecalllists &= !(parent instanceof RandomNode);
55965951 // usecalllists = false;
55975952
5598
- if (GetBRep() != null)
5599
- usecalllists = usecalllists;
5953
+ if (display.DrawMode() == display.SHADOW)
5954
+ //GetBRep() != null)
5955
+ usecalllists = !!usecalllists;
56005956 //System.out.println("draw " + this);
56015957 //new Exception().printStackTrace();
56025958
....@@ -5605,10 +5961,12 @@
56055961 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
56065962
56075963 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5608
- (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)))
56095966 {
56105967 Globals.lighttouched = true;
56115968 } // all panes...
5969
+
56125970 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
56135971 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
56145972 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5616,7 +5974,7 @@
56165974 if (!(this instanceof Composite))
56175975 touched = false;
56185976 //if (displaylist == -1 && usecalllists)
5619
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5977
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
56205978 {
56215979 bRep.displaylist = display.GenList();
56225980 assert(bRep.displaylist != 0);
....@@ -5627,7 +5985,7 @@
56275985
56285986 //System.out.println("\tnew list " + list);
56295987 //gl.glDrawBuffer(gl.GL_NONE);
5630
- if (usecalllists)
5988
+ if (usecalllists && bRep.displaylist > 0)
56315989 {
56325990 // System.err.println("new list " + bRep.displaylist + " for " + this);
56335991 display.NewList(bRep.displaylist);
....@@ -5636,7 +5994,7 @@
56365994 CallList(display, root, selected, blocked);
56375995
56385996 // compiled = true;
5639
- if (usecalllists)
5997
+ if (usecalllists && bRep.displaylist > 0)
56405998 {
56415999 // System.err.println("end list " + bRep.displaylist + " for " + this);
56426000 display.EndList();
....@@ -5736,6 +6094,7 @@
57366094 if (GetBRep() != null)
57376095 {
57386096 display.NextIndex();
6097
+
57396098 // vertex color conflict : gl.glCallList(list);
57406099 DrawNode(display, root, selected);
57416100 if (this instanceof BezierPatch)
....@@ -5776,16 +6135,27 @@
57766135 tex = GetTextures();
57776136 }
57786137
5779
- boolean failed = false;
6138
+ boolean failedPigment = false;
6139
+ boolean failedBump = false;
57806140
57816141 try
57826142 {
5783
- display.BindTextures(tex, texres);
6143
+ display.BindPigmentTexture(tex, texres);
57846144 }
57856145 catch (Exception e)
57866146 {
57876147 System.err.println("FAILED: " + this);
5788
- 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;
57896159 }
57906160
57916161 if (!compiled)
....@@ -5808,8 +6178,11 @@
58086178 }
58096179 }
58106180
5811
- if (!failed)
5812
- display.ReleaseTextures(tex);
6181
+ if (!failedBump)
6182
+ display.ReleaseBumpTexture(tex);
6183
+
6184
+ if (!failedPigment)
6185
+ display.ReleasePigmentTexture(tex);
58136186
58146187 display.PopMaterial(this, selected);
58156188 }
....@@ -6182,6 +6555,11 @@
61826555 // dec 2012
61836556 new Exception().printStackTrace();
61846557 return;
6558
+ }
6559
+
6560
+ if (dontselect)
6561
+ {
6562
+ //bRep.GenerateNormalsMINE();
61856563 }
61866564
61876565 display.DrawGeometry(bRep, flipV, selectmode);
....@@ -6967,20 +7345,23 @@
69677345 }
69687346 }
69697347
6970
- 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)
69717352 {
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;
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;
69757356 if (toscreen == null)
69767357 {
6977
- toscreen = new Camera(info.camera.viewCode).toScreen;
7358
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
69787359 }
69797360 cVector vec = in;
69807361 LA.xformPos(in, toscreen, in);
69817362 //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();
7363
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7364
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
69847365 outPt.x = hc + (int) vec.x;
69857366 outPt.y = vc - (int) vec.y;
69867367 outRec.x = outPt.x - 3;
....@@ -6988,15 +7369,18 @@
69887369 outRec.width = outRec.height = 6;
69897370 }
69907371
6991
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7372
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7373
+ )
69927374 {
69937375 Point pt = new Point(0, 0);
69947376 Rectangle rec = new Rectangle();
6995
- calcHotSpot(in, info, pt, rec);
7377
+ calcHotSpot(in, //clickInfo,
7378
+ pt, rec);
69967379 return rec;
69977380 }
69987381
6999
- void drawEditHandles0(ClickInfo info, int level)
7382
+ void drawEditHandles0(//ClickInfo clickInfo,
7383
+ int level)
70007384 {
70017385 if (level == 0)
70027386 {
....@@ -7005,16 +7389,19 @@
70057389 {
70067390 cVector origin = new cVector();
70077391 //LA.xformPos(origin, toParent, origin);
7008
- Rectangle spot = calcHotSpot(origin, info);
7392
+ if (this.clickInfo == null)
7393
+ this.clickInfo = new ClickInfo();
7394
+
7395
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
70097396 Rectangle boundary = new Rectangle();
70107397 boundary.x = spot.x - 30;
70117398 boundary.y = spot.y - 30;
70127399 boundary.width = spot.width + 60;
70137400 boundary.height = spot.height + 60;
7014
- info.g.setColor(Color.red);
7401
+ clickInfo.g.setColor(Color.red);
70157402 int spotw = spot.x + spot.width;
70167403 int spoth = spot.y + spot.height;
7017
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7404
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
70187405 // if (CameraPane.Xmin > spot.x)
70197406 // {
70207407 // CameraPane.Xmin = spot.x;
....@@ -7034,8 +7421,8 @@
70347421 spot.translate(32, 32);
70357422 spotw = spot.x + spot.width;
70367423 spoth = spot.y + spot.height;
7037
- info.g.setColor(Color.blue);
7038
- 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);
70397426 // if (CameraPane.Xmin > spot.x)
70407427 // {
70417428 // CameraPane.Xmin = spot.x;
....@@ -7052,11 +7439,12 @@
70527439 // {
70537440 // CameraPane.Ymax = spoth;
70547441 // }
7055
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7056
- //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
70577444 spot.translate(0, -32);
7058
- info.g.setColor(Color.green);
7059
- 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);
70607448 // if (CameraPane.Xmin > spot.x)
70617449 // {
70627450 // CameraPane.Xmin = spot.x;
....@@ -7073,8 +7461,8 @@
70737461 // {
70747462 // CameraPane.Ymax = spoth;
70757463 // }
7076
- info.g.drawArc(boundary.x, boundary.y,
7077
- 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);
70787466 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
70797467 // if (CameraPane.Xmin > boundary.x)
70807468 // {
....@@ -7096,7 +7484,8 @@
70967484 }
70977485 }
70987486
7099
- boolean doEditClick0(ClickInfo info, int level)
7487
+ boolean doEditClick0(//ClickInfo clickInfo,
7488
+ int level)
71007489 {
71017490 if (level == 0)
71027491 {
....@@ -7105,8 +7494,8 @@
71057494
71067495 boolean retval = false;
71077496
7108
- startX = info.x;
7109
- startY = info.y;
7497
+ startX = clickInfo.x;
7498
+ startY = clickInfo.y;
71107499
71117500 hitSomething = -1;
71127501 cVector origin = new cVector();
....@@ -7116,22 +7505,51 @@
71167505 {
71177506 centerPt = new Point(0, 0);
71187507 }
7119
- calcHotSpot(origin, info, centerPt, spot);
7120
- if (spot.contains(info.x, info.y))
7508
+ calcHotSpot(origin, //info,
7509
+ centerPt, spot);
7510
+ if (spot.contains(clickInfo.x, clickInfo.y))
71217511 {
71227512 hitSomething = hitCenter;
71237513 retval = true;
71247514 }
71257515 spot.translate(32, 0);
7126
- if (spot.contains(info.x, info.y))
7516
+ if (spot.contains(clickInfo.x, clickInfo.y))
71277517 {
71287518 hitSomething = hitRotate;
71297519 retval = true;
71307520 }
71317521 spot.translate(0, 32);
7132
- if (spot.contains(info.x, info.y))
7522
+ if (spot.contains(clickInfo.x, clickInfo.y))
71337523 {
71347524 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
+
71357553 retval = true;
71367554 }
71377555
....@@ -7141,7 +7559,7 @@
71417559 }
71427560
71437561 //System.out.println("info.modifiers = " + info.modifiers);
7144
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7562
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
71457563 //System.out.println("modified = " + modified);
71467564 //new Exception().printStackTrace();
71477565 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7169,7 +7587,8 @@
71697587 return true;
71707588 }
71717589
7172
- void doEditDrag0(ClickInfo info, boolean opposite)
7590
+ void doEditDrag0(//ClickInfo info,
7591
+ boolean opposite)
71737592 {
71747593 if (hitSomething == 0)
71757594 {
....@@ -7183,7 +7602,7 @@
71837602
71847603 //System.out.println("hitSomething = " + hitSomething);
71857604
7186
- double scale = 0.005f * info.camera.Distance();
7605
+ double scale = 0.005f * clickInfo.camera.Distance();
71877606
71887607 cVector xlate = new cVector();
71897608 //cVector xlate2 = new cVector();
....@@ -7217,8 +7636,8 @@
72177636 toParent[3][i] = xlate.get(i);
72187637 LA.matInvert(toParent, fromParent);
72197638 */
7220
- cVector delta = LA.newVector(0, 0, startY - info.y);
7221
- 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);
72227641
72237642 LA.matCopy(startMat, toParent);
72247643 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7227,7 +7646,7 @@
72277646 } else
72287647 {
72297648 //LA.xformDir(delta, info.camera.fromScreen, delta);
7230
- cVector up = new cVector(info.camera.up);
7649
+ cVector up = new cVector(clickInfo.camera.up);
72317650 cVector away = new cVector();
72327651 //cVector right2 = new cVector();
72337652 //LA.vecCross(up, cVector.Z, right);
....@@ -7244,19 +7663,19 @@
72447663 LA.xformDir(up, ClickInfo.matbuffer, up);
72457664 // if (!CameraPane.LOCALTRANSFORM)
72467665 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7247
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7666
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
72487667 // if (!CameraPane.LOCALTRANSFORM)
72497668 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
72507669 //LA.vecCross(up, cVector.Z, right2);
72517670
7252
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7671
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
72537672
72547673 //System.out.println("DELTA0 = " + delta);
72557674 //System.out.println("AWAY = " + info.camera.away);
72567675 //System.out.println("UP = " + info.camera.up);
72577676 if (away.z > 0)
72587677 {
7259
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7678
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
72607679 {
72617680 delta.x = -delta.x;
72627681 } else
....@@ -7271,7 +7690,7 @@
72717690 //System.out.println("DELTA1 = " + delta);
72727691 LA.xformDir(delta, ClickInfo.matbuffer, delta);
72737692 //System.out.println("DELTA2 = " + delta);
7274
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7693
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
72757694 LA.matCopy(startMat, toParent);
72767695 //System.out.println("DELTA3 = " + delta);
72777696 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7281,8 +7700,8 @@
72817700 break;
72827701
72837702 case hitRotate: // rotate
7284
- int dx = info.x - centerPt.x;
7285
- int dy = -(info.y - centerPt.y);
7703
+ int dx = clickInfo.x - centerPt.x;
7704
+ int dy = -(clickInfo.y - centerPt.y);
72867705 double angle = (double) Math.atan2(dx, dy);
72877706 angle = -(1.570796 - angle);
72887707
....@@ -7305,7 +7724,7 @@
73057724 }
73067725 /**/
73077726
7308
- switch (info.pane.RenderCamera().viewCode)
7727
+ switch (clickInfo.pane.RenderCamera().viewCode)
73097728 {
73107729 case 1: // '\001'
73117730 LA.matZRotate(toParent, angle);
....@@ -7332,7 +7751,7 @@
73327751 break;
73337752
73347753 case hitScale: // scale
7335
- double hScale = (double) (info.x - centerPt.x) / 32;
7754
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
73367755 double sign = 1;
73377756 if (hScale < 0)
73387757 {
....@@ -7344,7 +7763,7 @@
73447763 //hScale = 0.01;
73457764 }
73467765
7347
- double vScale = (double) (info.y - centerPt.y) / 32;
7766
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
73487767 sign = 1;
73497768 if (vScale < 0)
73507769 {
....@@ -7355,6 +7774,7 @@
73557774 {
73567775 //vScale = 0.01;
73577776 }
7777
+
73587778 LA.matCopy(startMat, toParent);
73597779 /**/
73607780 for (int i = 0; i < 3; i++)
....@@ -7364,29 +7784,30 @@
73647784 }
73657785 /**/
73667786
7367
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7787
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
73687788
73697789 if (totalScale < 0.01)
73707790 {
73717791 totalScale = 0.01;
73727792 }
73737793
7374
- switch (info.pane.RenderCamera().viewCode)
7794
+ switch (clickInfo.pane.RenderCamera().viewCode)
73757795 {
73767796 case 3: // '\001'
7377
- if (modified)
7797
+ if (modified || opposite)
73787798 {
73797799 //LA.matScale(toParent, 1, hScale, vScale);
73807800 LA.matScale(toParent, totalScale, 1, 1);
73817801 } // vScale, 1);
73827802 else
73837803 {
7804
+ // EXCEPTION!
73847805 LA.matScale(toParent, totalScale, totalScale, totalScale);
73857806 } // vScale, 1);
73867807 break;
73877808
73887809 case 2: // '\002'
7389
- if (modified)
7810
+ if (modified || opposite)
73907811 {
73917812 //LA.matScale(toParent, hScale, 1, vScale);
73927813 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7397,7 +7818,7 @@
73977818 break;
73987819
73997820 case 1: // '\003'
7400
- if (modified)
7821
+ if (modified || opposite)
74017822 {
74027823 //LA.matScale(toParent, hScale, vScale, 1);
74037824 LA.matScale(toParent, 1, 1, totalScale);
....@@ -7437,7 +7858,7 @@
74377858 } // NEW ...
74387859
74397860
7440
- info.pane.repaint();
7861
+ clickInfo.pane.repaint();
74417862 }
74427863
74437864 boolean overflow = false;
....@@ -7617,6 +8038,10 @@
76178038 editWindow = null;
76188039 } // ?
76198040 }
8041
+ else
8042
+ {
8043
+ //editWindow.closeUI();
8044
+ }
76208045 }
76218046
76228047 boolean root; // patch for edit windows
....@@ -7774,6 +8199,10 @@
77748199 }
77758200
77768201 transient ObjEditor editWindow;
8202
+ transient ObjEditor manipWindow;
8203
+
8204
+ transient boolean pinned;
8205
+
77778206 transient ObjectUI objectUI;
77788207 public static int povDepth = 0;
77798208 private static cVector tbMin = new cVector();