[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool CameraFlyTool.java,1.4,1.5 AbstractToo
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-01-25 14:45:36
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24213/src/net/sourceforge/bprocessor/gl/tool Modified Files: CameraFlyTool.java AbstractTool.java MoveTool.java CameraWalkTool.java CameraTool.java Log Message: Now all tools take the camera from Project Index: CameraTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraTool.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CameraTool.java 15 Dec 2005 12:37:00 -0000 1.6 --- CameraTool.java 25 Jan 2006 14:45:25 -0000 1.7 *************** *** 10,13 **** --- 10,14 ---- import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Project; //import java.awt.event.KeyEvent; *************** *** 65,69 **** protected void dragged(MouseEvent e) { View view = glv.getView(); ! Camera c = view.getCamera(); double[] roll = c.getRoll(); if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == --- 66,70 ---- protected void dragged(MouseEvent e) { View view = glv.getView(); ! Camera c = Project.getInstance().getCurrentCamera(); double[] roll = c.getRoll(); if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == Index: CameraWalkTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraWalkTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CameraWalkTool.java 19 Dec 2005 07:51:30 -0000 1.2 --- CameraWalkTool.java 25 Jan 2006 14:45:25 -0000 1.3 *************** *** 9,12 **** --- 9,13 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; *************** *** 47,51 **** if (e.getButton() == MouseEvent.BUTTON1 || (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK) { ! Camera c = glv.getView().getCamera(); double angleX = ((double)(e.getX() - previousPos[0]) / 360) * Math.PI; double angleY = ((double)(e.getY() - previousPos[1]) / 360) * Math.PI; --- 48,52 ---- if (e.getButton() == MouseEvent.BUTTON1 || (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK) { ! Camera c = Project.getInstance().getCurrentCamera(); double angleX = ((double)(e.getX() - previousPos[0]) / 360) * Math.PI; double angleY = ((double)(e.getY() - previousPos[1]) / 360) * Math.PI; *************** *** 74,78 **** */ public void keyPressed(KeyEvent e) { ! Camera c = glv.getView().getCamera(); Vertex up = new Vertex(c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); double x = c.getCenter()[0] - c.getCamera()[0]; --- 75,79 ---- */ public void keyPressed(KeyEvent e) { ! Camera c = Project.getInstance().getCurrentCamera(); Vertex up = new Vertex(c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); double x = c.getCenter()[0] - c.getCamera()[0]; Index: CameraFlyTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/CameraFlyTool.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CameraFlyTool.java 19 Dec 2005 07:51:30 -0000 1.4 --- CameraFlyTool.java 25 Jan 2006 14:45:25 -0000 1.5 *************** *** 9,12 **** --- 9,13 ---- import net.sourceforge.bprocessor.gl.GLView; import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; *************** *** 47,51 **** if (e.getButton() == MouseEvent.BUTTON1 || (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK) { ! Camera c = glv.getView().getCamera(); double angleX = ((double)(e.getX() - previousPos[0]) / 360) * Math.PI; double angleY = ((double)(e.getY() - previousPos[1]) / 360) * Math.PI; --- 48,52 ---- if (e.getButton() == MouseEvent.BUTTON1 || (e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK) { ! Camera c = Project.getInstance().getCurrentCamera(); double angleX = ((double)(e.getX() - previousPos[0]) / 360) * Math.PI; double angleY = ((double)(e.getY() - previousPos[1]) / 360) * Math.PI; *************** *** 74,78 **** */ public void keyPressed(KeyEvent e) { ! Camera c = glv.getView().getCamera(); Vertex up = new Vertex(c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); double x = c.getCenter()[0] - c.getCamera()[0]; --- 75,79 ---- */ public void keyPressed(KeyEvent e) { ! Camera c = Project.getInstance().getCurrentCamera(); Vertex up = new Vertex(c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); double x = c.getCenter()[0] - c.getCamera()[0]; Index: MoveTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/MoveTool.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** MoveTool.java 24 Jan 2006 12:14:39 -0000 1.27 --- MoveTool.java 25 Jan 2006 14:45:25 -0000 1.28 *************** *** 14,17 **** --- 14,18 ---- import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Plane; + import net.sourceforge.bprocessor.model.Project; import net.sourceforge.bprocessor.model.Vertex; import net.sourceforge.bprocessor.model.Surface; *************** *** 376,380 **** */ protected void findRestrictionPlane() { ! Camera camera = glv.getView().getCamera(); double[] centerPoint = camera.getCenter(); double[] cameraPoint = camera.getCamera(); --- 377,381 ---- */ protected void findRestrictionPlane() { ! Camera camera = Project.getInstance().getCurrentCamera(); double[] centerPoint = camera.getCenter(); double[] cameraPoint = camera.getCamera(); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** AbstractTool.java 25 Jan 2006 10:02:09 -0000 1.54 --- AbstractTool.java 25 Jan 2006 14:45:25 -0000 1.55 *************** *** 118,122 **** public void mouseWheelMoved(MouseWheelEvent e) { int rotation = e.getWheelRotation(); ! Camera cam = (glv.getView()).getCamera(); if (rotation > 0) { cam.zoomout(); --- 118,122 ---- public void mouseWheelMoved(MouseWheelEvent e) { int rotation = e.getWheelRotation(); ! Camera cam = Project.getInstance().getCurrentCamera(); if (rotation > 0) { cam.zoomout(); *************** *** 133,137 **** */ public double[] selectionCenter() { ! double[] center = (glv.getView()).getCamera().getCenter(); Iterator it = selection.iterator(); if (it.hasNext()) { --- 133,137 ---- */ public double[] selectionCenter() { ! double[] center = Project.getInstance().getCurrentCamera().getCenter(); Iterator it = selection.iterator(); if (it.hasNext()) { *************** *** 175,179 **** */ public void keyPressed(KeyEvent e) { ! Camera c = glv.getView().getCamera(); Vertex up = new Vertex(c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); double x = c.getCenter()[0] - c.getCamera()[0]; --- 175,179 ---- */ public void keyPressed(KeyEvent e) { ! Camera c = Project.getInstance().getCurrentCamera(); Vertex up = new Vertex(c.getRoll()[0], c.getRoll()[1], c.getRoll()[2]); double x = c.getCenter()[0] - c.getCamera()[0]; *************** *** 215,226 **** } else if (e.getKeyCode() == KeyEvent.VK_E) { glv.changeTool(Tool.EXTRUSION_TOOL); - } else if (e.getKeyCode() == KeyEvent.VK_F1) { - glv.changeCamera(Camera.create(Camera.VIEW_3D)); - } else if (e.getKeyCode() == KeyEvent.VK_F2) { - glv.changeCamera(Camera.create(Camera.VIEW_XZ)); - } else if (e.getKeyCode() == KeyEvent.VK_F3) { - glv.changeCamera(Camera.create(Camera.VIEW_XY)); - } else if (e.getKeyCode() == KeyEvent.VK_F4) { - glv.changeCamera(Camera.create(Camera.VIEW_YZ)); } else if (e.getKeyCode() == KeyEvent.VK_F5) { glv.getView().changeDrawMode(View.WIREFRAME_MODE); --- 215,218 ---- *************** *** 262,266 **** e.getButton() == MouseEvent.BUTTON2) { View view = glv.getView(); ! Camera c = view.getCamera(); double[] center = c.getCenter(); double[] camera = c.getCamera(); --- 254,258 ---- e.getButton() == MouseEvent.BUTTON2) { View view = glv.getView(); ! Camera c = Project.getInstance().getCurrentCamera(); double[] center = c.getCenter(); double[] camera = c.getCamera(); |