Normand Briere
2019-08-07 59de607850161a26863f92961d53caae7a2dabc8
Object3D.java
....@@ -22,6 +22,7 @@
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
2728 // TEMPORARY for mocap undo. No need to be transient.
....@@ -29,7 +30,10 @@
2930 Object3D saveskeleton;
3031 //
3132
32
- byte[] versions[] = new byte[100][];
33
+ String skyboxname;
34
+ String skyboxext;
35
+
36
+ Object3D versionlist[];
3337 int versionindex = -1;
3438
3539 ScriptNode scriptnode;
....@@ -219,7 +223,7 @@
219223 // o.bRep.support = null;
220224 // }
221225 o.selection = this.selection;
222
- o.versions = this.versions;
226
+ o.versionlist = this.versionlist;
223227 o.versionindex = this.versionindex;
224228
225229 if (this.support != null)
....@@ -242,6 +246,29 @@
242246 // this.support = null;
243247 // this.fileparent = null;
244248 }
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
+// }
245272
246273 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
247274 {
....@@ -277,7 +304,7 @@
277304
278305 this.selection = o.selection;
279306
280
- this.versions = o.versions;
307
+ this.versionlist = o.versionlist;
281308 this.versionindex = o.versionindex;
282309 // July 2019 if (this.bRep != null)
283310 // this.bRep.support = o.transientrep;
....@@ -426,6 +453,7 @@
426453 }
427454
428455 boolean live = false;
456
+ transient boolean keepdontselect;
429457 boolean dontselect = false;
430458 boolean hide = false;
431459 boolean link2master = false; // performs reset support/master at each frame
....@@ -1010,6 +1038,9 @@
10101038
10111039 if (material == null || material.multiply)
10121040 return true;
1041
+
1042
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1043
+ return false;
10131044
10141045 // Transparent objects are dynamic because we have to sort the triangles.
10151046 return material.opacity > 0.99;
....@@ -2437,6 +2468,7 @@
24372468 else
24382469 {
24392470 //((ObjEditor)editWindow).SetupUI2(null);
2471
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
24402472 }
24412473 }
24422474
....@@ -2566,7 +2598,8 @@
25662598 private static final int editSelf = 1;
25672599 private static final int editChild = 2;
25682600
2569
- void drawEditHandles(ClickInfo info, int level)
2601
+ void drawEditHandles(//ClickInfo info,
2602
+ int level)
25702603 {
25712604 if (level == 0)
25722605 {
....@@ -2574,7 +2607,8 @@
25742607 return;
25752608
25762609 Object3D selectee;
2577
- 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))
25782612 {
25792613 selectee = (Object3D) e.nextElement();
25802614 }
....@@ -2582,19 +2616,22 @@
25822616 } else
25832617 {
25842618 //super.
2585
- drawEditHandles0(info, level + 1);
2619
+ drawEditHandles0(//info,
2620
+ level + 1);
25862621 }
25872622 }
25882623
2589
- boolean doEditClick(ClickInfo info, int level)
2624
+ boolean doEditClick(//ClickInfo info,
2625
+ int level)
25902626 {
25912627 doSomething = 0;
25922628 if (level == 0)
25932629 {
2594
- return doParentClick(info);
2630
+ return doParentClick(); //info);
25952631 }
25962632 if (//super.
2597
- doEditClick0(info, level))
2633
+ doEditClick0(//info,
2634
+ level))
25982635 {
25992636 doSomething = 1;
26002637 return true;
....@@ -2604,7 +2641,7 @@
26042641 }
26052642 }
26062643
2607
- boolean doParentClick(ClickInfo info)
2644
+ boolean doParentClick() //ClickInfo info)
26082645 {
26092646 if (selection == null)
26102647 {
....@@ -2617,7 +2654,8 @@
26172654 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
26182655 {
26192656 Object3D selectee = (Object3D) e.nextElement();
2620
- if (selectee.doEditClick(info, 1))
2657
+ if (selectee.doEditClick(//info,
2658
+ 1))
26212659 {
26222660 childToDrag = selectee;
26232661 doSomething = 2;
....@@ -2629,13 +2667,15 @@
26292667 return retval;
26302668 }
26312669
2632
- void doEditDrag(ClickInfo info, boolean opposite)
2670
+ void doEditDrag(//ClickInfo clickInfo,
2671
+ boolean opposite)
26332672 {
26342673 switch (doSomething)
26352674 {
26362675 case 1: // '\001'
26372676 //super.
2638
- doEditDrag0(info, opposite);
2677
+ doEditDrag0(//clickInfo,
2678
+ opposite);
26392679 break;
26402680
26412681 case 2: // '\002'
....@@ -2648,11 +2688,13 @@
26482688 {
26492689 //sel.hitSomething = childToDrag.hitSomething;
26502690 //childToDrag.doEditDrag(info);
2651
- sel.doEditDrag(info, opposite);
2691
+ sel.doEditDrag(//clickInfo,
2692
+ opposite);
26522693 } else
26532694 {
26542695 //super.
2655
- doEditDrag0(info, opposite);
2696
+ doEditDrag0(//clickInfo,
2697
+ opposite);
26562698 }
26572699 }
26582700 break;
....@@ -2670,6 +2712,9 @@
26702712 {
26712713 deselectAll();
26722714 }
2715
+
2716
+ new Exception().printStackTrace();
2717
+
26732718 ClickInfo newInfo = new ClickInfo();
26742719 newInfo.flags = info.flags;
26752720 newInfo.bounds = info.bounds;
....@@ -3117,7 +3162,7 @@
31173162 {
31183163 if (bRep != null)
31193164 {
3120
- bRep.GenerateNormalsMINE();
3165
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
31213166 Touch();
31223167 }
31233168 }
....@@ -5420,6 +5465,51 @@
54205465 blockloop = false;
54215466 }
54225467
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
+
54235513 boolean IsSelected()
54245514 {
54255515 if (parent == null)
....@@ -5729,6 +5819,38 @@
57295819 }
57305820 }
57315821
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
+
57325854 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57335855 {
57345856 Draw(display, root, selected, blocked);
....@@ -5815,8 +5937,10 @@
58155937 if (support != null)
58165938 support = support;
58175939
5818
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5819
- boolean usecalllists = !IsLive(); // 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.
58205944
58215945 if (!usecalllists && bRep != null && bRep.displaylist > 0)
58225946 {
....@@ -5826,8 +5950,9 @@
58265950 // usecalllists &= !(parent instanceof RandomNode);
58275951 // usecalllists = false;
58285952
5829
- if (GetBRep() != null)
5830
- usecalllists = usecalllists;
5953
+ if (display.DrawMode() == display.SHADOW)
5954
+ //GetBRep() != null)
5955
+ usecalllists = !!usecalllists;
58315956 //System.out.println("draw " + this);
58325957 //new Exception().printStackTrace();
58335958
....@@ -5849,7 +5974,7 @@
58495974 if (!(this instanceof Composite))
58505975 touched = false;
58515976 //if (displaylist == -1 && usecalllists)
5852
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5977
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
58535978 {
58545979 bRep.displaylist = display.GenList();
58555980 assert(bRep.displaylist != 0);
....@@ -5860,7 +5985,7 @@
58605985
58615986 //System.out.println("\tnew list " + list);
58625987 //gl.glDrawBuffer(gl.GL_NONE);
5863
- if (usecalllists)
5988
+ if (usecalllists && bRep.displaylist > 0)
58645989 {
58655990 // System.err.println("new list " + bRep.displaylist + " for " + this);
58665991 display.NewList(bRep.displaylist);
....@@ -5869,7 +5994,7 @@
58695994 CallList(display, root, selected, blocked);
58705995
58715996 // compiled = true;
5872
- if (usecalllists)
5997
+ if (usecalllists && bRep.displaylist > 0)
58735998 {
58745999 // System.err.println("end list " + bRep.displaylist + " for " + this);
58756000 display.EndList();
....@@ -7220,20 +7345,23 @@
72207345 }
72217346 }
72227347
7223
- 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)
72247352 {
7225
- int hc = info.bounds.x + info.bounds.width / 2;
7226
- int vc = info.bounds.y + info.bounds.height / 2;
7227
- 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;
72287356 if (toscreen == null)
72297357 {
7230
- toscreen = new Camera(info.camera.viewCode).toScreen;
7358
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
72317359 }
72327360 cVector vec = in;
72337361 LA.xformPos(in, toscreen, in);
72347362 //System.out.println("Distance = " + info.camera.Distance());
7235
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
7236
- 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();
72377365 outPt.x = hc + (int) vec.x;
72387366 outPt.y = vc - (int) vec.y;
72397367 outRec.x = outPt.x - 3;
....@@ -7241,15 +7369,18 @@
72417369 outRec.width = outRec.height = 6;
72427370 }
72437371
7244
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7372
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7373
+ )
72457374 {
72467375 Point pt = new Point(0, 0);
72477376 Rectangle rec = new Rectangle();
7248
- calcHotSpot(in, info, pt, rec);
7377
+ calcHotSpot(in, //clickInfo,
7378
+ pt, rec);
72497379 return rec;
72507380 }
72517381
7252
- void drawEditHandles0(ClickInfo info, int level)
7382
+ void drawEditHandles0(//ClickInfo clickInfo,
7383
+ int level)
72537384 {
72547385 if (level == 0)
72557386 {
....@@ -7258,16 +7389,19 @@
72587389 {
72597390 cVector origin = new cVector();
72607391 //LA.xformPos(origin, toParent, origin);
7261
- Rectangle spot = calcHotSpot(origin, info);
7392
+ if (this.clickInfo == null)
7393
+ this.clickInfo = new ClickInfo();
7394
+
7395
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
72627396 Rectangle boundary = new Rectangle();
72637397 boundary.x = spot.x - 30;
72647398 boundary.y = spot.y - 30;
72657399 boundary.width = spot.width + 60;
72667400 boundary.height = spot.height + 60;
7267
- info.g.setColor(Color.red);
7401
+ clickInfo.g.setColor(Color.red);
72687402 int spotw = spot.x + spot.width;
72697403 int spoth = spot.y + spot.height;
7270
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7404
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72717405 // if (CameraPane.Xmin > spot.x)
72727406 // {
72737407 // CameraPane.Xmin = spot.x;
....@@ -7287,8 +7421,8 @@
72877421 spot.translate(32, 32);
72887422 spotw = spot.x + spot.width;
72897423 spoth = spot.y + spot.height;
7290
- info.g.setColor(Color.cyan);
7291
- 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);
72927426 // if (CameraPane.Xmin > spot.x)
72937427 // {
72947428 // CameraPane.Xmin = spot.x;
....@@ -7308,9 +7442,9 @@
73087442 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
73097443 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
73107444 spot.translate(0, -32);
7311
- info.g.setColor(Color.yellow);
7312
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7313
- info.g.setColor(Color.green);
7445
+ clickInfo.g.setColor(Color.yellow);
7446
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7447
+ clickInfo.g.setColor(Color.green);
73147448 // if (CameraPane.Xmin > spot.x)
73157449 // {
73167450 // CameraPane.Xmin = spot.x;
....@@ -7327,8 +7461,8 @@
73277461 // {
73287462 // CameraPane.Ymax = spoth;
73297463 // }
7330
- info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY,
7331
- (int)(boundary.width * info.W), (int)(boundary.height * info.W), 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);
73327466 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
73337467 // if (CameraPane.Xmin > boundary.x)
73347468 // {
....@@ -7350,7 +7484,8 @@
73507484 }
73517485 }
73527486
7353
- boolean doEditClick0(ClickInfo info, int level)
7487
+ boolean doEditClick0(//ClickInfo clickInfo,
7488
+ int level)
73547489 {
73557490 if (level == 0)
73567491 {
....@@ -7359,8 +7494,8 @@
73597494
73607495 boolean retval = false;
73617496
7362
- startX = info.x;
7363
- startY = info.y;
7497
+ startX = clickInfo.x;
7498
+ startY = clickInfo.y;
73647499
73657500 hitSomething = -1;
73667501 cVector origin = new cVector();
....@@ -7370,22 +7505,51 @@
73707505 {
73717506 centerPt = new Point(0, 0);
73727507 }
7373
- calcHotSpot(origin, info, centerPt, spot);
7374
- if (spot.contains(info.x, info.y))
7508
+ calcHotSpot(origin, //info,
7509
+ centerPt, spot);
7510
+ if (spot.contains(clickInfo.x, clickInfo.y))
73757511 {
73767512 hitSomething = hitCenter;
73777513 retval = true;
73787514 }
73797515 spot.translate(32, 0);
7380
- if (spot.contains(info.x, info.y))
7516
+ if (spot.contains(clickInfo.x, clickInfo.y))
73817517 {
73827518 hitSomething = hitRotate;
73837519 retval = true;
73847520 }
73857521 spot.translate(0, 32);
7386
- if (spot.contains(info.x, info.y))
7522
+ if (spot.contains(clickInfo.x, clickInfo.y))
73877523 {
73887524 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
+
73897553 retval = true;
73907554 }
73917555
....@@ -7395,7 +7559,7 @@
73957559 }
73967560
73977561 //System.out.println("info.modifiers = " + info.modifiers);
7398
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7562
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
73997563 //System.out.println("modified = " + modified);
74007564 //new Exception().printStackTrace();
74017565 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7423,7 +7587,8 @@
74237587 return true;
74247588 }
74257589
7426
- void doEditDrag0(ClickInfo info, boolean opposite)
7590
+ void doEditDrag0(//ClickInfo info,
7591
+ boolean opposite)
74277592 {
74287593 if (hitSomething == 0)
74297594 {
....@@ -7437,7 +7602,7 @@
74377602
74387603 //System.out.println("hitSomething = " + hitSomething);
74397604
7440
- double scale = 0.005f * info.camera.Distance();
7605
+ double scale = 0.005f * clickInfo.camera.Distance();
74417606
74427607 cVector xlate = new cVector();
74437608 //cVector xlate2 = new cVector();
....@@ -7471,8 +7636,8 @@
74717636 toParent[3][i] = xlate.get(i);
74727637 LA.matInvert(toParent, fromParent);
74737638 */
7474
- cVector delta = LA.newVector(0, 0, startY - info.y);
7475
- 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);
74767641
74777642 LA.matCopy(startMat, toParent);
74787643 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7481,7 +7646,7 @@
74817646 } else
74827647 {
74837648 //LA.xformDir(delta, info.camera.fromScreen, delta);
7484
- cVector up = new cVector(info.camera.up);
7649
+ cVector up = new cVector(clickInfo.camera.up);
74857650 cVector away = new cVector();
74867651 //cVector right2 = new cVector();
74877652 //LA.vecCross(up, cVector.Z, right);
....@@ -7498,19 +7663,19 @@
74987663 LA.xformDir(up, ClickInfo.matbuffer, up);
74997664 // if (!CameraPane.LOCALTRANSFORM)
75007665 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7501
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7666
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
75027667 // if (!CameraPane.LOCALTRANSFORM)
75037668 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
75047669 //LA.vecCross(up, cVector.Z, right2);
75057670
7506
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7671
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
75077672
75087673 //System.out.println("DELTA0 = " + delta);
75097674 //System.out.println("AWAY = " + info.camera.away);
75107675 //System.out.println("UP = " + info.camera.up);
75117676 if (away.z > 0)
75127677 {
7513
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7678
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
75147679 {
75157680 delta.x = -delta.x;
75167681 } else
....@@ -7525,7 +7690,7 @@
75257690 //System.out.println("DELTA1 = " + delta);
75267691 LA.xformDir(delta, ClickInfo.matbuffer, delta);
75277692 //System.out.println("DELTA2 = " + delta);
7528
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7693
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
75297694 LA.matCopy(startMat, toParent);
75307695 //System.out.println("DELTA3 = " + delta);
75317696 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7535,8 +7700,8 @@
75357700 break;
75367701
75377702 case hitRotate: // rotate
7538
- int dx = info.x - centerPt.x;
7539
- int dy = -(info.y - centerPt.y);
7703
+ int dx = clickInfo.x - centerPt.x;
7704
+ int dy = -(clickInfo.y - centerPt.y);
75407705 double angle = (double) Math.atan2(dx, dy);
75417706 angle = -(1.570796 - angle);
75427707
....@@ -7559,7 +7724,7 @@
75597724 }
75607725 /**/
75617726
7562
- switch (info.pane.RenderCamera().viewCode)
7727
+ switch (clickInfo.pane.RenderCamera().viewCode)
75637728 {
75647729 case 1: // '\001'
75657730 LA.matZRotate(toParent, angle);
....@@ -7586,7 +7751,7 @@
75867751 break;
75877752
75887753 case hitScale: // scale
7589
- double hScale = (double) (info.x - centerPt.x) / 32;
7754
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
75907755 double sign = 1;
75917756 if (hScale < 0)
75927757 {
....@@ -7598,7 +7763,7 @@
75987763 //hScale = 0.01;
75997764 }
76007765
7601
- double vScale = (double) (info.y - centerPt.y) / 32;
7766
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
76027767 sign = 1;
76037768 if (vScale < 0)
76047769 {
....@@ -7609,6 +7774,7 @@
76097774 {
76107775 //vScale = 0.01;
76117776 }
7777
+
76127778 LA.matCopy(startMat, toParent);
76137779 /**/
76147780 for (int i = 0; i < 3; i++)
....@@ -7618,14 +7784,14 @@
76187784 }
76197785 /**/
76207786
7621
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7787
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
76227788
76237789 if (totalScale < 0.01)
76247790 {
76257791 totalScale = 0.01;
76267792 }
76277793
7628
- switch (info.pane.RenderCamera().viewCode)
7794
+ switch (clickInfo.pane.RenderCamera().viewCode)
76297795 {
76307796 case 3: // '\001'
76317797 if (modified || opposite)
....@@ -7692,7 +7858,7 @@
76927858 } // NEW ...
76937859
76947860
7695
- info.pane.repaint();
7861
+ clickInfo.pane.repaint();
76967862 }
76977863
76987864 boolean overflow = false;