Mr.doob 15 年 前
コミット
0aac038d58

ファイルの差分が大きいため隠しています
+ 0 - 0
build/three.js


+ 1 - 1
examples/geometry_terrain.html

@@ -158,7 +158,7 @@
 
 					for (var x = 0; x < quality1; x++ ) {
 
-						plane.vertices[x + y * quality1].position.z = data[((x * pixelsPerTriangle) + (y * pixelsPerTriangle) * heightMap.width) * 4] * 2;
+						plane.vertices[x + y * quality1].position.z = data[((x * pixelsPerTriangle) + (y * pixelsPerTriangle) * heightMap.width) * 4] * 2 - 128;
 
 					}
 

+ 1 - 1
src/Three.js

@@ -2,4 +2,4 @@
  * @author mr.doob / http://mrdoob.com/
  */
 
-var THREE = THREE || {}
+var THREE = THREE || {};

+ 4 - 4
src/cameras/Camera.js

@@ -5,7 +5,7 @@
 THREE.Camera = function (x, y, z) {
 
 	this.position = new THREE.Vector3(x, y, z);
-	this.target = { position: new THREE.Vector3(0, 0, 0) }
+	this.target = { position: new THREE.Vector3(0, 0, 0) };
 
 	this.matrix = new THREE.Matrix4();
 	this.projectionMatrix = THREE.Matrix4.makePerspective(45, 1 /*SCREEN_WIDTH/SCREEN_HEIGHT*/, 0.001, 1000);
@@ -23,12 +23,12 @@ THREE.Camera = function (x, y, z) {
 
 		this.matrix.lookAt(this.position, this.target.position, this.up);
 
-	}
+	};
 
 	this.toString = function () {
 
 		return 'THREE.Camera ( ' + this.position + ', ' + this.target.position + ' )';
-	}
+	};
 
 	this.updateMatrix();
-}
+};

+ 8 - 10
src/core/Color.js

@@ -6,8 +6,7 @@ THREE.Color = function ( hex ) {
 
 	var _r, _g, _b, _a, _hex;
 
-	this.__styleString;
-	this.__svgStyleString; // Workaround for WebKit :(
+	this.__styleString = "rgba(0,0,0,1)";
 
 	this.setHex = function ( hex ) {
 
@@ -15,7 +14,7 @@ THREE.Color = function ( hex ) {
 		this.updateRGBA();
 		this.updateStyleString();
 
-	}
+	};
 
 	this.setRGBA = function ( r, g, b, a ) {
 
@@ -27,13 +26,13 @@ THREE.Color = function ( hex ) {
 		this.updateHex();
 		this.updateStyleString();
 
-	}
+	};
 
 	this.updateHex = function () {
 
 		_hex = _a * 255 << 24 | _r << 16 | _g << 8 | _b;
 
-	}
+	};
 
 	this.updateRGBA = function () {
 
@@ -42,21 +41,20 @@ THREE.Color = function ( hex ) {
 		_b = _hex & 0xff;
 		_a = (_hex >> 24 & 0xff) / 255;
 
-	}
+	};
 
 	this.updateStyleString = function () {
 
 		this.__styleString = 'rgba(' + _r + ',' + _g + ',' + _b + ',' + _a + ')';
-		this.__svgStyleString = 'rgb(' + _r + ',' + _g + ',' + _b + '); opacity: ' + _a;
 
-	}
+	};
 
 	this.toString = function () {
 
 		return 'THREE.Color ( r: ' + _r + ', g: ' + _g + ', b: ' + _b + ', a: ' + _a + ', hex: ' + _hex + ' )';
 
-	}
+	};
 
 	this.setHex( hex );
 
-}
+};

+ 2 - 2
src/core/Face3.js

@@ -17,6 +17,6 @@ THREE.Face3 = function ( a, b, c, normal, color ) {
 
 		return 'THREE.Face3 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' )';
 
-	}
+	};
 
-}
+};

+ 2 - 2
src/core/Face4.js

@@ -18,6 +18,6 @@ THREE.Face4 = function ( a, b, c, d, normal, color ) {
 
 		return 'THREE.Face4 ( ' + this.a + ', ' + this.b + ', ' + this.c + ' ' + this.d + ' )';
 
-	}
+	};
 
-}
+};

+ 7 - 7
src/core/Geometry.js

@@ -21,12 +21,12 @@ THREE.Geometry = function () {
 
 		for( f = 0; f < this.faces.length; f++ ) {
 
-			vA = this.vertices[ this.faces[f].a ],
-			vB = this.vertices[ this.faces[f].b ],
-			vC = this.vertices[ this.faces[f].c ],
+			vA = this.vertices[ this.faces[f].a ];
+			vB = this.vertices[ this.faces[f].b ];
+			vC = this.vertices[ this.faces[f].c ];
 
-			cb = new THREE.Vector3(),
-			ab = new THREE.Vector3(),
+			cb = new THREE.Vector3();
+			ab = new THREE.Vector3();
 			normal = new THREE.Vector3();
 
 			cb.sub(vC.position,vB.position);
@@ -53,6 +53,6 @@ THREE.Geometry = function () {
 
 		}
 
-	}
+	};
 
-}
+};

+ 7 - 7
src/core/Matrix3.js

@@ -15,7 +15,7 @@ THREE.Matrix3 = function () {
 		this.n21 = 0; this.n22 = 1; this.n23 = 0;
 		this.n31 = 0; this.n32 = 0; this.n33 = 1;
 
-	}
+	};
 
 	this.assign = function ( m ) {
 
@@ -23,7 +23,7 @@ THREE.Matrix3 = function () {
 		this.n21 = m.n21; this.n22 = m.n22; this.n23 = m.n23;
 		this.n31 = m.n31; this.n32 = m.n32; this.n33 = m.n33;
 
-	}
+	};
 
 	this.multiplySelf = function ( m ) {
 
@@ -43,7 +43,7 @@ THREE.Matrix3 = function () {
 		this.n32 = n31 * m.n12 + n32 * m.n22 + n33 * m.n32;
 		this.n33 = n31 * m.n13 + n32 * m.n23 + n33 * m.n33;
 
-	}
+	};
 
 	this.inverse = function () {
 
@@ -55,7 +55,7 @@ THREE.Matrix3 = function () {
 		this.n21 = n12; this.n22 = n22; this.n23 = n32;
 		this.n31 = n13; this.n32 = n23; this.n33 = n33;
 
-	}
+	};
 
 	this.clone = function () {
 
@@ -67,7 +67,7 @@ THREE.Matrix3 = function () {
 
 		return m;
 
-	}
+	};
 
 	this.toString = function () {
 
@@ -75,6 +75,6 @@ THREE.Matrix3 = function () {
 			"| " + this.n21 + " " + this.n22 + " " + this.n23 + " |\n" +
 			"| " + this.n31 + " " + this.n32 + " " + this.n33 + " |";
 
-	}
+	};
 
-}
+};

+ 17 - 17
src/core/Matrix4.js

@@ -22,7 +22,7 @@ THREE.Matrix4 = function () {
 		this.n21 = 0; this.n22 = 1; this.n23 = 0; this.n24 = 0;
 		this.n31 = 0; this.n32 = 0; this.n33 = 1; this.n34 = 0;
 		this.n41 = 0; this.n42 = 0; this.n43 = 0; this.n44 = 1;
-	}
+	};
 
 	this.lookAt = function ( eye, center, up ) {
 
@@ -50,11 +50,11 @@ THREE.Matrix4 = function () {
 		this.n32 = z.y;
 		this.n33 = z.z;
 		this.n34 = - z.dot( eye );
-	}
+	};
 
 	this.transform = function ( v ) {
 
-        	var vx = v.x, vy = v.y, vz = v.z, vw = ( v.w ? v.w : 1.0 );
+		var vx = v.x, vy = v.y, vz = v.z, vw = v.w ? v.w : 1.0;
 
 		v.x = this.n11 * vx + this.n12 * vy + this.n13 * vz + this.n14 * vw;
 		v.y = this.n21 * vx + this.n22 * vy + this.n23 * vz + this.n24 * vw;
@@ -73,7 +73,7 @@ THREE.Matrix4 = function () {
 			v.z = v.z / vw;
 
 		}
-	}
+	};
 
 	this.crossVector = function ( a ) {
 
@@ -87,7 +87,7 @@ THREE.Matrix4 = function () {
 
 		return v;
 
-	}
+	};
 
 	this.multiply = function ( a, b ) {
 
@@ -111,7 +111,7 @@ THREE.Matrix4 = function () {
 		this.n43 = a.n41 * b.n13 + a.n42 * b.n23 + a.n43 * b.n33 + a.n44 * b.n43;
 		this.n44 = a.n41 * b.n14 + a.n42 * b.n24 + a.n43 * b.n34 + a.n44 * b.n44;
 
-	}
+	};
 
 	this.multiplySelf = function ( m ) {
 
@@ -140,7 +140,7 @@ THREE.Matrix4 = function () {
 		this.n43 = n41 * m.n13 + n42 * m.n23 + n43 * m.n33 + n44 * m.n43;
 		this.n44 = n41 * m.n14 + n42 * m.n24 + n43 * m.n34 + n44 * m.n44;
 
-	}
+	};
 
 	this.clone = function () {
 
@@ -151,7 +151,7 @@ THREE.Matrix4 = function () {
 		m.n41 = this.n41; m.n42 = this.n42; m.n43 = this.n43; m.n44 = this.n44;
 		return m;
 
-	}
+	};
 
 	this.toString = function() {
 
@@ -160,9 +160,9 @@ THREE.Matrix4 = function () {
 			"| " + this.n31 + " " + this.n32 + " " + this.n33 + " " + this.n34 + " |\n" +
 			"| " + this.n41 + " " + this.n42 + " " + this.n43 + " " + this.n44 + " |";
 
-	}
+	};
 
-}
+};
 
 THREE.Matrix4.translationMatrix = function ( x, y, z ) {
 
@@ -174,7 +174,7 @@ THREE.Matrix4.translationMatrix = function ( x, y, z ) {
 
 	return m;
 
-}
+};
 
 THREE.Matrix4.scaleMatrix = function ( x, y, z ) {
 
@@ -186,7 +186,7 @@ THREE.Matrix4.scaleMatrix = function ( x, y, z ) {
 
 	return m;
 
-}
+};
 
 THREE.Matrix4.rotationXMatrix = function ( theta ) {
 
@@ -198,7 +198,7 @@ THREE.Matrix4.rotationXMatrix = function ( theta ) {
 
 	return rot;
 
-}
+};
 
 THREE.Matrix4.rotationYMatrix = function ( theta ) {
 
@@ -210,7 +210,7 @@ THREE.Matrix4.rotationYMatrix = function ( theta ) {
 
 	return rot;
 
-}
+};
 
 THREE.Matrix4.rotationZMatrix = function( theta ) {
 
@@ -222,7 +222,7 @@ THREE.Matrix4.rotationZMatrix = function( theta ) {
 
 	return rot;
 
-}
+};
 
 THREE.Matrix4.makeFrustum = function( left, right, bottom, top, near, far ) {
 
@@ -242,7 +242,7 @@ THREE.Matrix4.makeFrustum = function( left, right, bottom, top, near, far ) {
 
 	return m;
 
-}
+};
 
 THREE.Matrix4.makePerspective = function( fovy, aspect, near, far ) {
 
@@ -253,4 +253,4 @@ THREE.Matrix4.makePerspective = function( fovy, aspect, near, far ) {
 
 	return THREE.Matrix4.makeFrustum( xmin, xmax, ymin, ymax, near, far );
 
-}
+};

+ 18 - 18
src/core/Rectangle.js

@@ -20,49 +20,49 @@ THREE.Rectangle = function ( x1, y1, x2, y2 ) {
 
 		return _x1;
 
-	}
+	};
 
 	this.getY = function () {
 
 		return _y1;
 
-	}
+	};
 
 	this.getWidth = function () {
 
 		return _width;
 
-	}
+	};
 
 	this.getHeight = function () {
 
 		return _height;
 
-	}
+	};
 
 	this.getX1 = function() {
 
 		return _x1;
 
-	}
+	};
 
 	this.getY1 = function() {
 
 		return _y1;
 
-	}
+	};
 
 	this.getX2 = function() {
 
 		return _x2;
 
-	}
+	};
 
 	this.getY2 = function() {
 
 		return _y2;
 
-	}
+	};
 
 	this.set = function ( x1, y1, x2, y2 ) {
 
@@ -73,7 +73,7 @@ THREE.Rectangle = function ( x1, y1, x2, y2 ) {
 
 		resize();
 
-	}
+	};
 
 	this.addPoint = function ( x, y ) {
 
@@ -94,7 +94,7 @@ THREE.Rectangle = function ( x1, y1, x2, y2 ) {
 
 		resize();
 
-	}
+	};
 
 	this.addRectangle = function ( r ) {
 
@@ -115,7 +115,7 @@ THREE.Rectangle = function ( x1, y1, x2, y2 ) {
 
 		resize();
 
-	}
+	};
 
 	this.inflate = function ( v ) {
 
@@ -124,7 +124,7 @@ THREE.Rectangle = function ( x1, y1, x2, y2 ) {
 
 		resize();
 
-	}
+	};
 
 	this.minSelf = function( r ) {
 
@@ -135,7 +135,7 @@ THREE.Rectangle = function ( x1, y1, x2, y2 ) {
 
 		resize();
 
-	}
+	};
 
 	/*
 	this.containsPoint = function (x, y) {
@@ -149,23 +149,23 @@ THREE.Rectangle = function ( x1, y1, x2, y2 ) {
 
 		return Math.min( _x2, r.getX2() ) - Math.max( _x1, r.getX1() ) > 0 && Math.min( _y2, r.getY2() ) - Math.max( _y1, r.getY1() ) > 0;
 
-	}
+	};
 
 	this.empty = function () {
 
 		_isEmpty = true;
 
 		_x1 = 0; _y1 = 0;
-		_x2 = 0, _y2 = 0;
+		_x2 = 0; _y2 = 0;
 
 		resize();
 
-	}
+	};
 
 	this.toString = function () {
 
 		return "THREE.Rectangle (x1: " + _x1 + ", y1: " + _y2 + ", x2: " + _x2 + ", y1: " + _y1 + ", width: " + _width + ", height: " + _height + ")";
 
-	}
+	};
 
-}
+};

+ 14 - 14
src/core/Vector2.js

@@ -12,84 +12,84 @@ THREE.Vector2 = function ( x, y ) {
 		this.x = x;
 		this.y = y;
 
-	}
+	};
 
 	this.copy = function ( v ) {
 
 		this.x = v.x;
 		this.y = v.y;
 
-	}
+	};
 
 	this.addSelf = function ( v ) {
 
 		this.x += v.x;
 		this.y += v.y;
 
-	}
+	};
 
 	this.add = function ( v1, v2 ) {
 
 		this.x = v1.x + v2.x;
 		this.y = v1.y + v2.y;
 
-	}
+	};
 
 	this.subSelf = function ( v ) {
 
 		this.x -= v.x;
 		this.y -= v.y;
 
-	}
+	};
 
 	this.sub = function ( v1, v2 ) {
 
 		this.x = v1.x - v2.x;
 		this.y = v1.y - v2.y;
 
-	}
+	};
 
 	this.multiplyScalar = function ( s ) {
 
 		this.x *= s;
 		this.y *= s;
 
-	}
+	};
 
 	this.unit = function () {
 
 		this.multiplyScalar( 1 / this.length() );
 
-	}
+	};
 
 	this.length = function () {
 
 		return Math.sqrt( this.x * this.x + this.y * this.y );
 
-	}
+	};
 
 	this.lengthSq = function () {
 
 		return this.x * this.x + this.y * this.y;
 
-	}
+	};
 
 	this.negate = function() {
 
 		this.x = - this.x;
 		this.y = - this.y;
 
-	}
+	};
 
 	this.clone = function () {
 
 		return new THREE.Vector2( this.x, this.y );
 
-	}
+	};
 
 	this.toString = function () {
 
 		return 'THREE.Vector2 (' + this.x + ', ' + this.y + ')';
 
-	}
-}
+	};
+};

+ 22 - 20
src/core/Vector3.js

@@ -15,7 +15,7 @@ THREE.Vector3 = function ( x, y, z ) {
 		this.y = y;
 		this.z = z;
 
-	}
+	};
 
 	this.copy = function ( v ) {
 
@@ -23,7 +23,7 @@ THREE.Vector3 = function ( x, y, z ) {
 		this.y = v.y;
 		this.z = v.z;
 
-	}
+	};
 
 	this.add = function( v1, v2 ) {
 
@@ -31,7 +31,7 @@ THREE.Vector3 = function ( x, y, z ) {
 		this.y = v1.y + v2.y;
 		this.z = v1.z + v2.z;
 
-	}
+	};
 
 	this.addSelf = function ( v ) {
 
@@ -39,7 +39,7 @@ THREE.Vector3 = function ( x, y, z ) {
 		this.y += v.y;
 		this.z += v.z;
 
-	}
+	};
 
 	this.addScalar = function ( s ) {
 
@@ -47,7 +47,7 @@ THREE.Vector3 = function ( x, y, z ) {
 		this.y += s;
 		this.z += s;
 
-	}
+	};
 
 	this.sub = function( v1, v2 ) {
 
@@ -55,7 +55,7 @@ THREE.Vector3 = function ( x, y, z ) {
 		this.y = v1.y - v2.y;
 		this.z = v1.z - v2.z;
 
-	}
+	};
 
 	this.subSelf = function ( v ) {
 
@@ -63,7 +63,7 @@ THREE.Vector3 = function ( x, y, z ) {
 		this.y -= v.y;
 		this.z -= v.z;
 
-	}
+	};
 
 	this.crossSelf = function ( v ) {
 
@@ -73,14 +73,14 @@ THREE.Vector3 = function ( x, y, z ) {
 		this.y = tz * v.x - tx * v.z;
 		this.z = tx * v.y - ty * v.x;
 
-	}
+	};
 
 	this.multiplySelf = function ( v ) {
 
 		this.x *= v.x;
 		this.y *= v.y;
 		this.z *= v.z;
-	}
+	};
 
 	this.multiplyScalar = function ( s ) {
 
@@ -88,45 +88,46 @@ THREE.Vector3 = function ( x, y, z ) {
 		this.y *= s;
 		this.z *= s;
 
-	}
+	};
 
 	this.dot = function ( v ) {
 
 		return this.x * v.x + this.y * v.y + this.z * v.z;
 
-	}
+	};
 
 	this.distanceTo = function ( v ) {
 
 		return Math.sqrt( this.distanceToSquared( v ) );
 
-	}
+	};
 
 	this.distanceToSquared = function ( v ) {
 
 		var dx = this.x - v.x, dy = this.y - v.y, dz = this.z - v.z;
 		return dx * dx + dy * dy + dz * dz;
 
-	}
+	};
 
 	this.length = function () {
 
 		return Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z );
 
-	}
+	};
 
 	this.lengthSq = function () {
 
 		return this.x * this.x + this.y * this.y + this.z * this.z;
 
-	}
+	};
 
 	this.negate = function () {
 
 		this.x = - this.x;
 		this.y = - this.y;
 		this.z = - this.z;
-	}
+
+	};
 
 	this.normalize = function () {
 
@@ -139,18 +140,19 @@ THREE.Vector3 = function ( x, y, z ) {
 			this.multiplyScalar(0);
 
 		}
-	}
+
+	};
 
 	this.clone = function () {
 
 		return new THREE.Vector3(this.x, this.y, this.z);
 
-	}
+	};
 
 	this.toString = function () {
 
 		return 'THREE.Vector3 (' + this.x + ', ' + this.y + ', ' + this.z + ')';
 
-	}
+	};
 
-}
+};

+ 10 - 10
src/core/Vector4.js

@@ -16,7 +16,7 @@ THREE.Vector4 = function ( x, y, z, w ) {
 		this.z = z;
 		this.w = w;
 
-	}
+	};
 
 	this.copy = function ( v ) {
 
@@ -25,7 +25,7 @@ THREE.Vector4 = function ( x, y, z, w ) {
 		this.z = v.z;
 		this.w = v.w;
 
-	}
+	};
 
 	this.add = function ( v1, v2 ) {
 
@@ -34,7 +34,7 @@ THREE.Vector4 = function ( x, y, z, w ) {
 		this.z = v1.z + v2.z;
 		this.w = v1.w + v2.w;
 
-	}
+	};
 
 	this.addSelf = function ( v ) {
 
@@ -43,7 +43,7 @@ THREE.Vector4 = function ( x, y, z, w ) {
 		this.z += v.z;
 		this.w += v.w;
 
-	}
+	};
 
 	this.sub = function ( v1, v2 ) {
 
@@ -52,7 +52,7 @@ THREE.Vector4 = function ( x, y, z, w ) {
 		this.z = v1.z - v2.z;
 		this.w = v1.w - v2.w;
 
-	}
+	};
 
 	this.subSelf = function ( v ) {
 
@@ -61,24 +61,24 @@ THREE.Vector4 = function ( x, y, z, w ) {
 		this.z -= v.z;
 		this.w -= v.w;
 
-	}
+	};
 
 	this.clone = function () {
 
 		return new THREE.Vector4( this.x, this.y, this.z, this.w );
 
-	}
+	};
 
 	this.toVector3 = function () {
 
 		return new THREE.Vector3( this.x / this.w, this.y / this.w, this.z / this.w );
 
-	}
+	};
 
 	this.toString = function () {
 
 		return 'THREE.Vector4 (' + this.x + ', ' + this.y + ', ' + this.z + ', ' + this.w + ')';
 
-	}
+	};
 
-}
+};

+ 2 - 2
src/core/Vertex.js

@@ -13,5 +13,5 @@ THREE.Vertex = function ( position, normal ) {
 	this.toString = function () {
 
 		return 'THREE.Vertex ( position: ' + this.position + ', normal: ' + this.normal + ' )';
-	}
-}
+	};
+};

+ 2 - 2
src/materials/BitmapUVMappingMaterial.js

@@ -10,6 +10,6 @@ THREE.BitmapUVMappingMaterial = function ( bitmap ) {
 
 		return 'THREE.BitmapUVMappingMaterial ( bitmap: ' + this.bitmap + ' )';
 
-	}
+	};
 
-}
+};

+ 3 - 3
src/materials/ColorFillMaterial.js

@@ -4,12 +4,12 @@
 
 THREE.ColorFillMaterial = function ( hex, opacity ) {
 
-	this.color = new THREE.Color( ( opacity != null ? ( opacity * 0xff ) << 24 : 0xff000000 ) | hex );
+	this.color = new THREE.Color( ( opacity >= 0 ? ( opacity * 0xff ) << 24 : 0xff000000 ) | hex );
 
 	this.toString = function () {
 
 		return 'THREE.ColorFillMaterial ( color: ' + this.color + ' )';
 
-	}
+	};
 
-}
+};

+ 4 - 3
src/materials/ColorStrokeMaterial.js

@@ -5,12 +5,13 @@
 THREE.ColorStrokeMaterial = function ( lineWidth, hex, opacity ) {
 
 	this.lineWidth = lineWidth || 1;
-	this.color = new THREE.Color( ( opacity != null ? ( opacity * 0xff ) << 24 : 0xff000000 ) | hex );
+
+	this.color = new THREE.Color( ( opacity >= 0 ? ( opacity * 0xff ) << 24 : 0xff000000 ) | hex );
 
 	this.toString = function () {
 
 		return 'THREE.ColorStrokeMaterial ( lineWidth: ' + this.lineWidth + ', color: ' + this.color + ' )';
 
-	}
+	};
 
-}
+};

+ 2 - 2
src/materials/FaceColorFillMaterial.js

@@ -8,6 +8,6 @@ THREE.FaceColorFillMaterial = function () {
 
 		return 'THREE.FaceColorFillMaterial ( )';
 
-	}
+	};
 
-}
+};

+ 2 - 2
src/materials/FaceColorStrokeMaterial.js

@@ -10,6 +10,6 @@ THREE.FaceColorStrokeMaterial = function ( lineWidth ) {
 
 		return 'THREE.FaceColorStrokeMaterial ( lineWidth: ' + this.lineWidth + ' )';
 
-	}
+	};
 
-}
+};

+ 1 - 1
src/objects/Line.js

@@ -8,7 +8,7 @@ THREE.Line = function ( geometry, material ) {
 
 	this.geometry = geometry;
 
-}
+};
 
 THREE.Line.prototype = new THREE.Object3D();
 THREE.Line.prototype.constructor = THREE.Line;

+ 1 - 1
src/objects/Mesh.js

@@ -10,7 +10,7 @@ THREE.Mesh = function ( geometry, material ) {
 
 	this.doubleSided = false;
 
-}
+};
 
 THREE.Mesh.prototype = new THREE.Object3D();
 THREE.Mesh.prototype.constructor = THREE.Mesh;

+ 7 - 7
src/objects/Object3D.js

@@ -19,12 +19,12 @@ THREE.Object3D = function ( material ) {
 
 		this.matrix.identity();
 
-		this.matrix.multiplySelf(THREE.Matrix4.translationMatrix(this.position.x, this.position.y, this.position.z));
-		this.matrix.multiplySelf(THREE.Matrix4.rotationXMatrix(this.rotation.x));
-		this.matrix.multiplySelf(THREE.Matrix4.rotationYMatrix(this.rotation.y));
-		this.matrix.multiplySelf(THREE.Matrix4.rotationZMatrix(this.rotation.z));
-		this.matrix.multiplySelf(THREE.Matrix4.scaleMatrix(this.scale.x, this.scale.y, this.scale.z));
+		this.matrix.multiplySelf( THREE.Matrix4.translationMatrix( this.position.x, this.position.y, this.position.z ) );
+		this.matrix.multiplySelf( THREE.Matrix4.rotationXMatrix( this.rotation.x ) );
+		this.matrix.multiplySelf( THREE.Matrix4.rotationYMatrix( this.rotation.y ) );
+		this.matrix.multiplySelf( THREE.Matrix4.rotationZMatrix( this.rotation.z ) );
+		this.matrix.multiplySelf( THREE.Matrix4.scaleMatrix( this.scale.x, this.scale.y, this.scale.z ) );
 
-	}
+	};
 
-}
+};

+ 1 - 1
src/objects/Particle.js

@@ -9,7 +9,7 @@ THREE.Particle = function ( material ) {
 	this.size = 1;
 	this.autoUpdateMatrix = false;
 
-}
+};
 
 THREE.Particle.prototype = new THREE.Object3D();
 THREE.Particle.prototype.constructor = THREE.Particle;

+ 11 - 11
src/renderers/CanvasRenderer.js

@@ -13,6 +13,8 @@ THREE.CanvasRenderer = function () {
 	_bboxRect = new THREE.Rectangle(),
 	_vector2 = new THREE.Vector2();
 
+	this.domElement = _viewport;
+
 	this.setSize = function ( width, height ) {
 
 		_viewport.width = width;
@@ -22,9 +24,7 @@ THREE.CanvasRenderer = function () {
 
 		_clipRect.set( -width / 2, -height / 2, width / 2, height / 2 );
 
-	}
-
-	this.domElement = _viewport;
+	};
 
 	this.render = function ( scene, camera ) {
 
@@ -206,14 +206,14 @@ THREE.CanvasRenderer = function () {
 					expand( suv2, suv3 );
 					expand( suv3, suv1 );
 
-					suv1x = ( uv1.x == 0 ) ? 1 : ( uv1.x == 1 ) ? suv1.x - 1 : suv1.x;
-					suv1y = ( uv1.y == 0 ) ? 1 : ( uv1.y == 1 ) ? suv1.y - 1 : suv1.y;
+					suv1x = ( uv1.x === 0 ) ? 1 : ( uv1.x === 1 ) ? suv1.x - 1 : suv1.x;
+					suv1y = ( uv1.y === 0 ) ? 1 : ( uv1.y === 1 ) ? suv1.y - 1 : suv1.y;
 
-					suv2x = ( uv2.x == 0 ) ? 1 : ( uv2.x == 1 ) ? suv2.x - 1 : suv2.x;
-					suv2y = ( uv2.y == 0 ) ? 1 : ( uv2.y == 1 ) ? suv2.y - 1 : suv2.y;
+					suv2x = ( uv2.x === 0 ) ? 1 : ( uv2.x === 1 ) ? suv2.x - 1 : suv2.x;
+					suv2y = ( uv2.y === 0 ) ? 1 : ( uv2.y === 1 ) ? suv2.y - 1 : suv2.y;
 
-					suv3x = ( uv3.x == 0 ) ? 1 : ( uv3.x == 1 ) ? suv3.x - 1 : suv3.x;
-					suv3y = ( uv3.y == 0 ) ? 1 : ( uv3.y == 1 ) ? suv3.y - 1 : suv3.y;
+					suv3x = ( uv3.x === 0 ) ? 1 : ( uv3.x === 1 ) ? suv3.x - 1 : suv3.x;
+					suv3y = ( uv3.y === 0 ) ? 1 : ( uv3.y === 1 ) ? suv3.y - 1 : suv3.y;
 
 					// Textured triangle drawing by Thatcher Ulrich.
 					// http://tulrich.com/geekstuff/canvas/jsgl.js
@@ -249,7 +249,7 @@ THREE.CanvasRenderer = function () {
 		_context.strokeRect( _clearRect.getX(), _clearRect.getY(), _clearRect.getWidth(), _clearRect.getHeight() );
 		*/
 
-	}
+	};
 
 	function expand( a, b ) {
 
@@ -261,7 +261,7 @@ THREE.CanvasRenderer = function () {
 
 	}
 
-}
+};
 
 THREE.CanvasRenderer.prototype = new THREE.Renderer();
 THREE.CanvasRenderer.prototype.constructor = THREE.CanvasRenderer;

+ 4 - 4
src/renderers/GLRenderer.js

@@ -9,19 +9,19 @@ var GLRenderer = Renderer.extend
 	init: function()
 	{
 		this._super();
-		
+
 		this.viewport = document.createElement("canvas");
 		this.viewport.style.position = "absolute";
-		
+
 		try {
 			this.gl = this.viewport.getContext("experimental-webgl");
 		} catch(e) {}
-			
+
 		if (!this.gl) {
 			alert("WebGL not supported");
 			throw "cannot create webgl context";
 		}
-		
+
 		this.gl.clearColor(0.0, 0.0, 0.0, 1.0);
 		this.gl.clearDepth(1.0);
 		this.gl.enable(this.gl.DEPTH_TEST);

+ 5 - 4
src/renderers/Renderer.js

@@ -11,14 +11,14 @@ THREE.Renderer = function() {
 
 	matrix = new THREE.Matrix4();
 
-	this.renderList;
-
 	function painterSort(a, b) {
 
 		return a.screenZ - b.screenZ;
 
 	}
 
+	this.renderList = null;
+
 	this.project = function (scene, camera) {
 
 		var i, j, vertex, vertex2, face, object, v1, v2, v3, v4,
@@ -243,5 +243,6 @@ THREE.Renderer = function() {
 
 		this.renderList.sort(painterSort);
 
-	}
-}
+	};
+
+};

+ 15 - 13
src/renderers/SVGRenderer.js

@@ -12,6 +12,8 @@ THREE.SVGRenderer = function () {
 	_svgPathPool = [], _svgCirclePool = [],
 	_quality = 1;
 
+	this.domElement = _viewport;
+
 	this.setQuality = function( quality ) {
 
 		switch(quality) {
@@ -20,7 +22,8 @@ THREE.SVGRenderer = function () {
 			case "low": _quality = 0; break;
 
 		}
-	}
+
+	};
 
 	this.setSize = function ( width, height ) {
 
@@ -29,9 +32,8 @@ THREE.SVGRenderer = function () {
 		_viewport.setAttribute( 'height', height );
 
 		_clipRect.set( - width / 2, - height / 2, width / 2, height / 2 );
-	}
 
-	this.domElement = _viewport;
+	};
 
 	this.render = function ( scene, camera ) {
 
@@ -123,19 +125,19 @@ THREE.SVGRenderer = function () {
 
 				if ( material instanceof THREE.ColorFillMaterial ) {
 
-					svgNode.setAttribute( 'style', 'fill: ' + material.color.__svgStyleString );
+					svgNode.setAttribute( 'style', 'fill: ' + material.color.__styleString );
 
 				} else if ( material instanceof THREE.FaceColorFillMaterial ) {
 
-					svgNode.setAttribute( 'style', 'fill: ' + element.color.__svgStyleString );
+					svgNode.setAttribute( 'style', 'fill: ' + element.color.__styleString );
 
 				} else if ( material instanceof THREE.ColorStrokeMaterial ) {
 
-					svgNode.setAttribute( 'style', 'fill: none; stroke: ' + material.color.__svgStyleString + '; stroke-width: ' + material.lineWidth + '; stroke-linecap: round; stroke-linejoin: round' );
+					svgNode.setAttribute( 'style', 'fill: none; stroke: ' + material.color.__styleString + '; stroke-width: ' + material.lineWidth + '; stroke-linecap: round; stroke-linejoin: round' );
 
 				} else if ( material instanceof THREE.FaceColorStrokeMaterial ) {
 
-					svgNode.setAttribute( 'style', 'fill: none; stroke: ' + element.color.__svgStyleString + '; stroke-width: ' + material.lineWidth + '; stroke-linecap: round; stroke-linejoin: round' );
+					svgNode.setAttribute( 'style', 'fill: none; stroke: ' + element.color.__styleString + '; stroke-width: ' + material.lineWidth + '; stroke-linecap: round; stroke-linejoin: round' );
 
 				}
 
@@ -145,15 +147,15 @@ THREE.SVGRenderer = function () {
 
 		}
 
-	}
+	};
 
 	function getPathNode( id ) {
 
-		if ( _svgPathPool[ id ] == null ) {
+		if ( _svgPathPool[ id ] === null ) {
 
 			_svgPathPool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'path' );
 
-			if ( _quality == 0 ) {
+			if ( _quality === 0 ) {
 
 				_svgPathPool[ id ].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed
 
@@ -169,11 +171,11 @@ THREE.SVGRenderer = function () {
 
 	function getCircleNode( id ) {
 
-		if ( _svgCirclePool[id] == null ) {
+		if ( _svgCirclePool[id] === null ) {
 
 			_svgCirclePool[ id ] = document.createElementNS( 'http://www.w3.org/2000/svg', 'circle' );
 
-			if ( _quality == 0 ) {
+			if ( _quality === 0 ) {
 
 				_svgCirclePool[id].setAttribute( 'shape-rendering', 'crispEdges' ); //optimizeSpeed
 
@@ -187,7 +189,7 @@ THREE.SVGRenderer = function () {
 
 	}
 
-}
+};
 
 THREE.SVGRenderer.prototype = new THREE.Renderer();
 THREE.SVGRenderer.prototype.constructor = THREE.CanvasRenderer;

+ 4 - 4
src/renderers/renderables/RenderableFace3.js

@@ -8,9 +8,9 @@ THREE.RenderableFace3 = function () {
 	this.v2 = new THREE.Vector2();
 	this.v3 = new THREE.Vector2();
 
-	this.screenZ;
+	this.screenZ = null;
 
-	this.color;
-	this.material;
+	this.color = null;
+	this.material = null;
 
-}
+};

+ 4 - 4
src/renderers/renderables/RenderableFace4.js

@@ -9,9 +9,9 @@ THREE.RenderableFace4 = function () {
 	this.v3 = new THREE.Vector2();
 	this.v4 = new THREE.Vector2();
 
-	this.screenZ;
+	this.screenZ = null;
 
-	this.color;
-	this.material;
+	this.color = null;
+	this.material = null;
 
-}
+};

+ 4 - 4
src/renderers/renderables/RenderableLine.js

@@ -7,9 +7,9 @@ THREE.RenderableLine = function () {
 	this.v1 = new THREE.Vector2();
 	this.v2 = new THREE.Vector2();
 
-	this.screenZ;
+	this.screenZ = null;
 
-	this.color;
-	this.material;
+	this.color = null;
+	this.material = null;
 
-}
+};

+ 6 - 6
src/renderers/renderables/RenderableParticle.js

@@ -4,11 +4,11 @@
 
 THREE.RenderableParticle = function () {
 
-	this.x;
-	this.y;
-	this.screenZ;
+	this.x = null;
+	this.y = null;
+	this.screenZ = null;
 
-	this.color;
-	this.material;
+	this.color = null;
+	this.material = null;
 
-}
+};

+ 13 - 11
src/scenes/Scene.js

@@ -7,27 +7,29 @@ THREE.Scene = function () {
 	this.objects = [];
 
 	this.add = function (object) {
-	
+
 		this.objects.push(object);
-	}
-	
+
+	};
+
 	/*
 	this.remove = function (object) {
-		
+
 		var nrObjects = this.objects.length;
-	
+
 		for(var i = 0; i < nrObjects; i++) {
-		
+
 			if(object == this.objects[i]) {
-			
+
 				alert("yay");
 			}
 		}
 	}
 	*/
-	
+
 	this.toString = function () {
-	
+
 		return 'THREE.Scene ( ' + this.objects + ' )';
-	}
-}
+	};
+
+};

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません