Roi Atalla avatar Roi Atalla committed 2fe580a

Some method name changes.

Comments (0)

Files changed (5)

src/main/java/com/ra4king/opengl/arcsynthesis/gl33/chapter7/example1/Example7_1.java

 		Vector3 perpUpDir = rightDir.cross(lookDir);
 		
 		Matrix4 rotMat = new Matrix4().clearToIdentity();
-		rotMat.put(0, rightDir, 0);
-		rotMat.put(1, perpUpDir, 0);
-		rotMat.put(2, lookDir.mult(-1), 0);
+		rotMat.putColumn(0, rightDir, 0);
+		rotMat.putColumn(1, perpUpDir, 0);
+		rotMat.putColumn(2, lookDir.mult(-1), 0);
 		
 		return rotMat.transpose().translate(new Vector3(cameraPoint).mult(-1));
 	}

src/main/java/com/ra4king/opengl/arcsynthesis/gl33/chapter7/example2/Example7_2.java

 		Vector3 perpUpDir = rightDir.cross(lookDir);
 		
 		Matrix4 rotMat = new Matrix4().clearToIdentity();
-		rotMat.put(0, rightDir, 0);
-		rotMat.put(1, perpUpDir, 0);
-		rotMat.put(2, lookDir.mult(-1), 0);
+		rotMat.putColumn(0, rightDir, 0);
+		rotMat.putColumn(1, perpUpDir, 0);
+		rotMat.putColumn(2, lookDir.mult(-1), 0);
 		
 		return rotMat.transpose().translate(new Vector3(cameraPoint).mult(-1));
 	}

src/main/java/com/ra4king/opengl/arcsynthesis/gl33/chapter8/example3/Example8_3.java

 		Vector3 perpUpDir = rightDir.cross(lookDir);
 		
 		Matrix4 rotMat = new Matrix4().clearToIdentity();
-		rotMat.put(0, rightDir);
-		rotMat.put(1, perpUpDir);
-		rotMat.put(2, lookDir.mult(-1));
+		rotMat.putColumn(0, rightDir);
+		rotMat.putColumn(1, perpUpDir);
+		rotMat.putColumn(2, lookDir.mult(-1));
 		
 		return rotMat.transpose().translate(cameraPoint.mult(-1));
 	}

src/main/java/com/ra4king/opengl/util/MousePoles.java

 		
 		public Matrix4 calcMatrix() {
 			Matrix4 translateMat = new Matrix4().clearToIdentity();
-			translateMat.put(3, po.position);
+			translateMat.putColumn(3, po.position);
 			return translateMat.mult(po.orientation.toMatrix());
 		}
 		

src/main/java/com/ra4king/opengl/util/math/Matrix4.java

 	}
 	
 	public Matrix4 clearToIdentity() {
-		return clear().put(0, 1).put(5, 1).put(10, 1).put(15, 1);
+		return clear().put(0, 1)
+				.put(5, 1)
+				.put(10, 1)
+				.put(15, 1);
 	}
 	
 	public Matrix4 clearToOrtho(float left, float right, float bottom, float top, float near, float far) {
 		return this;
 	}
 	
-	public Matrix4 put(int index, Vector4 v) {
+	public Matrix4 putColumn(int index, Vector4 v) {
 		put(index * 4 + 0, v.x());
 		put(index * 4 + 1, v.y());
 		put(index * 4 + 2, v.z());
 		return this;
 	}
 	
-	public Matrix4 put(int index, Vector3 v) {
+	public Matrix4 putColumn(int index, Vector3 v) {
 		put(index * 4 + 0, v.x());
 		put(index * 4 + 1, v.y());
 		put(index * 4 + 2, v.z());
 		return this;
 	}
 	
-	public Matrix4 put(int index, Vector3 v, float w) {
+	public Matrix4 putColumn(int index, Vector3 v, float w) {
 		put(index * 4 + 0, v.x());
 		put(index * 4 + 1, v.y());
 		put(index * 4 + 2, v.z());
 	public Matrix4 rotate(float angle, float x, float y, float z) {
 		float cos = (float)Math.cos(angle);
 		float sin = (float)Math.sin(angle);
-		float invCos = 1 - cos;
+		float oneMinusCos = 1 - cos;
 		
 		Vector3 v = new Vector3(x, y, z).normalize();
 		
 		float[] m = new float[matrix.length];
 		m[0] = v.x() * v.x() + (1 - v.x() * v.x()) * cos;
-		m[4] = v.x() * v.y() * invCos - v.z() * sin;
-		m[8] = v.x() * v.z() * invCos + v.y() * sin;
+		m[4] = v.x() * v.y() * oneMinusCos - v.z() * sin;
+		m[8] = v.x() * v.z() * oneMinusCos + v.y() * sin;
 		
-		m[1] = v.y() * v.x() * invCos + v.z() * sin;
+		m[1] = v.y() * v.x() * oneMinusCos + v.z() * sin;
 		m[5] = v.y() * v.y() + (1 - v.y() * v.y()) * cos;
-		m[9] = v.y() * v.z() * invCos - v.x() * sin;
+		m[9] = v.y() * v.z() * oneMinusCos - v.x() * sin;
 		
-		m[2] = v.z() * v.x() * invCos - v.y() * sin;
-		m[6] = v.z() * v.y() * invCos + v.x() * sin;
+		m[2] = v.z() * v.x() * oneMinusCos - v.y() * sin;
+		m[6] = v.z() * v.y() * oneMinusCos + v.x() * sin;
 		m[10] = v.z() * v.z() + (1 - v.z() * v.z()) * cos;
 		
 		m[15] = 1;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.