Normand Briere
2019-07-30 475f8cbdbd96fdbf8f5b216ffebb31a51f25c2f9
Object3D.java
....@@ -24,11 +24,17 @@
2424
2525 private UUID uuid = UUID.randomUUID();
2626
27
- // TEMPORARY for mocap undo
28
- mocap.reader.BVHReader.BVHResult bvh;
29
- Object3D skeleton;
27
+ // TEMPORARY for mocap undo. No need to be transient.
28
+ mocap.reader.BVHReader.BVHResult savebvh;
29
+ Object3D saveskeleton;
3030 //
3131
32
+ String skyboxname;
33
+ String skyboxext;
34
+
35
+ byte[] versions[];
36
+ int versionindex = -1;
37
+
3238 ScriptNode scriptnode;
3339
3440 void InitOthers()
....@@ -170,24 +176,35 @@
170176
171177 void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
172178 {
179
+ Object3D o;
180
+
173181 if (hashtable.containsKey(GetUUID()))
174182 {
175
- Object3D o = hashtable.get(GetUUID());
183
+ o = hashtable.get(GetUUID());
176184
177185 Grafreed.Assert(this.bRep == o.bRep);
178
- if (this.bRep != null)
179
- assert(this.bRep.support == o.transientrep);
186
+ //if (this.bRep != null)
187
+ // assert(this.bRep.support == o.transientrep);
188
+ if (this.support != null)
189
+ assert(this.support.bRep == o.transientrep);
190
+ }
191
+ else
192
+ {
193
+ o = new Object3D("copy of " + this.name);
180194
181
- return;
195
+ hashtable.put(GetUUID(), o);
182196 }
183197
184
- Object3D o = new Object3D();
185
-
186
- hashtable.put(GetUUID(), o);
187
-
188
- for (int i=0; i<Size(); i++)
198
+ if (!blockloop)
189199 {
190
- get(i).ExtractBigData(hashtable);
200
+ blockloop = true;
201
+
202
+ for (int i=0; i<Size(); i++)
203
+ {
204
+ get(i).ExtractBigData(hashtable);
205
+ }
206
+
207
+ blockloop = false;
191208 }
192209
193210 ExtractBigData(o);
....@@ -195,11 +212,26 @@
195212
196213 void ExtractBigData(Object3D o)
197214 {
215
+ if (o.bRep != null)
216
+ Grafreed.Assert(o.bRep == this.bRep);
217
+
198218 o.bRep = this.bRep;
199
- if (this.bRep != null)
219
+// July 2019 if (this.bRep != null)
220
+// {
221
+// o.transientrep = this.bRep.support;
222
+// o.bRep.support = null;
223
+// }
224
+ o.selection = this.selection;
225
+ o.versions = this.versions;
226
+ o.versionindex = this.versionindex;
227
+
228
+ if (this.support != null)
200229 {
201
- o.transientrep = this.bRep.support;
202
- o.bRep.support = null;
230
+ if (o.transientrep != null)
231
+ Grafreed.Assert(o.transientrep == this.support.bRep);
232
+
233
+ o.transientrep = this.support.bRep;
234
+ this.support.bRep = null;
203235 }
204236
205237 // o.support = this.support;
....@@ -223,19 +255,35 @@
223255
224256 RestoreBigData(o);
225257
226
- hashtable.remove(GetUUID());
258
+ if (blockloop)
259
+ return;
260
+
261
+ blockloop = true;
262
+
263
+ //hashtable.remove(GetUUID());
227264
228265 for (int i=0; i<Size(); i++)
229266 {
230267 get(i).RestoreBigData(hashtable);
231268 }
269
+
270
+ blockloop = false;
232271 }
233272
234273 void RestoreBigData(Object3D o)
235274 {
236275 this.bRep = o.bRep;
237
- if (this.bRep != null)
238
- this.bRep.support = o.transientrep;
276
+ if (this.support != null && o.transientrep != null)
277
+ {
278
+ this.support.bRep = o.transientrep;
279
+ }
280
+
281
+ this.selection = o.selection;
282
+
283
+ this.versions = o.versions;
284
+ this.versionindex = o.versionindex;
285
+// July 2019 if (this.bRep != null)
286
+// this.bRep.support = o.transientrep;
239287 // this.support = o.support;
240288 // this.fileparent = o.fileparent;
241289 }
....@@ -381,6 +429,7 @@
381429 }
382430
383431 boolean live = false;
432
+ transient boolean keepdontselect;
384433 boolean dontselect = false;
385434 boolean hide = false;
386435 boolean link2master = false; // performs reset support/master at each frame
....@@ -1367,6 +1416,7 @@
13671416 toParent = LA.newMatrix();
13681417 fromParent = LA.newMatrix();
13691418 }
1419
+
13701420 LA.matCopy(other.toParent, toParent);
13711421 LA.matCopy(other.fromParent, fromParent);
13721422
....@@ -2433,6 +2483,14 @@
24332483 {
24342484 editWindow.refreshContents();
24352485 }
2486
+ else
2487
+ {
2488
+ if (manipWindow != null)
2489
+ {
2490
+ manipWindow.refreshContents();
2491
+ }
2492
+ }
2493
+
24362494 //if (parent != null)
24372495 //parent.refreshEditWindow();
24382496 }
....@@ -2512,7 +2570,8 @@
25122570 private static final int editSelf = 1;
25132571 private static final int editChild = 2;
25142572
2515
- void drawEditHandles(ClickInfo info, int level)
2573
+ void drawEditHandles(//ClickInfo info,
2574
+ int level)
25162575 {
25172576 if (level == 0)
25182577 {
....@@ -2520,7 +2579,8 @@
25202579 return;
25212580
25222581 Object3D selectee;
2523
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2582
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2583
+ level + 1))
25242584 {
25252585 selectee = (Object3D) e.nextElement();
25262586 }
....@@ -2528,19 +2588,22 @@
25282588 } else
25292589 {
25302590 //super.
2531
- drawEditHandles0(info, level + 1);
2591
+ drawEditHandles0(//info,
2592
+ level + 1);
25322593 }
25332594 }
25342595
2535
- boolean doEditClick(ClickInfo info, int level)
2596
+ boolean doEditClick(//ClickInfo info,
2597
+ int level)
25362598 {
25372599 doSomething = 0;
25382600 if (level == 0)
25392601 {
2540
- return doParentClick(info);
2602
+ return doParentClick(); //info);
25412603 }
25422604 if (//super.
2543
- doEditClick0(info, level))
2605
+ doEditClick0(//info,
2606
+ level))
25442607 {
25452608 doSomething = 1;
25462609 return true;
....@@ -2550,7 +2613,7 @@
25502613 }
25512614 }
25522615
2553
- boolean doParentClick(ClickInfo info)
2616
+ boolean doParentClick() //ClickInfo info)
25542617 {
25552618 if (selection == null)
25562619 {
....@@ -2563,7 +2626,8 @@
25632626 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
25642627 {
25652628 Object3D selectee = (Object3D) e.nextElement();
2566
- if (selectee.doEditClick(info, 1))
2629
+ if (selectee.doEditClick(//info,
2630
+ 1))
25672631 {
25682632 childToDrag = selectee;
25692633 doSomething = 2;
....@@ -2575,13 +2639,15 @@
25752639 return retval;
25762640 }
25772641
2578
- void doEditDrag(ClickInfo info, boolean opposite)
2642
+ void doEditDrag(//ClickInfo clickInfo,
2643
+ boolean opposite)
25792644 {
25802645 switch (doSomething)
25812646 {
25822647 case 1: // '\001'
25832648 //super.
2584
- doEditDrag0(info, opposite);
2649
+ doEditDrag0(//clickInfo,
2650
+ opposite);
25852651 break;
25862652
25872653 case 2: // '\002'
....@@ -2594,11 +2660,13 @@
25942660 {
25952661 //sel.hitSomething = childToDrag.hitSomething;
25962662 //childToDrag.doEditDrag(info);
2597
- sel.doEditDrag(info, opposite);
2663
+ sel.doEditDrag(//clickInfo,
2664
+ opposite);
25982665 } else
25992666 {
26002667 //super.
2601
- doEditDrag0(info, opposite);
2668
+ doEditDrag0(//clickInfo,
2669
+ opposite);
26022670 }
26032671 }
26042672 break;
....@@ -2616,6 +2684,9 @@
26162684 {
26172685 deselectAll();
26182686 }
2687
+
2688
+ new Exception().printStackTrace();
2689
+
26192690 ClickInfo newInfo = new ClickInfo();
26202691 newInfo.flags = info.flags;
26212692 newInfo.bounds = info.bounds;
....@@ -3063,7 +3134,7 @@
30633134 {
30643135 if (bRep != null)
30653136 {
3066
- bRep.GenerateNormalsMINE();
3137
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
30673138 Touch();
30683139 }
30693140 }
....@@ -4963,6 +5034,14 @@
49635034 }
49645035 }
49655036
5037
+ ObjEditor GetWindow()
5038
+ {
5039
+ if (editWindow != null)
5040
+ return editWindow;
5041
+
5042
+ return manipWindow;
5043
+ }
5044
+
49665045 cTreePath Select(int indexcount, boolean deselect)
49675046 {
49685047 if (hide || dontselect)
....@@ -4999,10 +5078,11 @@
49995078 if (leaf != null)
50005079 {
50015080 cTreePath tp = new cTreePath(this, leaf);
5002
- if (editWindow != null)
5081
+ ObjEditor window = GetWindow();
5082
+ if (window != null)
50035083 {
50045084 //System.out.println("editWindow = " + editWindow + " vs " + this);
5005
- editWindow.Select(tp, deselect, true);
5085
+ window.Select(tp, deselect, true);
50065086 }
50075087
50085088 return tp;
....@@ -5019,6 +5099,7 @@
50195099
50205100 if (child == null)
50215101 continue;
5102
+
50225103 if (child.HasTransparency() && child.size() != 0)
50235104 {
50245105 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -5028,9 +5109,10 @@
50285109 if (leaf != null)
50295110 {
50305111 cTreePath tp = new cTreePath(this, leaf);
5031
- if (editWindow != null)
5112
+ ObjEditor window = GetWindow();
5113
+ if (window != null)
50325114 {
5033
- editWindow.Select(tp, deselect, true);
5115
+ window.Select(tp, deselect, true);
50345116 }
50355117
50365118 return tp;
....@@ -5355,6 +5437,51 @@
53555437 blockloop = false;
53565438 }
53575439
5440
+ void ResetSelectable()
5441
+ {
5442
+ if (blockloop)
5443
+ return;
5444
+
5445
+ blockloop = true;
5446
+
5447
+ keepdontselect = dontselect;
5448
+ dontselect = true;
5449
+
5450
+ Object3D child;
5451
+ int nb = Size();
5452
+ for (int i = 0; i < nb; i++)
5453
+ {
5454
+ child = (Object3D) get(i);
5455
+ if (child == null)
5456
+ continue;
5457
+ child.ResetSelectable();
5458
+ }
5459
+
5460
+ blockloop = false;
5461
+ }
5462
+
5463
+ void RestoreSelectable()
5464
+ {
5465
+ if (blockloop)
5466
+ return;
5467
+
5468
+ blockloop = true;
5469
+
5470
+ dontselect = keepdontselect;
5471
+
5472
+ Object3D child;
5473
+ int nb = Size();
5474
+ for (int i = 0; i < nb; i++)
5475
+ {
5476
+ child = (Object3D) get(i);
5477
+ if (child == null)
5478
+ continue;
5479
+ child.RestoreSelectable();
5480
+ }
5481
+
5482
+ blockloop = false;
5483
+ }
5484
+
53585485 boolean IsSelected()
53595486 {
53605487 if (parent == null)
....@@ -5664,6 +5791,38 @@
56645791 }
56655792 }
56665793
5794
+ void EmbedTextures(boolean embed)
5795
+ {
5796
+ if (blockloop)
5797
+ return;
5798
+
5799
+ //if (GetTextures() != null)
5800
+ if (embed)
5801
+ CameraPane.EmbedTextures(GetTextures());
5802
+ else
5803
+ {
5804
+ GetTextures().pigmentdata = null;
5805
+ GetTextures().bumpdata = null;
5806
+ GetTextures().pw = 0;
5807
+ GetTextures().ph = 0;
5808
+ GetTextures().bw = 0;
5809
+ GetTextures().bh = 0;
5810
+ }
5811
+
5812
+ int nb = Size();
5813
+ for (int i = 0; i < nb; i++)
5814
+ {
5815
+ Object3D child = (Object3D) get(i);
5816
+
5817
+ if (child == null)
5818
+ continue;
5819
+
5820
+ blockloop = true;
5821
+ child.EmbedTextures(embed);
5822
+ blockloop = false;
5823
+ }
5824
+ }
5825
+
56675826 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
56685827 {
56695828 Draw(display, root, selected, blocked);
....@@ -5751,7 +5910,7 @@
57515910 support = support;
57525911
57535912 //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5754
- boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5913
+ boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
57555914
57565915 if (!usecalllists && bRep != null && bRep.displaylist > 0)
57575916 {
....@@ -5772,7 +5931,7 @@
57725931
57735932 if (!selectmode && //display.DrawMode() != display.SELECTION &&
57745933 //(touched || (bRep != null && bRep.displaylist <= 0)))
5775
- (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && (bRep != null && bRep.displaylist <= 0)))
5934
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
57765935 {
57775936 Globals.lighttouched = true;
57785937 } // all panes...
....@@ -5904,6 +6063,7 @@
59046063 if (GetBRep() != null)
59056064 {
59066065 display.NextIndex();
6066
+
59076067 // vertex color conflict : gl.glCallList(list);
59086068 DrawNode(display, root, selected);
59096069 if (this instanceof BezierPatch)
....@@ -7154,20 +7314,23 @@
71547314 }
71557315 }
71567316
7157
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7317
+ static ClickInfo clickInfo = new ClickInfo();
7318
+
7319
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7320
+ Point outPt, Rectangle outRec)
71587321 {
7159
- int hc = info.bounds.x + info.bounds.width / 2;
7160
- int vc = info.bounds.y + info.bounds.height / 2;
7161
- double[][] toscreen = info.toScreen;
7322
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7323
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7324
+ double[][] toscreen = clickInfo.toScreen;
71627325 if (toscreen == null)
71637326 {
7164
- toscreen = new Camera(info.camera.viewCode).toScreen;
7327
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
71657328 }
71667329 cVector vec = in;
71677330 LA.xformPos(in, toscreen, in);
71687331 //System.out.println("Distance = " + info.camera.Distance());
7169
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
7170
- vec.y *= 100 * info.camera.SCALE / info.camera.Distance();
7332
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7333
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
71717334 outPt.x = hc + (int) vec.x;
71727335 outPt.y = vc - (int) vec.y;
71737336 outRec.x = outPt.x - 3;
....@@ -7175,15 +7338,18 @@
71757338 outRec.width = outRec.height = 6;
71767339 }
71777340
7178
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7341
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7342
+ )
71797343 {
71807344 Point pt = new Point(0, 0);
71817345 Rectangle rec = new Rectangle();
7182
- calcHotSpot(in, info, pt, rec);
7346
+ calcHotSpot(in, //clickInfo,
7347
+ pt, rec);
71837348 return rec;
71847349 }
71857350
7186
- void drawEditHandles0(ClickInfo info, int level)
7351
+ void drawEditHandles0(//ClickInfo clickInfo,
7352
+ int level)
71877353 {
71887354 if (level == 0)
71897355 {
....@@ -7192,16 +7358,19 @@
71927358 {
71937359 cVector origin = new cVector();
71947360 //LA.xformPos(origin, toParent, origin);
7195
- Rectangle spot = calcHotSpot(origin, info);
7361
+ if (this.clickInfo == null)
7362
+ this.clickInfo = new ClickInfo();
7363
+
7364
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
71967365 Rectangle boundary = new Rectangle();
71977366 boundary.x = spot.x - 30;
71987367 boundary.y = spot.y - 30;
71997368 boundary.width = spot.width + 60;
72007369 boundary.height = spot.height + 60;
7201
- info.g.setColor(Color.red);
7370
+ clickInfo.g.setColor(Color.red);
72027371 int spotw = spot.x + spot.width;
72037372 int spoth = spot.y + spot.height;
7204
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7373
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72057374 // if (CameraPane.Xmin > spot.x)
72067375 // {
72077376 // CameraPane.Xmin = spot.x;
....@@ -7221,8 +7390,8 @@
72217390 spot.translate(32, 32);
72227391 spotw = spot.x + spot.width;
72237392 spoth = spot.y + spot.height;
7224
- info.g.setColor(Color.cyan);
7225
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7393
+ clickInfo.g.setColor(Color.cyan);
7394
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72267395 // if (CameraPane.Xmin > spot.x)
72277396 // {
72287397 // CameraPane.Xmin = spot.x;
....@@ -7242,9 +7411,9 @@
72427411 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
72437412 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
72447413 spot.translate(0, -32);
7245
- info.g.setColor(Color.yellow);
7246
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7247
- info.g.setColor(Color.green);
7414
+ clickInfo.g.setColor(Color.yellow);
7415
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7416
+ clickInfo.g.setColor(Color.green);
72487417 // if (CameraPane.Xmin > spot.x)
72497418 // {
72507419 // CameraPane.Xmin = spot.x;
....@@ -7261,8 +7430,8 @@
72617430 // {
72627431 // CameraPane.Ymax = spoth;
72637432 // }
7264
- info.g.drawArc(boundary.x, boundary.y,
7265
- boundary.width, boundary.height, 0, 360);
7433
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7434
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
72667435 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
72677436 // if (CameraPane.Xmin > boundary.x)
72687437 // {
....@@ -7284,7 +7453,8 @@
72847453 }
72857454 }
72867455
7287
- boolean doEditClick0(ClickInfo info, int level)
7456
+ boolean doEditClick0(//ClickInfo clickInfo,
7457
+ int level)
72887458 {
72897459 if (level == 0)
72907460 {
....@@ -7293,8 +7463,8 @@
72937463
72947464 boolean retval = false;
72957465
7296
- startX = info.x;
7297
- startY = info.y;
7466
+ startX = clickInfo.x;
7467
+ startY = clickInfo.y;
72987468
72997469 hitSomething = -1;
73007470 cVector origin = new cVector();
....@@ -7304,22 +7474,51 @@
73047474 {
73057475 centerPt = new Point(0, 0);
73067476 }
7307
- calcHotSpot(origin, info, centerPt, spot);
7308
- if (spot.contains(info.x, info.y))
7477
+ calcHotSpot(origin, //info,
7478
+ centerPt, spot);
7479
+ if (spot.contains(clickInfo.x, clickInfo.y))
73097480 {
73107481 hitSomething = hitCenter;
73117482 retval = true;
73127483 }
73137484 spot.translate(32, 0);
7314
- if (spot.contains(info.x, info.y))
7485
+ if (spot.contains(clickInfo.x, clickInfo.y))
73157486 {
73167487 hitSomething = hitRotate;
73177488 retval = true;
73187489 }
73197490 spot.translate(0, 32);
7320
- if (spot.contains(info.x, info.y))
7491
+ if (spot.contains(clickInfo.x, clickInfo.y))
73217492 {
73227493 hitSomething = hitScale;
7494
+
7495
+ double scale = 0.005f * clickInfo.camera.Distance();
7496
+ double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7497
+ double sign = 1;
7498
+ if (hScale < 0)
7499
+ {
7500
+ sign = -1;
7501
+ }
7502
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7503
+ if (hScale < 0.01)
7504
+ {
7505
+ //hScale = 0.01;
7506
+ }
7507
+
7508
+ double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7509
+ sign = 1;
7510
+ if (vScale < 0)
7511
+ {
7512
+ sign = -1;
7513
+ }
7514
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7515
+ if (vScale < 0.01)
7516
+ {
7517
+ //vScale = 0.01;
7518
+ }
7519
+
7520
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7521
+
73237522 retval = true;
73247523 }
73257524
....@@ -7329,7 +7528,7 @@
73297528 }
73307529
73317530 //System.out.println("info.modifiers = " + info.modifiers);
7332
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7531
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
73337532 //System.out.println("modified = " + modified);
73347533 //new Exception().printStackTrace();
73357534 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7357,7 +7556,8 @@
73577556 return true;
73587557 }
73597558
7360
- void doEditDrag0(ClickInfo info, boolean opposite)
7559
+ void doEditDrag0(//ClickInfo info,
7560
+ boolean opposite)
73617561 {
73627562 if (hitSomething == 0)
73637563 {
....@@ -7371,7 +7571,7 @@
73717571
73727572 //System.out.println("hitSomething = " + hitSomething);
73737573
7374
- double scale = 0.005f * info.camera.Distance();
7574
+ double scale = 0.005f * clickInfo.camera.Distance();
73757575
73767576 cVector xlate = new cVector();
73777577 //cVector xlate2 = new cVector();
....@@ -7405,8 +7605,8 @@
74057605 toParent[3][i] = xlate.get(i);
74067606 LA.matInvert(toParent, fromParent);
74077607 */
7408
- cVector delta = LA.newVector(0, 0, startY - info.y);
7409
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7608
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7609
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
74107610
74117611 LA.matCopy(startMat, toParent);
74127612 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7415,7 +7615,7 @@
74157615 } else
74167616 {
74177617 //LA.xformDir(delta, info.camera.fromScreen, delta);
7418
- cVector up = new cVector(info.camera.up);
7618
+ cVector up = new cVector(clickInfo.camera.up);
74197619 cVector away = new cVector();
74207620 //cVector right2 = new cVector();
74217621 //LA.vecCross(up, cVector.Z, right);
....@@ -7432,19 +7632,19 @@
74327632 LA.xformDir(up, ClickInfo.matbuffer, up);
74337633 // if (!CameraPane.LOCALTRANSFORM)
74347634 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7435
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7635
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
74367636 // if (!CameraPane.LOCALTRANSFORM)
74377637 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
74387638 //LA.vecCross(up, cVector.Z, right2);
74397639
7440
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7640
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
74417641
74427642 //System.out.println("DELTA0 = " + delta);
74437643 //System.out.println("AWAY = " + info.camera.away);
74447644 //System.out.println("UP = " + info.camera.up);
74457645 if (away.z > 0)
74467646 {
7447
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7647
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
74487648 {
74497649 delta.x = -delta.x;
74507650 } else
....@@ -7459,7 +7659,7 @@
74597659 //System.out.println("DELTA1 = " + delta);
74607660 LA.xformDir(delta, ClickInfo.matbuffer, delta);
74617661 //System.out.println("DELTA2 = " + delta);
7462
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7662
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
74637663 LA.matCopy(startMat, toParent);
74647664 //System.out.println("DELTA3 = " + delta);
74657665 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7469,8 +7669,8 @@
74697669 break;
74707670
74717671 case hitRotate: // rotate
7472
- int dx = info.x - centerPt.x;
7473
- int dy = -(info.y - centerPt.y);
7672
+ int dx = clickInfo.x - centerPt.x;
7673
+ int dy = -(clickInfo.y - centerPt.y);
74747674 double angle = (double) Math.atan2(dx, dy);
74757675 angle = -(1.570796 - angle);
74767676
....@@ -7493,7 +7693,7 @@
74937693 }
74947694 /**/
74957695
7496
- switch (info.pane.RenderCamera().viewCode)
7696
+ switch (clickInfo.pane.RenderCamera().viewCode)
74977697 {
74987698 case 1: // '\001'
74997699 LA.matZRotate(toParent, angle);
....@@ -7520,7 +7720,7 @@
75207720 break;
75217721
75227722 case hitScale: // scale
7523
- double hScale = (double) (info.x - centerPt.x) / 32;
7723
+ double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
75247724 double sign = 1;
75257725 if (hScale < 0)
75267726 {
....@@ -7532,7 +7732,7 @@
75327732 //hScale = 0.01;
75337733 }
75347734
7535
- double vScale = (double) (info.y - centerPt.y) / 32;
7735
+ double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
75367736 sign = 1;
75377737 if (vScale < 0)
75387738 {
....@@ -7543,6 +7743,7 @@
75437743 {
75447744 //vScale = 0.01;
75457745 }
7746
+
75467747 LA.matCopy(startMat, toParent);
75477748 /**/
75487749 for (int i = 0; i < 3; i++)
....@@ -7552,14 +7753,14 @@
75527753 }
75537754 /**/
75547755
7555
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7756
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
75567757
75577758 if (totalScale < 0.01)
75587759 {
75597760 totalScale = 0.01;
75607761 }
75617762
7562
- switch (info.pane.RenderCamera().viewCode)
7763
+ switch (clickInfo.pane.RenderCamera().viewCode)
75637764 {
75647765 case 3: // '\001'
75657766 if (modified || opposite)
....@@ -7626,7 +7827,7 @@
76267827 } // NEW ...
76277828
76287829
7629
- info.pane.repaint();
7830
+ clickInfo.pane.repaint();
76307831 }
76317832
76327833 boolean overflow = false;
....@@ -7967,6 +8168,10 @@
79678168 }
79688169
79698170 transient ObjEditor editWindow;
8171
+ transient ObjEditor manipWindow;
8172
+
8173
+ transient boolean pinned;
8174
+
79708175 transient ObjectUI objectUI;
79718176 public static int povDepth = 0;
79728177 private static cVector tbMin = new cVector();