Normand Briere
2019-08-13 0cdf3fb57ddea3226f094ba45c836c7e9b123e3a
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,11 @@
24322468 else
24332469 {
24342470 //((ObjEditor)editWindow).SetupUI2(null);
2471
+ if (objectUI != null)
2472
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
2473
+ else
2474
+ //new Exception().printStackTrace();
2475
+ System.err.println("objectUI is null");
24352476 }
24362477 }
24372478
....@@ -2561,7 +2602,8 @@
25612602 private static final int editSelf = 1;
25622603 private static final int editChild = 2;
25632604
2564
- void drawEditHandles(ClickInfo info, int level)
2605
+ void drawEditHandles(//ClickInfo info,
2606
+ int level)
25652607 {
25662608 if (level == 0)
25672609 {
....@@ -2569,7 +2611,8 @@
25692611 return;
25702612
25712613 Object3D selectee;
2572
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2614
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2615
+ level + 1))
25732616 {
25742617 selectee = (Object3D) e.nextElement();
25752618 }
....@@ -2577,19 +2620,22 @@
25772620 } else
25782621 {
25792622 //super.
2580
- drawEditHandles0(info, level + 1);
2623
+ drawEditHandles0(//info,
2624
+ level + 1);
25812625 }
25822626 }
25832627
2584
- boolean doEditClick(ClickInfo info, int level)
2628
+ boolean doEditClick(//ClickInfo info,
2629
+ int level)
25852630 {
25862631 doSomething = 0;
25872632 if (level == 0)
25882633 {
2589
- return doParentClick(info);
2634
+ return doParentClick(); //info);
25902635 }
25912636 if (//super.
2592
- doEditClick0(info, level))
2637
+ doEditClick0(//info,
2638
+ level))
25932639 {
25942640 doSomething = 1;
25952641 return true;
....@@ -2599,7 +2645,7 @@
25992645 }
26002646 }
26012647
2602
- boolean doParentClick(ClickInfo info)
2648
+ boolean doParentClick() //ClickInfo info)
26032649 {
26042650 if (selection == null)
26052651 {
....@@ -2612,7 +2658,8 @@
26122658 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
26132659 {
26142660 Object3D selectee = (Object3D) e.nextElement();
2615
- if (selectee.doEditClick(info, 1))
2661
+ if (selectee.doEditClick(//info,
2662
+ 1))
26162663 {
26172664 childToDrag = selectee;
26182665 doSomething = 2;
....@@ -2624,13 +2671,15 @@
26242671 return retval;
26252672 }
26262673
2627
- void doEditDrag(ClickInfo info, boolean opposite)
2674
+ void doEditDrag(//ClickInfo clickInfo,
2675
+ boolean opposite)
26282676 {
26292677 switch (doSomething)
26302678 {
26312679 case 1: // '\001'
26322680 //super.
2633
- doEditDrag0(info, opposite);
2681
+ doEditDrag0(//clickInfo,
2682
+ opposite);
26342683 break;
26352684
26362685 case 2: // '\002'
....@@ -2643,11 +2692,13 @@
26432692 {
26442693 //sel.hitSomething = childToDrag.hitSomething;
26452694 //childToDrag.doEditDrag(info);
2646
- sel.doEditDrag(info, opposite);
2695
+ sel.doEditDrag(//clickInfo,
2696
+ opposite);
26472697 } else
26482698 {
26492699 //super.
2650
- doEditDrag0(info, opposite);
2700
+ doEditDrag0(//clickInfo,
2701
+ opposite);
26512702 }
26522703 }
26532704 break;
....@@ -2665,6 +2716,9 @@
26652716 {
26662717 deselectAll();
26672718 }
2719
+
2720
+ new Exception().printStackTrace();
2721
+
26682722 ClickInfo newInfo = new ClickInfo();
26692723 newInfo.flags = info.flags;
26702724 newInfo.bounds = info.bounds;
....@@ -3112,7 +3166,7 @@
31123166 {
31133167 if (bRep != null)
31143168 {
3115
- bRep.GenerateNormalsMINE();
3169
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
31163170 Touch();
31173171 }
31183172 }
....@@ -5415,6 +5469,51 @@
54155469 blockloop = false;
54165470 }
54175471
5472
+ void ResetSelectable()
5473
+ {
5474
+ if (blockloop)
5475
+ return;
5476
+
5477
+ blockloop = true;
5478
+
5479
+ keepdontselect = dontselect;
5480
+ dontselect = true;
5481
+
5482
+ Object3D child;
5483
+ int nb = Size();
5484
+ for (int i = 0; i < nb; i++)
5485
+ {
5486
+ child = (Object3D) get(i);
5487
+ if (child == null)
5488
+ continue;
5489
+ child.ResetSelectable();
5490
+ }
5491
+
5492
+ blockloop = false;
5493
+ }
5494
+
5495
+ void RestoreSelectable()
5496
+ {
5497
+ if (blockloop)
5498
+ return;
5499
+
5500
+ blockloop = true;
5501
+
5502
+ dontselect = keepdontselect;
5503
+
5504
+ Object3D child;
5505
+ int nb = Size();
5506
+ for (int i = 0; i < nb; i++)
5507
+ {
5508
+ child = (Object3D) get(i);
5509
+ if (child == null)
5510
+ continue;
5511
+ child.RestoreSelectable();
5512
+ }
5513
+
5514
+ blockloop = false;
5515
+ }
5516
+
54185517 boolean IsSelected()
54195518 {
54205519 if (parent == null)
....@@ -5724,6 +5823,38 @@
57245823 }
57255824 }
57265825
5826
+ void EmbedTextures(boolean embed)
5827
+ {
5828
+ if (blockloop)
5829
+ return;
5830
+
5831
+ //if (GetTextures() != null)
5832
+ if (embed)
5833
+ CameraPane.EmbedTextures(GetTextures());
5834
+ else
5835
+ {
5836
+ GetTextures().pigmentdata = null;
5837
+ GetTextures().bumpdata = null;
5838
+ GetTextures().pw = 0;
5839
+ GetTextures().ph = 0;
5840
+ GetTextures().bw = 0;
5841
+ GetTextures().bh = 0;
5842
+ }
5843
+
5844
+ int nb = Size();
5845
+ for (int i = 0; i < nb; i++)
5846
+ {
5847
+ Object3D child = (Object3D) get(i);
5848
+
5849
+ if (child == null)
5850
+ continue;
5851
+
5852
+ blockloop = true;
5853
+ child.EmbedTextures(embed);
5854
+ blockloop = false;
5855
+ }
5856
+ }
5857
+
57275858 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57285859 {
57295860 Draw(display, root, selected, blocked);
....@@ -5810,8 +5941,10 @@
58105941 if (support != null)
58115942 support = support;
58125943
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);
5944
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5945
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5946
+
5947
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
58155948
58165949 if (!usecalllists && bRep != null && bRep.displaylist > 0)
58175950 {
....@@ -5821,8 +5954,9 @@
58215954 // usecalllists &= !(parent instanceof RandomNode);
58225955 // usecalllists = false;
58235956
5824
- if (GetBRep() != null)
5825
- usecalllists = usecalllists;
5957
+ if (display.DrawMode() == display.SHADOW)
5958
+ //GetBRep() != null)
5959
+ usecalllists = !!usecalllists;
58265960 //System.out.println("draw " + this);
58275961 //new Exception().printStackTrace();
58285962
....@@ -5844,7 +5978,7 @@
58445978 if (!(this instanceof Composite))
58455979 touched = false;
58465980 //if (displaylist == -1 && usecalllists)
5847
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5981
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
58485982 {
58495983 bRep.displaylist = display.GenList();
58505984 assert(bRep.displaylist != 0);
....@@ -5855,7 +5989,7 @@
58555989
58565990 //System.out.println("\tnew list " + list);
58575991 //gl.glDrawBuffer(gl.GL_NONE);
5858
- if (usecalllists)
5992
+ if (usecalllists && bRep.displaylist > 0)
58595993 {
58605994 // System.err.println("new list " + bRep.displaylist + " for " + this);
58615995 display.NewList(bRep.displaylist);
....@@ -5864,7 +5998,7 @@
58645998 CallList(display, root, selected, blocked);
58655999
58666000 // compiled = true;
5867
- if (usecalllists)
6001
+ if (usecalllists && bRep.displaylist > 0)
58686002 {
58696003 // System.err.println("end list " + bRep.displaylist + " for " + this);
58706004 display.EndList();
....@@ -7215,20 +7349,23 @@
72157349 }
72167350 }
72177351
7218
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7352
+ static ClickInfo clickInfo = new ClickInfo();
7353
+
7354
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7355
+ Point outPt, Rectangle outRec)
72197356 {
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;
7357
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7358
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7359
+ double[][] toscreen = clickInfo.toScreen;
72237360 if (toscreen == null)
72247361 {
7225
- toscreen = new Camera(info.camera.viewCode).toScreen;
7362
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
72267363 }
72277364 cVector vec = in;
72287365 LA.xformPos(in, toscreen, in);
72297366 //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();
7367
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7368
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
72327369 outPt.x = hc + (int) vec.x;
72337370 outPt.y = vc - (int) vec.y;
72347371 outRec.x = outPt.x - 3;
....@@ -7236,15 +7373,18 @@
72367373 outRec.width = outRec.height = 6;
72377374 }
72387375
7239
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7376
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7377
+ )
72407378 {
72417379 Point pt = new Point(0, 0);
72427380 Rectangle rec = new Rectangle();
7243
- calcHotSpot(in, info, pt, rec);
7381
+ calcHotSpot(in, //clickInfo,
7382
+ pt, rec);
72447383 return rec;
72457384 }
72467385
7247
- void drawEditHandles0(ClickInfo info, int level)
7386
+ void drawEditHandles0(//ClickInfo clickInfo,
7387
+ int level)
72487388 {
72497389 if (level == 0)
72507390 {
....@@ -7253,16 +7393,19 @@
72537393 {
72547394 cVector origin = new cVector();
72557395 //LA.xformPos(origin, toParent, origin);
7256
- Rectangle spot = calcHotSpot(origin, info);
7396
+ if (this.clickInfo == null)
7397
+ this.clickInfo = new ClickInfo();
7398
+
7399
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
72577400 Rectangle boundary = new Rectangle();
72587401 boundary.x = spot.x - 30;
72597402 boundary.y = spot.y - 30;
72607403 boundary.width = spot.width + 60;
72617404 boundary.height = spot.height + 60;
7262
- info.g.setColor(Color.red);
7405
+ clickInfo.g.setColor(Color.red);
72637406 int spotw = spot.x + spot.width;
72647407 int spoth = spot.y + spot.height;
7265
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7408
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72667409 // if (CameraPane.Xmin > spot.x)
72677410 // {
72687411 // CameraPane.Xmin = spot.x;
....@@ -7282,8 +7425,8 @@
72827425 spot.translate(32, 32);
72837426 spotw = spot.x + spot.width;
72847427 spoth = spot.y + spot.height;
7285
- info.g.setColor(Color.cyan);
7286
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7428
+ clickInfo.g.setColor(Color.cyan);
7429
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72877430 // if (CameraPane.Xmin > spot.x)
72887431 // {
72897432 // CameraPane.Xmin = spot.x;
....@@ -7303,9 +7446,9 @@
73037446 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
73047447 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
73057448 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);
7449
+ clickInfo.g.setColor(Color.yellow);
7450
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7451
+ clickInfo.g.setColor(Color.green);
73097452 // if (CameraPane.Xmin > spot.x)
73107453 // {
73117454 // CameraPane.Xmin = spot.x;
....@@ -7322,8 +7465,8 @@
73227465 // {
73237466 // CameraPane.Ymax = spoth;
73247467 // }
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);
7468
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7469
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
73277470 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
73287471 // if (CameraPane.Xmin > boundary.x)
73297472 // {
....@@ -7345,7 +7488,8 @@
73457488 }
73467489 }
73477490
7348
- boolean doEditClick0(ClickInfo info, int level)
7491
+ boolean doEditClick0(//ClickInfo clickInfo,
7492
+ int level)
73497493 {
73507494 if (level == 0)
73517495 {
....@@ -7354,8 +7498,8 @@
73547498
73557499 boolean retval = false;
73567500
7357
- startX = info.x;
7358
- startY = info.y;
7501
+ startX = clickInfo.x;
7502
+ startY = clickInfo.y;
73597503
73607504 hitSomething = -1;
73617505 cVector origin = new cVector();
....@@ -7365,22 +7509,51 @@
73657509 {
73667510 centerPt = new Point(0, 0);
73677511 }
7368
- calcHotSpot(origin, info, centerPt, spot);
7369
- if (spot.contains(info.x, info.y))
7512
+ calcHotSpot(origin, //info,
7513
+ centerPt, spot);
7514
+ if (spot.contains(clickInfo.x, clickInfo.y))
73707515 {
73717516 hitSomething = hitCenter;
73727517 retval = true;
73737518 }
73747519 spot.translate(32, 0);
7375
- if (spot.contains(info.x, info.y))
7520
+ if (spot.contains(clickInfo.x, clickInfo.y))
73767521 {
73777522 hitSomething = hitRotate;
73787523 retval = true;
73797524 }
73807525 spot.translate(0, 32);
7381
- if (spot.contains(info.x, info.y))
7526
+ if (spot.contains(clickInfo.x, clickInfo.y))
73827527 {
73837528 hitSomething = hitScale;
7529
+
7530
+ double scale = 0.005f * clickInfo.camera.Distance();
7531
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7532
+ double sign = 1;
7533
+ if (hScale < 0)
7534
+ {
7535
+ sign = -1;
7536
+ }
7537
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7538
+ if (hScale < 0.01)
7539
+ {
7540
+ //hScale = 0.01;
7541
+ }
7542
+
7543
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7544
+ sign = 1;
7545
+ if (vScale < 0)
7546
+ {
7547
+ sign = -1;
7548
+ }
7549
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7550
+ if (vScale < 0.01)
7551
+ {
7552
+ //vScale = 0.01;
7553
+ }
7554
+
7555
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7556
+
73847557 retval = true;
73857558 }
73867559
....@@ -7390,7 +7563,7 @@
73907563 }
73917564
73927565 //System.out.println("info.modifiers = " + info.modifiers);
7393
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7566
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
73947567 //System.out.println("modified = " + modified);
73957568 //new Exception().printStackTrace();
73967569 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7418,7 +7591,8 @@
74187591 return true;
74197592 }
74207593
7421
- void doEditDrag0(ClickInfo info, boolean opposite)
7594
+ void doEditDrag0(//ClickInfo info,
7595
+ boolean opposite)
74227596 {
74237597 if (hitSomething == 0)
74247598 {
....@@ -7432,7 +7606,7 @@
74327606
74337607 //System.out.println("hitSomething = " + hitSomething);
74347608
7435
- double scale = 0.005f * info.camera.Distance();
7609
+ double scale = 0.005f * clickInfo.camera.Distance();
74367610
74377611 cVector xlate = new cVector();
74387612 //cVector xlate2 = new cVector();
....@@ -7466,8 +7640,8 @@
74667640 toParent[3][i] = xlate.get(i);
74677641 LA.matInvert(toParent, fromParent);
74687642 */
7469
- cVector delta = LA.newVector(0, 0, startY - info.y);
7470
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7643
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7644
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
74717645
74727646 LA.matCopy(startMat, toParent);
74737647 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7476,7 +7650,7 @@
74767650 } else
74777651 {
74787652 //LA.xformDir(delta, info.camera.fromScreen, delta);
7479
- cVector up = new cVector(info.camera.up);
7653
+ cVector up = new cVector(clickInfo.camera.up);
74807654 cVector away = new cVector();
74817655 //cVector right2 = new cVector();
74827656 //LA.vecCross(up, cVector.Z, right);
....@@ -7493,19 +7667,19 @@
74937667 LA.xformDir(up, ClickInfo.matbuffer, up);
74947668 // if (!CameraPane.LOCALTRANSFORM)
74957669 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7496
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7670
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
74977671 // if (!CameraPane.LOCALTRANSFORM)
74987672 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
74997673 //LA.vecCross(up, cVector.Z, right2);
75007674
7501
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7675
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
75027676
75037677 //System.out.println("DELTA0 = " + delta);
75047678 //System.out.println("AWAY = " + info.camera.away);
75057679 //System.out.println("UP = " + info.camera.up);
75067680 if (away.z > 0)
75077681 {
7508
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7682
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
75097683 {
75107684 delta.x = -delta.x;
75117685 } else
....@@ -7520,7 +7694,7 @@
75207694 //System.out.println("DELTA1 = " + delta);
75217695 LA.xformDir(delta, ClickInfo.matbuffer, delta);
75227696 //System.out.println("DELTA2 = " + delta);
7523
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7697
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
75247698 LA.matCopy(startMat, toParent);
75257699 //System.out.println("DELTA3 = " + delta);
75267700 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7530,8 +7704,8 @@
75307704 break;
75317705
75327706 case hitRotate: // rotate
7533
- int dx = info.x - centerPt.x;
7534
- int dy = -(info.y - centerPt.y);
7707
+ int dx = clickInfo.x - centerPt.x;
7708
+ int dy = -(clickInfo.y - centerPt.y);
75357709 double angle = (double) Math.atan2(dx, dy);
75367710 angle = -(1.570796 - angle);
75377711
....@@ -7554,7 +7728,7 @@
75547728 }
75557729 /**/
75567730
7557
- switch (info.pane.RenderCamera().viewCode)
7731
+ switch (clickInfo.pane.RenderCamera().viewCode)
75587732 {
75597733 case 1: // '\001'
75607734 LA.matZRotate(toParent, angle);
....@@ -7581,7 +7755,7 @@
75817755 break;
75827756
75837757 case hitScale: // scale
7584
- double hScale = (double) (info.x - centerPt.x) / 32;
7758
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
75857759 double sign = 1;
75867760 if (hScale < 0)
75877761 {
....@@ -7593,7 +7767,7 @@
75937767 //hScale = 0.01;
75947768 }
75957769
7596
- double vScale = (double) (info.y - centerPt.y) / 32;
7770
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75977771 sign = 1;
75987772 if (vScale < 0)
75997773 {
....@@ -7604,6 +7778,7 @@
76047778 {
76057779 //vScale = 0.01;
76067780 }
7781
+
76077782 LA.matCopy(startMat, toParent);
76087783 /**/
76097784 for (int i = 0; i < 3; i++)
....@@ -7613,14 +7788,14 @@
76137788 }
76147789 /**/
76157790
7616
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7791
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
76177792
76187793 if (totalScale < 0.01)
76197794 {
76207795 totalScale = 0.01;
76217796 }
76227797
7623
- switch (info.pane.RenderCamera().viewCode)
7798
+ switch (clickInfo.pane.RenderCamera().viewCode)
76247799 {
76257800 case 3: // '\001'
76267801 if (modified || opposite)
....@@ -7687,7 +7862,7 @@
76877862 } // NEW ...
76887863
76897864
7690
- info.pane.repaint();
7865
+ clickInfo.pane.repaint();
76917866 }
76927867
76937868 boolean overflow = false;