Normand Briere
2019-08-06 4ec7130da08861dc4aff0232dbce38f3471696a4
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;
....@@ -2561,7 +2597,8 @@
25612597 private static final int editSelf = 1;
25622598 private static final int editChild = 2;
25632599
2564
- void drawEditHandles(ClickInfo info, int level)
2600
+ void drawEditHandles(//ClickInfo info,
2601
+ int level)
25652602 {
25662603 if (level == 0)
25672604 {
....@@ -2569,7 +2606,8 @@
25692606 return;
25702607
25712608 Object3D selectee;
2572
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2609
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2610
+ level + 1))
25732611 {
25742612 selectee = (Object3D) e.nextElement();
25752613 }
....@@ -2577,19 +2615,22 @@
25772615 } else
25782616 {
25792617 //super.
2580
- drawEditHandles0(info, level + 1);
2618
+ drawEditHandles0(//info,
2619
+ level + 1);
25812620 }
25822621 }
25832622
2584
- boolean doEditClick(ClickInfo info, int level)
2623
+ boolean doEditClick(//ClickInfo info,
2624
+ int level)
25852625 {
25862626 doSomething = 0;
25872627 if (level == 0)
25882628 {
2589
- return doParentClick(info);
2629
+ return doParentClick(); //info);
25902630 }
25912631 if (//super.
2592
- doEditClick0(info, level))
2632
+ doEditClick0(//info,
2633
+ level))
25932634 {
25942635 doSomething = 1;
25952636 return true;
....@@ -2599,7 +2640,7 @@
25992640 }
26002641 }
26012642
2602
- boolean doParentClick(ClickInfo info)
2643
+ boolean doParentClick() //ClickInfo info)
26032644 {
26042645 if (selection == null)
26052646 {
....@@ -2612,7 +2653,8 @@
26122653 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
26132654 {
26142655 Object3D selectee = (Object3D) e.nextElement();
2615
- if (selectee.doEditClick(info, 1))
2656
+ if (selectee.doEditClick(//info,
2657
+ 1))
26162658 {
26172659 childToDrag = selectee;
26182660 doSomething = 2;
....@@ -2624,13 +2666,15 @@
26242666 return retval;
26252667 }
26262668
2627
- void doEditDrag(ClickInfo info, boolean opposite)
2669
+ void doEditDrag(//ClickInfo clickInfo,
2670
+ boolean opposite)
26282671 {
26292672 switch (doSomething)
26302673 {
26312674 case 1: // '\001'
26322675 //super.
2633
- doEditDrag0(info, opposite);
2676
+ doEditDrag0(//clickInfo,
2677
+ opposite);
26342678 break;
26352679
26362680 case 2: // '\002'
....@@ -2643,11 +2687,13 @@
26432687 {
26442688 //sel.hitSomething = childToDrag.hitSomething;
26452689 //childToDrag.doEditDrag(info);
2646
- sel.doEditDrag(info, opposite);
2690
+ sel.doEditDrag(//clickInfo,
2691
+ opposite);
26472692 } else
26482693 {
26492694 //super.
2650
- doEditDrag0(info, opposite);
2695
+ doEditDrag0(//clickInfo,
2696
+ opposite);
26512697 }
26522698 }
26532699 break;
....@@ -2665,6 +2711,9 @@
26652711 {
26662712 deselectAll();
26672713 }
2714
+
2715
+ new Exception().printStackTrace();
2716
+
26682717 ClickInfo newInfo = new ClickInfo();
26692718 newInfo.flags = info.flags;
26702719 newInfo.bounds = info.bounds;
....@@ -3112,7 +3161,7 @@
31123161 {
31133162 if (bRep != null)
31143163 {
3115
- bRep.GenerateNormalsMINE();
3164
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
31163165 Touch();
31173166 }
31183167 }
....@@ -5415,6 +5464,51 @@
54155464 blockloop = false;
54165465 }
54175466
5467
+ void ResetSelectable()
5468
+ {
5469
+ if (blockloop)
5470
+ return;
5471
+
5472
+ blockloop = true;
5473
+
5474
+ keepdontselect = dontselect;
5475
+ dontselect = true;
5476
+
5477
+ Object3D child;
5478
+ int nb = Size();
5479
+ for (int i = 0; i < nb; i++)
5480
+ {
5481
+ child = (Object3D) get(i);
5482
+ if (child == null)
5483
+ continue;
5484
+ child.ResetSelectable();
5485
+ }
5486
+
5487
+ blockloop = false;
5488
+ }
5489
+
5490
+ void RestoreSelectable()
5491
+ {
5492
+ if (blockloop)
5493
+ return;
5494
+
5495
+ blockloop = true;
5496
+
5497
+ dontselect = keepdontselect;
5498
+
5499
+ Object3D child;
5500
+ int nb = Size();
5501
+ for (int i = 0; i < nb; i++)
5502
+ {
5503
+ child = (Object3D) get(i);
5504
+ if (child == null)
5505
+ continue;
5506
+ child.RestoreSelectable();
5507
+ }
5508
+
5509
+ blockloop = false;
5510
+ }
5511
+
54185512 boolean IsSelected()
54195513 {
54205514 if (parent == null)
....@@ -5724,6 +5818,38 @@
57245818 }
57255819 }
57265820
5821
+ void EmbedTextures(boolean embed)
5822
+ {
5823
+ if (blockloop)
5824
+ return;
5825
+
5826
+ //if (GetTextures() != null)
5827
+ if (embed)
5828
+ CameraPane.EmbedTextures(GetTextures());
5829
+ else
5830
+ {
5831
+ GetTextures().pigmentdata = null;
5832
+ GetTextures().bumpdata = null;
5833
+ GetTextures().pw = 0;
5834
+ GetTextures().ph = 0;
5835
+ GetTextures().bw = 0;
5836
+ GetTextures().bh = 0;
5837
+ }
5838
+
5839
+ int nb = Size();
5840
+ for (int i = 0; i < nb; i++)
5841
+ {
5842
+ Object3D child = (Object3D) get(i);
5843
+
5844
+ if (child == null)
5845
+ continue;
5846
+
5847
+ blockloop = true;
5848
+ child.EmbedTextures(embed);
5849
+ blockloop = false;
5850
+ }
5851
+ }
5852
+
57275853 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57285854 {
57295855 Draw(display, root, selected, blocked);
....@@ -5810,8 +5936,10 @@
58105936 if (support != null)
58115937 support = support;
58125938
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);
5939
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5940
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5941
+
5942
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
58155943
58165944 if (!usecalllists && bRep != null && bRep.displaylist > 0)
58175945 {
....@@ -5821,8 +5949,9 @@
58215949 // usecalllists &= !(parent instanceof RandomNode);
58225950 // usecalllists = false;
58235951
5824
- if (GetBRep() != null)
5825
- usecalllists = usecalllists;
5952
+ if (display.DrawMode() == display.SHADOW)
5953
+ //GetBRep() != null)
5954
+ usecalllists = !!usecalllists;
58265955 //System.out.println("draw " + this);
58275956 //new Exception().printStackTrace();
58285957
....@@ -5844,7 +5973,7 @@
58445973 if (!(this instanceof Composite))
58455974 touched = false;
58465975 //if (displaylist == -1 && usecalllists)
5847
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5976
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
58485977 {
58495978 bRep.displaylist = display.GenList();
58505979 assert(bRep.displaylist != 0);
....@@ -5855,7 +5984,7 @@
58555984
58565985 //System.out.println("\tnew list " + list);
58575986 //gl.glDrawBuffer(gl.GL_NONE);
5858
- if (usecalllists)
5987
+ if (usecalllists && bRep.displaylist > 0)
58595988 {
58605989 // System.err.println("new list " + bRep.displaylist + " for " + this);
58615990 display.NewList(bRep.displaylist);
....@@ -5864,7 +5993,7 @@
58645993 CallList(display, root, selected, blocked);
58655994
58665995 // compiled = true;
5867
- if (usecalllists)
5996
+ if (usecalllists && bRep.displaylist > 0)
58685997 {
58695998 // System.err.println("end list " + bRep.displaylist + " for " + this);
58705999 display.EndList();
....@@ -7215,20 +7344,23 @@
72157344 }
72167345 }
72177346
7218
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7347
+ static ClickInfo clickInfo = new ClickInfo();
7348
+
7349
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7350
+ Point outPt, Rectangle outRec)
72197351 {
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;
7352
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7353
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7354
+ double[][] toscreen = clickInfo.toScreen;
72237355 if (toscreen == null)
72247356 {
7225
- toscreen = new Camera(info.camera.viewCode).toScreen;
7357
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
72267358 }
72277359 cVector vec = in;
72287360 LA.xformPos(in, toscreen, in);
72297361 //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();
7362
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7363
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
72327364 outPt.x = hc + (int) vec.x;
72337365 outPt.y = vc - (int) vec.y;
72347366 outRec.x = outPt.x - 3;
....@@ -7236,15 +7368,18 @@
72367368 outRec.width = outRec.height = 6;
72377369 }
72387370
7239
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7371
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7372
+ )
72407373 {
72417374 Point pt = new Point(0, 0);
72427375 Rectangle rec = new Rectangle();
7243
- calcHotSpot(in, info, pt, rec);
7376
+ calcHotSpot(in, //clickInfo,
7377
+ pt, rec);
72447378 return rec;
72457379 }
72467380
7247
- void drawEditHandles0(ClickInfo info, int level)
7381
+ void drawEditHandles0(//ClickInfo clickInfo,
7382
+ int level)
72487383 {
72497384 if (level == 0)
72507385 {
....@@ -7253,16 +7388,19 @@
72537388 {
72547389 cVector origin = new cVector();
72557390 //LA.xformPos(origin, toParent, origin);
7256
- Rectangle spot = calcHotSpot(origin, info);
7391
+ if (this.clickInfo == null)
7392
+ this.clickInfo = new ClickInfo();
7393
+
7394
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
72577395 Rectangle boundary = new Rectangle();
72587396 boundary.x = spot.x - 30;
72597397 boundary.y = spot.y - 30;
72607398 boundary.width = spot.width + 60;
72617399 boundary.height = spot.height + 60;
7262
- info.g.setColor(Color.red);
7400
+ clickInfo.g.setColor(Color.red);
72637401 int spotw = spot.x + spot.width;
72647402 int spoth = spot.y + spot.height;
7265
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7403
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72667404 // if (CameraPane.Xmin > spot.x)
72677405 // {
72687406 // CameraPane.Xmin = spot.x;
....@@ -7282,8 +7420,8 @@
72827420 spot.translate(32, 32);
72837421 spotw = spot.x + spot.width;
72847422 spoth = spot.y + spot.height;
7285
- info.g.setColor(Color.cyan);
7286
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7423
+ clickInfo.g.setColor(Color.cyan);
7424
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72877425 // if (CameraPane.Xmin > spot.x)
72887426 // {
72897427 // CameraPane.Xmin = spot.x;
....@@ -7303,9 +7441,9 @@
73037441 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
73047442 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
73057443 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);
7444
+ clickInfo.g.setColor(Color.yellow);
7445
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7446
+ clickInfo.g.setColor(Color.green);
73097447 // if (CameraPane.Xmin > spot.x)
73107448 // {
73117449 // CameraPane.Xmin = spot.x;
....@@ -7322,8 +7460,8 @@
73227460 // {
73237461 // CameraPane.Ymax = spoth;
73247462 // }
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);
7463
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7464
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
73277465 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
73287466 // if (CameraPane.Xmin > boundary.x)
73297467 // {
....@@ -7345,7 +7483,8 @@
73457483 }
73467484 }
73477485
7348
- boolean doEditClick0(ClickInfo info, int level)
7486
+ boolean doEditClick0(//ClickInfo clickInfo,
7487
+ int level)
73497488 {
73507489 if (level == 0)
73517490 {
....@@ -7354,8 +7493,8 @@
73547493
73557494 boolean retval = false;
73567495
7357
- startX = info.x;
7358
- startY = info.y;
7496
+ startX = clickInfo.x;
7497
+ startY = clickInfo.y;
73597498
73607499 hitSomething = -1;
73617500 cVector origin = new cVector();
....@@ -7365,22 +7504,51 @@
73657504 {
73667505 centerPt = new Point(0, 0);
73677506 }
7368
- calcHotSpot(origin, info, centerPt, spot);
7369
- if (spot.contains(info.x, info.y))
7507
+ calcHotSpot(origin, //info,
7508
+ centerPt, spot);
7509
+ if (spot.contains(clickInfo.x, clickInfo.y))
73707510 {
73717511 hitSomething = hitCenter;
73727512 retval = true;
73737513 }
73747514 spot.translate(32, 0);
7375
- if (spot.contains(info.x, info.y))
7515
+ if (spot.contains(clickInfo.x, clickInfo.y))
73767516 {
73777517 hitSomething = hitRotate;
73787518 retval = true;
73797519 }
73807520 spot.translate(0, 32);
7381
- if (spot.contains(info.x, info.y))
7521
+ if (spot.contains(clickInfo.x, clickInfo.y))
73827522 {
73837523 hitSomething = hitScale;
7524
+
7525
+ double scale = 0.005f * clickInfo.camera.Distance();
7526
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7527
+ double sign = 1;
7528
+ if (hScale < 0)
7529
+ {
7530
+ sign = -1;
7531
+ }
7532
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7533
+ if (hScale < 0.01)
7534
+ {
7535
+ //hScale = 0.01;
7536
+ }
7537
+
7538
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7539
+ sign = 1;
7540
+ if (vScale < 0)
7541
+ {
7542
+ sign = -1;
7543
+ }
7544
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7545
+ if (vScale < 0.01)
7546
+ {
7547
+ //vScale = 0.01;
7548
+ }
7549
+
7550
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7551
+
73847552 retval = true;
73857553 }
73867554
....@@ -7390,7 +7558,7 @@
73907558 }
73917559
73927560 //System.out.println("info.modifiers = " + info.modifiers);
7393
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7561
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
73947562 //System.out.println("modified = " + modified);
73957563 //new Exception().printStackTrace();
73967564 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7418,7 +7586,8 @@
74187586 return true;
74197587 }
74207588
7421
- void doEditDrag0(ClickInfo info, boolean opposite)
7589
+ void doEditDrag0(//ClickInfo info,
7590
+ boolean opposite)
74227591 {
74237592 if (hitSomething == 0)
74247593 {
....@@ -7432,7 +7601,7 @@
74327601
74337602 //System.out.println("hitSomething = " + hitSomething);
74347603
7435
- double scale = 0.005f * info.camera.Distance();
7604
+ double scale = 0.005f * clickInfo.camera.Distance();
74367605
74377606 cVector xlate = new cVector();
74387607 //cVector xlate2 = new cVector();
....@@ -7466,8 +7635,8 @@
74667635 toParent[3][i] = xlate.get(i);
74677636 LA.matInvert(toParent, fromParent);
74687637 */
7469
- cVector delta = LA.newVector(0, 0, startY - info.y);
7470
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7638
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7639
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
74717640
74727641 LA.matCopy(startMat, toParent);
74737642 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7476,7 +7645,7 @@
74767645 } else
74777646 {
74787647 //LA.xformDir(delta, info.camera.fromScreen, delta);
7479
- cVector up = new cVector(info.camera.up);
7648
+ cVector up = new cVector(clickInfo.camera.up);
74807649 cVector away = new cVector();
74817650 //cVector right2 = new cVector();
74827651 //LA.vecCross(up, cVector.Z, right);
....@@ -7493,19 +7662,19 @@
74937662 LA.xformDir(up, ClickInfo.matbuffer, up);
74947663 // if (!CameraPane.LOCALTRANSFORM)
74957664 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7496
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7665
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
74977666 // if (!CameraPane.LOCALTRANSFORM)
74987667 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
74997668 //LA.vecCross(up, cVector.Z, right2);
75007669
7501
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7670
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
75027671
75037672 //System.out.println("DELTA0 = " + delta);
75047673 //System.out.println("AWAY = " + info.camera.away);
75057674 //System.out.println("UP = " + info.camera.up);
75067675 if (away.z > 0)
75077676 {
7508
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7677
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
75097678 {
75107679 delta.x = -delta.x;
75117680 } else
....@@ -7520,7 +7689,7 @@
75207689 //System.out.println("DELTA1 = " + delta);
75217690 LA.xformDir(delta, ClickInfo.matbuffer, delta);
75227691 //System.out.println("DELTA2 = " + delta);
7523
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7692
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
75247693 LA.matCopy(startMat, toParent);
75257694 //System.out.println("DELTA3 = " + delta);
75267695 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7530,8 +7699,8 @@
75307699 break;
75317700
75327701 case hitRotate: // rotate
7533
- int dx = info.x - centerPt.x;
7534
- int dy = -(info.y - centerPt.y);
7702
+ int dx = clickInfo.x - centerPt.x;
7703
+ int dy = -(clickInfo.y - centerPt.y);
75357704 double angle = (double) Math.atan2(dx, dy);
75367705 angle = -(1.570796 - angle);
75377706
....@@ -7554,7 +7723,7 @@
75547723 }
75557724 /**/
75567725
7557
- switch (info.pane.RenderCamera().viewCode)
7726
+ switch (clickInfo.pane.RenderCamera().viewCode)
75587727 {
75597728 case 1: // '\001'
75607729 LA.matZRotate(toParent, angle);
....@@ -7581,7 +7750,7 @@
75817750 break;
75827751
75837752 case hitScale: // scale
7584
- double hScale = (double) (info.x - centerPt.x) / 32;
7753
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
75857754 double sign = 1;
75867755 if (hScale < 0)
75877756 {
....@@ -7593,7 +7762,7 @@
75937762 //hScale = 0.01;
75947763 }
75957764
7596
- double vScale = (double) (info.y - centerPt.y) / 32;
7765
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75977766 sign = 1;
75987767 if (vScale < 0)
75997768 {
....@@ -7604,6 +7773,7 @@
76047773 {
76057774 //vScale = 0.01;
76067775 }
7776
+
76077777 LA.matCopy(startMat, toParent);
76087778 /**/
76097779 for (int i = 0; i < 3; i++)
....@@ -7613,14 +7783,14 @@
76137783 }
76147784 /**/
76157785
7616
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7786
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
76177787
76187788 if (totalScale < 0.01)
76197789 {
76207790 totalScale = 0.01;
76217791 }
76227792
7623
- switch (info.pane.RenderCamera().viewCode)
7793
+ switch (clickInfo.pane.RenderCamera().viewCode)
76247794 {
76257795 case 3: // '\001'
76267796 if (modified || opposite)
....@@ -7687,7 +7857,7 @@
76877857 } // NEW ...
76887858
76897859
7690
- info.pane.repaint();
7860
+ clickInfo.pane.repaint();
76917861 }
76927862
76937863 boolean overflow = false;