2
0
Mr.doob 8 жил өмнө
parent
commit
d37e7b8f68

+ 1 - 1
examples/js/SkyShader.js

@@ -66,7 +66,7 @@ THREE.ShaderLib[ 'sky' ] = {
 
 		"float sunIntensity(float zenithAngleCos)",
 		"{",
-		    	"zenithAngleCos = clamp(zenithAngleCos, -1.0, 1.0);",
+			"zenithAngleCos = clamp(zenithAngleCos, -1.0, 1.0);",
 			"return EE * max(0.0, 1.0 - pow(e, -((cutoffAngle - acos(zenithAngleCos))/steepness)));",
 		"}",
 

+ 2 - 4
src/animation/AnimationUtils.js

@@ -1,12 +1,10 @@
-var AnimationUtils;
-
 /**
  * @author tschw
  * @author Ben Houston / http://clara.io/
  * @author David Sarno / http://lighthaus.us/
  */
 
-AnimationUtils = {
+var AnimationUtils = {
 
 	// same as Array.prototype.slice, but also works on typed arrays
 	arraySlice: function( array, from, to ) {
@@ -161,4 +159,4 @@ AnimationUtils = {
 };
 
 
-export { AnimationUtils };
+export { AnimationUtils };

+ 2 - 4
src/extras/CurveUtils.js

@@ -1,10 +1,8 @@
-var CurveUtils;
-
 /**
  * @author zz85 / http://www.lab4games.net/zz85/blog
  */
 
-CurveUtils = {
+var CurveUtils = {
 
 	tangentQuadraticBezier: function ( t, p0, p1, p2 ) {
 
@@ -51,4 +49,4 @@ CurveUtils = {
 };
 
 
-export { CurveUtils };
+export { CurveUtils };

+ 2 - 4
src/extras/SceneUtils.js

@@ -2,13 +2,11 @@ import { Matrix4 } from '../math/Matrix4';
 import { Mesh } from '../objects/Mesh';
 import { Group } from '../objects/Group';
 
-var SceneUtils;
-
 /**
  * @author alteredq / http://alteredqualia.com/
  */
 
-SceneUtils = {
+var SceneUtils = {
 
 	createMultiMaterialObject: function ( geometry, materials ) {
 
@@ -46,4 +44,4 @@ SceneUtils = {
 };
 
 
-export { SceneUtils };
+export { SceneUtils };

+ 2 - 4
src/extras/ShapeUtils.js

@@ -1,10 +1,8 @@
-var ShapeUtils;
-
 /**
  * @author zz85 / http://www.lab4games.net/zz85/blog
  */
 
-ShapeUtils = {
+var ShapeUtils = {
 
 	// calculate area of the contour polygon
 
@@ -767,4 +765,4 @@ ShapeUtils = {
 };
 
 
-export { ShapeUtils };
+export { ShapeUtils };

+ 3 - 7
src/extras/curves/CatmullRomCurve3.js

@@ -1,8 +1,6 @@
 import { Vector3 } from '../../math/Vector3';
 import { Curve } from '../core/Curve';
 
-var CatmullRomCurve3;
-
 /**
  * @author zz85 https://github.com/zz85
  *
@@ -14,7 +12,7 @@ var CatmullRomCurve3;
  * curve.tension is used for catmullrom which defaults to 0.5
  */
 
-CatmullRomCurve3 = ( function() {
+var CatmullRomCurve3 = ( function() {
 
 	var
 		tmp = new Vector3(),
@@ -32,9 +30,7 @@ CatmullRomCurve3 = ( function() {
 	which can be placed in CurveUtils.
 	*/
 
-	function CubicPoly() {
-
-	}
+	function CubicPoly() {}
 
 	/*
 	 * Compute coefficients for a cubic polynomial
@@ -187,4 +183,4 @@ CatmullRomCurve3 = ( function() {
 } )();
 
 
-export { CatmullRomCurve3 };
+export { CatmullRomCurve3 };

+ 2 - 4
src/extras/curves/CubicBezierCurve3.js

@@ -2,13 +2,11 @@ import { Vector3 } from '../../math/Vector3';
 import { ShapeUtils } from '../ShapeUtils';
 import { Curve } from '../core/Curve';
 
-var CubicBezierCurve3;
-
 /**************************************************************
  *	Cubic Bezier 3D curve
  **************************************************************/
 
-CubicBezierCurve3 = Curve.create(
+var CubicBezierCurve3 = Curve.create(
 
 	function ( v0, v1, v2, v3 ) {
 
@@ -34,4 +32,4 @@ CubicBezierCurve3 = Curve.create(
 );
 
 
-export { CubicBezierCurve3 };
+export { CubicBezierCurve3 };

+ 2 - 4
src/extras/curves/LineCurve3.js

@@ -1,13 +1,11 @@
 import { Vector3 } from '../../math/Vector3';
 import { Curve } from '../core/Curve';
 
-var LineCurve3;
-
 /**************************************************************
  *	Line3D
  **************************************************************/
 
-LineCurve3 = Curve.create(
+var LineCurve3 = Curve.create(
 
 	function ( v1, v2 ) {
 
@@ -37,4 +35,4 @@ LineCurve3 = Curve.create(
 );
 
 
-export { LineCurve3 };
+export { LineCurve3 };

+ 3 - 5
src/extras/curves/QuadraticBezierCurve3.js

@@ -2,13 +2,11 @@ import { Vector3 } from '../../math/Vector3';
 import { ShapeUtils } from '../ShapeUtils';
 import { Curve } from '../core/Curve';
 
-var QuadraticBezierCurve3;
-
 /**************************************************************
  *	Quadratic Bezier 3D curve
  **************************************************************/
 
-QuadraticBezierCurve3 = Curve.create(
+var QuadraticBezierCurve3 = Curve.create(
 
 	function ( v0, v1, v2 ) {
 
@@ -20,7 +18,7 @@ QuadraticBezierCurve3 = Curve.create(
 
 	function ( t ) {
 
-		var b2 = ShapeUtils.b2;		
+		var b2 = ShapeUtils.b2;
 
 		return new Vector3(
 			b2( t, this.v0.x, this.v1.x, this.v2.x ),
@@ -33,4 +31,4 @@ QuadraticBezierCurve3 = Curve.create(
 );
 
 
-export { QuadraticBezierCurve3 };
+export { QuadraticBezierCurve3 };

+ 2 - 4
src/loaders/Cache.js

@@ -1,10 +1,8 @@
-var Cache;
-
 /**
  * @author mrdoob / http://mrdoob.com/
  */
 
-Cache = {
+var Cache = {
 
 	enabled: false,
 
@@ -45,4 +43,4 @@ Cache = {
 };
 
 
-export { Cache };
+export { Cache };

+ 1 - 3
src/loaders/LoadingManager.js

@@ -1,5 +1,3 @@
-var DefaultLoadingManager;
-
 /**
  * @author mrdoob / http://mrdoob.com/
  */
@@ -69,7 +67,7 @@ function LoadingManager( onLoad, onProgress, onError ) {
 
 }
 
-DefaultLoadingManager = new LoadingManager();
+var DefaultLoadingManager = new LoadingManager();
 
 
 export { DefaultLoadingManager, LoadingManager };

+ 1 - 3
src/math/Color.js

@@ -1,7 +1,5 @@
 import { _Math } from './Math';
 
-var ColorKeywords;
-
 /**
  * @author mrdoob / http://mrdoob.com/
  */
@@ -498,7 +496,7 @@ Color.prototype = {
 
 };
 
-ColorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,
+var ColorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua': 0x00FFFF, 'aquamarine': 0x7FFFD4, 'azure': 0xF0FFFF,
 'beige': 0xF5F5DC, 'bisque': 0xFFE4C4, 'black': 0x000000, 'blanchedalmond': 0xFFEBCD, 'blue': 0x0000FF, 'blueviolet': 0x8A2BE2,
 'brown': 0xA52A2A, 'burlywood': 0xDEB887, 'cadetblue': 0x5F9EA0, 'chartreuse': 0x7FFF00, 'chocolate': 0xD2691E, 'coral': 0xFF7F50,
 'cornflowerblue': 0x6495ED, 'cornsilk': 0xFFF8DC, 'crimson': 0xDC143C, 'cyan': 0x00FFFF, 'darkblue': 0x00008B, 'darkcyan': 0x008B8B,

+ 1 - 3
src/math/Math.js

@@ -1,11 +1,9 @@
-var _Math;
-
 /**
  * @author alteredq / http://alteredqualia.com/
  * @author mrdoob / http://mrdoob.com/
  */
 
-_Math = {
+var _Math = {
 
 	DEG2RAD: Math.PI / 180,
 	RAD2DEG: 180 / Math.PI,

+ 6 - 11
src/renderers/shaders/UniformsUtils.js

@@ -1,10 +1,8 @@
-var UniformsUtils;
-
 /**
  * Uniform Utilities
  */
 
-UniformsUtils = {
+var UniformsUtils = {
 
 	merge: function ( uniforms ) {
 
@@ -38,13 +36,10 @@ UniformsUtils = {
 
 				var parameter_src = uniforms_src[ u ][ p ];
 
-				if ( (parameter_src && parameter_src.isColor) ||
-					 (parameter_src && parameter_src.isVector2) ||
-					 (parameter_src && parameter_src.isVector3) ||
-					 (parameter_src && parameter_src.isVector4) ||
-					 (parameter_src && parameter_src.isMatrix3) ||
-					 (parameter_src && parameter_src.isMatrix4) ||
-					 (parameter_src && parameter_src.isTexture) ) {
+				if ( parameter_src.isColor ||
+					parameter_src.isMatrix3 || parameter_src.isMatrix4 ||
+					parameter_src.isVector2 || parameter_src.isVector3 || parameter_src.isVector4 ||
+					parameter_src.isTexture ) {
 
 					uniforms_dst[ u ][ p ] = parameter_src.clone();
 
@@ -69,4 +64,4 @@ UniformsUtils = {
 };
 
 
-export { UniformsUtils };
+export { UniformsUtils };