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,6 +223,8 @@
219223 // o.bRep.support = null;
220224 // }
221225 o.selection = this.selection;
226
+ o.versionlist = this.versionlist;
227
+ o.versionindex = this.versionindex;
222228
223229 if (this.support != null)
224230 {
....@@ -240,6 +246,29 @@
240246 // this.support = null;
241247 // this.fileparent = null;
242248 }
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
+// }
243272
244273 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
245274 {
....@@ -274,6 +303,9 @@
274303 }
275304
276305 this.selection = o.selection;
306
+
307
+ this.versionlist = o.versionlist;
308
+ this.versionindex = o.versionindex;
277309 // July 2019 if (this.bRep != null)
278310 // this.bRep.support = o.transientrep;
279311 // this.support = o.support;
....@@ -421,6 +453,7 @@
421453 }
422454
423455 boolean live = false;
456
+ transient boolean keepdontselect;
424457 boolean dontselect = false;
425458 boolean hide = false;
426459 boolean link2master = false; // performs reset support/master at each frame
....@@ -1005,6 +1038,9 @@
10051038
10061039 if (material == null || material.multiply)
10071040 return true;
1041
+
1042
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1043
+ return false;
10081044
10091045 // Transparent objects are dynamic because we have to sort the triangles.
10101046 return material.opacity > 0.99;
....@@ -2432,6 +2468,7 @@
24322468 else
24332469 {
24342470 //((ObjEditor)editWindow).SetupUI2(null);
2471
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
24352472 }
24362473 }
24372474
....@@ -2561,7 +2598,8 @@
25612598 private static final int editSelf = 1;
25622599 private static final int editChild = 2;
25632600
2564
- void drawEditHandles(ClickInfo info, int level)
2601
+ void drawEditHandles(//ClickInfo info,
2602
+ int level)
25652603 {
25662604 if (level == 0)
25672605 {
....@@ -2569,7 +2607,8 @@
25692607 return;
25702608
25712609 Object3D selectee;
2572
- 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))
25732612 {
25742613 selectee = (Object3D) e.nextElement();
25752614 }
....@@ -2577,19 +2616,22 @@
25772616 } else
25782617 {
25792618 //super.
2580
- drawEditHandles0(info, level + 1);
2619
+ drawEditHandles0(//info,
2620
+ level + 1);
25812621 }
25822622 }
25832623
2584
- boolean doEditClick(ClickInfo info, int level)
2624
+ boolean doEditClick(//ClickInfo info,
2625
+ int level)
25852626 {
25862627 doSomething = 0;
25872628 if (level == 0)
25882629 {
2589
- return doParentClick(info);
2630
+ return doParentClick(); //info);
25902631 }
25912632 if (//super.
2592
- doEditClick0(info, level))
2633
+ doEditClick0(//info,
2634
+ level))
25932635 {
25942636 doSomething = 1;
25952637 return true;
....@@ -2599,7 +2641,7 @@
25992641 }
26002642 }
26012643
2602
- boolean doParentClick(ClickInfo info)
2644
+ boolean doParentClick() //ClickInfo info)
26032645 {
26042646 if (selection == null)
26052647 {
....@@ -2612,7 +2654,8 @@
26122654 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
26132655 {
26142656 Object3D selectee = (Object3D) e.nextElement();
2615
- if (selectee.doEditClick(info, 1))
2657
+ if (selectee.doEditClick(//info,
2658
+ 1))
26162659 {
26172660 childToDrag = selectee;
26182661 doSomething = 2;
....@@ -2624,13 +2667,15 @@
26242667 return retval;
26252668 }
26262669
2627
- void doEditDrag(ClickInfo info, boolean opposite)
2670
+ void doEditDrag(//ClickInfo clickInfo,
2671
+ boolean opposite)
26282672 {
26292673 switch (doSomething)
26302674 {
26312675 case 1: // '\001'
26322676 //super.
2633
- doEditDrag0(info, opposite);
2677
+ doEditDrag0(//clickInfo,
2678
+ opposite);
26342679 break;
26352680
26362681 case 2: // '\002'
....@@ -2643,11 +2688,13 @@
26432688 {
26442689 //sel.hitSomething = childToDrag.hitSomething;
26452690 //childToDrag.doEditDrag(info);
2646
- sel.doEditDrag(info, opposite);
2691
+ sel.doEditDrag(//clickInfo,
2692
+ opposite);
26472693 } else
26482694 {
26492695 //super.
2650
- doEditDrag0(info, opposite);
2696
+ doEditDrag0(//clickInfo,
2697
+ opposite);
26512698 }
26522699 }
26532700 break;
....@@ -2665,6 +2712,9 @@
26652712 {
26662713 deselectAll();
26672714 }
2715
+
2716
+ new Exception().printStackTrace();
2717
+
26682718 ClickInfo newInfo = new ClickInfo();
26692719 newInfo.flags = info.flags;
26702720 newInfo.bounds = info.bounds;
....@@ -3112,7 +3162,7 @@
31123162 {
31133163 if (bRep != null)
31143164 {
3115
- bRep.GenerateNormalsMINE();
3165
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
31163166 Touch();
31173167 }
31183168 }
....@@ -5415,6 +5465,51 @@
54155465 blockloop = false;
54165466 }
54175467
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
+
54185513 boolean IsSelected()
54195514 {
54205515 if (parent == null)
....@@ -5724,6 +5819,38 @@
57245819 }
57255820 }
57265821
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
+
57275854 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57285855 {
57295856 Draw(display, root, selected, blocked);
....@@ -5810,8 +5937,10 @@
58105937 if (support != null)
58115938 support = support;
58125939
5813
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5814
- 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.
58155944
58165945 if (!usecalllists && bRep != null && bRep.displaylist > 0)
58175946 {
....@@ -5821,8 +5950,9 @@
58215950 // usecalllists &= !(parent instanceof RandomNode);
58225951 // usecalllists = false;
58235952
5824
- if (GetBRep() != null)
5825
- usecalllists = usecalllists;
5953
+ if (display.DrawMode() == display.SHADOW)
5954
+ //GetBRep() != null)
5955
+ usecalllists = !!usecalllists;
58265956 //System.out.println("draw " + this);
58275957 //new Exception().printStackTrace();
58285958
....@@ -5844,7 +5974,7 @@
58445974 if (!(this instanceof Composite))
58455975 touched = false;
58465976 //if (displaylist == -1 && usecalllists)
5847
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5977
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
58485978 {
58495979 bRep.displaylist = display.GenList();
58505980 assert(bRep.displaylist != 0);
....@@ -5855,7 +5985,7 @@
58555985
58565986 //System.out.println("\tnew list " + list);
58575987 //gl.glDrawBuffer(gl.GL_NONE);
5858
- if (usecalllists)
5988
+ if (usecalllists && bRep.displaylist > 0)
58595989 {
58605990 // System.err.println("new list " + bRep.displaylist + " for " + this);
58615991 display.NewList(bRep.displaylist);
....@@ -5864,7 +5994,7 @@
58645994 CallList(display, root, selected, blocked);
58655995
58665996 // compiled = true;
5867
- if (usecalllists)
5997
+ if (usecalllists && bRep.displaylist > 0)
58685998 {
58695999 // System.err.println("end list " + bRep.displaylist + " for " + this);
58706000 display.EndList();
....@@ -7215,20 +7345,23 @@
72157345 }
72167346 }
72177347
7218
- 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)
72197352 {
7220
- int hc = info.bounds.x + info.bounds.width / 2;
7221
- int vc = info.bounds.y + info.bounds.height / 2;
7222
- 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;
72237356 if (toscreen == null)
72247357 {
7225
- toscreen = new Camera(info.camera.viewCode).toScreen;
7358
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
72267359 }
72277360 cVector vec = in;
72287361 LA.xformPos(in, toscreen, in);
72297362 //System.out.println("Distance = " + info.camera.Distance());
7230
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
7231
- 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();
72327365 outPt.x = hc + (int) vec.x;
72337366 outPt.y = vc - (int) vec.y;
72347367 outRec.x = outPt.x - 3;
....@@ -7236,15 +7369,18 @@
72367369 outRec.width = outRec.height = 6;
72377370 }
72387371
7239
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7372
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7373
+ )
72407374 {
72417375 Point pt = new Point(0, 0);
72427376 Rectangle rec = new Rectangle();
7243
- calcHotSpot(in, info, pt, rec);
7377
+ calcHotSpot(in, //clickInfo,
7378
+ pt, rec);
72447379 return rec;
72457380 }
72467381
7247
- void drawEditHandles0(ClickInfo info, int level)
7382
+ void drawEditHandles0(//ClickInfo clickInfo,
7383
+ int level)
72487384 {
72497385 if (level == 0)
72507386 {
....@@ -7253,16 +7389,19 @@
72537389 {
72547390 cVector origin = new cVector();
72557391 //LA.xformPos(origin, toParent, origin);
7256
- Rectangle spot = calcHotSpot(origin, info);
7392
+ if (this.clickInfo == null)
7393
+ this.clickInfo = new ClickInfo();
7394
+
7395
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
72577396 Rectangle boundary = new Rectangle();
72587397 boundary.x = spot.x - 30;
72597398 boundary.y = spot.y - 30;
72607399 boundary.width = spot.width + 60;
72617400 boundary.height = spot.height + 60;
7262
- info.g.setColor(Color.red);
7401
+ clickInfo.g.setColor(Color.red);
72637402 int spotw = spot.x + spot.width;
72647403 int spoth = spot.y + spot.height;
7265
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7404
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72667405 // if (CameraPane.Xmin > spot.x)
72677406 // {
72687407 // CameraPane.Xmin = spot.x;
....@@ -7282,8 +7421,8 @@
72827421 spot.translate(32, 32);
72837422 spotw = spot.x + spot.width;
72847423 spoth = spot.y + spot.height;
7285
- info.g.setColor(Color.cyan);
7286
- 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);
72877426 // if (CameraPane.Xmin > spot.x)
72887427 // {
72897428 // CameraPane.Xmin = spot.x;
....@@ -7303,9 +7442,9 @@
73037442 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
73047443 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
73057444 spot.translate(0, -32);
7306
- info.g.setColor(Color.yellow);
7307
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7308
- 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);
73097448 // if (CameraPane.Xmin > spot.x)
73107449 // {
73117450 // CameraPane.Xmin = spot.x;
....@@ -7322,8 +7461,8 @@
73227461 // {
73237462 // CameraPane.Ymax = spoth;
73247463 // }
7325
- info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY,
7326
- (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);
73277466 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
73287467 // if (CameraPane.Xmin > boundary.x)
73297468 // {
....@@ -7345,7 +7484,8 @@
73457484 }
73467485 }
73477486
7348
- boolean doEditClick0(ClickInfo info, int level)
7487
+ boolean doEditClick0(//ClickInfo clickInfo,
7488
+ int level)
73497489 {
73507490 if (level == 0)
73517491 {
....@@ -7354,8 +7494,8 @@
73547494
73557495 boolean retval = false;
73567496
7357
- startX = info.x;
7358
- startY = info.y;
7497
+ startX = clickInfo.x;
7498
+ startY = clickInfo.y;
73597499
73607500 hitSomething = -1;
73617501 cVector origin = new cVector();
....@@ -7365,22 +7505,51 @@
73657505 {
73667506 centerPt = new Point(0, 0);
73677507 }
7368
- calcHotSpot(origin, info, centerPt, spot);
7369
- if (spot.contains(info.x, info.y))
7508
+ calcHotSpot(origin, //info,
7509
+ centerPt, spot);
7510
+ if (spot.contains(clickInfo.x, clickInfo.y))
73707511 {
73717512 hitSomething = hitCenter;
73727513 retval = true;
73737514 }
73747515 spot.translate(32, 0);
7375
- if (spot.contains(info.x, info.y))
7516
+ if (spot.contains(clickInfo.x, clickInfo.y))
73767517 {
73777518 hitSomething = hitRotate;
73787519 retval = true;
73797520 }
73807521 spot.translate(0, 32);
7381
- if (spot.contains(info.x, info.y))
7522
+ if (spot.contains(clickInfo.x, clickInfo.y))
73827523 {
73837524 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
+
73847553 retval = true;
73857554 }
73867555
....@@ -7390,7 +7559,7 @@
73907559 }
73917560
73927561 //System.out.println("info.modifiers = " + info.modifiers);
7393
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7562
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
73947563 //System.out.println("modified = " + modified);
73957564 //new Exception().printStackTrace();
73967565 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7418,7 +7587,8 @@
74187587 return true;
74197588 }
74207589
7421
- void doEditDrag0(ClickInfo info, boolean opposite)
7590
+ void doEditDrag0(//ClickInfo info,
7591
+ boolean opposite)
74227592 {
74237593 if (hitSomething == 0)
74247594 {
....@@ -7432,7 +7602,7 @@
74327602
74337603 //System.out.println("hitSomething = " + hitSomething);
74347604
7435
- double scale = 0.005f * info.camera.Distance();
7605
+ double scale = 0.005f * clickInfo.camera.Distance();
74367606
74377607 cVector xlate = new cVector();
74387608 //cVector xlate2 = new cVector();
....@@ -7466,8 +7636,8 @@
74667636 toParent[3][i] = xlate.get(i);
74677637 LA.matInvert(toParent, fromParent);
74687638 */
7469
- cVector delta = LA.newVector(0, 0, startY - info.y);
7470
- 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);
74717641
74727642 LA.matCopy(startMat, toParent);
74737643 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7476,7 +7646,7 @@
74767646 } else
74777647 {
74787648 //LA.xformDir(delta, info.camera.fromScreen, delta);
7479
- cVector up = new cVector(info.camera.up);
7649
+ cVector up = new cVector(clickInfo.camera.up);
74807650 cVector away = new cVector();
74817651 //cVector right2 = new cVector();
74827652 //LA.vecCross(up, cVector.Z, right);
....@@ -7493,19 +7663,19 @@
74937663 LA.xformDir(up, ClickInfo.matbuffer, up);
74947664 // if (!CameraPane.LOCALTRANSFORM)
74957665 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7496
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7666
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
74977667 // if (!CameraPane.LOCALTRANSFORM)
74987668 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
74997669 //LA.vecCross(up, cVector.Z, right2);
75007670
7501
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7671
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
75027672
75037673 //System.out.println("DELTA0 = " + delta);
75047674 //System.out.println("AWAY = " + info.camera.away);
75057675 //System.out.println("UP = " + info.camera.up);
75067676 if (away.z > 0)
75077677 {
7508
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7678
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
75097679 {
75107680 delta.x = -delta.x;
75117681 } else
....@@ -7520,7 +7690,7 @@
75207690 //System.out.println("DELTA1 = " + delta);
75217691 LA.xformDir(delta, ClickInfo.matbuffer, delta);
75227692 //System.out.println("DELTA2 = " + delta);
7523
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7693
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
75247694 LA.matCopy(startMat, toParent);
75257695 //System.out.println("DELTA3 = " + delta);
75267696 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7530,8 +7700,8 @@
75307700 break;
75317701
75327702 case hitRotate: // rotate
7533
- int dx = info.x - centerPt.x;
7534
- int dy = -(info.y - centerPt.y);
7703
+ int dx = clickInfo.x - centerPt.x;
7704
+ int dy = -(clickInfo.y - centerPt.y);
75357705 double angle = (double) Math.atan2(dx, dy);
75367706 angle = -(1.570796 - angle);
75377707
....@@ -7554,7 +7724,7 @@
75547724 }
75557725 /**/
75567726
7557
- switch (info.pane.RenderCamera().viewCode)
7727
+ switch (clickInfo.pane.RenderCamera().viewCode)
75587728 {
75597729 case 1: // '\001'
75607730 LA.matZRotate(toParent, angle);
....@@ -7581,7 +7751,7 @@
75817751 break;
75827752
75837753 case hitScale: // scale
7584
- double hScale = (double) (info.x - centerPt.x) / 32;
7754
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
75857755 double sign = 1;
75867756 if (hScale < 0)
75877757 {
....@@ -7593,7 +7763,7 @@
75937763 //hScale = 0.01;
75947764 }
75957765
7596
- double vScale = (double) (info.y - centerPt.y) / 32;
7766
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75977767 sign = 1;
75987768 if (vScale < 0)
75997769 {
....@@ -7604,6 +7774,7 @@
76047774 {
76057775 //vScale = 0.01;
76067776 }
7777
+
76077778 LA.matCopy(startMat, toParent);
76087779 /**/
76097780 for (int i = 0; i < 3; i++)
....@@ -7613,14 +7784,14 @@
76137784 }
76147785 /**/
76157786
7616
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7787
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
76177788
76187789 if (totalScale < 0.01)
76197790 {
76207791 totalScale = 0.01;
76217792 }
76227793
7623
- switch (info.pane.RenderCamera().viewCode)
7794
+ switch (clickInfo.pane.RenderCamera().viewCode)
76247795 {
76257796 case 3: // '\001'
76267797 if (modified || opposite)
....@@ -7687,7 +7858,7 @@
76877858 } // NEW ...
76887859
76897860
7690
- info.pane.repaint();
7861
+ clickInfo.pane.repaint();
76917862 }
76927863
76937864 boolean overflow = false;