瀏覽代碼

Updated builds.

Mr.doob 11 年之前
父節點
當前提交
566366fced
共有 2 個文件被更改,包括 285 次插入62 次删除
  1. 273 55
      build/three.js
  2. 12 7
      build/three.min.js

+ 273 - 55
build/three.js

@@ -870,19 +870,41 @@ THREE.Quaternion.prototype = {
 
 	setFromUnitVectors: function () {
 
-		// http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
+		// http://lolengine.net/blog/2014/02/24/quaternion-from-two-vectors-final
 
 		// assumes direction vectors vFrom and vTo are normalized
 
-		var v1;
+		var v1, r;
+
+		var EPS = 0.000001;
 
 		return function( vFrom, vTo ) {
 
 			if ( v1 === undefined ) v1 = new THREE.Vector3();
 
-			v1.crossVectors( vFrom, vTo );
+			r = vFrom.dot( vTo ) + 1;
+
+			if ( r < EPS ) {
+
+				r = 0;
+
+				if ( Math.abs( vFrom.x ) > Math.abs( vFrom.z ) ) {
+
+					v1.set( - vFrom.y, vFrom.x, 0 );
+
+				} else {
 
-			this.set( v1.x, v1.y, v1.z, vFrom.dot( vTo ) + 1 ).normalize();
+					v1.set( 0, - vFrom.z, vFrom.y );
+
+				}
+
+			} else {
+
+				v1.crossVectors( vFrom, vTo );
+
+			}
+
+			this.set( v1.x, v1.y, v1.z, r ).normalize();
 
 			this._updateEuler();
 
@@ -2905,56 +2927,6 @@ THREE.Vector4.prototype = {
 
 };
 
-/**
- * @author mrdoob / http://mrdoob.com/
- */
-
-THREE.ProxyVector2 = function ( array, offset ) {
-
-	this.array = array;
-	this.offset = offset;
-	
-};
-
-THREE.ProxyVector2.prototype = Object.create( THREE.Vector2.prototype );
-
-Object.defineProperties( THREE.ProxyVector2.prototype, {
-	'x': {
-		get: function () { return this.array[ this.offset ]; },
-		set: function ( v ) { this.array[ this.offset ] = v; }
-	},
-	'y': {
-		get: function () { return this.array[ this.offset + 1 ]; },
-		set: function ( v ) { this.array[ this.offset + 1 ] = v; }
-	}
-} );
-/**
- * @author mrdoob / http://mrdoob.com/
- */
-
-THREE.ProxyVector3 = function ( array, offset ) {
-	
-	this.array = array;
-	this.offset = offset;
-
-};
-
-THREE.ProxyVector3.prototype = Object.create( THREE.Vector3.prototype );
-
-Object.defineProperties( THREE.ProxyVector3.prototype, {
-	'x': {
-		get: function () { return this.array[ this.offset ]; },
-		set: function ( v ) { this.array[ this.offset ] = v; }
-	},
-	'y': {
-		get: function () { return this.array[ this.offset + 1 ]; },
-		set: function ( v ) { this.array[ this.offset + 1 ] = v; }
-	},
-	'z': {
-		get: function () { return this.array[ this.offset + 2 ]; },
-		set: function ( v ) { this.array[ this.offset + 2 ] = v; }
-	}
-} );
 /**
  * @author mrdoob / http://mrdoob.com/
  * @author WestLangley / http://github.com/WestLangley
@@ -10682,6 +10654,168 @@ THREE.Geometry2 = function ( vertices, normals, uvs ) {
 };
 
 THREE.Geometry2.prototype = Object.create( THREE.BufferGeometry.prototype );
+
+THREE.Geometry99 = function ( ) {
+
+	THREE.BufferGeometry.call( this );
+
+};
+
+THREE.Geometry99.prototype = Object.create( THREE.BufferGeometry.prototype );
+
+Object.defineProperties( THREE.Geometry99.prototype, {
+
+	vertices: { 
+
+		enumerable: true, 
+		get: function() { return this.createVertexProxies(); } 
+
+	},
+	faces: {
+
+		enumerable: true,  
+		get: function() { return this.createFaceProxies() } 
+
+	},
+	faceVertexUvs: {
+
+		enumerable: true,  
+		get: function() { return this.createUvProxies() } 
+
+	}
+	// TODO - fill in additional proxies:
+	// - colors
+	// - morphColors
+	// - morphNormals
+	// - morphTargets
+	// - skinIndex
+	// - skinWeights
+} );
+
+THREE.Geometry99.prototype.createVertexProxies = function() {
+
+	// Replace the prototype getter with a local array property
+
+	Object.defineProperty( this, "vertices", { value: [] } );
+
+	// If the attribute buffer has already been populated, set up proxy objects
+
+	this.populateProxyFromBuffer( this.vertices, "position", THREE.ProxyVector3, 3 );
+
+	// Return a reference to the newly-created array
+
+	return this.vertices;
+
+};
+
+THREE.Geometry99.prototype.createFaceProxies = function () {
+
+	// Replace the prototype getter with a local array property
+
+	Object.defineProperty( this, "faces", { value: [] } );
+
+	// If the attribute buffer has already been populated, set up proxy objects
+
+	if ( this.attributes.index ) {
+
+		var indexarray = this.attributes[ 'index' ].array;
+		var size = 3;
+		var attr = this.faces;
+
+		var normalarray = false;
+
+		if (this.attributes[ 'normal' ]) {
+
+			normalarray = this.attributes[ 'normal' ].array;
+
+		}
+
+		for ( var i = 0, l = indexarray.length / size; i < l; i ++ ) {
+
+			var o = i * size;
+
+			// Generate faceVertexNormals
+			var vertexNormals;
+			if (normalarray) {
+
+				vertexNormals = [
+					new THREE.ProxyVector3( normalarray, indexarray[ o     ] * 3 ),
+					new THREE.ProxyVector3( normalarray, indexarray[ o + 1 ] * 3 ),
+					new THREE.ProxyVector3( normalarray, indexarray[ o + 2 ] * 3 )
+				]
+
+			}
+
+			// TODO - do BufferGeometries support face normals?
+
+			var face = new THREE.ProxyFace3( indexarray, i * size, vertexNormals );
+
+			attr.push( face );
+
+		}
+
+	} else {
+
+		// TODO - should be able to generate Face data even for non-indexed geometries
+
+	}
+
+	// Return a reference to the newly-created array
+
+	return this.faces;
+
+};
+
+THREE.Geometry99.prototype.createUvProxies = function () {
+
+	// Replace the prototype getter with a local array property
+
+	Object.defineProperty( this, "faceVertexUvs", { value: [[]] } );
+
+	// If the attribute buffer has already been populated, set up proxy objects
+
+	if ( this.attributes.uv ) {
+
+		var faces = this.faces;
+		var uvarray = this.attributes.uv.array;
+
+		for (var i = 0, l = faces.length; i < l; i++) {
+			var f = faces[i];
+
+			this.faceVertexUvs[0][i] = [];
+			this.faceVertexUvs[0][i][0] = new THREE.ProxyVector2(uvarray, f.a * 2);
+			this.faceVertexUvs[0][i][1] = new THREE.ProxyVector2(uvarray, f.b * 2);
+			this.faceVertexUvs[0][i][2] = new THREE.ProxyVector2(uvarray, f.c * 2);
+
+		}
+	
+	}
+
+	// Return a reference to the newly-created array
+
+	return this.faceVertexUvs;
+
+};
+
+THREE.Geometry99.prototype.populateProxyFromBuffer = function ( attr, buffername, proxytype, itemsize, offset, count ) {
+
+	if ( this.attributes[ buffername ] ) {
+
+		var array = this.attributes[ buffername ].array;
+		var size = itemsize || this.attributes[ buffername ].itemSize;
+		var start = offset || 0;
+
+		count = count || ( array.length / size - start );
+
+		for ( var i = start, l = start + count; i < l; i ++ ) {
+
+			attr.push( new proxytype( array, i * size ) );
+
+		}
+
+	}
+
+};
 /**
  * @author mrdoob / http://mrdoob.com/
  */
@@ -10697,7 +10831,91 @@ THREE.IndexedGeometry2 = function ( indices, vertices, normals, uvs ) {
 
 };
 
-THREE.IndexedGeometry2.prototype = Object.create( THREE.BufferGeometry.prototype );
+THREE.IndexedGeometry2.prototype = Object.create( THREE.Geometry99.prototype );
+
+/**
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+THREE.ProxyVector2 = function ( array, offset ) {
+
+	this.array = array;
+	this.offset = offset;
+	
+};
+
+THREE.ProxyVector2.prototype = Object.create( THREE.Vector2.prototype );
+
+Object.defineProperties( THREE.ProxyVector2.prototype, {
+	'x': {
+		get: function () { return this.array[ this.offset ]; },
+		set: function ( v ) { this.array[ this.offset ] = v; }
+	},
+	'y': {
+		get: function () { return this.array[ this.offset + 1 ]; },
+		set: function ( v ) { this.array[ this.offset + 1 ] = v; }
+	}
+} );
+/**
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+THREE.ProxyVector3 = function ( array, offset ) {
+	
+	this.array = array;
+	this.offset = offset;
+
+};
+
+THREE.ProxyVector3.prototype = Object.create( THREE.Vector3.prototype );
+
+Object.defineProperties( THREE.ProxyVector3.prototype, {
+	'x': {
+		get: function () { return this.array[ this.offset ]; },
+		set: function ( v ) { this.array[ this.offset ] = v; }
+	},
+	'y': {
+		get: function () { return this.array[ this.offset + 1 ]; },
+		set: function ( v ) { this.array[ this.offset + 1 ] = v; }
+	},
+	'z': {
+		get: function () { return this.array[ this.offset + 2 ]; },
+		set: function ( v ) { this.array[ this.offset + 2 ] = v; }
+	}
+} );
+/**
+ * @author mrdoob / http://mrdoob.com/
+ */
+
+THREE.ProxyFace3 = function ( array, offset, vertexNormals ) {
+
+	this.array = array;
+	this.offset = offset;
+	this.vertexNormals = vertexNormals;
+
+	//THREE.Face3.call( this, array[offset], array[offset+1], array[offset+2] /*, normal, color, materialIndex */);
+
+}
+
+THREE.ProxyFace3.prototype = Object.create( THREE.Face3.prototype );
+
+Object.defineProperties( THREE.ProxyFace3.prototype, {
+	'a': {
+		enumerable: true,  
+		get: function () { return this.array[ this.offset ]; },
+		set: function ( v ) { this.array[ this.offset ] = v; }
+	},
+	'b': {
+		enumerable: true,  
+		get: function () { return this.array[ this.offset + 1 ]; },
+		set: function ( v ) { this.array[ this.offset + 1 ] = v; }
+	},
+	'c': {
+		enumerable: true,  
+		get: function () { return this.array[ this.offset + 2 ]; },
+		set: function ( v ) { this.array[ this.offset + 2 ] = v; }
+	},
+} );
 /**
  * @author mrdoob / http://mrdoob.com/
  * @author mikael emtinger / http://gomo.se/

+ 12 - 7
build/three.min.js

@@ -23,11 +23,11 @@ THREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,_eu
 d;this._updateEuler();return this},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._w=a._w;this._updateEuler();return this},setFromEuler:function(a,b){if(!1===a instanceof THREE.Euler)throw Error("ERROR: Quaternion's .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.  Please update your code.");var c=Math.cos(a._x/2),d=Math.cos(a._y/2),e=Math.cos(a._z/2),f=Math.sin(a._x/2),g=Math.sin(a._y/2),h=Math.sin(a._z/2);"XYZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*
 g*e-f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"YXZ"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e-f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"ZXY"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h+f*g*e,this._w=c*d*e-f*g*h):"ZYX"===a.order?(this._x=f*d*e-c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e+f*g*h):"YZX"===a.order?(this._x=f*d*e+c*g*h,this._y=c*g*e+f*d*h,this._z=c*d*h-f*g*e,this._w=c*d*e-f*g*h):"XZY"===a.order&&(this._x=f*d*e-c*g*h,this._y=c*g*e-f*d*h,
 this._z=c*d*h+f*g*e,this._w=c*d*e+f*g*h);!1!==b&&this._updateEuler();return this},setFromAxisAngle:function(a,b){var c=b/2,d=Math.sin(c);this._x=a.x*d;this._y=a.y*d;this._z=a.z*d;this._w=Math.cos(c);this._updateEuler();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],k=b[6],b=b[10],l=c+f+b;0<l?(c=0.5/Math.sqrt(l+1),this._w=0.25/c,this._x=(k-g)*c,this._y=(d-h)*c,this._z=(e-a)*c):c>f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(k-g)/c,this._x=
-0.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=0.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=0.25*c);this._updateEuler();return this},setFromUnitVectors:function(){var a;return function(b,c){void 0===a&&(a=new THREE.Vector3);a.crossVectors(b,c);this.set(a.x,a.y,a.z,b.dot(c)+1).normalize();this._updateEuler();return this}}(),inverse:function(){this.conjugate().normalize();return this},
-conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this._updateEuler();return this},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);return this},multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Quaternion's .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
-this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,l=b._w;this._x=c*l+f*g+d*k-e*h;this._y=d*l+f*h+e*g-c*k;this._z=e*l+f*k+c*h-d*g;this._w=f*l-c*g-d*h-e*k;this._updateEuler();return this},multiplyVector3:function(a){console.warn("DEPRECATED: Quaternion's .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");return a.applyQuaternion(this)},slerp:function(a,b){var c=
-this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(0.001>Math.abs(k))return this._w=0.5*(f+this._w),this._x=0.5*(c+this._x),this._y=0.5*(d+this._y),this._z=0.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h=Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x=c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*
-h;this._updateEuler();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];this._w=a[3];this._updateEuler();return this},toArray:function(){return[this._x,this._y,this._z,this._w]},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
+0.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=0.25*c,this._z=(g+k)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+k)/c,this._z=0.25*c);this._updateEuler();return this},setFromUnitVectors:function(){var a,b;return function(c,d){void 0===a&&(a=new THREE.Vector3);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this.set(a.x,a.y,a.z,b).normalize();this._updateEuler();
+return this}}(),inverse:function(){this.conjugate().normalize();return this},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this._updateEuler();return this},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);return this},
+multiply:function(a,b){return void 0!==b?(console.warn("DEPRECATED: Quaternion's .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z,f=a._w,g=b._x,h=b._y,k=b._z,l=b._w;this._x=c*l+f*g+d*k-e*h;this._y=d*l+f*h+e*g-c*k;this._z=e*l+f*k+c*h-d*g;this._w=f*l-c*g-d*h-e*k;this._updateEuler();return this},multiplyVector3:function(a){console.warn("DEPRECATED: Quaternion's .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");
+return a.applyQuaternion(this)},slerp:function(a,b){var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;var h=Math.acos(g),k=Math.sqrt(1-g*g);if(0.001>Math.abs(k))return this._w=0.5*(f+this._w),this._x=0.5*(c+this._x),this._y=0.5*(d+this._y),this._z=0.5*(e+this._z),this;g=Math.sin((1-b)*h)/k;h=Math.sin(b*h)/k;this._w=f*g+this._w*h;this._x=
+c*g+this._x*h;this._y=d*g+this._y*h;this._z=e*g+this._z*h;this._updateEuler();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];this._w=a[3];this._updateEuler();return this},toArray:function(){return[this._x,this._y,this._z,this._w]},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}};THREE.Quaternion.slerp=function(a,b,c,d){return c.copy(a).slerp(b,d)};THREE.Vector2=function(a,b){this.x=a||0;this.y=b||0};
 THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(a,b){this.x=a;this.y=b;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,
 b){if(void 0!==b)return console.warn("DEPRECATED: Vector2's .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},sub:function(a,b){if(void 0!==b)return console.warn("DEPRECATED: Vector2's .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=
 a.y;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){0!==a?(a=1/a,this.x*=a,this.y*=a):this.y=this.x=0;return this},min:function(a){this.x>a.x&&(this.x=a.x);this.y>a.y&&(this.y=a.y);return this},max:function(a){this.x<a.x&&(this.x=a.x);this.y<a.y&&(this.y=a.y);return this},
@@ -59,7 +59,7 @@ a.y);this.z<a.z&&(this.z=a.z);this.w<a.w&&(this.w=a.w);return this},clamp:functi
 Math.floor(this.y);this.z=Math.floor(this.z);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):
 Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){return this.multiplyScalar(-1)},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},
 setLength:function(a){var b=this.length();0!==b&&a!==b&&this.multiplyScalar(a/b);return this},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;this.w+=(a.w-this.w)*b;return this},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a){this.x=a[0];this.y=a[1];this.z=a[2];this.w=a[3];return this},toArray:function(){return[this.x,this.y,this.z,this.w]},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,
-this.w)}};THREE.ProxyVector2=function(a,b){this.array=a;this.offset=b};THREE.ProxyVector2.prototype=Object.create(THREE.Vector2.prototype);Object.defineProperties(THREE.ProxyVector2.prototype,{x:{get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},y:{get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}}});THREE.ProxyVector3=function(a,b){this.array=a;this.offset=b};THREE.ProxyVector3.prototype=Object.create(THREE.Vector3.prototype);Object.defineProperties(THREE.ProxyVector3.prototype,{x:{get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},y:{get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}},z:{get:function(){return this.array[this.offset+2]},set:function(a){this.array[this.offset+2]=a}}});THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ";
+this.w)}};THREE.Euler=function(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._order=d||THREE.Euler.DefaultOrder};THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");THREE.Euler.DefaultOrder="XYZ";
 THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,_quaternion:void 0,_updateQuaternion:function(){void 0!==this._quaternion&&this._quaternion.setFromEuler(this,!1)},get x(){return this._x},set x(a){this._x=a;this._updateQuaternion()},get y(){return this._y},set y(a){this._y=a;this._updateQuaternion()},get z(){return this._z},set z(a){this._z=a;this._updateQuaternion()},get order(){return this._order},set order(a){this._order=a;this._updateQuaternion()},
 set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this._updateQuaternion();return this},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this._updateQuaternion();return this},setFromRotationMatrix:function(a,b){var c=THREE.Math.clamp,d=a.elements,e=d[0],f=d[4],g=d[8],h=d[1],k=d[5],l=d[9],n=d[2],r=d[6],d=d[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(c(g,-1,1)),0.99999>Math.abs(g)?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-f,e)):(this._x=
 Math.atan2(r,k),this._z=0)):"YXZ"===b?(this._x=Math.asin(-c(l,-1,1)),0.99999>Math.abs(l)?(this._y=Math.atan2(g,d),this._z=Math.atan2(h,k)):(this._y=Math.atan2(-n,e),this._z=0)):"ZXY"===b?(this._x=Math.asin(c(r,-1,1)),0.99999>Math.abs(r)?(this._y=Math.atan2(-n,d),this._z=Math.atan2(-f,k)):(this._y=0,this._z=Math.atan2(h,e))):"ZYX"===b?(this._y=Math.asin(-c(n,-1,1)),0.99999>Math.abs(n)?(this._x=Math.atan2(r,d),this._z=Math.atan2(h,e)):(this._x=0,this._z=Math.atan2(-f,k))):"YZX"===b?(this._z=Math.asin(c(h,
@@ -214,7 +214,12 @@ this.boundingBox&&(this.boundingBox=new THREE.Box3);this.boundingBox.setFromPoin
 c[f]=c[a[d]];a=[];f=0;for(g=this.faces.length;f<g;f++)for(e=this.faces[f],e.a=c[e.a],e.b=c[e.b],e.c=c[e.c],e=[e.a,e.b,e.c],d=0;3>d;d++)if(e[d]==e[(d+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(e=a[f],this.faces.splice(e,1),c=0,g=this.faceVertexUvs.length;c<g;c++)this.faceVertexUvs[c].splice(e,1);f=this.vertices.length-b.length;this.vertices=b;return f},makeGroups:function(){var a=0;return function(b,c){var d,e,f,g,h={},k=this.morphTargets.length,l=this.morphNormals.length;this.geometryGroups=
 {};d=0;for(e=this.faces.length;d<e;d++)f=this.faces[d],f=b?f.materialIndex:0,f in h||(h[f]={hash:f,counter:0}),g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(this.geometryGroups[g]={faces3:[],materialIndex:f,vertices:0,numMorphTargets:k,numMorphNormals:l}),this.geometryGroups[g].vertices+3>c&&(h[f].counter+=1,g=h[f].hash+"_"+h[f].counter,g in this.geometryGroups||(this.geometryGroups[g]={faces3:[],materialIndex:f,vertices:0,numMorphTargets:k,numMorphNormals:l})),this.geometryGroups[g].faces3.push(d),
 this.geometryGroups[g].vertices+=3;this.geometryGroupsList=[];for(var n in this.geometryGroups)this.geometryGroups[n].id=a++,this.geometryGroupsList.push(this.geometryGroups[n])}}(),clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],f=[],g=0,h=e.length;g<h;g++)f.push(new THREE.Vector2(e[g].x,e[g].y));a.faceVertexUvs[0].push(f)}return a},
-dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Geometry2=function(a,b,c){THREE.BufferGeometry.call(this);this.attributes.position={array:a,itemSize:3};this.attributes.normal={array:b,itemSize:3};this.attributes.uv={array:c,itemSize:2}};THREE.Geometry2.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.IndexedGeometry2=function(a,b,c,d){THREE.BufferGeometry.call(this);this.attributes.index={array:a,itemSize:1};this.attributes.position={array:b,itemSize:3};this.attributes.normal={array:c,itemSize:3};this.attributes.uv={array:d,itemSize:2}};THREE.IndexedGeometry2.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
+dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);THREE.GeometryIdCount=0;THREE.Geometry2=function(a,b,c){THREE.BufferGeometry.call(this);this.attributes.position={array:a,itemSize:3};this.attributes.normal={array:b,itemSize:3};this.attributes.uv={array:c,itemSize:2}};THREE.Geometry2.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.Geometry99=function(){THREE.BufferGeometry.call(this)};THREE.Geometry99.prototype=Object.create(THREE.BufferGeometry.prototype);Object.defineProperties(THREE.Geometry99.prototype,{vertices:{enumerable:!0,get:function(){return this.createVertexProxies()}},faces:{enumerable:!0,get:function(){return this.createFaceProxies()}},faceVertexUvs:{enumerable:!0,get:function(){return this.createUvProxies()}}});
+THREE.Geometry99.prototype.createVertexProxies=function(){Object.defineProperty(this,"vertices",{value:[]});this.populateProxyFromBuffer(this.vertices,"position",THREE.ProxyVector3,3);return this.vertices};
+THREE.Geometry99.prototype.createFaceProxies=function(){Object.defineProperty(this,"faces",{value:[]});if(this.attributes.index){var a=this.attributes.index.array,b=this.faces,c=!1;this.attributes.normal&&(c=this.attributes.normal.array);for(var d=0,e=a.length/3;d<e;d++){var f=3*d,g;c&&(g=[new THREE.ProxyVector3(c,3*a[f]),new THREE.ProxyVector3(c,3*a[f+1]),new THREE.ProxyVector3(c,3*a[f+2])]);f=new THREE.ProxyFace3(a,3*d,g);b.push(f)}}return this.faces};
+THREE.Geometry99.prototype.createUvProxies=function(){Object.defineProperty(this,"faceVertexUvs",{value:[[]]});if(this.attributes.uv)for(var a=this.faces,b=this.attributes.uv.array,c=0,d=a.length;c<d;c++){var e=a[c];this.faceVertexUvs[0][c]=[];this.faceVertexUvs[0][c][0]=new THREE.ProxyVector2(b,2*e.a);this.faceVertexUvs[0][c][1]=new THREE.ProxyVector2(b,2*e.b);this.faceVertexUvs[0][c][2]=new THREE.ProxyVector2(b,2*e.c)}return this.faceVertexUvs};
+THREE.Geometry99.prototype.populateProxyFromBuffer=function(a,b,c,d,e,f){if(this.attributes[b]){var g=this.attributes[b].array;b=d||this.attributes[b].itemSize;d=e||0;f=f||g.length/b-d;e=d;for(f=d+f;e<f;e++)a.push(new c(g,e*b))}};THREE.IndexedGeometry2=function(a,b,c,d){THREE.BufferGeometry.call(this);this.attributes.index={array:a,itemSize:1};this.attributes.position={array:b,itemSize:3};this.attributes.normal={array:c,itemSize:3};this.attributes.uv={array:d,itemSize:2}};THREE.IndexedGeometry2.prototype=Object.create(THREE.Geometry99.prototype);THREE.ProxyVector2=function(a,b){this.array=a;this.offset=b};THREE.ProxyVector2.prototype=Object.create(THREE.Vector2.prototype);Object.defineProperties(THREE.ProxyVector2.prototype,{x:{get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},y:{get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}}});THREE.ProxyVector3=function(a,b){this.array=a;this.offset=b};THREE.ProxyVector3.prototype=Object.create(THREE.Vector3.prototype);Object.defineProperties(THREE.ProxyVector3.prototype,{x:{get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},y:{get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}},z:{get:function(){return this.array[this.offset+2]},set:function(a){this.array[this.offset+2]=a}}});THREE.ProxyFace3=function(a,b,c){this.array=a;this.offset=b;this.vertexNormals=c};THREE.ProxyFace3.prototype=Object.create(THREE.Face3.prototype);
+Object.defineProperties(THREE.ProxyFace3.prototype,{a:{enumerable:!0,get:function(){return this.array[this.offset]},set:function(a){this.array[this.offset]=a}},b:{enumerable:!0,get:function(){return this.array[this.offset+1]},set:function(a){this.array[this.offset+1]=a}},c:{enumerable:!0,get:function(){return this.array[this.offset+2]},set:function(a){this.array[this.offset+2]=a}}});THREE.Camera=function(){THREE.Object3D.call(this);this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.lookAt=function(){var a=new THREE.Matrix4;return function(b){a.lookAt(this.position,b,this.up);this.quaternion.setFromRotationMatrix(a)}}();
 THREE.Camera.prototype.clone=function(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};THREE.OrthographicCamera=function(a,b,c,d,e,f){THREE.Camera.call(this);this.left=a;this.right=b;this.top=c;this.bottom=d;this.near=void 0!==e?e:0.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()};THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype);THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){this.projectionMatrix.makeOrthographic(this.left,this.right,this.top,this.bottom,this.near,this.far)};
 THREE.OrthographicCamera.prototype.clone=function(){var a=new THREE.OrthographicCamera;THREE.Camera.prototype.clone.call(this,a);a.left=this.left;a.right=this.right;a.top=this.top;a.bottom=this.bottom;a.near=this.near;a.far=this.far;return a};THREE.PerspectiveCamera=function(a,b,c,d){THREE.Camera.call(this);this.fov=void 0!==a?a:50;this.aspect=void 0!==b?b:1;this.near=void 0!==c?c:0.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()};THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype);THREE.PerspectiveCamera.prototype.setLens=function(a,b){void 0===b&&(b=24);this.fov=2*THREE.Math.radToDeg(Math.atan(b/(2*a)));this.updateProjectionMatrix()};
 THREE.PerspectiveCamera.prototype.setViewOffset=function(a,b,c,d,e,f){this.fullWidth=a;this.fullHeight=b;this.x=c;this.y=d;this.width=e;this.height=f;this.updateProjectionMatrix()};