Normand Briere
2019-08-15 7f97054d681518416a4ee1c1548ad42cfb489a8f
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[];
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;
....@@ -1011,6 +1038,9 @@
10111038
10121039 if (material == null || material.multiply)
10131040 return true;
1041
+
1042
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1043
+ return false;
10141044
10151045 // Transparent objects are dynamic because we have to sort the triangles.
10161046 return material.opacity > 0.99;
....@@ -2438,6 +2468,11 @@
24382468 else
24392469 {
24402470 //((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");
24412476 }
24422477 }
24432478
....@@ -2567,7 +2602,8 @@
25672602 private static final int editSelf = 1;
25682603 private static final int editChild = 2;
25692604
2570
- void drawEditHandles(ClickInfo info, int level)
2605
+ void drawEditHandles(//ClickInfo info,
2606
+ int level)
25712607 {
25722608 if (level == 0)
25732609 {
....@@ -2575,7 +2611,8 @@
25752611 return;
25762612
25772613 Object3D selectee;
2578
- 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))
25792616 {
25802617 selectee = (Object3D) e.nextElement();
25812618 }
....@@ -2583,19 +2620,22 @@
25832620 } else
25842621 {
25852622 //super.
2586
- drawEditHandles0(info, level + 1);
2623
+ drawEditHandles0(//info,
2624
+ level + 1);
25872625 }
25882626 }
25892627
2590
- boolean doEditClick(ClickInfo info, int level)
2628
+ boolean doEditClick(//ClickInfo info,
2629
+ int level)
25912630 {
25922631 doSomething = 0;
25932632 if (level == 0)
25942633 {
2595
- return doParentClick(info);
2634
+ return doParentClick(); //info);
25962635 }
25972636 if (//super.
2598
- doEditClick0(info, level))
2637
+ doEditClick0(//info,
2638
+ level))
25992639 {
26002640 doSomething = 1;
26012641 return true;
....@@ -2605,7 +2645,7 @@
26052645 }
26062646 }
26072647
2608
- boolean doParentClick(ClickInfo info)
2648
+ boolean doParentClick() //ClickInfo info)
26092649 {
26102650 if (selection == null)
26112651 {
....@@ -2618,7 +2658,8 @@
26182658 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
26192659 {
26202660 Object3D selectee = (Object3D) e.nextElement();
2621
- if (selectee.doEditClick(info, 1))
2661
+ if (selectee.doEditClick(//info,
2662
+ 1))
26222663 {
26232664 childToDrag = selectee;
26242665 doSomething = 2;
....@@ -2630,13 +2671,15 @@
26302671 return retval;
26312672 }
26322673
2633
- void doEditDrag(ClickInfo info, boolean opposite)
2674
+ void doEditDrag(//ClickInfo clickInfo,
2675
+ boolean opposite)
26342676 {
26352677 switch (doSomething)
26362678 {
26372679 case 1: // '\001'
26382680 //super.
2639
- doEditDrag0(info, opposite);
2681
+ doEditDrag0(//clickInfo,
2682
+ opposite);
26402683 break;
26412684
26422685 case 2: // '\002'
....@@ -2649,11 +2692,13 @@
26492692 {
26502693 //sel.hitSomething = childToDrag.hitSomething;
26512694 //childToDrag.doEditDrag(info);
2652
- sel.doEditDrag(info, opposite);
2695
+ sel.doEditDrag(//clickInfo,
2696
+ opposite);
26532697 } else
26542698 {
26552699 //super.
2656
- doEditDrag0(info, opposite);
2700
+ doEditDrag0(//clickInfo,
2701
+ opposite);
26572702 }
26582703 }
26592704 break;
....@@ -2671,6 +2716,9 @@
26712716 {
26722717 deselectAll();
26732718 }
2719
+
2720
+ new Exception().printStackTrace();
2721
+
26742722 ClickInfo newInfo = new ClickInfo();
26752723 newInfo.flags = info.flags;
26762724 newInfo.bounds = info.bounds;
....@@ -5526,6 +5574,11 @@
55265574 if (fullname == null)
55275575 return "";
55285576
5577
+ if (fullname.pigment != null)
5578
+ {
5579
+ return fullname.pigment;
5580
+ }
5581
+
55295582 // System.out.println("Fullname = " + fullname);
55305583
55315584 // Does not work on Windows due to C:
....@@ -5538,7 +5591,7 @@
55385591
55395592 if (split.length == 0)
55405593 {
5541
- return "";
5594
+ return fullname.pigment = "";
55425595 }
55435596
55445597 if (split.length <= 2)
....@@ -5546,22 +5599,27 @@
55465599 if (fullname.name.endsWith(":"))
55475600 {
55485601 // Windows
5549
- return fullname.name.substring(0, fullname.name.length()-1);
5602
+ return fullname.pigment = fullname.name.substring(0, fullname.name.length()-1);
55505603 }
55515604
5552
- return split[0];
5605
+ return fullname.pigment = split[0];
55535606 }
55545607
55555608 // Windows
55565609 assert(split.length == 4);
55575610
5558
- return split[0] + ":" + split[1];
5611
+ return fullname.pigment = split[0] + ":" + split[1];
55595612 }
55605613
55615614 static String GetBump(cTexture fullname)
55625615 {
55635616 if (fullname == null)
55645617 return "";
5618
+
5619
+ if (fullname.bump != null)
5620
+ {
5621
+ return fullname.bump;
5622
+ }
55655623
55665624 // System.out.println("Fullname = " + fullname);
55675625 // Does not work on Windows due to C:
....@@ -5573,12 +5631,12 @@
55735631
55745632 if (split.length == 0)
55755633 {
5576
- return "";
5634
+ return fullname.bump = "";
55775635 }
55785636
55795637 if (split.length == 1)
55805638 {
5581
- return "";
5639
+ return fullname.bump = "";
55825640 }
55835641
55845642 if (split.length == 2)
....@@ -5586,16 +5644,16 @@
55865644 if (fullname.name.endsWith(":"))
55875645 {
55885646 // Windows
5589
- return "";
5647
+ return fullname.bump = "";
55905648 }
55915649
5592
- return split[1];
5650
+ return fullname.bump = split[1];
55935651 }
55945652
55955653 // Windows
55965654 assert(split.length == 4);
55975655
5598
- return split[2] + ":" + split[3];
5656
+ return fullname.bump = split[2] + ":" + split[3];
55995657 }
56005658
56015659 String GetPigmentTexture()
....@@ -5678,6 +5736,9 @@
56785736 texname = "";
56795737
56805738 GetTextures().name = texname + ":" + GetBump(GetTextures());
5739
+
5740
+ GetTextures().pigment = null;
5741
+
56815742 Touch();
56825743 }
56835744
....@@ -5750,6 +5811,8 @@
57505811 texname = "";
57515812
57525813 GetTextures().name = Object3D.GetPigment(GetTextures()) + ":" + texname;
5814
+
5815
+ GetTextures().bump = null;
57535816
57545817 Touch();
57555818 }
....@@ -5893,8 +5956,10 @@
58935956 if (support != null)
58945957 support = support;
58955958
5896
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5897
- boolean usecalllists = !IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5959
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5960
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5961
+
5962
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
58985963
58995964 if (!usecalllists && bRep != null && bRep.displaylist > 0)
59005965 {
....@@ -5904,8 +5969,9 @@
59045969 // usecalllists &= !(parent instanceof RandomNode);
59055970 // usecalllists = false;
59065971
5907
- if (GetBRep() != null)
5908
- usecalllists = usecalllists;
5972
+ if (display.DrawMode() == display.SHADOW)
5973
+ //GetBRep() != null)
5974
+ usecalllists = !!usecalllists;
59095975 //System.out.println("draw " + this);
59105976 //new Exception().printStackTrace();
59115977
....@@ -5927,7 +5993,7 @@
59275993 if (!(this instanceof Composite))
59285994 touched = false;
59295995 //if (displaylist == -1 && usecalllists)
5930
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5996
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
59315997 {
59325998 bRep.displaylist = display.GenList();
59335999 assert(bRep.displaylist != 0);
....@@ -5938,7 +6004,7 @@
59386004
59396005 //System.out.println("\tnew list " + list);
59406006 //gl.glDrawBuffer(gl.GL_NONE);
5941
- if (usecalllists)
6007
+ if (usecalllists && bRep.displaylist > 0)
59426008 {
59436009 // System.err.println("new list " + bRep.displaylist + " for " + this);
59446010 display.NewList(bRep.displaylist);
....@@ -5947,7 +6013,7 @@
59476013 CallList(display, root, selected, blocked);
59486014
59496015 // compiled = true;
5950
- if (usecalllists)
6016
+ if (usecalllists && bRep.displaylist > 0)
59516017 {
59526018 // System.err.println("end list " + bRep.displaylist + " for " + this);
59536019 display.EndList();
....@@ -7298,20 +7364,23 @@
72987364 }
72997365 }
73007366
7301
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7367
+ static ClickInfo clickInfo = new ClickInfo();
7368
+
7369
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7370
+ Point outPt, Rectangle outRec)
73027371 {
7303
- int hc = info.bounds.x + info.bounds.width / 2;
7304
- int vc = info.bounds.y + info.bounds.height / 2;
7305
- double[][] toscreen = info.toScreen;
7372
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7373
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7374
+ double[][] toscreen = clickInfo.toScreen;
73067375 if (toscreen == null)
73077376 {
7308
- toscreen = new Camera(info.camera.viewCode).toScreen;
7377
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
73097378 }
73107379 cVector vec = in;
73117380 LA.xformPos(in, toscreen, in);
73127381 //System.out.println("Distance = " + info.camera.Distance());
7313
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
7314
- vec.y *= 100 * info.camera.SCALE / info.camera.Distance();
7382
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7383
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
73157384 outPt.x = hc + (int) vec.x;
73167385 outPt.y = vc - (int) vec.y;
73177386 outRec.x = outPt.x - 3;
....@@ -7319,15 +7388,18 @@
73197388 outRec.width = outRec.height = 6;
73207389 }
73217390
7322
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7391
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7392
+ )
73237393 {
73247394 Point pt = new Point(0, 0);
73257395 Rectangle rec = new Rectangle();
7326
- calcHotSpot(in, info, pt, rec);
7396
+ calcHotSpot(in, //clickInfo,
7397
+ pt, rec);
73277398 return rec;
73287399 }
73297400
7330
- void drawEditHandles0(ClickInfo info, int level)
7401
+ void drawEditHandles0(//ClickInfo clickInfo,
7402
+ int level)
73317403 {
73327404 if (level == 0)
73337405 {
....@@ -7336,16 +7408,19 @@
73367408 {
73377409 cVector origin = new cVector();
73387410 //LA.xformPos(origin, toParent, origin);
7339
- Rectangle spot = calcHotSpot(origin, info);
7411
+ if (this.clickInfo == null)
7412
+ this.clickInfo = new ClickInfo();
7413
+
7414
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
73407415 Rectangle boundary = new Rectangle();
73417416 boundary.x = spot.x - 30;
73427417 boundary.y = spot.y - 30;
73437418 boundary.width = spot.width + 60;
73447419 boundary.height = spot.height + 60;
7345
- info.g.setColor(Color.red);
7420
+ clickInfo.g.setColor(Color.red);
73467421 int spotw = spot.x + spot.width;
73477422 int spoth = spot.y + spot.height;
7348
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7423
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
73497424 // if (CameraPane.Xmin > spot.x)
73507425 // {
73517426 // CameraPane.Xmin = spot.x;
....@@ -7362,11 +7437,6 @@
73627437 // {
73637438 // CameraPane.Ymax = spoth;
73647439 // }
7365
- spot.translate(32, 32);
7366
- spotw = spot.x + spot.width;
7367
- spoth = spot.y + spot.height;
7368
- info.g.setColor(Color.cyan);
7369
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
73707440 // if (CameraPane.Xmin > spot.x)
73717441 // {
73727442 // CameraPane.Xmin = spot.x;
....@@ -7385,10 +7455,15 @@
73857455 // }
73867456 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
73877457 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
7388
- spot.translate(0, -32);
7389
- info.g.setColor(Color.yellow);
7390
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7391
- info.g.setColor(Color.green);
7458
+ spot.translate(32, 0);
7459
+ clickInfo.g.setColor(Color.yellow);
7460
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7461
+
7462
+ spot.translate(32, 64);
7463
+ spotw = spot.x + spot.width;
7464
+ spoth = spot.y + spot.height;
7465
+ clickInfo.g.setColor(Color.cyan);
7466
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
73927467 // if (CameraPane.Xmin > spot.x)
73937468 // {
73947469 // CameraPane.Xmin = spot.x;
....@@ -7405,8 +7480,9 @@
74057480 // {
74067481 // CameraPane.Ymax = spoth;
74077482 // }
7408
- info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY,
7409
- (int)(boundary.width * info.W), (int)(boundary.height * info.W), 0, 360);
7483
+ clickInfo.g.setColor(Color.green);
7484
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7485
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
74107486 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
74117487 // if (CameraPane.Xmin > boundary.x)
74127488 // {
....@@ -7428,7 +7504,8 @@
74287504 }
74297505 }
74307506
7431
- boolean doEditClick0(ClickInfo info, int level)
7507
+ boolean doEditClick0(//ClickInfo clickInfo,
7508
+ int level)
74327509 {
74337510 if (level == 0)
74347511 {
....@@ -7437,8 +7514,8 @@
74377514
74387515 boolean retval = false;
74397516
7440
- startX = info.x;
7441
- startY = info.y;
7517
+ startX = clickInfo.x;
7518
+ startY = clickInfo.y;
74427519
74437520 hitSomething = -1;
74447521 cVector origin = new cVector();
....@@ -7448,22 +7525,53 @@
74487525 {
74497526 centerPt = new Point(0, 0);
74507527 }
7451
- calcHotSpot(origin, info, centerPt, spot);
7452
- if (spot.contains(info.x, info.y))
7528
+ calcHotSpot(origin, //info,
7529
+ centerPt, spot);
7530
+ if (spot.contains(clickInfo.x, clickInfo.y))
74537531 {
74547532 hitSomething = hitCenter;
74557533 retval = true;
74567534 }
74577535 spot.translate(32, 0);
7458
- if (spot.contains(info.x, info.y))
7536
+ if (spot.contains(clickInfo.x, clickInfo.y))
74597537 {
74607538 hitSomething = hitRotate;
74617539 retval = true;
74627540 }
74637541 spot.translate(0, 32);
7464
- if (spot.contains(info.x, info.y))
7542
+ spot.translate(32, 0);
7543
+ spot.translate(0, 32);
7544
+ if (spot.contains(clickInfo.x, clickInfo.y))
74657545 {
74667546 hitSomething = hitScale;
7547
+
7548
+ double scale = 0.005f * clickInfo.camera.Distance();
7549
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
7550
+ double sign = 1;
7551
+ if (hScale < 0)
7552
+ {
7553
+ sign = -1;
7554
+ }
7555
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7556
+ if (hScale < 0.01)
7557
+ {
7558
+ //hScale = 0.01;
7559
+ }
7560
+
7561
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
7562
+ sign = 1;
7563
+ if (vScale < 0)
7564
+ {
7565
+ sign = -1;
7566
+ }
7567
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7568
+ if (vScale < 0.01)
7569
+ {
7570
+ //vScale = 0.01;
7571
+ }
7572
+
7573
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7574
+
74677575 retval = true;
74687576 }
74697577
....@@ -7473,7 +7581,7 @@
74737581 }
74747582
74757583 //System.out.println("info.modifiers = " + info.modifiers);
7476
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7584
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
74777585 //System.out.println("modified = " + modified);
74787586 //new Exception().printStackTrace();
74797587 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7501,7 +7609,8 @@
75017609 return true;
75027610 }
75037611
7504
- void doEditDrag0(ClickInfo info, boolean opposite)
7612
+ void doEditDrag0(//ClickInfo info,
7613
+ boolean opposite)
75057614 {
75067615 if (hitSomething == 0)
75077616 {
....@@ -7515,7 +7624,7 @@
75157624
75167625 //System.out.println("hitSomething = " + hitSomething);
75177626
7518
- double scale = 0.005f * info.camera.Distance();
7627
+ double scale = 0.005f * clickInfo.camera.Distance();
75197628
75207629 cVector xlate = new cVector();
75217630 //cVector xlate2 = new cVector();
....@@ -7549,8 +7658,8 @@
75497658 toParent[3][i] = xlate.get(i);
75507659 LA.matInvert(toParent, fromParent);
75517660 */
7552
- cVector delta = LA.newVector(0, 0, startY - info.y);
7553
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7661
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7662
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
75547663
75557664 LA.matCopy(startMat, toParent);
75567665 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7559,7 +7668,7 @@
75597668 } else
75607669 {
75617670 //LA.xformDir(delta, info.camera.fromScreen, delta);
7562
- cVector up = new cVector(info.camera.up);
7671
+ cVector up = new cVector(clickInfo.camera.up);
75637672 cVector away = new cVector();
75647673 //cVector right2 = new cVector();
75657674 //LA.vecCross(up, cVector.Z, right);
....@@ -7576,19 +7685,19 @@
75767685 LA.xformDir(up, ClickInfo.matbuffer, up);
75777686 // if (!CameraPane.LOCALTRANSFORM)
75787687 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7579
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7688
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
75807689 // if (!CameraPane.LOCALTRANSFORM)
75817690 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
75827691 //LA.vecCross(up, cVector.Z, right2);
75837692
7584
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7693
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
75857694
75867695 //System.out.println("DELTA0 = " + delta);
75877696 //System.out.println("AWAY = " + info.camera.away);
75887697 //System.out.println("UP = " + info.camera.up);
75897698 if (away.z > 0)
75907699 {
7591
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7700
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
75927701 {
75937702 delta.x = -delta.x;
75947703 } else
....@@ -7603,7 +7712,7 @@
76037712 //System.out.println("DELTA1 = " + delta);
76047713 LA.xformDir(delta, ClickInfo.matbuffer, delta);
76057714 //System.out.println("DELTA2 = " + delta);
7606
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7715
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
76077716 LA.matCopy(startMat, toParent);
76087717 //System.out.println("DELTA3 = " + delta);
76097718 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7613,8 +7722,8 @@
76137722 break;
76147723
76157724 case hitRotate: // rotate
7616
- int dx = info.x - centerPt.x;
7617
- int dy = -(info.y - centerPt.y);
7725
+ int dx = clickInfo.x - centerPt.x;
7726
+ int dy = -(clickInfo.y - centerPt.y);
76187727 double angle = (double) Math.atan2(dx, dy);
76197728 angle = -(1.570796 - angle);
76207729
....@@ -7637,7 +7746,7 @@
76377746 }
76387747 /**/
76397748
7640
- switch (info.pane.RenderCamera().viewCode)
7749
+ switch (clickInfo.pane.RenderCamera().viewCode)
76417750 {
76427751 case 1: // '\001'
76437752 LA.matZRotate(toParent, angle);
....@@ -7664,7 +7773,7 @@
76647773 break;
76657774
76667775 case hitScale: // scale
7667
- double hScale = (double) (info.x - centerPt.x) / 32;
7776
+ double hScale = (double) (clickInfo.x - centerPt.x) / 64;
76687777 double sign = 1;
76697778 if (hScale < 0)
76707779 {
....@@ -7676,7 +7785,7 @@
76767785 //hScale = 0.01;
76777786 }
76787787
7679
- double vScale = (double) (info.y - centerPt.y) / 32;
7788
+ double vScale = (double) (clickInfo.y - centerPt.y) / 64;
76807789 sign = 1;
76817790 if (vScale < 0)
76827791 {
....@@ -7687,6 +7796,7 @@
76877796 {
76887797 //vScale = 0.01;
76897798 }
7799
+
76907800 LA.matCopy(startMat, toParent);
76917801 /**/
76927802 for (int i = 0; i < 3; i++)
....@@ -7696,14 +7806,14 @@
76967806 }
76977807 /**/
76987808
7699
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7809
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
77007810
77017811 if (totalScale < 0.01)
77027812 {
77037813 totalScale = 0.01;
77047814 }
77057815
7706
- switch (info.pane.RenderCamera().viewCode)
7816
+ switch (clickInfo.pane.RenderCamera().viewCode)
77077817 {
77087818 case 3: // '\001'
77097819 if (modified || opposite)
....@@ -7770,7 +7880,7 @@
77707880 } // NEW ...
77717881
77727882
7773
- info.pane.repaint();
7883
+ clickInfo.pane.repaint();
77747884 }
77757885
77767886 boolean overflow = false;