.. | .. |
---|
9699 | 9699 | |
---|
9700 | 9700 | if (renderCamera != lightCamera) |
---|
9701 | 9701 | //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
9702 | | - LA.matConcat(matrix, parentcam.GlobalTransform(), matrix); |
---|
| 9702 | + LA.matConcat(matrix, parentcam.GlobalTransformInv(), matrix); |
---|
9703 | 9703 | |
---|
9704 | 9704 | // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix); |
---|
9705 | 9705 | |
---|
.. | .. |
---|
9715 | 9715 | |
---|
9716 | 9716 | if (renderCamera != lightCamera) |
---|
9717 | 9717 | //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
9718 | | - LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix); |
---|
| 9718 | + LA.matConcat(parentcam.GlobalTransform(), matrix, matrix); |
---|
9719 | 9719 | |
---|
9720 | 9720 | // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix); |
---|
9721 | 9721 | |
---|
.. | .. |
---|
10916 | 10916 | // if (parentcam != renderCamera) // not a light |
---|
10917 | 10917 | if (cam != lightCamera) |
---|
10918 | 10918 | //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10919 | | - LA.matConcat(matrix, parentcam.GlobalTransform(), matrix); |
---|
| 10919 | + LA.matConcat(matrix, parentcam.GlobalTransformInv(), matrix); |
---|
10920 | 10920 | |
---|
10921 | 10921 | for (int j = 0; j < 4; j++) |
---|
10922 | 10922 | { |
---|
.. | .. |
---|
10931 | 10931 | // if (parentcam != renderCamera) // not a light |
---|
10932 | 10932 | if (cam != lightCamera) |
---|
10933 | 10933 | //for (int count = parentcam.GetTransformCount(); --count>=0;) |
---|
10934 | | - LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix); |
---|
| 10934 | + LA.matConcat(parentcam.GlobalTransform(), matrix, matrix); |
---|
10935 | 10935 | |
---|
10936 | 10936 | //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix); |
---|
10937 | 10937 | |
---|
.. | .. |
---|
14255 | 14255 | drag = false; |
---|
14256 | 14256 | //System.out.println("Mouse DOWN"); |
---|
14257 | 14257 | 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); |
---|
14266 | 14267 | if (!editObj) |
---|
14267 | 14268 | { |
---|
14268 | 14269 | hasMarquee = true; |
---|
.. | .. |
---|
14662 | 14663 | if (editObj) |
---|
14663 | 14664 | { |
---|
14664 | 14665 | 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, |
---|
14667 | 14668 | (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); |
---|
14674 | 14676 | } else |
---|
14675 | 14677 | { |
---|
14676 | 14678 | if (x < startX) |
---|
.. | .. |
---|
14819 | 14821 | } |
---|
14820 | 14822 | } |
---|
14821 | 14823 | |
---|
| 14824 | +// ClickInfo clickInfo = new ClickInfo(); |
---|
| 14825 | + |
---|
14822 | 14826 | public void mouseMoved(MouseEvent e) |
---|
14823 | 14827 | { |
---|
14824 | 14828 | //System.out.println("mouseMoved: " + e); |
---|
14825 | 14829 | if (isRenderer) |
---|
14826 | 14830 | return; |
---|
14827 | 14831 | |
---|
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; |
---|
14835 | 14839 | if (!isRenderer) |
---|
14836 | 14840 | { |
---|
14837 | 14841 | //ObjEditor editWindow = object.editWindow; |
---|
14838 | 14842 | //Object3D copy = editWindow.copy; |
---|
14839 | | - if (object.doEditClick(ci, 0)) |
---|
| 14843 | + if (object.doEditClick(//clickInfo, |
---|
| 14844 | + 0)) |
---|
14840 | 14845 | { |
---|
14841 | 14846 | setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); |
---|
14842 | 14847 | } else |
---|
.. | .. |
---|
15862 | 15867 | |
---|
15863 | 15868 | int width = getBounds().width; |
---|
15864 | 15869 | int height = getBounds().height; |
---|
15865 | | - ClickInfo info = new ClickInfo(); |
---|
15866 | | - info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom)); |
---|
15867 | 15870 | //Image img = CreateImage(width, height); |
---|
15868 | 15871 | //System.out.println("width = " + width + "; height = " + height + "\n"); |
---|
15869 | 15872 | |
---|
.. | .. |
---|
15940 | 15943 | } |
---|
15941 | 15944 | if (object != null && !hasMarquee) |
---|
15942 | 15945 | { |
---|
| 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 | + |
---|
15943 | 15952 | if (isRenderer) |
---|
15944 | 15953 | { |
---|
15945 | | - info.flags++; |
---|
| 15954 | + object.clickInfo.flags++; |
---|
15946 | 15955 | double frameAspect = (double) width / (double) height; |
---|
15947 | 15956 | if (frameAspect > renderCamera.aspect) |
---|
15948 | 15957 | { |
---|
15949 | 15958 | 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; |
---|
15952 | 15961 | } else |
---|
15953 | 15962 | { |
---|
15954 | 15963 | 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; |
---|
15957 | 15966 | } |
---|
15958 | 15967 | } |
---|
15959 | 15968 | |
---|
15960 | | - info.g = gr; |
---|
15961 | | - info.camera = renderCamera; |
---|
| 15969 | + object.clickInfo.g = gr; |
---|
| 15970 | + object.clickInfo.camera = renderCamera; |
---|
15962 | 15971 | /* |
---|
15963 | 15972 | // Memory intensive (brep.verticescopy) |
---|
15964 | 15973 | if (!(object instanceof Composite)) |
---|
15965 | 15974 | object.draw(info, 0, false); // SLOW : |
---|
15966 | 15975 | */ |
---|
15967 | | - if (!isRenderer) |
---|
| 15976 | + if (!isRenderer) // && drag) |
---|
15968 | 15977 | { |
---|
15969 | 15978 | Grafreed.Assert(object != null); |
---|
15970 | 15979 | Grafreed.Assert(object.selection != null); |
---|
.. | .. |
---|
15972 | 15981 | { |
---|
15973 | 15982 | int hitSomething = object.selection.get(0).hitSomething; |
---|
15974 | 15983 | |
---|
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; |
---|
15978 | 15987 | if (hitSomething == Object3D.hitCenter) |
---|
15979 | 15988 | { |
---|
15980 | 15989 | info.DX = X; |
---|
.. | .. |
---|
15986 | 15995 | info.DY -= info.bounds.height/2; |
---|
15987 | 15996 | } |
---|
15988 | 15997 | |
---|
15989 | | - object.drawEditHandles(info, 0); |
---|
| 15998 | + object.drawEditHandles(//info, |
---|
| 15999 | + 0); |
---|
15990 | 16000 | |
---|
15991 | 16001 | if (drag && (X != 0 || Y != 0)) |
---|
15992 | 16002 | { |
---|
.. | .. |
---|
15999 | 16009 | gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2); |
---|
16000 | 16010 | break; |
---|
16001 | 16011 | 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); |
---|
16003 | 16013 | break; |
---|
16004 | 16014 | } |
---|
16005 | 16015 | |
---|