Normand Briere
2019-07-27 1af7d3700724834e40ad8636bc9a56cdc3b19b15
Object3D.java
....@@ -24,11 +24,14 @@
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
+ byte[] versions[];
33
+ int versionindex = -1;
34
+
3235 ScriptNode scriptnode;
3336
3437 void InitOthers()
....@@ -170,24 +173,35 @@
170173
171174 void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
172175 {
176
+ Object3D o;
177
+
173178 if (hashtable.containsKey(GetUUID()))
174179 {
175
- Object3D o = hashtable.get(GetUUID());
180
+ o = hashtable.get(GetUUID());
176181
177182 Grafreed.Assert(this.bRep == o.bRep);
178
- if (this.bRep != null)
179
- assert(this.bRep.support == o.transientrep);
183
+ //if (this.bRep != null)
184
+ // assert(this.bRep.support == o.transientrep);
185
+ if (this.support != null)
186
+ assert(this.support.bRep == o.transientrep);
187
+ }
188
+ else
189
+ {
190
+ o = new Object3D("copy of " + this.name);
180191
181
- return;
192
+ hashtable.put(GetUUID(), o);
182193 }
183194
184
- Object3D o = new Object3D("copy of " + this.name);
185
-
186
- hashtable.put(GetUUID(), o);
187
-
188
- for (int i=0; i<Size(); i++)
195
+ if (!blockloop)
189196 {
190
- get(i).ExtractBigData(hashtable);
197
+ blockloop = true;
198
+
199
+ for (int i=0; i<Size(); i++)
200
+ {
201
+ get(i).ExtractBigData(hashtable);
202
+ }
203
+
204
+ blockloop = false;
191205 }
192206
193207 ExtractBigData(o);
....@@ -195,11 +209,26 @@
195209
196210 void ExtractBigData(Object3D o)
197211 {
212
+ if (o.bRep != null)
213
+ Grafreed.Assert(o.bRep == this.bRep);
214
+
198215 o.bRep = this.bRep;
199
- if (this.bRep != null)
216
+// July 2019 if (this.bRep != null)
217
+// {
218
+// o.transientrep = this.bRep.support;
219
+// o.bRep.support = null;
220
+// }
221
+ o.selection = this.selection;
222
+ o.versions = this.versions;
223
+ o.versionindex = this.versionindex;
224
+
225
+ if (this.support != null)
200226 {
201
- o.transientrep = this.bRep.support;
202
- o.bRep.support = null;
227
+ if (o.transientrep != null)
228
+ Grafreed.Assert(o.transientrep == this.support.bRep);
229
+
230
+ o.transientrep = this.support.bRep;
231
+ this.support.bRep = null;
203232 }
204233
205234 // o.support = this.support;
....@@ -219,14 +248,14 @@
219248 if (!hashtable.containsKey(GetUUID()))
220249 return;
221250
251
+ Object3D o = hashtable.get(GetUUID());
252
+
253
+ RestoreBigData(o);
254
+
222255 if (blockloop)
223256 return;
224257
225258 blockloop = true;
226
-
227
- Object3D o = hashtable.get(GetUUID());
228
-
229
- RestoreBigData(o);
230259
231260 //hashtable.remove(GetUUID());
232261
....@@ -241,8 +270,17 @@
241270 void RestoreBigData(Object3D o)
242271 {
243272 this.bRep = o.bRep;
244
- if (this.bRep != null)
245
- this.bRep.support = o.transientrep;
273
+ if (this.support != null && o.transientrep != null)
274
+ {
275
+ this.support.bRep = o.transientrep;
276
+ }
277
+
278
+ this.selection = o.selection;
279
+
280
+ this.versions = o.versions;
281
+ this.versionindex = o.versionindex;
282
+// July 2019 if (this.bRep != null)
283
+// this.bRep.support = o.transientrep;
246284 // this.support = o.support;
247285 // this.fileparent = o.fileparent;
248286 }
....@@ -388,6 +426,7 @@
388426 }
389427
390428 boolean live = false;
429
+ transient boolean keepdontselect;
391430 boolean dontselect = false;
392431 boolean hide = false;
393432 boolean link2master = false; // performs reset support/master at each frame
....@@ -1374,6 +1413,7 @@
13741413 toParent = LA.newMatrix();
13751414 fromParent = LA.newMatrix();
13761415 }
1416
+
13771417 LA.matCopy(other.toParent, toParent);
13781418 LA.matCopy(other.fromParent, fromParent);
13791419
....@@ -2527,7 +2567,8 @@
25272567 private static final int editSelf = 1;
25282568 private static final int editChild = 2;
25292569
2530
- void drawEditHandles(ClickInfo info, int level)
2570
+ void drawEditHandles(//ClickInfo info,
2571
+ int level)
25312572 {
25322573 if (level == 0)
25332574 {
....@@ -2535,7 +2576,8 @@
25352576 return;
25362577
25372578 Object3D selectee;
2538
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2579
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2580
+ level + 1))
25392581 {
25402582 selectee = (Object3D) e.nextElement();
25412583 }
....@@ -2543,19 +2585,22 @@
25432585 } else
25442586 {
25452587 //super.
2546
- drawEditHandles0(info, level + 1);
2588
+ drawEditHandles0(//info,
2589
+ level + 1);
25472590 }
25482591 }
25492592
2550
- boolean doEditClick(ClickInfo info, int level)
2593
+ boolean doEditClick(//ClickInfo info,
2594
+ int level)
25512595 {
25522596 doSomething = 0;
25532597 if (level == 0)
25542598 {
2555
- return doParentClick(info);
2599
+ return doParentClick(); //info);
25562600 }
25572601 if (//super.
2558
- doEditClick0(info, level))
2602
+ doEditClick0(//info,
2603
+ level))
25592604 {
25602605 doSomething = 1;
25612606 return true;
....@@ -2565,7 +2610,7 @@
25652610 }
25662611 }
25672612
2568
- boolean doParentClick(ClickInfo info)
2613
+ boolean doParentClick() //ClickInfo info)
25692614 {
25702615 if (selection == null)
25712616 {
....@@ -2578,7 +2623,8 @@
25782623 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
25792624 {
25802625 Object3D selectee = (Object3D) e.nextElement();
2581
- if (selectee.doEditClick(info, 1))
2626
+ if (selectee.doEditClick(//info,
2627
+ 1))
25822628 {
25832629 childToDrag = selectee;
25842630 doSomething = 2;
....@@ -2590,13 +2636,15 @@
25902636 return retval;
25912637 }
25922638
2593
- void doEditDrag(ClickInfo info, boolean opposite)
2639
+ void doEditDrag(//ClickInfo clickInfo,
2640
+ boolean opposite)
25942641 {
25952642 switch (doSomething)
25962643 {
25972644 case 1: // '\001'
25982645 //super.
2599
- doEditDrag0(info, opposite);
2646
+ doEditDrag0(//clickInfo,
2647
+ opposite);
26002648 break;
26012649
26022650 case 2: // '\002'
....@@ -2609,11 +2657,13 @@
26092657 {
26102658 //sel.hitSomething = childToDrag.hitSomething;
26112659 //childToDrag.doEditDrag(info);
2612
- sel.doEditDrag(info, opposite);
2660
+ sel.doEditDrag(//clickInfo,
2661
+ opposite);
26132662 } else
26142663 {
26152664 //super.
2616
- doEditDrag0(info, opposite);
2665
+ doEditDrag0(//clickInfo,
2666
+ opposite);
26172667 }
26182668 }
26192669 break;
....@@ -2631,6 +2681,9 @@
26312681 {
26322682 deselectAll();
26332683 }
2684
+
2685
+ new Exception().printStackTrace();
2686
+
26342687 ClickInfo newInfo = new ClickInfo();
26352688 newInfo.flags = info.flags;
26362689 newInfo.bounds = info.bounds;
....@@ -3078,7 +3131,7 @@
30783131 {
30793132 if (bRep != null)
30803133 {
3081
- bRep.GenerateNormalsMINE();
3134
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
30823135 Touch();
30833136 }
30843137 }
....@@ -5043,6 +5096,7 @@
50435096
50445097 if (child == null)
50455098 continue;
5099
+
50465100 if (child.HasTransparency() && child.size() != 0)
50475101 {
50485102 cTreePath leaf = child.Select(indexcount, deselect);
....@@ -5380,6 +5434,51 @@
53805434 blockloop = false;
53815435 }
53825436
5437
+ void ResetSelectable()
5438
+ {
5439
+ if (blockloop)
5440
+ return;
5441
+
5442
+ blockloop = true;
5443
+
5444
+ keepdontselect = dontselect;
5445
+ dontselect = true;
5446
+
5447
+ Object3D child;
5448
+ int nb = Size();
5449
+ for (int i = 0; i < nb; i++)
5450
+ {
5451
+ child = (Object3D) get(i);
5452
+ if (child == null)
5453
+ continue;
5454
+ child.ResetSelectable();
5455
+ }
5456
+
5457
+ blockloop = false;
5458
+ }
5459
+
5460
+ void RestoreSelectable()
5461
+ {
5462
+ if (blockloop)
5463
+ return;
5464
+
5465
+ blockloop = true;
5466
+
5467
+ dontselect = keepdontselect;
5468
+
5469
+ Object3D child;
5470
+ int nb = Size();
5471
+ for (int i = 0; i < nb; i++)
5472
+ {
5473
+ child = (Object3D) get(i);
5474
+ if (child == null)
5475
+ continue;
5476
+ child.RestoreSelectable();
5477
+ }
5478
+
5479
+ blockloop = false;
5480
+ }
5481
+
53835482 boolean IsSelected()
53845483 {
53855484 if (parent == null)
....@@ -5689,6 +5788,38 @@
56895788 }
56905789 }
56915790
5791
+ void EmbedTextures(boolean embed)
5792
+ {
5793
+ if (blockloop)
5794
+ return;
5795
+
5796
+ //if (GetTextures() != null)
5797
+ if (embed)
5798
+ CameraPane.EmbedTextures(GetTextures());
5799
+ else
5800
+ {
5801
+ GetTextures().pigmentdata = null;
5802
+ GetTextures().bumpdata = null;
5803
+ GetTextures().pw = 0;
5804
+ GetTextures().ph = 0;
5805
+ GetTextures().bw = 0;
5806
+ GetTextures().bh = 0;
5807
+ }
5808
+
5809
+ int nb = Size();
5810
+ for (int i = 0; i < nb; i++)
5811
+ {
5812
+ Object3D child = (Object3D) get(i);
5813
+
5814
+ if (child == null)
5815
+ continue;
5816
+
5817
+ blockloop = true;
5818
+ child.EmbedTextures(embed);
5819
+ blockloop = false;
5820
+ }
5821
+ }
5822
+
56925823 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
56935824 {
56945825 Draw(display, root, selected, blocked);
....@@ -5776,7 +5907,7 @@
57765907 support = support;
57775908
57785909 //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5779
- boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5910
+ boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
57805911
57815912 if (!usecalllists && bRep != null && bRep.displaylist > 0)
57825913 {
....@@ -5797,7 +5928,7 @@
57975928
57985929 if (!selectmode && //display.DrawMode() != display.SELECTION &&
57995930 //(touched || (bRep != null && bRep.displaylist <= 0)))
5800
- (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && (bRep != null && bRep.displaylist <= 0)))
5931
+ (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
58015932 {
58025933 Globals.lighttouched = true;
58035934 } // all panes...
....@@ -5929,6 +6060,7 @@
59296060 if (GetBRep() != null)
59306061 {
59316062 display.NextIndex();
6063
+
59326064 // vertex color conflict : gl.glCallList(list);
59336065 DrawNode(display, root, selected);
59346066 if (this instanceof BezierPatch)
....@@ -7179,20 +7311,23 @@
71797311 }
71807312 }
71817313
7182
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7314
+ static ClickInfo clickInfo = new ClickInfo();
7315
+
7316
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7317
+ Point outPt, Rectangle outRec)
71837318 {
7184
- int hc = info.bounds.x + info.bounds.width / 2;
7185
- int vc = info.bounds.y + info.bounds.height / 2;
7186
- double[][] toscreen = info.toScreen;
7319
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7320
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7321
+ double[][] toscreen = clickInfo.toScreen;
71877322 if (toscreen == null)
71887323 {
7189
- toscreen = new Camera(info.camera.viewCode).toScreen;
7324
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
71907325 }
71917326 cVector vec = in;
71927327 LA.xformPos(in, toscreen, in);
71937328 //System.out.println("Distance = " + info.camera.Distance());
7194
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
7195
- vec.y *= 100 * info.camera.SCALE / info.camera.Distance();
7329
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7330
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
71967331 outPt.x = hc + (int) vec.x;
71977332 outPt.y = vc - (int) vec.y;
71987333 outRec.x = outPt.x - 3;
....@@ -7200,15 +7335,18 @@
72007335 outRec.width = outRec.height = 6;
72017336 }
72027337
7203
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7338
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7339
+ )
72047340 {
72057341 Point pt = new Point(0, 0);
72067342 Rectangle rec = new Rectangle();
7207
- calcHotSpot(in, info, pt, rec);
7343
+ calcHotSpot(in, //clickInfo,
7344
+ pt, rec);
72087345 return rec;
72097346 }
72107347
7211
- void drawEditHandles0(ClickInfo info, int level)
7348
+ void drawEditHandles0(//ClickInfo clickInfo,
7349
+ int level)
72127350 {
72137351 if (level == 0)
72147352 {
....@@ -7217,16 +7355,19 @@
72177355 {
72187356 cVector origin = new cVector();
72197357 //LA.xformPos(origin, toParent, origin);
7220
- Rectangle spot = calcHotSpot(origin, info);
7358
+ if (this.clickInfo == null)
7359
+ this.clickInfo = new ClickInfo();
7360
+
7361
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
72217362 Rectangle boundary = new Rectangle();
72227363 boundary.x = spot.x - 30;
72237364 boundary.y = spot.y - 30;
72247365 boundary.width = spot.width + 60;
72257366 boundary.height = spot.height + 60;
7226
- info.g.setColor(Color.red);
7367
+ clickInfo.g.setColor(Color.red);
72277368 int spotw = spot.x + spot.width;
72287369 int spoth = spot.y + spot.height;
7229
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7370
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72307371 // if (CameraPane.Xmin > spot.x)
72317372 // {
72327373 // CameraPane.Xmin = spot.x;
....@@ -7246,8 +7387,8 @@
72467387 spot.translate(32, 32);
72477388 spotw = spot.x + spot.width;
72487389 spoth = spot.y + spot.height;
7249
- info.g.setColor(Color.cyan);
7250
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7390
+ clickInfo.g.setColor(Color.cyan);
7391
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72517392 // if (CameraPane.Xmin > spot.x)
72527393 // {
72537394 // CameraPane.Xmin = spot.x;
....@@ -7267,9 +7408,9 @@
72677408 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
72687409 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
72697410 spot.translate(0, -32);
7270
- info.g.setColor(Color.yellow);
7271
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7272
- info.g.setColor(Color.green);
7411
+ clickInfo.g.setColor(Color.yellow);
7412
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7413
+ clickInfo.g.setColor(Color.green);
72737414 // if (CameraPane.Xmin > spot.x)
72747415 // {
72757416 // CameraPane.Xmin = spot.x;
....@@ -7286,8 +7427,8 @@
72867427 // {
72877428 // CameraPane.Ymax = spoth;
72887429 // }
7289
- info.g.drawArc(boundary.x, boundary.y,
7290
- boundary.width, boundary.height, 0, 360);
7430
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7431
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
72917432 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
72927433 // if (CameraPane.Xmin > boundary.x)
72937434 // {
....@@ -7309,7 +7450,8 @@
73097450 }
73107451 }
73117452
7312
- boolean doEditClick0(ClickInfo info, int level)
7453
+ boolean doEditClick0(//ClickInfo clickInfo,
7454
+ int level)
73137455 {
73147456 if (level == 0)
73157457 {
....@@ -7318,8 +7460,8 @@
73187460
73197461 boolean retval = false;
73207462
7321
- startX = info.x;
7322
- startY = info.y;
7463
+ startX = clickInfo.x;
7464
+ startY = clickInfo.y;
73237465
73247466 hitSomething = -1;
73257467 cVector origin = new cVector();
....@@ -7329,22 +7471,51 @@
73297471 {
73307472 centerPt = new Point(0, 0);
73317473 }
7332
- calcHotSpot(origin, info, centerPt, spot);
7333
- if (spot.contains(info.x, info.y))
7474
+ calcHotSpot(origin, //info,
7475
+ centerPt, spot);
7476
+ if (spot.contains(clickInfo.x, clickInfo.y))
73347477 {
73357478 hitSomething = hitCenter;
73367479 retval = true;
73377480 }
73387481 spot.translate(32, 0);
7339
- if (spot.contains(info.x, info.y))
7482
+ if (spot.contains(clickInfo.x, clickInfo.y))
73407483 {
73417484 hitSomething = hitRotate;
73427485 retval = true;
73437486 }
73447487 spot.translate(0, 32);
7345
- if (spot.contains(info.x, info.y))
7488
+ if (spot.contains(clickInfo.x, clickInfo.y))
73467489 {
73477490 hitSomething = hitScale;
7491
+
7492
+ double scale = 0.005f * clickInfo.camera.Distance();
7493
+ double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
7494
+ double sign = 1;
7495
+ if (hScale < 0)
7496
+ {
7497
+ sign = -1;
7498
+ }
7499
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7500
+ if (hScale < 0.01)
7501
+ {
7502
+ //hScale = 0.01;
7503
+ }
7504
+
7505
+ double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
7506
+ sign = 1;
7507
+ if (vScale < 0)
7508
+ {
7509
+ sign = -1;
7510
+ }
7511
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7512
+ if (vScale < 0.01)
7513
+ {
7514
+ //vScale = 0.01;
7515
+ }
7516
+
7517
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7518
+
73487519 retval = true;
73497520 }
73507521
....@@ -7354,7 +7525,7 @@
73547525 }
73557526
73567527 //System.out.println("info.modifiers = " + info.modifiers);
7357
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7528
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
73587529 //System.out.println("modified = " + modified);
73597530 //new Exception().printStackTrace();
73607531 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7382,7 +7553,8 @@
73827553 return true;
73837554 }
73847555
7385
- void doEditDrag0(ClickInfo info, boolean opposite)
7556
+ void doEditDrag0(//ClickInfo info,
7557
+ boolean opposite)
73867558 {
73877559 if (hitSomething == 0)
73887560 {
....@@ -7396,7 +7568,7 @@
73967568
73977569 //System.out.println("hitSomething = " + hitSomething);
73987570
7399
- double scale = 0.005f * info.camera.Distance();
7571
+ double scale = 0.005f * clickInfo.camera.Distance();
74007572
74017573 cVector xlate = new cVector();
74027574 //cVector xlate2 = new cVector();
....@@ -7430,8 +7602,8 @@
74307602 toParent[3][i] = xlate.get(i);
74317603 LA.matInvert(toParent, fromParent);
74327604 */
7433
- cVector delta = LA.newVector(0, 0, startY - info.y);
7434
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7605
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7606
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
74357607
74367608 LA.matCopy(startMat, toParent);
74377609 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7440,7 +7612,7 @@
74407612 } else
74417613 {
74427614 //LA.xformDir(delta, info.camera.fromScreen, delta);
7443
- cVector up = new cVector(info.camera.up);
7615
+ cVector up = new cVector(clickInfo.camera.up);
74447616 cVector away = new cVector();
74457617 //cVector right2 = new cVector();
74467618 //LA.vecCross(up, cVector.Z, right);
....@@ -7457,19 +7629,19 @@
74577629 LA.xformDir(up, ClickInfo.matbuffer, up);
74587630 // if (!CameraPane.LOCALTRANSFORM)
74597631 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7460
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7632
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
74617633 // if (!CameraPane.LOCALTRANSFORM)
74627634 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
74637635 //LA.vecCross(up, cVector.Z, right2);
74647636
7465
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7637
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
74667638
74677639 //System.out.println("DELTA0 = " + delta);
74687640 //System.out.println("AWAY = " + info.camera.away);
74697641 //System.out.println("UP = " + info.camera.up);
74707642 if (away.z > 0)
74717643 {
7472
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7644
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
74737645 {
74747646 delta.x = -delta.x;
74757647 } else
....@@ -7484,7 +7656,7 @@
74847656 //System.out.println("DELTA1 = " + delta);
74857657 LA.xformDir(delta, ClickInfo.matbuffer, delta);
74867658 //System.out.println("DELTA2 = " + delta);
7487
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7659
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
74887660 LA.matCopy(startMat, toParent);
74897661 //System.out.println("DELTA3 = " + delta);
74907662 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7494,8 +7666,8 @@
74947666 break;
74957667
74967668 case hitRotate: // rotate
7497
- int dx = info.x - centerPt.x;
7498
- int dy = -(info.y - centerPt.y);
7669
+ int dx = clickInfo.x - centerPt.x;
7670
+ int dy = -(clickInfo.y - centerPt.y);
74997671 double angle = (double) Math.atan2(dx, dy);
75007672 angle = -(1.570796 - angle);
75017673
....@@ -7518,7 +7690,7 @@
75187690 }
75197691 /**/
75207692
7521
- switch (info.pane.RenderCamera().viewCode)
7693
+ switch (clickInfo.pane.RenderCamera().viewCode)
75227694 {
75237695 case 1: // '\001'
75247696 LA.matZRotate(toParent, angle);
....@@ -7545,7 +7717,7 @@
75457717 break;
75467718
75477719 case hitScale: // scale
7548
- double hScale = (double) (info.x - centerPt.x) / 32;
7720
+ double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32;
75497721 double sign = 1;
75507722 if (hScale < 0)
75517723 {
....@@ -7557,7 +7729,7 @@
75577729 //hScale = 0.01;
75587730 }
75597731
7560
- double vScale = (double) (info.y - centerPt.y) / 32;
7732
+ double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32;
75617733 sign = 1;
75627734 if (vScale < 0)
75637735 {
....@@ -7568,6 +7740,7 @@
75687740 {
75697741 //vScale = 0.01;
75707742 }
7743
+
75717744 LA.matCopy(startMat, toParent);
75727745 /**/
75737746 for (int i = 0; i < 3; i++)
....@@ -7577,14 +7750,14 @@
75777750 }
75787751 /**/
75797752
7580
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7753
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
75817754
75827755 if (totalScale < 0.01)
75837756 {
75847757 totalScale = 0.01;
75857758 }
75867759
7587
- switch (info.pane.RenderCamera().viewCode)
7760
+ switch (clickInfo.pane.RenderCamera().viewCode)
75887761 {
75897762 case 3: // '\001'
75907763 if (modified || opposite)
....@@ -7651,7 +7824,7 @@
76517824 } // NEW ...
76527825
76537826
7654
- info.pane.repaint();
7827
+ clickInfo.pane.repaint();
76557828 }
76567829
76577830 boolean overflow = false;
....@@ -7994,6 +8167,8 @@
79948167 transient ObjEditor editWindow;
79958168 transient ObjEditor manipWindow;
79968169
8170
+ transient boolean pinned;
8171
+
79978172 transient ObjectUI objectUI;
79988173 public static int povDepth = 0;
79998174 private static cVector tbMin = new cVector();