Normand Briere
2019-08-01 abb71c81c8a351cda9a2918dcaa7ee61e6c125c5
Object3D.java
....@@ -29,7 +29,10 @@
2929 Object3D saveskeleton;
3030 //
3131
32
- byte[] versions[] = new byte[100][];
32
+ String skyboxname;
33
+ String skyboxext;
34
+
35
+ byte[] versions[];
3336 int versionindex = -1;
3437
3538 ScriptNode scriptnode;
....@@ -219,6 +222,8 @@
219222 // o.bRep.support = null;
220223 // }
221224 o.selection = this.selection;
225
+ o.versions = this.versions;
226
+ o.versionindex = this.versionindex;
222227
223228 if (this.support != null)
224229 {
....@@ -274,6 +279,9 @@
274279 }
275280
276281 this.selection = o.selection;
282
+
283
+ this.versions = o.versions;
284
+ this.versionindex = o.versionindex;
277285 // July 2019 if (this.bRep != null)
278286 // this.bRep.support = o.transientrep;
279287 // this.support = o.support;
....@@ -421,6 +429,7 @@
421429 }
422430
423431 boolean live = false;
432
+ transient boolean keepdontselect;
424433 boolean dontselect = false;
425434 boolean hide = false;
426435 boolean link2master = false; // performs reset support/master at each frame
....@@ -1005,6 +1014,9 @@
10051014
10061015 if (material == null || material.multiply)
10071016 return true;
1017
+
1018
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1019
+ return false;
10081020
10091021 // Transparent objects are dynamic because we have to sort the triangles.
10101022 return material.opacity > 0.99;
....@@ -2561,7 +2573,8 @@
25612573 private static final int editSelf = 1;
25622574 private static final int editChild = 2;
25632575
2564
- void drawEditHandles(ClickInfo info, int level)
2576
+ void drawEditHandles(//ClickInfo info,
2577
+ int level)
25652578 {
25662579 if (level == 0)
25672580 {
....@@ -2569,7 +2582,8 @@
25692582 return;
25702583
25712584 Object3D selectee;
2572
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2585
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2586
+ level + 1))
25732587 {
25742588 selectee = (Object3D) e.nextElement();
25752589 }
....@@ -2577,19 +2591,22 @@
25772591 } else
25782592 {
25792593 //super.
2580
- drawEditHandles0(info, level + 1);
2594
+ drawEditHandles0(//info,
2595
+ level + 1);
25812596 }
25822597 }
25832598
2584
- boolean doEditClick(ClickInfo info, int level)
2599
+ boolean doEditClick(//ClickInfo info,
2600
+ int level)
25852601 {
25862602 doSomething = 0;
25872603 if (level == 0)
25882604 {
2589
- return doParentClick(info);
2605
+ return doParentClick(); //info);
25902606 }
25912607 if (//super.
2592
- doEditClick0(info, level))
2608
+ doEditClick0(//info,
2609
+ level))
25932610 {
25942611 doSomething = 1;
25952612 return true;
....@@ -2599,7 +2616,7 @@
25992616 }
26002617 }
26012618
2602
- boolean doParentClick(ClickInfo info)
2619
+ boolean doParentClick() //ClickInfo info)
26032620 {
26042621 if (selection == null)
26052622 {
....@@ -2612,7 +2629,8 @@
26122629 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
26132630 {
26142631 Object3D selectee = (Object3D) e.nextElement();
2615
- if (selectee.doEditClick(info, 1))
2632
+ if (selectee.doEditClick(//info,
2633
+ 1))
26162634 {
26172635 childToDrag = selectee;
26182636 doSomething = 2;
....@@ -2624,13 +2642,15 @@
26242642 return retval;
26252643 }
26262644
2627
- void doEditDrag(ClickInfo info, boolean opposite)
2645
+ void doEditDrag(//ClickInfo clickInfo,
2646
+ boolean opposite)
26282647 {
26292648 switch (doSomething)
26302649 {
26312650 case 1: // '\001'
26322651 //super.
2633
- doEditDrag0(info, opposite);
2652
+ doEditDrag0(//clickInfo,
2653
+ opposite);
26342654 break;
26352655
26362656 case 2: // '\002'
....@@ -2643,11 +2663,13 @@
26432663 {
26442664 //sel.hitSomething = childToDrag.hitSomething;
26452665 //childToDrag.doEditDrag(info);
2646
- sel.doEditDrag(info, opposite);
2666
+ sel.doEditDrag(//clickInfo,
2667
+ opposite);
26472668 } else
26482669 {
26492670 //super.
2650
- doEditDrag0(info, opposite);
2671
+ doEditDrag0(//clickInfo,
2672
+ opposite);
26512673 }
26522674 }
26532675 break;
....@@ -2665,6 +2687,9 @@
26652687 {
26662688 deselectAll();
26672689 }
2690
+
2691
+ new Exception().printStackTrace();
2692
+
26682693 ClickInfo newInfo = new ClickInfo();
26692694 newInfo.flags = info.flags;
26702695 newInfo.bounds = info.bounds;
....@@ -3112,7 +3137,7 @@
31123137 {
31133138 if (bRep != null)
31143139 {
3115
- bRep.GenerateNormalsMINE();
3140
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
31163141 Touch();
31173142 }
31183143 }
....@@ -5415,6 +5440,51 @@
54155440 blockloop = false;
54165441 }
54175442
5443
+ void ResetSelectable()
5444
+ {
5445
+ if (blockloop)
5446
+ return;
5447
+
5448
+ blockloop = true;
5449
+
5450
+ keepdontselect = dontselect;
5451
+ dontselect = true;
5452
+
5453
+ Object3D child;
5454
+ int nb = Size();
5455
+ for (int i = 0; i < nb; i++)
5456
+ {
5457
+ child = (Object3D) get(i);
5458
+ if (child == null)
5459
+ continue;
5460
+ child.ResetSelectable();
5461
+ }
5462
+
5463
+ blockloop = false;
5464
+ }
5465
+
5466
+ void RestoreSelectable()
5467
+ {
5468
+ if (blockloop)
5469
+ return;
5470
+
5471
+ blockloop = true;
5472
+
5473
+ dontselect = keepdontselect;
5474
+
5475
+ Object3D child;
5476
+ int nb = Size();
5477
+ for (int i = 0; i < nb; i++)
5478
+ {
5479
+ child = (Object3D) get(i);
5480
+ if (child == null)
5481
+ continue;
5482
+ child.RestoreSelectable();
5483
+ }
5484
+
5485
+ blockloop = false;
5486
+ }
5487
+
54185488 boolean IsSelected()
54195489 {
54205490 if (parent == null)
....@@ -5724,6 +5794,38 @@
57245794 }
57255795 }
57265796
5797
+ void EmbedTextures(boolean embed)
5798
+ {
5799
+ if (blockloop)
5800
+ return;
5801
+
5802
+ //if (GetTextures() != null)
5803
+ if (embed)
5804
+ CameraPane.EmbedTextures(GetTextures());
5805
+ else
5806
+ {
5807
+ GetTextures().pigmentdata = null;
5808
+ GetTextures().bumpdata = null;
5809
+ GetTextures().pw = 0;
5810
+ GetTextures().ph = 0;
5811
+ GetTextures().bw = 0;
5812
+ GetTextures().bh = 0;
5813
+ }
5814
+
5815
+ int nb = Size();
5816
+ for (int i = 0; i < nb; i++)
5817
+ {
5818
+ Object3D child = (Object3D) get(i);
5819
+
5820
+ if (child == null)
5821
+ continue;
5822
+
5823
+ blockloop = true;
5824
+ child.EmbedTextures(embed);
5825
+ blockloop = false;
5826
+ }
5827
+ }
5828
+
57275829 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57285830 {
57295831 Draw(display, root, selected, blocked);
....@@ -5810,8 +5912,10 @@
58105912 if (support != null)
58115913 support = support;
58125914
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);
5915
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5916
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5917
+
5918
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
58155919
58165920 if (!usecalllists && bRep != null && bRep.displaylist > 0)
58175921 {
....@@ -5821,8 +5925,9 @@
58215925 // usecalllists &= !(parent instanceof RandomNode);
58225926 // usecalllists = false;
58235927
5824
- if (GetBRep() != null)
5825
- usecalllists = usecalllists;
5928
+ if (display.DrawMode() == display.SHADOW)
5929
+ //GetBRep() != null)
5930
+ usecalllists = !!usecalllists;
58265931 //System.out.println("draw " + this);
58275932 //new Exception().printStackTrace();
58285933
....@@ -5844,7 +5949,7 @@
58445949 if (!(this instanceof Composite))
58455950 touched = false;
58465951 //if (displaylist == -1 && usecalllists)
5847
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5952
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
58485953 {
58495954 bRep.displaylist = display.GenList();
58505955 assert(bRep.displaylist != 0);
....@@ -5855,7 +5960,7 @@
58555960
58565961 //System.out.println("\tnew list " + list);
58575962 //gl.glDrawBuffer(gl.GL_NONE);
5858
- if (usecalllists)
5963
+ if (usecalllists && bRep.displaylist > 0)
58595964 {
58605965 // System.err.println("new list " + bRep.displaylist + " for " + this);
58615966 display.NewList(bRep.displaylist);
....@@ -5864,7 +5969,7 @@
58645969 CallList(display, root, selected, blocked);
58655970
58665971 // compiled = true;
5867
- if (usecalllists)
5972
+ if (usecalllists && bRep.displaylist > 0)
58685973 {
58695974 // System.err.println("end list " + bRep.displaylist + " for " + this);
58705975 display.EndList();
....@@ -7215,20 +7320,23 @@
72157320 }
72167321 }
72177322
7218
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7323
+ static ClickInfo clickInfo = new ClickInfo();
7324
+
7325
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7326
+ Point outPt, Rectangle outRec)
72197327 {
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;
7328
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7329
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7330
+ double[][] toscreen = clickInfo.toScreen;
72237331 if (toscreen == null)
72247332 {
7225
- toscreen = new Camera(info.camera.viewCode).toScreen;
7333
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
72267334 }
72277335 cVector vec = in;
72287336 LA.xformPos(in, toscreen, in);
72297337 //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();
7338
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7339
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
72327340 outPt.x = hc + (int) vec.x;
72337341 outPt.y = vc - (int) vec.y;
72347342 outRec.x = outPt.x - 3;
....@@ -7236,15 +7344,18 @@
72367344 outRec.width = outRec.height = 6;
72377345 }
72387346
7239
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7347
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7348
+ )
72407349 {
72417350 Point pt = new Point(0, 0);
72427351 Rectangle rec = new Rectangle();
7243
- calcHotSpot(in, info, pt, rec);
7352
+ calcHotSpot(in, //clickInfo,
7353
+ pt, rec);
72447354 return rec;
72457355 }
72467356
7247
- void drawEditHandles0(ClickInfo info, int level)
7357
+ void drawEditHandles0(//ClickInfo clickInfo,
7358
+ int level)
72487359 {
72497360 if (level == 0)
72507361 {
....@@ -7253,16 +7364,19 @@
72537364 {
72547365 cVector origin = new cVector();
72557366 //LA.xformPos(origin, toParent, origin);
7256
- Rectangle spot = calcHotSpot(origin, info);
7367
+ if (this.clickInfo == null)
7368
+ this.clickInfo = new ClickInfo();
7369
+
7370
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
72577371 Rectangle boundary = new Rectangle();
72587372 boundary.x = spot.x - 30;
72597373 boundary.y = spot.y - 30;
72607374 boundary.width = spot.width + 60;
72617375 boundary.height = spot.height + 60;
7262
- info.g.setColor(Color.red);
7376
+ clickInfo.g.setColor(Color.red);
72637377 int spotw = spot.x + spot.width;
72647378 int spoth = spot.y + spot.height;
7265
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7379
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72667380 // if (CameraPane.Xmin > spot.x)
72677381 // {
72687382 // CameraPane.Xmin = spot.x;
....@@ -7282,8 +7396,8 @@
72827396 spot.translate(32, 32);
72837397 spotw = spot.x + spot.width;
72847398 spoth = spot.y + spot.height;
7285
- info.g.setColor(Color.cyan);
7286
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7399
+ clickInfo.g.setColor(Color.cyan);
7400
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72877401 // if (CameraPane.Xmin > spot.x)
72887402 // {
72897403 // CameraPane.Xmin = spot.x;
....@@ -7303,9 +7417,9 @@
73037417 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
73047418 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
73057419 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);
7420
+ clickInfo.g.setColor(Color.yellow);
7421
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7422
+ clickInfo.g.setColor(Color.green);
73097423 // if (CameraPane.Xmin > spot.x)
73107424 // {
73117425 // CameraPane.Xmin = spot.x;
....@@ -7322,8 +7436,8 @@
73227436 // {
73237437 // CameraPane.Ymax = spoth;
73247438 // }
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);
7439
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7440
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
73277441 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
73287442 // if (CameraPane.Xmin > boundary.x)
73297443 // {
....@@ -7345,7 +7459,8 @@
73457459 }
73467460 }
73477461
7348
- boolean doEditClick0(ClickInfo info, int level)
7462
+ boolean doEditClick0(//ClickInfo clickInfo,
7463
+ int level)
73497464 {
73507465 if (level == 0)
73517466 {
....@@ -7354,8 +7469,8 @@
73547469
73557470 boolean retval = false;
73567471
7357
- startX = info.x;
7358
- startY = info.y;
7472
+ startX = clickInfo.x;
7473
+ startY = clickInfo.y;
73597474
73607475 hitSomething = -1;
73617476 cVector origin = new cVector();
....@@ -7365,22 +7480,51 @@
73657480 {
73667481 centerPt = new Point(0, 0);
73677482 }
7368
- calcHotSpot(origin, info, centerPt, spot);
7369
- if (spot.contains(info.x, info.y))
7483
+ calcHotSpot(origin, //info,
7484
+ centerPt, spot);
7485
+ if (spot.contains(clickInfo.x, clickInfo.y))
73707486 {
73717487 hitSomething = hitCenter;
73727488 retval = true;
73737489 }
73747490 spot.translate(32, 0);
7375
- if (spot.contains(info.x, info.y))
7491
+ if (spot.contains(clickInfo.x, clickInfo.y))
73767492 {
73777493 hitSomething = hitRotate;
73787494 retval = true;
73797495 }
73807496 spot.translate(0, 32);
7381
- if (spot.contains(info.x, info.y))
7497
+ if (spot.contains(clickInfo.x, clickInfo.y))
73827498 {
73837499 hitSomething = hitScale;
7500
+
7501
+ double scale = 0.005f * clickInfo.camera.Distance();
7502
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7503
+ double sign = 1;
7504
+ if (hScale < 0)
7505
+ {
7506
+ sign = -1;
7507
+ }
7508
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7509
+ if (hScale < 0.01)
7510
+ {
7511
+ //hScale = 0.01;
7512
+ }
7513
+
7514
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7515
+ sign = 1;
7516
+ if (vScale < 0)
7517
+ {
7518
+ sign = -1;
7519
+ }
7520
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7521
+ if (vScale < 0.01)
7522
+ {
7523
+ //vScale = 0.01;
7524
+ }
7525
+
7526
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7527
+
73847528 retval = true;
73857529 }
73867530
....@@ -7390,7 +7534,7 @@
73907534 }
73917535
73927536 //System.out.println("info.modifiers = " + info.modifiers);
7393
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7537
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
73947538 //System.out.println("modified = " + modified);
73957539 //new Exception().printStackTrace();
73967540 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7418,7 +7562,8 @@
74187562 return true;
74197563 }
74207564
7421
- void doEditDrag0(ClickInfo info, boolean opposite)
7565
+ void doEditDrag0(//ClickInfo info,
7566
+ boolean opposite)
74227567 {
74237568 if (hitSomething == 0)
74247569 {
....@@ -7432,7 +7577,7 @@
74327577
74337578 //System.out.println("hitSomething = " + hitSomething);
74347579
7435
- double scale = 0.005f * info.camera.Distance();
7580
+ double scale = 0.005f * clickInfo.camera.Distance();
74367581
74377582 cVector xlate = new cVector();
74387583 //cVector xlate2 = new cVector();
....@@ -7466,8 +7611,8 @@
74667611 toParent[3][i] = xlate.get(i);
74677612 LA.matInvert(toParent, fromParent);
74687613 */
7469
- cVector delta = LA.newVector(0, 0, startY - info.y);
7470
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7614
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7615
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
74717616
74727617 LA.matCopy(startMat, toParent);
74737618 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7476,7 +7621,7 @@
74767621 } else
74777622 {
74787623 //LA.xformDir(delta, info.camera.fromScreen, delta);
7479
- cVector up = new cVector(info.camera.up);
7624
+ cVector up = new cVector(clickInfo.camera.up);
74807625 cVector away = new cVector();
74817626 //cVector right2 = new cVector();
74827627 //LA.vecCross(up, cVector.Z, right);
....@@ -7493,19 +7638,19 @@
74937638 LA.xformDir(up, ClickInfo.matbuffer, up);
74947639 // if (!CameraPane.LOCALTRANSFORM)
74957640 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7496
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7641
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
74977642 // if (!CameraPane.LOCALTRANSFORM)
74987643 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
74997644 //LA.vecCross(up, cVector.Z, right2);
75007645
7501
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7646
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
75027647
75037648 //System.out.println("DELTA0 = " + delta);
75047649 //System.out.println("AWAY = " + info.camera.away);
75057650 //System.out.println("UP = " + info.camera.up);
75067651 if (away.z > 0)
75077652 {
7508
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7653
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
75097654 {
75107655 delta.x = -delta.x;
75117656 } else
....@@ -7520,7 +7665,7 @@
75207665 //System.out.println("DELTA1 = " + delta);
75217666 LA.xformDir(delta, ClickInfo.matbuffer, delta);
75227667 //System.out.println("DELTA2 = " + delta);
7523
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7668
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
75247669 LA.matCopy(startMat, toParent);
75257670 //System.out.println("DELTA3 = " + delta);
75267671 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7530,8 +7675,8 @@
75307675 break;
75317676
75327677 case hitRotate: // rotate
7533
- int dx = info.x - centerPt.x;
7534
- int dy = -(info.y - centerPt.y);
7678
+ int dx = clickInfo.x - centerPt.x;
7679
+ int dy = -(clickInfo.y - centerPt.y);
75357680 double angle = (double) Math.atan2(dx, dy);
75367681 angle = -(1.570796 - angle);
75377682
....@@ -7554,7 +7699,7 @@
75547699 }
75557700 /**/
75567701
7557
- switch (info.pane.RenderCamera().viewCode)
7702
+ switch (clickInfo.pane.RenderCamera().viewCode)
75587703 {
75597704 case 1: // '\001'
75607705 LA.matZRotate(toParent, angle);
....@@ -7581,7 +7726,7 @@
75817726 break;
75827727
75837728 case hitScale: // scale
7584
- double hScale = (double) (info.x - centerPt.x) / 32;
7729
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
75857730 double sign = 1;
75867731 if (hScale < 0)
75877732 {
....@@ -7593,7 +7738,7 @@
75937738 //hScale = 0.01;
75947739 }
75957740
7596
- double vScale = (double) (info.y - centerPt.y) / 32;
7741
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75977742 sign = 1;
75987743 if (vScale < 0)
75997744 {
....@@ -7604,6 +7749,7 @@
76047749 {
76057750 //vScale = 0.01;
76067751 }
7752
+
76077753 LA.matCopy(startMat, toParent);
76087754 /**/
76097755 for (int i = 0; i < 3; i++)
....@@ -7613,14 +7759,14 @@
76137759 }
76147760 /**/
76157761
7616
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7762
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
76177763
76187764 if (totalScale < 0.01)
76197765 {
76207766 totalScale = 0.01;
76217767 }
76227768
7623
- switch (info.pane.RenderCamera().viewCode)
7769
+ switch (clickInfo.pane.RenderCamera().viewCode)
76247770 {
76257771 case 3: // '\001'
76267772 if (modified || opposite)
....@@ -7687,7 +7833,7 @@
76877833 } // NEW ...
76887834
76897835
7690
- info.pane.repaint();
7836
+ clickInfo.pane.repaint();
76917837 }
76927838
76937839 boolean overflow = false;