[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef3d-commits] r542 - trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry

Author: jvonpilgrim
Date: 2011-02-11 04:51:23 -0500 (Fri, 11 Feb 2011)
New Revision: 542

Modified:
   trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix2f.java
   trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix3f.java
   trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix4f.java
Log:
Added zero matrices

Modified: trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix2f.java
===================================================================
--- trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix2f.java	2011-02-11 00:17:48 UTC (rev 541)
+++ trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix2f.java	2011-02-11 09:51:23 UTC (rev 542)
@@ -14,24 +14,31 @@
 import static org.eclipse.draw3d.geometry.IVector3f.NF;
 
 /**
- * Immutable matrix2f.
- * 
- * <h3>Converting a Matrix</h4>
- * There are two formats for converting to or from a stream:
- * row major or column major. While row major is used in most mathematical
- * areas, OpenGL uses column major format. The two formats store the entries
- * of a matrix in the following way:
- * 
+ * Immutable matrix2f. <h3>Converting a Matrix</h4> There are two formats for
+ * converting to or from a stream: row major or column major. While row major is
+ * used in most mathematical areas, OpenGL uses column major format. The two
+ * formats store the entries of a matrix in the following way:
  * <h4>Row Major Format</h4>
  * <table>
- * <tr><td>[0]</td><td>[1]</td></tr>
- * <tr><td>[2]</td><td>[3]</td></tr>
+ * <tr>
+ * <td>[0]</td>
+ * <td>[1]</td>
+ * </tr>
+ * <tr>
+ * <td>[2]</td>
+ * <td>[3]</td>
+ * </tr>
  * </table>
- * 
  * <h4>Column Major Format (OpenGL)</h4>
  * <table>
- * <tr><td>[0]</td><td>[1]</td></tr>
- * <tr><td>[2]</td><td>[3]</td></tr>
+ * <tr>
+ * <td>[0]</td>
+ * <td>[1]</td>
+ * </tr>
+ * <tr>
+ * <td>[2]</td>
+ * <td>[3]</td>
+ * </tr>
  * </table>
  * 
  * @author Jens von Pilgrim
@@ -45,16 +52,21 @@
 	 * with the identity matrix, by default. We write it here explicitly to make
 	 * it clear (and enable tests).
 	 */
-	public final static IMatrix2f IDENTITY = new Matrix2fImpl(new float[] { 1,
-			0, 0,1 }, false);
+	public final static IMatrix2f IDENTITY =
+		new Matrix2fImpl(new float[] { 1, 0, 0, 1 }, false);
 
 	/**
+	 * Zero matrix ( (0,0), (0,0) ).
+	 */
+	public final static IMatrix2f ZERO =
+		new Matrix2fImpl(new float[] { 0, 0, 0, 0 }, false);
+
+	/**
 	 * Format used in toString() methods
 	 */
-	public final static String TO_STRING_FORMAT = "%n(" + NF + ", " + NF + ", "
-			+ "%n " + NF + ", " + NF +  ")%n";
+	public final static String TO_STRING_FORMAT =
+		"%n(" + NF + ", " + NF + ", " + "%n " + NF + ", " + NF + ")%n";
 
-	
 	/**
 	 * Compares two matrices. A matrix m0 is equals another matrix m1 if m0 and
 	 * m1 are the same instance (m0==m1) or if all their components are equal.
@@ -64,5 +76,4 @@
 	 */
 	public boolean equals(IMatrix2f i_anotherMatrix2f);
 
-
 }

Modified: trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix3f.java
===================================================================
--- trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix3f.java	2011-02-11 00:17:48 UTC (rev 541)
+++ trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix3f.java	2011-02-11 09:51:23 UTC (rev 542)
@@ -49,6 +49,12 @@
 	 */
 	public final static IMatrix3f IDENTITY = new Matrix3fImpl(new float[] { 1,
 			0, 0, 0, 1, 0, 0, 0, 1 }, false);
+	
+	/**
+	 * Zero matrix ( (0,0,0), (0,0,0), (0,0,0) ).
+	 */
+	public final static IMatrix3f ZERO = new Matrix3fImpl(new float[] { 0,
+			0, 0, 0, 0, 0, 0, 0, 0 }, false);
 
 
 	/**

Modified: trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix4f.java
===================================================================
--- trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix4f.java	2011-02-11 00:17:48 UTC (rev 541)
+++ trunk/org.eclipse.draw3d.geometry/src/java/org/eclipse/draw3d/geometry/IMatrix4f.java	2011-02-11 09:51:23 UTC (rev 542)
@@ -85,9 +85,22 @@
 	 * created with the identity matrix, by default. We write it here explicitly
 	 * to make it clear (and enable tests).
 	 */
-	public final static IMatrix4f IDENTITY = new Matrix4fImpl();
+	public final static IMatrix4f IDENTITY =
+		new Matrix4fImpl(new float[] { 1, 0, 0, 0, //
+			0, 1, 0, 0, //
+			0, 0, 1, 0, //
+			0, 0, 0, 1 }, false);
 
 	/**
+	 * Zero matrix ( (0,0,0,0), (0,0,0,0), (0,0,0,0), (0,0,0,0) ).
+	 */
+	public final static IMatrix4f ZERO =
+		new Matrix4fImpl(new float[] { 0, 0, 0, 0, //
+			0, 0, 0, 0, //
+			0, 0, 0, 0, //
+			0, 0, 0, 0 }, false);
+
+	/**
 	 * Format used in toString() methods
 	 */
 	public final static String TO_STRING_FORMAT =