Normand Briere
2019-07-25 f2b6a33fdf84a06b958f9cb9d667a2eff3063d8b
CameraPane.java
....@@ -9699,7 +9699,7 @@
96999699
97009700 if (renderCamera != lightCamera)
97019701 //for (int count = parentcam.GetTransformCount(); --count>=0;)
9702
- LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
9702
+ LA.matConcat(matrix, parentcam.GlobalTransformInv(), matrix);
97039703
97049704 // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix);
97059705
....@@ -9715,7 +9715,7 @@
97159715
97169716 if (renderCamera != lightCamera)
97179717 //for (int count = parentcam.GetTransformCount(); --count>=0;)
9718
- LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
9718
+ LA.matConcat(parentcam.GlobalTransform(), matrix, matrix);
97199719
97209720 // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix);
97219721
....@@ -10916,7 +10916,7 @@
1091610916 // if (parentcam != renderCamera) // not a light
1091710917 if (cam != lightCamera)
1091810918 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10919
- LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
10919
+ LA.matConcat(matrix, parentcam.GlobalTransformInv(), matrix);
1092010920
1092110921 for (int j = 0; j < 4; j++)
1092210922 {
....@@ -10931,7 +10931,7 @@
1093110931 // if (parentcam != renderCamera) // not a light
1093210932 if (cam != lightCamera)
1093310933 //for (int count = parentcam.GetTransformCount(); --count>=0;)
10934
- LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
10934
+ LA.matConcat(parentcam.GlobalTransform(), matrix, matrix);
1093510935
1093610936 //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix);
1093710937
....@@ -14255,14 +14255,15 @@
1425514255 drag = false;
1425614256 //System.out.println("Mouse DOWN");
1425714257 editObj = false;
14258
- ClickInfo info = new ClickInfo();
14259
- info.bounds.setBounds(0, 0, (int) (getBounds().width * zoom), (int) (getBounds().height * zoom));
14260
- info.pane = this;
14261
- info.camera = renderCamera;
14262
- info.x = x;
14263
- info.y = y;
14264
- info.modifiers = modifiersex;
14265
- editObj = object.doEditClick(info, 0);
14258
+ //ClickInfo info = new ClickInfo();
14259
+ object.clickInfo.bounds.setBounds(0, 0, (int) (getBounds().width * zoom), (int) (getBounds().height * zoom));
14260
+ object.clickInfo.pane = this;
14261
+ object.clickInfo.camera = renderCamera;
14262
+ object.clickInfo.x = x;
14263
+ object.clickInfo.y = y;
14264
+ object.clickInfo.modifiers = modifiersex;
14265
+ editObj = object.doEditClick(//info,
14266
+ 0);
1426614267 if (!editObj)
1426714268 {
1426814269 hasMarquee = true;
....@@ -14662,15 +14663,16 @@
1466214663 if (editObj)
1466314664 {
1466414665 drag = true;
14665
- ClickInfo info = new ClickInfo();
14666
- info.bounds.setBounds(0, 0,
14666
+ //ClickInfo info = new ClickInfo();
14667
+ object.clickInfo.bounds.setBounds(0, 0,
1466714668 (int) (getBounds().width * zoom), (int) (getBounds().height * zoom));
14668
- info.pane = this;
14669
- info.camera = renderCamera;
14670
- info.x = x;
14671
- info.y = y;
14672
- object.GetWindow().copy
14673
- .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
14669
+ object.clickInfo.pane = this;
14670
+ object.clickInfo.camera = renderCamera;
14671
+ object.clickInfo.x = x;
14672
+ object.clickInfo.y = y;
14673
+ object //.GetWindow().copy
14674
+ .doEditDrag(//info,
14675
+ (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1467414676 } else
1467514677 {
1467614678 if (x < startX)
....@@ -14819,24 +14821,27 @@
1481914821 }
1482014822 }
1482114823
14824
+// ClickInfo clickInfo = new ClickInfo();
14825
+
1482214826 public void mouseMoved(MouseEvent e)
1482314827 {
1482414828 //System.out.println("mouseMoved: " + e);
1482514829 if (isRenderer)
1482614830 return;
1482714831
14828
- ClickInfo ci = new ClickInfo();
14829
- ci.x = e.getX();
14830
- ci.y = e.getY();
14831
- ci.modifiers = e.getModifiersEx();
14832
- ci.bounds.setBounds(0, 0, (int) (getBounds().width * zoom), (int) (getBounds().height * zoom));
14833
- ci.pane = this;
14834
- ci.camera = renderCamera;
14832
+ // Mouse cursor feedback
14833
+ object.clickInfo.x = e.getX();
14834
+ object.clickInfo.y = e.getY();
14835
+ object.clickInfo.modifiers = e.getModifiersEx();
14836
+ object.clickInfo.bounds.setBounds(0, 0, (int) (getBounds().width * zoom), (int) (getBounds().height * zoom));
14837
+ object.clickInfo.pane = this;
14838
+ object.clickInfo.camera = renderCamera;
1483514839 if (!isRenderer)
1483614840 {
1483714841 //ObjEditor editWindow = object.editWindow;
1483814842 //Object3D copy = editWindow.copy;
14839
- if (object.doEditClick(ci, 0))
14843
+ if (object.doEditClick(//clickInfo,
14844
+ 0))
1484014845 {
1484114846 setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
1484214847 } else
....@@ -15862,8 +15867,6 @@
1586215867
1586315868 int width = getBounds().width;
1586415869 int height = getBounds().height;
15865
- ClickInfo info = new ClickInfo();
15866
- info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom));
1586715870 //Image img = CreateImage(width, height);
1586815871 //System.out.println("width = " + width + "; height = " + height + "\n");
1586915872
....@@ -15940,31 +15943,37 @@
1594015943 }
1594115944 if (object != null && !hasMarquee)
1594215945 {
15946
+ if (object.clickInfo == null)
15947
+ object.clickInfo = new ClickInfo();
15948
+ ClickInfo info = object.clickInfo;
15949
+ //ClickInfo info = new ClickInfo();
15950
+ info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom));
15951
+
1594315952 if (isRenderer)
1594415953 {
15945
- info.flags++;
15954
+ object.clickInfo.flags++;
1594615955 double frameAspect = (double) width / (double) height;
1594715956 if (frameAspect > renderCamera.aspect)
1594815957 {
1594915958 int desired = (int) ((double) height * renderCamera.aspect);
15950
- info.bounds.width -= width - desired;
15951
- info.bounds.x += (width - desired) / 2;
15959
+ object.clickInfo.bounds.width -= width - desired;
15960
+ object.clickInfo.bounds.x += (width - desired) / 2;
1595215961 } else
1595315962 {
1595415963 int desired = (int) ((double) width / renderCamera.aspect);
15955
- info.bounds.height -= height - desired;
15956
- info.bounds.y += (height - desired) / 2;
15964
+ object.clickInfo.bounds.height -= height - desired;
15965
+ object.clickInfo.bounds.y += (height - desired) / 2;
1595715966 }
1595815967 }
1595915968
15960
- info.g = gr;
15961
- info.camera = renderCamera;
15969
+ object.clickInfo.g = gr;
15970
+ object.clickInfo.camera = renderCamera;
1596215971 /*
1596315972 // Memory intensive (brep.verticescopy)
1596415973 if (!(object instanceof Composite))
1596515974 object.draw(info, 0, false); // SLOW :
1596615975 */
15967
- if (!isRenderer)
15976
+ if (!isRenderer) // && drag)
1596815977 {
1596915978 Grafreed.Assert(object != null);
1597015979 Grafreed.Assert(object.selection != null);
....@@ -15972,9 +15981,9 @@
1597215981 {
1597315982 int hitSomething = object.selection.get(0).hitSomething;
1597415983
15975
- info.DX = 0;
15976
- info.DY = 0;
15977
- info.W = 1;
15984
+ object.clickInfo.DX = 0;
15985
+ object.clickInfo.DY = 0;
15986
+ object.clickInfo.W = 1;
1597815987 if (hitSomething == Object3D.hitCenter)
1597915988 {
1598015989 info.DX = X;
....@@ -15986,7 +15995,8 @@
1598615995 info.DY -= info.bounds.height/2;
1598715996 }
1598815997
15989
- object.drawEditHandles(info, 0);
15998
+ object.drawEditHandles(//info,
15999
+ 0);
1599016000
1599116001 if (drag && (X != 0 || Y != 0))
1599216002 {
....@@ -15999,7 +16009,7 @@
1599916009 gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
1600016010 break;
1600116011 case Object3D.hitScale: gr.setColor(Color.cyan);
16002
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
16012
+ gr.drawLine(X, Y, 0, 0);
1600316013 break;
1600416014 }
1600516015