[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Camera.java, 1.37, 1.38
Status: Pre-Alpha
Brought to you by:
henryml
|
From: rimestad <rim...@us...> - 2007-02-22 12:37:04
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18849/src/net/sourceforge/bprocessor/model Modified Files: Camera.java Log Message: Added a focus on tool that works as a tool Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Camera.java 15 Feb 2007 14:57:41 -0000 1.37 --- Camera.java 22 Feb 2007 12:36:54 -0000 1.38 *************** *** 657,660 **** --- 657,683 ---- * Static modification of the camera to focus on a given surface * @param currentCamera The camera to change + * @param cp The clippingplane to focus on + */ + public static void focusOn(Camera currentCamera, ClippingPlane cp) { + List<Edge> edges = new ArrayList<Edge>(4); + Vertex first = null, prev = null, cur = null;; + for (Vertex v : (Collection<Vertex>)cp.getCorners()) { + cur = v; + if (first == null) { + first = cur; + } else { + edges.add(new Edge(prev, cur)); + } + prev = cur; + } + edges.add(new Edge(cur, first)); + Surface s = new Surface(edges); + + focusOn(currentCamera, s); + } + + /** + * Static modification of the camera to focus on a given surface + * @param currentCamera The camera to change * @param s The surface to focus on */ |