Roi Atalla avatar Roi Atalla committed 9179172

Formatted LightManager class.

Comments (0)

Files changed (12)

src/main/java/com/ra4king/opengl/arcsynthesis/gl33/chapter12/LightManager.java

 		return ret;
 	}
 	
-//	public Vector4 getMaxIntensityValue(Pair<Vector4,Float> data) {
-//		return data.first;
-//	}
-//	
-//	public float getMaxIntensityTime(Pair<Vector4,Float> data) {
-//		return data.second;
-//	}
-//	
-//	public float getLightVectorValue(Pair<Float,Float> data) {
-//		return data.first;
-//	}
-//	
-//	public float getLightVectorTime(Pair<Float,Float> data) {
-//		return data.second;
-//	}
+	// public Vector4 getMaxIntensityValue(Pair<Vector4,Float> data) {
+	// return data.first;
+	// }
+	//
+	// public float getMaxIntensityTime(Pair<Vector4,Float> data) {
+	// return data.second;
+	// }
+	//
+	// public float getLightVectorValue(Pair<Float,Float> data) {
+	// return data.first;
+	// }
+	//
+	// public float getLightVectorTime(Pair<Float,Float> data) {
+	// return data.second;
+	// }
 	
 	public void setSunlightValues(SunlightValue[] values) {
 		ArrayList<TimedLinearInterpolatorVector<Vector4>.Data> ambient = new ArrayList<>();
 			Vector4 worldLightPos = new Vector4(lightPos.get(light).interpolate(lightTimers.get(light).getAlpha()), 1);
 			Vector4 lightPosCameraSpace = worldToCameraMatrix.mult(worldLightPos);
 			
-			lightData.lights[light+1] = new PerLight(lightPosCameraSpace, lightIntensity.get(light));
+			lightData.lights[light + 1] = new PerLight(lightPosCameraSpace, lightIntensity.get(light));
 		}
 		
 		return lightData;
 			Vector4 worldLightPos = new Vector4(lightPos.get(light).interpolate(lightTimers.get(light).getAlpha()), 1);
 			Vector4 lightPosCameraSpace = worldToCameraMatrix.mult(worldLightPos);
 			
-			lightData.lights[light+1] = new PerLight(lightPosCameraSpace, lightIntensity.get(light));
+			lightData.lights[light + 1] = new PerLight(lightPosCameraSpace, lightIntensity.get(light));
 		}
 		
 		return lightData;

src/main/java/com/ra4king/opengl/superbible/osb4/chapter3/Example3_14.java

 
 public class Example3_14 extends GLProgram {
 	public static void main(String[] args) {
-		new Example3_14().run(new PixelFormat(0,0,1));
+		new Example3_14().run(new PixelFormat(0, 0, 1));
 	}
 	
 	private float x, y, size = 50;

src/main/java/com/ra4king/opengl/test/Test.java

 		
 		program.end();
 	}
-}
+}

src/main/java/com/ra4king/opengl/util/interpolators/ConstVelLinearInterpolatorVector.java

 		
 		totalDist = 0;
 		for(int a = 0; a < values.size(); a++) {
-			totalDist += values.get(a).data.copy().sub(values.get(a-1).data).length();
+			totalDist += values.get(a).data.copy().sub(values.get(a - 1).data).length();
 			values.get(a).weight = totalDist;
 		}
 		

src/main/java/com/ra4king/opengl/util/interpolators/ConstVelLinearInterpolatorf.java

 		
 		totalDist = 0;
 		for(int a = 0; a < values.size(); a++) {
-			totalDist += Math.abs(values.get(a).data - values.get(a-1).data);
+			totalDist += Math.abs(values.get(a).data - values.get(a - 1).data);
 			values.get(a).weight = totalDist;
 		}
 		

src/main/java/com/ra4king/opengl/util/interpolators/LinearInterpolatorVector.java

 			values.add(new Data(d, 0));
 		
 		if(isLooping && !values.isEmpty())
-			values.add(values.get(values.size()-1));
+			values.add(values.get(values.size() - 1));
 		
 		for(int a = 0; a < values.size(); a++)
-			values.get(a).weight = a / (float)(values.size()-1);
+			values.get(a).weight = a / (float)(values.size() - 1);
 	}
 }

src/main/java/com/ra4king/opengl/util/interpolators/LinearInterpolatorf.java

 			values.add(new Data(d, 0));
 		
 		if(isLooping && !values.isEmpty())
-			values.add(values.get(values.size()-1));
+			values.add(values.get(values.size() - 1));
 		
 		for(int a = 0; a < values.size(); a++)
-			values.get(a).weight = a / (float)(values.size()-1);
+			values.get(a).weight = a / (float)(values.size() - 1);
 	}
 }

src/main/java/com/ra4king/opengl/util/interpolators/TimedLinearInterpolatorVector.java

 		
 		if(!values.isEmpty()) {
 			values.get(0).weight = 0;
-			values.get(values.size()-1).weight = 1;
+			values.get(values.size() - 1).weight = 1;
 		}
 	}
 }

src/main/java/com/ra4king/opengl/util/interpolators/TimedLinearInterpolatorf.java

 		
 		if(!values.isEmpty()) {
 			values.get(0).weight = 0;
-			values.get(values.size()-1).weight = 1;
+			values.get(values.size() - 1).weight = 1;
 		}
 	}
 }

src/main/java/com/ra4king/opengl/util/interpolators/WeightedLinearInterpolatorVector.java

 				break;
 		
 		if(segment == values.size())
-			return values.get(values.size()-1).data;
+			return values.get(values.size() - 1).data;
 		
-		float sectionAlpha = alpha - values.get(segment-1).weight;
-		sectionAlpha /= values.get(segment).weight - values.get(segment-1).weight;
+		float sectionAlpha = alpha - values.get(segment - 1).weight;
+		sectionAlpha /= values.get(segment).weight - values.get(segment - 1).weight;
 		
 		float invSecAlpha = 1 - sectionAlpha;
 		
-		return values.get(segment-1).data.copy().mult(invSecAlpha).add(values.get(segment).data.copy().mult(sectionAlpha));
+		return values.get(segment - 1).data.copy().mult(invSecAlpha).add(values.get(segment).data.copy().mult(sectionAlpha));
 	}
 }

src/main/java/com/ra4king/opengl/util/interpolators/WeightedLinearInterpolatorf.java

 				break;
 		
 		if(segment == values.size())
-			return values.get(values.size()-1).data;
+			return values.get(values.size() - 1).data;
 		
-		float sectionAlpha = alpha - values.get(segment-1).weight;
-		sectionAlpha /= values.get(segment).weight - values.get(segment-1).weight;
+		float sectionAlpha = alpha - values.get(segment - 1).weight;
+		sectionAlpha /= values.get(segment).weight - values.get(segment - 1).weight;
 		
 		float invSecAlpha = 1 - sectionAlpha;
 		
-		return values.get(segment-1).data * invSecAlpha + values.get(segment).data * sectionAlpha;
+		return values.get(segment - 1).data * invSecAlpha + values.get(segment).data * sectionAlpha;
 	}
 }

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

 
 public interface Vector<V> {
 	V add(V v);
+	
 	V sub(V v);
+	
 	V mult(V v);
+	
 	V mult(float f);
+	
 	float length();
+	
 	V copy();
+	
 	FloatBuffer toBuffer();
 }
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.