[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Line.java, 1.3, 1.4
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2006-07-06 15:10:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22924/src/net/sourceforge/bprocessor/model Modified Files: Line.java Log Message: Changed the Drawing of point and line, and changed the implementation of getDirection in Line Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Line.java 6 Jul 2006 10:42:08 -0000 1.3 --- Line.java 6 Jul 2006 15:10:21 -0000 1.4 *************** *** 49,61 **** /** ! * Get a direction vertex from the line ! * @return A non stored vertex in the direction of the line */ public Vertex getDirection() { ! Vertex dir = new Vertex(1, 0, 0); ! Geometry.rotate(degreeX, 0, 1, 0, dir, getOrigin()); ! Geometry.rotate(degreeY, 0, 0, 1, dir, getOrigin()); ! Geometry.rotate(degreeZ, 1, 0, 0, dir, getOrigin()); ! return dir.add(getOrigin()); } --- 49,62 ---- /** ! * Get a direction vector for the line ! * @return A non stored vertex that points in the direction of the line and are of length 1 */ public Vertex getDirection() { ! Vertex dir = new Vertex(Math.cos(Math.toRadians(degreeX)), ! Math.sin(Math.toRadians(degreeY)), ! Math.sin(Math.toRadians(degreeZ))); ! dir.scale(1 / dir.length()); ! System.out.println("Direction: " + dir); ! return dir; } *************** *** 154,156 **** --- 155,166 ---- return "Constructor-Line"; } + + /** + * Print a line + * @return The string + */ + public String toString() { + return "Line: " + getOrigin() + " AngleX: " + getDegreeX() + + " Angle Y: " + getDegreeY() + " Angle Z : " + getDegreeZ(); + } } |