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

Updated builds.

上级 7e18d182
......@@ -7642,7 +7642,7 @@ THREE.Object3D.prototype = {
var result = optionalTarget || new THREE.Euler();
this.worldQuaternion( quaternion );
this.getWorldQuaternion( quaternion );
return result.setFromQuaternion( quaternion, this.rotation.order, false );
......@@ -7677,7 +7677,7 @@ THREE.Object3D.prototype = {
var result = optionalTarget || new THREE.Vector3();
this.worldQuaternion( quaternion );
this.getWorldQuaternion( quaternion );
return result.set( 0, 0, 1 ).applyQuaternion( quaternion );
......@@ -10260,7 +10260,7 @@ THREE.Camera.prototype.getWorldDirection = function () {
var result = optionalTarget || new THREE.Vector3();
this.worldQuaternion( quaternion );
this.getWorldQuaternion( quaternion );
return result.set( 0, 0, - 1 ).applyQuaternion( quaternion );
......@@ -18296,6 +18296,8 @@ THREE.WebGLRenderer = function ( parameters ) {
}
delete geometryGroups[ geometry.id ];
} else {
deleteBuffers( geometry );
......
......@@ -161,12 +161,12 @@ return this}}(),translate:function(a,b){console.warn("THREE.Object3D: .translate
b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new THREE.Matrix4;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a=new THREE.Matrix4;return function(b){a.lookAt(b,this.position,this.up);this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.add(arguments[b]);return this}if(a===this)return console.error("THREE.Object3D.add:",
a,"can't be added as a child of itself."),this;a instanceof THREE.Object3D?(void 0!==a.parent&&a.parent.remove(a),a.parent=this,a.dispatchEvent({type:"added"}),this.children.push(a)):console.error("THREE.Object3D.add:",a,"is not an instance of THREE.Object3D.");return this},remove:function(a){if(1<arguments.length)for(var b=0;b<arguments.length;b++)this.remove(arguments[b]);b=this.children.indexOf(a);-1!==b&&(a.parent=void 0,a.dispatchEvent({type:"removed"}),this.children.splice(b,1))},getChildByName:function(a,
b){console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().");return this.getObjectByName(a,b)},getObjectById:function(a,b){if(this.id===a)return this;for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c].getObjectById(a,b);if(void 0!==e)return e}},getObjectByName:function(a,b){if(this.name===a)return this;for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c].getObjectByName(a,b);if(void 0!==e)return e}},getWorldPosition:function(a){a=a||new THREE.Vector3;
this.updateMatrixWorld(!0);return a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){c=c||new THREE.Quaternion;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,c,b);return c}}(),getWorldRotation:function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Euler;this.worldQuaternion(a);return b.setFromQuaternion(a,this.rotation.order,!1)}}(),getWorldScale:function(){var a=new THREE.Vector3,b=new THREE.Quaternion;
return function(c){c=c||new THREE.Vector3;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,b,c);return c}}(),getWorldDirection:function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.worldQuaternion(a);return b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverseVisible(a)}},
updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},toJSON:function(){var a=
{metadata:{version:4.3,type:"Object",generator:"ObjectExporter"}},b={},c={},d=function(b){void 0===a.materials&&(a.materials=[]);if(void 0===c[b.uuid]){var d=b.toJSON();delete d.metadata;c[b.uuid]=d;a.materials.push(d)}return b.uuid},e=function(c){var f={};f.uuid=c.uuid;f.type=c.type;""!==c.name&&(f.name=c.name);"{}"!==JSON.stringify(c.userData)&&(f.userData=c.userData);!0!==c.visible&&(f.visible=c.visible);if(c instanceof THREE.PerspectiveCamera)f.fov=c.fov,f.aspect=c.aspect,f.near=c.near,f.far=
c.far;else if(c instanceof THREE.OrthographicCamera)f.left=c.left,f.right=c.right,f.top=c.top,f.bottom=c.bottom,f.near=c.near,f.far=c.far;else if(c instanceof THREE.AmbientLight)f.color=c.color.getHex();else if(c instanceof THREE.DirectionalLight)f.color=c.color.getHex(),f.intensity=c.intensity;else if(c instanceof THREE.PointLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=c.distance;else if(c instanceof THREE.SpotLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=
c.distance,f.angle=c.angle,f.exponent=c.exponent;else if(c instanceof THREE.HemisphereLight)f.color=c.color.getHex(),f.groundColor=c.groundColor.getHex();else if(c instanceof THREE.Mesh){var h=c.geometry;void 0===a.geometries&&(a.geometries=[]);if(void 0===b[h.uuid]){var k=h.toJSON();delete k.metadata;b[h.uuid]=k;a.geometries.push(k)}f.geometry=h.uuid;f.material=d(c.material)}else c instanceof THREE.Sprite&&(f.material=d(c.material));f.matrix=c.matrix.toArray();if(0<c.children.length)for(f.children=
this.updateMatrixWorld(!0);return a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new THREE.Vector3,b=new THREE.Vector3;return function(c){c=c||new THREE.Quaternion;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,c,b);return c}}(),getWorldRotation:function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Euler;this.getWorldQuaternion(a);return b.setFromQuaternion(a,this.rotation.order,!1)}}(),getWorldScale:function(){var a=new THREE.Vector3,b=new THREE.Quaternion;
return function(c){c=c||new THREE.Vector3;this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,b,c);return c}}(),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)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=0,c=this.children.length;b<c;b++)this.children[b].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=0,c=this.children.length;b<
c;b++)this.children[b].traverseVisible(a)}},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){!0===this.matrixAutoUpdate&&this.updateMatrix();if(!0===this.matrixWorldNeedsUpdate||!0===a)void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=0,c=this.children.length;b<c;b++)this.children[b].updateMatrixWorld(a)},
toJSON:function(){var a={metadata:{version:4.3,type:"Object",generator:"ObjectExporter"}},b={},c={},d=function(b){void 0===a.materials&&(a.materials=[]);if(void 0===c[b.uuid]){var d=b.toJSON();delete d.metadata;c[b.uuid]=d;a.materials.push(d)}return b.uuid},e=function(c){var f={};f.uuid=c.uuid;f.type=c.type;""!==c.name&&(f.name=c.name);"{}"!==JSON.stringify(c.userData)&&(f.userData=c.userData);!0!==c.visible&&(f.visible=c.visible);if(c instanceof THREE.PerspectiveCamera)f.fov=c.fov,f.aspect=c.aspect,
f.near=c.near,f.far=c.far;else if(c instanceof THREE.OrthographicCamera)f.left=c.left,f.right=c.right,f.top=c.top,f.bottom=c.bottom,f.near=c.near,f.far=c.far;else if(c instanceof THREE.AmbientLight)f.color=c.color.getHex();else if(c instanceof THREE.DirectionalLight)f.color=c.color.getHex(),f.intensity=c.intensity;else if(c instanceof THREE.PointLight)f.color=c.color.getHex(),f.intensity=c.intensity,f.distance=c.distance;else if(c instanceof THREE.SpotLight)f.color=c.color.getHex(),f.intensity=c.intensity,
f.distance=c.distance,f.angle=c.angle,f.exponent=c.exponent;else if(c instanceof THREE.HemisphereLight)f.color=c.color.getHex(),f.groundColor=c.groundColor.getHex();else if(c instanceof THREE.Mesh){var h=c.geometry;void 0===a.geometries&&(a.geometries=[]);if(void 0===b[h.uuid]){var k=h.toJSON();delete k.metadata;b[h.uuid]=k;a.geometries.push(k)}f.geometry=h.uuid;f.material=d(c.material)}else c instanceof THREE.Sprite&&(f.material=d(c.material));f.matrix=c.matrix.toArray();if(0<c.children.length)for(f.children=
[],h=0;h<c.children.length;h++)f.children.push(e(c.children[h]));return f};a.object=e(this);return a},clone:function(a,b){void 0===a&&(a=new THREE.Object3D);void 0===b&&(b=!0);a.name=this.name;a.up.copy(this.up);a.position.copy(this.position);a.quaternion.copy(this.quaternion);a.scale.copy(this.scale);a.renderDepth=this.renderDepth;a.rotationAutoUpdate=this.rotationAutoUpdate;a.matrix.copy(this.matrix);a.matrixWorld.copy(this.matrixWorld);a.matrixAutoUpdate=this.matrixAutoUpdate;a.matrixWorldNeedsUpdate=
this.matrixWorldNeedsUpdate;a.visible=this.visible;a.castShadow=this.castShadow;a.receiveShadow=this.receiveShadow;a.frustumCulled=this.frustumCulled;a.userData=JSON.parse(JSON.stringify(this.userData));if(!0===b)for(var c=0;c<this.children.length;c++)a.add(this.children[c].clone());return a}};THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype);THREE.Object3DIdCount=0;
THREE.Projector=function(){console.warn("THREE.Projector has been moved to /examples/renderers/Projector.js.");this.projectVector=function(a,b){console.warn("THREE.Projector: .projectVector() is now vector.project().");a.project(b)};this.unprojectVector=function(a,b){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject().");a.unproject(b)};this.pickingRay=function(a,b){console.error("THREE.Projector: .pickingRay() has been removed.")}};
......@@ -218,7 +218,7 @@ f.vertexColors,t=new THREE.Face3(f.a+e,f.b+e,f.c+e);t.normal.copy(f.normal);void
a.y);return q[b]}var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=this.parameters,f;for(f in g)void 0!==g[f]&&(e[f]=g[f]);return e}g=[];for(f=0;f<this.vertices.length;f++){var h=this.vertices[f];g.push(h.x,h.y,h.z)}var h=[],k=[],n={},p=[],m={},t=[],q={};for(f=0;f<this.faces.length;f++){var s=this.faces[f],r=void 0!==this.faceVertexUvs[0][f],v=0<s.normal.length(),
w=0<s.vertexNormals.length,u=1!==s.color.r||1!==s.color.g||1!==s.color.b,A=0<s.vertexColors.length,x=0,x=a(x,0,0),x=a(x,1,!1),x=a(x,2,!1),x=a(x,3,r),x=a(x,4,v),x=a(x,5,w),x=a(x,6,u),x=a(x,7,A);h.push(x);h.push(s.a,s.b,s.c);r&&(r=this.faceVertexUvs[0][f],h.push(d(r[0]),d(r[1]),d(r[2])));v&&h.push(b(s.normal));w&&(v=s.vertexNormals,h.push(b(v[0]),b(v[1]),b(v[2])));u&&h.push(c(s.color));A&&(s=s.vertexColors,h.push(c(s[0]),c(s[1]),c(s[2])))}e.data={};e.data.vertices=g;e.data.normals=k;0<p.length&&(e.data.colors=
p);0<t.length&&(e.data.uvs=[t]);e.data.faces=h;return e},clone:function(){for(var a=new THREE.Geometry,b=this.vertices,c=0,d=b.length;c<d;c++)a.vertices.push(b[c].clone());b=this.faces;c=0;for(d=b.length;c<d;c++)a.faces.push(b[c].clone());b=this.faceVertexUvs[0];c=0;for(d=b.length;c<d;c++){for(var e=b[c],g=[],f=0,h=e.length;f<h;f++)g.push(new THREE.Vector2(e[f].x,e[f].y));a.faceVertexUvs[0].push(g)}return a},dispose:function(){this.dispatchEvent({type:"dispose"})}};THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype);
THREE.GeometryIdCount=0;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.getWorldDirection=function(){var a=new THREE.Quaternion;return function(b){b=b||new THREE.Vector3;this.worldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}();
THREE.GeometryIdCount=0;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.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(a){void 0===a&&(a=new THREE.Camera);THREE.Object3D.prototype.clone.call(this,a);a.matrixWorldInverse.copy(this.matrixWorldInverse);a.projectionMatrix.copy(this.projectionMatrix);return a};
THREE.CubeCamera=function(a,b,c){THREE.Object3D.call(this);this.type="CubeCamera";var d=new THREE.PerspectiveCamera(90,1,a,b);d.up.set(0,-1,0);d.lookAt(new THREE.Vector3(1,0,0));this.add(d);var e=new THREE.PerspectiveCamera(90,1,a,b);e.up.set(0,-1,0);e.lookAt(new THREE.Vector3(-1,0,0));this.add(e);var g=new THREE.PerspectiveCamera(90,1,a,b);g.up.set(0,0,1);g.lookAt(new THREE.Vector3(0,1,0));this.add(g);var f=new THREE.PerspectiveCamera(90,1,a,b);f.up.set(0,0,-1);f.lookAt(new THREE.Vector3(0,-1,0));
this.add(f);var h=new THREE.PerspectiveCamera(90,1,a,b);h.up.set(0,-1,0);h.lookAt(new THREE.Vector3(0,0,1));this.add(h);var k=new THREE.PerspectiveCamera(90,1,a,b);k.up.set(0,-1,0);k.lookAt(new THREE.Vector3(0,0,-1));this.add(k);this.renderTarget=new THREE.WebGLRenderTargetCube(c,c,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter});this.updateCubeMap=function(a,b){var c=this.renderTarget,t=c.generateMipmaps;c.generateMipmaps=!1;c.activeCubeFace=0;a.render(b,d,c);c.activeCubeFace=
......@@ -430,23 +430,23 @@ THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sa
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){var b=a.geometry;a=a.material;var c=b.vertices.length;if(a.attributes){void 0===b.__webglCustomAttributesList&&(b.__webglCustomAttributesList=[]);for(var d in a.attributes){var e=a.attributes[d];if(!e.__webglInitialized||e.createUniqueBuffers){e.__webglInitialized=!0;var f=1;"v2"===e.type?f=2:"v3"===e.type?f=3:"v4"===e.type?f=4:"c"===e.type&&(f=3);e.size=f;e.array=new Float32Array(c*f);e.buffer=l.createBuffer();e.buffer.belongsToAttribute=d;e.needsUpdate=
!0}b.__webglCustomAttributesList.push(e)}}}function c(a,b){var c=b.geometry,e=a.faces3,f=3*e.length,g=1*e.length,h=3*e.length,e=d(b,a);a.__vertexArray=new Float32Array(3*f);a.__normalArray=new Float32Array(3*f);a.__colorArray=new Float32Array(3*f);a.__uvArray=new Float32Array(2*f);1<c.faceVertexUvs.length&&(a.__uv2Array=new Float32Array(2*f));c.hasTangents&&(a.__tangentArray=new Float32Array(4*f));b.geometry.skinWeights.length&&b.geometry.skinIndices.length&&(a.__skinIndexArray=new Float32Array(4*
f),a.__skinWeightArray=new Float32Array(4*f));c=null!==Gb&&21845<g?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=new c(3*g);a.__lineArray=new c(2*h);var k;if(a.numMorphTargets)for(a.__morphTargetsArrays=[],c=0,k=a.numMorphTargets;c<k;c++)a.__morphTargetsArrays.push(new Float32Array(3*f));if(a.numMorphNormals)for(a.__morphNormalsArrays=[],c=0,k=a.numMorphNormals;c<k;c++)a.__morphNormalsArrays.push(new Float32Array(3*f));a.__webglFaceCount=3*g;a.__webglLineCount=2*h;if(e.attributes){void 0===
f),a.__skinWeightArray=new Float32Array(4*f));c=null!==Hb&&21845<g?Uint32Array:Uint16Array;a.__typeArray=c;a.__faceArray=new c(3*g);a.__lineArray=new c(2*h);var k;if(a.numMorphTargets)for(a.__morphTargetsArrays=[],c=0,k=a.numMorphTargets;c<k;c++)a.__morphTargetsArrays.push(new Float32Array(3*f));if(a.numMorphNormals)for(a.__morphNormalsArrays=[],c=0,k=a.numMorphNormals;c<k;c++)a.__morphNormalsArrays.push(new Float32Array(3*f));a.__webglFaceCount=3*g;a.__webglLineCount=2*h;if(e.attributes){void 0===
a.__webglCustomAttributesList&&(a.__webglCustomAttributesList=[]);for(var m in e.attributes){var g=e.attributes[m],h={},n;for(n in g)h[n]=g[n];if(!h.__webglInitialized||h.createUniqueBuffers)h.__webglInitialized=!0,c=1,"v2"===h.type?c=2:"v3"===h.type?c=3:"v4"===h.type?c=4:"c"===h.type&&(c=3),h.size=c,h.array=new Float32Array(f*c),h.buffer=l.createBuffer(),h.buffer.belongsToAttribute=m,g.needsUpdate=!0,h.__original=g;a.__webglCustomAttributesList.push(h)}}a.__inittedArrays=!0}function d(a,b){return a.material instanceof
THREE.MeshFaceMaterial?a.material.materials[b.materialIndex]:a.material}function e(a,b,c,d){c=c.attributes;var e=b.attributes;b=b.attributesKeys;for(var g=0,k=b.length;g<k;g++){var m=b[g],n=e[m];if(0<=n){var p=c[m];void 0!==p?(m=p.itemSize,l.bindBuffer(l.ARRAY_BUFFER,p.buffer),f(n),l.vertexAttribPointer(n,m,l.FLOAT,!1,0,d*m*4)):void 0!==a.defaultAttributeValues&&(2===a.defaultAttributeValues[m].length?l.vertexAttrib2fv(n,a.defaultAttributeValues[m]):3===a.defaultAttributeValues[m].length&&l.vertexAttrib3fv(n,
a.defaultAttributeValues[m]))}}h()}function g(){for(var a=0,b=xb.length;a<b;a++)xb[a]=0}function f(a){xb[a]=1;0===Hb[a]&&(l.enableVertexAttribArray(a),Hb[a]=1)}function h(){for(var a=0,b=Hb.length;a<b;a++)Hb[a]!==xb[a]&&(l.disableVertexAttribArray(a),Hb[a]=0)}function k(a,b){return a.material.id!==b.material.id?b.material.id-a.material.id:a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return b[0]-a[0]}function m(a,e){if(!1!==e.visible){e instanceof THREE.Light&&
a.defaultAttributeValues[m]))}}h()}function g(){for(var a=0,b=xb.length;a<b;a++)xb[a]=0}function f(a){xb[a]=1;0===Ib[a]&&(l.enableVertexAttribArray(a),Ib[a]=1)}function h(){for(var a=0,b=Ib.length;a<b;a++)Ib[a]!==xb[a]&&(l.disableVertexAttribArray(a),Ib[a]=0)}function k(a,b){return a.material.id!==b.material.id?b.material.id-a.material.id:a.z!==b.z?b.z-a.z:a.id-b.id}function n(a,b){return a.z!==b.z?a.z-b.z:a.id-b.id}function p(a,b){return b[0]-a[0]}function m(a,e){if(!1!==e.visible){e instanceof THREE.Light&&
Da.push(e);if(!(e instanceof THREE.Scene||e instanceof THREE.Group)){void 0===e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrix=new THREE.Matrix3,e.addEventListener("removed",Gc));var f=e.geometry;if(void 0!==f&&void 0===f.__webglInit&&(f.__webglInit=!0,f.addEventListener("dispose",Hc),!(f instanceof THREE.BufferGeometry)))if(e instanceof THREE.Mesh)v(a,e,f);else if(e instanceof THREE.Line){if(void 0===f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();
f.__webglColorBuffer=l.createBuffer();f.__webglLineDistanceBuffer=l.createBuffer();H.info.memory.geometries++;var g=f.vertices.length;f.__vertexArray=new Float32Array(3*g);f.__colorArray=new Float32Array(3*g);f.__lineDistanceArray=new Float32Array(1*g);f.__webglLineCount=g;b(e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0;f.lineDistancesNeedUpdate=!0}}else if(e instanceof THREE.PointCloud&&void 0===f.__webglVertexBuffer){f.__webglVertexBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();
H.info.memory.geometries++;var h=f.vertices.length;f.__vertexArray=new Float32Array(3*h);f.__colorArray=new Float32Array(3*h);f.__sortArray=[];f.__webglParticleCount=h;b(e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0}if(void 0===e.__webglActive)if(e.__webglActive=!0,e instanceof THREE.Mesh)if(f instanceof THREE.BufferGeometry)w(db,f,e);else{if(f instanceof THREE.Geometry)for(var k=Ib[f.id],n=0,s=k.length;n<s;n++)w(db,k[n],e)}else e instanceof THREE.Line||e instanceof THREE.PointCloud?w(db,f,e):
H.info.memory.geometries++;var h=f.vertices.length;f.__vertexArray=new Float32Array(3*h);f.__colorArray=new Float32Array(3*h);f.__sortArray=[];f.__webglParticleCount=h;b(e);f.verticesNeedUpdate=!0;f.colorsNeedUpdate=!0}if(void 0===e.__webglActive)if(e.__webglActive=!0,e instanceof THREE.Mesh)if(f instanceof THREE.BufferGeometry)w(db,f,e);else{if(f instanceof THREE.Geometry)for(var k=tb[f.id],n=0,s=k.length;n<s;n++)w(db,k[n],e)}else e instanceof THREE.Line||e instanceof THREE.PointCloud?w(db,f,e):
(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&Ja.push({id:null,object:e,opaque:null,transparent:null,z:0});var t=db[e.id];if(t&&(!1===e.frustumCulled||!0===Cc.intersectsObject(e))){var q=e.geometry,r,x;if(q instanceof THREE.BufferGeometry)for(var y=q.attributes,B=q.attributesKeys,F=0,D=B.length;F<D;F++){var E=B[F],G=y[E];void 0===G.buffer&&(G.buffer=l.createBuffer(),G.needsUpdate=!0);if(!0===G.needsUpdate){var L="index"===E?l.ELEMENT_ARRAY_BUFFER:l.ARRAY_BUFFER;l.bindBuffer(L,
G.buffer);l.bufferData(L,G.array,l.STATIC_DRAW);G.needsUpdate=!1}}else if(e instanceof THREE.Mesh){!0===q.groupsNeedUpdate&&v(a,e,q);for(var O=Ib[q.id],Q=0,N=O.length;Q<N;Q++){var I=O[Q];x=d(e,I);!0===q.groupsNeedUpdate&&c(I,e);r=x.attributes&&u(x);if(q.verticesNeedUpdate||q.morphTargetsNeedUpdate||q.elementsNeedUpdate||q.uvsNeedUpdate||q.normalsNeedUpdate||q.colorsNeedUpdate||q.tangentsNeedUpdate||r){var S=I,P=e,T=l.DYNAMIC_DRAW,U=!q.dynamic,Y=x;if(S.__inittedArrays){var X=Y&&void 0!==Y.shading&&
G.buffer);l.bufferData(L,G.array,l.STATIC_DRAW);G.needsUpdate=!1}}else if(e instanceof THREE.Mesh){!0===q.groupsNeedUpdate&&v(a,e,q);for(var O=tb[q.id],Q=0,N=O.length;Q<N;Q++){var I=O[Q];x=d(e,I);!0===q.groupsNeedUpdate&&c(I,e);r=x.attributes&&u(x);if(q.verticesNeedUpdate||q.morphTargetsNeedUpdate||q.elementsNeedUpdate||q.uvsNeedUpdate||q.normalsNeedUpdate||q.colorsNeedUpdate||q.tangentsNeedUpdate||r){var S=I,P=e,T=l.DYNAMIC_DRAW,U=!q.dynamic,Y=x;if(S.__inittedArrays){var X=Y&&void 0!==Y.shading&&
Y.shading===THREE.SmoothShading,K=void 0,Z=void 0,Ka=void 0,ea=void 0,ca=void 0,sa=void 0,Sa=void 0,ia=void 0,wa=void 0,ta=void 0,ja=void 0,ba=void 0,aa=void 0,$=void 0,Aa=void 0,qa=void 0,J=void 0,Pa=void 0,oa=void 0,sc=void 0,la=void 0,yb=void 0,tc=void 0,uc=void 0,Ca=void 0,Oa=void 0,Ha=void 0,La=void 0,Ia=void 0,Ba=void 0,xa=void 0,vc=void 0,zb=void 0,Dc=void 0,Ta=void 0,Yb=void 0,cb=void 0,eb=void 0,Ob=void 0,Sb=void 0,jb=0,kb=0,Ab=0,Bb=0,Jb=0,Xa=0,Ea=0,Va=0,Qa=0,ma=0,ua=0,C=0,Ma=void 0,Wa=S.__vertexArray,
Cb=S.__uvArray,lb=S.__uv2Array,Ya=S.__normalArray,ra=S.__tangentArray,Ra=S.__colorArray,Za=S.__skinIndexArray,$a=S.__skinWeightArray,Kb=S.__morphTargetsArrays,nb=S.__morphNormalsArrays,hb=S.__webglCustomAttributesList,z=void 0,Tb=S.__faceArray,Na=S.__lineArray,ya=P.geometry,fb=ya.elementsNeedUpdate,Ic=ya.uvsNeedUpdate,Hb=ya.normalsNeedUpdate,fa=ya.tangentsNeedUpdate,hc=ya.colorsNeedUpdate,R=ya.morphTargetsNeedUpdate,ga=ya.vertices,M=S.faces3,za=ya.faces,va=ya.faceVertexUvs[0],Jc=ya.faceVertexUvs[1],
Ec=ya.skinIndices,Ub=ya.skinWeights,tb=ya.morphTargets,Fa=ya.morphNormals;if(ya.verticesNeedUpdate){K=0;for(Z=M.length;K<Z;K++)ea=za[M[K]],ba=ga[ea.a],aa=ga[ea.b],$=ga[ea.c],Wa[kb]=ba.x,Wa[kb+1]=ba.y,Wa[kb+2]=ba.z,Wa[kb+3]=aa.x,Wa[kb+4]=aa.y,Wa[kb+5]=aa.z,Wa[kb+6]=$.x,Wa[kb+7]=$.y,Wa[kb+8]=$.z,kb+=9;l.bindBuffer(l.ARRAY_BUFFER,S.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,Wa,T)}if(R)for(Ta=0,Yb=tb.length;Ta<Yb;Ta++){K=ua=0;for(Z=M.length;K<Z;K++)Ob=M[K],ea=za[Ob],ba=tb[Ta].vertices[ea.a],aa=
tb[Ta].vertices[ea.b],$=tb[Ta].vertices[ea.c],cb=Kb[Ta],cb[ua]=ba.x,cb[ua+1]=ba.y,cb[ua+2]=ba.z,cb[ua+3]=aa.x,cb[ua+4]=aa.y,cb[ua+5]=aa.z,cb[ua+6]=$.x,cb[ua+7]=$.y,cb[ua+8]=$.z,Y.morphNormals&&(X?(Sb=Fa[Ta].vertexNormals[Ob],Pa=Sb.a,oa=Sb.b,sc=Sb.c):sc=oa=Pa=Fa[Ta].faceNormals[Ob],eb=nb[Ta],eb[ua]=Pa.x,eb[ua+1]=Pa.y,eb[ua+2]=Pa.z,eb[ua+3]=oa.x,eb[ua+4]=oa.y,eb[ua+5]=oa.z,eb[ua+6]=sc.x,eb[ua+7]=sc.y,eb[ua+8]=sc.z),ua+=9;l.bindBuffer(l.ARRAY_BUFFER,S.__webglMorphTargetsBuffers[Ta]);l.bufferData(l.ARRAY_BUFFER,
Cb=S.__uvArray,lb=S.__uv2Array,Ya=S.__normalArray,ra=S.__tangentArray,Ra=S.__colorArray,Za=S.__skinIndexArray,$a=S.__skinWeightArray,Kb=S.__morphTargetsArrays,nb=S.__morphNormalsArrays,hb=S.__webglCustomAttributesList,z=void 0,Tb=S.__faceArray,Na=S.__lineArray,ya=P.geometry,fb=ya.elementsNeedUpdate,Ic=ya.uvsNeedUpdate,Ib=ya.normalsNeedUpdate,fa=ya.tangentsNeedUpdate,hc=ya.colorsNeedUpdate,R=ya.morphTargetsNeedUpdate,ga=ya.vertices,M=S.faces3,za=ya.faces,va=ya.faceVertexUvs[0],Jc=ya.faceVertexUvs[1],
Ec=ya.skinIndices,Ub=ya.skinWeights,ub=ya.morphTargets,Fa=ya.morphNormals;if(ya.verticesNeedUpdate){K=0;for(Z=M.length;K<Z;K++)ea=za[M[K]],ba=ga[ea.a],aa=ga[ea.b],$=ga[ea.c],Wa[kb]=ba.x,Wa[kb+1]=ba.y,Wa[kb+2]=ba.z,Wa[kb+3]=aa.x,Wa[kb+4]=aa.y,Wa[kb+5]=aa.z,Wa[kb+6]=$.x,Wa[kb+7]=$.y,Wa[kb+8]=$.z,kb+=9;l.bindBuffer(l.ARRAY_BUFFER,S.__webglVertexBuffer);l.bufferData(l.ARRAY_BUFFER,Wa,T)}if(R)for(Ta=0,Yb=ub.length;Ta<Yb;Ta++){K=ua=0;for(Z=M.length;K<Z;K++)Ob=M[K],ea=za[Ob],ba=ub[Ta].vertices[ea.a],aa=
ub[Ta].vertices[ea.b],$=ub[Ta].vertices[ea.c],cb=Kb[Ta],cb[ua]=ba.x,cb[ua+1]=ba.y,cb[ua+2]=ba.z,cb[ua+3]=aa.x,cb[ua+4]=aa.y,cb[ua+5]=aa.z,cb[ua+6]=$.x,cb[ua+7]=$.y,cb[ua+8]=$.z,Y.morphNormals&&(X?(Sb=Fa[Ta].vertexNormals[Ob],Pa=Sb.a,oa=Sb.b,sc=Sb.c):sc=oa=Pa=Fa[Ta].faceNormals[Ob],eb=nb[Ta],eb[ua]=Pa.x,eb[ua+1]=Pa.y,eb[ua+2]=Pa.z,eb[ua+3]=oa.x,eb[ua+4]=oa.y,eb[ua+5]=oa.z,eb[ua+6]=sc.x,eb[ua+7]=sc.y,eb[ua+8]=sc.z),ua+=9;l.bindBuffer(l.ARRAY_BUFFER,S.__webglMorphTargetsBuffers[Ta]);l.bufferData(l.ARRAY_BUFFER,
Kb[Ta],T);Y.morphNormals&&(l.bindBuffer(l.ARRAY_BUFFER,S.__webglMorphNormalsBuffers[Ta]),l.bufferData(l.ARRAY_BUFFER,nb[Ta],T))}if(Ub.length){K=0;for(Z=M.length;K<Z;K++)ea=za[M[K]],uc=Ub[ea.a],Ca=Ub[ea.b],Oa=Ub[ea.c],$a[ma]=uc.x,$a[ma+1]=uc.y,$a[ma+2]=uc.z,$a[ma+3]=uc.w,$a[ma+4]=Ca.x,$a[ma+5]=Ca.y,$a[ma+6]=Ca.z,$a[ma+7]=Ca.w,$a[ma+8]=Oa.x,$a[ma+9]=Oa.y,$a[ma+10]=Oa.z,$a[ma+11]=Oa.w,Ha=Ec[ea.a],La=Ec[ea.b],Ia=Ec[ea.c],Za[ma]=Ha.x,Za[ma+1]=Ha.y,Za[ma+2]=Ha.z,Za[ma+3]=Ha.w,Za[ma+4]=La.x,Za[ma+5]=La.y,
Za[ma+6]=La.z,Za[ma+7]=La.w,Za[ma+8]=Ia.x,Za[ma+9]=Ia.y,Za[ma+10]=Ia.z,Za[ma+11]=Ia.w,ma+=12;0<ma&&(l.bindBuffer(l.ARRAY_BUFFER,S.__webglSkinIndicesBuffer),l.bufferData(l.ARRAY_BUFFER,Za,T),l.bindBuffer(l.ARRAY_BUFFER,S.__webglSkinWeightsBuffer),l.bufferData(l.ARRAY_BUFFER,$a,T))}if(hc){K=0;for(Z=M.length;K<Z;K++)ea=za[M[K]],Sa=ea.vertexColors,ia=ea.color,3===Sa.length&&Y.vertexColors===THREE.VertexColors?(la=Sa[0],yb=Sa[1],tc=Sa[2]):tc=yb=la=ia,Ra[Qa]=la.r,Ra[Qa+1]=la.g,Ra[Qa+2]=la.b,Ra[Qa+3]=yb.r,
Ra[Qa+4]=yb.g,Ra[Qa+5]=yb.b,Ra[Qa+6]=tc.r,Ra[Qa+7]=tc.g,Ra[Qa+8]=tc.b,Qa+=9;0<Qa&&(l.bindBuffer(l.ARRAY_BUFFER,S.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,Ra,T))}if(fa&&ya.hasTangents){K=0;for(Z=M.length;K<Z;K++)ea=za[M[K]],wa=ea.vertexTangents,Aa=wa[0],qa=wa[1],J=wa[2],ra[Ea]=Aa.x,ra[Ea+1]=Aa.y,ra[Ea+2]=Aa.z,ra[Ea+3]=Aa.w,ra[Ea+4]=qa.x,ra[Ea+5]=qa.y,ra[Ea+6]=qa.z,ra[Ea+7]=qa.w,ra[Ea+8]=J.x,ra[Ea+9]=J.y,ra[Ea+10]=J.z,ra[Ea+11]=J.w,Ea+=12;l.bindBuffer(l.ARRAY_BUFFER,S.__webglTangentBuffer);l.bufferData(l.ARRAY_BUFFER,
ra,T)}if(Hb){K=0;for(Z=M.length;K<Z;K++)if(ea=za[M[K]],ca=ea.vertexNormals,sa=ea.normal,3===ca.length&&X)for(Ba=0;3>Ba;Ba++)vc=ca[Ba],Ya[Xa]=vc.x,Ya[Xa+1]=vc.y,Ya[Xa+2]=vc.z,Xa+=3;else for(Ba=0;3>Ba;Ba++)Ya[Xa]=sa.x,Ya[Xa+1]=sa.y,Ya[Xa+2]=sa.z,Xa+=3;l.bindBuffer(l.ARRAY_BUFFER,S.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,Ya,T)}if(Ic&&va){K=0;for(Z=M.length;K<Z;K++)if(Ka=M[K],ta=va[Ka],void 0!==ta)for(Ba=0;3>Ba;Ba++)zb=ta[Ba],Cb[Ab]=zb.x,Cb[Ab+1]=zb.y,Ab+=2;0<Ab&&(l.bindBuffer(l.ARRAY_BUFFER,
ra,T)}if(Ib){K=0;for(Z=M.length;K<Z;K++)if(ea=za[M[K]],ca=ea.vertexNormals,sa=ea.normal,3===ca.length&&X)for(Ba=0;3>Ba;Ba++)vc=ca[Ba],Ya[Xa]=vc.x,Ya[Xa+1]=vc.y,Ya[Xa+2]=vc.z,Xa+=3;else for(Ba=0;3>Ba;Ba++)Ya[Xa]=sa.x,Ya[Xa+1]=sa.y,Ya[Xa+2]=sa.z,Xa+=3;l.bindBuffer(l.ARRAY_BUFFER,S.__webglNormalBuffer);l.bufferData(l.ARRAY_BUFFER,Ya,T)}if(Ic&&va){K=0;for(Z=M.length;K<Z;K++)if(Ka=M[K],ta=va[Ka],void 0!==ta)for(Ba=0;3>Ba;Ba++)zb=ta[Ba],Cb[Ab]=zb.x,Cb[Ab+1]=zb.y,Ab+=2;0<Ab&&(l.bindBuffer(l.ARRAY_BUFFER,
S.__webglUVBuffer),l.bufferData(l.ARRAY_BUFFER,Cb,T))}if(Ic&&Jc){K=0;for(Z=M.length;K<Z;K++)if(Ka=M[K],ja=Jc[Ka],void 0!==ja)for(Ba=0;3>Ba;Ba++)Dc=ja[Ba],lb[Bb]=Dc.x,lb[Bb+1]=Dc.y,Bb+=2;0<Bb&&(l.bindBuffer(l.ARRAY_BUFFER,S.__webglUV2Buffer),l.bufferData(l.ARRAY_BUFFER,lb,T))}if(fb){K=0;for(Z=M.length;K<Z;K++)Tb[Jb]=jb,Tb[Jb+1]=jb+1,Tb[Jb+2]=jb+2,Jb+=3,Na[Va]=jb,Na[Va+1]=jb+1,Na[Va+2]=jb,Na[Va+3]=jb+2,Na[Va+4]=jb+1,Na[Va+5]=jb+2,Va+=6,jb+=3;l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,S.__webglFaceBuffer);
l.bufferData(l.ELEMENT_ARRAY_BUFFER,Tb,T);l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,S.__webglLineBuffer);l.bufferData(l.ELEMENT_ARRAY_BUFFER,Na,T)}if(hb)for(Ba=0,xa=hb.length;Ba<xa;Ba++)if(z=hb[Ba],z.__original.needsUpdate){C=0;if(1===z.size)if(void 0===z.boundTo||"vertices"===z.boundTo)for(K=0,Z=M.length;K<Z;K++)ea=za[M[K]],z.array[C]=z.value[ea.a],z.array[C+1]=z.value[ea.b],z.array[C+2]=z.value[ea.c],C+=3;else{if("faces"===z.boundTo)for(K=0,Z=M.length;K<Z;K++)Ma=z.value[M[K]],z.array[C]=Ma,z.array[C+
1]=Ma,z.array[C+2]=Ma,C+=3}else if(2===z.size)if(void 0===z.boundTo||"vertices"===z.boundTo)for(K=0,Z=M.length;K<Z;K++)ea=za[M[K]],ba=z.value[ea.a],aa=z.value[ea.b],$=z.value[ea.c],z.array[C]=ba.x,z.array[C+1]=ba.y,z.array[C+2]=aa.x,z.array[C+3]=aa.y,z.array[C+4]=$.x,z.array[C+5]=$.y,C+=6;else{if("faces"===z.boundTo)for(K=0,Z=M.length;K<Z;K++)$=aa=ba=Ma=z.value[M[K]],z.array[C]=ba.x,z.array[C+1]=ba.y,z.array[C+2]=aa.x,z.array[C+3]=aa.y,z.array[C+4]=$.x,z.array[C+5]=$.y,C+=6}else if(3===z.size){var na;
......@@ -455,20 +455,20 @@ z.array[C+2]=ba[na[2]],z.array[C+3]=aa[na[0]],z.array[C+4]=aa[na[1]],z.array[C+5
z.boundTo||"vertices"===z.boundTo)for(K=0,Z=M.length;K<Z;K++)ea=za[M[K]],ba=z.value[ea.a],aa=z.value[ea.b],$=z.value[ea.c],z.array[C]=ba.x,z.array[C+1]=ba.y,z.array[C+2]=ba.z,z.array[C+3]=ba.w,z.array[C+4]=aa.x,z.array[C+5]=aa.y,z.array[C+6]=aa.z,z.array[C+7]=aa.w,z.array[C+8]=$.x,z.array[C+9]=$.y,z.array[C+10]=$.z,z.array[C+11]=$.w,C+=12;else if("faces"===z.boundTo)for(K=0,Z=M.length;K<Z;K++)$=aa=ba=Ma=z.value[M[K]],z.array[C]=ba.x,z.array[C+1]=ba.y,z.array[C+2]=ba.z,z.array[C+3]=ba.w,z.array[C+
4]=aa.x,z.array[C+5]=aa.y,z.array[C+6]=aa.z,z.array[C+7]=aa.w,z.array[C+8]=$.x,z.array[C+9]=$.y,z.array[C+10]=$.z,z.array[C+11]=$.w,C+=12;else if("faceVertices"===z.boundTo)for(K=0,Z=M.length;K<Z;K++)Ma=z.value[M[K]],ba=Ma[0],aa=Ma[1],$=Ma[2],z.array[C]=ba.x,z.array[C+1]=ba.y,z.array[C+2]=ba.z,z.array[C+3]=ba.w,z.array[C+4]=aa.x,z.array[C+5]=aa.y,z.array[C+6]=aa.z,z.array[C+7]=aa.w,z.array[C+8]=$.x,z.array[C+9]=$.y,z.array[C+10]=$.z,z.array[C+11]=$.w,C+=12;l.bindBuffer(l.ARRAY_BUFFER,z.buffer);l.bufferData(l.ARRAY_BUFFER,
z.array,T)}U&&(delete S.__inittedArrays,delete S.__colorArray,delete S.__normalArray,delete S.__tangentArray,delete S.__uvArray,delete S.__uv2Array,delete S.__faceArray,delete S.__vertexArray,delete S.__lineArray,delete S.__skinIndexArray,delete S.__skinWeightArray)}}}q.verticesNeedUpdate=!1;q.morphTargetsNeedUpdate=!1;q.elementsNeedUpdate=!1;q.uvsNeedUpdate=!1;q.normalsNeedUpdate=!1;q.colorsNeedUpdate=!1;q.tangentsNeedUpdate=!1;x.attributes&&A(x)}else if(e instanceof THREE.Line){x=d(e,q);r=x.attributes&&
u(x);if(q.verticesNeedUpdate||q.colorsNeedUpdate||q.lineDistancesNeedUpdate||r){var bc=l.DYNAMIC_DRAW,gb,Lb,mb,cc,ha,wc,ac=q.vertices,Gb=q.colors,xb=q.lineDistances,Pb=ac.length,Qb=Gb.length,Zb=xb.length,ob=q.__vertexArray,ib=q.__colorArray,wb=q.__lineDistanceArray,pc=q.colorsNeedUpdate,qc=q.lineDistancesNeedUpdate,pb=q.__webglCustomAttributesList,qb,mc,Ga,kc,ab,pa;if(q.verticesNeedUpdate){for(gb=0;gb<Pb;gb++)cc=ac[gb],ha=3*gb,ob[ha]=cc.x,ob[ha+1]=cc.y,ob[ha+2]=cc.z;l.bindBuffer(l.ARRAY_BUFFER,q.__webglVertexBuffer);
l.bufferData(l.ARRAY_BUFFER,ob,bc)}if(pc){for(Lb=0;Lb<Qb;Lb++)wc=Gb[Lb],ha=3*Lb,ib[ha]=wc.r,ib[ha+1]=wc.g,ib[ha+2]=wc.b;l.bindBuffer(l.ARRAY_BUFFER,q.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,ib,bc)}if(qc){for(mb=0;mb<Zb;mb++)wb[mb]=xb[mb];l.bindBuffer(l.ARRAY_BUFFER,q.__webglLineDistanceBuffer);l.bufferData(l.ARRAY_BUFFER,wb,bc)}if(pb)for(qb=0,mc=pb.length;qb<mc;qb++)if(pa=pb[qb],pa.needsUpdate&&(void 0===pa.boundTo||"vertices"===pa.boundTo)){ha=0;kc=pa.value.length;if(1===pa.size)for(Ga=0;Ga<
u(x);if(q.verticesNeedUpdate||q.colorsNeedUpdate||q.lineDistancesNeedUpdate||r){var bc=l.DYNAMIC_DRAW,gb,Lb,mb,cc,ha,wc,ac=q.vertices,Hb=q.colors,xb=q.lineDistances,Pb=ac.length,Qb=Hb.length,Zb=xb.length,ob=q.__vertexArray,ib=q.__colorArray,Rb=q.__lineDistanceArray,pc=q.colorsNeedUpdate,qc=q.lineDistancesNeedUpdate,pb=q.__webglCustomAttributesList,qb,mc,Ga,kc,ab,pa;if(q.verticesNeedUpdate){for(gb=0;gb<Pb;gb++)cc=ac[gb],ha=3*gb,ob[ha]=cc.x,ob[ha+1]=cc.y,ob[ha+2]=cc.z;l.bindBuffer(l.ARRAY_BUFFER,q.__webglVertexBuffer);
l.bufferData(l.ARRAY_BUFFER,ob,bc)}if(pc){for(Lb=0;Lb<Qb;Lb++)wc=Hb[Lb],ha=3*Lb,ib[ha]=wc.r,ib[ha+1]=wc.g,ib[ha+2]=wc.b;l.bindBuffer(l.ARRAY_BUFFER,q.__webglColorBuffer);l.bufferData(l.ARRAY_BUFFER,ib,bc)}if(qc){for(mb=0;mb<Zb;mb++)Rb[mb]=xb[mb];l.bindBuffer(l.ARRAY_BUFFER,q.__webglLineDistanceBuffer);l.bufferData(l.ARRAY_BUFFER,Rb,bc)}if(pb)for(qb=0,mc=pb.length;qb<mc;qb++)if(pa=pb[qb],pa.needsUpdate&&(void 0===pa.boundTo||"vertices"===pa.boundTo)){ha=0;kc=pa.value.length;if(1===pa.size)for(Ga=0;Ga<
kc;Ga++)pa.array[Ga]=pa.value[Ga];else if(2===pa.size)for(Ga=0;Ga<kc;Ga++)ab=pa.value[Ga],pa.array[ha]=ab.x,pa.array[ha+1]=ab.y,ha+=2;else if(3===pa.size)if("c"===pa.type)for(Ga=0;Ga<kc;Ga++)ab=pa.value[Ga],pa.array[ha]=ab.r,pa.array[ha+1]=ab.g,pa.array[ha+2]=ab.b,ha+=3;else for(Ga=0;Ga<kc;Ga++)ab=pa.value[Ga],pa.array[ha]=ab.x,pa.array[ha+1]=ab.y,pa.array[ha+2]=ab.z,ha+=3;else if(4===pa.size)for(Ga=0;Ga<kc;Ga++)ab=pa.value[Ga],pa.array[ha]=ab.x,pa.array[ha+1]=ab.y,pa.array[ha+2]=ab.z,pa.array[ha+
3]=ab.w,ha+=4;l.bindBuffer(l.ARRAY_BUFFER,pa.buffer);l.bufferData(l.ARRAY_BUFFER,pa.array,bc)}}q.verticesNeedUpdate=!1;q.colorsNeedUpdate=!1;q.lineDistancesNeedUpdate=!1;x.attributes&&A(x)}else if(e instanceof THREE.PointCloud){x=d(e,q);r=x.attributes&&u(x);if(q.verticesNeedUpdate||q.colorsNeedUpdate||e.sortParticles||r){var gc=l.DYNAMIC_DRAW,bb,Db,Eb,W,Fb,Vb,xc=q.vertices,ic=xc.length,jc=q.colors,$b=jc.length,dc=q.__vertexArray,ec=q.__colorArray,Mb=q.__sortArray,nc=q.verticesNeedUpdate,oc=q.colorsNeedUpdate,
Nb=q.__webglCustomAttributesList,ub,lc,da,vb,ka,V;if(e.sortParticles){Fc.copy(yc);Fc.multiply(e.matrixWorld);for(bb=0;bb<ic;bb++)Eb=xc[bb],Ua.copy(Eb),Ua.applyProjection(Fc),Mb[bb]=[Ua.z,bb];Mb.sort(p);for(bb=0;bb<ic;bb++)Eb=xc[Mb[bb][1]],W=3*bb,dc[W]=Eb.x,dc[W+1]=Eb.y,dc[W+2]=Eb.z;for(Db=0;Db<$b;Db++)W=3*Db,Vb=jc[Mb[Db][1]],ec[W]=Vb.r,ec[W+1]=Vb.g,ec[W+2]=Vb.b;if(Nb)for(ub=0,lc=Nb.length;ub<lc;ub++)if(V=Nb[ub],void 0===V.boundTo||"vertices"===V.boundTo)if(W=0,vb=V.value.length,1===V.size)for(da=
0;da<vb;da++)Fb=Mb[da][1],V.array[da]=V.value[Fb];else if(2===V.size)for(da=0;da<vb;da++)Fb=Mb[da][1],ka=V.value[Fb],V.array[W]=ka.x,V.array[W+1]=ka.y,W+=2;else if(3===V.size)if("c"===V.type)for(da=0;da<vb;da++)Fb=Mb[da][1],ka=V.value[Fb],V.array[W]=ka.r,V.array[W+1]=ka.g,V.array[W+2]=ka.b,W+=3;else for(da=0;da<vb;da++)Fb=Mb[da][1],ka=V.value[Fb],V.array[W]=ka.x,V.array[W+1]=ka.y,V.array[W+2]=ka.z,W+=3;else if(4===V.size)for(da=0;da<vb;da++)Fb=Mb[da][1],ka=V.value[Fb],V.array[W]=ka.x,V.array[W+1]=
ka.y,V.array[W+2]=ka.z,V.array[W+3]=ka.w,W+=4}else{if(nc)for(bb=0;bb<ic;bb++)Eb=xc[bb],W=3*bb,dc[W]=Eb.x,dc[W+1]=Eb.y,dc[W+2]=Eb.z;if(oc)for(Db=0;Db<$b;Db++)Vb=jc[Db],W=3*Db,ec[W]=Vb.r,ec[W+1]=Vb.g,ec[W+2]=Vb.b;if(Nb)for(ub=0,lc=Nb.length;ub<lc;ub++)if(V=Nb[ub],V.needsUpdate&&(void 0===V.boundTo||"vertices"===V.boundTo))if(vb=V.value.length,W=0,1===V.size)for(da=0;da<vb;da++)V.array[da]=V.value[da];else if(2===V.size)for(da=0;da<vb;da++)ka=V.value[da],V.array[W]=ka.x,V.array[W+1]=ka.y,W+=2;else if(3===
V.size)if("c"===V.type)for(da=0;da<vb;da++)ka=V.value[da],V.array[W]=ka.r,V.array[W+1]=ka.g,V.array[W+2]=ka.b,W+=3;else for(da=0;da<vb;da++)ka=V.value[da],V.array[W]=ka.x,V.array[W+1]=ka.y,V.array[W+2]=ka.z,W+=3;else if(4===V.size)for(da=0;da<vb;da++)ka=V.value[da],V.array[W]=ka.x,V.array[W+1]=ka.y,V.array[W+2]=ka.z,V.array[W+3]=ka.w,W+=4}if(nc||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,q.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,dc,gc);if(oc||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,
q.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,ec,gc);if(Nb)for(ub=0,lc=Nb.length;ub<lc;ub++)if(V=Nb[ub],V.needsUpdate||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,V.buffer),l.bufferData(l.ARRAY_BUFFER,V.array,gc)}q.verticesNeedUpdate=!1;q.colorsNeedUpdate=!1;x.attributes&&A(x)}for(var fc=0,Rb=t.length;fc<Rb;fc++){var zc=t[fc],Wb=zc,rc=Wb.object,Ac=Wb.buffer,Bc=rc.geometry,Xb=rc.material;Xb instanceof THREE.MeshFaceMaterial?(Xb=Xb.materials[Bc instanceof THREE.BufferGeometry?0:Ac.materialIndex],
Wb.material=Xb,Xb.transparent?sb.push(Wb):rb.push(Wb)):Xb&&(Wb.material=Xb,Xb.transparent?sb.push(Wb):rb.push(Wb));zc.render=!0;!0===H.sortObjects&&(null!==e.renderDepth?zc.z=e.renderDepth:(Ua.setFromMatrixPosition(e.matrixWorld),Ua.applyProjection(yc),zc.z=Ua.z))}}}fc=0;for(Rb=e.children.length;fc<Rb;fc++)m(a,e.children[fc])}}function t(a,b,c){if(0!==a.length)for(var d=0,e=a.length;d<e;d++)a[d].render(b,c,Ac,Bc)}function q(a,b,c,d,e,f){for(var g,h,k,l=a.length-1;-1!==l;l--){g=a[l];h=g.object;k=g.buffer;
Nb=q.__webglCustomAttributesList,vb,lc,da,wb,ka,V;if(e.sortParticles){Fc.copy(yc);Fc.multiply(e.matrixWorld);for(bb=0;bb<ic;bb++)Eb=xc[bb],Ua.copy(Eb),Ua.applyProjection(Fc),Mb[bb]=[Ua.z,bb];Mb.sort(p);for(bb=0;bb<ic;bb++)Eb=xc[Mb[bb][1]],W=3*bb,dc[W]=Eb.x,dc[W+1]=Eb.y,dc[W+2]=Eb.z;for(Db=0;Db<$b;Db++)W=3*Db,Vb=jc[Mb[Db][1]],ec[W]=Vb.r,ec[W+1]=Vb.g,ec[W+2]=Vb.b;if(Nb)for(vb=0,lc=Nb.length;vb<lc;vb++)if(V=Nb[vb],void 0===V.boundTo||"vertices"===V.boundTo)if(W=0,wb=V.value.length,1===V.size)for(da=
0;da<wb;da++)Fb=Mb[da][1],V.array[da]=V.value[Fb];else if(2===V.size)for(da=0;da<wb;da++)Fb=Mb[da][1],ka=V.value[Fb],V.array[W]=ka.x,V.array[W+1]=ka.y,W+=2;else if(3===V.size)if("c"===V.type)for(da=0;da<wb;da++)Fb=Mb[da][1],ka=V.value[Fb],V.array[W]=ka.r,V.array[W+1]=ka.g,V.array[W+2]=ka.b,W+=3;else for(da=0;da<wb;da++)Fb=Mb[da][1],ka=V.value[Fb],V.array[W]=ka.x,V.array[W+1]=ka.y,V.array[W+2]=ka.z,W+=3;else if(4===V.size)for(da=0;da<wb;da++)Fb=Mb[da][1],ka=V.value[Fb],V.array[W]=ka.x,V.array[W+1]=
ka.y,V.array[W+2]=ka.z,V.array[W+3]=ka.w,W+=4}else{if(nc)for(bb=0;bb<ic;bb++)Eb=xc[bb],W=3*bb,dc[W]=Eb.x,dc[W+1]=Eb.y,dc[W+2]=Eb.z;if(oc)for(Db=0;Db<$b;Db++)Vb=jc[Db],W=3*Db,ec[W]=Vb.r,ec[W+1]=Vb.g,ec[W+2]=Vb.b;if(Nb)for(vb=0,lc=Nb.length;vb<lc;vb++)if(V=Nb[vb],V.needsUpdate&&(void 0===V.boundTo||"vertices"===V.boundTo))if(wb=V.value.length,W=0,1===V.size)for(da=0;da<wb;da++)V.array[da]=V.value[da];else if(2===V.size)for(da=0;da<wb;da++)ka=V.value[da],V.array[W]=ka.x,V.array[W+1]=ka.y,W+=2;else if(3===
V.size)if("c"===V.type)for(da=0;da<wb;da++)ka=V.value[da],V.array[W]=ka.r,V.array[W+1]=ka.g,V.array[W+2]=ka.b,W+=3;else for(da=0;da<wb;da++)ka=V.value[da],V.array[W]=ka.x,V.array[W+1]=ka.y,V.array[W+2]=ka.z,W+=3;else if(4===V.size)for(da=0;da<wb;da++)ka=V.value[da],V.array[W]=ka.x,V.array[W+1]=ka.y,V.array[W+2]=ka.z,V.array[W+3]=ka.w,W+=4}if(nc||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,q.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,dc,gc);if(oc||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,
q.__webglColorBuffer),l.bufferData(l.ARRAY_BUFFER,ec,gc);if(Nb)for(vb=0,lc=Nb.length;vb<lc;vb++)if(V=Nb[vb],V.needsUpdate||e.sortParticles)l.bindBuffer(l.ARRAY_BUFFER,V.buffer),l.bufferData(l.ARRAY_BUFFER,V.array,gc)}q.verticesNeedUpdate=!1;q.colorsNeedUpdate=!1;x.attributes&&A(x)}for(var fc=0,Gb=t.length;fc<Gb;fc++){var zc=t[fc],Wb=zc,rc=Wb.object,Ac=Wb.buffer,Bc=rc.geometry,Xb=rc.material;Xb instanceof THREE.MeshFaceMaterial?(Xb=Xb.materials[Bc instanceof THREE.BufferGeometry?0:Ac.materialIndex],
Wb.material=Xb,Xb.transparent?sb.push(Wb):rb.push(Wb)):Xb&&(Wb.material=Xb,Xb.transparent?sb.push(Wb):rb.push(Wb));zc.render=!0;!0===H.sortObjects&&(null!==e.renderDepth?zc.z=e.renderDepth:(Ua.setFromMatrixPosition(e.matrixWorld),Ua.applyProjection(yc),zc.z=Ua.z))}}}fc=0;for(Gb=e.children.length;fc<Gb;fc++)m(a,e.children[fc])}}function t(a,b,c){if(0!==a.length)for(var d=0,e=a.length;d<e;d++)a[d].render(b,c,Ac,Bc)}function q(a,b,c,d,e,f){for(var g,h,k,l=a.length-1;-1!==l;l--){g=a[l];h=g.object;k=g.buffer;
B(h,b);if(f)g=f;else{g=g.material;if(!g)continue;e&&H.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst);H.setDepthTest(g.depthTest);H.setDepthWrite(g.depthWrite);G(g.polygonOffset,g.polygonOffsetFactor,g.polygonOffsetUnits)}H.setMaterialFaces(g);k instanceof THREE.BufferGeometry?H.renderBufferDirect(b,c,d,g,k,h):H.renderBuffer(b,c,d,g,k,h)}}function s(a,b,c,d,e,f,g){for(var h,k,l=0,m=a.length;l<m;l++)if(h=a[l],k=h.object,k.visible){if(g)h=g;else{h=h[b];if(!h)continue;f&&H.setBlending(h.blending,
h.blendEquation,h.blendSrc,h.blendDst);H.setDepthTest(h.depthTest);H.setDepthWrite(h.depthWrite);G(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}H.renderImmediateObject(c,d,e,h,k)}}function r(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function v(a,b,d){var e=b.material,f=!1;if(void 0===Ib[d.id]||!0===d.groupsNeedUpdate){delete db[b.id];a=Ib;for(var g=d.id,e=e instanceof THREE.MeshFaceMaterial,h=Gb?4294967296:65535,k,f={},
h.blendEquation,h.blendSrc,h.blendDst);H.setDepthTest(h.depthTest);H.setDepthWrite(h.depthWrite);G(h.polygonOffset,h.polygonOffsetFactor,h.polygonOffsetUnits)}H.renderImmediateObject(c,d,e,h,k)}}function r(a){var b=a.object.material;b.transparent?(a.transparent=b,a.opaque=null):(a.opaque=b,a.transparent=null)}function v(a,b,d){var e=b.material,f=!1;if(void 0===tb[d.id]||!0===d.groupsNeedUpdate){delete db[b.id];a=tb;for(var g=d.id,e=e instanceof THREE.MeshFaceMaterial,h=Hb?4294967296:65535,k,f={},
m=d.morphTargets.length,n=d.morphNormals.length,p,q={},s=[],t=0,r=d.faces.length;t<r;t++){k=d.faces[t];var u=e?k.materialIndex:0;u in f||(f[u]={hash:u,counter:0});k=f[u].hash+"_"+f[u].counter;k in q||(p={id:Kc++,faces3:[],materialIndex:u,vertices:0,numMorphTargets:m,numMorphNormals:n},q[k]=p,s.push(p));q[k].vertices+3>h&&(f[u].counter+=1,k=f[u].hash+"_"+f[u].counter,k in q||(p={id:Kc++,faces3:[],materialIndex:u,vertices:0,numMorphTargets:m,numMorphNormals:n},q[k]=p,s.push(p)));q[k].faces3.push(t);
q[k].vertices+=3}a[g]=s;d.groupsNeedUpdate=!1}a=Ib[d.id];g=0;for(e=a.length;g<e;g++){h=a[g];if(void 0===h.__webglVertexBuffer){f=h;f.__webglVertexBuffer=l.createBuffer();f.__webglNormalBuffer=l.createBuffer();f.__webglTangentBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();f.__webglUVBuffer=l.createBuffer();f.__webglUV2Buffer=l.createBuffer();f.__webglSkinIndicesBuffer=l.createBuffer();f.__webglSkinWeightsBuffer=l.createBuffer();f.__webglFaceBuffer=l.createBuffer();f.__webglLineBuffer=
q[k].vertices+=3}a[g]=s;d.groupsNeedUpdate=!1}a=tb[d.id];g=0;for(e=a.length;g<e;g++){h=a[g];if(void 0===h.__webglVertexBuffer){f=h;f.__webglVertexBuffer=l.createBuffer();f.__webglNormalBuffer=l.createBuffer();f.__webglTangentBuffer=l.createBuffer();f.__webglColorBuffer=l.createBuffer();f.__webglUVBuffer=l.createBuffer();f.__webglUV2Buffer=l.createBuffer();f.__webglSkinIndicesBuffer=l.createBuffer();f.__webglSkinWeightsBuffer=l.createBuffer();f.__webglFaceBuffer=l.createBuffer();f.__webglLineBuffer=
l.createBuffer();n=m=void 0;if(f.numMorphTargets)for(f.__webglMorphTargetsBuffers=[],m=0,n=f.numMorphTargets;m<n;m++)f.__webglMorphTargetsBuffers.push(l.createBuffer());if(f.numMorphNormals)for(f.__webglMorphNormalsBuffers=[],m=0,n=f.numMorphNormals;m<n;m++)f.__webglMorphNormalsBuffers.push(l.createBuffer());H.info.memory.geometries++;c(h,b);d.verticesNeedUpdate=!0;d.morphTargetsNeedUpdate=!0;d.elementsNeedUpdate=!0;d.uvsNeedUpdate=!0;d.normalsNeedUpdate=!0;d.tangentsNeedUpdate=!0;f=d.colorsNeedUpdate=
!0}else f=!1;(f||void 0===b.__webglActive)&&w(db,h,b)}b.__webglActive=!0}function w(a,b,c){var d=c.id;a[d]=a[d]||[];a[d].push({id:d,buffer:b,object:c,material:null,z:0})}function u(a){for(var b in a.attributes)if(a.attributes[b].needsUpdate)return!0;return!1}function A(a){for(var b in a.attributes)a.attributes[b].needsUpdate=!1}function x(a,b,c,d,e){var f,g,h,k;Ob=0;if(d.needsUpdate){d.program&&Lc(d);d.addEventListener("dispose",Mc);var m;d instanceof THREE.MeshDepthMaterial?m="depth":d instanceof
THREE.MeshNormalMaterial?m="normal":d instanceof THREE.MeshBasicMaterial?m="basic":d instanceof THREE.MeshLambertMaterial?m="lambert":d instanceof THREE.MeshPhongMaterial?m="phong":d instanceof THREE.LineBasicMaterial?m="basic":d instanceof THREE.LineDashedMaterial?m="dashed":d instanceof THREE.PointCloudMaterial&&(m="particle_basic");if(m){var n=THREE.ShaderLib[m];d.__webglShader={uniforms:THREE.UniformsUtils.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}}else d.__webglShader=
......@@ -481,9 +481,9 @@ db;Da++){var Ka=Sa[Da];if(Ka.code===K){Z=Ka;Z.usedTimes++;break}}void 0===Z&&(Z=
a.projectionMatrix.elements),Pa&&l.uniform1f(qa.logDepthBufFC,2/(Math.log(a.far+1)/Math.LN2)),a!==Yb&&(Yb=a),(d instanceof THREE.ShaderMaterial||d instanceof THREE.MeshPhongMaterial||d.envMap)&&null!==qa.cameraPosition&&(Ua.setFromMatrixPosition(a.matrixWorld),l.uniform3f(qa.cameraPosition,Ua.x,Ua.y,Ua.z)),(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.ShaderMaterial||d.skinning)&&null!==qa.viewMatrix&&l.uniformMatrix4fv(qa.viewMatrix,!1,a.matrixWorldInverse.elements);
if(d.skinning)if(e.bindMatrix&&null!==qa.bindMatrix&&l.uniformMatrix4fv(qa.bindMatrix,!1,e.bindMatrix.elements),e.bindMatrixInverse&&null!==qa.bindMatrixInverse&&l.uniformMatrix4fv(qa.bindMatrixInverse,!1,e.bindMatrixInverse.elements),mc&&e.skeleton&&e.skeleton.useVertexTexture){if(null!==qa.boneTexture){var Aa=E();l.uniform1i(qa.boneTexture,Aa);H.setTexture(e.skeleton.boneTexture,Aa)}null!==qa.boneTextureWidth&&l.uniform1i(qa.boneTextureWidth,e.skeleton.boneTextureWidth);null!==qa.boneTextureHeight&&
l.uniform1i(qa.boneTextureHeight,e.skeleton.boneTextureHeight)}else e.skeleton&&e.skeleton.boneMatrices&&null!==qa.boneGlobalMatrices&&l.uniformMatrix4fv(qa.boneGlobalMatrices,!1,e.skeleton.boneMatrices);if(aa){c&&d.fog&&(J.fogColor.value=c.color,c instanceof THREE.Fog?(J.fogNear.value=c.near,J.fogFar.value=c.far):c instanceof THREE.FogExp2&&(J.fogDensity.value=c.density));if(d instanceof THREE.MeshPhongMaterial||d instanceof THREE.MeshLambertMaterial||d.lights){if(hc){var $=!0,oa,ja,la,Oa=0,Ha=0,
Ia=0,Ca,hb,nb,La,ob,Ba,xa=Nc,ib=xa.directional.colors,qb=xa.directional.positions,pb=xa.point.colors,Ta=xa.point.positions,ac=xa.point.distances,cb=xa.spot.colors,eb=xa.spot.positions,Gb=xa.spot.distances,Sb=xa.spot.directions,jb=xa.spot.anglesCos,kb=xa.spot.exponents,Ab=xa.hemi.skyColors,Bb=xa.hemi.groundColors,Jb=xa.hemi.positions,Xa=0,Ea=0,Va=0,Qa=0,ma=0,ua=0,C=0,Ma=0,Wa=0,Cb=0,lb=0,Ya=0;oa=0;for(ja=b.length;oa<ja;oa++)la=b[oa],la.onlyShadow||(Ca=la.color,La=la.intensity,Ba=la.distance,la instanceof
Ia=0,Ca,hb,nb,La,ob,Ba,xa=Nc,ib=xa.directional.colors,qb=xa.directional.positions,pb=xa.point.colors,Ta=xa.point.positions,ac=xa.point.distances,cb=xa.spot.colors,eb=xa.spot.positions,Hb=xa.spot.distances,Sb=xa.spot.directions,jb=xa.spot.anglesCos,kb=xa.spot.exponents,Ab=xa.hemi.skyColors,Bb=xa.hemi.groundColors,Jb=xa.hemi.positions,Xa=0,Ea=0,Va=0,Qa=0,ma=0,ua=0,C=0,Ma=0,Wa=0,Cb=0,lb=0,Ya=0;oa=0;for(ja=b.length;oa<ja;oa++)la=b[oa],la.onlyShadow||(Ca=la.color,La=la.intensity,Ba=la.distance,la instanceof
THREE.AmbientLight?la.visible&&(H.gammaInput?(Oa+=Ca.r*Ca.r,Ha+=Ca.g*Ca.g,Ia+=Ca.b*Ca.b):(Oa+=Ca.r,Ha+=Ca.g,Ia+=Ca.b)):la instanceof THREE.DirectionalLight?(ma+=1,la.visible&&(wa.setFromMatrixPosition(la.matrixWorld),Ua.setFromMatrixPosition(la.target.matrixWorld),wa.sub(Ua),wa.normalize(),Wa=3*Xa,qb[Wa]=wa.x,qb[Wa+1]=wa.y,qb[Wa+2]=wa.z,H.gammaInput?y(ib,Wa,Ca,La*La):D(ib,Wa,Ca,La),Xa+=1)):la instanceof THREE.PointLight?(ua+=1,la.visible&&(Cb=3*Ea,H.gammaInput?y(pb,Cb,Ca,La*La):D(pb,Cb,Ca,La),Ua.setFromMatrixPosition(la.matrixWorld),
Ta[Cb]=Ua.x,Ta[Cb+1]=Ua.y,Ta[Cb+2]=Ua.z,ac[Ea]=Ba,Ea+=1)):la instanceof THREE.SpotLight?(C+=1,la.visible&&(lb=3*Va,H.gammaInput?y(cb,lb,Ca,La*La):D(cb,lb,Ca,La),wa.setFromMatrixPosition(la.matrixWorld),eb[lb]=wa.x,eb[lb+1]=wa.y,eb[lb+2]=wa.z,Gb[Va]=Ba,Ua.setFromMatrixPosition(la.target.matrixWorld),wa.sub(Ua),wa.normalize(),Sb[lb]=wa.x,Sb[lb+1]=wa.y,Sb[lb+2]=wa.z,jb[Va]=Math.cos(la.angle),kb[Va]=la.exponent,Va+=1)):la instanceof THREE.HemisphereLight&&(Ma+=1,la.visible&&(wa.setFromMatrixPosition(la.matrixWorld),
Ta[Cb]=Ua.x,Ta[Cb+1]=Ua.y,Ta[Cb+2]=Ua.z,ac[Ea]=Ba,Ea+=1)):la instanceof THREE.SpotLight?(C+=1,la.visible&&(lb=3*Va,H.gammaInput?y(cb,lb,Ca,La*La):D(cb,lb,Ca,La),wa.setFromMatrixPosition(la.matrixWorld),eb[lb]=wa.x,eb[lb+1]=wa.y,eb[lb+2]=wa.z,Hb[Va]=Ba,Ua.setFromMatrixPosition(la.target.matrixWorld),wa.sub(Ua),wa.normalize(),Sb[lb]=wa.x,Sb[lb+1]=wa.y,Sb[lb+2]=wa.z,jb[Va]=Math.cos(la.angle),kb[Va]=la.exponent,Va+=1)):la instanceof THREE.HemisphereLight&&(Ma+=1,la.visible&&(wa.setFromMatrixPosition(la.matrixWorld),
wa.normalize(),Ya=3*Qa,Jb[Ya]=wa.x,Jb[Ya+1]=wa.y,Jb[Ya+2]=wa.z,hb=la.color,nb=la.groundColor,H.gammaInput?(ob=La*La,y(Ab,Ya,hb,ob),y(Bb,Ya,nb,ob)):(D(Ab,Ya,hb,La),D(Bb,Ya,nb,La)),Qa+=1)));oa=3*Xa;for(ja=Math.max(ib.length,3*ma);oa<ja;oa++)ib[oa]=0;oa=3*Ea;for(ja=Math.max(pb.length,3*ua);oa<ja;oa++)pb[oa]=0;oa=3*Va;for(ja=Math.max(cb.length,3*C);oa<ja;oa++)cb[oa]=0;oa=3*Qa;for(ja=Math.max(Ab.length,3*Ma);oa<ja;oa++)Ab[oa]=0;oa=3*Qa;for(ja=Math.max(Bb.length,3*Ma);oa<ja;oa++)Bb[oa]=0;xa.directional.length=
Xa;xa.point.length=Ea;xa.spot.length=Va;xa.hemi.length=Qa;xa.ambient[0]=Oa;xa.ambient[1]=Ha;xa.ambient[2]=Ia;hc=!1}if($){var ra=Nc;J.ambientLightColor.value=ra.ambient;J.directionalLightColor.value=ra.directional.colors;J.directionalLightDirection.value=ra.directional.positions;J.pointLightColor.value=ra.point.colors;J.pointLightPosition.value=ra.point.positions;J.pointLightDistance.value=ra.point.distances;J.spotLightColor.value=ra.spot.colors;J.spotLightPosition.value=ra.spot.positions;J.spotLightDistance.value=
ra.spot.distances;J.spotLightDirection.value=ra.spot.directions;J.spotLightAngleCos.value=ra.spot.anglesCos;J.spotLightExponent.value=ra.spot.exponents;J.hemisphereLightSkyColor.value=ra.hemi.skyColors;J.hemisphereLightGroundColor.value=ra.hemi.groundColors;J.hemisphereLightDirection.value=ra.hemi.positions;F(J,!0)}else F(J,!1)}if(d instanceof THREE.MeshBasicMaterial||d instanceof THREE.MeshLambertMaterial||d instanceof THREE.MeshPhongMaterial){J.opacity.value=d.opacity;H.gammaInput?J.diffuse.value.copyGammaToLinear(d.color):
......@@ -491,16 +491,16 @@ J.diffuse.value=d.color;J.map.value=d.map;J.lightMap.value=d.lightMap;J.specular
$a.y)}J.envMap.value=d.envMap;J.flipEnvMap.value=d.envMap instanceof THREE.WebGLRenderTargetCube?1:-1;J.reflectivity.value=d.reflectivity;J.refractionRatio.value=d.refractionRatio;J.combine.value=d.combine;J.useRefract.value=d.envMap&&d.envMap.mapping instanceof THREE.CubeRefractionMapping}d instanceof THREE.LineBasicMaterial?(J.diffuse.value=d.color,J.opacity.value=d.opacity):d instanceof THREE.LineDashedMaterial?(J.diffuse.value=d.color,J.opacity.value=d.opacity,J.dashSize.value=d.dashSize,J.totalSize.value=
d.dashSize+d.gapSize,J.scale.value=d.scale):d instanceof THREE.PointCloudMaterial?(J.psColor.value=d.color,J.opacity.value=d.opacity,J.size.value=d.size,J.scale.value=O.height/2,J.map.value=d.map):d instanceof THREE.MeshPhongMaterial?(J.shininess.value=d.shininess,H.gammaInput?(J.ambient.value.copyGammaToLinear(d.ambient),J.emissive.value.copyGammaToLinear(d.emissive),J.specular.value.copyGammaToLinear(d.specular)):(J.ambient.value=d.ambient,J.emissive.value=d.emissive,J.specular.value=d.specular),
d.wrapAround&&J.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshLambertMaterial?(H.gammaInput?(J.ambient.value.copyGammaToLinear(d.ambient),J.emissive.value.copyGammaToLinear(d.emissive)):(J.ambient.value=d.ambient,J.emissive.value=d.emissive),d.wrapAround&&J.wrapRGB.value.copy(d.wrapRGB)):d instanceof THREE.MeshDepthMaterial?(J.mNear.value=a.near,J.mFar.value=a.far,J.opacity.value=d.opacity):d instanceof THREE.MeshNormalMaterial&&(J.opacity.value=d.opacity);if(e.receiveShadow&&!d._shadowPass&&
J.shadowMatrix)for(var Kb=0,xb=0,Hb=b.length;xb<Hb;xb++){var z=b[xb];z.castShadow&&(z instanceof THREE.SpotLight||z instanceof THREE.DirectionalLight&&!z.shadowCascade)&&(J.shadowMap.value[Kb]=z.shadowMap,J.shadowMapSize.value[Kb]=z.shadowMapSize,J.shadowMatrix.value[Kb]=z.shadowMatrix,J.shadowDarkness.value[Kb]=z.shadowDarkness,J.shadowBias.value[Kb]=z.shadowBias,Kb++)}for(var Tb=d.uniformsList,Na,ya,fb,wb=0,Rb=Tb.length;wb<Rb;wb++){var fa=Tb[wb][0];if(!1!==fa.needsUpdate){var Ib=fa.type,R=fa.value,
ga=Tb[wb][1];switch(Ib){case "1i":l.uniform1i(ga,R);break;case "1f":l.uniform1f(ga,R);break;case "2f":l.uniform2f(ga,R[0],R[1]);break;case "3f":l.uniform3f(ga,R[0],R[1],R[2]);break;case "4f":l.uniform4f(ga,R[0],R[1],R[2],R[3]);break;case "1iv":l.uniform1iv(ga,R);break;case "3iv":l.uniform3iv(ga,R);break;case "1fv":l.uniform1fv(ga,R);break;case "2fv":l.uniform2fv(ga,R);break;case "3fv":l.uniform3fv(ga,R);break;case "4fv":l.uniform4fv(ga,R);break;case "Matrix3fv":l.uniformMatrix3fv(ga,!1,R);break;case "Matrix4fv":l.uniformMatrix4fv(ga,
J.shadowMatrix)for(var Kb=0,xb=0,Ib=b.length;xb<Ib;xb++){var z=b[xb];z.castShadow&&(z instanceof THREE.SpotLight||z instanceof THREE.DirectionalLight&&!z.shadowCascade)&&(J.shadowMap.value[Kb]=z.shadowMap,J.shadowMapSize.value[Kb]=z.shadowMapSize,J.shadowMatrix.value[Kb]=z.shadowMatrix,J.shadowDarkness.value[Kb]=z.shadowDarkness,J.shadowBias.value[Kb]=z.shadowBias,Kb++)}for(var Tb=d.uniformsList,Na,ya,fb,tb=0,Rb=Tb.length;tb<Rb;tb++){var fa=Tb[tb][0];if(!1!==fa.needsUpdate){var Gb=fa.type,R=fa.value,
ga=Tb[tb][1];switch(Gb){case "1i":l.uniform1i(ga,R);break;case "1f":l.uniform1f(ga,R);break;case "2f":l.uniform2f(ga,R[0],R[1]);break;case "3f":l.uniform3f(ga,R[0],R[1],R[2]);break;case "4f":l.uniform4f(ga,R[0],R[1],R[2],R[3]);break;case "1iv":l.uniform1iv(ga,R);break;case "3iv":l.uniform3iv(ga,R);break;case "1fv":l.uniform1fv(ga,R);break;case "2fv":l.uniform2fv(ga,R);break;case "3fv":l.uniform3fv(ga,R);break;case "4fv":l.uniform4fv(ga,R);break;case "Matrix3fv":l.uniformMatrix3fv(ga,!1,R);break;case "Matrix4fv":l.uniformMatrix4fv(ga,
!1,R);break;case "i":l.uniform1i(ga,R);break;case "f":l.uniform1f(ga,R);break;case "v2":l.uniform2f(ga,R.x,R.y);break;case "v3":l.uniform3f(ga,R.x,R.y,R.z);break;case "v4":l.uniform4f(ga,R.x,R.y,R.z,R.w);break;case "c":l.uniform3f(ga,R.r,R.g,R.b);break;case "iv1":l.uniform1iv(ga,R);break;case "iv":l.uniform3iv(ga,R);break;case "fv1":l.uniform1fv(ga,R);break;case "fv":l.uniform3fv(ga,R);break;case "v2v":void 0===fa._array&&(fa._array=new Float32Array(2*R.length));for(var M=0,za=R.length;M<za;M++)fb=
2*M,fa._array[fb]=R[M].x,fa._array[fb+1]=R[M].y;l.uniform2fv(ga,fa._array);break;case "v3v":void 0===fa._array&&(fa._array=new Float32Array(3*R.length));M=0;for(za=R.length;M<za;M++)fb=3*M,fa._array[fb]=R[M].x,fa._array[fb+1]=R[M].y,fa._array[fb+2]=R[M].z;l.uniform3fv(ga,fa._array);break;case "v4v":void 0===fa._array&&(fa._array=new Float32Array(4*R.length));M=0;for(za=R.length;M<za;M++)fb=4*M,fa._array[fb]=R[M].x,fa._array[fb+1]=R[M].y,fa._array[fb+2]=R[M].z,fa._array[fb+3]=R[M].w;l.uniform4fv(ga,
fa._array);break;case "m3":l.uniformMatrix3fv(ga,!1,R.elements);break;case "m3v":void 0===fa._array&&(fa._array=new Float32Array(9*R.length));M=0;for(za=R.length;M<za;M++)R[M].flattenToArrayOffset(fa._array,9*M);l.uniformMatrix3fv(ga,!1,fa._array);break;case "m4":l.uniformMatrix4fv(ga,!1,R.elements);break;case "m4v":void 0===fa._array&&(fa._array=new Float32Array(16*R.length));M=0;for(za=R.length;M<za;M++)R[M].flattenToArrayOffset(fa._array,16*M);l.uniformMatrix4fv(ga,!1,fa._array);break;case "t":Na=
R;ya=E();l.uniform1i(ga,ya);if(!Na)continue;if(Na instanceof THREE.CubeTexture||Na.image instanceof Array&&6===Na.image.length){var va=Na,Pb=ya;if(6===va.image.length)if(va.needsUpdate){va.image.__webglTextureCube||(va.addEventListener("dispose",ic),va.image.__webglTextureCube=l.createTexture(),H.info.memory.textures++);l.activeTexture(l.TEXTURE0+Pb);l.bindTexture(l.TEXTURE_CUBE_MAP,va.image.__webglTextureCube);l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL,va.flipY);for(var Qb=va instanceof THREE.CompressedTexture,
Ub=va.image[0]instanceof THREE.DataTexture,tb=[],Fa=0;6>Fa;Fa++)tb[Fa]=!H.autoScaleCubemaps||Qb||Ub?Ub?va.image[Fa].image:va.image[Fa]:N(va.image[Fa],Yc);var na=tb[0],bc=THREE.Math.isPowerOfTwo(na.width)&&THREE.Math.isPowerOfTwo(na.height),gb=T(va.format),Lb=T(va.type);L(l.TEXTURE_CUBE_MAP,va,bc);for(Fa=0;6>Fa;Fa++)if(Qb)for(var mb,cc=tb[Fa].mipmaps,ha=0,Zb=cc.length;ha<Zb;ha++)mb=cc[ha],va.format!==THREE.RGBAFormat&&va.format!==THREE.RGBFormat?-1<jc.indexOf(gb)?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+
Fa,ha,gb,mb.width,mb.height,0,mb.data):console.warn("Attempt to load unsupported compressed texture format"):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Fa,ha,gb,mb.width,mb.height,0,gb,Lb,mb.data);else Ub?l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Fa,0,gb,tb[Fa].width,tb[Fa].height,0,gb,Lb,tb[Fa].data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Fa,0,gb,gb,Lb,tb[Fa]);va.generateMipmaps&&bc&&l.generateMipmap(l.TEXTURE_CUBE_MAP);va.needsUpdate=!1;if(va.onUpdate)va.onUpdate()}else l.activeTexture(l.TEXTURE0+
Ub=va.image[0]instanceof THREE.DataTexture,ub=[],Fa=0;6>Fa;Fa++)ub[Fa]=!H.autoScaleCubemaps||Qb||Ub?Ub?va.image[Fa].image:va.image[Fa]:N(va.image[Fa],Yc);var na=ub[0],bc=THREE.Math.isPowerOfTwo(na.width)&&THREE.Math.isPowerOfTwo(na.height),gb=T(va.format),Lb=T(va.type);L(l.TEXTURE_CUBE_MAP,va,bc);for(Fa=0;6>Fa;Fa++)if(Qb)for(var mb,cc=ub[Fa].mipmaps,ha=0,Zb=cc.length;ha<Zb;ha++)mb=cc[ha],va.format!==THREE.RGBAFormat&&va.format!==THREE.RGBFormat?-1<jc.indexOf(gb)?l.compressedTexImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+
Fa,ha,gb,mb.width,mb.height,0,mb.data):console.warn("Attempt to load unsupported compressed texture format"):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Fa,ha,gb,mb.width,mb.height,0,gb,Lb,mb.data);else Ub?l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Fa,0,gb,ub[Fa].width,ub[Fa].height,0,gb,Lb,ub[Fa].data):l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+Fa,0,gb,gb,Lb,ub[Fa]);va.generateMipmaps&&bc&&l.generateMipmap(l.TEXTURE_CUBE_MAP);va.needsUpdate=!1;if(va.onUpdate)va.onUpdate()}else l.activeTexture(l.TEXTURE0+
Pb),l.bindTexture(l.TEXTURE_CUBE_MAP,va.image.__webglTextureCube)}else if(Na instanceof THREE.WebGLRenderTargetCube){var $b=Na;l.activeTexture(l.TEXTURE0+ya);l.bindTexture(l.TEXTURE_CUBE_MAP,$b.__webglTexture)}else H.setTexture(Na,ya);break;case "tv":void 0===fa._array&&(fa._array=[]);M=0;for(za=fa.value.length;M<za;M++)fa._array[M]=E();l.uniform1iv(ga,fa._array);M=0;for(za=fa.value.length;M<za;M++)Na=fa.value[M],ya=fa._array[M],Na&&H.setTexture(Na,ya);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+
Ib)}}}}l.uniformMatrix4fv(qa.modelViewMatrix,!1,e._modelViewMatrix.elements);qa.normalMatrix&&l.uniformMatrix3fv(qa.normalMatrix,!1,e._normalMatrix.elements);null!==qa.modelMatrix&&l.uniformMatrix4fv(qa.modelMatrix,!1,e.matrixWorld.elements);return ta}function F(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.spotLightColor.needsUpdate=
Gb)}}}}l.uniformMatrix4fv(qa.modelViewMatrix,!1,e._modelViewMatrix.elements);qa.normalMatrix&&l.uniformMatrix3fv(qa.normalMatrix,!1,e._normalMatrix.elements);null!==qa.modelMatrix&&l.uniformMatrix4fv(qa.modelMatrix,!1,e.matrixWorld.elements);return ta}function F(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.spotLightColor.needsUpdate=
b;a.spotLightPosition.needsUpdate=b;a.spotLightDistance.needsUpdate=b;a.spotLightDirection.needsUpdate=b;a.spotLightAngleCos.needsUpdate=b;a.spotLightExponent.needsUpdate=b;a.hemisphereLightSkyColor.needsUpdate=b;a.hemisphereLightGroundColor.needsUpdate=b;a.hemisphereLightDirection.needsUpdate=b}function E(){var a=Ob;a>=Oc&&console.warn("WebGLRenderer: trying to use "+a+" texture units while this GPU supports only "+Oc);Ob+=1;return a}function B(a,b){a._modelViewMatrix.multiplyMatrices(b.matrixWorldInverse,
a.matrixWorld);a._normalMatrix.getNormalMatrix(a._modelViewMatrix)}function y(a,b,c,d){a[b]=c.r*c.r*d;a[b+1]=c.g*c.g*d;a[b+2]=c.b*c.b*d}function D(a,b,c,d){a[b]=c.r*d;a[b+1]=c.g*d;a[b+2]=c.b*d}function Q(a){a!==Pc&&(l.lineWidth(a),Pc=a)}function G(a,b,c){Qc!==a&&(a?l.enable(l.POLYGON_OFFSET_FILL):l.disable(l.POLYGON_OFFSET_FILL),Qc=a);!a||Rc===b&&Sc===c||(l.polygonOffset(b,c),Rc=b,Sc=c)}function L(a,b,c){c?(l.texParameteri(a,l.TEXTURE_WRAP_S,T(b.wrapS)),l.texParameteri(a,l.TEXTURE_WRAP_T,T(b.wrapT)),
l.texParameteri(a,l.TEXTURE_MAG_FILTER,T(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,T(b.minFilter))):(l.texParameteri(a,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texParameteri(a,l.TEXTURE_MAG_FILTER,P(b.magFilter)),l.texParameteri(a,l.TEXTURE_MIN_FILTER,P(b.minFilter)));nb&&b.type!==THREE.FloatType&&(1<b.anisotropy||b.__oldAnisotropy)&&(l.texParameterf(a,nb.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(b.anisotropy,Tc)),b.__oldAnisotropy=b.anisotropy)}
......@@ -514,22 +514,22 @@ if(a===THREE.OneMinusDstAlphaFactor)return l.ONE_MINUS_DST_ALPHA;if(a===THREE.Ds
Ia){if(a===THREE.RGB_PVRTC_4BPPV1_Format)return Ia.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(a===THREE.RGB_PVRTC_2BPPV1_Format)return Ia.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(a===THREE.RGBA_PVRTC_4BPPV1_Format)return Ia.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(a===THREE.RGBA_PVRTC_2BPPV1_Format)return Ia.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(void 0!==hb){if(a===THREE.MinEquation)return hb.MIN_EXT;if(a===THREE.MaxEquation)return hb.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);a=a||{};var O=void 0!==
a.canvas?a.canvas:document.createElement("canvas"),sa=void 0!==a.context?a.context:null,Y=void 0!==a.precision?a.precision:"highp",ca=void 0!==a.alpha?a.alpha:!1,ia=void 0!==a.depth?a.depth:!0,ta=void 0!==a.stencil?a.stencil:!0,I=void 0!==a.antialias?a.antialias:!1,Aa=void 0!==a.premultipliedAlpha?a.premultipliedAlpha:!0,ja=void 0!==a.preserveDrawingBuffer?a.preserveDrawingBuffer:!1,Pa=void 0!==a.logarithmicDepthBuffer?a.logarithmicDepthBuffer:!1,S=new THREE.Color(0),Ka=0,Da=[],db={},Ja=[],rb=[],
sb=[];this.domElement=O;this.context=null;this.devicePixelRatio=void 0!==a.devicePixelRatio?a.devicePixelRatio:void 0!==self.devicePixelRatio?self.devicePixelRatio:1;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1;this.shadowMapAutoUpdate=!0;this.shadowMapType=THREE.PCFShadowMap;this.shadowMapCullFace=THREE.CullFaceFront;this.shadowMapCascade=this.shadowMapDebug=!1;this.maxMorphTargets=8;this.maxMorphNormals=
4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var H=this,Sa=[],yb=null,ac=null,zb=-1,Oa=null,Yb=null,Ob=0,Pb=-1,Qb=-1,Zb=-1,$b=-1,nc=-1,oc=-1,ob=-1,ib=-1,Qc=null,Rc=null,Sc=null,Pc=null,wb=0,pc=0,qc=O.width,pb=O.height,Ac=0,Bc=0,xb=new Uint8Array(16),Hb=new Uint8Array(16),Cc=new THREE.Frustum,yc=new THREE.Matrix4,Fc=new THREE.Matrix4,Ua=new THREE.Vector3,wa=new THREE.Vector3,
hc=!0,Nc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},l,qb,Rb,nb,Ha,Ia,Gb,hb;(function(){try{var a={alpha:ca,depth:ia,stencil:ta,antialias:I,premultipliedAlpha:Aa,preserveDrawingBuffer:ja};l=sa||O.getContext("webgl",a)||O.getContext("experimental-webgl",a);if(null===l)throw"Error creating WebGL context.";
}catch(b){console.error(b)}qb=l.getExtension("OES_texture_float");l.getExtension("OES_texture_float_linear");null===qb&&console.log("THREE.WebGLRenderer: Float textures not supported.");Rb=l.getExtension("OES_standard_derivatives");null===Rb&&console.log("THREE.WebGLRenderer: Standard derivatives not supported.");nb=l.getExtension("EXT_texture_filter_anisotropic")||l.getExtension("MOZ_EXT_texture_filter_anisotropic")||l.getExtension("WEBKIT_EXT_texture_filter_anisotropic");null===nb&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");
Ha=l.getExtension("WEBGL_compressed_texture_s3tc")||l.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||l.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");null===Ha&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");Ia=l.getExtension("WEBGL_compressed_texture_pvrtc")||l.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");null===Ia&&console.log("THREE.WebGLRenderer: PVRTC compressed textures not supported.");Gb=l.getExtension("OES_element_index_uint");null===Gb&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");
4;this.autoScaleCubemaps=!0;this.renderPluginsPre=[];this.renderPluginsPost=[];this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var H=this,Sa=[],yb=null,ac=null,zb=-1,Oa=null,Yb=null,Ob=0,Pb=-1,Qb=-1,Zb=-1,$b=-1,nc=-1,oc=-1,ob=-1,ib=-1,Qc=null,Rc=null,Sc=null,Pc=null,Rb=0,pc=0,qc=O.width,pb=O.height,Ac=0,Bc=0,xb=new Uint8Array(16),Ib=new Uint8Array(16),Cc=new THREE.Frustum,yc=new THREE.Matrix4,Fc=new THREE.Matrix4,Ua=new THREE.Vector3,wa=new THREE.Vector3,
hc=!0,Nc={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},l,qb,Gb,nb,Ha,Ia,Hb,hb;(function(){try{var a={alpha:ca,depth:ia,stencil:ta,antialias:I,premultipliedAlpha:Aa,preserveDrawingBuffer:ja};l=sa||O.getContext("webgl",a)||O.getContext("experimental-webgl",a);if(null===l)throw"Error creating WebGL context.";
}catch(b){console.error(b)}qb=l.getExtension("OES_texture_float");l.getExtension("OES_texture_float_linear");null===qb&&console.log("THREE.WebGLRenderer: Float textures not supported.");Gb=l.getExtension("OES_standard_derivatives");null===Gb&&console.log("THREE.WebGLRenderer: Standard derivatives not supported.");nb=l.getExtension("EXT_texture_filter_anisotropic")||l.getExtension("MOZ_EXT_texture_filter_anisotropic")||l.getExtension("WEBKIT_EXT_texture_filter_anisotropic");null===nb&&console.log("THREE.WebGLRenderer: Anisotropic texture filtering not supported.");
Ha=l.getExtension("WEBGL_compressed_texture_s3tc")||l.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||l.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");null===Ha&&console.log("THREE.WebGLRenderer: S3TC compressed textures not supported.");Ia=l.getExtension("WEBGL_compressed_texture_pvrtc")||l.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");null===Ia&&console.log("THREE.WebGLRenderer: PVRTC compressed textures not supported.");Hb=l.getExtension("OES_element_index_uint");null===Hb&&console.log("THREE.WebGLRenderer: elementindex as unsigned integer not supported.");
hb=l.getExtension("EXT_blend_minmax");null===hb&&console.log("THREE.WebGLRenderer: min max blend equations not supported.");void 0===l.getShaderPrecisionFormat&&(l.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});Pa&&l.getExtension("EXT_frag_depth")})();l.clearColor(0,0,0,1);l.clearDepth(1);l.clearStencil(0);l.enable(l.DEPTH_TEST);l.depthFunc(l.LEQUAL);l.frontFace(l.CCW);l.cullFace(l.BACK);l.enable(l.CULL_FACE);l.enable(l.BLEND);l.blendEquation(l.FUNC_ADD);l.blendFunc(l.SRC_ALPHA,
l.ONE_MINUS_SRC_ALPHA);l.viewport(wb,pc,qc,pb);l.clearColor(S.r,S.g,S.b,Ka);this.context=l;var Oc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Zc=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),$c=l.getParameter(l.MAX_TEXTURE_SIZE),Yc=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),Tc=nb?l.getParameter(nb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,gc=0<Zc,mc=gc&&qb,jc=[];if(Ia||Ha)for(var Uc=l.getParameter(l.COMPRESSED_TEXTURE_FORMATS),rc=0;rc<Uc.length;rc++)jc.push(Uc[rc]);var ad=l.getShaderPrecisionFormat(l.VERTEX_SHADER,
l.ONE_MINUS_SRC_ALPHA);l.viewport(Rb,pc,qc,pb);l.clearColor(S.r,S.g,S.b,Ka);this.context=l;var Oc=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),Zc=l.getParameter(l.MAX_VERTEX_TEXTURE_IMAGE_UNITS),$c=l.getParameter(l.MAX_TEXTURE_SIZE),Yc=l.getParameter(l.MAX_CUBE_MAP_TEXTURE_SIZE),Tc=nb?l.getParameter(nb.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,gc=0<Zc,mc=gc&&qb,jc=[];if(Ia||Ha)for(var Uc=l.getParameter(l.COMPRESSED_TEXTURE_FORMATS),rc=0;rc<Uc.length;rc++)jc.push(Uc[rc]);var ad=l.getShaderPrecisionFormat(l.VERTEX_SHADER,
l.HIGH_FLOAT),bd=l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.VERTEX_SHADER,l.LOW_FLOAT);var cd=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT),dd=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.MEDIUM_FLOAT);l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.LOW_FLOAT);var ed=0<ad.precision&&0<cd.precision,Vc=0<bd.precision&&0<dd.precision;"highp"!==Y||ed||(Vc?(Y="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(Y=
"lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==Y||Vc||(Y="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));this.getContext=function(){return l};this.supportsVertexTextures=function(){return gc};this.supportsFloatTextures=function(){return qb};this.supportsStandardDerivatives=function(){return Rb};this.supportsCompressedTextureS3TC=function(){return Ha};this.supportsCompressedTexturePVRTC=function(){return Ia};this.supportsBlendMinMax=
function(){return hb};this.getMaxAnisotropy=function(){return Tc};this.getPrecision=function(){return Y};this.setSize=function(a,b,c){O.width=a*this.devicePixelRatio;O.height=b*this.devicePixelRatio;!1!==c&&(O.style.width=a+"px",O.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){wb=a*this.devicePixelRatio;pc=b*this.devicePixelRatio;qc=c*this.devicePixelRatio;pb=d*this.devicePixelRatio;l.viewport(wb,pc,qc,pb)};this.setScissor=function(a,b,c,d){l.scissor(a*this.devicePixelRatio,
"lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp.")));"mediump"!==Y||Vc||(Y="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));this.getContext=function(){return l};this.supportsVertexTextures=function(){return gc};this.supportsFloatTextures=function(){return qb};this.supportsStandardDerivatives=function(){return Gb};this.supportsCompressedTextureS3TC=function(){return Ha};this.supportsCompressedTexturePVRTC=function(){return Ia};this.supportsBlendMinMax=
function(){return hb};this.getMaxAnisotropy=function(){return Tc};this.getPrecision=function(){return Y};this.setSize=function(a,b,c){O.width=a*this.devicePixelRatio;O.height=b*this.devicePixelRatio;!1!==c&&(O.style.width=a+"px",O.style.height=b+"px");this.setViewport(0,0,a,b)};this.setViewport=function(a,b,c,d){Rb=a*this.devicePixelRatio;pc=b*this.devicePixelRatio;qc=c*this.devicePixelRatio;pb=d*this.devicePixelRatio;l.viewport(Rb,pc,qc,pb)};this.setScissor=function(a,b,c,d){l.scissor(a*this.devicePixelRatio,
b*this.devicePixelRatio,c*this.devicePixelRatio,d*this.devicePixelRatio)};this.enableScissorTest=function(a){a?l.enable(l.SCISSOR_TEST):l.disable(l.SCISSOR_TEST)};this.setClearColor=function(a,b){S.set(a);Ka=void 0!==b?b:1;l.clearColor(S.r,S.g,S.b,Ka)};this.setClearColorHex=function(a,b){console.warn("THREE.WebGLRenderer: .setClearColorHex() is being removed. Use .setClearColor() instead.");this.setClearColor(a,b)};this.getClearColor=function(){return S};this.getClearAlpha=function(){return Ka};this.clear=
function(a,b,c){var d=0;if(void 0===a||a)d|=l.COLOR_BUFFER_BIT;if(void 0===b||b)d|=l.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=l.STENCIL_BUFFER_BIT;l.clear(d)};this.clearColor=function(){l.clear(l.COLOR_BUFFER_BIT)};this.clearDepth=function(){l.clear(l.DEPTH_BUFFER_BIT)};this.clearStencil=function(){l.clear(l.STENCIL_BUFFER_BIT)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.addPostPlugin=function(a){a.init(this,Da,db,Ja);this.renderPluginsPost.push(a)};this.addPrePlugin=
function(a){a.init(this,Da,db,Ja);this.renderPluginsPre.push(a)};this.updateShadowMap=function(a,b){yb=null;zb=Oa=ib=ob=Zb=-1;hc=!0;Qb=Pb=-1;this.shadowMapPlugin.update(a,b)};var Gc=function(a){a.target.traverse(function(a){a.removeEventListener("remove",Gc);if(a instanceof THREE.Mesh||a instanceof THREE.PointCloud||a instanceof THREE.Line)delete db[a.id];else if(a instanceof THREE.ImmediateRenderObject||a.immediateRenderCallback)for(var b=Ja,c=b.length-1;0<=c;c--)b[c].object===a&&b.splice(c,1);delete a.__webglInit;
delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})},Hc=function(a){a=a.target;a.removeEventListener("dispose",Hc);delete a.__webglInit;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(l.deleteBuffer(c.buffer),delete c.buffer)}H.info.memory.geometries--}else if(b=Ib[a.id],void 0!==b)for(a=0,c=b.length;a<c;a++){var d=b[a];if(void 0!==d.numMorphTargets){for(var e=0,f=d.numMorphTargets;e<f;e++)l.deleteBuffer(d.__webglMorphTargetsBuffers[e]);
delete d.__webglMorphTargetsBuffers}if(void 0!==d.numMorphNormals){e=0;for(f=d.numMorphNormals;e<f;e++)l.deleteBuffer(d.__webglMorphNormalsBuffers[e]);delete d.__webglMorphNormalsBuffers}Wc(d)}else Wc(a);Oa=-1},ic=function(a){a=a.target;a.removeEventListener("dispose",ic);a.image&&a.image.__webglTextureCube?(l.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(l.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);H.info.memory.textures--},
Xc=function(a){a=a.target;a.removeEventListener("dispose",Xc);if(a&&void 0!==a.__webglTexture){l.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}H.info.memory.textures--},Mc=function(a){a=a.target;
a.removeEventListener("dispose",Mc);Lc(a)},Wc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(l.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[e].buffer);
delete a._modelViewMatrix;delete a._normalMatrix;delete a.__webglActive})},Hc=function(a){a=a.target;a.removeEventListener("dispose",Hc);delete a.__webglInit;if(a instanceof THREE.BufferGeometry){for(var b in a.attributes){var c=a.attributes[b];void 0!==c.buffer&&(l.deleteBuffer(c.buffer),delete c.buffer)}H.info.memory.geometries--}else if(b=tb[a.id],void 0!==b){for(var c=0,d=b.length;c<d;c++){var e=b[c];if(void 0!==e.numMorphTargets){for(var f=0,g=e.numMorphTargets;f<g;f++)l.deleteBuffer(e.__webglMorphTargetsBuffers[f]);
delete e.__webglMorphTargetsBuffers}if(void 0!==e.numMorphNormals){f=0;for(g=e.numMorphNormals;f<g;f++)l.deleteBuffer(e.__webglMorphNormalsBuffers[f]);delete e.__webglMorphNormalsBuffers}Wc(e)}delete tb[a.id]}else Wc(a);Oa=-1},ic=function(a){a=a.target;a.removeEventListener("dispose",ic);a.image&&a.image.__webglTextureCube?(l.deleteTexture(a.image.__webglTextureCube),delete a.image.__webglTextureCube):void 0!==a.__webglInit&&(l.deleteTexture(a.__webglTexture),delete a.__webglTexture,delete a.__webglInit);
H.info.memory.textures--},Xc=function(a){a=a.target;a.removeEventListener("dispose",Xc);if(a&&void 0!==a.__webglTexture){l.deleteTexture(a.__webglTexture);delete a.__webglTexture;if(a instanceof THREE.WebGLRenderTargetCube)for(var b=0;6>b;b++)l.deleteFramebuffer(a.__webglFramebuffer[b]),l.deleteRenderbuffer(a.__webglRenderbuffer[b]);else l.deleteFramebuffer(a.__webglFramebuffer),l.deleteRenderbuffer(a.__webglRenderbuffer);delete a.__webglFramebuffer;delete a.__webglRenderbuffer}H.info.memory.textures--},
Mc=function(a){a=a.target;a.removeEventListener("dispose",Mc);Lc(a)},Wc=function(a){for(var b="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),c=0,d=b.length;c<d;c++){var e=b[c];void 0!==a[e]&&(l.deleteBuffer(a[e]),delete a[e])}if(void 0!==a.__webglCustomAttributesList){for(e in a.__webglCustomAttributesList)l.deleteBuffer(a.__webglCustomAttributesList[e].buffer);
delete a.__webglCustomAttributesList}H.info.memory.geometries--},Lc=function(a){var b=a.program.program;if(void 0!==b){a.program=void 0;var c,d,e=!1;a=0;for(c=Sa.length;a<c;a++)if(d=Sa[a],d.program===b){d.usedTimes--;0===d.usedTimes&&(e=!0);break}if(!0===e){e=[];a=0;for(c=Sa.length;a<c;a++)d=Sa[a],d.program!==b&&e.push(d);Sa=e;l.deleteProgram(b);H.info.memory.programs--}}};this.renderBufferImmediate=function(a,b,c){g();a.hasPositions&&!a.__webglVertexBuffer&&(a.__webglVertexBuffer=l.createBuffer());
a.hasNormals&&!a.__webglNormalBuffer&&(a.__webglNormalBuffer=l.createBuffer());a.hasUvs&&!a.__webglUvBuffer&&(a.__webglUvBuffer=l.createBuffer());a.hasColors&&!a.__webglColorBuffer&&(a.__webglColorBuffer=l.createBuffer());a.hasPositions&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglVertexBuffer),l.bufferData(l.ARRAY_BUFFER,a.positionArray,l.DYNAMIC_DRAW),f(b.attributes.position),l.vertexAttribPointer(b.attributes.position,3,l.FLOAT,!1,0,0));if(a.hasNormals){l.bindBuffer(l.ARRAY_BUFFER,a.__webglNormalBuffer);
if(c.shading===THREE.FlatShading){var d,e,k,m,n,p,q,t,s,r,u,w=3*a.count;for(u=0;u<w;u+=9)r=a.normalArray,d=r[u],e=r[u+1],k=r[u+2],m=r[u+3],p=r[u+4],t=r[u+5],n=r[u+6],q=r[u+7],s=r[u+8],d=(d+m+n)/3,e=(e+p+q)/3,k=(k+t+s)/3,r[u]=d,r[u+1]=e,r[u+2]=k,r[u+3]=d,r[u+4]=e,r[u+5]=k,r[u+6]=d,r[u+7]=e,r[u+8]=k}l.bufferData(l.ARRAY_BUFFER,a.normalArray,l.DYNAMIC_DRAW);f(b.attributes.normal);l.vertexAttribPointer(b.attributes.normal,3,l.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(l.bindBuffer(l.ARRAY_BUFFER,a.__webglUvBuffer),
......@@ -549,7 +549,7 @@ q;p++)t=n[p].index,b&&(e(d,a,f,t),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,c.buffer))
k.type===THREE.LineStrip?l.LINE_STRIP:l.LINES,Q(d.linewidth),l.drawArrays(k,0,e.__webglLineCount),H.info.render.calls++):k instanceof THREE.PointCloud&&(l.drawArrays(l.POINTS,0,e.__webglParticleCount),H.info.render.calls++,H.info.render.points+=e.__webglParticleCount)}};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,f,g,h=a.fog;zb=-1;Yb=null;hc=!0;!0===a.autoUpdate&&a.updateMatrixWorld();
void 0===b.parent&&b.updateMatrixWorld();a.traverse(function(a){a instanceof THREE.SkinnedMesh&&a.skeleton.update()});b.matrixWorldInverse.getInverse(b.matrixWorld);yc.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse);Cc.setFromMatrix(yc);Da.length=0;rb.length=0;sb.length=0;m(a,a);!0===H.sortObjects&&(rb.sort(k),sb.sort(n));t(this.renderPluginsPre,a,b);H.info.render.calls=0;H.info.render.vertices=0;H.info.render.faces=0;H.info.render.points=0;this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,
this.autoClearDepth,this.autoClearStencil);d=0;for(e=Ja.length;d<e;d++)f=Ja[d],g=f.object,g.visible&&(B(g,b),r(f));a.overrideMaterial?(d=a.overrideMaterial,this.setBlending(d.blending,d.blendEquation,d.blendSrc,d.blendDst),this.setDepthTest(d.depthTest),this.setDepthWrite(d.depthWrite),G(d.polygonOffset,d.polygonOffsetFactor,d.polygonOffsetUnits),q(rb,b,Da,h,!0,d),q(sb,b,Da,h,!0,d),s(Ja,"",b,Da,h,!1,d)):(d=null,this.setBlending(THREE.NoBlending),q(rb,b,Da,h,!1,d),s(Ja,"opaque",b,Da,h,!1,d),q(sb,b,
Da,h,!0,d),s(Ja,"transparent",b,Da,h,!0,d));t(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&U(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=x(a,b,c,d,e);Oa=-1;H.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,Cc):e.render(function(a){H.renderBufferImmediate(a,f,d)})};var Ib={},Kc=0;this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};
Da,h,!0,d),s(Ja,"transparent",b,Da,h,!0,d));t(this.renderPluginsPost,a,b);c&&c.generateMipmaps&&c.minFilter!==THREE.NearestFilter&&c.minFilter!==THREE.LinearFilter&&U(c);this.setDepthTest(!0);this.setDepthWrite(!0)}};this.renderImmediateObject=function(a,b,c,d,e){var f=x(a,b,c,d,e);Oa=-1;H.setMaterialFaces(d);e.immediateRenderCallback?e.immediateRenderCallback(f,l,Cc):e.render(function(a){H.renderBufferImmediate(a,f,d)})};var tb={},Kc=0;this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")};
this.setFaceCulling=function(a,b){a===THREE.CullFaceNone?l.disable(l.CULL_FACE):(b===THREE.FrontFaceDirectionCW?l.frontFace(l.CW):l.frontFace(l.CCW),a===THREE.CullFaceBack?l.cullFace(l.BACK):a===THREE.CullFaceFront?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK),l.enable(l.CULL_FACE))};this.setMaterialFaces=function(a){var b=a.side===THREE.DoubleSide;a=a.side===THREE.BackSide;Pb!==b&&(b?l.disable(l.CULL_FACE):l.enable(l.CULL_FACE),Pb=b);Qb!==a&&(a?l.frontFace(l.CW):l.frontFace(l.CCW),Qb=a)};this.setDepthTest=
function(a){ob!==a&&(a?l.enable(l.DEPTH_TEST):l.disable(l.DEPTH_TEST),ob=a)};this.setDepthWrite=function(a){ib!==a&&(l.depthMask(a),ib=a)};this.setBlending=function(a,b,c,d){a!==Zb&&(a===THREE.NoBlending?l.disable(l.BLEND):a===THREE.AdditiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):a===THREE.SubtractiveBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):a===THREE.MultiplyBlending?(l.enable(l.BLEND),l.blendEquation(l.FUNC_ADD),
l.blendFunc(l.ZERO,l.SRC_COLOR)):a===THREE.CustomBlending?l.enable(l.BLEND):(l.enable(l.BLEND),l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),Zb=a);if(a===THREE.CustomBlending){if(b!==$b&&(l.blendEquation(T(b)),$b=b),c!==nc||d!==oc)l.blendFunc(T(c),T(d)),nc=c,oc=d}else oc=nc=$b=null};this.uploadTexture=function(a){void 0===a.__webglInit&&(a.__webglInit=!0,a.addEventListener("dispose",ic),a.__webglTexture=l.createTexture(),
......@@ -559,7 +559,7 @@ f.length;g<h;g++)b=f[g],l.texImage2D(l.TEXTURE_2D,g,d,d,e,b);a.generateMipmaps=!
(a.depthBuffer=!0);void 0===a.stencilBuffer&&(a.stencilBuffer=!0);a.addEventListener("dispose",Xc);a.__webglTexture=l.createTexture();H.info.memory.textures++;var c=THREE.Math.isPowerOfTwo(a.width)&&THREE.Math.isPowerOfTwo(a.height),d=T(a.format),e=T(a.type);if(b){a.__webglFramebuffer=[];a.__webglRenderbuffer=[];l.bindTexture(l.TEXTURE_CUBE_MAP,a.__webglTexture);L(l.TEXTURE_CUBE_MAP,a,c);for(var f=0;6>f;f++){a.__webglFramebuffer[f]=l.createFramebuffer();a.__webglRenderbuffer[f]=l.createRenderbuffer();
l.texImage2D(l.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,d,a.width,a.height,0,d,e,null);var g=a,h=l.TEXTURE_CUBE_MAP_POSITIVE_X+f;l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer[f]);l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,h,g.__webglTexture,0);X(a.__webglRenderbuffer[f],a)}c&&l.generateMipmap(l.TEXTURE_CUBE_MAP)}else a.__webglFramebuffer=l.createFramebuffer(),a.__webglRenderbuffer=a.shareDepthFrom?a.shareDepthFrom.__webglRenderbuffer:l.createRenderbuffer(),l.bindTexture(l.TEXTURE_2D,a.__webglTexture),
L(l.TEXTURE_2D,a,c),l.texImage2D(l.TEXTURE_2D,0,d,a.width,a.height,0,d,e,null),d=l.TEXTURE_2D,l.bindFramebuffer(l.FRAMEBUFFER,a.__webglFramebuffer),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,d,a.__webglTexture,0),a.shareDepthFrom?a.depthBuffer&&!a.stencilBuffer?l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):a.depthBuffer&&a.stencilBuffer&&l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,a.__webglRenderbuffer):
X(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=qc,a=pb,d=wb,e=pc);b!==ac&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),ac=b);Ac=c;Bc=a};this.resetGLState=function(){Yb=yb=null;zb=Oa=Qb=Pb=ib=ob=Zb=-1;hc=!0};this.shadowMapPlugin=
X(a.__webglRenderbuffer,a),c&&l.generateMipmap(l.TEXTURE_2D);b?l.bindTexture(l.TEXTURE_CUBE_MAP,null):l.bindTexture(l.TEXTURE_2D,null);l.bindRenderbuffer(l.RENDERBUFFER,null);l.bindFramebuffer(l.FRAMEBUFFER,null)}a?(b=b?a.__webglFramebuffer[a.activeCubeFace]:a.__webglFramebuffer,c=a.width,a=a.height,e=d=0):(b=null,c=qc,a=pb,d=Rb,e=pc);b!==ac&&(l.bindFramebuffer(l.FRAMEBUFFER,b),l.viewport(d,e,c,a),ac=b);Ac=c;Bc=a};this.resetGLState=function(){Yb=yb=null;zb=Oa=Qb=Pb=ib=ob=Zb=-1;hc=!0};this.shadowMapPlugin=
new THREE.ShadowMapPlugin;this.addPrePlugin(this.shadowMapPlugin);this.addPostPlugin(new THREE.SpritePlugin);this.addPostPlugin(new THREE.LensFlarePlugin)};
THREE.WebGLRenderTarget=function(a,b,c){this.width=a;this.height=b;c=c||{};this.wrapS=void 0!==c.wrapS?c.wrapS:THREE.ClampToEdgeWrapping;this.wrapT=void 0!==c.wrapT?c.wrapT:THREE.ClampToEdgeWrapping;this.magFilter=void 0!==c.magFilter?c.magFilter:THREE.LinearFilter;this.minFilter=void 0!==c.minFilter?c.minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=void 0!==c.anisotropy?c.anisotropy:1;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.format=void 0!==c.format?c.format:
THREE.RGBAFormat;this.type=void 0!==c.type?c.type:THREE.UnsignedByteType;this.depthBuffer=void 0!==c.depthBuffer?c.depthBuffer:!0;this.stencilBuffer=void 0!==c.stencilBuffer?c.stencilBuffer:!0;this.generateMipmaps=!0;this.shareDepthFrom=null};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册