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,6 +30,12 @@
2930 Object3D saveskeleton;
3031 //
3132
33
+ String skyboxname;
34
+ String skyboxext;
35
+
36
+ Object3D versionlist[];
37
+ int versionindex = -1;
38
+
3239 ScriptNode scriptnode;
3340
3441 void InitOthers()
....@@ -215,6 +222,9 @@
215222 // o.transientrep = this.bRep.support;
216223 // o.bRep.support = null;
217224 // }
225
+ o.selection = this.selection;
226
+ o.versionlist = this.versionlist;
227
+ o.versionindex = this.versionindex;
218228
219229 if (this.support != null)
220230 {
....@@ -236,6 +246,29 @@
236246 // this.support = null;
237247 // this.fileparent = null;
238248 }
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
+// }
239272
240273 void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable)
241274 {
....@@ -268,6 +301,11 @@
268301 {
269302 this.support.bRep = o.transientrep;
270303 }
304
+
305
+ this.selection = o.selection;
306
+
307
+ this.versionlist = o.versionlist;
308
+ this.versionindex = o.versionindex;
271309 // July 2019 if (this.bRep != null)
272310 // this.bRep.support = o.transientrep;
273311 // this.support = o.support;
....@@ -415,6 +453,7 @@
415453 }
416454
417455 boolean live = false;
456
+ transient boolean keepdontselect;
418457 boolean dontselect = false;
419458 boolean hide = false;
420459 boolean link2master = false; // performs reset support/master at each frame
....@@ -999,6 +1038,9 @@
9991038
10001039 if (material == null || material.multiply)
10011040 return true;
1041
+
1042
+ if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
1043
+ return false;
10021044
10031045 // Transparent objects are dynamic because we have to sort the triangles.
10041046 return material.opacity > 0.99;
....@@ -2555,7 +2597,8 @@
25552597 private static final int editSelf = 1;
25562598 private static final int editChild = 2;
25572599
2558
- void drawEditHandles(ClickInfo info, int level)
2600
+ void drawEditHandles(//ClickInfo info,
2601
+ int level)
25592602 {
25602603 if (level == 0)
25612604 {
....@@ -2563,7 +2606,8 @@
25632606 return;
25642607
25652608 Object3D selectee;
2566
- 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))
25672611 {
25682612 selectee = (Object3D) e.nextElement();
25692613 }
....@@ -2571,19 +2615,22 @@
25712615 } else
25722616 {
25732617 //super.
2574
- drawEditHandles0(info, level + 1);
2618
+ drawEditHandles0(//info,
2619
+ level + 1);
25752620 }
25762621 }
25772622
2578
- boolean doEditClick(ClickInfo info, int level)
2623
+ boolean doEditClick(//ClickInfo info,
2624
+ int level)
25792625 {
25802626 doSomething = 0;
25812627 if (level == 0)
25822628 {
2583
- return doParentClick(info);
2629
+ return doParentClick(); //info);
25842630 }
25852631 if (//super.
2586
- doEditClick0(info, level))
2632
+ doEditClick0(//info,
2633
+ level))
25872634 {
25882635 doSomething = 1;
25892636 return true;
....@@ -2593,7 +2640,7 @@
25932640 }
25942641 }
25952642
2596
- boolean doParentClick(ClickInfo info)
2643
+ boolean doParentClick() //ClickInfo info)
25972644 {
25982645 if (selection == null)
25992646 {
....@@ -2606,7 +2653,8 @@
26062653 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
26072654 {
26082655 Object3D selectee = (Object3D) e.nextElement();
2609
- if (selectee.doEditClick(info, 1))
2656
+ if (selectee.doEditClick(//info,
2657
+ 1))
26102658 {
26112659 childToDrag = selectee;
26122660 doSomething = 2;
....@@ -2618,13 +2666,15 @@
26182666 return retval;
26192667 }
26202668
2621
- void doEditDrag(ClickInfo info, boolean opposite)
2669
+ void doEditDrag(//ClickInfo clickInfo,
2670
+ boolean opposite)
26222671 {
26232672 switch (doSomething)
26242673 {
26252674 case 1: // '\001'
26262675 //super.
2627
- doEditDrag0(info, opposite);
2676
+ doEditDrag0(//clickInfo,
2677
+ opposite);
26282678 break;
26292679
26302680 case 2: // '\002'
....@@ -2637,11 +2687,13 @@
26372687 {
26382688 //sel.hitSomething = childToDrag.hitSomething;
26392689 //childToDrag.doEditDrag(info);
2640
- sel.doEditDrag(info, opposite);
2690
+ sel.doEditDrag(//clickInfo,
2691
+ opposite);
26412692 } else
26422693 {
26432694 //super.
2644
- doEditDrag0(info, opposite);
2695
+ doEditDrag0(//clickInfo,
2696
+ opposite);
26452697 }
26462698 }
26472699 break;
....@@ -2659,6 +2711,9 @@
26592711 {
26602712 deselectAll();
26612713 }
2714
+
2715
+ new Exception().printStackTrace();
2716
+
26622717 ClickInfo newInfo = new ClickInfo();
26632718 newInfo.flags = info.flags;
26642719 newInfo.bounds = info.bounds;
....@@ -3106,7 +3161,7 @@
31063161 {
31073162 if (bRep != null)
31083163 {
3109
- bRep.GenerateNormalsMINE();
3164
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
31103165 Touch();
31113166 }
31123167 }
....@@ -5409,6 +5464,51 @@
54095464 blockloop = false;
54105465 }
54115466
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
+
54125512 boolean IsSelected()
54135513 {
54145514 if (parent == null)
....@@ -5718,6 +5818,38 @@
57185818 }
57195819 }
57205820
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
+
57215853 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57225854 {
57235855 Draw(display, root, selected, blocked);
....@@ -5804,8 +5936,10 @@
58045936 if (support != null)
58055937 support = support;
58065938
5807
- //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5808
- 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.
58095943
58105944 if (!usecalllists && bRep != null && bRep.displaylist > 0)
58115945 {
....@@ -5815,8 +5949,9 @@
58155949 // usecalllists &= !(parent instanceof RandomNode);
58165950 // usecalllists = false;
58175951
5818
- if (GetBRep() != null)
5819
- usecalllists = usecalllists;
5952
+ if (display.DrawMode() == display.SHADOW)
5953
+ //GetBRep() != null)
5954
+ usecalllists = !!usecalllists;
58205955 //System.out.println("draw " + this);
58215956 //new Exception().printStackTrace();
58225957
....@@ -5838,7 +5973,7 @@
58385973 if (!(this instanceof Composite))
58395974 touched = false;
58405975 //if (displaylist == -1 && usecalllists)
5841
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5976
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
58425977 {
58435978 bRep.displaylist = display.GenList();
58445979 assert(bRep.displaylist != 0);
....@@ -5849,7 +5984,7 @@
58495984
58505985 //System.out.println("\tnew list " + list);
58515986 //gl.glDrawBuffer(gl.GL_NONE);
5852
- if (usecalllists)
5987
+ if (usecalllists && bRep.displaylist > 0)
58535988 {
58545989 // System.err.println("new list " + bRep.displaylist + " for " + this);
58555990 display.NewList(bRep.displaylist);
....@@ -5858,7 +5993,7 @@
58585993 CallList(display, root, selected, blocked);
58595994
58605995 // compiled = true;
5861
- if (usecalllists)
5996
+ if (usecalllists && bRep.displaylist > 0)
58625997 {
58635998 // System.err.println("end list " + bRep.displaylist + " for " + this);
58645999 display.EndList();
....@@ -7209,20 +7344,23 @@
72097344 }
72107345 }
72117346
7212
- 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)
72137351 {
7214
- int hc = info.bounds.x + info.bounds.width / 2;
7215
- int vc = info.bounds.y + info.bounds.height / 2;
7216
- 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;
72177355 if (toscreen == null)
72187356 {
7219
- toscreen = new Camera(info.camera.viewCode).toScreen;
7357
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
72207358 }
72217359 cVector vec = in;
72227360 LA.xformPos(in, toscreen, in);
72237361 //System.out.println("Distance = " + info.camera.Distance());
7224
- vec.x *= 100 * info.camera.SCALE / info.camera.Distance();
7225
- 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();
72267364 outPt.x = hc + (int) vec.x;
72277365 outPt.y = vc - (int) vec.y;
72287366 outRec.x = outPt.x - 3;
....@@ -7230,15 +7368,18 @@
72307368 outRec.width = outRec.height = 6;
72317369 }
72327370
7233
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7371
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7372
+ )
72347373 {
72357374 Point pt = new Point(0, 0);
72367375 Rectangle rec = new Rectangle();
7237
- calcHotSpot(in, info, pt, rec);
7376
+ calcHotSpot(in, //clickInfo,
7377
+ pt, rec);
72387378 return rec;
72397379 }
72407380
7241
- void drawEditHandles0(ClickInfo info, int level)
7381
+ void drawEditHandles0(//ClickInfo clickInfo,
7382
+ int level)
72427383 {
72437384 if (level == 0)
72447385 {
....@@ -7247,16 +7388,19 @@
72477388 {
72487389 cVector origin = new cVector();
72497390 //LA.xformPos(origin, toParent, origin);
7250
- Rectangle spot = calcHotSpot(origin, info);
7391
+ if (this.clickInfo == null)
7392
+ this.clickInfo = new ClickInfo();
7393
+
7394
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
72517395 Rectangle boundary = new Rectangle();
72527396 boundary.x = spot.x - 30;
72537397 boundary.y = spot.y - 30;
72547398 boundary.width = spot.width + 60;
72557399 boundary.height = spot.height + 60;
7256
- info.g.setColor(Color.red);
7400
+ clickInfo.g.setColor(Color.red);
72577401 int spotw = spot.x + spot.width;
72587402 int spoth = spot.y + spot.height;
7259
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7403
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72607404 // if (CameraPane.Xmin > spot.x)
72617405 // {
72627406 // CameraPane.Xmin = spot.x;
....@@ -7276,8 +7420,8 @@
72767420 spot.translate(32, 32);
72777421 spotw = spot.x + spot.width;
72787422 spoth = spot.y + spot.height;
7279
- info.g.setColor(Color.cyan);
7280
- 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);
72817425 // if (CameraPane.Xmin > spot.x)
72827426 // {
72837427 // CameraPane.Xmin = spot.x;
....@@ -7297,9 +7441,9 @@
72977441 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
72987442 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
72997443 spot.translate(0, -32);
7300
- info.g.setColor(Color.yellow);
7301
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7302
- 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);
73037447 // if (CameraPane.Xmin > spot.x)
73047448 // {
73057449 // CameraPane.Xmin = spot.x;
....@@ -7316,8 +7460,8 @@
73167460 // {
73177461 // CameraPane.Ymax = spoth;
73187462 // }
7319
- info.g.drawArc(boundary.x + info.DX, boundary.y + info.DY,
7320
- (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);
73217465 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
73227466 // if (CameraPane.Xmin > boundary.x)
73237467 // {
....@@ -7339,7 +7483,8 @@
73397483 }
73407484 }
73417485
7342
- boolean doEditClick0(ClickInfo info, int level)
7486
+ boolean doEditClick0(//ClickInfo clickInfo,
7487
+ int level)
73437488 {
73447489 if (level == 0)
73457490 {
....@@ -7348,8 +7493,8 @@
73487493
73497494 boolean retval = false;
73507495
7351
- startX = info.x;
7352
- startY = info.y;
7496
+ startX = clickInfo.x;
7497
+ startY = clickInfo.y;
73537498
73547499 hitSomething = -1;
73557500 cVector origin = new cVector();
....@@ -7359,22 +7504,51 @@
73597504 {
73607505 centerPt = new Point(0, 0);
73617506 }
7362
- calcHotSpot(origin, info, centerPt, spot);
7363
- if (spot.contains(info.x, info.y))
7507
+ calcHotSpot(origin, //info,
7508
+ centerPt, spot);
7509
+ if (spot.contains(clickInfo.x, clickInfo.y))
73647510 {
73657511 hitSomething = hitCenter;
73667512 retval = true;
73677513 }
73687514 spot.translate(32, 0);
7369
- if (spot.contains(info.x, info.y))
7515
+ if (spot.contains(clickInfo.x, clickInfo.y))
73707516 {
73717517 hitSomething = hitRotate;
73727518 retval = true;
73737519 }
73747520 spot.translate(0, 32);
7375
- if (spot.contains(info.x, info.y))
7521
+ if (spot.contains(clickInfo.x, clickInfo.y))
73767522 {
73777523 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
+
73787552 retval = true;
73797553 }
73807554
....@@ -7384,7 +7558,7 @@
73847558 }
73857559
73867560 //System.out.println("info.modifiers = " + info.modifiers);
7387
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7561
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
73887562 //System.out.println("modified = " + modified);
73897563 //new Exception().printStackTrace();
73907564 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7412,7 +7586,8 @@
74127586 return true;
74137587 }
74147588
7415
- void doEditDrag0(ClickInfo info, boolean opposite)
7589
+ void doEditDrag0(//ClickInfo info,
7590
+ boolean opposite)
74167591 {
74177592 if (hitSomething == 0)
74187593 {
....@@ -7426,7 +7601,7 @@
74267601
74277602 //System.out.println("hitSomething = " + hitSomething);
74287603
7429
- double scale = 0.005f * info.camera.Distance();
7604
+ double scale = 0.005f * clickInfo.camera.Distance();
74307605
74317606 cVector xlate = new cVector();
74327607 //cVector xlate2 = new cVector();
....@@ -7460,8 +7635,8 @@
74607635 toParent[3][i] = xlate.get(i);
74617636 LA.matInvert(toParent, fromParent);
74627637 */
7463
- cVector delta = LA.newVector(0, 0, startY - info.y);
7464
- 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);
74657640
74667641 LA.matCopy(startMat, toParent);
74677642 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7470,7 +7645,7 @@
74707645 } else
74717646 {
74727647 //LA.xformDir(delta, info.camera.fromScreen, delta);
7473
- cVector up = new cVector(info.camera.up);
7648
+ cVector up = new cVector(clickInfo.camera.up);
74747649 cVector away = new cVector();
74757650 //cVector right2 = new cVector();
74767651 //LA.vecCross(up, cVector.Z, right);
....@@ -7487,19 +7662,19 @@
74877662 LA.xformDir(up, ClickInfo.matbuffer, up);
74887663 // if (!CameraPane.LOCALTRANSFORM)
74897664 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7490
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7665
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
74917666 // if (!CameraPane.LOCALTRANSFORM)
74927667 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
74937668 //LA.vecCross(up, cVector.Z, right2);
74947669
7495
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7670
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
74967671
74977672 //System.out.println("DELTA0 = " + delta);
74987673 //System.out.println("AWAY = " + info.camera.away);
74997674 //System.out.println("UP = " + info.camera.up);
75007675 if (away.z > 0)
75017676 {
7502
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7677
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
75037678 {
75047679 delta.x = -delta.x;
75057680 } else
....@@ -7514,7 +7689,7 @@
75147689 //System.out.println("DELTA1 = " + delta);
75157690 LA.xformDir(delta, ClickInfo.matbuffer, delta);
75167691 //System.out.println("DELTA2 = " + delta);
7517
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7692
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
75187693 LA.matCopy(startMat, toParent);
75197694 //System.out.println("DELTA3 = " + delta);
75207695 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7524,8 +7699,8 @@
75247699 break;
75257700
75267701 case hitRotate: // rotate
7527
- int dx = info.x - centerPt.x;
7528
- int dy = -(info.y - centerPt.y);
7702
+ int dx = clickInfo.x - centerPt.x;
7703
+ int dy = -(clickInfo.y - centerPt.y);
75297704 double angle = (double) Math.atan2(dx, dy);
75307705 angle = -(1.570796 - angle);
75317706
....@@ -7548,7 +7723,7 @@
75487723 }
75497724 /**/
75507725
7551
- switch (info.pane.RenderCamera().viewCode)
7726
+ switch (clickInfo.pane.RenderCamera().viewCode)
75527727 {
75537728 case 1: // '\001'
75547729 LA.matZRotate(toParent, angle);
....@@ -7575,7 +7750,7 @@
75757750 break;
75767751
75777752 case hitScale: // scale
7578
- double hScale = (double) (info.x - centerPt.x) / 32;
7753
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
75797754 double sign = 1;
75807755 if (hScale < 0)
75817756 {
....@@ -7587,7 +7762,7 @@
75877762 //hScale = 0.01;
75887763 }
75897764
7590
- double vScale = (double) (info.y - centerPt.y) / 32;
7765
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75917766 sign = 1;
75927767 if (vScale < 0)
75937768 {
....@@ -7598,6 +7773,7 @@
75987773 {
75997774 //vScale = 0.01;
76007775 }
7776
+
76017777 LA.matCopy(startMat, toParent);
76027778 /**/
76037779 for (int i = 0; i < 3; i++)
....@@ -7607,14 +7783,14 @@
76077783 }
76087784 /**/
76097785
7610
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7786
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
76117787
76127788 if (totalScale < 0.01)
76137789 {
76147790 totalScale = 0.01;
76157791 }
76167792
7617
- switch (info.pane.RenderCamera().viewCode)
7793
+ switch (clickInfo.pane.RenderCamera().viewCode)
76187794 {
76197795 case 3: // '\001'
76207796 if (modified || opposite)
....@@ -7681,7 +7857,7 @@
76817857 } // NEW ...
76827858
76837859
7684
- info.pane.repaint();
7860
+ clickInfo.pane.repaint();
76857861 }
76867862
76877863 boolean overflow = false;