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,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;
....@@ -426,6 +453,7 @@
426453 }
427454
428455 boolean live = false;
456
+ transient boolean keepdontselect;
429457 boolean dontselect = false;
430458 boolean hide = false;
431459 boolean link2master = false; // performs reset support/master at each frame
....@@ -1010,6 +1038,9 @@
10101038
10111039 if (material == null || material.multiply)
10121040 return true;
1041
+
1042
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1043
+ return false;
10131044
10141045 // Transparent objects are dynamic because we have to sort the triangles.
10151046 return material.opacity > 0.99;
....@@ -2437,6 +2468,11 @@
24372468 else
24382469 {
24392470 //((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");
24402476 }
24412477 }
24422478
....@@ -2566,7 +2602,8 @@
25662602 private static final int editSelf = 1;
25672603 private static final int editChild = 2;
25682604
2569
- void drawEditHandles(ClickInfo info, int level)
2605
+ void drawEditHandles(//ClickInfo info,
2606
+ int level)
25702607 {
25712608 if (level == 0)
25722609 {
....@@ -2574,7 +2611,8 @@
25742611 return;
25752612
25762613 Object3D selectee;
2577
- 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))
25782616 {
25792617 selectee = (Object3D) e.nextElement();
25802618 }
....@@ -2582,19 +2620,22 @@
25822620 } else
25832621 {
25842622 //super.
2585
- drawEditHandles0(info, level + 1);
2623
+ drawEditHandles0(//info,
2624
+ level + 1);
25862625 }
25872626 }
25882627
2589
- boolean doEditClick(ClickInfo info, int level)
2628
+ boolean doEditClick(//ClickInfo info,
2629
+ int level)
25902630 {
25912631 doSomething = 0;
25922632 if (level == 0)
25932633 {
2594
- return doParentClick(info);
2634
+ return doParentClick(); //info);
25952635 }
25962636 if (//super.
2597
- doEditClick0(info, level))
2637
+ doEditClick0(//info,
2638
+ level))
25982639 {
25992640 doSomething = 1;
26002641 return true;
....@@ -2604,7 +2645,7 @@
26042645 }
26052646 }
26062647
2607
- boolean doParentClick(ClickInfo info)
2648
+ boolean doParentClick() //ClickInfo info)
26082649 {
26092650 if (selection == null)
26102651 {
....@@ -2617,7 +2658,8 @@
26172658 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
26182659 {
26192660 Object3D selectee = (Object3D) e.nextElement();
2620
- if (selectee.doEditClick(info, 1))
2661
+ if (selectee.doEditClick(//info,
2662
+ 1))
26212663 {
26222664 childToDrag = selectee;
26232665 doSomething = 2;
....@@ -2629,13 +2671,15 @@
26292671 return retval;
26302672 }
26312673
2632
- void doEditDrag(ClickInfo info, boolean opposite)
2674
+ void doEditDrag(//ClickInfo clickInfo,
2675
+ boolean opposite)
26332676 {
26342677 switch (doSomething)
26352678 {
26362679 case 1: // '\001'
26372680 //super.
2638
- doEditDrag0(info, opposite);
2681
+ doEditDrag0(//clickInfo,
2682
+ opposite);
26392683 break;
26402684
26412685 case 2: // '\002'
....@@ -2648,11 +2692,13 @@
26482692 {
26492693 //sel.hitSomething = childToDrag.hitSomething;
26502694 //childToDrag.doEditDrag(info);
2651
- sel.doEditDrag(info, opposite);
2695
+ sel.doEditDrag(//clickInfo,
2696
+ opposite);
26522697 } else
26532698 {
26542699 //super.
2655
- doEditDrag0(info, opposite);
2700
+ doEditDrag0(//clickInfo,
2701
+ opposite);
26562702 }
26572703 }
26582704 break;
....@@ -2670,6 +2716,9 @@
26702716 {
26712717 deselectAll();
26722718 }
2719
+
2720
+ new Exception().printStackTrace();
2721
+
26732722 ClickInfo newInfo = new ClickInfo();
26742723 newInfo.flags = info.flags;
26752724 newInfo.bounds = info.bounds;
....@@ -5420,6 +5469,51 @@
54205469 blockloop = false;
54215470 }
54225471
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
+
54235517 boolean IsSelected()
54245518 {
54255519 if (parent == null)
....@@ -5729,6 +5823,38 @@
57295823 }
57305824 }
57315825
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
+
57325858 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57335859 {
57345860 Draw(display, root, selected, blocked);
....@@ -5815,8 +5941,10 @@
58155941 if (support != null)
58165942 support = support;
58175943
5818
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5819
- 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.
58205948
58215949 if (!usecalllists && bRep != null && bRep.displaylist > 0)
58225950 {
....@@ -5826,8 +5954,9 @@
58265954 // usecalllists &= !(parent instanceof RandomNode);
58275955 // usecalllists = false;
58285956
5829
- if (GetBRep() != null)
5830
- usecalllists = usecalllists;
5957
+ if (display.DrawMode() == display.SHADOW)
5958
+ //GetBRep() != null)
5959
+ usecalllists = !!usecalllists;
58315960 //System.out.println("draw " + this);
58325961 //new Exception().printStackTrace();
58335962
....@@ -5849,7 +5978,7 @@
58495978 if (!(this instanceof Composite))
58505979 touched = false;
58515980 //if (displaylist == -1 && usecalllists)
5852
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5981
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
58535982 {
58545983 bRep.displaylist = display.GenList();
58555984 assert(bRep.displaylist != 0);
....@@ -5860,7 +5989,7 @@
58605989
58615990 //System.out.println("\tnew list " + list);
58625991 //gl.glDrawBuffer(gl.GL_NONE);
5863
- if (usecalllists)
5992
+ if (usecalllists && bRep.displaylist > 0)
58645993 {
58655994 // System.err.println("new list " + bRep.displaylist + " for " + this);
58665995 display.NewList(bRep.displaylist);
....@@ -5869,7 +5998,7 @@
58695998 CallList(display, root, selected, blocked);
58705999
58716000 // compiled = true;
5872
- if (usecalllists)
6001
+ if (usecalllists && bRep.displaylist > 0)
58736002 {
58746003 // System.err.println("end list " + bRep.displaylist + " for " + this);
58756004 display.EndList();
....@@ -7220,20 +7349,23 @@
72207349 }
72217350 }
72227351
7223
- 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)
72247356 {
7225
- int hc = info.bounds.x + info.bounds.width / 2;
7226
- int vc = info.bounds.y + info.bounds.height / 2;
7227
- 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;
72287360 if (toscreen == null)
72297361 {
7230
- toscreen = new Camera(info.camera.viewCode).toScreen;
7362
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
72317363 }
72327364 cVector vec = in;
72337365 LA.xformPos(in, toscreen, in);
72347366 //System.out.println("Distance = " + info.camera.Distance());
7235
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
7236
- 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();
72377369 outPt.x = hc + (int) vec.x;
72387370 outPt.y = vc - (int) vec.y;
72397371 outRec.x = outPt.x - 3;
....@@ -7241,15 +7373,18 @@
72417373 outRec.width = outRec.height = 6;
72427374 }
72437375
7244
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7376
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7377
+ )
72457378 {
72467379 Point pt = new Point(0, 0);
72477380 Rectangle rec = new Rectangle();
7248
- calcHotSpot(in, info, pt, rec);
7381
+ calcHotSpot(in, //clickInfo,
7382
+ pt, rec);
72497383 return rec;
72507384 }
72517385
7252
- void drawEditHandles0(ClickInfo info, int level)
7386
+ void drawEditHandles0(//ClickInfo clickInfo,
7387
+ int level)
72537388 {
72547389 if (level == 0)
72557390 {
....@@ -7258,16 +7393,19 @@
72587393 {
72597394 cVector origin = new cVector();
72607395 //LA.xformPos(origin, toParent, origin);
7261
- Rectangle spot = calcHotSpot(origin, info);
7396
+ if (this.clickInfo == null)
7397
+ this.clickInfo = new ClickInfo();
7398
+
7399
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
72627400 Rectangle boundary = new Rectangle();
72637401 boundary.x = spot.x - 30;
72647402 boundary.y = spot.y - 30;
72657403 boundary.width = spot.width + 60;
72667404 boundary.height = spot.height + 60;
7267
- info.g.setColor(Color.red);
7405
+ clickInfo.g.setColor(Color.red);
72687406 int spotw = spot.x + spot.width;
72697407 int spoth = spot.y + spot.height;
7270
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7408
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72717409 // if (CameraPane.Xmin > spot.x)
72727410 // {
72737411 // CameraPane.Xmin = spot.x;
....@@ -7287,8 +7425,8 @@
72877425 spot.translate(32, 32);
72887426 spotw = spot.x + spot.width;
72897427 spoth = spot.y + spot.height;
7290
- info.g.setColor(Color.cyan);
7291
- 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);
72927430 // if (CameraPane.Xmin > spot.x)
72937431 // {
72947432 // CameraPane.Xmin = spot.x;
....@@ -7308,9 +7446,9 @@
73087446 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
73097447 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
73107448 spot.translate(0, -32);
7311
- info.g.setColor(Color.yellow);
7312
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7313
- 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);
73147452 // if (CameraPane.Xmin > spot.x)
73157453 // {
73167454 // CameraPane.Xmin = spot.x;
....@@ -7327,8 +7465,8 @@
73277465 // {
73287466 // CameraPane.Ymax = spoth;
73297467 // }
7330
- info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY,
7331
- (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);
73327470 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
73337471 // if (CameraPane.Xmin > boundary.x)
73347472 // {
....@@ -7350,7 +7488,8 @@
73507488 }
73517489 }
73527490
7353
- boolean doEditClick0(ClickInfo info, int level)
7491
+ boolean doEditClick0(//ClickInfo clickInfo,
7492
+ int level)
73547493 {
73557494 if (level == 0)
73567495 {
....@@ -7359,8 +7498,8 @@
73597498
73607499 boolean retval = false;
73617500
7362
- startX = info.x;
7363
- startY = info.y;
7501
+ startX = clickInfo.x;
7502
+ startY = clickInfo.y;
73647503
73657504 hitSomething = -1;
73667505 cVector origin = new cVector();
....@@ -7370,22 +7509,51 @@
73707509 {
73717510 centerPt = new Point(0, 0);
73727511 }
7373
- calcHotSpot(origin, info, centerPt, spot);
7374
- if (spot.contains(info.x, info.y))
7512
+ calcHotSpot(origin, //info,
7513
+ centerPt, spot);
7514
+ if (spot.contains(clickInfo.x, clickInfo.y))
73757515 {
73767516 hitSomething = hitCenter;
73777517 retval = true;
73787518 }
73797519 spot.translate(32, 0);
7380
- if (spot.contains(info.x, info.y))
7520
+ if (spot.contains(clickInfo.x, clickInfo.y))
73817521 {
73827522 hitSomething = hitRotate;
73837523 retval = true;
73847524 }
73857525 spot.translate(0, 32);
7386
- if (spot.contains(info.x, info.y))
7526
+ if (spot.contains(clickInfo.x, clickInfo.y))
73877527 {
73887528 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
+
73897557 retval = true;
73907558 }
73917559
....@@ -7395,7 +7563,7 @@
73957563 }
73967564
73977565 //System.out.println("info.modifiers = " + info.modifiers);
7398
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7566
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
73997567 //System.out.println("modified = " + modified);
74007568 //new Exception().printStackTrace();
74017569 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7423,7 +7591,8 @@
74237591 return true;
74247592 }
74257593
7426
- void doEditDrag0(ClickInfo info, boolean opposite)
7594
+ void doEditDrag0(//ClickInfo info,
7595
+ boolean opposite)
74277596 {
74287597 if (hitSomething == 0)
74297598 {
....@@ -7437,7 +7606,7 @@
74377606
74387607 //System.out.println("hitSomething = " + hitSomething);
74397608
7440
- double scale = 0.005f * info.camera.Distance();
7609
+ double scale = 0.005f * clickInfo.camera.Distance();
74417610
74427611 cVector xlate = new cVector();
74437612 //cVector xlate2 = new cVector();
....@@ -7471,8 +7640,8 @@
74717640 toParent[3][i] = xlate.get(i);
74727641 LA.matInvert(toParent, fromParent);
74737642 */
7474
- cVector delta = LA.newVector(0, 0, startY - info.y);
7475
- 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);
74767645
74777646 LA.matCopy(startMat, toParent);
74787647 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7481,7 +7650,7 @@
74817650 } else
74827651 {
74837652 //LA.xformDir(delta, info.camera.fromScreen, delta);
7484
- cVector up = new cVector(info.camera.up);
7653
+ cVector up = new cVector(clickInfo.camera.up);
74857654 cVector away = new cVector();
74867655 //cVector right2 = new cVector();
74877656 //LA.vecCross(up, cVector.Z, right);
....@@ -7498,19 +7667,19 @@
74987667 LA.xformDir(up, ClickInfo.matbuffer, up);
74997668 // if (!CameraPane.LOCALTRANSFORM)
75007669 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7501
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7670
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
75027671 // if (!CameraPane.LOCALTRANSFORM)
75037672 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
75047673 //LA.vecCross(up, cVector.Z, right2);
75057674
7506
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7675
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
75077676
75087677 //System.out.println("DELTA0 = " + delta);
75097678 //System.out.println("AWAY = " + info.camera.away);
75107679 //System.out.println("UP = " + info.camera.up);
75117680 if (away.z > 0)
75127681 {
7513
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7682
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
75147683 {
75157684 delta.x = -delta.x;
75167685 } else
....@@ -7525,7 +7694,7 @@
75257694 //System.out.println("DELTA1 = " + delta);
75267695 LA.xformDir(delta, ClickInfo.matbuffer, delta);
75277696 //System.out.println("DELTA2 = " + delta);
7528
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7697
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
75297698 LA.matCopy(startMat, toParent);
75307699 //System.out.println("DELTA3 = " + delta);
75317700 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7535,8 +7704,8 @@
75357704 break;
75367705
75377706 case hitRotate: // rotate
7538
- int dx = info.x - centerPt.x;
7539
- int dy = -(info.y - centerPt.y);
7707
+ int dx = clickInfo.x - centerPt.x;
7708
+ int dy = -(clickInfo.y - centerPt.y);
75407709 double angle = (double) Math.atan2(dx, dy);
75417710 angle = -(1.570796 - angle);
75427711
....@@ -7559,7 +7728,7 @@
75597728 }
75607729 /**/
75617730
7562
- switch (info.pane.RenderCamera().viewCode)
7731
+ switch (clickInfo.pane.RenderCamera().viewCode)
75637732 {
75647733 case 1: // '\001'
75657734 LA.matZRotate(toParent, angle);
....@@ -7586,7 +7755,7 @@
75867755 break;
75877756
75887757 case hitScale: // scale
7589
- double hScale = (double) (info.x - centerPt.x) / 32;
7758
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
75907759 double sign = 1;
75917760 if (hScale < 0)
75927761 {
....@@ -7598,7 +7767,7 @@
75987767 //hScale = 0.01;
75997768 }
76007769
7601
- double vScale = (double) (info.y - centerPt.y) / 32;
7770
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
76027771 sign = 1;
76037772 if (vScale < 0)
76047773 {
....@@ -7609,6 +7778,7 @@
76097778 {
76107779 //vScale = 0.01;
76117780 }
7781
+
76127782 LA.matCopy(startMat, toParent);
76137783 /**/
76147784 for (int i = 0; i < 3; i++)
....@@ -7618,14 +7788,14 @@
76187788 }
76197789 /**/
76207790
7621
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7791
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
76227792
76237793 if (totalScale < 0.01)
76247794 {
76257795 totalScale = 0.01;
76267796 }
76277797
7628
- switch (info.pane.RenderCamera().viewCode)
7798
+ switch (clickInfo.pane.RenderCamera().viewCode)
76297799 {
76307800 case 3: // '\001'
76317801 if (modified || opposite)
....@@ -7692,7 +7862,7 @@
76927862 } // NEW ...
76937863
76947864
7695
- info.pane.repaint();
7865
+ clickInfo.pane.repaint();
76967866 }
76977867
76987868 boolean overflow = false;