Normand Briere
2019-08-08 8294241adc5fe698b70e13ebd6780af46ab83f7e
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;
....@@ -2426,6 +2468,7 @@
24262468 else
24272469 {
24282470 //((ObjEditor)editWindow).SetupUI2(null);
2471
+ ((ObjEditor)objectUI).pinButton.setSelected(pinned);
24292472 }
24302473 }
24312474
....@@ -2555,7 +2598,8 @@
25552598 private static final int editSelf = 1;
25562599 private static final int editChild = 2;
25572600
2558
- void drawEditHandles(ClickInfo info, int level)
2601
+ void drawEditHandles(//ClickInfo info,
2602
+ int level)
25592603 {
25602604 if (level == 0)
25612605 {
....@@ -2563,7 +2607,8 @@
25632607 return;
25642608
25652609 Object3D selectee;
2566
- for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(info, level + 1))
2610
+ for (java.util.Enumeration e = selection.elements(); e.hasMoreElements(); selectee.drawEditHandles(//info,
2611
+ level + 1))
25672612 {
25682613 selectee = (Object3D) e.nextElement();
25692614 }
....@@ -2571,19 +2616,22 @@
25712616 } else
25722617 {
25732618 //super.
2574
- drawEditHandles0(info, level + 1);
2619
+ drawEditHandles0(//info,
2620
+ level + 1);
25752621 }
25762622 }
25772623
2578
- boolean doEditClick(ClickInfo info, int level)
2624
+ boolean doEditClick(//ClickInfo info,
2625
+ int level)
25792626 {
25802627 doSomething = 0;
25812628 if (level == 0)
25822629 {
2583
- return doParentClick(info);
2630
+ return doParentClick(); //info);
25842631 }
25852632 if (//super.
2586
- doEditClick0(info, level))
2633
+ doEditClick0(//info,
2634
+ level))
25872635 {
25882636 doSomething = 1;
25892637 return true;
....@@ -2593,7 +2641,7 @@
25932641 }
25942642 }
25952643
2596
- boolean doParentClick(ClickInfo info)
2644
+ boolean doParentClick() //ClickInfo info)
25972645 {
25982646 if (selection == null)
25992647 {
....@@ -2606,7 +2654,8 @@
26062654 for (java.util.Enumeration e = selection.elements(); e.hasMoreElements();)
26072655 {
26082656 Object3D selectee = (Object3D) e.nextElement();
2609
- if (selectee.doEditClick(info, 1))
2657
+ if (selectee.doEditClick(//info,
2658
+ 1))
26102659 {
26112660 childToDrag = selectee;
26122661 doSomething = 2;
....@@ -2618,13 +2667,15 @@
26182667 return retval;
26192668 }
26202669
2621
- void doEditDrag(ClickInfo info, boolean opposite)
2670
+ void doEditDrag(//ClickInfo clickInfo,
2671
+ boolean opposite)
26222672 {
26232673 switch (doSomething)
26242674 {
26252675 case 1: // '\001'
26262676 //super.
2627
- doEditDrag0(info, opposite);
2677
+ doEditDrag0(//clickInfo,
2678
+ opposite);
26282679 break;
26292680
26302681 case 2: // '\002'
....@@ -2637,11 +2688,13 @@
26372688 {
26382689 //sel.hitSomething = childToDrag.hitSomething;
26392690 //childToDrag.doEditDrag(info);
2640
- sel.doEditDrag(info, opposite);
2691
+ sel.doEditDrag(//clickInfo,
2692
+ opposite);
26412693 } else
26422694 {
26432695 //super.
2644
- doEditDrag0(info, opposite);
2696
+ doEditDrag0(//clickInfo,
2697
+ opposite);
26452698 }
26462699 }
26472700 break;
....@@ -2659,6 +2712,9 @@
26592712 {
26602713 deselectAll();
26612714 }
2715
+
2716
+ new Exception().printStackTrace();
2717
+
26622718 ClickInfo newInfo = new ClickInfo();
26632719 newInfo.flags = info.flags;
26642720 newInfo.bounds = info.bounds;
....@@ -3106,7 +3162,7 @@
31063162 {
31073163 if (bRep != null)
31083164 {
3109
- bRep.GenerateNormalsMINE();
3165
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
31103166 Touch();
31113167 }
31123168 }
....@@ -5409,6 +5465,51 @@
54095465 blockloop = false;
54105466 }
54115467
5468
+ void ResetSelectable()
5469
+ {
5470
+ if (blockloop)
5471
+ return;
5472
+
5473
+ blockloop = true;
5474
+
5475
+ keepdontselect = dontselect;
5476
+ dontselect = true;
5477
+
5478
+ Object3D child;
5479
+ int nb = Size();
5480
+ for (int i = 0; i < nb; i++)
5481
+ {
5482
+ child = (Object3D) get(i);
5483
+ if (child == null)
5484
+ continue;
5485
+ child.ResetSelectable();
5486
+ }
5487
+
5488
+ blockloop = false;
5489
+ }
5490
+
5491
+ void RestoreSelectable()
5492
+ {
5493
+ if (blockloop)
5494
+ return;
5495
+
5496
+ blockloop = true;
5497
+
5498
+ dontselect = keepdontselect;
5499
+
5500
+ Object3D child;
5501
+ int nb = Size();
5502
+ for (int i = 0; i < nb; i++)
5503
+ {
5504
+ child = (Object3D) get(i);
5505
+ if (child == null)
5506
+ continue;
5507
+ child.RestoreSelectable();
5508
+ }
5509
+
5510
+ blockloop = false;
5511
+ }
5512
+
54125513 boolean IsSelected()
54135514 {
54145515 if (parent == null)
....@@ -5718,6 +5819,38 @@
57185819 }
57195820 }
57205821
5822
+ void EmbedTextures(boolean embed)
5823
+ {
5824
+ if (blockloop)
5825
+ return;
5826
+
5827
+ //if (GetTextures() != null)
5828
+ if (embed)
5829
+ CameraPane.EmbedTextures(GetTextures());
5830
+ else
5831
+ {
5832
+ GetTextures().pigmentdata = null;
5833
+ GetTextures().bumpdata = null;
5834
+ GetTextures().pw = 0;
5835
+ GetTextures().ph = 0;
5836
+ GetTextures().bw = 0;
5837
+ GetTextures().bh = 0;
5838
+ }
5839
+
5840
+ int nb = Size();
5841
+ for (int i = 0; i < nb; i++)
5842
+ {
5843
+ Object3D child = (Object3D) get(i);
5844
+
5845
+ if (child == null)
5846
+ continue;
5847
+
5848
+ blockloop = true;
5849
+ child.EmbedTextures(embed);
5850
+ blockloop = false;
5851
+ }
5852
+ }
5853
+
57215854 void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57225855 {
57235856 Draw(display, root, selected, blocked);
....@@ -5804,8 +5937,10 @@
58045937 if (support != null)
58055938 support = support;
58065939
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);
5940
+ boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5941
+ //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5942
+
5943
+ //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
58095944
58105945 if (!usecalllists && bRep != null && bRep.displaylist > 0)
58115946 {
....@@ -5815,8 +5950,9 @@
58155950 // usecalllists &= !(parent instanceof RandomNode);
58165951 // usecalllists = false;
58175952
5818
- if (GetBRep() != null)
5819
- usecalllists = usecalllists;
5953
+ if (display.DrawMode() == display.SHADOW)
5954
+ //GetBRep() != null)
5955
+ usecalllists = !!usecalllists;
58205956 //System.out.println("draw " + this);
58215957 //new Exception().printStackTrace();
58225958
....@@ -5838,7 +5974,7 @@
58385974 if (!(this instanceof Composite))
58395975 touched = false;
58405976 //if (displaylist == -1 && usecalllists)
5841
- if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
5977
+ if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013
58425978 {
58435979 bRep.displaylist = display.GenList();
58445980 assert(bRep.displaylist != 0);
....@@ -5849,7 +5985,7 @@
58495985
58505986 //System.out.println("\tnew list " + list);
58515987 //gl.glDrawBuffer(gl.GL_NONE);
5852
- if (usecalllists)
5988
+ if (usecalllists && bRep.displaylist > 0)
58535989 {
58545990 // System.err.println("new list " + bRep.displaylist + " for " + this);
58555991 display.NewList(bRep.displaylist);
....@@ -5858,7 +5994,7 @@
58585994 CallList(display, root, selected, blocked);
58595995
58605996 // compiled = true;
5861
- if (usecalllists)
5997
+ if (usecalllists && bRep.displaylist > 0)
58625998 {
58635999 // System.err.println("end list " + bRep.displaylist + " for " + this);
58646000 display.EndList();
....@@ -7209,20 +7345,23 @@
72097345 }
72107346 }
72117347
7212
- protected void calcHotSpot(cVector in, ClickInfo info, Point outPt, Rectangle outRec)
7348
+ static ClickInfo clickInfo = new ClickInfo();
7349
+
7350
+ protected void calcHotSpot(cVector in, //ClickInfo clickInfo,
7351
+ Point outPt, Rectangle outRec)
72137352 {
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;
7353
+ int hc = clickInfo.bounds.x + clickInfo.bounds.width / 2;
7354
+ int vc = clickInfo.bounds.y + clickInfo.bounds.height / 2;
7355
+ double[][] toscreen = clickInfo.toScreen;
72177356 if (toscreen == null)
72187357 {
7219
- toscreen = new Camera(info.camera.viewCode).toScreen;
7358
+ toscreen = new Camera(clickInfo.camera.viewCode).toScreen;
72207359 }
72217360 cVector vec = in;
72227361 LA.xformPos(in, toscreen, in);
72237362 //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();
7363
+ vec.x *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
7364
+ vec.y *= 100 * clickInfo.camera.SCALE / clickInfo.camera.Distance();
72267365 outPt.x = hc + (int) vec.x;
72277366 outPt.y = vc - (int) vec.y;
72287367 outRec.x = outPt.x - 3;
....@@ -7230,15 +7369,18 @@
72307369 outRec.width = outRec.height = 6;
72317370 }
72327371
7233
- protected Rectangle calcHotSpot(cVector in, ClickInfo info)
7372
+ protected Rectangle calcHotSpot(cVector in//, ClickInfo clickInfo
7373
+ )
72347374 {
72357375 Point pt = new Point(0, 0);
72367376 Rectangle rec = new Rectangle();
7237
- calcHotSpot(in, info, pt, rec);
7377
+ calcHotSpot(in, //clickInfo,
7378
+ pt, rec);
72387379 return rec;
72397380 }
72407381
7241
- void drawEditHandles0(ClickInfo info, int level)
7382
+ void drawEditHandles0(//ClickInfo clickInfo,
7383
+ int level)
72427384 {
72437385 if (level == 0)
72447386 {
....@@ -7247,16 +7389,19 @@
72477389 {
72487390 cVector origin = new cVector();
72497391 //LA.xformPos(origin, toParent, origin);
7250
- Rectangle spot = calcHotSpot(origin, info);
7392
+ if (this.clickInfo == null)
7393
+ this.clickInfo = new ClickInfo();
7394
+
7395
+ Rectangle spot = calcHotSpot(origin); //, clickInfo);
72517396 Rectangle boundary = new Rectangle();
72527397 boundary.x = spot.x - 30;
72537398 boundary.y = spot.y - 30;
72547399 boundary.width = spot.width + 60;
72557400 boundary.height = spot.height + 60;
7256
- info.g.setColor(Color.red);
7401
+ clickInfo.g.setColor(Color.red);
72577402 int spotw = spot.x + spot.width;
72587403 int spoth = spot.y + spot.height;
7259
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7404
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72607405 // if (CameraPane.Xmin > spot.x)
72617406 // {
72627407 // CameraPane.Xmin = spot.x;
....@@ -7276,8 +7421,8 @@
72767421 spot.translate(32, 32);
72777422 spotw = spot.x + spot.width;
72787423 spoth = spot.y + spot.height;
7279
- info.g.setColor(Color.cyan);
7280
- info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7424
+ clickInfo.g.setColor(Color.cyan);
7425
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
72817426 // if (CameraPane.Xmin > spot.x)
72827427 // {
72837428 // CameraPane.Xmin = spot.x;
....@@ -7297,9 +7442,9 @@
72977442 // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
72987443 //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
72997444 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);
7445
+ clickInfo.g.setColor(Color.yellow);
7446
+ clickInfo.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7447
+ clickInfo.g.setColor(Color.green);
73037448 // if (CameraPane.Xmin > spot.x)
73047449 // {
73057450 // CameraPane.Xmin = spot.x;
....@@ -7316,8 +7461,8 @@
73167461 // {
73177462 // CameraPane.Ymax = spoth;
73187463 // }
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);
7464
+ clickInfo.g.drawArc(boundary.x + clickInfo.DX, boundary.y + clickInfo.DY,
7465
+ (int)(boundary.width * clickInfo.W), (int)(boundary.height * clickInfo.W), 0, 360);
73217466 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
73227467 // if (CameraPane.Xmin > boundary.x)
73237468 // {
....@@ -7339,7 +7484,8 @@
73397484 }
73407485 }
73417486
7342
- boolean doEditClick0(ClickInfo info, int level)
7487
+ boolean doEditClick0(//ClickInfo clickInfo,
7488
+ int level)
73437489 {
73447490 if (level == 0)
73457491 {
....@@ -7348,8 +7494,8 @@
73487494
73497495 boolean retval = false;
73507496
7351
- startX = info.x;
7352
- startY = info.y;
7497
+ startX = clickInfo.x;
7498
+ startY = clickInfo.y;
73537499
73547500 hitSomething = -1;
73557501 cVector origin = new cVector();
....@@ -7359,22 +7505,51 @@
73597505 {
73607506 centerPt = new Point(0, 0);
73617507 }
7362
- calcHotSpot(origin, info, centerPt, spot);
7363
- if (spot.contains(info.x, info.y))
7508
+ calcHotSpot(origin, //info,
7509
+ centerPt, spot);
7510
+ if (spot.contains(clickInfo.x, clickInfo.y))
73647511 {
73657512 hitSomething = hitCenter;
73667513 retval = true;
73677514 }
73687515 spot.translate(32, 0);
7369
- if (spot.contains(info.x, info.y))
7516
+ if (spot.contains(clickInfo.x, clickInfo.y))
73707517 {
73717518 hitSomething = hitRotate;
73727519 retval = true;
73737520 }
73747521 spot.translate(0, 32);
7375
- if (spot.contains(info.x, info.y))
7522
+ if (spot.contains(clickInfo.x, clickInfo.y))
73767523 {
73777524 hitSomething = hitScale;
7525
+
7526
+ double scale = 0.005f * clickInfo.camera.Distance();
7527
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
7528
+ double sign = 1;
7529
+ if (hScale < 0)
7530
+ {
7531
+ sign = -1;
7532
+ }
7533
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
7534
+ if (hScale < 0.01)
7535
+ {
7536
+ //hScale = 0.01;
7537
+ }
7538
+
7539
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
7540
+ sign = 1;
7541
+ if (vScale < 0)
7542
+ {
7543
+ sign = -1;
7544
+ }
7545
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
7546
+ if (vScale < 0.01)
7547
+ {
7548
+ //vScale = 0.01;
7549
+ }
7550
+
7551
+ clickInfo.scale = Math.sqrt(hScale*hScale + vScale*vScale);
7552
+
73787553 retval = true;
73797554 }
73807555
....@@ -7384,7 +7559,7 @@
73847559 }
73857560
73867561 //System.out.println("info.modifiers = " + info.modifiers);
7387
- modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
7562
+ modified = (clickInfo.modifiers & CameraPane.SHIFT) != 0; // Was META
73887563 //System.out.println("modified = " + modified);
73897564 //new Exception().printStackTrace();
73907565 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7412,7 +7587,8 @@
74127587 return true;
74137588 }
74147589
7415
- void doEditDrag0(ClickInfo info, boolean opposite)
7590
+ void doEditDrag0(//ClickInfo info,
7591
+ boolean opposite)
74167592 {
74177593 if (hitSomething == 0)
74187594 {
....@@ -7426,7 +7602,7 @@
74267602
74277603 //System.out.println("hitSomething = " + hitSomething);
74287604
7429
- double scale = 0.005f * info.camera.Distance();
7605
+ double scale = 0.005f * clickInfo.camera.Distance();
74307606
74317607 cVector xlate = new cVector();
74327608 //cVector xlate2 = new cVector();
....@@ -7460,8 +7636,8 @@
74607636 toParent[3][i] = xlate.get(i);
74617637 LA.matInvert(toParent, fromParent);
74627638 */
7463
- cVector delta = LA.newVector(0, 0, startY - info.y);
7464
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7639
+ cVector delta = LA.newVector(0, 0, startY - clickInfo.y);
7640
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
74657641
74667642 LA.matCopy(startMat, toParent);
74677643 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7470,7 +7646,7 @@
74707646 } else
74717647 {
74727648 //LA.xformDir(delta, info.camera.fromScreen, delta);
7473
- cVector up = new cVector(info.camera.up);
7649
+ cVector up = new cVector(clickInfo.camera.up);
74747650 cVector away = new cVector();
74757651 //cVector right2 = new cVector();
74767652 //LA.vecCross(up, cVector.Z, right);
....@@ -7487,19 +7663,19 @@
74877663 LA.xformDir(up, ClickInfo.matbuffer, up);
74887664 // if (!CameraPane.LOCALTRANSFORM)
74897665 LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
7490
- LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
7666
+ LA.xformDir(clickInfo.camera.away, ClickInfo.matbuffer, away);
74917667 // if (!CameraPane.LOCALTRANSFORM)
74927668 LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
74937669 //LA.vecCross(up, cVector.Z, right2);
74947670
7495
- cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
7671
+ cVector delta = LA.newVector(clickInfo.x - startX, startY - clickInfo.y, 0);
74967672
74977673 //System.out.println("DELTA0 = " + delta);
74987674 //System.out.println("AWAY = " + info.camera.away);
74997675 //System.out.println("UP = " + info.camera.up);
75007676 if (away.z > 0)
75017677 {
7502
- if (info.camera.up.x == 0) // LA.vecDot(right, right2)<0)
7678
+ if (clickInfo.camera.up.x == 0) // LA.vecDot(right, right2)<0)
75037679 {
75047680 delta.x = -delta.x;
75057681 } else
....@@ -7514,7 +7690,7 @@
75147690 //System.out.println("DELTA1 = " + delta);
75157691 LA.xformDir(delta, ClickInfo.matbuffer, delta);
75167692 //System.out.println("DELTA2 = " + delta);
7517
- LA.xformDir(delta, new Camera(info.camera.viewCode).fromScreen, delta);
7693
+ LA.xformDir(delta, new Camera(clickInfo.camera.viewCode).fromScreen, delta);
75187694 LA.matCopy(startMat, toParent);
75197695 //System.out.println("DELTA3 = " + delta);
75207696 LA.matTranslate(toParent, delta.x * scale, delta.y * scale, delta.z * scale);
....@@ -7524,8 +7700,8 @@
75247700 break;
75257701
75267702 case hitRotate: // rotate
7527
- int dx = info.x - centerPt.x;
7528
- int dy = -(info.y - centerPt.y);
7703
+ int dx = clickInfo.x - centerPt.x;
7704
+ int dy = -(clickInfo.y - centerPt.y);
75297705 double angle = (double) Math.atan2(dx, dy);
75307706 angle = -(1.570796 - angle);
75317707
....@@ -7548,7 +7724,7 @@
75487724 }
75497725 /**/
75507726
7551
- switch (info.pane.RenderCamera().viewCode)
7727
+ switch (clickInfo.pane.RenderCamera().viewCode)
75527728 {
75537729 case 1: // '\001'
75547730 LA.matZRotate(toParent, angle);
....@@ -7575,7 +7751,7 @@
75757751 break;
75767752
75777753 case hitScale: // scale
7578
- double hScale = (double) (info.x - centerPt.x) / 32;
7754
+ double hScale = (double) (clickInfo.x - centerPt.x) / 32;
75797755 double sign = 1;
75807756 if (hScale < 0)
75817757 {
....@@ -7587,7 +7763,7 @@
75877763 //hScale = 0.01;
75887764 }
75897765
7590
- double vScale = (double) (info.y - centerPt.y) / 32;
7766
+ double vScale = (double) (clickInfo.y - centerPt.y) / 32;
75917767 sign = 1;
75927768 if (vScale < 0)
75937769 {
....@@ -7598,6 +7774,7 @@
75987774 {
75997775 //vScale = 0.01;
76007776 }
7777
+
76017778 LA.matCopy(startMat, toParent);
76027779 /**/
76037780 for (int i = 0; i < 3; i++)
....@@ -7607,14 +7784,14 @@
76077784 }
76087785 /**/
76097786
7610
- double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7787
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / clickInfo.scale;
76117788
76127789 if (totalScale < 0.01)
76137790 {
76147791 totalScale = 0.01;
76157792 }
76167793
7617
- switch (info.pane.RenderCamera().viewCode)
7794
+ switch (clickInfo.pane.RenderCamera().viewCode)
76187795 {
76197796 case 3: // '\001'
76207797 if (modified || opposite)
....@@ -7681,7 +7858,7 @@
76817858 } // NEW ...
76827859
76837860
7684
- info.pane.repaint();
7861
+ clickInfo.pane.repaint();
76857862 }
76867863
76877864 boolean overflow = false;