提交 a9f33e77 编写于 作者: M Mr.doob

Updated builds.

上级 c170af7b
...@@ -8938,6 +8938,22 @@ THREE.DynamicBufferAttribute = function ( array, itemSize ) { ...@@ -8938,6 +8938,22 @@ THREE.DynamicBufferAttribute = function ( array, itemSize ) {
THREE.DynamicBufferAttribute.prototype = Object.create( THREE.BufferAttribute.prototype ); THREE.DynamicBufferAttribute.prototype = Object.create( THREE.BufferAttribute.prototype );
THREE.DynamicBufferAttribute.prototype.constructor = THREE.DynamicBufferAttribute; THREE.DynamicBufferAttribute.prototype.constructor = THREE.DynamicBufferAttribute;
// File:src/core/IndexBufferAttribute.js
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.IndexBufferAttribute = function ( array, itemSize ) {
THREE.BufferAttribute.call( this, array, itemSize );
};
THREE.IndexBufferAttribute.prototype = Object.create( THREE.BufferAttribute.prototype );
THREE.IndexBufferAttribute.prototype.constructor = THREE.IndexBufferAttribute;
// File:src/core/InstancedBufferAttribute.js // File:src/core/InstancedBufferAttribute.js
/** /**
...@@ -10757,6 +10773,13 @@ THREE.BufferGeometry.prototype = { ...@@ -10757,6 +10773,13 @@ THREE.BufferGeometry.prototype = {
} }
if ( name === 'index' && attribute instanceof THREE.IndexBufferAttribute === false ) {
console.warn( 'THREE.BufferGeometry.addAttribute: Use THREE.IndexBufferAttribute for index attribute.' );
attribute = new THREE.IndexBufferAttribute( attribute.array, attribute.itemSize );
}
this.attributes[ name ] = attribute; this.attributes[ name ] = attribute;
}, },
...@@ -11176,8 +11199,9 @@ THREE.BufferGeometry.prototype = { ...@@ -11176,8 +11199,9 @@ THREE.BufferGeometry.prototype = {
if ( geometry.indices.length > 0 ) { if ( geometry.indices.length > 0 ) {
var indices = new Uint16Array( geometry.indices.length * 3 ); var TypeArray = geometry.vertices.length > 65535 ? Uint32Array : Uint16Array;
this.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ).copyIndicesArray( geometry.indices ) ); var indices = new TypeArray( geometry.indices.length * 3 );
this.addAttribute( 'index', new THREE.IndexBufferAttribute( indices, 1 ).copyIndicesArray( geometry.indices ) );
} }
...@@ -11717,57 +11741,6 @@ THREE.BufferGeometry.prototype = { ...@@ -11717,57 +11741,6 @@ THREE.BufferGeometry.prototype = {
}, },
/*
reoderBuffers:
Reorder attributes based on a new indexBuffer and indexMap.
indexBuffer - Uint16Array of the new ordered indices.
indexMap - Int32Array where the position is the new vertex ID and the value the old vertex ID for each vertex.
vertexCount - Amount of total vertices considered in this reordering (in case you want to grow the vertex stack).
*/
reorderBuffers: function ( indexBuffer, indexMap, vertexCount ) {
/* Create a copy of all attributes for reordering. */
var sortedAttributes = {};
for ( var attr in this.attributes ) {
if ( attr === 'index' )
continue;
var sourceArray = this.attributes[ attr ].array;
sortedAttributes[ attr ] = new sourceArray.constructor( this.attributes[ attr ].itemSize * vertexCount );
}
/* Move attribute positions based on the new index map */
for ( var new_vid = 0; new_vid < vertexCount; new_vid ++ ) {
var vid = indexMap[ new_vid ];
for ( var attr in this.attributes ) {
if ( attr === 'index' )
continue;
var attrArray = this.attributes[ attr ].array;
var attrSize = this.attributes[ attr ].itemSize;
var sortedAttr = sortedAttributes[ attr ];
for ( var k = 0; k < attrSize; k ++ )
sortedAttr[ new_vid * attrSize + k ] = attrArray[ vid * attrSize + k ];
}
}
/* Carry the new sorted buffers locally */
this.attributes[ 'index' ].array = indexBuffer;
for ( var attr in this.attributes ) {
if ( attr === 'index' )
continue;
this.attributes[ attr ].array = sortedAttributes[ attr ];
this.attributes[ attr ].numItems = this.attributes[ attr ].itemSize * vertexCount;
}
},
toJSON: function () { toJSON: function () {
var data = { var data = {
...@@ -18078,7 +18051,7 @@ THREE.Sprite = ( function () { ...@@ -18078,7 +18051,7 @@ THREE.Sprite = ( function () {
var uvs = new Float32Array( [ 0, 0, 1, 0, 1, 1, 0, 1 ] ); var uvs = new Float32Array( [ 0, 0, 1, 0, 1, 1, 0, 1 ] );
var geometry = new THREE.BufferGeometry(); var geometry = new THREE.BufferGeometry();
geometry.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) ); geometry.addAttribute( 'index', new THREE.IndexBufferAttribute( indices, 1 ) );
geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) ); geometry.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) ); geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
...@@ -23863,7 +23836,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) { ...@@ -23863,7 +23836,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
for ( var name in attributes ) { for ( var name in attributes ) {
updateAttribute( attributes[ name ], name ); updateAttribute( attributes[ name ] );
} }
...@@ -23877,7 +23850,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) { ...@@ -23877,7 +23850,7 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
for ( var i = 0, l = array.length; i < l; i ++ ) { for ( var i = 0, l = array.length; i < l; i ++ ) {
updateAttribute( array[ i ], i ); updateAttribute( array[ i ] );
} }
...@@ -23887,9 +23860,19 @@ THREE.WebGLObjects = function ( gl, properties, info ) { ...@@ -23887,9 +23860,19 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
} }
function updateAttribute( attribute, name ) { function updateAttribute( attribute ) {
var bufferType;
if ( attribute instanceof THREE.IndexBufferAttribute ) {
bufferType = gl.ELEMENT_ARRAY_BUFFER;
} else {
bufferType = gl.ARRAY_BUFFER;
var bufferType = name === 'index' ? gl.ELEMENT_ARRAY_BUFFER : gl.ARRAY_BUFFER; }
var data = ( attribute instanceof THREE.InterleavedBufferAttribute ) ? attribute.data : attribute; var data = ( attribute instanceof THREE.InterleavedBufferAttribute ) ? attribute.data : attribute;
...@@ -23969,9 +23952,11 @@ THREE.WebGLObjects = function ( gl, properties, info ) { ...@@ -23969,9 +23952,11 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
function getWireframeAttribute( geometry ) { function getWireframeAttribute( geometry ) {
if ( geometry._wireframe !== undefined ) { var property = properties.get( geometry );
return geometry._wireframe; if ( property.wireframe !== undefined ) {
return property.wireframe;
} }
...@@ -24020,11 +24005,11 @@ THREE.WebGLObjects = function ( gl, properties, info ) { ...@@ -24020,11 +24005,11 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
console.timeEnd( 'wireframe' ); console.timeEnd( 'wireframe' );
var TypeArray = position.count > 65535 ? Uint32Array : Uint16Array; var TypeArray = position.count > 65535 ? Uint32Array : Uint16Array;
var attribute = new THREE.BufferAttribute( new TypeArray( indices ), 1 ); var attribute = new THREE.IndexBufferAttribute( new TypeArray( indices ), 1 );
updateAttribute( attribute, 'index' ); updateAttribute( attribute );
geometry._wireframe = attribute; property.wireframe = attribute;
return attribute; return attribute;
...@@ -24046,7 +24031,6 @@ THREE.WebGLObjects = function ( gl, properties, info ) { ...@@ -24046,7 +24031,6 @@ THREE.WebGLObjects = function ( gl, properties, info ) {
this.getWireframeAttribute = getWireframeAttribute; this.getWireframeAttribute = getWireframeAttribute;
this.update = update; this.update = update;
this.updateAttribute = updateAttribute;
this.clear = function () { this.clear = function () {
...@@ -31333,7 +31317,7 @@ THREE.CircleBufferGeometry = function ( radius, segments, thetaStart, thetaLengt ...@@ -31333,7 +31317,7 @@ THREE.CircleBufferGeometry = function ( radius, segments, thetaStart, thetaLengt
} }
this.addAttribute( 'index', new THREE.BufferAttribute( new Uint16Array( indices ), 1 ) ); this.addAttribute( 'index', new THREE.IndexBufferAttribute( new Uint16Array( indices ), 1 ) );
this.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) ); this.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) ); this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) ); this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
...@@ -31494,7 +31478,7 @@ THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, radialSegme ...@@ -31494,7 +31478,7 @@ THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, radialSegme
var uv2 = uvs[ 0 ][ x + 1 ].clone(); var uv2 = uvs[ 0 ][ x + 1 ].clone();
var uv3 = new THREE.Vector2( uv2.x, 0 ); var uv3 = new THREE.Vector2( uv2.x, 0 );
this.faces.push( new THREE.Face3( v1, v2, v3, [ n1, n2, n3 ] ) ); this.faces.push( new THREE.Face3( v1, v2, v3, [ n1, n2, n3 ], undefined, 1 ) );
this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv3 ] ); this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv3 ] );
} }
...@@ -31521,7 +31505,7 @@ THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, radialSegme ...@@ -31521,7 +31505,7 @@ THREE.CylinderGeometry = function ( radiusTop, radiusBottom, height, radialSegme
var uv2 = uvs[ heightSegments ][ x ].clone(); var uv2 = uvs[ heightSegments ][ x ].clone();
var uv3 = new THREE.Vector2( uv2.x, 1 ); var uv3 = new THREE.Vector2( uv2.x, 1 );
this.faces.push( new THREE.Face3( v1, v2, v3, [ n1, n2, n3 ] ) ); this.faces.push( new THREE.Face3( v1, v2, v3, [ n1, n2, n3 ], undefined, 2 ) );
this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv3 ] ); this.faceVertexUvs[ 0 ].push( [ uv1, uv2, uv3 ] );
} }
...@@ -32730,7 +32714,7 @@ THREE.PlaneBufferGeometry = function ( width, height, widthSegments, heightSegme ...@@ -32730,7 +32714,7 @@ THREE.PlaneBufferGeometry = function ( width, height, widthSegments, heightSegme
} }
this.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) ); this.addAttribute( 'index', new THREE.IndexBufferAttribute( indices, 1 ) );
this.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) ); this.addAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) ); this.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) ); this.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
...@@ -33091,7 +33075,7 @@ THREE.SphereBufferGeometry = function ( radius, widthSegments, heightSegments, p ...@@ -33091,7 +33075,7 @@ THREE.SphereBufferGeometry = function ( radius, widthSegments, heightSegments, p
} }
this.addAttribute( 'index', new THREE.BufferAttribute( new Uint16Array( indices ), 1 ) ); this.addAttribute( 'index', new THREE.IndexBufferAttribute( new Uint16Array( indices ), 1 ) );
this.addAttribute( 'position', positions ); this.addAttribute( 'position', positions );
this.addAttribute( 'normal', normals ); this.addAttribute( 'normal', normals );
this.addAttribute( 'uv', uvs ); this.addAttribute( 'uv', uvs );
...@@ -33765,7 +33749,7 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) { ...@@ -33765,7 +33749,7 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) {
var v2 = p[ indices[ i + 1 ] ]; var v2 = p[ indices[ i + 1 ] ];
var v3 = p[ indices[ i + 2 ] ]; var v3 = p[ indices[ i + 2 ] ];
faces[ j ] = new THREE.Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ] ); faces[ j ] = new THREE.Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ], undefined, j );
} }
...@@ -33842,9 +33826,9 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) { ...@@ -33842,9 +33826,9 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) {
// Approximate a curved face with recursively sub-divided triangles. // Approximate a curved face with recursively sub-divided triangles.
function make( v1, v2, v3 ) { function make( v1, v2, v3, materialIndex ) {
var face = new THREE.Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ] ); var face = new THREE.Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ], undefined, materialIndex );
that.faces.push( face ); that.faces.push( face );
centroid.copy( v1 ).add( v2 ).add( v3 ).divideScalar( 3 ); centroid.copy( v1 ).add( v2 ).add( v3 ).divideScalar( 3 );
...@@ -33870,6 +33854,8 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) { ...@@ -33870,6 +33854,8 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) {
var c = prepare( that.vertices[ face.c ] ); var c = prepare( that.vertices[ face.c ] );
var v = []; var v = [];
var materialIndex = face.materialIndex;
// Construct all of the vertices for this subdivision. // Construct all of the vertices for this subdivision.
for ( var i = 0 ; i <= cols; i ++ ) { for ( var i = 0 ; i <= cols; i ++ ) {
...@@ -33909,7 +33895,8 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) { ...@@ -33909,7 +33895,8 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) {
make( make(
v[ i ][ k + 1 ], v[ i ][ k + 1 ],
v[ i + 1 ][ k ], v[ i + 1 ][ k ],
v[ i ][ k ] v[ i ][ k ],
materialIndex
); );
} else { } else {
...@@ -33917,7 +33904,8 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) { ...@@ -33917,7 +33904,8 @@ THREE.PolyhedronGeometry = function ( vertices, indices, radius, detail ) {
make( make(
v[ i ][ k + 1 ], v[ i ][ k + 1 ],
v[ i + 1 ][ k + 1 ], v[ i + 1 ][ k + 1 ],
v[ i + 1 ][ k ] v[ i + 1 ][ k ],
materialIndex
); );
} }
......
...@@ -106,8 +106,8 @@ e=Math.sin(e);if("XYZ"===a.order){a=g*h;var k=g*e,l=c*h,n=c*e;b[0]=f*h;b[4]=-f*e ...@@ -106,8 +106,8 @@ e=Math.sin(e);if("XYZ"===a.order){a=g*h;var k=g*e,l=c*h,n=c*e;b[0]=f*h;b[4]=-f*e
n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."); n*d+a,b[9]=k*d-l,b[2]=-d,b[6]=c*f,b[10]=g*f):"YZX"===a.order?(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=n-a*e,b[8]=l*e+k,b[1]=e,b[5]=g*h,b[9]=-c*h,b[2]=-d*h,b[6]=k*e+l,b[10]=a-n*e):"XZY"===a.order&&(a=g*f,k=g*d,l=c*f,n=c*d,b[0]=f*h,b[4]=-e,b[8]=d*h,b[1]=a*e+n,b[5]=g*h,b[9]=k*e-l,b[2]=l*e-k,b[6]=c*h,b[10]=n*e+a);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");
return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var l=c*h,c=c*k,n=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(n+e);b[4]=l-g;b[8]=c+h;b[1]=l+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3); return this.makeRotationFromQuaternion(a)},makeRotationFromQuaternion:function(a){var b=this.elements,c=a.x,d=a.y,e=a.z,g=a.w,f=c+c,h=d+d,k=e+e;a=c*f;var l=c*h,c=c*k,n=d*h,d=d*k,e=e*k,f=g*f,h=g*h,g=g*k;b[0]=1-(n+e);b[4]=l-g;b[8]=c+h;b[1]=l+g;b[5]=1-(a+e);b[9]=d-f;b[2]=c-h;b[6]=d+f;b[10]=1-(a+n);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a,b,c;return function(d,e,g){void 0===a&&(a=new THREE.Vector3);void 0===b&&(b=new THREE.Vector3);void 0===c&&(c=new THREE.Vector3);
var f=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a, var f=this.elements;c.subVectors(d,e).normalize();0===c.length()&&(c.z=1);a.crossVectors(g,c).normalize();0===a.length()&&(c.x+=1E-4,a.crossVectors(g,c).normalize());b.crossVectors(c,a);f[0]=a.x;f[4]=b.x;f[8]=c.x;f[1]=a.y;f[5]=b.y;f[9]=c.y;f[2]=a.z;f[6]=b.z;f[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},multiplyMatrices:function(a,
b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],l=c[1],n=c[5],p=c[9],m=c[13],q=c[2],t=c[6],r=c[10],u=c[14],w=c[3],v=c[7],y=c[11],c=c[15],x=d[0],E=d[4],B=d[8],z=d[12],A=d[1],M=d[5],J=d[9],D=d[13],P=d[2],K=d[6],C=d[10],G=d[14],H=d[3],O=d[7],Q=d[11],d=d[15];e[0]=g*x+f*A+h*P+k*H;e[4]=g*E+f*M+h*K+k*O;e[8]=g*B+f*J+h*C+k*Q;e[12]=g*z+f*D+h*G+k*d;e[1]=l*x+n*A+p*P+m*H;e[5]=l*E+n*M+p*K+m*O;e[9]=l*B+n*J+p*C+m*Q;e[13]=l*z+n*D+p*G+m*d;e[2]=q*x+t*A+r*P+u*H;e[6]=q*E+t*M+r*K+u*O;e[10]= b){var c=a.elements,d=b.elements,e=this.elements,g=c[0],f=c[4],h=c[8],k=c[12],l=c[1],n=c[5],p=c[9],m=c[13],q=c[2],t=c[6],r=c[10],u=c[14],w=c[3],v=c[7],y=c[11],c=c[15],x=d[0],E=d[4],B=d[8],z=d[12],A=d[1],L=d[5],J=d[9],D=d[13],P=d[2],K=d[6],C=d[10],G=d[14],H=d[3],O=d[7],Q=d[11],d=d[15];e[0]=g*x+f*A+h*P+k*H;e[4]=g*E+f*L+h*K+k*O;e[8]=g*B+f*J+h*C+k*Q;e[12]=g*z+f*D+h*G+k*d;e[1]=l*x+n*A+p*P+m*H;e[5]=l*E+n*L+p*K+m*O;e[9]=l*B+n*J+p*C+m*Q;e[13]=l*z+n*D+p*G+m*d;e[2]=q*x+t*A+r*P+u*H;e[6]=q*E+t*L+r*K+u*O;e[10]=
q*B+t*J+r*C+u*Q;e[14]=q*z+t*D+r*G+u*d;e[3]=w*x+v*A+y*P+c*H;e[7]=w*E+v*M+y*K+c*O;e[11]=w*B+v*J+y*C+c*Q;e[15]=w*z+v*D+y*G+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*= q*B+t*J+r*C+u*Q;e[14]=q*z+t*D+r*G+u*d;e[3]=w*x+v*A+y*P+c*H;e[7]=w*E+v*L+y*K+c*O;e[11]=w*B+v*J+y*C+c*Q;e[15]=w*z+v*D+y*G+c*d;return this},multiplyToArray:function(a,b,c){var d=this.elements;this.multiplyMatrices(a,b);c[0]=d[0];c[1]=d[1];c[2]=d[2];c[3]=d[3];c[4]=d[4];c[5]=d[5];c[6]=d[6];c[7]=d[7];c[8]=d[8];c[9]=d[9];c[10]=d[10];c[11]=d[11];c[12]=d[12];c[13]=d[13];c[14]=d[14];c[15]=d[15];return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[4]*=a;b[8]*=a;b[12]*=a;b[1]*=a;b[5]*=a;b[9]*=
a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."); a;b[13]*=a;b[2]*=a;b[6]*=a;b[10]*=a;b[14]*=a;b[3]*=a;b[7]*=a;b[11]*=a;b[15]*=a;return this},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.");return a.applyProjection(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(a){console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.");
return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x, return this.applyToVector3Array(a)},applyToVector3Array:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length);for(var e=0;e<d;e+=3,c+=3)a.fromArray(b,c),a.applyMatrix4(this),a.toArray(b,c);return b}}(),applyToBuffer:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Vector3);void 0===c&&(c=0);void 0===d&&(d=b.length/b.itemSize);for(var e=0;e<d;e++,c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(a.x,
a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],l=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*k* a.y,a.z);return b}}(),rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],f=a[5],h=a[9],k=a[13],l=a[2],n=a[6],p=a[10],m=a[14];return a[3]*(+e*h*n-d*k*
...@@ -189,8 +189,9 @@ b[c++]=g.x;b[c++]=g.y;b[c++]=g.z;b[c++]=g.w}return this},set:function(a,b){void ...@@ -189,8 +189,9 @@ b[c++]=g.x;b[c++]=g.y;b[c++]=g.z;b[c++]=g.w}return this},set:function(a,b){void
this.itemSize+3]},setW:function(a,b){this.array[a*this.itemSize+3]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this},clone:function(){return new this.constructor(new this.array.constructor(this.array),this.itemSize)}}; this.itemSize+3]},setW:function(a,b){this.array[a*this.itemSize+3]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this},clone:function(){return new this.constructor(new this.array.constructor(this.array),this.itemSize)}};
THREE.Int8Attribute=function(a,b){return new THREE.BufferAttribute(new Int8Array(a),b)};THREE.Uint8Attribute=function(a,b){return new THREE.BufferAttribute(new Uint8Array(a),b)};THREE.Uint8ClampedAttribute=function(a,b){return new THREE.BufferAttribute(new Uint8ClampedArray(a),b)};THREE.Int16Attribute=function(a,b){return new THREE.BufferAttribute(new Int16Array(a),b)};THREE.Uint16Attribute=function(a,b){return new THREE.BufferAttribute(new Uint16Array(a),b)}; THREE.Int8Attribute=function(a,b){return new THREE.BufferAttribute(new Int8Array(a),b)};THREE.Uint8Attribute=function(a,b){return new THREE.BufferAttribute(new Uint8Array(a),b)};THREE.Uint8ClampedAttribute=function(a,b){return new THREE.BufferAttribute(new Uint8ClampedArray(a),b)};THREE.Int16Attribute=function(a,b){return new THREE.BufferAttribute(new Int16Array(a),b)};THREE.Uint16Attribute=function(a,b){return new THREE.BufferAttribute(new Uint16Array(a),b)};
THREE.Int32Attribute=function(a,b){return new THREE.BufferAttribute(new Int32Array(a),b)};THREE.Uint32Attribute=function(a,b){return new THREE.BufferAttribute(new Uint32Array(a),b)};THREE.Float32Attribute=function(a,b){return new THREE.BufferAttribute(new Float32Array(a),b)};THREE.Float64Attribute=function(a,b){return new THREE.BufferAttribute(new Float64Array(a),b)};THREE.DynamicBufferAttribute=function(a,b){THREE.BufferAttribute.call(this,a,b);this.updateRange={offset:0,count:-1}}; THREE.Int32Attribute=function(a,b){return new THREE.BufferAttribute(new Int32Array(a),b)};THREE.Uint32Attribute=function(a,b){return new THREE.BufferAttribute(new Uint32Array(a),b)};THREE.Float32Attribute=function(a,b){return new THREE.BufferAttribute(new Float32Array(a),b)};THREE.Float64Attribute=function(a,b){return new THREE.BufferAttribute(new Float64Array(a),b)};THREE.DynamicBufferAttribute=function(a,b){THREE.BufferAttribute.call(this,a,b);this.updateRange={offset:0,count:-1}};
THREE.DynamicBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.DynamicBufferAttribute.prototype.constructor=THREE.DynamicBufferAttribute;THREE.InstancedBufferAttribute=function(a,b,c,d){THREE.DynamicBufferAttribute.call(this,a,b);this.dynamic=d||!1;this.meshPerAttribute=c||1};THREE.InstancedBufferAttribute.prototype=Object.create(THREE.DynamicBufferAttribute.prototype);THREE.InstancedBufferAttribute.prototype.constructor=THREE.InstancedBufferAttribute; THREE.DynamicBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.DynamicBufferAttribute.prototype.constructor=THREE.DynamicBufferAttribute;THREE.IndexBufferAttribute=function(a,b){THREE.BufferAttribute.call(this,a,b)};THREE.IndexBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype);THREE.IndexBufferAttribute.prototype.constructor=THREE.IndexBufferAttribute;
THREE.InstancedBufferAttribute.prototype.clone=function(){return new THREE.InstancedBufferAttribute(new this.array.constructor(this.array),this.itemSize,this.meshPerAttribute,this.dynamic)};THREE.InterleavedBuffer=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.array=a;this.stride=b;this.version=0;this.dynamic=c||!1;this.updateRange={offset:0,count:-1}}; THREE.InstancedBufferAttribute=function(a,b,c,d){THREE.DynamicBufferAttribute.call(this,a,b);this.dynamic=d||!1;this.meshPerAttribute=c||1};THREE.InstancedBufferAttribute.prototype=Object.create(THREE.DynamicBufferAttribute.prototype);THREE.InstancedBufferAttribute.prototype.constructor=THREE.InstancedBufferAttribute;THREE.InstancedBufferAttribute.prototype.clone=function(){return new THREE.InstancedBufferAttribute(new this.array.constructor(this.array),this.itemSize,this.meshPerAttribute,this.dynamic)};
THREE.InterleavedBuffer=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.array=a;this.stride=b;this.version=0;this.dynamic=c||!1;this.updateRange={offset:0,count:-1}};
THREE.InterleavedBuffer.prototype={constructor:THREE.InterleavedBuffer,get length(){return this.array.length},get count(){return this.array.length/this.stride},set needsUpdate(a){!0===a&&this.version++},copyAt:function(a,b,c){a*=this.stride;c*=b.stride;for(var d=0,e=this.stride;d<e;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},clone:function(){return new this.constructor(new this.array.constructor(this.array),this.stride,this.dynamic)}}; THREE.InterleavedBuffer.prototype={constructor:THREE.InterleavedBuffer,get length(){return this.array.length},get count(){return this.array.length/this.stride},set needsUpdate(a){!0===a&&this.version++},copyAt:function(a,b,c){a*=this.stride;c*=b.stride;for(var d=0,e=this.stride;d<e;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},clone:function(){return new this.constructor(new this.array.constructor(this.array),this.stride,this.dynamic)}};
THREE.InstancedInterleavedBuffer=function(a,b,c,d){THREE.InterleavedBuffer.call(this,a,b,c);this.meshPerAttribute=d||1};THREE.InstancedInterleavedBuffer.prototype=Object.create(THREE.InterleavedBuffer.prototype);THREE.InstancedInterleavedBuffer.prototype.constructor=THREE.InstancedInterleavedBuffer;THREE.InstancedInterleavedBuffer.prototype.clone=function(){return new this.constructor(new this.array.constructor(this.array),this.stride,this.dynamic,this.meshPerAttribute)}; THREE.InstancedInterleavedBuffer=function(a,b,c,d){THREE.InterleavedBuffer.call(this,a,b,c);this.meshPerAttribute=d||1};THREE.InstancedInterleavedBuffer.prototype=Object.create(THREE.InterleavedBuffer.prototype);THREE.InstancedInterleavedBuffer.prototype.constructor=THREE.InstancedInterleavedBuffer;THREE.InstancedInterleavedBuffer.prototype.clone=function(){return new this.constructor(new this.array.constructor(this.array),this.stride,this.dynamic,this.meshPerAttribute)};
THREE.InterleavedBufferAttribute=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.data=a;this.itemSize=b;this.offset=c}; THREE.InterleavedBufferAttribute=function(a,b,c){this.uuid=THREE.Math.generateUUID();this.data=a;this.itemSize=b;this.offset=c};
...@@ -229,31 +230,30 @@ v.vertexNormals;3===y.length?this.normals.push(y[0],y[1],y[2]):(y=v.normal,this. ...@@ -229,31 +230,30 @@ v.vertexNormals;3===y.length?this.normals.push(y[0],y[1],y[2]):(y=v.normal,this.
n),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(y=v.vertexTangents,3===y.length?this.tangents.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",n),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(y=0;y<k;y++){var x=h[y].vertices;l[y].push(x[v.a],x[v.b],x[v.c])}for(y=0;y<m;y++)x=p[y].vertexNormals[n],q[y].push(x.a,x.b,x.c);u&&this.skinIndices.push(t[v.a],t[v.b],t[v.c]);w&&this.skinWeights.push(r[v.a], n),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2)));!0===f&&(y=v.vertexTangents,3===y.length?this.tangents.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined tangents ",n),this.tangents.push(new THREE.Vector4,new THREE.Vector4,new THREE.Vector4)));for(y=0;y<k;y++){var x=h[y].vertices;l[y].push(x[v.a],x[v.b],x[v.c])}for(y=0;y<m;y++)x=p[y].vertexNormals[n],q[y].push(x.a,x.b,x.c);u&&this.skinIndices.push(t[v.a],t[v.b],t[v.c]);w&&this.skinWeights.push(r[v.a],
r[v.b],r[v.c])}this.verticesNeedUpdate=a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.tangentsNeedUpdate=a.tangentsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype); r[v.b],r[v.c])}this.verticesNeedUpdate=a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.tangentsNeedUpdate=a.tangentsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype);
THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.morphAttributes={};this.drawcalls=[];this.boundingSphere=this.boundingBox=null}; THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++});this.uuid=THREE.Math.generateUUID();this.name="";this.type="BufferGeometry";this.attributes={};this.morphAttributes={};this.drawcalls=[];this.boundingSphere=this.boundingBox=null};
THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a]},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .drawcalls."); THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(a,b,c){!1===b instanceof THREE.BufferAttribute&&!1===b instanceof THREE.InterleavedBufferAttribute?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[a]={array:b,itemSize:c}):("index"===a&&!1===b instanceof THREE.IndexBufferAttribute&&(console.warn("THREE.BufferGeometry.addAttribute: Use THREE.IndexBufferAttribute for index attribute."),b=new THREE.IndexBufferAttribute(b.array,
return this.drawcalls},addDrawCall:function(a,b,c){void 0!==c&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.");this.drawcalls.push({start:a,count:b})},clearDrawCalls:function(){this.drawcalls=[]},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox(); b.itemSize)),this.attributes[a]=b)},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a]},get offsets(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .drawcalls.");return this.drawcalls},addDrawCall:function(a,b,c){void 0!==c&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.");this.drawcalls.push({start:a,count:b})},clearDrawCalls:function(){this.drawcalls=[]},applyMatrix:function(a){var b=this.attributes.position;
null!==this.boundingSphere&&this.computeBoundingSphere()},rotateX:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationY(b);this.applyMatrix(a);return this}}(),rotateZ:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a;return function(b, void 0!==b&&(a.applyToVector3Array(b.array),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new THREE.Matrix3).getNormalMatrix(a).applyToVector3Array(b.array),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere()},rotateX:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);
c,d){void 0===a&&(a=new THREE.Matrix4);a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a;return function(b){void 0===a&&(a=new THREE.Object3D);a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.translate(a.x,a.y,a.z);return a},setFromObject:function(a){var b= a.makeRotationY(b);this.applyMatrix(a);return this}}(),rotateZ:function(){var a;return function(b){void 0===a&&(a=new THREE.Matrix4);a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a;return function(b,c,d){void 0===a&&(a=new THREE.Matrix4);a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),lookAt:function(){var a;return function(b){void 0===
a.geometry;if(a instanceof THREE.PointCloud||a instanceof THREE.Line){a=new THREE.Float32Attribute(3*b.vertices.length,3);var c=new THREE.Float32Attribute(3*b.colors.length,3);this.addAttribute("position",a.copyVector3sArray(b.vertices));this.addAttribute("color",c.copyColorsArray(b.colors));b.lineDistances&&b.lineDistances.length===b.vertices.length&&(a=new THREE.Float32Attribute(b.lineDistances.length,1),this.addAttribute("lineDistance",a.copyArray(b.lineDistances)));null!==b.boundingSphere&&(this.boundingSphere= a&&(a=new THREE.Object3D);a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),center:function(){this.computeBoundingBox();var a=this.boundingBox.center().negate();this.translate(a.x,a.y,a.z);return a},setFromObject:function(a){var b=a.geometry;if(a instanceof THREE.PointCloud||a instanceof THREE.Line){a=new THREE.Float32Attribute(3*b.vertices.length,3);var c=new THREE.Float32Attribute(3*b.colors.length,3);this.addAttribute("position",a.copyVector3sArray(b.vertices));this.addAttribute("color",
b.boundingSphere.clone());null!==b.boundingBox&&(this.boundingBox=b.boundingBox.clone())}else a instanceof THREE.Mesh&&b instanceof THREE.Geometry&&this.fromGeometry(b);return this},updateFromObject:function(a){var b=a.geometry;if(a instanceof THREE.Mesh){a=b.__directGeometry;if(void 0===a)return this.fromGeometry(b);a.verticesNeedUpdate=b.verticesNeedUpdate;a.normalsNeedUpdate=b.normalsNeedUpdate;a.colorsNeedUpdate=b.colorsNeedUpdate;a.uvsNeedUpdate=b.uvsNeedUpdate;a.tangentsNeedUpdate=b.tangentsNeedUpdate; c.copyColorsArray(b.colors));b.lineDistances&&b.lineDistances.length===b.vertices.length&&(a=new THREE.Float32Attribute(b.lineDistances.length,1),this.addAttribute("lineDistance",a.copyArray(b.lineDistances)));null!==b.boundingSphere&&(this.boundingSphere=b.boundingSphere.clone());null!==b.boundingBox&&(this.boundingBox=b.boundingBox.clone())}else a instanceof THREE.Mesh&&b instanceof THREE.Geometry&&this.fromGeometry(b);return this},updateFromObject:function(a){var b=a.geometry;if(a instanceof THREE.Mesh){a=
b.verticesNeedUpdate=!1;b.normalsNeedUpdate=!1;b.colorsNeedUpdate=!1;b.uvsNeedUpdate=!1;b.tangentsNeedUpdate=!1;b=a}!0===b.verticesNeedUpdate&&(a=this.attributes.position,void 0!==a&&(a.copyVector3sArray(b.vertices),a.needsUpdate=!0),b.verticesNeedUpdate=!1);!0===b.normalsNeedUpdate&&(a=this.attributes.normal,void 0!==a&&(a.copyVector3sArray(b.normals),a.needsUpdate=!0),b.normalsNeedUpdate=!1);!0===b.colorsNeedUpdate&&(a=this.attributes.color,void 0!==a&&(a.copyColorsArray(b.colors),a.needsUpdate= b.__directGeometry;if(void 0===a)return this.fromGeometry(b);a.verticesNeedUpdate=b.verticesNeedUpdate;a.normalsNeedUpdate=b.normalsNeedUpdate;a.colorsNeedUpdate=b.colorsNeedUpdate;a.uvsNeedUpdate=b.uvsNeedUpdate;a.tangentsNeedUpdate=b.tangentsNeedUpdate;b.verticesNeedUpdate=!1;b.normalsNeedUpdate=!1;b.colorsNeedUpdate=!1;b.uvsNeedUpdate=!1;b.tangentsNeedUpdate=!1;b=a}!0===b.verticesNeedUpdate&&(a=this.attributes.position,void 0!==a&&(a.copyVector3sArray(b.vertices),a.needsUpdate=!0),b.verticesNeedUpdate=
!0),b.colorsNeedUpdate=!1);!0===b.tangentsNeedUpdate&&(a=this.attributes.tangent,void 0!==a&&(a.copyVector4sArray(b.tangents),a.needsUpdate=!0),b.tangentsNeedUpdate=!1);b.lineDistancesNeedUpdate&&(a=this.attributes.lineDistance,void 0!==a&&(a.copyArray(b.lineDistances),a.needsUpdate=!0),b.lineDistancesNeedUpdate=!1);return this},fromGeometry:function(a){a.__directGeometry=(new THREE.DirectGeometry).fromGeometry(a);return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){var b= !1);!0===b.normalsNeedUpdate&&(a=this.attributes.normal,void 0!==a&&(a.copyVector3sArray(b.normals),a.needsUpdate=!0),b.normalsNeedUpdate=!1);!0===b.colorsNeedUpdate&&(a=this.attributes.color,void 0!==a&&(a.copyColorsArray(b.colors),a.needsUpdate=!0),b.colorsNeedUpdate=!1);!0===b.tangentsNeedUpdate&&(a=this.attributes.tangent,void 0!==a&&(a.copyVector4sArray(b.tangents),a.needsUpdate=!0),b.tangentsNeedUpdate=!1);b.lineDistancesNeedUpdate&&(a=this.attributes.lineDistance,void 0!==a&&(a.copyArray(b.lineDistances),
new Float32Array(3*a.vertices.length);this.addAttribute("position",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.vertices));0<a.normals.length&&(b=new Float32Array(3*a.normals.length),this.addAttribute("normal",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.normals)));0<a.colors.length&&(b=new Float32Array(3*a.colors.length),this.addAttribute("color",(new THREE.BufferAttribute(b,3)).copyColorsArray(a.colors)));0<a.uvs.length&&(b=new Float32Array(2*a.uvs.length),this.addAttribute("uv", a.needsUpdate=!0),b.lineDistancesNeedUpdate=!1);return this},fromGeometry:function(a){a.__directGeometry=(new THREE.DirectGeometry).fromGeometry(a);return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){var b=new Float32Array(3*a.vertices.length);this.addAttribute("position",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.vertices));0<a.normals.length&&(b=new Float32Array(3*a.normals.length),this.addAttribute("normal",(new THREE.BufferAttribute(b,3)).copyVector3sArray(a.normals)));
(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs)));0<a.uvs2.length&&(b=new Float32Array(2*a.uvs2.length),this.addAttribute("uv2",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs2)));0<a.tangents.length&&(b=new Float32Array(4*a.tangents.length),this.addAttribute("tangent",(new THREE.BufferAttribute(b,4)).copyVector4sArray(a.tangents)));0<a.indices.length&&(b=new Uint16Array(3*a.indices.length),this.addAttribute("index",(new THREE.BufferAttribute(b,1)).copyIndicesArray(a.indices))); 0<a.colors.length&&(b=new Float32Array(3*a.colors.length),this.addAttribute("color",(new THREE.BufferAttribute(b,3)).copyColorsArray(a.colors)));0<a.uvs.length&&(b=new Float32Array(2*a.uvs.length),this.addAttribute("uv",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs)));0<a.uvs2.length&&(b=new Float32Array(2*a.uvs2.length),this.addAttribute("uv2",(new THREE.BufferAttribute(b,2)).copyVector2sArray(a.uvs2)));0<a.tangents.length&&(b=new Float32Array(4*a.tangents.length),this.addAttribute("tangent",
for(var c in a.morphTargets){for(var b=[],d=a.morphTargets[c],e=0,g=d.length;e<g;e++){var f=d[e],h=new THREE.Float32Attribute(3*f.length,3);b.push(h.copyVector3sArray(f))}this.morphAttributes[c]=b}0<a.skinIndices.length&&(c=new THREE.Float32Attribute(4*a.skinIndices.length,4),this.addAttribute("skinIndex",c.copyVector4sArray(a.skinIndices)));0<a.skinWeights.length&&(c=new THREE.Float32Attribute(4*a.skinWeights.length,4),this.addAttribute("skinWeight",c.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&& (new THREE.BufferAttribute(b,4)).copyVector4sArray(a.tangents)));0<a.indices.length&&(b=new (65535<a.vertices.length?Uint32Array:Uint16Array)(3*a.indices.length),this.addAttribute("index",(new THREE.IndexBufferAttribute(b,1)).copyIndicesArray(a.indices)));for(var c in a.morphTargets){for(var b=[],d=a.morphTargets[c],e=0,g=d.length;e<g;e++){var f=d[e],h=new THREE.Float32Attribute(3*f.length,3);b.push(h.copyVector3sArray(f))}this.morphAttributes[c]=b}0<a.skinIndices.length&&(c=new THREE.Float32Attribute(4*
(this.boundingSphere=a.boundingSphere.clone());null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)|| a.skinIndices.length,4),this.addAttribute("skinIndex",c.copyVector4sArray(a.skinIndices)));0<a.skinWeights.length&&(c=new THREE.Float32Attribute(4*a.skinWeights.length,4),this.addAttribute("skinWeight",c.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){var a=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=
isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.fromArray(c, new THREE.Box3);var b=this.attributes.position.array;if(b){var c=this.boundingBox;c.makeEmpty();for(var d=0,e=b.length;d<e;d+=3)a.fromArray(b,d),c.expandByPoint(a)}if(void 0===b||0===b.length)this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0);(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}}(),
e),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes,b=this.drawcalls;if(a.position){var c=a.position.array;if(void 0=== computeBoundingSphere:function(){var a=new THREE.Box3,b=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var c=this.attributes.position.array;if(c){a.makeEmpty();for(var d=this.boundingSphere.center,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),a.expandByPoint(b);a.center(d);for(var f=0,e=0,g=c.length;e<g;e+=3)b.fromArray(c,e),f=Math.max(f,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(f);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(c.length),3));else for(var d=a.normal.array,e=0,g=d.length;e<g;e++)d[e]=0;var d=a.normal.array,f,h,k,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3,q=new THREE.Vector3;if(a.index){var t=a.index.array;0===b.length&&this.addDrawCall(0,t.length);for(var r=0,u=b.length;r<u;++r)for(e=b[r],g=e.start,f=e.count,e=g,g+=f;e<g;e+=3)f=3*t[e+0],h=3*t[e+1],k=3*t[e+2],l.fromArray(c,f),n.fromArray(c,h), this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.attributes,b=this.drawcalls;if(a.position){var c=a.position.array;if(void 0===a.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(c.length),3));else for(var d=a.normal.array,e=0,g=d.length;e<g;e++)d[e]=0;var d=a.normal.array,f,h,k,l=new THREE.Vector3,n=new THREE.Vector3,p=new THREE.Vector3,m=new THREE.Vector3,q=new THREE.Vector3;if(a.index){var t=a.index.array;0===b.length&&this.addDrawCall(0,
p.fromArray(c,k),m.subVectors(p,n),q.subVectors(l,n),m.cross(q),d[f]+=m.x,d[f+1]+=m.y,d[f+2]+=m.z,d[h]+=m.x,d[h+1]+=m.y,d[h+2]+=m.z,d[k]+=m.x,d[k+1]+=m.y,d[k+2]+=m.z}else for(e=0,g=c.length;e<g;e+=9)l.fromArray(c,e),n.fromArray(c,e+3),p.fromArray(c,e+6),m.subVectors(p,n),q.subVectors(l,n),m.cross(q),d[e]=m.x,d[e+1]=m.y,d[e+2]=m.z,d[e+3]=m.x,d[e+4]=m.y,d[e+5]=m.z,d[e+6]=m.x,d[e+7]=m.y,d[e+8]=m.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d, t.length);for(var r=0,u=b.length;r<u;++r)for(e=b[r],g=e.start,f=e.count,e=g,g+=f;e<g;e+=3)f=3*t[e+0],h=3*t[e+1],k=3*t[e+2],l.fromArray(c,f),n.fromArray(c,h),p.fromArray(c,k),m.subVectors(p,n),q.subVectors(l,n),m.cross(q),d[f]+=m.x,d[f+1]+=m.y,d[f+2]+=m.z,d[h]+=m.x,d[h+1]+=m.y,d[h+2]+=m.z,d[k]+=m.x,d[k+1]+=m.y,d[k+2]+=m.z}else for(e=0,g=c.length;e<g;e+=9)l.fromArray(c,e),n.fromArray(c,e+3),p.fromArray(c,e+6),m.subVectors(p,n),q.subVectors(l,n),m.cross(q),d[e]=m.x,d[e+1]=m.y,d[e+2]=m.z,d[e+3]=m.x,d[e+
3*a);m.fromArray(d,3*b);q.fromArray(d,3*c);t.fromArray(g,2*a);r.fromArray(g,2*b);u.fromArray(g,2*c);w=m.x-p.x;v=q.x-p.x;y=m.y-p.y;x=q.y-p.y;E=m.z-p.z;B=q.z-p.z;z=r.x-t.x;A=u.x-t.x;M=r.y-t.y;J=u.y-t.y;D=1/(z*J-A*M);P.set((J*w-M*v)*D,(J*y-M*x)*D,(J*E-M*B)*D);K.set((z*v-A*w)*D,(z*x-A*y)*D,(z*B-A*E)*D);k[a].add(P);k[b].add(P);k[c].add(P);l[a].add(K);l[b].add(K);l[c].add(K)}function b(a){F.fromArray(e,3*a);$.copy(F);aa=k[a];R.copy(aa);R.sub(F.multiplyScalar(F.dot(aa))).normalize();U.crossVectors($,aa); 4]=m.y,d[e+5]=m.z,d[e+6]=m.x,d[e+7]=m.y,d[e+8]=m.z;this.normalizeNormals();a.normal.needsUpdate=!0}},computeTangents:function(){function a(a,b,c){p.fromArray(d,3*a);m.fromArray(d,3*b);q.fromArray(d,3*c);t.fromArray(g,2*a);r.fromArray(g,2*b);u.fromArray(g,2*c);w=m.x-p.x;v=q.x-p.x;y=m.y-p.y;x=q.y-p.y;E=m.z-p.z;B=q.z-p.z;z=r.x-t.x;A=u.x-t.x;L=r.y-t.y;J=u.y-t.y;D=1/(z*J-A*L);P.set((J*w-L*v)*D,(J*y-L*x)*D,(J*E-L*B)*D);K.set((z*v-A*w)*D,(z*x-A*y)*D,(z*B-A*E)*D);k[a].add(P);k[b].add(P);k[c].add(P);l[a].add(K);
pa=U.dot(l[a]);ea=0>pa?-1:1;h[4*a]=R.x;h[4*a+1]=R.y;h[4*a+2]=R.z;h[4*a+3]=ea}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&& l[b].add(K);l[c].add(K)}function b(a){F.fromArray(e,3*a);$.copy(F);aa=k[a];R.copy(aa);R.sub(F.multiplyScalar(F.dot(aa))).normalize();U.crossVectors($,aa);pa=U.dot(l[a]);ea=0>pa?-1:1;h[4*a]=R.x;h[4*a+1]=R.y;h[4*a+2]=R.z;h[4*a+3]=ea}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var c=
this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<f;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,q=new THREE.Vector3,t=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,w,v,y,x,E,B,z,A,M,J,D,P=new THREE.Vector3,K=new THREE.Vector3,C,G,H,O,Q;0===this.drawcalls.length&&this.addDrawCall(0,c.length);for(var T=this.drawcalls,f=0,n=T.length;f<n;++f)for(C=T[f],G= this.attributes.index.array,d=this.attributes.position.array,e=this.attributes.normal.array,g=this.attributes.uv.array,f=d.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*f),4));for(var h=this.attributes.tangent.array,k=[],l=[],n=0;n<f;n++)k[n]=new THREE.Vector3,l[n]=new THREE.Vector3;var p=new THREE.Vector3,m=new THREE.Vector3,q=new THREE.Vector3,t=new THREE.Vector2,r=new THREE.Vector2,u=new THREE.Vector2,w,v,y,x,E,B,z,A,L,J,D,P=
C.start,H=C.count,C=G,G+=H;C<G;C+=3)H=c[C+0],O=c[C+1],Q=c[C+2],a(H,O,Q);for(var R=new THREE.Vector3,U=new THREE.Vector3,F=new THREE.Vector3,$=new THREE.Vector3,ea,aa,pa,f=0,n=T.length;f<n;++f)for(C=T[f],G=C.start,H=C.count,C=G,G+=H;C<G;C+=3)H=c[C+0],O=c[C+1],Q=c[C+2],b(H),b(O),b(Q)}},computeOffsets:function(a){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", new THREE.Vector3,K=new THREE.Vector3,C,G,H,O,Q;0===this.drawcalls.length&&this.addDrawCall(0,c.length);for(var T=this.drawcalls,f=0,n=T.length;f<n;++f)for(C=T[f],G=C.start,H=C.count,C=G,G+=H;C<G;C+=3)H=c[C+0],O=c[C+1],Q=c[C+2],a(H,O,Q);for(var R=new THREE.Vector3,U=new THREE.Vector3,F=new THREE.Vector3,$=new THREE.Vector3,ea,aa,pa,f=0,n=T.length;f<n;++f)for(C=T[f],G=C.start,H=C.count,C=G,G+=H;C<G;C+=3)H=c[C+0],O=c[C+1],Q=c[C+2],b(H),b(O),b(Q)}},computeOffsets:function(a){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},
a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,g=a.attributes[d],f=g.array,h=0,g=g.itemSize*b;h<f.length;h++,g++)e[g]=f[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},reorderBuffers:function(a,b,c){var d={},e;for(e in this.attributes)"index"!==e&&(d[e]=new this.attributes[e].array.constructor(this.attributes[e].itemSize* merge:function(a,b){if(!1===a instanceof THREE.BufferGeometry)console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",a);else{void 0===b&&(b=0);var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d])for(var e=c[d].array,g=a.attributes[d],f=g.array,h=0,g=g.itemSize*b;h<f.length;h++,g++)e[g]=f[h];return this}},normalizeNormals:function(){for(var a=this.attributes.normal.array,b,c,d,e=0,g=a.length;e<g;e+=3)b=a[e],c=a[e+1],d=a[e+2],b=1/Math.sqrt(b*b+c*c+
c));for(var g=0;g<c;g++){var f=b[g];for(e in this.attributes)if("index"!==e)for(var h=this.attributes[e].array,k=this.attributes[e].itemSize,l=d[e],n=0;n<k;n++)l[g*k+n]=h[f*k+n]}this.attributes.index.array=a;for(e in this.attributes)"index"!==e&&(this.attributes[e].array=d[e],this.attributes[e].numItems=this.attributes[e].itemSize*c)},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name); d*d),a[e]*=b,a[e+1]*=b,a[e+2]*=b},toJSON:function(){var a={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};var b=this.attributes,d=this.drawcalls,e=this.boundingSphere;for(c in b){var g=b[c],f=Array.prototype.slice.call(g.array);a.data.attributes[c]={itemSize:g.itemSize,type:g.array.constructor.name,
if(void 0!==this.parameters){var b=this.parameters,c;for(c in b)void 0!==b[c]&&(a[c]=b[c]);return a}a.data={attributes:{}};var b=this.attributes,d=this.drawcalls,e=this.boundingSphere;for(c in b){var g=b[c],f=Array.prototype.slice.call(g.array);a.data.attributes[c]={itemSize:g.itemSize,type:g.array.constructor.name,array:f}}0<d.length&&(a.data.drawcalls=JSON.parse(JSON.stringify(d)));null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){return(new this.constructor).copy(this)}, array:f}}0<d.length&&(a.data.drawcalls=JSON.parse(JSON.stringify(d)));null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){return(new this.constructor).copy(this)},copy:function(a){var b=a.attributes;a=a.drawcalls;for(var c in b)this.addAttribute(c,b[c].clone());b=0;for(c=a.length;b<c;b++){var d=a[b];this.addDrawCall(d.start,d.count)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);
copy:function(a){var b=a.attributes;a=a.drawcalls;for(var c in b)this.addAttribute(c,b[c].clone());b=0;for(c=a.length;b<c;b++){var d=a[b];this.addDrawCall(d.start,d.count)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype);THREE.BufferGeometry.MaxIndex=65535;THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0}; THREE.BufferGeometry.MaxIndex=65535;THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0};THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;THREE.InstancedBufferGeometry.prototype.addDrawCall=function(a,b,c){this.drawcalls.push({start:a,count:b,instances:c})};
THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry;THREE.InstancedBufferGeometry.prototype.addDrawCall=function(a,b,c){this.drawcalls.push({start:a,count:b,instances:c})};
THREE.InstancedBufferGeometry.prototype.copy=function(a){for(var b in a.attributes)this.addAttribute(b,a.attributes[b].clone());b=0;for(var c=a.drawcalls.length;b<c;b++){var d=a.drawcalls[b];this.addDrawCall(d.start,d.count,d.instances)}return this};THREE.EventDispatcher.prototype.apply(THREE.InstancedBufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4}; THREE.InstancedBufferGeometry.prototype.copy=function(a){for(var b in a.attributes)this.addAttribute(b,a.attributes[b].clone());b=0;for(var c=a.drawcalls.length;b<c;b++){var d=a.drawcalls[b];this.addDrawCall(d.start,d.count,d.instances)}return this};THREE.EventDispatcher.prototype.apply(THREE.InstancedBufferGeometry.prototype);THREE.Camera=function(){THREE.Object3D.call(this);this.type="Camera";this.matrixWorldInverse=new THREE.Matrix4;this.projectionMatrix=new THREE.Matrix4};
THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}();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(){return(new this.constructor).copy(this)}; THREE.Camera.prototype=Object.create(THREE.Object3D.prototype);THREE.Camera.prototype.constructor=THREE.Camera;THREE.Camera.prototype.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.getWorldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}();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(){return(new this.constructor).copy(this)};
THREE.Camera.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.matrixWorldInverse.copy(a.matrixWorldInverse);this.projectionMatrix.copy(a.projectionMatrix);return this}; THREE.Camera.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.matrixWorldInverse.copy(a.matrixWorldInverse);this.projectionMatrix.copy(a.projectionMatrix);return this};
...@@ -391,8 +391,8 @@ THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morp ...@@ -391,8 +391,8 @@ THREE.Mesh.prototype.getMorphTargetIndexByName=function(a){if(void 0!==this.morp
THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3;return function(l,n){var p=this.geometry,m=this.material;if(void 0!==m&&(null===p.boundingSphere&&p.computeBoundingSphere(),c.copy(p.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==l.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(l.ray).applyMatrix4(a),null=== THREE.Mesh.prototype.raycast=function(){var a=new THREE.Matrix4,b=new THREE.Ray,c=new THREE.Sphere,d=new THREE.Vector3,e=new THREE.Vector3,g=new THREE.Vector3,f=new THREE.Vector3,h=new THREE.Vector3,k=new THREE.Vector3;return function(l,n){var p=this.geometry,m=this.material;if(void 0!==m&&(null===p.boundingSphere&&p.computeBoundingSphere(),c.copy(p.boundingSphere),c.applyMatrix4(this.matrixWorld),!1!==l.ray.isIntersectionSphere(c)&&(a.getInverse(this.matrixWorld),b.copy(l.ray).applyMatrix4(a),null===
p.boundingBox||!1!==b.isIntersectionBox(p.boundingBox)))){var q,t,r;if(p instanceof THREE.BufferGeometry)if(q=p.attributes,void 0!==q.index){var u=q.index.array,w=q.position.array,v=p.drawcalls;0===v.length&&p.addDrawCall(0,u.length);for(var p=0,y=v.length;p<y;++p){q=v[p];for(var x=t=q.start,E=t+q.count;x<E;x+=3){q=u[x];t=u[x+1];r=u[x+2];d.fromArray(w,3*q);e.fromArray(w,3*t);g.fromArray(w,3*r);var B=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide); p.boundingBox||!1!==b.isIntersectionBox(p.boundingBox)))){var q,t,r;if(p instanceof THREE.BufferGeometry)if(q=p.attributes,void 0!==q.index){var u=q.index.array,w=q.position.array,v=p.drawcalls;0===v.length&&p.addDrawCall(0,u.length);for(var p=0,y=v.length;p<y;++p){q=v[p];for(var x=t=q.start,E=t+q.count;x<E;x+=3){q=u[x];t=u[x+1];r=u[x+2];d.fromArray(w,3*q);e.fromArray(w,3*t);g.fromArray(w,3*r);var B=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide);
if(null!==B){B.applyMatrix4(this.matrixWorld);var z=l.ray.origin.distanceTo(B);z<l.near||z>l.far||n.push({distance:z,point:B,face:new THREE.Face3(q,t,r,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(x/3),object:this})}}}}else for(w=q.position.array,x=0,E=w.length;x<E;x+=9)d.fromArray(w,x),e.fromArray(w,x+3),g.fromArray(w,x+6),B=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide),null!==B&&(B.applyMatrix4(this.matrixWorld),z=l.ray.origin.distanceTo(B), if(null!==B){B.applyMatrix4(this.matrixWorld);var z=l.ray.origin.distanceTo(B);z<l.near||z>l.far||n.push({distance:z,point:B,face:new THREE.Face3(q,t,r,THREE.Triangle.normal(d,e,g)),faceIndex:Math.floor(x/3),object:this})}}}}else for(w=q.position.array,x=0,E=w.length;x<E;x+=9)d.fromArray(w,x),e.fromArray(w,x+3),g.fromArray(w,x+6),B=m.side===THREE.BackSide?b.intersectTriangle(g,e,d,!0):b.intersectTriangle(d,e,g,m.side!==THREE.DoubleSide),null!==B&&(B.applyMatrix4(this.matrixWorld),z=l.ray.origin.distanceTo(B),
z<l.near||z>l.far||(q=x/3,t=q+1,r=q+2,n.push({distance:z,point:B,face:new THREE.Face3(q,t,r,THREE.Triangle.normal(d,e,g)),index:q,object:this})));else if(p instanceof THREE.Geometry)for(u=m instanceof THREE.MeshFaceMaterial,w=!0===u?m.materials:null,v=p.vertices,y=p.faces,x=0,E=y.length;x<E;x++){var A=y[x],B=!0===u?w[A.materialIndex]:m;if(void 0!==B){q=v[A.a];t=v[A.b];r=v[A.c];if(!0===B.morphTargets){var z=p.morphTargets,M=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var J= z<l.near||z>l.far||(q=x/3,t=q+1,r=q+2,n.push({distance:z,point:B,face:new THREE.Face3(q,t,r,THREE.Triangle.normal(d,e,g)),index:q,object:this})));else if(p instanceof THREE.Geometry)for(u=m instanceof THREE.MeshFaceMaterial,w=!0===u?m.materials:null,v=p.vertices,y=p.faces,x=0,E=y.length;x<E;x++){var A=y[x],B=!0===u?w[A.materialIndex]:m;if(void 0!==B){q=v[A.a];t=v[A.b];r=v[A.c];if(!0===B.morphTargets){var z=p.morphTargets,L=this.morphTargetInfluences;d.set(0,0,0);e.set(0,0,0);g.set(0,0,0);for(var J=
0,D=z.length;J<D;J++){var P=M[J];if(0!==P){var K=z[J].vertices;d.addScaledVector(f.subVectors(K[A.a],q),P);e.addScaledVector(h.subVectors(K[A.b],t),P);g.addScaledVector(k.subVectors(K[A.c],r),P)}}d.add(q);e.add(t);g.add(r);q=d;t=e;r=g}B=B.side===THREE.BackSide?b.intersectTriangle(r,t,q,!0):b.intersectTriangle(q,t,r,B.side!==THREE.DoubleSide);null!==B&&(B.applyMatrix4(this.matrixWorld),z=l.ray.origin.distanceTo(B),z<l.near||z>l.far||n.push({distance:z,point:B,face:A,faceIndex:x,object:this}))}}}}}(); 0,D=z.length;J<D;J++){var P=L[J];if(0!==P){var K=z[J].vertices;d.addScaledVector(f.subVectors(K[A.a],q),P);e.addScaledVector(h.subVectors(K[A.b],t),P);g.addScaledVector(k.subVectors(K[A.c],r),P)}}d.add(q);e.add(t);g.add(r);q=d;t=e;r=g}B=B.side===THREE.BackSide?b.intersectTriangle(r,t,q,!0):b.intersectTriangle(q,t,r,B.side!==THREE.DoubleSide);null!==B&&(B.applyMatrix4(this.matrixWorld),z=l.ray.origin.distanceTo(B),z<l.near||z>l.far||n.push({distance:z,point:B,face:A,faceIndex:x,object:this}))}}}}}();
THREE.Mesh.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a));void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a));b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b}; THREE.Mesh.prototype.clone=function(){return(new this.constructor(this.geometry,this.material)).copy(this)};THREE.Mesh.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.geometries[this.geometry.uuid]&&(a.geometries[this.geometry.uuid]=this.geometry.toJSON(a));void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON(a));b.object.geometry=this.geometry.uuid;b.object.material=this.material.uuid;return b};
THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this}; THREE.Bone=function(a){THREE.Object3D.call(this);this.type="Bone";this.skin=a};THREE.Bone.prototype=Object.create(THREE.Object3D.prototype);THREE.Bone.prototype.constructor=THREE.Bone;THREE.Bone.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a);this.skin=a.skin;return this};
THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(a=Math.sqrt(4*this.bones.length),a=THREE.Math.nextPowerOfTwo(Math.ceil(a)),this.boneTextureHeight=this.boneTextureWidth=a=Math.max(a,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType), THREE.Skeleton=function(a,b,c){this.useVertexTexture=void 0!==c?c:!0;this.identityMatrix=new THREE.Matrix4;a=a||[];this.bones=a.slice(0);this.useVertexTexture?(a=Math.sqrt(4*this.bones.length),a=THREE.Math.nextPowerOfTwo(Math.ceil(a)),this.boneTextureHeight=this.boneTextureWidth=a=Math.max(a,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),
...@@ -415,7 +415,7 @@ THREE.LOD=function(){THREE.Object3D.call(this);Object.defineProperties(this,{lev ...@@ -415,7 +415,7 @@ THREE.LOD=function(){THREE.Object3D.call(this);Object.defineProperties(this,{lev
THREE.LOD.prototype.getObjectForDistance=function(a){for(var b=this.levels,c=1,d=b.length;c<d&&!(a<b[c].distance);c++);return b[c-1].object};THREE.LOD.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.origin.distanceTo(a);this.getObjectForDistance(d).raycast(b,c)}}(); THREE.LOD.prototype.getObjectForDistance=function(a){for(var b=this.levels,c=1,d=b.length;c<d&&!(a<b[c].distance);c++);return b[c-1].object};THREE.LOD.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.origin.distanceTo(a);this.getObjectForDistance(d).raycast(b,c)}}();
THREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){var d=this.levels;if(1<d.length){a.setFromMatrixPosition(c.matrixWorld);b.setFromMatrixPosition(this.matrixWorld);c=a.distanceTo(b);d[0].object.visible=!0;for(var e=1,g=d.length;e<g;e++)if(c>=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break;for(;e<g;e++)d[e].object.visible=!1}}}(); THREE.LOD.prototype.update=function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){var d=this.levels;if(1<d.length){a.setFromMatrixPosition(c.matrixWorld);b.setFromMatrixPosition(this.matrixWorld);c=a.distanceTo(b);d[0].object.visible=!0;for(var e=1,g=d.length;e<g;e++)if(c>=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break;for(;e<g;e++)d[e].object.visible=!1}}}();
THREE.LOD.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b<c;b++){var d=a[b];this.addLevel(d.object.clone(),d.distance)}return this}; THREE.LOD.prototype.copy=function(a){THREE.Object3D.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b<c;b++){var d=a[b];this.addLevel(d.object.clone(),d.distance)}return this};
THREE.Sprite=function(){var a=new Uint16Array([0,1,2,0,2,3]),b=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),c=new Float32Array([0,0,1,0,1,1,0,1]),d=new THREE.BufferGeometry;d.addAttribute("index",new THREE.BufferAttribute(a,1));d.addAttribute("position",new THREE.BufferAttribute(b,3));d.addAttribute("uv",new THREE.BufferAttribute(c,2));return function(a){THREE.Object3D.call(this);this.type="Sprite";this.geometry=d;this.material=void 0!==a?a:new THREE.SpriteMaterial}}(); THREE.Sprite=function(){var a=new Uint16Array([0,1,2,0,2,3]),b=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),c=new Float32Array([0,0,1,0,1,1,0,1]),d=new THREE.BufferGeometry;d.addAttribute("index",new THREE.IndexBufferAttribute(a,1));d.addAttribute("position",new THREE.BufferAttribute(b,3));d.addAttribute("uv",new THREE.BufferAttribute(c,2));return function(a){THREE.Object3D.call(this);this.type="Sprite";this.geometry=d;this.material=void 0!==a?a:new THREE.SpriteMaterial}}();
THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype);THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceSqToPoint(a);d>this.scale.x*this.scale.y||c.push({distance:Math.sqrt(d),point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.clone=function(){return(new this.constructor(this.material)).copy(this)}; THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype);THREE.Sprite.prototype.constructor=THREE.Sprite;THREE.Sprite.prototype.raycast=function(){var a=new THREE.Vector3;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.distanceSqToPoint(a);d>this.scale.x*this.scale.y||c.push({distance:Math.sqrt(d),point:this.position,face:null,object:this})}}();THREE.Sprite.prototype.clone=function(){return(new this.constructor(this.material)).copy(this)};
THREE.Sprite.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.material=this.material.uuid;return b};THREE.Particle=THREE.Sprite;THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype); THREE.Sprite.prototype.toJSON=function(a){var b=THREE.Object3D.prototype.toJSON.call(this,a);void 0===a.materials[this.material.uuid]&&(a.materials[this.material.uuid]=this.material.toJSON());b.object.material=this.material.uuid;return b};THREE.Particle=THREE.Sprite;THREE.LensFlare=function(a,b,c,d,e){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3;this.customUpdateCallback=void 0;void 0!==a&&this.add(a,b,c,d,e)};THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype);
THREE.LensFlare.prototype.constructor=THREE.LensFlare;THREE.LensFlare.prototype.add=function(a,b,c,d,e,g){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===g&&(g=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:0,opacity:g,color:e,blending:d})}; THREE.LensFlare.prototype.constructor=THREE.LensFlare;THREE.LensFlare.prototype.add=function(a,b,c,d,e,g){void 0===b&&(b=-1);void 0===c&&(c=0);void 0===g&&(g=1);void 0===e&&(e=new THREE.Color(16777215));void 0===d&&(d=THREE.NormalBlending);c=Math.min(c,Math.max(0,c));this.lensFlares.push({texture:a,size:b,distance:c,x:0,y:0,z:0,scale:1,rotation:0,opacity:g,color:e,blending:d})};
...@@ -485,17 +485,17 @@ tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.Sh ...@@ -485,17 +485,17 @@ tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.Sh
THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment, THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,
"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {", "}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",
THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}}; THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}};
THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===R&&(a*=d,b*=d,c*=d);s.clearColor(a,b,c,d)}function c(){L.init();s.viewport(Aa,Ga,Ha,Ba);b($.r,$.g,$.b,ea)}function d(){Wa=lb=null;Ia="";Xa=-1;eb=!0;L.reset()}function e(a){a.preventDefault();d();c();ua.clear();Z.clear()}function g(a){a=a.target;a.removeEventListener("dispose",g);a:{var b=Z.get(a);if(a.image&&b.__image__webglTextureCube)s.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;s.deleteTexture(b.__webglTexture)}Z.delete(a)}Ca.textures--} THREE.WebGLRenderer=function(a){function b(a,b,c,d){!0===R&&(a*=d,b*=d,c*=d);s.clearColor(a,b,c,d)}function c(){M.init();s.viewport(Aa,Ga,Ha,Ba);b($.r,$.g,$.b,ea)}function d(){Wa=lb=null;Ia="";Xa=-1;eb=!0;M.reset()}function e(a){a.preventDefault();d();c();ua.clear();Z.clear()}function g(a){a=a.target;a.removeEventListener("dispose",g);a:{var b=Z.get(a);if(a.image&&b.__image__webglTextureCube)s.deleteTexture(b.__image__webglTextureCube);else{if(void 0===b.__webglInit)break a;s.deleteTexture(b.__webglTexture)}Z.delete(a)}Ca.textures--}
function f(a){a=a.target;a.removeEventListener("dispose",f);var b=Z.get(a);if(a&&void 0!==b.__webglTexture){s.deleteTexture(b.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(var c=0;6>c;c++)s.deleteFramebuffer(b.__webglFramebuffer[c]),s.deleteRenderbuffer(b.__webglRenderbuffer[c]);else s.deleteFramebuffer(b.__webglFramebuffer),s.deleteRenderbuffer(b.__webglRenderbuffer);Z.delete(a)}Ca.textures--}function h(a){a=a.target;a.removeEventListener("dispose",h);k(a);Z.delete(a)}function k(a){var b= function f(a){a=a.target;a.removeEventListener("dispose",f);var b=Z.get(a);if(a&&void 0!==b.__webglTexture){s.deleteTexture(b.__webglTexture);if(a instanceof THREE.WebGLRenderTargetCube)for(var c=0;6>c;c++)s.deleteFramebuffer(b.__webglFramebuffer[c]),s.deleteRenderbuffer(b.__webglRenderbuffer[c]);else s.deleteFramebuffer(b.__webglFramebuffer),s.deleteRenderbuffer(b.__webglRenderbuffer);Z.delete(a)}Ca.textures--}function h(a){a=a.target;a.removeEventListener("dispose",h);k(a);Z.delete(a)}function k(a){var b=
Z.get(a).program.program;if(void 0!==b){a.program=void 0;a=0;for(var c=va.length;a!==c;++a){var d=va[a];if(d.program===b){0===--d.usedTimes&&(c-=1,va[a]=va[c],va.pop(),s.deleteProgram(b),Ca.programs=c);break}}}}function l(a,b){return b[0]-a[0]}function n(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.object.material.id!==b.object.material.id?a.object.material.id-b.object.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!== Z.get(a).program.program;if(void 0!==b){a.program=void 0;a=0;for(var c=va.length;a!==c;++a){var d=va[a];if(d.program===b){0===--d.usedTimes&&(c-=1,va[a]=va[c],va.pop(),s.deleteProgram(b),Ca.programs=c);break}}}}function l(a,b){return b[0]-a[0]}function n(a,b){return a.object.renderOrder!==b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.object.material.id!==b.object.material.id?a.object.material.id-b.object.material.id:a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return a.object.renderOrder!==
b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ua.init(a),a instanceof THREE.Light)aa.push(a);else if(a instanceof THREE.Sprite)Pa.push(a);else if(a instanceof THREE.LensFlare)Ja.push(a);else if(a instanceof THREE.ImmediateRenderObject){var b=a.material;b.transparent?za.push(a):ma.push(a)}else{var c=ua.objects[a.id]; b.object.renderOrder?a.object.renderOrder-b.object.renderOrder:a.z!==b.z?b.z-a.z:a.id-b.id}function m(a){if(!1!==a.visible){if(!(a instanceof THREE.Scene||a instanceof THREE.Group))if(a instanceof THREE.SkinnedMesh&&a.skeleton.update(),ua.init(a),a instanceof THREE.Light)aa.push(a);else if(a instanceof THREE.Sprite)Pa.push(a);else if(a instanceof THREE.LensFlare)Ja.push(a);else if(a instanceof THREE.ImmediateRenderObject){var b=a.material;b.transparent?za.push(a):ma.push(a)}else{var c=ua.objects[a.id];
!c||!1!==a.frustumCulled&&!0!==Ya.intersectsObject(a)||(b=a.material,null!==b&&!0===b.visible&&(Z.get(b)&&(b.program=Z.get(b).program),b.transparent?ta.push(c):pa.push(c),!0===ja.sortObjects&&(ka.setFromMatrixPosition(a.matrixWorld),ka.applyProjection(Qa),c.z=ka.z)))}a=a.children;b=0;for(c=a.length;b<c;b++)m(a[b])}}function q(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g].object,l=ua.update(k);k._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,k.matrixWorld);k._normalMatrix.getNormalMatrix(k._modelViewMatrix); !c||!1!==a.frustumCulled&&!0!==Ya.intersectsObject(a)||(b=a.material,null!==b&&!0===b.visible&&(Z.get(b)&&(b.program=Z.get(b).program),b.transparent?ta.push(c):pa.push(c),!0===ja.sortObjects&&(ka.setFromMatrixPosition(a.matrixWorld),ka.applyProjection(Qa),c.z=ka.z)))}a=a.children;b=0;for(c=a.length;b<c;b++)m(a[b])}}function q(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g].object,l=ua.update(k);k._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,k.matrixWorld);k._normalMatrix.getNormalMatrix(k._modelViewMatrix);
void 0===e&&(f=k.material);if(f instanceof THREE.MeshFaceMaterial)for(var m=f.materials,n=0,p=m.length;n<p;n++)f=m[n],f.visible&&ja.renderBufferDirect(b,c,d,l,f,k);else ja.renderBufferDirect(b,c,d,l,f,k)}}function t(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g];k._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,k.matrixWorld);k._normalMatrix.getNormalMatrix(k._modelViewMatrix);void 0===e&&(f=k.material);r(f);var l=u(b,c,d,f,k);Ia="";k.render(function(a){ja.renderBufferImmediate(a, void 0===e&&(f=k.material);if(f instanceof THREE.MeshFaceMaterial)for(var m=f.materials,n=0,p=m.length;n<p;n++)f=m[n],f.visible&&ja.renderBufferDirect(b,c,d,l,f,k);else ja.renderBufferDirect(b,c,d,l,f,k)}}function t(a,b,c,d,e){for(var f=e,g=0,h=a.length;g<h;g++){var k=a[g];k._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,k.matrixWorld);k._normalMatrix.getNormalMatrix(k._modelViewMatrix);void 0===e&&(f=k.material);r(f);var l=u(b,c,d,f,k);Ia="";k.render(function(a){ja.renderBufferImmediate(a,
l,f)})}}function r(a){a.side!==THREE.DoubleSide?L.enable(s.CULL_FACE):L.disable(s.CULL_FACE);L.setFlipSided(a.side===THREE.BackSide);!0===a.transparent?L.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):L.setBlending(THREE.NoBlending);L.setDepthFunc(a.depthFunc);L.setDepthTest(a.depthTest);L.setDepthWrite(a.depthWrite);L.setColorWrite(a.colorWrite);L.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function u(a, l,f)})}}function r(a){a.side!==THREE.DoubleSide?M.enable(s.CULL_FACE):M.disable(s.CULL_FACE);M.setFlipSided(a.side===THREE.BackSide);!0===a.transparent?M.setBlending(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha):M.setBlending(THREE.NoBlending);M.setDepthFunc(a.depthFunc);M.setDepthTest(a.depthTest);M.setDepthWrite(a.depthWrite);M.setColorWrite(a.colorWrite);M.setPolygonOffset(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)}function u(a,
b,c,d,e){var f,l,m,n;fb=0;var p=Z.get(d);if(d.needsUpdate||!p.program){a:{for(var q=Z.get(d),t=ac[d.type],r=0,u=0,z=0,B=0,A=0,D=b.length;A<D;A++){var C=b[A];C.onlyShadow||!1===C.visible||(C instanceof THREE.DirectionalLight&&r++,C instanceof THREE.PointLight&&u++,C instanceof THREE.SpotLight&&z++,C instanceof THREE.HemisphereLight&&B++)}f=r;l=u;m=z;n=B;for(var H,O=0,K=0,Q=b.length;K<Q;K++){var P=b[K];P.castShadow&&(P instanceof THREE.SpotLight&&O++,P instanceof THREE.DirectionalLight&&O++)}H=O;var pa; b,c,d,e){var f,l,m,n;fb=0;var p=Z.get(d);if(d.needsUpdate||!p.program){a:{for(var q=Z.get(d),t=ac[d.type],r=0,u=0,z=0,B=0,A=0,D=b.length;A<D;A++){var C=b[A];C.onlyShadow||!1===C.visible||(C instanceof THREE.DirectionalLight&&r++,C instanceof THREE.PointLight&&u++,C instanceof THREE.SpotLight&&z++,C instanceof THREE.HemisphereLight&&B++)}f=r;l=u;m=z;n=B;for(var K,H=0,O=0,Q=b.length;O<Q;O++){var pa=b[O];pa.castShadow&&(pa instanceof THREE.SpotLight&&H++,pa instanceof THREE.DirectionalLight&&H++)}K=
if(mb&&e&&e.skeleton&&e.skeleton.useVertexTexture)pa=1024;else{var R=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),T=Math.floor((R-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(T=Math.min(e.skeleton.bones.length,T),T<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+T+" (try OpenGL instead of ANGLE)"));pa=T}var U=G;null!==d.precision&&(U=L.getMaxPrecision(d.precision),U!==d.precision&&console.warn("THREE.WebGLRenderer.initMaterial:", H;var P;if(mb&&e&&e.skeleton&&e.skeleton.useVertexTexture)P=1024;else{var R=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),T=Math.floor((R-20)/4);void 0!==e&&e instanceof THREE.SkinnedMesh&&(T=Math.min(e.skeleton.bones.length,T),T<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+T+" (try OpenGL instead of ANGLE)"));P=T}var U=G;null!==d.precision&&(U=M.getMaxPrecision(d.precision),U!==d.precision&&console.warn("THREE.WebGLRenderer.initMaterial:",
d.precision,"not supported, using",U,"instead."));var za={precision:U,supportsVertexTextures:nb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,emissiveMap:!!d.emissiveMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:F, d.precision,"not supported, using",U,"instead."));var za={precision:U,supportsVertexTextures:nb,map:!!d.map,envMap:!!d.envMap,envMapMode:d.envMap&&d.envMap.mapping,lightMap:!!d.lightMap,aoMap:!!d.aoMap,emissiveMap:!!d.emissiveMap,bumpMap:!!d.bumpMap,normalMap:!!d.normalMap,specularMap:!!d.specularMap,alphaMap:!!d.alphaMap,combine:d.combine,vertexColors:d.vertexColors,fog:c,useFog:d.fog,fogExp:c instanceof THREE.FogExp2,flatShading:d.shading===THREE.FlatShading,sizeAttenuation:d.sizeAttenuation,logarithmicDepthBuffer:F,
skinning:d.skinning,maxBones:pa,useVertexTexture:mb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:ja.maxMorphTargets,maxMorphNormals:ja.maxMorphNormals,maxDirLights:f,maxPointLights:l,maxSpotLights:m,maxHemiLights:n,maxShadows:H,shadowMapEnabled:na.enabled&&e.receiveShadow&&0<H,shadowMapType:na.type,shadowMapDebug:na.debug,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide}, skinning:d.skinning,maxBones:P,useVertexTexture:mb&&e&&e.skeleton&&e.skeleton.useVertexTexture,morphTargets:d.morphTargets,morphNormals:d.morphNormals,maxMorphTargets:ja.maxMorphTargets,maxMorphNormals:ja.maxMorphNormals,maxDirLights:f,maxPointLights:l,maxSpotLights:m,maxHemiLights:n,maxShadows:K,shadowMapEnabled:na.enabled&&e.receiveShadow&&0<K,shadowMapType:na.type,shadowMapDebug:na.debug,alphaTest:d.alphaTest,metal:d.metal,doubleSided:d.side===THREE.DoubleSide,flipSided:d.side===THREE.BackSide},
ma=[];t?ma.push(t):(ma.push(d.fragmentShader),ma.push(d.vertexShader));if(void 0!==d.defines)for(var ta in d.defines)ma.push(ta),ma.push(d.defines[ta]);for(ta in za)ma.push(ta),ma.push(za[ta]);var X=ma.join(),aa=!0;if(q.program)if(q.program.code!==X)k(d);else if(void 0!==t)break a;else aa=!1;else d.addEventListener("dispose",h);if(t){var Ja=THREE.ShaderLib[t];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(Ja.uniforms),vertexShader:Ja.vertexShader,fragmentShader:Ja.fragmentShader}}else q.__webglShader= ma=[];t?ma.push(t):(ma.push(d.fragmentShader),ma.push(d.vertexShader));if(void 0!==d.defines)for(var ta in d.defines)ma.push(ta),ma.push(d.defines[ta]);for(ta in za)ma.push(ta),ma.push(za[ta]);var X=ma.join(),aa=!0;if(q.program)if(q.program.code!==X)k(d);else if(void 0!==t)break a;else aa=!1;else d.addEventListener("dispose",h);if(t){var Ja=THREE.ShaderLib[t];q.__webglShader={name:d.type,uniforms:THREE.UniformsUtils.clone(Ja.uniforms),vertexShader:Ja.vertexShader,fragmentShader:Ja.fragmentShader}}else q.__webglShader=
{name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var $,ea=0,ib=va.length;ea<ib;ea++){var Pa=va[ea];if(Pa.code===X){$=Pa;aa&&$.usedTimes++;break}}void 0===$&&(d.__webglShader=q.__webglShader,$=new THREE.WebGLProgram(ja,X,d,za),va.push($),Ca.programs=va.length);q.program=$;var ua=$.getAttributes();if(d.morphTargets)for(var la=d.numSupportedMorphTargets=0;la<ja.maxMorphTargets;la++)0<=ua["morphTarget"+la]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(la= {name:d.type,uniforms:d.uniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader};for(var $,ea=0,ib=va.length;ea<ib;ea++){var Pa=va[ea];if(Pa.code===X){$=Pa;aa&&$.usedTimes++;break}}void 0===$&&(d.__webglShader=q.__webglShader,$=new THREE.WebGLProgram(ja,X,d,za),va.push($),Ca.programs=va.length);q.program=$;var ua=$.getAttributes();if(d.morphTargets)for(var la=d.numSupportedMorphTargets=0;la<ja.maxMorphTargets;la++)0<=ua["morphTarget"+la]&&d.numSupportedMorphTargets++;if(d.morphNormals)for(la=
d.numSupportedMorphNormals=0;la<ja.maxMorphNormals;la++)0<=ua["morphNormal"+la]&&d.numSupportedMorphNormals++;q.uniformsList=[];var Ia=q.program.getUniforms(),Aa;for(Aa in q.__webglShader.uniforms){var Ga=Ia[Aa];Ga&&q.uniformsList.push([q.__webglShader.uniforms[Aa],Ga])}}d.needsUpdate=!1}var Ha=!1,Ba=!1,ya=!1,Za=p.program,ca=Za.getUniforms(),I=p.__webglShader.uniforms;Za.id!==lb&&(s.useProgram(Za.program),lb=Za.id,ya=Ba=Ha=!0);d.id!==Xa&&(-1===Xa&&(ya=!0),Xa=d.id,Ba=!0);if(Ha||a!==Wa)s.uniformMatrix4fv(ca.projectionMatrix, d.numSupportedMorphNormals=0;la<ja.maxMorphNormals;la++)0<=ua["morphNormal"+la]&&d.numSupportedMorphNormals++;q.uniformsList=[];var Ia=q.program.getUniforms(),Aa;for(Aa in q.__webglShader.uniforms){var Ga=Ia[Aa];Ga&&q.uniformsList.push([q.__webglShader.uniforms[Aa],Ga])}}d.needsUpdate=!1}var Ha=!1,Ba=!1,ya=!1,Za=p.program,ca=Za.getUniforms(),I=p.__webglShader.uniforms;Za.id!==lb&&(s.useProgram(Za.program),lb=Za.id,ya=Ba=Ha=!0);d.id!==Xa&&(-1===Xa&&(ya=!0),Xa=d.id,Ba=!0);if(Ha||a!==Wa)s.uniformMatrix4fv(ca.projectionMatrix,
...@@ -517,17 +517,17 @@ break;case "4f":s.uniform4f(W,N[0],N[1],N[2],N[3]);break;case "1iv":s.uniform1iv ...@@ -517,17 +517,17 @@ break;case "4f":s.uniform4f(W,N[0],N[1],N[2],N[3]);break;case "1iv":s.uniform1iv
N.z);break;case "v4":s.uniform4f(W,N.x,N.y,N.z,N.w);break;case "c":s.uniform3f(W,N.r,N.g,N.b);break;case "iv1":s.uniform1iv(W,N);break;case "iv":s.uniform3iv(W,N);break;case "fv1":s.uniform1fv(W,N);break;case "fv":s.uniform3fv(W,N);break;case "v2v":void 0===V._array&&(V._array=new Float32Array(2*N.length));for(var S=0,oa=N.length;S<oa;S++)sa=2*S,V._array[sa+0]=N[S].x,V._array[sa+1]=N[S].y;s.uniform2fv(W,V._array);break;case "v3v":void 0===V._array&&(V._array=new Float32Array(3*N.length));S=0;for(oa= N.z);break;case "v4":s.uniform4f(W,N.x,N.y,N.z,N.w);break;case "c":s.uniform3f(W,N.r,N.g,N.b);break;case "iv1":s.uniform1iv(W,N);break;case "iv":s.uniform3iv(W,N);break;case "fv1":s.uniform1fv(W,N);break;case "fv":s.uniform3fv(W,N);break;case "v2v":void 0===V._array&&(V._array=new Float32Array(2*N.length));for(var S=0,oa=N.length;S<oa;S++)sa=2*S,V._array[sa+0]=N[S].x,V._array[sa+1]=N[S].y;s.uniform2fv(W,V._array);break;case "v3v":void 0===V._array&&(V._array=new Float32Array(3*N.length));S=0;for(oa=
N.length;S<oa;S++)sa=3*S,V._array[sa+0]=N[S].x,V._array[sa+1]=N[S].y,V._array[sa+2]=N[S].z;s.uniform3fv(W,V._array);break;case "v4v":void 0===V._array&&(V._array=new Float32Array(4*N.length));S=0;for(oa=N.length;S<oa;S++)sa=4*S,V._array[sa+0]=N[S].x,V._array[sa+1]=N[S].y,V._array[sa+2]=N[S].z,V._array[sa+3]=N[S].w;s.uniform4fv(W,V._array);break;case "m3":s.uniformMatrix3fv(W,!1,N.elements);break;case "m3v":void 0===V._array&&(V._array=new Float32Array(9*N.length));S=0;for(oa=N.length;S<oa;S++)N[S].flattenToArrayOffset(V._array, N.length;S<oa;S++)sa=3*S,V._array[sa+0]=N[S].x,V._array[sa+1]=N[S].y,V._array[sa+2]=N[S].z;s.uniform3fv(W,V._array);break;case "v4v":void 0===V._array&&(V._array=new Float32Array(4*N.length));S=0;for(oa=N.length;S<oa;S++)sa=4*S,V._array[sa+0]=N[S].x,V._array[sa+1]=N[S].y,V._array[sa+2]=N[S].z,V._array[sa+3]=N[S].w;s.uniform4fv(W,V._array);break;case "m3":s.uniformMatrix3fv(W,!1,N.elements);break;case "m3v":void 0===V._array&&(V._array=new Float32Array(9*N.length));S=0;for(oa=N.length;S<oa;S++)N[S].flattenToArrayOffset(V._array,
9*S);s.uniformMatrix3fv(W,!1,V._array);break;case "m4":s.uniformMatrix4fv(W,!1,N.elements);break;case "m4v":void 0===V._array&&(V._array=new Float32Array(16*N.length));S=0;for(oa=N.length;S<oa;S++)N[S].flattenToArrayOffset(V._array,16*S);s.uniformMatrix4fv(W,!1,V._array);break;case "t":ra=N;Ma=v();s.uniform1i(W,Ma);if(!ra)continue;if(ra instanceof THREE.CubeTexture||Array.isArray(ra.image)&&6===ra.image.length){var fa=ra,Wb=Ma,Va=Z.get(fa);if(6===fa.image.length)if(0<fa.version&&Va.__version!==fa.version){Va.__image__webglTextureCube|| 9*S);s.uniformMatrix3fv(W,!1,V._array);break;case "m4":s.uniformMatrix4fv(W,!1,N.elements);break;case "m4v":void 0===V._array&&(V._array=new Float32Array(16*N.length));S=0;for(oa=N.length;S<oa;S++)N[S].flattenToArrayOffset(V._array,16*S);s.uniformMatrix4fv(W,!1,V._array);break;case "t":ra=N;Ma=v();s.uniform1i(W,Ma);if(!ra)continue;if(ra instanceof THREE.CubeTexture||Array.isArray(ra.image)&&6===ra.image.length){var fa=ra,Wb=Ma,Va=Z.get(fa);if(6===fa.image.length)if(0<fa.version&&Va.__version!==fa.version){Va.__image__webglTextureCube||
(fa.addEventListener("dispose",g),Va.__image__webglTextureCube=s.createTexture(),Ca.textures++);L.activeTexture(s.TEXTURE0+Wb);L.bindTexture(s.TEXTURE_CUBE_MAP,Va.__image__webglTextureCube);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,fa.flipY);for(var Xb=fa instanceof THREE.CompressedTexture,Hb=fa.image[0]instanceof THREE.DataTexture,Na=[],ha=0;6>ha;ha++)Na[ha]=!ja.autoScaleCubemaps||Xb||Hb?Hb?fa.image[ha].image:fa.image[ha]:E(fa.image[ha],bc);var Yb=Na[0],Zb=THREE.Math.isPowerOfTwo(Yb.width)&&THREE.Math.isPowerOfTwo(Yb.height), (fa.addEventListener("dispose",g),Va.__image__webglTextureCube=s.createTexture(),Ca.textures++);M.activeTexture(s.TEXTURE0+Wb);M.bindTexture(s.TEXTURE_CUBE_MAP,Va.__image__webglTextureCube);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,fa.flipY);for(var Xb=fa instanceof THREE.CompressedTexture,Hb=fa.image[0]instanceof THREE.DataTexture,Na=[],ha=0;6>ha;ha++)Na[ha]=!ja.autoScaleCubemaps||Xb||Hb?Hb?fa.image[ha].image:fa.image[ha]:E(fa.image[ha],bc);var Yb=Na[0],Zb=THREE.Math.isPowerOfTwo(Yb.width)&&THREE.Math.isPowerOfTwo(Yb.height),
Fa=M(fa.format),Ib=M(fa.type);x(s.TEXTURE_CUBE_MAP,fa,Zb);for(ha=0;6>ha;ha++)if(Xb)for(var Oa,$b=Na[ha].mipmaps,cb=0,Pb=$b.length;cb<Pb;cb++)Oa=$b[cb],fa.format!==THREE.RGBAFormat&&fa.format!==THREE.RGBFormat?-1<L.getCompressedTextureFormats().indexOf(Fa)?L.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,cb,Fa,Oa.width,Oa.height,0,Oa.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):L.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ Fa=L(fa.format),Ib=L(fa.type);x(s.TEXTURE_CUBE_MAP,fa,Zb);for(ha=0;6>ha;ha++)if(Xb)for(var Oa,$b=Na[ha].mipmaps,cb=0,Pb=$b.length;cb<Pb;cb++)Oa=$b[cb],fa.format!==THREE.RGBAFormat&&fa.format!==THREE.RGBFormat?-1<M.getCompressedTextureFormats().indexOf(Fa)?M.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,cb,Fa,Oa.width,Oa.height,0,Oa.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):M.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+
ha,cb,Fa,Oa.width,Oa.height,0,Fa,Ib,Oa.data);else Hb?L.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Fa,Na[ha].width,Na[ha].height,0,Fa,Ib,Na[ha].data):L.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Fa,Fa,Ib,Na[ha]);fa.generateMipmaps&&Zb&&s.generateMipmap(s.TEXTURE_CUBE_MAP);Va.__version=fa.version;if(fa.onUpdate)fa.onUpdate(fa)}else L.activeTexture(s.TEXTURE0+Wb),L.bindTexture(s.TEXTURE_CUBE_MAP,Va.__image__webglTextureCube)}else if(ra instanceof THREE.WebGLRenderTargetCube){var cc=ra;L.activeTexture(s.TEXTURE0+ ha,cb,Fa,Oa.width,Oa.height,0,Fa,Ib,Oa.data);else Hb?M.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Fa,Na[ha].width,Na[ha].height,0,Fa,Ib,Na[ha].data):M.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+ha,0,Fa,Fa,Ib,Na[ha]);fa.generateMipmaps&&Zb&&s.generateMipmap(s.TEXTURE_CUBE_MAP);Va.__version=fa.version;if(fa.onUpdate)fa.onUpdate(fa)}else M.activeTexture(s.TEXTURE0+Wb),M.bindTexture(s.TEXTURE_CUBE_MAP,Va.__image__webglTextureCube)}else if(ra instanceof THREE.WebGLRenderTargetCube){var cc=ra;M.activeTexture(s.TEXTURE0+
Ma);L.bindTexture(s.TEXTURE_CUBE_MAP,Z.get(cc).__webglTexture)}else ja.setTexture(ra,Ma);break;case "tv":void 0===V._array&&(V._array=[]);S=0;for(oa=V.value.length;S<oa;S++)V._array[S]=v();s.uniform1iv(W,V._array);S=0;for(oa=V.value.length;S<oa;S++)ra=V.value[S],Ma=V._array[S],ra&&ja.setTexture(ra,Ma);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Vb)}}}}s.uniformMatrix4fv(ca.modelViewMatrix,!1,e._modelViewMatrix.elements);ca.normalMatrix&&s.uniformMatrix3fv(ca.normalMatrix, Ma);M.bindTexture(s.TEXTURE_CUBE_MAP,Z.get(cc).__webglTexture)}else ja.setTexture(ra,Ma);break;case "tv":void 0===V._array&&(V._array=[]);S=0;for(oa=V.value.length;S<oa;S++)V._array[S]=v();s.uniform1iv(W,V._array);S=0;for(oa=V.value.length;S<oa;S++)ra=V.value[S],Ma=V._array[S],ra&&ja.setTexture(ra,Ma);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+Vb)}}}}s.uniformMatrix4fv(ca.modelViewMatrix,!1,e._modelViewMatrix.elements);ca.normalMatrix&&s.uniformMatrix3fv(ca.normalMatrix,
!1,e._normalMatrix.elements);void 0!==ca.modelMatrix&&s.uniformMatrix4fv(ca.modelMatrix,!1,e.matrixWorld.elements);return Za}function w(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate= !1,e._normalMatrix.elements);void 0!==ca.modelMatrix&&s.uniformMatrix4fv(ca.modelMatrix,!1,e.matrixWorld.elements);return Za}function w(a,b){a.ambientLightColor.needsUpdate=b;a.directionalLightColor.needsUpdate=b;a.directionalLightDirection.needsUpdate=b;a.pointLightColor.needsUpdate=b;a.pointLightPosition.needsUpdate=b;a.pointLightDistance.needsUpdate=b;a.pointLightDecay.needsUpdate=b;a.spotLightColor.needsUpdate=b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=
b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function v(){var a=fb;a>=db&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+db);fb+=1;return a}function y(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function x(a,b,c){c?(s.texParameteri(a,s.TEXTURE_WRAP_S,M(b.wrapS)),s.texParameteri(a, b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.spotLightDecay.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function v(){var a=fb;a>=db&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+db);fb+=1;return a}function y(a,b,c,d){a[b+0]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function x(a,b,c){c?(s.texParameteri(a,s.TEXTURE_WRAP_S,L(b.wrapS)),s.texParameteri(a,
s.TEXTURE_WRAP_T,M(b.wrapT)),s.texParameteri(a,s.TEXTURE_MAG_FILTER,M(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,M(b.minFilter))):(s.texParameteri(a,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(a,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),s.texParameteri(a,s.TEXTURE_MAG_FILTER, s.TEXTURE_WRAP_T,L(b.wrapT)),s.texParameteri(a,s.TEXTURE_MAG_FILTER,L(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,L(b.minFilter))):(s.texParameteri(a,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(a,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),b.wrapS===THREE.ClampToEdgeWrapping&&b.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+b.sourceFile+" )"),s.texParameteri(a,s.TEXTURE_MAG_FILTER,
A(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,A(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=X.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||Z.get(b).__currentAnisotropy)&&(s.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT, A(b.magFilter)),s.texParameteri(a,s.TEXTURE_MIN_FILTER,A(b.minFilter)),b.minFilter!==THREE.NearestFilter&&b.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+b.sourceFile+" )"));(c=X.get("EXT_texture_filter_anisotropic"))&&b.type!==THREE.FloatType&&b.type!==THREE.HalfFloatType&&(1<b.anisotropy||Z.get(b).__currentAnisotropy)&&(s.texParameterf(a,c.TEXTURE_MAX_ANISOTROPY_EXT,
Math.min(b.anisotropy,ja.getMaxAnisotropy())),Z.get(b).__currentAnisotropy=b.anisotropy)}function E(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function B(a,b,c){s.bindFramebuffer(s.FRAMEBUFFER, Math.min(b.anisotropy,ja.getMaxAnisotropy())),Z.get(b).__currentAnisotropy=b.anisotropy)}function E(a,b){if(a.width>b||a.height>b){var c=b/Math.max(a.width,a.height),d=document.createElement("canvas");d.width=Math.floor(a.width*c);d.height=Math.floor(a.height*c);d.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+d.width+"x"+d.height,a);return d}return a}function B(a,b,c){s.bindFramebuffer(s.FRAMEBUFFER,
a);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,c,Z.get(b).__webglTexture,0)}function z(a,b){s.bindRenderbuffer(s.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER, a);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,c,Z.get(b).__webglTexture,0)}function z(a,b){s.bindRenderbuffer(s.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_COMPONENT16,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,a)):b.depthBuffer&&b.stencilBuffer?(s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,b.width,b.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,
a)):s.renderbufferStorage(s.RENDERBUFFER,s.RGBA4,b.width,b.height)}function A(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?s.NEAREST:s.LINEAR}function M(a){var b;if(a===THREE.RepeatWrapping)return s.REPEAT;if(a===THREE.ClampToEdgeWrapping)return s.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return s.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return s.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return s.NEAREST_MIPMAP_NEAREST; a)):s.renderbufferStorage(s.RENDERBUFFER,s.RGBA4,b.width,b.height)}function A(a){return a===THREE.NearestFilter||a===THREE.NearestMipMapNearestFilter||a===THREE.NearestMipMapLinearFilter?s.NEAREST:s.LINEAR}function L(a){var b;if(a===THREE.RepeatWrapping)return s.REPEAT;if(a===THREE.ClampToEdgeWrapping)return s.CLAMP_TO_EDGE;if(a===THREE.MirroredRepeatWrapping)return s.MIRRORED_REPEAT;if(a===THREE.NearestFilter)return s.NEAREST;if(a===THREE.NearestMipMapNearestFilter)return s.NEAREST_MIPMAP_NEAREST;
if(a===THREE.NearestMipMapLinearFilter)return s.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return s.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return s.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return s.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return s.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return s.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return s.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return s.UNSIGNED_SHORT_5_6_5; if(a===THREE.NearestMipMapLinearFilter)return s.NEAREST_MIPMAP_LINEAR;if(a===THREE.LinearFilter)return s.LINEAR;if(a===THREE.LinearMipMapNearestFilter)return s.LINEAR_MIPMAP_NEAREST;if(a===THREE.LinearMipMapLinearFilter)return s.LINEAR_MIPMAP_LINEAR;if(a===THREE.UnsignedByteType)return s.UNSIGNED_BYTE;if(a===THREE.UnsignedShort4444Type)return s.UNSIGNED_SHORT_4_4_4_4;if(a===THREE.UnsignedShort5551Type)return s.UNSIGNED_SHORT_5_5_5_1;if(a===THREE.UnsignedShort565Type)return s.UNSIGNED_SHORT_5_6_5;
if(a===THREE.ByteType)return s.BYTE;if(a===THREE.ShortType)return s.SHORT;if(a===THREE.UnsignedShortType)return s.UNSIGNED_SHORT;if(a===THREE.IntType)return s.INT;if(a===THREE.UnsignedIntType)return s.UNSIGNED_INT;if(a===THREE.FloatType)return s.FLOAT;b=X.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return s.ALPHA;if(a===THREE.RGBFormat)return s.RGB;if(a===THREE.RGBAFormat)return s.RGBA;if(a===THREE.LuminanceFormat)return s.LUMINANCE; if(a===THREE.ByteType)return s.BYTE;if(a===THREE.ShortType)return s.SHORT;if(a===THREE.UnsignedShortType)return s.UNSIGNED_SHORT;if(a===THREE.IntType)return s.INT;if(a===THREE.UnsignedIntType)return s.UNSIGNED_INT;if(a===THREE.FloatType)return s.FLOAT;b=X.get("OES_texture_half_float");if(null!==b&&a===THREE.HalfFloatType)return b.HALF_FLOAT_OES;if(a===THREE.AlphaFormat)return s.ALPHA;if(a===THREE.RGBFormat)return s.RGB;if(a===THREE.RGBAFormat)return s.RGBA;if(a===THREE.LuminanceFormat)return s.LUMINANCE;
if(a===THREE.LuminanceAlphaFormat)return s.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return s.FUNC_ADD;if(a===THREE.SubtractEquation)return s.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return s.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return s.ZERO;if(a===THREE.OneFactor)return s.ONE;if(a===THREE.SrcColorFactor)return s.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return s.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return s.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return s.ONE_MINUS_SRC_ALPHA; if(a===THREE.LuminanceAlphaFormat)return s.LUMINANCE_ALPHA;if(a===THREE.AddEquation)return s.FUNC_ADD;if(a===THREE.SubtractEquation)return s.FUNC_SUBTRACT;if(a===THREE.ReverseSubtractEquation)return s.FUNC_REVERSE_SUBTRACT;if(a===THREE.ZeroFactor)return s.ZERO;if(a===THREE.OneFactor)return s.ONE;if(a===THREE.SrcColorFactor)return s.SRC_COLOR;if(a===THREE.OneMinusSrcColorFactor)return s.ONE_MINUS_SRC_COLOR;if(a===THREE.SrcAlphaFactor)return s.SRC_ALPHA;if(a===THREE.OneMinusSrcAlphaFactor)return s.ONE_MINUS_SRC_ALPHA;
...@@ -537,32 +537,32 @@ if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRende ...@@ -537,32 +537,32 @@ if(a===THREE.MaxEquation)return b.MAX_EXT}return 0}console.log("THREE.WebGLRende
a.preserveDrawingBuffer:!1,F=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,$=new THREE.Color(0),ea=0,aa=[],pa=[],ta=[],ma=[],za=[],ib=new Float32Array(8),Pa=[],Ja=[];this.domElement=J;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;var ja=this,va=[],lb=null,ya=null,Xa=-1,Ia="",Wa=null,fb=0, a.preserveDrawingBuffer:!1,F=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,$=new THREE.Color(0),ea=0,aa=[],pa=[],ta=[],ma=[],za=[],ib=new Float32Array(8),Pa=[],Ja=[];this.domElement=J;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.gammaFactor=2;this.gammaOutput=this.gammaInput=!1;this.maxMorphTargets=8;this.maxMorphNormals=4;this.autoScaleCubemaps=!0;var ja=this,va=[],lb=null,ya=null,Xa=-1,Ia="",Wa=null,fb=0,
Aa=0,Ga=0,Ha=J.width,Ba=J.height,jb=0,kb=0,Ya=new THREE.Frustum,Qa=new THREE.Matrix4,ka=new THREE.Vector3,ga=new THREE.Vector3,eb=!0,Qb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},Ca={programs:0,geometries:0,textures:0},la={calls:0,vertices:0,faces:0,points:0}; Aa=0,Ga=0,Ha=J.width,Ba=J.height,jb=0,kb=0,Ya=new THREE.Frustum,Qa=new THREE.Matrix4,ka=new THREE.Vector3,ga=new THREE.Vector3,eb=!0,Qb={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},Ca={programs:0,geometries:0,textures:0},la={calls:0,vertices:0,faces:0,points:0};
this.info={render:la,memory:Ca,programs:va};var s;try{a={alpha:H,depth:O,stencil:Q,antialias:T,premultipliedAlpha:R,preserveDrawingBuffer:U};s=D||J.getContext("webgl",a)||J.getContext("experimental-webgl",a);if(null===s){if(null!==J.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}J.addEventListener("webglcontextlost",e,!1)}catch(Jb){console.error("THREE.WebGLRenderer: "+Jb)}var X=new THREE.WebGLExtensions(s);X.get("OES_texture_float"); this.info={render:la,memory:Ca,programs:va};var s;try{a={alpha:H,depth:O,stencil:Q,antialias:T,premultipliedAlpha:R,preserveDrawingBuffer:U};s=D||J.getContext("webgl",a)||J.getContext("experimental-webgl",a);if(null===s){if(null!==J.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context.";}J.addEventListener("webglcontextlost",e,!1)}catch(Jb){console.error("THREE.WebGLRenderer: "+Jb)}var X=new THREE.WebGLExtensions(s);X.get("OES_texture_float");
X.get("OES_texture_float_linear");X.get("OES_texture_half_float");X.get("OES_texture_half_float_linear");X.get("OES_standard_derivatives");X.get("ANGLE_instanced_arrays");X.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);F&&X.get("EXT_frag_depth");var L=new THREE.WebGLState(s,X,M),Z=new THREE.WebGLProperties,ua=new THREE.WebGLObjects(s,Z,this.info),Kb=new THREE.WebGLBufferRenderer(s,X,la),Lb=new THREE.WebGLIndexedBufferRenderer(s,X,la);c();this.context=s;this.extensions= X.get("OES_texture_float_linear");X.get("OES_texture_half_float");X.get("OES_texture_half_float_linear");X.get("OES_standard_derivatives");X.get("ANGLE_instanced_arrays");X.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);F&&X.get("EXT_frag_depth");var M=new THREE.WebGLState(s,X,L),Z=new THREE.WebGLProperties,ua=new THREE.WebGLObjects(s,Z,this.info),Kb=new THREE.WebGLBufferRenderer(s,X,la),Lb=new THREE.WebGLIndexedBufferRenderer(s,X,la);c();this.context=s;this.extensions=
X;this.state=L;var na=new THREE.WebGLShadowMap(this,aa,ua);this.shadowMap=na;var db=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),D=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Mb=s.getParameter(s.MAX_TEXTURE_SIZE),bc=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),nb=0<D,mb=nb&&X.get("OES_texture_float"),Nb=X.get("ANGLE_instanced_arrays"),D=L.getMaxPrecision(G);D!==G&&(console.warn("THREE.WebGLRenderer:",G,"not supported, using",D,"instead."),G=D);var Ob=new THREE.SpritePlugin(this,Pa),Pb=new THREE.LensFlarePlugin(this, X;this.state=M;var na=new THREE.WebGLShadowMap(this,aa,ua);this.shadowMap=na;var db=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),D=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Mb=s.getParameter(s.MAX_TEXTURE_SIZE),bc=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),nb=0<D,mb=nb&&X.get("OES_texture_float"),Nb=X.get("ANGLE_instanced_arrays"),D=M.getMaxPrecision(G);D!==G&&(console.warn("THREE.WebGLRenderer:",G,"not supported, using",D,"instead."),G=D);var Ob=new THREE.SpritePlugin(this,Pa),Pb=new THREE.LensFlarePlugin(this,
Ja);this.getContext=function(){return s};this.getContextAttributes=function(){return s.getContextAttributes()};this.forceContextLoss=function(){X.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return nb};this.supportsInstancedArrays=function(){return Nb};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=X.get("EXT_texture_filter_anisotropic");return a=null!==b?s.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision= Ja);this.getContext=function(){return s};this.getContextAttributes=function(){return s.getContextAttributes()};this.forceContextLoss=function(){X.get("WEBGL_lose_context").loseContext()};this.supportsVertexTextures=function(){return nb};this.supportsInstancedArrays=function(){return Nb};this.getMaxAnisotropy=function(){var a;return function(){if(void 0!==a)return a;var b=X.get("EXT_texture_filter_anisotropic");return a=null!==b?s.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}();this.getPrecision=
function(){return G};this.getPixelRatio=function(){return C};this.setPixelRatio=function(a){void 0!==a&&(C=a)};this.getSize=function(){return{width:P,height:K}};this.setSize=function(a,b,c){P=a;K=b;J.width=a*C;J.height=b*C;!1!==c&&(J.style.width=a+"px",J.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Aa=a*C;Ga=b*C;Ha=c*C;Ba=d*C;s.viewport(Aa,Ga,Ha,Ba)};this.setScissor=function(a,b,c,d){s.scissor(a*C,b*C,c*C,d*C)};this.enableScissorTest=function(a){L.setScissorTest(a)}; function(){return G};this.getPixelRatio=function(){return C};this.setPixelRatio=function(a){void 0!==a&&(C=a)};this.getSize=function(){return{width:P,height:K}};this.setSize=function(a,b,c){P=a;K=b;J.width=a*C;J.height=b*C;!1!==c&&(J.style.width=a+"px",J.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Aa=a*C;Ga=b*C;Ha=c*C;Ba=d*C;s.viewport(Aa,Ga,Ha,Ba)};this.setScissor=function(a,b,c,d){s.scissor(a*C,b*C,c*C,d*C)};this.enableScissorTest=function(a){M.setScissorTest(a)};
this.getClearColor=function(){return $};this.setClearColor=function(a,c){$.set(a);ea=void 0!==c?c:1;b($.r,$.g,$.b,ea)};this.getClearAlpha=function(){return ea};this.setClearAlpha=function(a){ea=a;b($.r,$.g,$.b,ea)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=s.COLOR_BUFFER_BIT;if(void 0===b||b)d|=s.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=s.STENCIL_BUFFER_BIT;s.clear(d)};this.clearColor=function(){s.clear(s.COLOR_BUFFER_BIT)};this.clearDepth=function(){s.clear(s.DEPTH_BUFFER_BIT)};this.clearStencil= this.getClearColor=function(){return $};this.setClearColor=function(a,c){$.set(a);ea=void 0!==c?c:1;b($.r,$.g,$.b,ea)};this.getClearAlpha=function(){return ea};this.setClearAlpha=function(a){ea=a;b($.r,$.g,$.b,ea)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=s.COLOR_BUFFER_BIT;if(void 0===b||b)d|=s.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=s.STENCIL_BUFFER_BIT;s.clear(d)};this.clearColor=function(){s.clear(s.COLOR_BUFFER_BIT)};this.clearDepth=function(){s.clear(s.DEPTH_BUFFER_BIT)};this.clearStencil=
function(){s.clear(s.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){J.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){L.initAttributes();var d=Z.get(a);a.hasPositions&&!d.position&&(d.position=s.createBuffer());a.hasNormals&&!d.normal&&(d.normal=s.createBuffer());a.hasUvs&&!d.uv&&(d.uv=s.createBuffer());a.hasColors&&!d.color&&(d.color=s.createBuffer());b=b.getAttributes(); function(){s.clear(s.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.resetGLState=d;this.dispose=function(){J.removeEventListener("webglcontextlost",e,!1)};this.renderBufferImmediate=function(a,b,c){M.initAttributes();var d=Z.get(a);a.hasPositions&&!d.position&&(d.position=s.createBuffer());a.hasNormals&&!d.normal&&(d.normal=s.createBuffer());a.hasUvs&&!d.uv&&(d.uv=s.createBuffer());a.hasColors&&!d.color&&(d.color=s.createBuffer());b=b.getAttributes();
a.hasPositions&&(s.bindBuffer(s.ARRAY_BUFFER,d.position),s.bufferData(s.ARRAY_BUFFER,a.positionArray,s.DYNAMIC_DRAW),L.enableAttribute(b.position),s.vertexAttribPointer(b.position,3,s.FLOAT,!1,0,0));if(a.hasNormals){s.bindBuffer(s.ARRAY_BUFFER,d.normal);if("MeshPhongMaterial"!==c.type&&c.shading===THREE.FlatShading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,k=(g[e+1]+g[e+4]+g[e+7])/3,l=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=k;g[e+2]=l;g[e+3]=h;g[e+4]=k;g[e+ a.hasPositions&&(s.bindBuffer(s.ARRAY_BUFFER,d.position),s.bufferData(s.ARRAY_BUFFER,a.positionArray,s.DYNAMIC_DRAW),M.enableAttribute(b.position),s.vertexAttribPointer(b.position,3,s.FLOAT,!1,0,0));if(a.hasNormals){s.bindBuffer(s.ARRAY_BUFFER,d.normal);if("MeshPhongMaterial"!==c.type&&c.shading===THREE.FlatShading)for(var e=0,f=3*a.count;e<f;e+=9){var g=a.normalArray,h=(g[e+0]+g[e+3]+g[e+6])/3,k=(g[e+1]+g[e+4]+g[e+7])/3,l=(g[e+2]+g[e+5]+g[e+8])/3;g[e+0]=h;g[e+1]=k;g[e+2]=l;g[e+3]=h;g[e+4]=k;g[e+
5]=l;g[e+6]=h;g[e+7]=k;g[e+8]=l}s.bufferData(s.ARRAY_BUFFER,a.normalArray,s.DYNAMIC_DRAW);L.enableAttribute(b.normal);s.vertexAttribPointer(b.normal,3,s.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(s.bindBuffer(s.ARRAY_BUFFER,d.uv),s.bufferData(s.ARRAY_BUFFER,a.uvArray,s.DYNAMIC_DRAW),L.enableAttribute(b.uv),s.vertexAttribPointer(b.uv,2,s.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(s.bindBuffer(s.ARRAY_BUFFER,d.color),s.bufferData(s.ARRAY_BUFFER,a.colorArray,s.DYNAMIC_DRAW),L.enableAttribute(b.color), 5]=l;g[e+6]=h;g[e+7]=k;g[e+8]=l}s.bufferData(s.ARRAY_BUFFER,a.normalArray,s.DYNAMIC_DRAW);M.enableAttribute(b.normal);s.vertexAttribPointer(b.normal,3,s.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(s.bindBuffer(s.ARRAY_BUFFER,d.uv),s.bufferData(s.ARRAY_BUFFER,a.uvArray,s.DYNAMIC_DRAW),M.enableAttribute(b.uv),s.vertexAttribPointer(b.uv,2,s.FLOAT,!1,0,0));a.hasColors&&c.vertexColors!==THREE.NoColors&&(s.bindBuffer(s.ARRAY_BUFFER,d.color),s.bufferData(s.ARRAY_BUFFER,a.colorArray,s.DYNAMIC_DRAW),M.enableAttribute(b.color),
s.vertexAttribPointer(b.color,3,s.FLOAT,!1,0,0));L.disableUnusedAttributes();s.drawArrays(s.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){r(e);var g=u(a,b,c,e,f),h=!1;a=d.id+"_"+g.id+"_"+e.wireframe;a!==Ia&&(Ia=a,h=!0);a=f.morphTargetInfluences;if(void 0!==a){b=[];c=0;for(var k=a.length;c<k;c++)h=a[c],b.push([h,c]);b.sort(l);8<b.length&&(b.length=8);var m=d.morphAttributes;c=0;for(k=b.length;c<k;c++)h=b[c],ib[c]=h[0],0!==h[0]?(a=h[1],!0===e.morphTargets&&d.addAttribute("morphTarget"+ s.vertexAttribPointer(b.color,3,s.FLOAT,!1,0,0));M.disableUnusedAttributes();s.drawArrays(s.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){r(e);var g=u(a,b,c,e,f),h=!1;a=d.id+"_"+g.id+"_"+e.wireframe;a!==Ia&&(Ia=a,h=!0);a=f.morphTargetInfluences;if(void 0!==a){b=[];c=0;for(var k=a.length;c<k;c++)h=a[c],b.push([h,c]);b.sort(l);8<b.length&&(b.length=8);var m=d.morphAttributes;c=0;for(k=b.length;c<k;c++)h=b[c],ib[c]=h[0],0!==h[0]?(a=h[1],!0===e.morphTargets&&d.addAttribute("morphTarget"+
c,m.position[a]),!0===e.morphNormals&&d.addAttribute("morphNormal"+c,m.normal[a])):(!0===e.morphTargets&&d.removeAttribute("morphTarget"+c),!0===e.morphNormals&&d.removeAttribute("morphNormal"+c));a=g.getUniforms();null!==a.morphTargetInfluences&&s.uniform1fv(a.morphTargetInfluences,ib);h=!0}a=d.attributes.index;k=d.attributes.position;!0===e.wireframe&&(a=ua.getWireframeAttribute(d));b=d.drawcalls;void 0!==a?(c=Lb,c.setIndex(a)):c=Kb;if(h){a:{var h=void 0,n;if(d instanceof THREE.InstancedBufferGeometry&& c,m.position[a]),!0===e.morphNormals&&d.addAttribute("morphNormal"+c,m.normal[a])):(!0===e.morphTargets&&d.removeAttribute("morphTarget"+c),!0===e.morphNormals&&d.removeAttribute("morphNormal"+c));a=g.getUniforms();null!==a.morphTargetInfluences&&s.uniform1fv(a.morphTargetInfluences,ib);h=!0}a=d.attributes.index;k=d.attributes.position;!0===e.wireframe&&(a=ua.getWireframeAttribute(d));b=d.drawcalls;void 0!==a?(c=Lb,c.setIndex(a)):c=Kb;if(h){a:{var h=void 0,n;if(d instanceof THREE.InstancedBufferGeometry&&
(n=X.get("ANGLE_instanced_arrays"),null===n)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===h&&(h=0);L.initAttributes();var m=d.attributes,g=g.getAttributes(),p=e.defaultAttributeValues,q;for(q in g){var t=g[q];if(0<=t){var v=m[q];if(void 0!==v){L.enableAttribute(t);var w=v.itemSize,x=ua.getAttributeBuffer(v);if(v instanceof THREE.InterleavedBufferAttribute){var y=v.data, (n=X.get("ANGLE_instanced_arrays"),null===n)){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");break a}void 0===h&&(h=0);M.initAttributes();var m=d.attributes,g=g.getAttributes(),q=e.defaultAttributeValues,p;for(p in g){var t=g[p];if(0<=t){var v=m[p];if(void 0!==v){M.enableAttribute(t);var w=v.itemSize,x=ua.getAttributeBuffer(v);if(v instanceof THREE.InterleavedBufferAttribute){var y=v.data,
z=y.stride,v=v.offset;s.bindBuffer(s.ARRAY_BUFFER,x);s.vertexAttribPointer(t,w,s.FLOAT,!1,z*y.array.BYTES_PER_ELEMENT,(h*z+v)*y.array.BYTES_PER_ELEMENT);if(y instanceof THREE.InstancedInterleavedBuffer){if(null===n){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");break a}n.vertexAttribDivisorANGLE(t,y.meshPerAttribute);void 0===d.maxInstancedCount&&(d.maxInstancedCount=y.meshPerAttribute* L=y.stride,v=v.offset;s.bindBuffer(s.ARRAY_BUFFER,x);s.vertexAttribPointer(t,w,s.FLOAT,!1,L*y.array.BYTES_PER_ELEMENT,(h*L+v)*y.array.BYTES_PER_ELEMENT);if(y instanceof THREE.InstancedInterleavedBuffer){if(null===n){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");break a}n.vertexAttribDivisorANGLE(t,y.meshPerAttribute);void 0===d.maxInstancedCount&&(d.maxInstancedCount=y.meshPerAttribute*
y.count)}}else if(s.bindBuffer(s.ARRAY_BUFFER,x),s.vertexAttribPointer(t,w,s.FLOAT,!1,0,h*w*4),v instanceof THREE.InstancedBufferAttribute){if(null===n){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");break a}n.vertexAttribDivisorANGLE(t,v.meshPerAttribute);void 0===d.maxInstancedCount&&(d.maxInstancedCount=v.meshPerAttribute*v.count)}}else if(void 0!==p&&(w=p[q],void 0!==w))switch(w.length){case 2:s.vertexAttrib2fv(t, y.count)}}else if(s.bindBuffer(s.ARRAY_BUFFER,x),s.vertexAttribPointer(t,w,s.FLOAT,!1,0,h*w*4),v instanceof THREE.InstancedBufferAttribute){if(null===n){console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferAttribute but hardware does not support extension ANGLE_instanced_arrays.");break a}n.vertexAttribDivisorANGLE(t,v.meshPerAttribute);void 0===d.maxInstancedCount&&(d.maxInstancedCount=v.meshPerAttribute*v.count)}}else if(void 0!==q&&(w=q[p],void 0!==w))switch(w.length){case 2:s.vertexAttrib2fv(t,
w);break;case 3:s.vertexAttrib3fv(t,w);break;case 4:s.vertexAttrib4fv(t,w);break;default:s.vertexAttrib1fv(t,w)}}}L.disableUnusedAttributes()}void 0!==a&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,ua.getAttributeBuffer(a))}0===b.length&&(b=[{start:0,count:void 0!==a?a.array.length:k instanceof THREE.InterleavedBufferAttribute?k.data.array.length/3:k.array.length/3}]);f instanceof THREE.Mesh?(!0===e.wireframe?(L.setLineWidth(e.wireframeLinewidth*C),c.setMode(s.LINES)):c.setMode(s.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&& w);break;case 3:s.vertexAttrib3fv(t,w);break;case 4:s.vertexAttrib4fv(t,w);break;default:s.vertexAttrib1fv(t,w)}}}M.disableUnusedAttributes()}void 0!==a&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,ua.getAttributeBuffer(a))}0===b.length&&(b=[{start:0,count:void 0!==a?a.array.length:k instanceof THREE.InterleavedBufferAttribute?k.data.array.length/3:k.array.length/3}]);f instanceof THREE.Mesh?(!0===e.wireframe?(M.setLineWidth(e.wireframeLinewidth*C),c.setMode(s.LINES)):c.setMode(s.TRIANGLES),d instanceof THREE.InstancedBufferGeometry&&
0<d.maxInstancedCount?c.renderInstances(d):k instanceof THREE.InterleavedBufferAttribute?c.render(0,k.data.count):c.renderGroups(b)):f instanceof THREE.Line?(d=e.linewidth,void 0===d&&(d=1),L.setLineWidth(d*C),f instanceof THREE.LineSegments?c.setMode(s.LINES):c.setMode(s.LINE_STRIP),c.renderGroups(b)):f instanceof THREE.PointCloud&&(c.setMode(s.POINTS),c.renderGroups(b))};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."); 0<d.maxInstancedCount?c.renderInstances(d):k instanceof THREE.InterleavedBufferAttribute?c.render(0,k.data.count):c.renderGroups(b)):f instanceof THREE.Line?(d=e.linewidth,void 0===d&&(d=1),M.setLineWidth(d*C),f instanceof THREE.LineSegments?c.setMode(s.LINES):c.setMode(s.LINE_STRIP),c.renderGroups(b)):f instanceof THREE.PointCloud&&(c.setMode(s.POINTS),c.renderGroups(b))};this.render=function(a,b,c,d){if(!1===b instanceof THREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
else{var e=a.fog;Ia="";Xa=-1;Wa=null;eb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Qa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ya.setFromMatrix(Qa);aa.length=0;pa.length=0;ta.length=0;ma.length=0;za.length=0;Pa.length=0;Ja.length=0;m(a);!0===ja.sortObjects&&(pa.sort(n),ta.sort(p));na.render(a,b);la.calls=0;la.vertices=0;la.faces=0;la.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor, else{var e=a.fog;Ia="";Xa=-1;Wa=null;eb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();b.matrixWorldInverse.getInverse(b.matrixWorld);Qa.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Ya.setFromMatrix(Qa);aa.length=0;pa.length=0;ta.length=0;ma.length=0;za.length=0;Pa.length=0;Ja.length=0;m(a);!0===ja.sortObjects&&(pa.sort(n),ta.sort(p));na.render(a,b);la.calls=0;la.vertices=0;la.faces=0;la.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,
this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,q(pa,b,aa,e,d),q(ta,b,aa,e,d),t(ma,b,aa,e,d),t(za,b,aa,e,d)):(L.setBlending(THREE.NoBlending),q(pa,b,aa,e),t(ma,b,aa,e),q(ta,b,aa,e),t(za,b,aa,e));Ob.render(a,b);Pb.render(a,b,jb,kb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(L.bindTexture(s.TEXTURE_CUBE_MAP,Z.get(c).__webglTexture),s.generateMipmap(s.TEXTURE_CUBE_MAP),L.bindTexture(s.TEXTURE_CUBE_MAP, this.autoClearDepth,this.autoClearStencil);a.overrideMaterial?(d=a.overrideMaterial,q(pa,b,aa,e,d),q(ta,b,aa,e,d),t(ma,b,aa,e,d),t(za,b,aa,e,d)):(M.setBlending(THREE.NoBlending),q(pa,b,aa,e),t(ma,b,aa,e),q(ta,b,aa,e),t(za,b,aa,e));Ob.render(a,b);Pb.render(a,b,jb,kb);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&(c instanceof THREE.WebGLRenderTargetCube?(M.bindTexture(s.TEXTURE_CUBE_MAP,Z.get(c).__webglTexture),s.generateMipmap(s.TEXTURE_CUBE_MAP),M.bindTexture(s.TEXTURE_CUBE_MAP,
null)):(L.bindTexture(s.TEXTURE_2D,Z.get(c).__webglTexture),s.generateMipmap(s.TEXTURE_2D),L.bindTexture(s.TEXTURE_2D,null)));L.setDepthTest(!0);L.setDepthWrite(!0);L.setColorWrite(!0)}};var ac={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?L.disable(s.CULL_FACE): null)):(M.bindTexture(s.TEXTURE_2D,Z.get(c).__webglTexture),s.generateMipmap(s.TEXTURE_2D),M.bindTexture(s.TEXTURE_2D,null)));M.setDepthTest(!0);M.setDepthWrite(!0);M.setColorWrite(!0)}};var ac={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?M.disable(s.CULL_FACE):
(b===THREE.FrontFaceDirectionCW?s.frontFace(s.CW):s.frontFace(s.CCW),a===THREE.CullFaceBack?s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),L.enable(s.CULL_FACE))};this.setTexture=function(a,b){var c=Z.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", (b===THREE.FrontFaceDirectionCW?s.frontFace(s.CW):s.frontFace(s.CCW),a===THREE.CullFaceBack?s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),M.enable(s.CULL_FACE))};this.setTexture=function(a,b){var c=Z.get(a);if(0<a.version&&c.__version!==a.version){var d=a.image;if(void 0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);else if(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",
a);else{void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",g),c.__webglTexture=s.createTexture(),Ca.textures++);L.activeTexture(s.TEXTURE0+b);L.bindTexture(s.TEXTURE_2D,c.__webglTexture);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,a.flipY);s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);s.pixelStorei(s.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=E(a.image,Mb);var e=a.image,d=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),f=M(a.format), a);else{void 0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",g),c.__webglTexture=s.createTexture(),Ca.textures++);M.activeTexture(s.TEXTURE0+b);M.bindTexture(s.TEXTURE_2D,c.__webglTexture);s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,a.flipY);s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha);s.pixelStorei(s.UNPACK_ALIGNMENT,a.unpackAlignment);a.image=E(a.image,Mb);var e=a.image,d=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),f=L(a.format),
h=M(a.type);x(s.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var l=0,m=k.length;l<m;l++)e=k[l],L.texImage2D(s.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}else L.texImage2D(s.TEXTURE_2D,0,f,e.width,e.height,0,f,h,e.data);else if(a instanceof THREE.CompressedTexture)for(l=0,m=k.length;l<m;l++)e=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<L.getCompressedTextureFormats().indexOf(f)?L.compressedTexImage2D(s.TEXTURE_2D, h=L(a.type);x(s.TEXTURE_2D,a,d);var k=a.mipmaps;if(a instanceof THREE.DataTexture)if(0<k.length&&d){for(var l=0,m=k.length;l<m;l++)e=k[l],M.texImage2D(s.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}else M.texImage2D(s.TEXTURE_2D,0,f,e.width,e.height,0,f,h,e.data);else if(a instanceof THREE.CompressedTexture)for(l=0,m=k.length;l<m;l++)e=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<M.getCompressedTextureFormats().indexOf(f)?M.compressedTexImage2D(s.TEXTURE_2D,
l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):L.texImage2D(s.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);else if(0<k.length&&d){l=0;for(m=k.length;l<m;l++)e=k[l],L.texImage2D(s.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}else L.texImage2D(s.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else L.activeTexture(s.TEXTURE0+ l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):M.texImage2D(s.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);else if(0<k.length&&d){l=0;for(m=k.length;l<m;l++)e=k[l],M.texImage2D(s.TEXTURE_2D,l,f,f,h,e);a.generateMipmaps=!1}else M.texImage2D(s.TEXTURE_2D,0,f,f,h,a.image);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);c.__version=a.version;if(a.onUpdate)a.onUpdate(a)}}else M.activeTexture(s.TEXTURE0+
b),L.bindTexture(s.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===Z.get(a).__webglFramebuffer){var c=Z.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",f);c.__webglTexture=s.createTexture();Ca.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),e=M(a.format),g=M(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer= b),M.bindTexture(s.TEXTURE_2D,c.__webglTexture)};this.setRenderTarget=function(a){var b=a instanceof THREE.WebGLRenderTargetCube;if(a&&void 0===Z.get(a).__webglFramebuffer){var c=Z.get(a);void 0===a.depthBuffer&&(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",f);c.__webglTexture=s.createTexture();Ca.textures++;var d=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),e=L(a.format),g=L(a.type);if(b){c.__webglFramebuffer=[];c.__webglRenderbuffer=
[];L.bindTexture(s.TEXTURE_CUBE_MAP,c.__webglTexture);x(s.TEXTURE_CUBE_MAP,a,d);for(var h=0;6>h;h++)c.__webglFramebuffer[h]=s.createFramebuffer(),c.__webglRenderbuffer[h]=s.createRenderbuffer(),L.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,e,a.width,a.height,0,e,g,null),B(c.__webglFramebuffer[h],a,s.TEXTURE_CUBE_MAP_POSITIVE_X+h),z(c.__webglRenderbuffer[h],a);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=s.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom? [];M.bindTexture(s.TEXTURE_CUBE_MAP,c.__webglTexture);x(s.TEXTURE_CUBE_MAP,a,d);for(var h=0;6>h;h++)c.__webglFramebuffer[h]=s.createFramebuffer(),c.__webglRenderbuffer[h]=s.createRenderbuffer(),M.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+h,0,e,a.width,a.height,0,e,g,null),B(c.__webglFramebuffer[h],a,s.TEXTURE_CUBE_MAP_POSITIVE_X+h),z(c.__webglRenderbuffer[h],a);a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_CUBE_MAP)}else c.__webglFramebuffer=s.createFramebuffer(),c.__webglRenderbuffer=a.shareDepthFrom?
a.shareDepthFrom.__webglRenderbuffer:s.createRenderbuffer(),L.bindTexture(s.TEXTURE_2D,c.__webglTexture),x(s.TEXTURE_2D,a,d),L.texImage2D(s.TEXTURE_2D,0,e,a.width,a.height,0,e,g,null),B(c.__webglFramebuffer,a,s.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer): a.shareDepthFrom.__webglRenderbuffer:s.createRenderbuffer(),M.bindTexture(s.TEXTURE_2D,c.__webglTexture),x(s.TEXTURE_2D,a,d),M.texImage2D(s.TEXTURE_2D,0,e,a.width,a.height,0,e,g,null),B(c.__webglFramebuffer,a,s.TEXTURE_2D),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,c.__webglRenderbuffer):
z(c.__webglRenderbuffer,a),a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);b?L.bindTexture(s.TEXTURE_CUBE_MAP,null):L.bindTexture(s.TEXTURE_2D,null);s.bindRenderbuffer(s.RENDERBUFFER,null);s.bindFramebuffer(s.FRAMEBUFFER,null)}a?(c=Z.get(a),b=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Ha,a=Ba,d=Aa,e=Ga);b!==ya&&(s.bindFramebuffer(s.FRAMEBUFFER,b),s.viewport(d,e,c,a),ya=b);jb=c;kb=a};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof z(c.__webglRenderbuffer,a),a.generateMipmaps&&d&&s.generateMipmap(s.TEXTURE_2D);b?M.bindTexture(s.TEXTURE_CUBE_MAP,null):M.bindTexture(s.TEXTURE_2D,null);s.bindRenderbuffer(s.RENDERBUFFER,null);s.bindFramebuffer(s.FRAMEBUFFER,null)}a?(c=Z.get(a),b=b?c.__webglFramebuffer[a.activeCubeFace]:c.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=Ha,a=Ba,d=Aa,e=Ga);b!==ya&&(s.bindFramebuffer(s.FRAMEBUFFER,b),s.viewport(d,e,c,a),ya=b);jb=c;kb=a};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(!(a instanceof
THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(Z.get(a).__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;Z.get(a).__webglFramebuffer!==ya&&(s.bindFramebuffer(s.FRAMEBUFFER,Z.get(a).__webglFramebuffer),g=!0);s.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE? THREE.WebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else if(Z.get(a).__webglFramebuffer)if(a.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var g=!1;Z.get(a).__webglFramebuffer!==ya&&(s.bindFramebuffer(s.FRAMEBUFFER,Z.get(a).__webglFramebuffer),g=!0);s.checkFramebufferStatus(s.FRAMEBUFFER)===s.FRAMEBUFFER_COMPLETE?
s.readPixels(b,c,d,e,s.RGBA,s.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&s.bindFramebuffer(s.FRAMEBUFFER,ya)}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");return X.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."); s.readPixels(b,c,d,e,s.RGBA,s.UNSIGNED_BYTE,f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");g&&s.bindFramebuffer(s.FRAMEBUFFER,ya)}};this.supportsFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");return X.get("OES_texture_float")};this.supportsHalfFloatTextures=function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");
return X.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");return X.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");return X.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC= return X.get("OES_texture_half_float")};this.supportsStandardDerivatives=function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");return X.get("OES_standard_derivatives")};this.supportsCompressedTextureS3TC=function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");return X.get("WEBGL_compressed_texture_s3tc")};this.supportsCompressedTexturePVRTC=
...@@ -582,12 +582,12 @@ THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c] ...@@ -582,12 +582,12 @@ THREE.WebGLExtensions=function(a){var b={};this.get=function(c){if(void 0!==b[c]
break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}}; break;case "WEBGL_compressed_texture_pvrtc":d=a.getExtension("WEBGL_compressed_texture_pvrtc")||a.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=a.getExtension(c)}null===d&&console.warn("THREE.WebGLRenderer: "+c+" extension not supported.");return b[c]=d}};
THREE.WebGLGeometries=function(a,b,c){function d(g){g=g.target;var f=e[g.id].attributes,h;for(h in f){var k=f[h],l;l=k;l=l instanceof THREE.InterleavedBufferAttribute?b.get(l.data).__webglBuffer:b.get(l).__webglBuffer;void 0!==l&&(a.deleteBuffer(l),k instanceof THREE.InterleavedBufferAttribute?b.delete(k.data):b.delete(k))}g.removeEventListener("dispose",d);delete e[g.id];c.memory.geometries--}var e={};this.get=function(a){var b=a.geometry;if(void 0!==e[b.id])return e[b.id];b.addEventListener("dispose", THREE.WebGLGeometries=function(a,b,c){function d(g){g=g.target;var f=e[g.id].attributes,h;for(h in f){var k=f[h],l;l=k;l=l instanceof THREE.InterleavedBufferAttribute?b.get(l.data).__webglBuffer:b.get(l).__webglBuffer;void 0!==l&&(a.deleteBuffer(l),k instanceof THREE.InterleavedBufferAttribute?b.delete(k.data):b.delete(k))}g.removeEventListener("dispose",d);delete e[g.id];c.memory.geometries--}var e={};this.get=function(a){var b=a.geometry;if(void 0!==e[b.id])return e[b.id];b.addEventListener("dispose",
d);var h;b instanceof THREE.BufferGeometry?h=b:b instanceof THREE.Geometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new THREE.BufferGeometry).setFromObject(a)),h=b._bufferGeometry);e[b.id]=h;c.memory.geometries++;return h}}; d);var h;b instanceof THREE.BufferGeometry?h=b:b instanceof THREE.Geometry&&(void 0===b._bufferGeometry&&(b._bufferGeometry=(new THREE.BufferGeometry).setFromObject(a)),h=b._bufferGeometry);e[b.id]=h;c.memory.geometries++;return h}};
THREE.WebGLObjects=function(a,b,c){function d(a){a.target.traverse(function(a){a.removeEventListener("remove",d);(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)&&delete f[a.id];delete a._modelViewMatrix;delete a._normalMatrix;b.delete(a)})}function e(c,d){var e="index"===d?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER,f=c instanceof THREE.InterleavedBufferAttribute?c.data:c,g=b.get(f);if(void 0===g.__webglBuffer){g.__webglBuffer=a.createBuffer();a.bindBuffer(e,g.__webglBuffer); THREE.WebGLObjects=function(a,b,c){function d(a){a.target.traverse(function(a){a.removeEventListener("remove",d);(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)&&delete f[a.id];delete a._modelViewMatrix;delete a._normalMatrix;b.delete(a)})}function e(c){var d;d=c instanceof THREE.IndexBufferAttribute?a.ELEMENT_ARRAY_BUFFER:a.ARRAY_BUFFER;c=c instanceof THREE.InterleavedBufferAttribute?c.data:c;var e=b.get(c);if(void 0===e.__webglBuffer){e.__webglBuffer=a.createBuffer();
var h=a.STATIC_DRAW;if(f instanceof THREE.DynamicBufferAttribute||f instanceof THREE.InstancedBufferAttribute&&!0===f.dynamic||f instanceof THREE.InterleavedBuffer&&!0===f.dynamic)h=a.DYNAMIC_DRAW;a.bufferData(e,f.array,h);g.version=f.version}else g.version!==f.version&&(a.bindBuffer(e,g.__webglBuffer),void 0===f.updateRange||-1===f.updateRange.count?a.bufferSubData(e,0,f.array):0===f.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."): a.bindBuffer(d,e.__webglBuffer);var f=a.STATIC_DRAW;if(c instanceof THREE.DynamicBufferAttribute||c instanceof THREE.InstancedBufferAttribute&&!0===c.dynamic||c instanceof THREE.InterleavedBuffer&&!0===c.dynamic)f=a.DYNAMIC_DRAW;a.bufferData(d,c.array,f);e.version=c.version}else e.version!==c.version&&(a.bindBuffer(d,e.__webglBuffer),void 0===c.updateRange||-1===c.updateRange.count?a.bufferSubData(d,0,c.array):0===c.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):
(a.bufferSubData(e,f.updateRange.offset*f.array.BYTES_PER_ELEMENT,f.array.subarray(f.updateRange.offset,f.updateRange.offset+f.updateRange.count)),f.updateRange.count=0),g.version=f.version)}function g(a,b,c){b=b<c?b+"_"+c:c+"_"+b;if(a.hasOwnProperty(b))return!1;a[b]=1;return!0}var f={},h=new THREE.WebGLGeometries(a,b,c);this.objects=f;this.init=function(a){var c=b.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed", (a.bufferSubData(d,c.updateRange.offset*c.array.BYTES_PER_ELEMENT,c.array.subarray(c.updateRange.offset,c.updateRange.offset+c.updateRange.count)),c.updateRange.count=0),e.version=c.version)}function g(a,b,c){b=b<c?b+"_"+c:c+"_"+b;if(a.hasOwnProperty(b))return!1;a[b]=1;return!0}var f={},h=new THREE.WebGLGeometries(a,b,c);this.objects=f;this.init=function(a){var c=b.get(a);void 0===c.__webglInit&&(c.__webglInit=!0,a._modelViewMatrix=new THREE.Matrix4,a._normalMatrix=new THREE.Matrix3,a.addEventListener("removed",
d));void 0===c.__webglActive&&(c.__webglActive=!0,a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud)&&(f[a.id]={id:a.id,object:a,z:0})};this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.getWireframeAttribute=function(a){if(void 0!==a._wireframe)return a._wireframe;var b=[],c=a.attributes,d=c.index,c=c.position;console.time("wireframe");if(void 0!==d)for(var f={},d=d.array, d));void 0===c.__webglActive&&(c.__webglActive=!0,a instanceof THREE.Mesh||a instanceof THREE.Line||a instanceof THREE.PointCloud)&&(f[a.id]={id:a.id,object:a,z:0})};this.getAttributeBuffer=function(a){return a instanceof THREE.InterleavedBufferAttribute?b.get(a.data).__webglBuffer:b.get(a).__webglBuffer};this.getWireframeAttribute=function(a){var c=b.get(a);if(void 0!==c.wireframe)return c.wireframe;var d=[];a=a.attributes;var f=a.index;a=a.position;console.time("wireframe");if(void 0!==f)for(var h=
h=0,t=d.length;h<t;h+=3){var r=d[h+0],u=d[h+1],w=d[h+2];g(f,r,u)&&b.push(r,u);g(f,u,w)&&b.push(u,w);g(f,w,r)&&b.push(w,r)}else for(d=c.array,h=0,t=d.length/3-1;h<t;h+=3)r=h+0,u=h+1,w=h+2,b.push(r,u,u,w,w,r);console.timeEnd("wireframe");b=new THREE.BufferAttribute(new (65535<c.count?Uint32Array:Uint16Array)(b),1);e(b,"index");return a._wireframe=b};this.update=function(a){var b=h.get(a);a.geometry instanceof THREE.Geometry&&b.updateFromObject(a);a=b.attributes;for(var c in a)e(a[c],c);a=b.morphAttributes; {},f=f.array,q=0,t=f.length;q<t;q+=3){var r=f[q+0],u=f[q+1],w=f[q+2];g(h,r,u)&&d.push(r,u);g(h,u,w)&&d.push(u,w);g(h,w,r)&&d.push(w,r)}else for(f=a.array,q=0,t=f.length/3-1;q<t;q+=3)r=q+0,u=q+1,w=q+2,d.push(r,u,u,w,w,r);console.timeEnd("wireframe");d=new THREE.IndexBufferAttribute(new (65535<a.count?Uint32Array:Uint16Array)(d),1);e(d);return c.wireframe=d};this.update=function(a){var b=h.get(a);a.geometry instanceof THREE.Geometry&&b.updateFromObject(a);a=b.attributes;for(var c in a)e(a[c]);a=b.morphAttributes;
for(c in a)for(var d=a[c],f=0,g=d.length;f<g;f++)e(d[f],f);return b};this.updateAttribute=e;this.clear=function(){f={}}}; for(c in a)for(var d=a[c],f=0,g=d.length;f<g;f++)e(d[f]);return b};this.clear=function(){f={}}};
THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var f=a[c];!1!==f&&b.push("#define "+c+" "+f)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,g,f){var h=d.context,k=g.defines,l=g.__webglShader.vertexShader,n=g.__webglShader.fragmentShader,p="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?p="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(p="SHADOWMAP_TYPE_PCF_SOFT");var m="ENVMAP_TYPE_CUBE",q="ENVMAP_MODE_REFLECTION",t="ENVMAP_BLENDING_MULTIPLY"; THREE.WebGLProgram=function(){function a(a){var b=[],c;for(c in a){var f=a[c];!1!==f&&b.push("#define "+c+" "+f)}return b.join("\n")}function b(a){return""!==a}var c=0;return function(d,e,g,f){var h=d.context,k=g.defines,l=g.__webglShader.vertexShader,n=g.__webglShader.fragmentShader,p="SHADOWMAP_TYPE_BASIC";f.shadowMapType===THREE.PCFShadowMap?p="SHADOWMAP_TYPE_PCF":f.shadowMapType===THREE.PCFSoftShadowMap&&(p="SHADOWMAP_TYPE_PCF_SOFT");var m="ENVMAP_TYPE_CUBE",q="ENVMAP_MODE_REFLECTION",t="ENVMAP_BLENDING_MULTIPLY";
if(f.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:m="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:m="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:m="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_MODE_REFRACTION"}switch(g.combine){case THREE.MultiplyOperation:t="ENVMAP_BLENDING_MULTIPLY"; if(f.envMap){switch(g.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:m="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:m="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:m="ENVMAP_TYPE_SPHERE"}switch(g.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:q="ENVMAP_MODE_REFRACTION"}switch(g.combine){case THREE.MultiplyOperation:t="ENVMAP_BLENDING_MULTIPLY";
break;case THREE.MixOperation:t="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:t="ENVMAP_BLENDING_ADD"}}var r=0<d.gammaFactor?d.gammaFactor:1,u=a(k),w=h.createProgram();g instanceof THREE.RawShaderMaterial?d=k="":(k=["precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,u,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+r,"#define MAX_DIR_LIGHTS "+ break;case THREE.MixOperation:t="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:t="ENVMAP_BLENDING_ADD"}}var r=0<d.gammaFactor?d.gammaFactor:1,u=a(k),w=h.createProgram();g instanceof THREE.RawShaderMaterial?d=k="":(k=["precision "+f.precision+" float;","precision "+f.precision+" int;","#define SHADER_NAME "+g.__webglShader.name,u,f.supportsVertexTextures?"#define VERTEX_TEXTURES":"",d.gammaInput?"#define GAMMA_INPUT":"",d.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+r,"#define MAX_DIR_LIGHTS "+
...@@ -609,9 +609,9 @@ a.matrixWorld),n.push(d))}for(var d=a.children,f=0,g=d.length;f<g;f++)e(d[f],b)} ...@@ -609,9 +609,9 @@ a.matrixWorld),n.push(d))}for(var d=a.children,f=0,g=d.length;f<g;f++)e(d[f],b)}
vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,skinning:!0}),u=new THREE.ShaderMaterial({uniforms:m,vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,morphTargets:!0,skinning:!0});q._shadowPass=!0;t._shadowPass=!0;r._shadowPass=!0;u._shadowPass=!0;var w=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.render=function(m,q){if(!1!==w.enabled&&(!1!==w.autoUpdate||!1!==w.needsUpdate)){g.clearColor(1, vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,skinning:!0}),u=new THREE.ShaderMaterial({uniforms:m,vertexShader:p.vertexShader,fragmentShader:p.fragmentShader,morphTargets:!0,skinning:!0});q._shadowPass=!0;t._shadowPass=!0;r._shadowPass=!0;u._shadowPass=!0;var w=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=THREE.PCFShadowMap;this.cullFace=THREE.CullFaceFront;this.render=function(m,q){if(!1!==w.enabled&&(!1!==w.autoUpdate||!1!==w.needsUpdate)){g.clearColor(1,
1,1,1);f.disable(g.BLEND);f.enable(g.CULL_FACE);g.frontFace(g.CCW);w.cullFace===THREE.CullFaceFront?g.cullFace(g.FRONT):g.cullFace(g.BACK);f.setDepthTest(!0);for(var p=0,t=b.length;p<t;p++){var r=b[p];if(r.castShadow){if(!r.shadowMap){var u=THREE.LinearFilter;w.type===THREE.PCFSoftShadowMap&&(u=THREE.NearestFilter);r.shadowMap=new THREE.WebGLRenderTarget(r.shadowMapWidth,r.shadowMapHeight,{minFilter:u,magFilter:u,format:THREE.RGBAFormat});r.shadowMapSize=new THREE.Vector2(r.shadowMapWidth,r.shadowMapHeight); 1,1,1);f.disable(g.BLEND);f.enable(g.CULL_FACE);g.frontFace(g.CCW);w.cullFace===THREE.CullFaceFront?g.cullFace(g.FRONT):g.cullFace(g.BACK);f.setDepthTest(!0);for(var p=0,t=b.length;p<t;p++){var r=b[p];if(r.castShadow){if(!r.shadowMap){var u=THREE.LinearFilter;w.type===THREE.PCFSoftShadowMap&&(u=THREE.NearestFilter);r.shadowMap=new THREE.WebGLRenderTarget(r.shadowMapWidth,r.shadowMapHeight,{minFilter:u,magFilter:u,format:THREE.RGBAFormat});r.shadowMapSize=new THREE.Vector2(r.shadowMapWidth,r.shadowMapHeight);
r.shadowMatrix=new THREE.Matrix4}if(!r.shadowCamera){if(r instanceof THREE.SpotLight)r.shadowCamera=new THREE.PerspectiveCamera(r.shadowCameraFov,r.shadowMapWidth/r.shadowMapHeight,r.shadowCameraNear,r.shadowCameraFar);else if(r instanceof THREE.DirectionalLight)r.shadowCamera=new THREE.OrthographicCamera(r.shadowCameraLeft,r.shadowCameraRight,r.shadowCameraTop,r.shadowCameraBottom,r.shadowCameraNear,r.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow", r.shadowMatrix=new THREE.Matrix4}if(!r.shadowCamera){if(r instanceof THREE.SpotLight)r.shadowCamera=new THREE.PerspectiveCamera(r.shadowCameraFov,r.shadowMapWidth/r.shadowMapHeight,r.shadowCameraNear,r.shadowCameraFar);else if(r instanceof THREE.DirectionalLight)r.shadowCamera=new THREE.OrthographicCamera(r.shadowCameraLeft,r.shadowCameraRight,r.shadowCameraTop,r.shadowCameraBottom,r.shadowCameraNear,r.shadowCameraFar);else{console.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",
r);continue}m.add(r.shadowCamera);!0===m.autoUpdate&&m.updateMatrixWorld()}r.shadowCameraVisible&&!r.cameraHelper&&(r.cameraHelper=new THREE.CameraHelper(r.shadowCamera),m.add(r.cameraHelper));var A=r.shadowMap,M=r.shadowMatrix,u=r.shadowCamera;u.position.setFromMatrixPosition(r.matrixWorld);l.setFromMatrixPosition(r.target.matrixWorld);u.lookAt(l);u.updateMatrixWorld();u.matrixWorldInverse.getInverse(u.matrixWorld);r.cameraHelper&&(r.cameraHelper.visible=r.shadowCameraVisible);r.shadowCameraVisible&& r);continue}m.add(r.shadowCamera);!0===m.autoUpdate&&m.updateMatrixWorld()}r.shadowCameraVisible&&!r.cameraHelper&&(r.cameraHelper=new THREE.CameraHelper(r.shadowCamera),m.add(r.cameraHelper));var A=r.shadowMap,L=r.shadowMatrix,u=r.shadowCamera;u.position.setFromMatrixPosition(r.matrixWorld);l.setFromMatrixPosition(r.target.matrixWorld);u.lookAt(l);u.updateMatrixWorld();u.matrixWorldInverse.getInverse(u.matrixWorld);r.cameraHelper&&(r.cameraHelper.visible=r.shadowCameraVisible);r.shadowCameraVisible&&
r.cameraHelper.update();M.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);M.multiply(u.projectionMatrix);M.multiply(u.matrixWorldInverse);k.multiplyMatrices(u.projectionMatrix,u.matrixWorldInverse);h.setFromMatrix(k);a.setRenderTarget(A);a.clear();n.length=0;e(m,u);for(var J,D,r=0,A=n.length;r<A;r++)if(M=n[r],M=M.object,J=c.update(M),D=M.material,D instanceof THREE.MeshFaceMaterial)for(var P=D.materials,K=0,C=P.length;K<C;K++)D=P[K],D.visible&&a.renderBufferDirect(u,b,null,J,d(M,D),M);else a.renderBufferDirect(u, r.cameraHelper.update();L.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);L.multiply(u.projectionMatrix);L.multiply(u.matrixWorldInverse);k.multiplyMatrices(u.projectionMatrix,u.matrixWorldInverse);h.setFromMatrix(k);a.setRenderTarget(A);a.clear();n.length=0;e(m,u);for(var J,D,r=0,A=n.length;r<A;r++)if(L=n[r],L=L.object,J=c.update(L),D=L.material,D instanceof THREE.MeshFaceMaterial)for(var P=D.materials,K=0,C=P.length;K<C;K++)D=P[K],D.visible&&a.renderBufferDirect(u,b,null,J,d(L,D),L);else a.renderBufferDirect(u,
b,null,J,d(M,D),M)}}p=a.getClearColor();t=a.getClearAlpha();g.clearColor(p.r,p.g,p.b,t);f.enable(g.BLEND);w.cullFace===THREE.CullFaceFront&&g.cullFace(g.BACK);a.resetGLState();w.needsUpdate=!1}}}; b,null,J,d(L,D),L)}}p=a.getClearColor();t=a.getClearAlpha();g.clearColor(p.r,p.g,p.b,t);f.enable(g.BLEND);w.cullFace===THREE.CullFaceFront&&g.cullFace(g.BACK);a.resetGLState();w.needsUpdate=!1}}};
THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),g=new Uint8Array(16),f={},h=null,k=null,l=null,n=null,p=null,m=null,q=null,t=null,r=null,u=null,w=null,v=null,y=null,x=null,E=null,B=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),z=void 0,A={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.SRC_ALPHA, THREE.WebGLState=function(a,b,c){var d=this,e=new Uint8Array(16),g=new Uint8Array(16),f={},h=null,k=null,l=null,n=null,p=null,m=null,q=null,t=null,r=null,u=null,w=null,v=null,y=null,x=null,E=null,B=a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS),z=void 0,A={};this.init=function(){a.clearColor(0,0,0,1);a.clearDepth(1);a.clearStencil(0);this.enable(a.DEPTH_TEST);a.depthFunc(a.LEQUAL);a.frontFace(a.CCW);a.cullFace(a.BACK);this.enable(a.CULL_FACE);this.enable(a.BLEND);a.blendEquation(a.FUNC_ADD);a.blendFunc(a.SRC_ALPHA,
a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(b){e[b]=1;0===g[b]&&(a.enableVertexAttribArray(b),g[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=g.length;b<c;b++)g[b]!==e[b]&&(a.disableVertexAttribArray(b),g[b]=0)};this.enable=function(b){!0!==f[b]&&(a.enable(b),f[b]=!0)};this.disable=function(b){!1!==f[b]&&(a.disable(b),f[b]=!1)};this.getCompressedTextureFormats=function(){if(null===h&&(h=[],b.get("WEBGL_compressed_texture_pvrtc")|| a.ONE_MINUS_SRC_ALPHA)};this.initAttributes=function(){for(var a=0,b=e.length;a<b;a++)e[a]=0};this.enableAttribute=function(b){e[b]=1;0===g[b]&&(a.enableVertexAttribArray(b),g[b]=1)};this.disableUnusedAttributes=function(){for(var b=0,c=g.length;b<c;b++)g[b]!==e[b]&&(a.disableVertexAttribArray(b),g[b]=0)};this.enable=function(b){!0!==f[b]&&(a.enable(b),f[b]=!0)};this.disable=function(b){!1!==f[b]&&(a.disable(b),f[b]=!1)};this.getCompressedTextureFormats=function(){if(null===h&&(h=[],b.get("WEBGL_compressed_texture_pvrtc")||
b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)h.push(c[d]);return h};this.getMaxPrecision=function(b){if("highp"===b){if(0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision)return"highp";b="mediump"}return"mediump"===b&&0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision? b.get("WEBGL_compressed_texture_s3tc")))for(var c=a.getParameter(a.COMPRESSED_TEXTURE_FORMATS),d=0;d<c.length;d++)h.push(c[d]);return h};this.getMaxPrecision=function(b){if("highp"===b){if(0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.HIGH_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT).precision)return"highp";b="mediump"}return"mediump"===b&&0<a.getShaderPrecisionFormat(a.VERTEX_SHADER,a.MEDIUM_FLOAT).precision&&0<a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.MEDIUM_FLOAT).precision?
...@@ -621,24 +621,24 @@ break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a ...@@ -621,24 +621,24 @@ break;case THREE.LessDepth:a.depthFunc(a.LESS);break;case THREE.LessEqualDepth:a
b&&(a.depthMask(b),u=b)};this.setColorWrite=function(b){w!==b&&(a.colorMask(b,b,b,b),w=b)};this.setFlipSided=function(b){v!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),v=b)};this.setLineWidth=function(b){b!==y&&(a.lineWidth(b),y=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||x===c&&E===d||(a.polygonOffset(c,d),x=c,E=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture= b&&(a.depthMask(b),u=b)};this.setColorWrite=function(b){w!==b&&(a.colorMask(b,b,b,b),w=b)};this.setFlipSided=function(b){v!==b&&(b?a.frontFace(a.CW):a.frontFace(a.CCW),v=b)};this.setLineWidth=function(b){b!==y&&(a.lineWidth(b),y=b)};this.setPolygonOffset=function(b,c,d){b?this.enable(a.POLYGON_OFFSET_FILL):this.disable(a.POLYGON_OFFSET_FILL);!b||x===c&&E===d||(a.polygonOffset(c,d),x=c,E=d)};this.setScissorTest=function(b){b?this.enable(a.SCISSOR_TEST):this.disable(a.SCISSOR_TEST)};this.activeTexture=
function(b){void 0===b&&(b=a.TEXTURE0+B-1);z!==b&&(a.activeTexture(b),z=b)};this.bindTexture=function(b,c){void 0===z&&d.activeTexture();var e=A[z];void 0===e&&(e={type:void 0,texture:void 0},A[z]=e);if(e.type!==b||e.texture!==c)a.bindTexture(b,c),e.type=b,e.texture=c};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b= function(b){void 0===b&&(b=a.TEXTURE0+B-1);z!==b&&(a.activeTexture(b),z=b)};this.bindTexture=function(b,c){void 0===z&&d.activeTexture();var e=A[z];void 0===e&&(e={type:void 0,texture:void 0},A[z]=e);if(e.type!==b||e.texture!==c)a.bindTexture(b,c),e.type=b,e.texture=c};this.compressedTexImage2D=function(){try{a.compressedTexImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.texImage2D=function(){try{a.texImage2D.apply(a,arguments)}catch(b){console.error(b)}};this.reset=function(){for(var b=
0;b<g.length;b++)1===g[b]&&(a.disableVertexAttribArray(b),g[b]=0);f={};v=w=u=k=h=null}}; 0;b<g.length;b++)1===g[b]&&(a.disableVertexAttribArray(b),g[b]=0);f={};v=w=u=k=h=null}};
THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,l,n,p,m=a.context,q=a.state,t,r,u,w,v,y;this.render=function(x,E,B,z){if(0!==b.length){x=new THREE.Vector3;var A=z/B,M=.5*B,J=.5*z,D=16/z,P=new THREE.Vector2(D*A,D),K=new THREE.Vector3(1,1,0),C=new THREE.Vector2(1,1);if(void 0===u){var D=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),G=new Uint16Array([0,1,2,0,2,3]);t=m.createBuffer();r=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,t);m.bufferData(m.ARRAY_BUFFER,D,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER, THREE.LensFlarePlugin=function(a,b){var c,d,e,g,f,h,k,l,n,p,m=a.context,q=a.state,t,r,u,w,v,y;this.render=function(x,E,B,z){if(0!==b.length){x=new THREE.Vector3;var A=z/B,L=.5*B,J=.5*z,D=16/z,P=new THREE.Vector2(D*A,D),K=new THREE.Vector3(1,1,0),C=new THREE.Vector2(1,1);if(void 0===u){var D=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),G=new Uint16Array([0,1,2,0,2,3]);t=m.createBuffer();r=m.createBuffer();m.bindBuffer(m.ARRAY_BUFFER,t);m.bufferData(m.ARRAY_BUFFER,D,m.STATIC_DRAW);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,
r);m.bufferData(m.ELEMENT_ARRAY_BUFFER,G,m.STATIC_DRAW);v=m.createTexture();y=m.createTexture();q.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);q.bindTexture(m.TEXTURE_2D,y);m.texImage2D(m.TEXTURE_2D,0, r);m.bufferData(m.ELEMENT_ARRAY_BUFFER,G,m.STATIC_DRAW);v=m.createTexture();y=m.createTexture();q.bindTexture(m.TEXTURE_2D,v);m.texImage2D(m.TEXTURE_2D,0,m.RGB,16,16,0,m.RGB,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);q.bindTexture(m.TEXTURE_2D,y);m.texImage2D(m.TEXTURE_2D,0,
m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var D=(w=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *= visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}", m.RGBA,16,16,0,m.RGBA,m.UNSIGNED_BYTE,null);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.NEAREST);m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.NEAREST);var D=(w=0<m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *= visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}", fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",
fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}, fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},
G=m.createProgram(),H=m.createShader(m.FRAGMENT_SHADER),O=m.createShader(m.VERTEX_SHADER),Q="precision "+a.getPrecision()+" float;\n";m.shaderSource(H,Q+D.fragmentShader);m.shaderSource(O,Q+D.vertexShader);m.compileShader(H);m.compileShader(O);m.attachShader(G,H);m.attachShader(G,O);m.linkProgram(G);u=G;n=m.getAttribLocation(u,"position");p=m.getAttribLocation(u,"uv");c=m.getUniformLocation(u,"renderType");d=m.getUniformLocation(u,"map");e=m.getUniformLocation(u,"occlusionMap");g=m.getUniformLocation(u, G=m.createProgram(),H=m.createShader(m.FRAGMENT_SHADER),O=m.createShader(m.VERTEX_SHADER),Q="precision "+a.getPrecision()+" float;\n";m.shaderSource(H,Q+D.fragmentShader);m.shaderSource(O,Q+D.vertexShader);m.compileShader(H);m.compileShader(O);m.attachShader(G,H);m.attachShader(G,O);m.linkProgram(G);u=G;n=m.getAttribLocation(u,"position");p=m.getAttribLocation(u,"uv");c=m.getUniformLocation(u,"renderType");d=m.getUniformLocation(u,"map");e=m.getUniformLocation(u,"occlusionMap");g=m.getUniformLocation(u,
"opacity");f=m.getUniformLocation(u,"color");h=m.getUniformLocation(u,"scale");k=m.getUniformLocation(u,"rotation");l=m.getUniformLocation(u,"screenPosition")}m.useProgram(u);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,t);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,r);q.disable(m.CULL_FACE);m.depthMask(!1);G=0;for(H= "opacity");f=m.getUniformLocation(u,"color");h=m.getUniformLocation(u,"scale");k=m.getUniformLocation(u,"rotation");l=m.getUniformLocation(u,"screenPosition")}m.useProgram(u);q.initAttributes();q.enableAttribute(n);q.enableAttribute(p);q.disableUnusedAttributes();m.uniform1i(e,0);m.uniform1i(d,1);m.bindBuffer(m.ARRAY_BUFFER,t);m.vertexAttribPointer(n,2,m.FLOAT,!1,16,0);m.vertexAttribPointer(p,2,m.FLOAT,!1,16,8);m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,r);q.disable(m.CULL_FACE);m.depthMask(!1);G=0;for(H=
b.length;G<H;G++)if(D=16/z,P.set(D*A,D),O=b[G],x.set(O.matrixWorld.elements[12],O.matrixWorld.elements[13],O.matrixWorld.elements[14]),x.applyMatrix4(E.matrixWorldInverse),x.applyProjection(E.projectionMatrix),K.copy(x),C.x=K.x*M+M,C.y=K.y*J+J,w||0<C.x&&C.x<B&&0<C.y&&C.y<z){q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,null);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,C.x-8,C.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,P.x,P.y);m.uniform3f(l, b.length;G<H;G++)if(D=16/z,P.set(D*A,D),O=b[G],x.set(O.matrixWorld.elements[12],O.matrixWorld.elements[13],O.matrixWorld.elements[14]),x.applyMatrix4(E.matrixWorldInverse),x.applyProjection(E.projectionMatrix),K.copy(x),C.x=K.x*L+L,C.y=K.y*J+J,w||0<C.x&&C.x<B&&0<C.y&&C.y<z){q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,null);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGB,C.x-8,C.y-8,16,16,0);m.uniform1i(c,0);m.uniform2f(h,P.x,P.y);m.uniform3f(l,
K.x,K.y,K.z);q.disable(m.BLEND);q.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,y);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,C.x-8,C.y-8,16,16,0);m.uniform1i(c,1);q.disable(m.DEPTH_TEST);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);O.positionScreen.copy(K);O.customUpdateCallback?O.customUpdateCallback(O):O.updateLensFlares();m.uniform1i(c,2);q.enable(m.BLEND);for(var Q= K.x,K.y,K.z);q.disable(m.BLEND);q.enable(m.DEPTH_TEST);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);q.activeTexture(m.TEXTURE0);q.bindTexture(m.TEXTURE_2D,y);m.copyTexImage2D(m.TEXTURE_2D,0,m.RGBA,C.x-8,C.y-8,16,16,0);m.uniform1i(c,1);q.disable(m.DEPTH_TEST);q.activeTexture(m.TEXTURE1);q.bindTexture(m.TEXTURE_2D,v);m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0);O.positionScreen.copy(K);O.customUpdateCallback?O.customUpdateCallback(O):O.updateLensFlares();m.uniform1i(c,2);q.enable(m.BLEND);for(var Q=
0,T=O.lensFlares.length;Q<T;Q++){var R=O.lensFlares[Q];.001<R.opacity&&.001<R.scale&&(K.x=R.x,K.y=R.y,K.z=R.z,D=R.size*R.scale/z,P.x=D*A,P.y=D,m.uniform3f(l,K.x,K.y,K.z),m.uniform2f(h,P.x,P.y),m.uniform1f(k,R.rotation),m.uniform1f(g,R.opacity),m.uniform3f(f,R.color.r,R.color.g,R.color.b),q.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),a.setTexture(R.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}q.enable(m.CULL_FACE);q.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}}; 0,T=O.lensFlares.length;Q<T;Q++){var R=O.lensFlares[Q];.001<R.opacity&&.001<R.scale&&(K.x=R.x,K.y=R.y,K.z=R.z,D=R.size*R.scale/z,P.x=D*A,P.y=D,m.uniform3f(l,K.x,K.y,K.z),m.uniform2f(h,P.x,P.y),m.uniform1f(k,R.rotation),m.uniform1f(g,R.opacity),m.uniform3f(f,R.color.r,R.color.g,R.color.b),q.setBlending(R.blending,R.blendEquation,R.blendSrc,R.blendDst),a.setTexture(R.texture,1),m.drawElements(m.TRIANGLES,6,m.UNSIGNED_SHORT,0))}}q.enable(m.CULL_FACE);q.enable(m.DEPTH_TEST);m.depthMask(!0);a.resetGLState()}}};
THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,l,n,p,m,q,t,r,u,w,v;function y(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,E=a.state,B,z,A,M,J=new THREE.Vector3,D=new THREE.Quaternion,P=new THREE.Vector3;this.render=function(K,C){if(0!==b.length){if(void 0===A){var G=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),H=new Uint16Array([0,1,2,0,2,3]);B=x.createBuffer();z=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,B);x.bufferData(x.ARRAY_BUFFER,G,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER, THREE.SpritePlugin=function(a,b){var c,d,e,g,f,h,k,l,n,p,m,q,t,r,u,w,v;function y(a,b){return a.z!==b.z?b.z-a.z:b.id-a.id}var x=a.context,E=a.state,B,z,A,L,J=new THREE.Vector3,D=new THREE.Quaternion,P=new THREE.Vector3;this.render=function(K,C){if(0!==b.length){if(void 0===A){var G=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),H=new Uint16Array([0,1,2,0,2,3]);B=x.createBuffer();z=x.createBuffer();x.bindBuffer(x.ARRAY_BUFFER,B);x.bufferData(x.ARRAY_BUFFER,G,x.STATIC_DRAW);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,
z);x.bufferData(x.ELEMENT_ARRAY_BUFFER,H,x.STATIC_DRAW);var G=x.createProgram(),H=x.createShader(x.VERTEX_SHADER),O=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(H,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")); z);x.bufferData(x.ELEMENT_ARRAY_BUFFER,H,x.STATIC_DRAW);var G=x.createProgram(),H=x.createShader(x.VERTEX_SHADER),O=x.createShader(x.FRAGMENT_SHADER);x.shaderSource(H,["precision "+a.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n"));
x.shaderSource(O,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")); x.shaderSource(O,["precision "+a.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n"));
x.compileShader(H);x.compileShader(O);x.attachShader(G,H);x.attachShader(G,O);x.linkProgram(G);A=G;w=x.getAttribLocation(A,"position");v=x.getAttribLocation(A,"uv");c=x.getUniformLocation(A,"uvOffset");d=x.getUniformLocation(A,"uvScale");e=x.getUniformLocation(A,"rotation");g=x.getUniformLocation(A,"scale");f=x.getUniformLocation(A,"color");h=x.getUniformLocation(A,"map");k=x.getUniformLocation(A,"opacity");l=x.getUniformLocation(A,"modelViewMatrix");n=x.getUniformLocation(A,"projectionMatrix");p= x.compileShader(H);x.compileShader(O);x.attachShader(G,H);x.attachShader(G,O);x.linkProgram(G);A=G;w=x.getAttribLocation(A,"position");v=x.getAttribLocation(A,"uv");c=x.getUniformLocation(A,"uvOffset");d=x.getUniformLocation(A,"uvScale");e=x.getUniformLocation(A,"rotation");g=x.getUniformLocation(A,"scale");f=x.getUniformLocation(A,"color");h=x.getUniformLocation(A,"map");k=x.getUniformLocation(A,"opacity");l=x.getUniformLocation(A,"modelViewMatrix");n=x.getUniformLocation(A,"projectionMatrix");p=
x.getUniformLocation(A,"fogType");m=x.getUniformLocation(A,"fogDensity");q=x.getUniformLocation(A,"fogNear");t=x.getUniformLocation(A,"fogFar");r=x.getUniformLocation(A,"fogColor");u=x.getUniformLocation(A,"alphaTest");G=document.createElement("canvas");G.width=8;G.height=8;H=G.getContext("2d");H.fillStyle="white";H.fillRect(0,0,8,8);M=new THREE.Texture(G);M.needsUpdate=!0}x.useProgram(A);E.initAttributes();E.enableAttribute(w);E.enableAttribute(v);E.disableUnusedAttributes();E.disable(x.CULL_FACE); x.getUniformLocation(A,"fogType");m=x.getUniformLocation(A,"fogDensity");q=x.getUniformLocation(A,"fogNear");t=x.getUniformLocation(A,"fogFar");r=x.getUniformLocation(A,"fogColor");u=x.getUniformLocation(A,"alphaTest");G=document.createElement("canvas");G.width=8;G.height=8;H=G.getContext("2d");H.fillStyle="white";H.fillRect(0,0,8,8);L=new THREE.Texture(G);L.needsUpdate=!0}x.useProgram(A);E.initAttributes();E.enableAttribute(w);E.enableAttribute(v);E.disableUnusedAttributes();E.disable(x.CULL_FACE);
E.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,B);x.vertexAttribPointer(w,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,z);x.uniformMatrix4fv(n,!1,C.projectionMatrix.elements);E.activeTexture(x.TEXTURE0);x.uniform1i(h,0);H=G=0;(O=K.fog)?(x.uniform3f(r,O.color.r,O.color.g,O.color.b),O instanceof THREE.Fog?(x.uniform1f(q,O.near),x.uniform1f(t,O.far),x.uniform1i(p,1),H=G=1):O instanceof THREE.FogExp2&&(x.uniform1f(m,O.density),x.uniform1i(p,2),H=G=2)): E.enable(x.BLEND);x.bindBuffer(x.ARRAY_BUFFER,B);x.vertexAttribPointer(w,2,x.FLOAT,!1,16,0);x.vertexAttribPointer(v,2,x.FLOAT,!1,16,8);x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,z);x.uniformMatrix4fv(n,!1,C.projectionMatrix.elements);E.activeTexture(x.TEXTURE0);x.uniform1i(h,0);H=G=0;(O=K.fog)?(x.uniform3f(r,O.color.r,O.color.g,O.color.b),O instanceof THREE.Fog?(x.uniform1f(q,O.near),x.uniform1f(t,O.far),x.uniform1i(p,1),H=G=1):O instanceof THREE.FogExp2&&(x.uniform1f(m,O.density),x.uniform1i(p,2),H=G=2)):
(x.uniform1i(p,0),H=G=0);for(var O=0,Q=b.length;O<Q;O++){var T=b[O];T._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,T.matrixWorld);T.z=-T._modelViewMatrix.elements[14]}b.sort(y);for(var R=[],O=0,Q=b.length;O<Q;O++){var T=b[O],U=T.material;x.uniform1f(u,U.alphaTest);x.uniformMatrix4fv(l,!1,T._modelViewMatrix.elements);T.matrixWorld.decompose(J,D,P);R[0]=P.x;R[1]=P.y;T=0;K.fog&&U.fog&&(T=H);G!==T&&(x.uniform1i(p,T),G=T);null!==U.map?(x.uniform2f(c,U.map.offset.x,U.map.offset.y),x.uniform2f(d, (x.uniform1i(p,0),H=G=0);for(var O=0,Q=b.length;O<Q;O++){var T=b[O];T._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,T.matrixWorld);T.z=-T._modelViewMatrix.elements[14]}b.sort(y);for(var R=[],O=0,Q=b.length;O<Q;O++){var T=b[O],U=T.material;x.uniform1f(u,U.alphaTest);x.uniformMatrix4fv(l,!1,T._modelViewMatrix.elements);T.matrixWorld.decompose(J,D,P);R[0]=P.x;R[1]=P.y;T=0;K.fog&&U.fog&&(T=H);G!==T&&(x.uniform1i(p,T),G=T);null!==U.map?(x.uniform2f(c,U.map.offset.x,U.map.offset.y),x.uniform2f(d,
U.map.repeat.x,U.map.repeat.y)):(x.uniform2f(c,0,0),x.uniform2f(d,1,1));x.uniform1f(k,U.opacity);x.uniform3f(f,U.color.r,U.color.g,U.color.b);x.uniform1f(e,U.rotation);x.uniform2fv(g,R);E.setBlending(U.blending,U.blendEquation,U.blendSrc,U.blendDst);E.setDepthTest(U.depthTest);E.setDepthWrite(U.depthWrite);U.map&&U.map.image&&U.map.image.width?a.setTexture(U.map,0):a.setTexture(M,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}E.enable(x.CULL_FACE);a.resetGLState()}}}; U.map.repeat.x,U.map.repeat.y)):(x.uniform2f(c,0,0),x.uniform2f(d,1,1));x.uniform1f(k,U.opacity);x.uniform3f(f,U.color.r,U.color.g,U.color.b);x.uniform1f(e,U.rotation);x.uniform2fv(g,R);E.setBlending(U.blending,U.blendEquation,U.blendSrc,U.blendDst);E.setDepthTest(U.depthTest);E.setDepthWrite(U.depthWrite);U.map&&U.map.image&&U.map.image.width?a.setTexture(U.map,0):a.setTexture(L,0);x.drawElements(x.TRIANGLES,6,x.UNSIGNED_SHORT,0)}E.enable(x.CULL_FACE);a.resetGLState()}}};
THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}}; THREE.GeometryUtils={merge:function(a,b,c){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var d;b instanceof THREE.Mesh&&(b.matrixAutoUpdate&&b.updateMatrix(),d=b.matrix,b=b.geometry);a.merge(b,d,c)},center:function(a){console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.");return a.center()}};
THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b),f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&c(g))},void 0, THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.Texture(void 0,b);e.load(a,function(a){g.image=a;g.needsUpdate=!0;c&&c(g)},void 0,function(a){d&&d(a)});g.sourceFile=a;return g},loadTextureCube:function(a,b,c,d){var e=new THREE.ImageLoader;e.crossOrigin=this.crossOrigin;var g=new THREE.CubeTexture([],b),f=0;b=function(b){e.load(a[b],function(a){g.images[b]=a;f+=1;6===f&&(g.needsUpdate=!0,c&&c(g))},void 0,
d)};for(var h=0,k=a.length;h<k;++h)b(h);return g},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,g=document.createElement("canvas"); d)};for(var h=0,k=a.length;h<k;++h)b(h);return g},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(a,b){var c=function(a){var b=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);return[a[0]/b,a[1]/b,a[2]/b]};b|=1;var d=a.width,e=a.height,g=document.createElement("canvas");
...@@ -652,7 +652,7 @@ break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d ...@@ -652,7 +652,7 @@ break;case "l":k=b[a++]*c+d;n=b[a++]*c;e.lineTo(k,n);break;case "q":k=b[a++]*c+d
m,t,u,n)}return{offset:w.ha*c,path:e}}}}; m,t,u,n)}return{offset:w.ha*c,path:e}}}};
THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d}; THREE.FontUtils.generateShapes=function(a,b){b=b||{};var c=void 0!==b.curveSegments?b.curveSegments:4,d=void 0!==b.font?b.font:"helvetiker",e=void 0!==b.weight?b.weight:"normal",g=void 0!==b.style?b.style:"normal";THREE.FontUtils.size=void 0!==b.size?b.size:100;THREE.FontUtils.divisions=c;THREE.FontUtils.face=d;THREE.FontUtils.weight=e;THREE.FontUtils.style=g;c=THREE.FontUtils.drawText(a).paths;d=[];e=0;for(g=c.length;e<g;e++)Array.prototype.push.apply(d,c[e].toShapes());return d};
(function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var m;a:{var q=m=void 0,t=void 0,r=void 0, (function(a){var b=function(a){for(var b=a.length,e=0,g=b-1,f=0;f<b;g=f++)e+=a[g].x*a[f].y-a[f].x*a[g].y;return.5*e};a.Triangulate=function(a,d){var e=a.length;if(3>e)return null;var g=[],f=[],h=[],k,l,n;if(0<b(a))for(l=0;l<e;l++)f[l]=l;else for(l=0;l<e;l++)f[l]=e-1-l;var p=2*e;for(l=e-1;2<e;){if(0>=p--){console.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}k=l;e<=k&&(k=0);l=k+1;e<=l&&(l=0);n=l+1;e<=n&&(n=0);var m;a:{var q=m=void 0,t=void 0,r=void 0,
u=void 0,w=void 0,v=void 0,y=void 0,x=void 0,q=a[f[k]].x,t=a[f[k]].y,r=a[f[l]].x,u=a[f[l]].y,w=a[f[n]].x,v=a[f[n]].y;if(1E-10>(r-q)*(v-t)-(u-t)*(w-q))m=!1;else{var E=void 0,B=void 0,z=void 0,A=void 0,M=void 0,J=void 0,D=void 0,P=void 0,K=void 0,C=void 0,K=P=D=x=y=void 0,E=w-r,B=v-u,z=q-w,A=t-v,M=r-q,J=u-t;for(m=0;m<e;m++)if(y=a[f[m]].x,x=a[f[m]].y,!(y===q&&x===t||y===r&&x===u||y===w&&x===v)&&(D=y-q,P=x-t,K=y-r,C=x-u,y-=w,x-=v,K=E*C-B*K,D=M*P-J*D,P=z*x-A*y,-1E-10<=K&&-1E-10<=P&&-1E-10<=D)){m=!1;break a}m= u=void 0,w=void 0,v=void 0,y=void 0,x=void 0,q=a[f[k]].x,t=a[f[k]].y,r=a[f[l]].x,u=a[f[l]].y,w=a[f[n]].x,v=a[f[n]].y;if(1E-10>(r-q)*(v-t)-(u-t)*(w-q))m=!1;else{var E=void 0,B=void 0,z=void 0,A=void 0,L=void 0,J=void 0,D=void 0,P=void 0,K=void 0,C=void 0,K=P=D=x=y=void 0,E=w-r,B=v-u,z=q-w,A=t-v,L=r-q,J=u-t;for(m=0;m<e;m++)if(y=a[f[m]].x,x=a[f[m]].y,!(y===q&&x===t||y===r&&x===u||y===w&&x===v)&&(D=y-q,P=x-t,K=y-r,C=x-u,y-=w,x-=v,K=E*C-B*K,D=L*P-J*D,P=z*x-A*y,-1E-10<=K&&-1E-10<=P&&-1E-10<=D)){m=!1;break a}m=
!0}}if(m){g.push([a[f[k]],a[f[l]],a[f[n]]]);h.push([f[k],f[l],f[n]]);k=l;for(n=l+1;n<e;k++,n++)f[k]=f[n];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js); !0}}if(m){g.push([a[f[k]],a[f[l]],a[f[n]]]);h.push([f[k],f[l],f[n]]);k=l;for(n=l+1;n<e;k++,n++)f[k]=f[n];e--;p=2*e}}return d?h:g};a.Triangulate.area=b;return a})(THREE.FontUtils);THREE.typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace};"undefined"!==typeof self&&(self._typeface_js=THREE.typeface_js);
THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.playbackRate=1;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype); THREE.Audio=function(a){THREE.Object3D.call(this);this.type="Audio";this.context=a.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.panner=this.context.createPanner();this.panner.connect(this.gain);this.autoplay=!1;this.startTime=0;this.playbackRate=1;this.isPlaying=!1};THREE.Audio.prototype=Object.create(THREE.Object3D.prototype);
THREE.Audio.prototype.constructor=THREE.Audio;THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this}; THREE.Audio.prototype.constructor=THREE.Audio;THREE.Audio.prototype.load=function(a){var b=this,c=new XMLHttpRequest;c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(a){b.context.decodeAudioData(this.response,function(a){b.source.buffer=a;b.autoplay&&b.play()})};c.send();return this};
...@@ -695,8 +695,8 @@ THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransfor ...@@ -695,8 +695,8 @@ THREE.Shape.prototype.extractAllPoints=function(a){return{shape:this.getTransfor
THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,z=h*k-g*l,A=h*n-g*p;if(1E-10<Math.abs(z)){if(0<z){if(0>A||A>z)return[];k=l*n-k*p;if(0>k||k>z)return[]}else{if(0<A||A<z)return[];k=l*n-k*p;if(0<k||k<z)return[]}if(0===k)return!f||0!==A&&A!==z?[a]:[];if(k===z)return!f||0!==A&&A!==z?[b]:[];if(0=== THREE.Shape.Utils={triangulateShape:function(a,b){function c(a,b,c){return a.x!==b.x?a.x<b.x?a.x<=c.x&&c.x<=b.x:b.x<=c.x&&c.x<=a.x:a.y<b.y?a.y<=c.y&&c.y<=b.y:b.y<=c.y&&c.y<=a.y}function d(a,b,d,e,f){var g=b.x-a.x,h=b.y-a.y,k=e.x-d.x,l=e.y-d.y,n=a.x-d.x,p=a.y-d.y,z=h*k-g*l,A=h*n-g*p;if(1E-10<Math.abs(z)){if(0<z){if(0>A||A>z)return[];k=l*n-k*p;if(0>k||k>z)return[]}else{if(0<A||A<z)return[];k=l*n-k*p;if(0<k||k<z)return[]}if(0===k)return!f||0!==A&&A!==z?[a]:[];if(k===z)return!f||0!==A&&A!==z?[b]:[];if(0===
A)return[d];if(A===z)return[e];f=k/z;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==A||l*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,z=d.x,l=e,d=e.x):(b=e,z=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,z=d.y,l=e,d=e.y):(b=e,z=e.y,l=d,d=d.y));return k<=z?a<z?[]:a===z?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]: A)return[d];if(A===z)return[e];f=k/z;return[{x:a.x+f*g,y:a.y+f*h}]}if(0!==A||l*n!==k*p)return[];h=0===g&&0===h;k=0===k&&0===l;if(h&&k)return a.x!==d.x||a.y!==d.y?[]:[a];if(h)return c(d,e,a)?[a]:[];if(k)return c(a,b,d)?[d]:[];0!==g?(a.x<b.x?(g=a,k=a.x,h=b,a=b.x):(g=b,k=b.x,h=a,a=a.x),d.x<e.x?(b=d,z=d.x,l=e,d=e.x):(b=e,z=e.x,l=d,d=d.x)):(a.y<b.y?(g=a,k=a.y,h=b,a=b.y):(g=b,k=b.y,h=a,a=a.y),d.y<e.y?(b=d,z=d.y,l=e,d=e.y):(b=e,z=e.y,l=d,d=d.y));return k<=z?a<z?[]:a===z?f?[]:[b]:a<=d?[b,h]:[b,l]:k>d?[]:
k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,k,l,n={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)l=h[g].x+":"+h[g].y,void 0!==n[l]&&console.warn("THREE.Shape: Duplicate point",l),n[l]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g= k===d?f?[]:[g]:a<=d?[g,h]:[g,l]}function e(a,b,c,d){var e=b.x-a.x,f=b.y-a.y;b=c.x-a.x;c=c.y-a.y;var g=d.x-a.x;d=d.y-a.y;a=e*c-f*b;e=e*d-f*g;return 1E-10<Math.abs(a)?(b=g*c-d*b,0<a?0<=e&&0<=b:0<=e||0<=b):0<e}var g,f,h,k,l,n={};h=a.concat();g=0;for(f=b.length;g<f;g++)Array.prototype.push.apply(h,b[g]);g=0;for(f=h.length;g<f;g++)l=h[g].x+":"+h[g].y,void 0!==n[l]&&console.warn("THREE.Shape: Duplicate point",l),n[l]=g;g=function(a,b){function c(a,b){var d=h.length-1,f=a-1;0>f&&(f=d);var g=a+1;g>d&&(g=
0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,B,z,A,M=[],J,D,P,K=0;for(n=b.length;K<n;K++)l.push(K);J=0;for(var C=2* 0);d=e(h[a],h[f],h[g],k[b]);if(!d)return!1;d=k.length-1;f=b-1;0>f&&(f=d);g=b+1;g>d&&(g=0);return(d=e(k[b],k[f],k[g],h[a]))?!0:!1}function f(a,b){var c,e;for(c=0;c<h.length;c++)if(e=c+1,e%=h.length,e=d(a,b,h[c],h[e],!0),0<e.length)return!0;return!1}function g(a,c){var e,f,h,k;for(e=0;e<l.length;e++)for(f=b[l[e]],h=0;h<f.length;h++)if(k=h+1,k%=f.length,k=d(a,c,f[h],f[k],!0),0<k.length)return!0;return!1}var h=a.concat(),k,l=[],n,p,B,z,A,L=[],J,D,P,K=0;for(n=b.length;K<n;K++)l.push(K);J=0;for(var C=2*
l.length;0<l.length;){C--;if(0>C){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=J;p<h.length;p++){B=h[p];n=-1;for(K=0;K<l.length;K++)if(z=l[K],A=B.x+":"+B.y+":"+z,void 0===M[A]){k=b[z];for(D=0;D<k.length;D++)if(z=k[D],c(p,D)&&!f(B,z)&&!g(B,z)){n=D;l.splice(K,1);J=h.slice(0,p+1);z=h.slice(p);D=k.slice(n);P=k.slice(0,n+1);h=J.concat(D).concat(P).concat(z);J=p;break}if(0<=n)break;M[A]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g, l.length;0<l.length;){C--;if(0>C){console.log("Infinite Loop! Holes left:"+l.length+", Probably Hole outside Shape!");break}for(p=J;p<h.length;p++){B=h[p];n=-1;for(K=0;K<l.length;K++)if(z=l[K],A=B.x+":"+B.y+":"+z,void 0===L[A]){k=b[z];for(D=0;D<k.length;D++)if(z=k[D],c(p,D)&&!f(B,z)&&!g(B,z)){n=D;l.splice(K,1);J=h.slice(0,p+1);z=h.slice(p);D=k.slice(n);P=k.slice(0,n+1);h=J.concat(D).concat(P).concat(z);J=p;break}if(0<=n)break;L[A]=!0}if(0<=n)break}}return h}(a,b);var p=THREE.FontUtils.Triangulate(g,
!1);g=0;for(f=p.length;g<f;g++)for(k=p[g],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=n[l],void 0!==l&&(k[h]=l);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1- !1);g=0;for(f=p.length;g<f;g++)for(k=p[g],h=0;3>h;h++)l=k[h].x+":"+k[h].y,l=n[l],void 0!==l&&(k[h]=l);return p.concat()},isClockWise:function(a){return 0>THREE.FontUtils.Triangulate.area(a)},b2p0:function(a,b){var c=1-a;return c*c*b},b2p1:function(a,b){return 2*(1-a)*a*b},b2p2:function(a,b){return a*a*b},b2:function(a,b,c,d){return this.b2p0(a,b)+this.b2p1(a,c)+this.b2p2(a,d)},b3p0:function(a,b){var c=1-a;return c*c*c*b},b3p1:function(a,b){var c=1-a;return 3*c*c*a*b},b3p2:function(a,b){return 3*(1-
a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)}; a)*a*a*b},b3p3:function(a,b){return a*a*a*b},b3:function(a,b,c,d,e){return this.b3p0(a,b)+this.b3p1(a,c)+this.b3p2(a,d)+this.b3p3(a,e)}};THREE.LineCurve=function(a,b){this.v1=a;this.v2=b};THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype);THREE.LineCurve.prototype.constructor=THREE.LineCurve;THREE.LineCurve.prototype.getPoint=function(a){var b=this.v2.clone().sub(this.v1);b.multiplyScalar(a).add(this.v1);return b};THREE.LineCurve.prototype.getPointAt=function(a){return this.getPoint(a)};
THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve; THREE.LineCurve.prototype.getTangent=function(a){return this.v2.clone().sub(this.v1).normalize()};THREE.QuadraticBezierCurve=function(a,b,c){this.v0=a;this.v1=b;this.v2=c};THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype);THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve;
...@@ -738,7 +738,7 @@ g.interpolate(f,f.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorld ...@@ -738,7 +738,7 @@ g.interpolate(f,f.time);this.data.hierarchy[a].node.updateMatrix();c.matrixWorld
THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1}; THREE.MorphAnimation=function(a){this.mesh=a;this.frames=a.morphTargetInfluences.length;this.currentTime=0;this.duration=1E3;this.loop=!0;this.currentFrame=this.lastFrame=0;this.isPlaying=!1};
THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);var b=this.duration/this.frames;a=Math.floor(this.currentTime/b);var c=this.mesh.morphTargetInfluences;a!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]= THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(a){if(!1!==this.isPlaying){this.currentTime+=a;!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration);this.currentTime=Math.min(this.currentTime,this.duration);var b=this.duration/this.frames;a=Math.floor(this.currentTime/b);var c=this.mesh.morphTargetInfluences;a!==this.currentFrame&&(c[this.lastFrame]=0,c[this.currentFrame]=
1,c[a]=0,this.lastFrame=this.currentFrame,this.currentFrame=a);b=this.currentTime%b/b;c[a]=b;c[this.lastFrame]=1-b}}}; 1,c[a]=0,this.lastFrame=this.currentFrame,this.currentFrame=a);b=this.currentTime%b/b;c[a]=b;c[this.lastFrame]=1-b}}};
THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,r){var u,w=h.widthSegments,v=h.heightSegments,y=e/2,x=f/2,E=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",w=h.depthSegments;var B=w+1,z=v+1,A=e/w,M=f/v,J=new THREE.Vector3;J[u]=0<g?1:-1;for(e=0;e<z;e++)for(f=0;f<B;f++){var D=new THREE.Vector3;D[a]=(f*A-y)*c;D[b]=(e*M-x)*d;D[u]=g;h.vertices.push(D)}for(e= THREE.BoxGeometry=function(a,b,c,d,e,g){function f(a,b,c,d,e,f,g,r){var u,w=h.widthSegments,v=h.heightSegments,y=e/2,x=f/2,E=h.vertices.length;if("x"===a&&"y"===b||"y"===a&&"x"===b)u="z";else if("x"===a&&"z"===b||"z"===a&&"x"===b)u="y",v=h.depthSegments;else if("z"===a&&"y"===b||"y"===a&&"z"===b)u="x",w=h.depthSegments;var B=w+1,z=v+1,A=e/w,L=f/v,J=new THREE.Vector3;J[u]=0<g?1:-1;for(e=0;e<z;e++)for(f=0;f<B;f++){var D=new THREE.Vector3;D[a]=(f*A-y)*c;D[b]=(e*L-x)*d;D[u]=g;h.vertices.push(D)}for(e=
0;e<v;e++)for(f=0;f<w;f++)x=f+B*e,a=f+B*(e+1),b=f+1+B*(e+1),c=f+1+B*e,d=new THREE.Vector2(f/w,1-e/v),g=new THREE.Vector2(f/w,1-(e+1)/v),u=new THREE.Vector2((f+1)/w,1-(e+1)/v),y=new THREE.Vector2((f+1)/w,1-e/v),x=new THREE.Face3(x+E,a+E,c+E),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=r,h.faces.push(x),h.faceVertexUvs[0].push([d,g,y]),x=new THREE.Face3(a+E,b+E,c+E),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=r,h.faces.push(x), 0;e<v;e++)for(f=0;f<w;f++)x=f+B*e,a=f+B*(e+1),b=f+1+B*(e+1),c=f+1+B*e,d=new THREE.Vector2(f/w,1-e/v),g=new THREE.Vector2(f/w,1-(e+1)/v),u=new THREE.Vector2((f+1)/w,1-(e+1)/v),y=new THREE.Vector2((f+1)/w,1-e/v),x=new THREE.Face3(x+E,a+E,c+E),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=r,h.faces.push(x),h.faceVertexUvs[0].push([d,g,y]),x=new THREE.Face3(a+E,b+E,c+E),x.normal.copy(J),x.vertexNormals.push(J.clone(),J.clone(),J.clone()),x.materialIndex=r,h.faces.push(x),
h.faceVertexUvs[0].push([g.clone(),u,y.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d,0);f("z","y",1,-1,c,b,-d,1);f("x","z",1,1,a,c,e,2);f("x","z",1,-1,a,c,-e,3);f("x","y",1,-1,a,b,g,4);f("x","y",-1,-1,a,b,-g,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype); h.faceVertexUvs[0].push([g.clone(),u,y.clone()])}THREE.Geometry.call(this);this.type="BoxGeometry";this.parameters={width:a,height:b,depth:c,widthSegments:d,heightSegments:e,depthSegments:g};this.widthSegments=d||1;this.heightSegments=e||1;this.depthSegments=g||1;var h=this;d=a/2;e=b/2;g=c/2;f("z","y",-1,-1,c,b,d,0);f("z","y",1,-1,c,b,-d,1);f("x","z",1,1,a,c,e,2);f("x","z",1,-1,a,c,-e,3);f("x","y",1,-1,a,b,g,4);f("x","y",-1,-1,a,b,-g,5);this.mergeVertices()};THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype);
THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.BoxGeometry.prototype.clone=function(){return new THREE.BoxGeometry(this.parameters.width,this.parameters.height,this.parameters.depth,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.depthSegments)};THREE.CubeGeometry=THREE.BoxGeometry; THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry;THREE.BoxGeometry.prototype.clone=function(){return new THREE.BoxGeometry(this.parameters.width,this.parameters.height,this.parameters.depth,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.depthSegments)};THREE.CubeGeometry=THREE.BoxGeometry;
...@@ -746,20 +746,20 @@ THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="Circ ...@@ -746,20 +746,20 @@ THREE.CircleGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="Circ
0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([g[e].clone(),g[e+1].clone(),f.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry; 0,1);for(e=1;e<=b;e++)this.faces.push(new THREE.Face3(e,e+1,0,[c.clone(),c.clone(),c.clone()])),this.faceVertexUvs[0].push([g[e].clone(),g[e+1].clone(),f.clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry;
THREE.CircleGeometry.prototype.clone=function(){return new THREE.CircleGeometry(this.parameters.radius,this.parameters.segments,this.parameters.thetaStart,this.parameters.thetaLength)}; THREE.CircleGeometry.prototype.clone=function(){return new THREE.CircleGeometry(this.parameters.radius,this.parameters.segments,this.parameters.thetaStart,this.parameters.thetaLength)};
THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,g=new Float32Array(3*e),f=new Float32Array(3*e),e=new Float32Array(2*e);f[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var n=c+h/b*d;g[k]=a*Math.cos(n);g[k+1]=a*Math.sin(n);f[k+2]=1;e[l]=(g[k]/a+1)/2;e[l+1]=(g[k+1]/a+1)/2}c= THREE.CircleBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="CircleBufferGeometry";this.parameters={radius:a,segments:b,thetaStart:c,thetaLength:d};a=a||50;b=void 0!==b?Math.max(3,b):8;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;var e=b+2,g=new Float32Array(3*e),f=new Float32Array(3*e),e=new Float32Array(2*e);f[3]=1;e[0]=.5;e[1]=.5;for(var h=0,k=3,l=2;h<=b;h++,k+=3,l+=2){var n=c+h/b*d;g[k]=a*Math.cos(n);g[k+1]=a*Math.sin(n);f[k+2]=1;e[l]=(g[k]/a+1)/2;e[l+1]=(g[k+1]/a+1)/2}c=
[];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(g,3));this.addAttribute("normal",new THREE.BufferAttribute(f,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry; [];for(k=1;k<=b;k++)c.push(k),c.push(k+1),c.push(0);this.addAttribute("index",new THREE.IndexBufferAttribute(new Uint16Array(c),1));this.addAttribute("position",new THREE.BufferAttribute(g,3));this.addAttribute("normal",new THREE.BufferAttribute(f,3));this.addAttribute("uv",new THREE.BufferAttribute(e,2));this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry;
THREE.CircleBufferGeometry.prototype.clone=function(){var a=new THREE.CircleBufferGeometry(this.parameters.radius,this.parameters.segments,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a}; THREE.CircleBufferGeometry.prototype.clone=function(){var a=new THREE.CircleBufferGeometry(this.parameters.radius,this.parameters.segments,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a};
THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,n,p=[],m=[];for(n=0;n<=e;n++){var q=[],t=[],r=n/e,u=r*(b-a)+a;for(l=0;l<=d;l++){var w=l/d,v=new THREE.Vector3;v.x=u*Math.sin(w*h+ THREE.CylinderGeometry=function(a,b,c,d,e,g,f,h){THREE.Geometry.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:g,thetaStart:f,thetaLength:h};a=void 0!==a?a:20;b=void 0!==b?b:20;c=void 0!==c?c:100;d=d||8;e=e||1;g=void 0!==g?g:!1;f=void 0!==f?f:0;h=void 0!==h?h:2*Math.PI;var k=c/2,l,n,p=[],m=[];for(n=0;n<=e;n++){var q=[],t=[],r=n/e,u=r*(b-a)+a;for(l=0;l<=d;l++){var w=l/d,v=new THREE.Vector3;v.x=u*Math.sin(w*h+
f);v.y=-r*c+k;v.z=u*Math.cos(w*h+f);this.vertices.push(v);q.push(this.vertices.length-1);t.push(new THREE.Vector2(w,1-r))}p.push(q);m.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(f=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(f=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var q=p[n][l],t=p[n+1][l],r=p[n+1][l+1],u=p[n][l+1],w=f.clone(),v=f.clone(), f);v.y=-r*c+k;v.z=u*Math.cos(w*h+f);this.vertices.push(v);q.push(this.vertices.length-1);t.push(new THREE.Vector2(w,1-r))}p.push(q);m.push(t)}c=(b-a)/c;for(l=0;l<d;l++)for(0!==a?(f=this.vertices[p[0][l]].clone(),h=this.vertices[p[0][l+1]].clone()):(f=this.vertices[p[1][l]].clone(),h=this.vertices[p[1][l+1]].clone()),f.setY(Math.sqrt(f.x*f.x+f.z*f.z)*c).normalize(),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*c).normalize(),n=0;n<e;n++){var q=p[n][l],t=p[n+1][l],r=p[n+1][l+1],u=p[n][l+1],w=f.clone(),v=f.clone(),
y=h.clone(),x=h.clone(),E=m[n][l].clone(),B=m[n+1][l].clone(),z=m[n+1][l+1].clone(),A=m[n][l+1].clone();this.faces.push(new THREE.Face3(q,t,u,[w,v,x]));this.faceVertexUvs[0].push([E,B,A]);this.faces.push(new THREE.Face3(t,r,u,[v.clone(),y,x.clone()]));this.faceVertexUvs[0].push([B.clone(),z,A.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],t=p[0][l+1],r=this.vertices.length-1,w=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0, y=h.clone(),x=h.clone(),E=m[n][l].clone(),B=m[n+1][l].clone(),z=m[n+1][l+1].clone(),A=m[n][l+1].clone();this.faces.push(new THREE.Face3(q,t,u,[w,v,x]));this.faceVertexUvs[0].push([E,B,A]);this.faces.push(new THREE.Face3(t,r,u,[v.clone(),y,x.clone()]));this.faceVertexUvs[0].push([B.clone(),z,A.clone()])}if(!1===g&&0<a)for(this.vertices.push(new THREE.Vector3(0,k,0)),l=0;l<d;l++)q=p[0][l],t=p[0][l+1],r=this.vertices.length-1,w=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,
1,0),E=m[0][l].clone(),B=m[0][l+1].clone(),z=new THREE.Vector2(B.x,0),this.faces.push(new THREE.Face3(q,t,r,[w,v,y])),this.faceVertexUvs[0].push([E,B,z]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],t=p[e][l],r=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),E=m[e][l+1].clone(),B=m[e][l].clone(),z=new THREE.Vector2(B.x,1),this.faces.push(new THREE.Face3(q,t,r,[w,v,y])),this.faceVertexUvs[0].push([E, 1,0),E=m[0][l].clone(),B=m[0][l+1].clone(),z=new THREE.Vector2(B.x,0),this.faces.push(new THREE.Face3(q,t,r,[w,v,y],void 0,1)),this.faceVertexUvs[0].push([E,B,z]);if(!1===g&&0<b)for(this.vertices.push(new THREE.Vector3(0,-k,0)),l=0;l<d;l++)q=p[e][l+1],t=p[e][l],r=this.vertices.length-1,w=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),E=m[e][l+1].clone(),B=m[e][l].clone(),z=new THREE.Vector2(B.x,1),this.faces.push(new THREE.Face3(q,t,r,[w,v,y],void 0,2)),this.faceVertexUvs[0].push([E,
B,z]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.CylinderGeometry.prototype.clone=function(){return new THREE.CylinderGeometry(this.parameters.radiusTop,this.parameters.radiusBottom,this.parameters.height,this.parameters.radialSegments,this.parameters.heightSegments,this.parameters.openEnded,this.parameters.thetaStart,this.parameters.thetaLength)}; B,z]);this.computeFaceNormals()};THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry;THREE.CylinderGeometry.prototype.clone=function(){return new THREE.CylinderGeometry(this.parameters.radiusTop,this.parameters.radiusBottom,this.parameters.height,this.parameters.radialSegments,this.parameters.heightSegments,this.parameters.openEnded,this.parameters.thetaStart,this.parameters.thetaLength)};
THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,n=h.length;l<n;l++)for(var p=h[l],m=0;3>m;m++){d[0]=p[f[m]];d[1]=p[f[(m+1)%3]];d.sort(g);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:l, THREE.EdgesGeometry=function(a,b){THREE.BufferGeometry.call(this);var c=Math.cos(THREE.Math.degToRad(void 0!==b?b:1)),d=[0,0],e={},g=function(a,b){return a-b},f=["a","b","c"],h;a instanceof THREE.BufferGeometry?(h=new THREE.Geometry,h.fromBufferGeometry(a)):h=a.clone();h.mergeVertices();h.computeFaceNormals();var k=h.vertices;h=h.faces;for(var l=0,n=h.length;l<n;l++)for(var p=h[l],m=0;3>m;m++){d[0]=p[f[m]];d[1]=p[f[(m+1)%3]];d.sort(g);var q=d.toString();void 0===e[q]?e[q]={vert1:d[0],vert2:d[1],face1:l,
face2:void 0}:e[q].face2=l}d=[];for(q in e)if(g=e[q],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=c)f=k[g.vert1],d.push(f.x),d.push(f.y),d.push(f.z),f=k[g.vert2],d.push(f.x),d.push(f.y),d.push(f.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry; face2:void 0}:e[q].face2=l}d=[];for(q in e)if(g=e[q],void 0===g.face2||h[g.face1].normal.dot(h[g.face2].normal)<=c)f=k[g.vert1],d.push(f.x),d.push(f.y),d.push(f.z),f=k[g.vert2],d.push(f.x),d.push(f.y),d.push(f.z);this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(d),3))};THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry;
THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)}; THREE.ExtrudeGeometry=function(a,b){"undefined"!==typeof a&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",a=Array.isArray(a)?a:[a],this.addShapeList(a,b),this.computeFaceNormals())};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(a,b){for(var c=a.length,d=0;d<c;d++)this.addShape(a[d],b)};
THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a= THREE.ExtrudeGeometry.prototype.addShape=function(a,b){function c(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}function d(a,b,c){var d=1,d=a.x-b.x,e=a.y-b.y,f=c.x-a.x,g=c.y-a.y,h=d*d+e*e;if(1E-10<Math.abs(d*g-e*f)){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g),h=b.x-e/k;b=b.y+d/k;f=((c.x-g/l-h)*g-(c.y+f/l-b)*f)/(d*g-e*f);c=h+d*f-a.x;a=b+e*f-a.y;d=c*c+a*a;if(2>=d)return new THREE.Vector2(c,a);d=Math.sqrt(d/2)}else a=!1,1E-10<d?1E-10<f&&(a=
!0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(F=a.length;0<=--F;){c=F;d=F-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=T*e,h=T*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+J,g=g+J,l=l+J,h=h+J;M.faces.push(new THREE.Face3(k,g,h));M.faces.push(new THREE.Face3(g,l,h));k=w.generateSideWallUV(M,k,g,l,h);M.faceVertexUvs[0].push([k[0],k[1],k[3]]);M.faceVertexUvs[0].push([k[1], !0):-1E-10>d?-1E-10>f&&(a=!0):Math.sign(e)===Math.sign(g)&&(a=!0),a?(c=-e,a=d,d=Math.sqrt(h)):(c=d,a=e,d=Math.sqrt(h/2));return new THREE.Vector2(c/d,a/d)}function e(a,b){var c,d;for(F=a.length;0<=--F;){c=F;d=F-1;0>d&&(d=a.length-1);for(var e=0,f=q+2*n,e=0;e<f;e++){var g=T*e,h=T*(e+1),k=b+c+g,g=b+d+g,l=b+d+h,h=b+c+h,k=k+J,g=g+J,l=l+J,h=h+J;L.faces.push(new THREE.Face3(k,g,h));L.faces.push(new THREE.Face3(g,l,h));k=w.generateSideWallUV(L,k,g,l,h);L.faceVertexUvs[0].push([k[0],k[1],k[3]]);L.faceVertexUvs[0].push([k[1],
k[2],k[3]])}}}function g(a,b,c){M.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=J;b+=J;c+=J;M.faces.push(new THREE.Face3(a,b,c));a=w.generateTopUV(M,a,b,c);M.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath, k[2],k[3]])}}}function g(a,b,c){L.vertices.push(new THREE.Vector3(a,b,c))}function f(a,b,c){a+=J;b+=J;c+=J;L.faces.push(new THREE.Face3(a,b,c));a=w.generateTopUV(L,a,b,c);L.faceVertexUvs[0].push(a)}var h=void 0!==b.amount?b.amount:100,k=void 0!==b.bevelThickness?b.bevelThickness:6,l=void 0!==b.bevelSize?b.bevelSize:k-2,n=void 0!==b.bevelSegments?b.bevelSegments:3,p=void 0!==b.bevelEnabled?b.bevelEnabled:!0,m=void 0!==b.curveSegments?b.curveSegments:12,q=void 0!==b.steps?b.steps:1,t=b.extrudePath,
r,u=!1,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,y,x,E;t&&(r=t.getSpacedPoints(q),u=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,!1),y=new THREE.Vector3,x=new THREE.Vector3,E=new THREE.Vector3);p||(l=k=n=0);var B,z,A,M=this,J=this.vertices.length,t=a.extractPoints(m),m=t.shape,D=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();z=0;for(A=D.length;z<A;z++)B=D[z],THREE.Shape.Utils.isClockWise(B)&&(D[z]=B.reverse());t= r,u=!1,w=void 0!==b.UVGenerator?b.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator,v,y,x,E;t&&(r=t.getSpacedPoints(q),u=!0,p=!1,v=void 0!==b.frames?b.frames:new THREE.TubeGeometry.FrenetFrames(t,q,!1),y=new THREE.Vector3,x=new THREE.Vector3,E=new THREE.Vector3);p||(l=k=n=0);var B,z,A,L=this,J=this.vertices.length,t=a.extractPoints(m),m=t.shape,D=t.holes;if(t=!THREE.Shape.Utils.isClockWise(m)){m=m.reverse();z=0;for(A=D.length;z<A;z++)B=D[z],THREE.Shape.Utils.isClockWise(B)&&(D[z]=B.reverse());t=
!1}var P=THREE.Shape.Utils.triangulateShape(m,D),K=m;z=0;for(A=D.length;z<A;z++)B=D[z],m=m.concat(B);var C,G,H,O,Q,T=m.length,R,U=P.length,t=[],F=0;H=K.length;C=H-1;for(G=F+1;F<H;F++,C++,G++)C===H&&(C=0),G===H&&(G=0),t[F]=d(K[F],K[C],K[G]);var $=[],ea,aa=t.concat();z=0;for(A=D.length;z<A;z++){B=D[z];ea=[];F=0;H=B.length;C=H-1;for(G=F+1;F<H;F++,C++,G++)C===H&&(C=0),G===H&&(G=0),ea[F]=d(B[F],B[C],B[G]);$.push(ea);aa=aa.concat(ea)}for(C=0;C<n;C++){H=C/n;O=k*(1-H);G=l*Math.sin(H*Math.PI/2);F=0;for(H= !1}var P=THREE.Shape.Utils.triangulateShape(m,D),K=m;z=0;for(A=D.length;z<A;z++)B=D[z],m=m.concat(B);var C,G,H,O,Q,T=m.length,R,U=P.length,t=[],F=0;H=K.length;C=H-1;for(G=F+1;F<H;F++,C++,G++)C===H&&(C=0),G===H&&(G=0),t[F]=d(K[F],K[C],K[G]);var $=[],ea,aa=t.concat();z=0;for(A=D.length;z<A;z++){B=D[z];ea=[];F=0;H=B.length;C=H-1;for(G=F+1;F<H;F++,C++,G++)C===H&&(C=0),G===H&&(G=0),ea[F]=d(B[F],B[C],B[G]);$.push(ea);aa=aa.concat(ea)}for(C=0;C<n;C++){H=C/n;O=k*(1-H);G=l*Math.sin(H*Math.PI/2);F=0;for(H=
K.length;F<H;F++)Q=c(K[F],t[F],G),g(Q.x,Q.y,-O);z=0;for(A=D.length;z<A;z++)for(B=D[z],ea=$[z],F=0,H=B.length;F<H;F++)Q=c(B[F],ea[F],G),g(Q.x,Q.y,-O)}G=l;for(F=0;F<T;F++)Q=p?c(m[F],aa[F],G):m[F],u?(x.copy(v.normals[0]).multiplyScalar(Q.x),y.copy(v.binormals[0]).multiplyScalar(Q.y),E.copy(r[0]).add(x).add(y),g(E.x,E.y,E.z)):g(Q.x,Q.y,0);for(H=1;H<=q;H++)for(F=0;F<T;F++)Q=p?c(m[F],aa[F],G):m[F],u?(x.copy(v.normals[H]).multiplyScalar(Q.x),y.copy(v.binormals[H]).multiplyScalar(Q.y),E.copy(r[H]).add(x).add(y), K.length;F<H;F++)Q=c(K[F],t[F],G),g(Q.x,Q.y,-O);z=0;for(A=D.length;z<A;z++)for(B=D[z],ea=$[z],F=0,H=B.length;F<H;F++)Q=c(B[F],ea[F],G),g(Q.x,Q.y,-O)}G=l;for(F=0;F<T;F++)Q=p?c(m[F],aa[F],G):m[F],u?(x.copy(v.normals[0]).multiplyScalar(Q.x),y.copy(v.binormals[0]).multiplyScalar(Q.y),E.copy(r[0]).add(x).add(y),g(E.x,E.y,E.z)):g(Q.x,Q.y,0);for(H=1;H<=q;H++)for(F=0;F<T;F++)Q=p?c(m[F],aa[F],G):m[F],u?(x.copy(v.normals[H]).multiplyScalar(Q.x),y.copy(v.binormals[H]).multiplyScalar(Q.y),E.copy(r[H]).add(x).add(y),
g(E.x,E.y,E.z)):g(Q.x,Q.y,h/q*H);for(C=n-1;0<=C;C--){H=C/n;O=k*(1-H);G=l*Math.sin(H*Math.PI/2);F=0;for(H=K.length;F<H;F++)Q=c(K[F],t[F],G),g(Q.x,Q.y,h+O);z=0;for(A=D.length;z<A;z++)for(B=D[z],ea=$[z],F=0,H=B.length;F<H;F++)Q=c(B[F],ea[F],G),u?g(Q.x,Q.y+r[q-1].y,r[q-1].x+O):g(Q.x,Q.y,h+O)}(function(){if(p){var a;a=0*T;for(F=0;F<U;F++)R=P[F],f(R[2]+a,R[1]+a,R[0]+a);a=q+2*n;a*=T;for(F=0;F<U;F++)R=P[F],f(R[0]+a,R[1]+a,R[2]+a)}else{for(F=0;F<U;F++)R=P[F],f(R[2],R[1],R[0]);for(F=0;F<U;F++)R=P[F],f(R[0]+ g(E.x,E.y,E.z)):g(Q.x,Q.y,h/q*H);for(C=n-1;0<=C;C--){H=C/n;O=k*(1-H);G=l*Math.sin(H*Math.PI/2);F=0;for(H=K.length;F<H;F++)Q=c(K[F],t[F],G),g(Q.x,Q.y,h+O);z=0;for(A=D.length;z<A;z++)for(B=D[z],ea=$[z],F=0,H=B.length;F<H;F++)Q=c(B[F],ea[F],G),u?g(Q.x,Q.y+r[q-1].y,r[q-1].x+O):g(Q.x,Q.y,h+O)}(function(){if(p){var a;a=0*T;for(F=0;F<U;F++)R=P[F],f(R[2]+a,R[1]+a,R[0]+a);a=q+2*n;a*=T;for(F=0;F<U;F++)R=P[F],f(R[0]+a,R[1]+a,R[2]+a)}else{for(F=0;F<U;F++)R=P[F],f(R[2],R[1],R[0]);for(F=0;F<U;F++)R=P[F],f(R[0]+
...@@ -773,8 +773,8 @@ m+g,r=q+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([ne ...@@ -773,8 +773,8 @@ m+g,r=q+e;this.faces.push(new THREE.Face3(b,d,n));this.faceVertexUvs[0].push([ne
THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry; THREE.PlaneGeometry=function(a,b,c,d){THREE.Geometry.call(this);this.type="PlaneGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};this.fromBufferGeometry(new THREE.PlaneBufferGeometry(a,b,c,d))};THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry;
THREE.PlaneGeometry.prototype.clone=function(){return new THREE.PlaneGeometry(this.parameters.width,this.parameters.height,this.parameters.widthSegments,this.parameters.heightSegments)}; THREE.PlaneGeometry.prototype.clone=function(){return new THREE.PlaneGeometry(this.parameters.width,this.parameters.height,this.parameters.widthSegments,this.parameters.heightSegments)};
THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,g=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var f=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var n=new Float32Array(f*h*2),p=0,m=0,q=0;q<h;q++)for(var t=q*l-g,r=0;r<f;r++)b[p]=r*k-e,b[p+1]=-t,a[p+2]=1,n[m]=r/c,n[m+1]=1-q/d,p+=3,m+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c* THREE.PlaneBufferGeometry=function(a,b,c,d){THREE.BufferGeometry.call(this);this.type="PlaneBufferGeometry";this.parameters={width:a,height:b,widthSegments:c,heightSegments:d};var e=a/2,g=b/2;c=Math.floor(c)||1;d=Math.floor(d)||1;var f=c+1,h=d+1,k=a/c,l=b/d;b=new Float32Array(f*h*3);a=new Float32Array(f*h*3);for(var n=new Float32Array(f*h*2),p=0,m=0,q=0;q<h;q++)for(var t=q*l-g,r=0;r<f;r++)b[p]=r*k-e,b[p+1]=-t,a[p+2]=1,n[m]=r/c,n[m+1]=1-q/d,p+=3,m+=2;p=0;e=new (65535<b.length/3?Uint32Array:Uint16Array)(c*
d*6);for(q=0;q<d;q++)for(r=0;r<c;r++)g=r+f*(q+1),h=r+1+f*(q+1),k=r+1+f*q,e[p]=r+f*q,e[p+1]=g,e[p+2]=k,e[p+3]=g,e[p+4]=h,e[p+5]=k,p+=6;this.addAttribute("index",new THREE.BufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(n,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry; d*6);for(q=0;q<d;q++)for(r=0;r<c;r++)g=r+f*(q+1),h=r+1+f*(q+1),k=r+1+f*q,e[p]=r+f*q,e[p+1]=g,e[p+2]=k,e[p+3]=g,e[p+4]=h,e[p+5]=k,p+=6;this.addAttribute("index",new THREE.IndexBufferAttribute(e,1));this.addAttribute("position",new THREE.BufferAttribute(b,3));this.addAttribute("normal",new THREE.BufferAttribute(a,3));this.addAttribute("uv",new THREE.BufferAttribute(n,2))};THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);
THREE.PlaneBufferGeometry.prototype.clone=function(){var a=new THREE.PlaneBufferGeometry(this.parameters.width,this.parameters.height,this.parameters.widthSegments,this.parameters.heightSegments);a.copy(this);return a}; THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry;THREE.PlaneBufferGeometry.prototype.clone=function(){var a=new THREE.PlaneBufferGeometry(this.parameters.width,this.parameters.height,this.parameters.widthSegments,this.parameters.heightSegments);a.copy(this);return a};
THREE.RingGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:g};a=a||0;b=b||50;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var f,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(f=0;f<c+1;f++){var n=new THREE.Vector3,p=e+f/c*g;n.x=k*Math.cos(p);n.y=k*Math.sin(p);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2, THREE.RingGeometry=function(a,b,c,d,e,g){THREE.Geometry.call(this);this.type="RingGeometry";this.parameters={innerRadius:a,outerRadius:b,thetaSegments:c,phiSegments:d,thetaStart:e,thetaLength:g};a=a||0;b=b||50;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;c=void 0!==c?Math.max(3,c):8;d=void 0!==d?Math.max(1,d):8;var f,h=[],k=a,l=(b-a)/d;for(a=0;a<d+1;a++){for(f=0;f<c+1;f++){var n=new THREE.Vector3,p=e+f/c*g;n.x=k*Math.cos(p);n.y=k*Math.sin(p);this.vertices.push(n);h.push(new THREE.Vector2((n.x/b+1)/2,
(n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),f=0;f<c;f++)g=p=f+e,l=p+c+1,n=p+c+2,this.faces.push(new THREE.Face3(g,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[l].clone(),h[n].clone()]),g=p,l=p+c+2,n=p+1,this.faces.push(new THREE.Face3(g,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[l].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)}; (n.y/b+1)/2))}k+=l}b=new THREE.Vector3(0,0,1);for(a=0;a<d;a++)for(e=a*(c+1),f=0;f<c;f++)g=p=f+e,l=p+c+1,n=p+c+2,this.faces.push(new THREE.Face3(g,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[l].clone(),h[n].clone()]),g=p,l=p+c+2,n=p+1,this.faces.push(new THREE.Face3(g,l,n,[b.clone(),b.clone(),b.clone()])),this.faceVertexUvs[0].push([h[g].clone(),h[l].clone(),h[n].clone()]);this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,k)};
THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;THREE.RingGeometry.prototype.clone=function(){return new THREE.RingGeometry(this.parameters.innerRadius,this.parameters.outerRadius,this.parameters.thetaSegments,this.parameters.phiSegments,this.parameters.thetaStart,this.parameters.thetaLength)}; THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.RingGeometry.prototype.constructor=THREE.RingGeometry;THREE.RingGeometry.prototype.clone=function(){return new THREE.RingGeometry(this.parameters.innerRadius,this.parameters.outerRadius,this.parameters.thetaSegments,this.parameters.phiSegments,this.parameters.thetaStart,this.parameters.thetaLength)};
...@@ -784,7 +784,7 @@ r=n[k][h+1].clone(),u=n[k][h].clone(),w=n[k+1][h].clone(),v=n[k+1][h+1].clone(); ...@@ -784,7 +784,7 @@ r=n[k][h+1].clone(),u=n[k][h].clone(),w=n[k+1][h].clone(),v=n[k+1][h+1].clone();
w,v.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.SphereGeometry.prototype.clone=function(){return new THREE.SphereGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength)}; w,v.clone()]))}this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry;THREE.SphereGeometry.prototype.clone=function(){return new THREE.SphereGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength)};
THREE.SphereBufferGeometry=function(a,b,c,d,e,g,f){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;for(var h=g+f,k=(b+1)*(c+1),l=new THREE.BufferAttribute(new Float32Array(3*k),3),n=new THREE.BufferAttribute(new Float32Array(3* THREE.SphereBufferGeometry=function(a,b,c,d,e,g,f){THREE.BufferGeometry.call(this);this.type="SphereBufferGeometry";this.parameters={radius:a,widthSegments:b,heightSegments:c,phiStart:d,phiLength:e,thetaStart:g,thetaLength:f};a=a||50;b=Math.max(3,Math.floor(b)||8);c=Math.max(2,Math.floor(c)||6);d=void 0!==d?d:0;e=void 0!==e?e:2*Math.PI;g=void 0!==g?g:0;f=void 0!==f?f:Math.PI;for(var h=g+f,k=(b+1)*(c+1),l=new THREE.BufferAttribute(new Float32Array(3*k),3),n=new THREE.BufferAttribute(new Float32Array(3*
k),3),k=new THREE.BufferAttribute(new Float32Array(2*k),2),p=0,m=[],q=new THREE.Vector3,t=0;t<=c;t++){for(var r=[],u=t/c,w=0;w<=b;w++){var v=w/b,y=-a*Math.cos(d+v*e)*Math.sin(g+u*f),x=a*Math.cos(g+u*f),E=a*Math.sin(d+v*e)*Math.sin(g+u*f);q.set(y,x,E).normalize();l.setXYZ(p,y,x,E);n.setXYZ(p,q.x,q.y,q.z);k.setXY(p,v,1-u);r.push(p);p++}m.push(r)}d=[];for(t=0;t<c;t++)for(w=0;w<b;w++)e=m[t][w+1],f=m[t][w],p=m[t+1][w],q=m[t+1][w+1],(0!==t||0<g)&&d.push(e,f,q),(t!==c-1||h<Math.PI)&&d.push(f,p,q);this.addAttribute("index", k),3),k=new THREE.BufferAttribute(new Float32Array(2*k),2),p=0,m=[],q=new THREE.Vector3,t=0;t<=c;t++){for(var r=[],u=t/c,w=0;w<=b;w++){var v=w/b,y=-a*Math.cos(d+v*e)*Math.sin(g+u*f),x=a*Math.cos(g+u*f),E=a*Math.sin(d+v*e)*Math.sin(g+u*f);q.set(y,x,E).normalize();l.setXYZ(p,y,x,E);n.setXYZ(p,q.x,q.y,q.z);k.setXY(p,v,1-u);r.push(p);p++}m.push(r)}d=[];for(t=0;t<c;t++)for(w=0;w<b;w++)e=m[t][w+1],f=m[t][w],p=m[t+1][w],q=m[t+1][w+1],(0!==t||0<g)&&d.push(e,f,q),(t!==c-1||h<Math.PI)&&d.push(f,p,q);this.addAttribute("index",
new THREE.BufferAttribute(new Uint16Array(d),1));this.addAttribute("position",l);this.addAttribute("normal",n);this.addAttribute("uv",k);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry; new THREE.IndexBufferAttribute(new Uint16Array(d),1));this.addAttribute("position",l);this.addAttribute("normal",n);this.addAttribute("uv",k);this.boundingSphere=new THREE.Sphere(new THREE.Vector3,a)};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;
THREE.SphereBufferGeometry.prototype.clone=function(){var a=new THREE.SphereBufferGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a}; THREE.SphereBufferGeometry.prototype.clone=function(){var a=new THREE.SphereBufferGeometry(this.parameters.radius,this.parameters.widthSegments,this.parameters.heightSegments,this.parameters.phiStart,this.parameters.phiLength,this.parameters.thetaStart,this.parameters.thetaLength);a.copy(this);return a};
THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TextGeometry.prototype.constructor=THREE.TextGeometry; THREE.TextGeometry=function(a,b){b=b||{};var c=THREE.FontUtils.generateShapes(a,b);b.amount=void 0!==b.height?b.height:50;void 0===b.bevelThickness&&(b.bevelThickness=10);void 0===b.bevelSize&&(b.bevelSize=8);void 0===b.bevelEnabled&&(b.bevelEnabled=!1);THREE.ExtrudeGeometry.call(this,c,b);this.type="TextGeometry"};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;
THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var g=new THREE.Vector3,f=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var n=l/d*e,p=k/c*Math.PI*2;g.x=a*Math.cos(n);g.y=a*Math.sin(n);var m=new THREE.Vector3;m.x=(a+b*Math.cos(p))*Math.cos(n);m.y=(a+b*Math.cos(p))*Math.sin(n);m.z=b*Math.sin(p);this.vertices.push(m);f.push(new THREE.Vector2(l/ THREE.TorusGeometry=function(a,b,c,d,e){THREE.Geometry.call(this);this.type="TorusGeometry";this.parameters={radius:a,tube:b,radialSegments:c,tubularSegments:d,arc:e};a=a||100;b=b||40;c=c||8;d=d||6;e=e||2*Math.PI;for(var g=new THREE.Vector3,f=[],h=[],k=0;k<=c;k++)for(var l=0;l<=d;l++){var n=l/d*e,p=k/c*Math.PI*2;g.x=a*Math.cos(n);g.y=a*Math.sin(n);var m=new THREE.Vector3;m.x=(a+b*Math.cos(p))*Math.cos(n);m.y=(a+b*Math.cos(p))*Math.sin(n);m.z=b*Math.sin(p);this.vertices.push(m);f.push(new THREE.Vector2(l/
...@@ -799,9 +799,9 @@ n/d*2*Math.PI,q=-m*Math.cos(p),p=m*Math.sin(p),r.copy(t),r.x+=q*h.x+p*k.x,r.y+=q ...@@ -799,9 +799,9 @@ n/d*2*Math.PI,q=-m*Math.cos(p),p=m*Math.sin(p),r.copy(t),r.x+=q*h.x+p*k.x,r.y+=q
g,l)),this.faceVertexUvs[0].push([w.clone(),v,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)}; g,l)),this.faceVertexUvs[0].push([w.clone(),v,h.clone()]);this.computeFaceNormals();this.computeVertexNormals()};THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry;THREE.TubeGeometry.NoTaper=function(a){return 1};THREE.TubeGeometry.SinusoidalTaper=function(a){return Math.sin(Math.PI*a)};
THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,p;this.tangents=e;this.normals=g;this.binormals=f;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();g[0].crossVectors(e[0], THREE.TubeGeometry.FrenetFrames=function(a,b,c){var d=new THREE.Vector3,e=[],g=[],f=[],h=new THREE.Vector3,k=new THREE.Matrix4;b+=1;var l,n,p;this.tangents=e;this.normals=g;this.binormals=f;for(l=0;l<b;l++)n=l/(b-1),e[l]=a.getTangentAt(n),e[l].normalize();g[0]=new THREE.Vector3;f[0]=new THREE.Vector3;a=Number.MAX_VALUE;l=Math.abs(e[0].x);n=Math.abs(e[0].y);p=Math.abs(e[0].z);l<=a&&(a=l,d.set(1,0,0));n<=a&&(a=n,d.set(0,1,0));p<=a&&d.set(0,0,1);h.crossVectors(e[0],d).normalize();g[0].crossVectors(e[0],
h);f[0].crossVectors(e[0],g[0]);for(l=1;l<b;l++)g[l]=g[l-1].clone(),f[l]=f[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),g[l].applyMatrix4(k.makeRotationAxis(h,d))),f[l].crossVectors(e[l],g[l]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(g[0],g[b-1]))&&(d=-d),l=1;l<b;l++)g[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),f[l].crossVectors(e[l],g[l])}; h);f[0].crossVectors(e[0],g[0]);for(l=1;l<b;l++)g[l]=g[l-1].clone(),f[l]=f[l-1].clone(),h.crossVectors(e[l-1],e[l]),1E-4<h.length()&&(h.normalize(),d=Math.acos(THREE.Math.clamp(e[l-1].dot(e[l]),-1,1)),g[l].applyMatrix4(k.makeRotationAxis(h,d))),f[l].crossVectors(e[l],g[l]);if(c)for(d=Math.acos(THREE.Math.clamp(g[0].dot(g[b-1]),-1,1)),d/=b-1,0<e[0].dot(h.crossVectors(g[0],g[b-1]))&&(d=-d),l=1;l<b;l++)g[l].applyMatrix4(k.makeRotationAxis(e[l],d*l)),f[l].crossVectors(e[l],g[l])};
THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function g(a,b,c){var d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()]);k.faces.push(d);u.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(u.z,-u.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function f(a, THREE.PolyhedronGeometry=function(a,b,c,d){function e(a){var b=a.normalize().clone();b.index=k.vertices.push(b)-1;var c=Math.atan2(a.z,-a.x)/2/Math.PI+.5;a=Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+.5;b.uv=new THREE.Vector2(c,1-a);return b}function g(a,b,c,d){d=new THREE.Face3(a.index,b.index,c.index,[a.clone(),b.clone(),c.clone()],void 0,d);k.faces.push(d);u.copy(a).add(b).add(c).divideScalar(3);d=Math.atan2(u.z,-u.x);k.faceVertexUvs[0].push([h(a.uv,a,d),h(b.uv,b,d),h(c.uv,c,d)])}function f(a,
b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),f=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=0;m<=c;m++){l[m]=[];for(var n=e(d.clone().lerp(h,m/c)),p=e(f.clone().lerp(h,m/c)),q=c-m,r=0;r<=q;r++)l[m][r]=0===r&&m===c?n:e(n.clone().lerp(p,r/q))}for(m=0;m<c;m++)for(r=0;r<2*(c-m)-1;r++)d=Math.floor(r/2),0===r%2?g(l[m][d+1],l[m+1][d],l[m][d]):g(l[m][d+1],l[m+1][d+1],l[m+1][d])}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/2/Math.PI+.5,a.y)); b){for(var c=Math.pow(2,b),d=e(k.vertices[a.a]),f=e(k.vertices[a.b]),h=e(k.vertices[a.c]),l=[],m=a.materialIndex,n=0;n<=c;n++){l[n]=[];for(var p=e(d.clone().lerp(h,n/c)),q=e(f.clone().lerp(h,n/c)),r=c-n,t=0;t<=r;t++)l[n][t]=0===t&&n===c?p:e(p.clone().lerp(q,t/r))}for(n=0;n<c;n++)for(t=0;t<2*(c-n)-1;t++)d=Math.floor(t/2),0===t%2?g(l[n][d+1],l[n+1][d],l[n][d],m):g(l[n][d+1],l[n+1][d+1],l[n+1][d],m)}function h(a,b,c){0>c&&1===a.x&&(a=new THREE.Vector2(a.x-1,a.y));0===b.x&&0===b.z&&(a=new THREE.Vector2(c/
return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,l=0,n=a.length;l<n;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],m=l=0,n=b.length;l<n;l+=3,m++){var q=a[b[l]],t=a[b[l+1]],r=a[b[l+2]];p[m]=new THREE.Face3(q.index,t.index,r.index,[q.clone(),t.clone(),r.clone()])}for(var u=new THREE.Vector3,l=0,n=p.length;l<n;l++)f(p[l],d);l=0;for(n=this.faceVertexUvs[0].length;l< 2/Math.PI+.5,a.y));return a.clone()}THREE.Geometry.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c=c||1;d=d||0;for(var k=this,l=0,n=a.length;l<n;l+=3)e(new THREE.Vector3(a[l],a[l+1],a[l+2]));a=this.vertices;for(var p=[],m=l=0,n=b.length;l<n;l+=3,m++){var q=a[b[l]],t=a[b[l+1]],r=a[b[l+2]];p[m]=new THREE.Face3(q.index,t.index,r.index,[q.clone(),t.clone(),r.clone()],void 0,m)}for(var u=new THREE.Vector3,l=0,n=p.length;l<n;l++)f(p[l],d);l=0;for(n=this.faceVertexUvs[0].length;l<
n;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,p=b[2].x,m=Math.max(d,Math.max(a,p)),q=Math.min(d,Math.min(a,p)),.9<m&&.1>q&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));l=0;for(n=this.vertices.length;l<n;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry; n;l++)b=this.faceVertexUvs[0][l],d=b[0].x,a=b[1].x,p=b[2].x,m=Math.max(d,Math.max(a,p)),q=Math.min(d,Math.min(a,p)),.9<m&&.1>q&&(.2>d&&(b[0].x+=1),.2>a&&(b[1].x+=1),.2>p&&(b[2].x+=1));l=0;for(n=this.vertices.length;l<n;l++)this.vertices[l].multiplyScalar(c);this.mergeVertices();this.computeFaceNormals();this.boundingSphere=new THREE.Sphere(new THREE.Vector3,c)};THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry;
THREE.PolyhedronGeometry.prototype.clone=function(){return(new THREE.PolyhedronGeometry(this.parameters.vertices,this.parameters.indices,this.parameters.radius,this.parameters.detail)).copy(this)};THREE.PolyhedronGeometry.prototype.copy=function(a){THREE.Geometry.prototype.copy.call(this,a);return this}; THREE.PolyhedronGeometry.prototype.clone=function(){return(new THREE.PolyhedronGeometry(this.parameters.vertices,this.parameters.indices,this.parameters.radius,this.parameters.detail)).copy(this)};THREE.PolyhedronGeometry.prototype.copy=function(a){THREE.Geometry.prototype.copy.call(this,a);return this};
THREE.DodecahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1, THREE.DodecahedronGeometry=function(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-d,-c,0,-d,c,0,d,-c,0,d,c,-d,-c,0,-d,c,0,d,-c,0,d,c,0,-c,0,-d,c,0,-d,-c,0,d,c,0,d],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,
......
...@@ -12,4 +12,4 @@ THREE.DynamicBufferAttribute = function ( array, itemSize ) { ...@@ -12,4 +12,4 @@ THREE.DynamicBufferAttribute = function ( array, itemSize ) {
}; };
THREE.DynamicBufferAttribute.prototype = Object.create( THREE.BufferAttribute.prototype ); THREE.DynamicBufferAttribute.prototype = Object.create( THREE.BufferAttribute.prototype );
THREE.DynamicBufferAttribute.prototype.constructor = THREE.DynamicBufferAttribute; THREE.DynamicBufferAttribute.prototype.constructor = THREE.DynamicBufferAttribute;
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册