diff --git a/build/three.js b/build/three.js index 6ad8a582745f94fec9d1ab8f448aeea101203f3a..e803466e5839e8d53b11dbadbe9dfb948ecf89f7 100644 --- a/build/three.js +++ b/build/three.js @@ -97,90 +97,6 @@ } - /** - * https://github.com/mrdoob/eventdispatcher.js/ - */ - - function EventDispatcher() {} - - Object.assign( EventDispatcher.prototype, { - - addEventListener: function ( type, listener ) { - - if ( this._listeners === undefined ) { this._listeners = {}; } - - var listeners = this._listeners; - - if ( listeners[ type ] === undefined ) { - - listeners[ type ] = []; - - } - - if ( listeners[ type ].indexOf( listener ) === - 1 ) { - - listeners[ type ].push( listener ); - - } - - }, - - hasEventListener: function ( type, listener ) { - - if ( this._listeners === undefined ) { return false; } - - var listeners = this._listeners; - - return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1; - - }, - - removeEventListener: function ( type, listener ) { - - if ( this._listeners === undefined ) { return; } - - var listeners = this._listeners; - var listenerArray = listeners[ type ]; - - if ( listenerArray !== undefined ) { - - var index = listenerArray.indexOf( listener ); - - if ( index !== - 1 ) { - - listenerArray.splice( index, 1 ); - - } - - } - - }, - - dispatchEvent: function ( event ) { - - if ( this._listeners === undefined ) { return; } - - var listeners = this._listeners; - var listenerArray = listeners[ event.type ]; - - if ( listenerArray !== undefined ) { - - event.target = this; - - var array = listenerArray.slice( 0 ); - - for ( var i = 0, l = array.length; i < l; i ++ ) { - - array[ i ].call( this, event ); - - } - - } - - } - - } ); - var REVISION = '109dev'; var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 }; var TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 }; @@ -350,6 +266,90 @@ var GreaterEqualStencilFunc = 518; var AlwaysStencilFunc = 519; + /** + * https://github.com/mrdoob/eventdispatcher.js/ + */ + + function EventDispatcher() {} + + Object.assign( EventDispatcher.prototype, { + + addEventListener: function ( type, listener ) { + + if ( this._listeners === undefined ) { this._listeners = {}; } + + var listeners = this._listeners; + + if ( listeners[ type ] === undefined ) { + + listeners[ type ] = []; + + } + + if ( listeners[ type ].indexOf( listener ) === - 1 ) { + + listeners[ type ].push( listener ); + + } + + }, + + hasEventListener: function ( type, listener ) { + + if ( this._listeners === undefined ) { return false; } + + var listeners = this._listeners; + + return listeners[ type ] !== undefined && listeners[ type ].indexOf( listener ) !== - 1; + + }, + + removeEventListener: function ( type, listener ) { + + if ( this._listeners === undefined ) { return; } + + var listeners = this._listeners; + var listenerArray = listeners[ type ]; + + if ( listenerArray !== undefined ) { + + var index = listenerArray.indexOf( listener ); + + if ( index !== - 1 ) { + + listenerArray.splice( index, 1 ); + + } + + } + + }, + + dispatchEvent: function ( event ) { + + if ( this._listeners === undefined ) { return; } + + var listeners = this._listeners; + var listenerArray = listeners[ event.type ]; + + if ( listenerArray !== undefined ) { + + event.target = this; + + var array = listenerArray.slice( 0 ); + + for ( var i = 0, l = array.length; i < l; i ++ ) { + + array[ i ].call( this, event ); + + } + + } + + } + + } ); + /** * @author alteredq / http://alteredqualia.com/ * @author mrdoob / http://mrdoob.com/ @@ -8330,9 +8330,10 @@ this.depthTest = true; this.depthWrite = true; + this.stencilWriteMask = 0xff; this.stencilFunc = AlwaysStencilFunc; this.stencilRef = 0; - this.stencilMask = 0xff; + this.stencilFuncMask = 0xff; this.stencilFail = KeepStencilOp; this.stencilZFail = KeepStencilOp; this.stencilZPass = KeepStencilOp; @@ -8458,6 +8459,7 @@ if ( this.roughness !== undefined ) { data.roughness = this.roughness; } if ( this.metalness !== undefined ) { data.metalness = this.metalness; } + if ( this.sheen && this.sheen.isColor ) { data.sheen = this.sheen.getHex(); } if ( this.emissive && this.emissive.isColor ) { data.emissive = this.emissive.getHex(); } if ( this.emissiveIntensity && this.emissiveIntensity !== 1 ) { data.emissiveIntensity = this.emissiveIntensity; } @@ -8547,9 +8549,10 @@ data.depthWrite = this.depthWrite; data.stencilWrite = this.stencilWrite; + data.stencilWriteMask = this.stencilWriteMask; data.stencilFunc = this.stencilFunc; data.stencilRef = this.stencilRef; - data.stencilMask = this.stencilMask; + data.stencilFuncMask = this.stencilFuncMask; data.stencilFail = this.stencilFail; data.stencilZFail = this.stencilZFail; data.stencilZPass = this.stencilZPass; @@ -8651,9 +8654,10 @@ this.depthWrite = source.depthWrite; this.stencilWrite = source.stencilWrite; + this.stencilWriteMask = source.stencilWriteMask; this.stencilFunc = source.stencilFunc; this.stencilRef = source.stencilRef; - this.stencilMask = source.stencilMask; + this.stencilFuncMask = source.stencilFuncMask; this.stencilFail = source.stencilFail; this.stencilZFail = source.stencilZFail; this.stencilZPass = source.stencilZPass; @@ -15545,6 +15549,10 @@ var maxSamples = isWebGL2 ? gl.getParameter( 36183 ) : 0; + var multiviewExt = extensions.get( 'OVR_multiview2' ); + var multiview = isWebGL2 && !! multiviewExt && ! gl.getContextAttributes().antialias; + var maxMultiviewViews = multiview ? gl.getParameter( multiviewExt.MAX_VIEWS_OVR ) : 0; + return { isWebGL2: isWebGL2, @@ -15569,7 +15577,10 @@ floatFragmentTextures: floatFragmentTextures, floatVertexTextures: floatVertexTextures, - maxSamples: maxSamples + maxSamples: maxSamples, + + multiview: multiview, + maxMultiviewViews: maxMultiviewViews }; @@ -17599,6 +17610,9 @@ var prefixVertex, prefixFragment; + var renderTarget = renderer.getRenderTarget(); + var numMultiviewViews = renderTarget && renderTarget.isWebGLMultiviewRenderTarget ? renderTarget.numViews : 0; + if ( material.isRawShaderMaterial ) { prefixVertex = [ @@ -17686,14 +17700,27 @@ parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', parameters.logarithmicDepthBuffer && ( capabilities.isWebGL2 || extensions.get( 'EXT_frag_depth' ) ) ? '#define USE_LOGDEPTHBUF_EXT' : '', - 'uniform mat4 modelMatrix;', - 'uniform mat4 modelViewMatrix;', - 'uniform mat4 projectionMatrix;', - 'uniform mat4 viewMatrix;', - 'uniform mat3 normalMatrix;', 'uniform vec3 cameraPosition;', + numMultiviewViews > 0 ? [ + 'uniform mat4 modelViewMatrices[' + numMultiviewViews + '];', + 'uniform mat3 normalMatrices[' + numMultiviewViews + '];', + 'uniform mat4 viewMatrices[' + numMultiviewViews + '];', + 'uniform mat4 projectionMatrices[' + numMultiviewViews + '];', + + '#define modelViewMatrix modelViewMatrices[VIEW_ID]', + '#define normalMatrix normalMatrices[VIEW_ID]', + '#define viewMatrix viewMatrices[VIEW_ID]', + '#define projectionMatrix projectionMatrices[VIEW_ID]' + + ].join( '\n' ) : [ + + 'uniform mat4 modelViewMatrix;', + 'uniform mat4 projectionMatrix;', + 'uniform mat4 viewMatrix;', + 'uniform mat3 normalMatrix;' ].join( '\n' ), + 'attribute vec3 position;', 'attribute vec3 normal;', 'attribute vec2 uv;', @@ -17810,9 +17837,15 @@ ( ( material.extensions ? material.extensions.shaderTextureLOD : false ) || parameters.envMap ) && ( capabilities.isWebGL2 || extensions.get( 'EXT_shader_texture_lod' ) ) ? '#define TEXTURE_LOD_EXT' : '', - 'uniform mat4 viewMatrix;', 'uniform vec3 cameraPosition;', + numMultiviewViews > 0 ? [ + + 'uniform mat4 viewMatrices[' + numMultiviewViews + '];', + '#define viewMatrix viewMatrices[VIEW_ID]' + + ].join( '\n' ) : 'uniform mat4 viewMatrix;', + ( parameters.toneMapping !== NoToneMapping ) ? '#define TONE_MAPPING' : '', ( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below ( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '', @@ -17866,6 +17899,15 @@ // GLSL 3.0 conversion prefixVertex = [ '#version 300 es\n', + + numMultiviewViews > 0 ? [ + + '#extension GL_OVR_multiview2 : require', + 'layout(num_views = ' + numMultiviewViews + ') in;', + '#define VIEW_ID gl_ViewID_OVR' + + ].join( '\n' ) : '', + '#define attribute in', '#define varying out', '#define texture2D texture' @@ -17873,6 +17915,12 @@ prefixFragment = [ '#version 300 es\n', + numMultiviewViews > 0 ? [ + + '#extension GL_OVR_multiview2 : require', + '#define VIEW_ID gl_ViewID_OVR' + + ].join( '\n' ) : '', '#define varying in', isGLSL3ShaderMaterial ? '' : 'out highp vec4 pc_fragColor;', isGLSL3ShaderMaterial ? '' : '#define gl_FragColor pc_fragColor', @@ -18030,6 +18078,7 @@ this.program = program; this.vertexShader = glVertexShader; this.fragmentShader = glFragmentShader; + this.numMultiviewViews = numMultiviewViews; return this; @@ -20398,7 +20447,8 @@ stencilBuffer.setTest( stencilWrite ); if ( stencilWrite ) { - stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilMask ); + stencilBuffer.setMask( material.stencilWriteMask ); + stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilFuncMask ); stencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass ); } @@ -20959,6 +21009,21 @@ } + if ( renderTarget.isWebGLMultiviewRenderTarget ) { + + _gl.deleteTexture( renderTargetProperties.__webglColorTexture ); + _gl.deleteTexture( renderTargetProperties.__webglDepthStencilTexture ); + + info.memory.textures -= 2; + + for ( var i = 0, il = renderTargetProperties.__webglViewFramebuffers.length; i < il; i ++ ) { + + _gl.deleteFramebuffer( renderTargetProperties.__webglViewFramebuffers[ i ] ); + + } + + } + properties.remove( renderTarget.texture ); properties.remove( renderTarget ); @@ -21645,6 +21710,7 @@ var isCube = ( renderTarget.isWebGLRenderTargetCube === true ); var isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true ); + var isMultiview = ( renderTarget.isWebGLMultiviewRenderTarget === true ); var supportsMips = isPowerOfTwo( renderTarget ) || capabilities.isWebGL2; // Setup framebuffer @@ -21697,6 +21763,56 @@ } + } else if ( isMultiview ) { + + if ( capabilities.multiview ) { + + var width = renderTarget.width; + var height = renderTarget.height; + var numViews = renderTarget.numViews; + + _gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer ); + + var ext = extensions.get( 'OVR_multiview2' ); + + info.memory.textures += 2; + + var colorTexture = _gl.createTexture(); + _gl.bindTexture( 35866, colorTexture ); + _gl.texParameteri( 35866, 10240, 9728 ); + _gl.texParameteri( 35866, 10241, 9728 ); + _gl.texImage3D( 35866, 0, 32856, width, height, numViews, 0, 6408, 5121, null ); + ext.framebufferTextureMultiviewOVR( 36160, 36064, colorTexture, 0, 0, numViews ); + + var depthStencilTexture = _gl.createTexture(); + _gl.bindTexture( 35866, depthStencilTexture ); + _gl.texParameteri( 35866, 10240, 9728 ); + _gl.texParameteri( 35866, 10241, 9728 ); + _gl.texImage3D( 35866, 0, 35056, width, height, numViews, 0, 34041, 34042, null ); + ext.framebufferTextureMultiviewOVR( 36160, 33306, depthStencilTexture, 0, 0, numViews ); + + var viewFramebuffers = new Array( numViews ); + for ( var i = 0; i < numViews; ++ i ) { + + viewFramebuffers[ i ] = _gl.createFramebuffer(); + _gl.bindFramebuffer( 36160, viewFramebuffers[ i ] ); + _gl.framebufferTextureLayer( 36160, 36064, colorTexture, 0, i ); + + } + + renderTargetProperties.__webglColorTexture = colorTexture; + renderTargetProperties.__webglDepthStencilTexture = depthStencilTexture; + renderTargetProperties.__webglViewFramebuffers = viewFramebuffers; + + _gl.bindFramebuffer( 36160, null ); + _gl.bindTexture( 35866, null ); + + } else { + + console.warn( 'THREE.WebGLRenderer: WebGLMultiviewRenderTarget can only be used with WebGL2 and Multiview extension support.' ); + + } + } } @@ -21722,7 +21838,7 @@ state.bindTexture( 34067, null ); - } else { + } else if ( ! isMultiview ) { state.bindTexture( 3553, textureProperties.__webglTexture ); setTextureParameters( 3553, renderTarget.texture, supportsMips ); @@ -22059,6 +22175,258 @@ } + /** + * @author fernandojsg / http://fernandojsg.com + * @author Takahiro https://github.com/takahirox + */ + + function WebGLMultiviewRenderTarget( width, height, numViews, options ) { + + WebGLRenderTarget.call( this, width, height, options ); + + this.depthBuffer = false; + this.stencilBuffer = false; + + this.numViews = numViews; + + } + + WebGLMultiviewRenderTarget.prototype = Object.assign( Object.create( WebGLRenderTarget.prototype ), { + + constructor: WebGLMultiviewRenderTarget, + + isWebGLMultiviewRenderTarget: true, + + copy: function ( source ) { + + WebGLRenderTarget.prototype.copy.call( this, source ); + + this.numViews = source.numViews; + + return this; + + }, + + setNumViews: function ( numViews ) { + + if ( this.numViews !== numViews ) { + + this.numViews = numViews; + this.dispose(); + + } + + return this; + + } + + } ); + + /** + * @author fernandojsg / http://fernandojsg.com + * @author Takahiro https://github.com/takahirox + */ + + function WebGLMultiview( renderer, gl ) { + + var DEFAULT_NUMVIEWS = 2; + + var capabilities = renderer.capabilities; + var properties = renderer.properties; + + var maxNumViews = capabilities.maxMultiviewViews; + + var renderTarget, currentRenderTarget; + var mat3, mat4, cameraArray, renderSize; + + function getCameraArray( camera ) { + + if ( camera.isArrayCamera ) { return camera.cameras; } + + cameraArray[ 0 ] = camera; + + return cameraArray; + + } + + // + + function updateCameraProjectionMatricesUniform( camera, uniforms ) { + + var cameras = getCameraArray( camera ); + + for ( var i = 0; i < cameras.length; i ++ ) { + + mat4[ i ].copy( cameras[ i ].projectionMatrix ); + + } + + uniforms.setValue( gl, 'projectionMatrices', mat4 ); + + } + + function updateCameraViewMatricesUniform( camera, uniforms ) { + + var cameras = getCameraArray( camera ); + + for ( var i = 0; i < cameras.length; i ++ ) { + + mat4[ i ].copy( cameras[ i ].matrixWorldInverse ); + + } + + uniforms.setValue( gl, 'viewMatrices', mat4 ); + + } + + function updateObjectMatricesUniforms( object, camera, uniforms ) { + + var cameras = getCameraArray( camera ); + + for ( var i = 0; i < cameras.length; i ++ ) { + + mat4[ i ].multiplyMatrices( cameras[ i ].matrixWorldInverse, object.matrixWorld ); + mat3[ i ].getNormalMatrix( mat4[ i ] ); + + } + + uniforms.setValue( gl, 'modelViewMatrices', mat4 ); + uniforms.setValue( gl, 'normalMatrices', mat3 ); + + } + + function isMultiviewCompatible( camera ) { + + if ( ! camera.isArrayCamera ) { return true; } + + var cameras = camera.cameras; + + if ( cameras.length > maxNumViews ) { return false; } + + for ( var i = 1, il = cameras.length; i < il; i ++ ) { + + if ( cameras[ 0 ].viewport.z !== cameras[ i ].viewport.z || + cameras[ 0 ].viewport.w !== cameras[ i ].viewport.w ) { return false; } + + } + + return true; + + } + + function resizeRenderTarget( camera ) { + + if ( currentRenderTarget ) { + + renderSize.set( currentRenderTarget.width, currentRenderTarget.height ); + + } else { + + renderer.getDrawingBufferSize( renderSize ); + + } + + if ( camera.isArrayCamera ) { + + var viewport = camera.cameras[ 0 ].viewport; + + renderTarget.setSize( viewport.z, viewport.w ); + + renderTarget.setNumViews( camera.cameras.length ); + + } else { + + renderTarget.setSize( renderSize.x, renderSize.y ); + renderTarget.setNumViews( DEFAULT_NUMVIEWS ); + + } + + } + + function attachCamera( camera ) { + + if ( ! isMultiviewCompatible( camera ) ) { return; } + + currentRenderTarget = renderer.getRenderTarget(); + resizeRenderTarget( camera ); + renderer.setRenderTarget( renderTarget ); + + } + + function detachCamera( camera ) { + + if ( renderTarget !== renderer.getRenderTarget() ) { return; } + + renderer.setRenderTarget( currentRenderTarget ); + flush( camera ); + + } + + function flush( camera ) { + + var srcRenderTarget = renderTarget; + var numViews = srcRenderTarget.numViews; + + var srcFramebuffers = properties.get( srcRenderTarget ).__webglViewFramebuffers; + + var viewWidth = srcRenderTarget.width; + var viewHeight = srcRenderTarget.height; + + if ( camera.isArrayCamera ) { + + for ( var i = 0; i < numViews; i ++ ) { + + var viewport = camera.cameras[ i ].viewport; + + var x1 = viewport.x; + var y1 = viewport.y; + var x2 = x1 + viewport.z; + var y2 = y1 + viewport.w; + + gl.bindFramebuffer( 36008, srcFramebuffers[ i ] ); + gl.blitFramebuffer( 0, 0, viewWidth, viewHeight, x1, y1, x2, y2, 16384, 9728 ); + + } + + } else { + + gl.bindFramebuffer( 36008, srcFramebuffers[ 0 ] ); + gl.blitFramebuffer( 0, 0, viewWidth, viewHeight, 0, 0, renderSize.x, renderSize.y, 16384, 9728 ); + + } + + } + + + if ( renderer.capabilities.multiview ) { + + renderTarget = new WebGLMultiviewRenderTarget( 0, 0, DEFAULT_NUMVIEWS ); + + renderSize = new Vector2(); + mat4 = []; + mat3 = []; + cameraArray = []; + + var maxViews = capabilities.maxMultiviewViews; + + for ( var i = 0; i < maxViews; i ++ ) { + + mat4[ i ] = new Matrix4(); + mat3[ i ] = new Matrix3(); + + } + + } + + + this.attachCamera = attachCamera; + this.detachCamera = detachCamera; + this.updateCameraProjectionMatricesUniform = updateCameraProjectionMatricesUniform; + this.updateCameraViewMatricesUniform = updateCameraViewMatricesUniform; + this.updateObjectMatricesUniforms = updateObjectMatricesUniforms; + + } + /** * @author mrdoob / http://mrdoob.com/ */ @@ -23162,6 +23530,10 @@ this.vr = vr; + // Multiview + + var multiview = new WebGLMultiview( _this, _gl ); + // shadow map var shadowMap = new WebGLShadowMap( _this, objects, capabilities.maxTextureSize ); @@ -24025,6 +24397,12 @@ } + if ( capabilities.multiview ) { + + multiview.attachCamera( camera ); + + } + // background.render( currentRenderList, scene, camera, forceClear ); @@ -24079,6 +24457,12 @@ state.setPolygonOffset( false ); + if ( capabilities.multiview ) { + + multiview.detachCamera( camera ); + + } + if ( vr.enabled ) { vr.submitFrame(); @@ -24225,19 +24609,27 @@ _currentArrayCamera = camera; - var cameras = camera.cameras; + if ( capabilities.multiview ) { + + renderObject( object, scene, camera, geometry, material, group ); + + } else { + + var cameras = camera.cameras; + + for ( var j = 0, jl = cameras.length; j < jl; j ++ ) { - for ( var j = 0, jl = cameras.length; j < jl; j ++ ) { + var camera2 = cameras[ j ]; - var camera2 = cameras[ j ]; + if ( object.layers.test( camera2.layers ) ) { - if ( object.layers.test( camera2.layers ) ) { + state.viewport( _currentViewport.copy( camera2.viewport ) ); - state.viewport( _currentViewport.copy( camera2.viewport ) ); + currentRenderState.setupLights( camera2 ); - currentRenderState.setupLights( camera2 ); + renderObject( object, scene, camera2, geometry, material, group ); - renderObject( object, scene, camera2, geometry, material, group ); + } } @@ -24532,7 +24924,15 @@ if ( refreshProgram || _currentCamera !== camera ) { - p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + if ( program.numMultiviewViews > 0 ) { + + multiview.updateCameraProjectionMatricesUniform( camera, p_uniforms ); + + } else { + + p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + + } if ( capabilities.logarithmicDepthBuffer ) { @@ -24580,7 +24980,15 @@ material.isShaderMaterial || material.skinning ) { - p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + if ( program.numMultiviewViews > 0 ) { + + multiview.updateCameraViewMatricesUniform( camera, p_uniforms ); + + } else { + + p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + + } } @@ -24785,8 +25193,17 @@ // common matrices - p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix ); - p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix ); + if ( program.numMultiviewViews > 0 ) { + + multiview.updateObjectMatricesUniforms( object, camera, p_uniforms ); + + } else { + + p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix ); + p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix ); + + } + p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld ); return program; @@ -34481,6 +34898,7 @@ var itemsLoaded = 0; var itemsTotal = 0; var urlModifier = undefined; + var handlers = []; // Refer to #5689 for the reason why we don't set .onStart // in the constructor @@ -34557,10 +34975,52 @@ this.setURLModifier = function ( transform ) { urlModifier = transform; + return this; }; + this.addHandler = function ( regex, loader ) { + + handlers.push( regex, loader ); + + return this; + + }; + + this.removeHandler = function ( regex ) { + + var index = handlers.indexOf( regex ); + + if ( index !== - 1 ) { + + handlers.splice( index, 2 ); + + } + + return this; + + }; + + this.getHandler = function ( file ) { + + for ( var i = 0, l = handlers.length; i < l; i += 2 ) { + + var regex = handlers[ i ]; + var loader = handlers[ i + 1 ]; + + if ( regex.test( file ) ) { + + return loader; + + } + + } + + return null; + + }; + } var DefaultLoadingManager = new LoadingManager(); @@ -34608,41 +35068,6 @@ } ); - // - - Loader.Handlers = { - - handlers: [], - - add: function ( regex, loader ) { - - this.handlers.push( regex, loader ); - - }, - - get: function ( file ) { - - var handlers = this.handlers; - - for ( var i = 0, l = handlers.length; i < l; i += 2 ) { - - var regex = handlers[ i ]; - var loader = handlers[ i + 1 ]; - - if ( regex.test( file ) ) { - - return loader; - - } - - } - - return null; - - } - - }; - /** * @author mrdoob / http://mrdoob.com/ */ @@ -38194,6 +38619,7 @@ if ( json.color !== undefined ) { material.color.setHex( json.color ); } if ( json.roughness !== undefined ) { material.roughness = json.roughness; } if ( json.metalness !== undefined ) { material.metalness = json.metalness; } + if ( json.sheen !== undefined ) { material.sheen = new Color().setHex( json.sheen ); } if ( json.emissive !== undefined ) { material.emissive.setHex( json.emissive ); } if ( json.specular !== undefined ) { material.specular.setHex( json.specular ); } if ( json.shininess !== undefined ) { material.shininess = json.shininess; } @@ -38211,6 +38637,16 @@ if ( json.depthTest !== undefined ) { material.depthTest = json.depthTest; } if ( json.depthWrite !== undefined ) { material.depthWrite = json.depthWrite; } if ( json.colorWrite !== undefined ) { material.colorWrite = json.colorWrite; } + + if ( json.stencilWrite !== undefined ) { material.stencilWrite = json.stencilWrite; } + if ( json.stencilWriteMask !== undefined ) { material.stencilWriteMask = json.stencilWriteMask; } + if ( json.stencilFunc !== undefined ) { material.stencilFunc = json.stencilFunc; } + if ( json.stencilRef !== undefined ) { material.stencilRef = json.stencilRef; } + if ( json.stencilFuncMask !== undefined ) { material.stencilFuncMask = json.stencilFuncMask; } + if ( json.stencilFail !== undefined ) { material.stencilFail = json.stencilFail; } + if ( json.stencilZFail !== undefined ) { material.stencilZFail = json.stencilZFail; } + if ( json.stencilZPass !== undefined ) { material.stencilZPass = json.stencilZPass; } + if ( json.wireframe !== undefined ) { material.wireframe = json.wireframe; } if ( json.wireframeLinewidth !== undefined ) { material.wireframeLinewidth = json.wireframeLinewidth; } if ( json.wireframeLinecap !== undefined ) { material.wireframeLinecap = json.wireframeLinecap; } @@ -46569,7 +47005,7 @@ if ( headLength === undefined ) { headLength = 0.2 * length; } if ( headWidth === undefined ) { headWidth = 0.2 * headLength; } - this.line.scale.set( 1, Math.max( 0, length - headLength ), 1 ); + this.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458 this.line.updateMatrix(); this.cone.scale.set( headWidth, headLength, headWidth ); @@ -46982,6 +47418,22 @@ } ); + Loader.Handlers = { + + add: function ( /* regex, loader */ ) { + + console.error( 'THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.' ); + + }, + + get: function ( /* file */ ) { + + console.error( 'THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.' ); + + } + + }; + function XHRLoader( manager ) { console.warn( 'THREE.XHRLoader has been renamed to THREE.FileLoader.' ); @@ -47869,6 +48321,21 @@ console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' ); this.flatShading = ( value === FlatShading ); + } + }, + + stencilMask: { + get: function () { + + console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' ); + return this.stencilFuncMask; + + }, + set: function ( value ) { + + console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' ); + this.stencilFuncMask = value; + } } @@ -48500,6 +48967,16 @@ } + if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + + /* eslint-disable no-undef */ + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: { + revision: REVISION, + } } ) ); + /* eslint-enable no-undef */ + + } + exports.ACESFilmicToneMapping = ACESFilmicToneMapping; exports.AddEquation = AddEquation; exports.AddOperation = AddOperation; diff --git a/build/three.min.js b/build/three.min.js index 75c3229d54566064183db3ca43a285b83d8cf626..e986df6770d1c3758a342a4b34cffedae3a870e3 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -1,84 +1,84 @@ -// threejs.org/license -(function(k,za){"object"===typeof exports&&"undefined"!==typeof module?za(exports):"function"===typeof define&&define.amd?define(["exports"],za):(k=k||self,za(k.THREE={}))})(this,function(k){function za(){}function v(a,b){this.x=a||0;this.y=b||0}function sa(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function n(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}function S(){this.elements=[1,0,0,0,1,0,0,0,1];0h)return!1}return!0}function nb(a,b){this.center=void 0!==a?a:new n;this.radius=void 0!==b?b:0}function Rb(a,b){this.origin=void 0!==a?a:new n;this.direction=void 0!==b?b:new n}function ca(a,b,c){this.a=void 0!==a?a:new n;this.b=void 0!==b?b:new n;this.c=void 0!==c?c:new n}function I(a,b,c){return void 0===b&&void 0=== +(function(k,Ba){"object"===typeof exports&&"undefined"!==typeof module?Ba(exports):"function"===typeof define&&define.amd?define(["exports"],Ba):(k=k||self,Ba(k.THREE={}))})(this,function(k){function Ba(){}function w(a,b){this.x=a||0;this.y=b||0}function sa(a,b,c,d){this._x=a||0;this._y=b||0;this._z=c||0;this._w=void 0!==d?d:1}function n(a,b,c){this.x=a||0;this.y=b||0;this.z=c||0}function S(){this.elements=[1,0,0,0,1,0,0,0,1];0h)return!1}return!0}function nb(a,b){this.center=void 0!==a?a:new n;this.radius=void 0!==b?b:0}function Rb(a,b){this.origin=void 0!==a?a:new n;this.direction=void 0!==b?b:new n}function aa(a,b,c){this.a=void 0!==a?a:new n;this.b=void 0!==b?b:new n;this.c=void 0!==c?c:new n}function I(a,b,c){return void 0===b&&void 0=== c?this.set(a):this.setRGB(a,b,c)}function Rf(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a}function Sf(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}function Tf(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}function zc(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.normal=d&&d.isVector3?d:new n;this.vertexNormals=Array.isArray(d)?d:[];this.color=e&&e.isColor?e:new I;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex= -void 0!==f?f:0}function O(){Object.defineProperty(this,"id",{value:Mi++});this.uuid=N.generateUUID();this.name="";this.type="Material";this.lights=this.fog=!0;this.blending=1;this.side=0;this.vertexTangents=this.flatShading=!1;this.vertexColors=0;this.opacity=1;this.transparent=!1;this.blendSrc=204;this.blendDst=205;this.blendEquation=100;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=3;this.depthWrite=this.depthTest=!0;this.stencilFunc=519;this.stencilRef=0;this.stencilMask= -255;this.stencilZPass=this.stencilZFail=this.stencilFail=7680;this.stencilWrite=!1;this.clippingPlanes=null;this.clipShadows=this.clipIntersection=!1;this.shadowSide=null;this.colorWrite=!0;this.precision=null;this.polygonOffset=!1;this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.dithering=!1;this.alphaTest=0;this.premultipliedAlpha=!1;this.toneMapped=this.visible=!0;this.userData={};this.needsUpdate=!0}function Fa(a){O.call(this);this.type="MeshBasicMaterial";this.color=new I(16777215);this.lightMap= -this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.lights=this.morphTargets=this.skinning=!1;this.setValues(a)}function L(a,b,c){if(Array.isArray(a))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="";this.array=a;this.itemSize= -b;this.count=void 0!==a?a.length/b:0;this.normalized=!0===c;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function xd(a,b,c){L.call(this,new Int8Array(a),b,c)}function yd(a,b,c){L.call(this,new Uint8Array(a),b,c)}function zd(a,b,c){L.call(this,new Uint8ClampedArray(a),b,c)}function Ad(a,b,c){L.call(this,new Int16Array(a),b,c)}function Sb(a,b,c){L.call(this,new Uint16Array(a),b,c)}function Bd(a,b,c){L.call(this,new Int32Array(a),b,c)}function Tb(a,b,c){L.call(this,new Uint32Array(a), -b,c)}function B(a,b,c){L.call(this,new Float32Array(a),b,c)}function Cd(a,b,c){L.call(this,new Float64Array(a),b,c)}function eh(){this.vertices=[];this.normals=[];this.colors=[];this.uvs=[];this.uvs2=[];this.groups=[];this.morphTargets={};this.skinWeights=[];this.skinIndices=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function fh(a){if(0===a.length)return-Infinity;for(var b=a[0],c=1,d= -a.length;cb&&(b=a[c]);return b}function D(){Object.defineProperty(this,"id",{value:Ni+=2});this.uuid=N.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}}function ia(a,b){A.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new Fa({color:16777215*Math.random()});this.drawMode= -0;this.updateMorphTargets()}function gh(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,f,g,2!==b.side,h)))return null;Ee.copy(h);Ee.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(Ee);return bc.far?null:{distance:b,point:Ee.clone(),object:a}}function Fe(a,b,c,d,e,f,g,h,l,m,p){Ub.fromBufferAttribute(e,l);Vb.fromBufferAttribute(e,m);Wb.fromBufferAttribute(e,p);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){Uf.set(0,0,0);Vf.set(0,0,0); -Wf.set(0,0,0);for(var u=0,q=f.length;ub&&(b=a[c]);return b}function D(){Object.defineProperty(this,"id",{value:Qi+=2});this.uuid=N.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={}}function R(a,b){C.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new Ga({color:16777215*Math.random()}); +this.drawMode=0;this.updateMorphTargets()}function jh(a,b,c,d,e,f,g,h){if(null===(1===b.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,f,g,2!==b.side,h)))return null;Ee.copy(h);Ee.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(Ee);return bc.far?null:{distance:b,point:Ee.clone(),object:a}}function Fe(a,b,c,d,e,f,g,h,l,m,p){Ub.fromBufferAttribute(e,l);Vb.fromBufferAttribute(e,m);Wb.fromBufferAttribute(e,p);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){Uf.set(0,0,0); +Vf.set(0,0,0);Wf.set(0,0,0);for(var u=0,t=f.length;ug;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function Ab(a,b,c){Ka.call(this,a,b,c)}function Yb(a,b,c,d,e,f,g,h,l,m,p,u){V.call(this,null,f,g,h,l,m,d,e,p,u);this.image={data:a,width:b, +1);a.render(b,f);a.setRenderTarget(d,2);a.render(b,g);a.setRenderTarget(d,3);a.render(b,h);a.setRenderTarget(d,4);a.render(b,l);d.texture.generateMipmaps=p;a.setRenderTarget(d,5);a.render(b,m);a.setRenderTarget(c)};this.clear=function(a,b,c,d){for(var e=a.getRenderTarget(),f=this.renderTarget,g=0;6>g;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function Ab(a,b,c){ka.call(this,a,b,c)}function Yb(a,b,c,d,e,f,g,h,l,m,p,u){Z.call(this,null,f,g,h,l,m,d,e,p,u);this.image={data:a,width:b, height:c};this.magFilter=void 0!==l?l:1003;this.minFilter=void 0!==m?m:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1}function cb(a,b){this.normal=void 0!==a?a:new n(1,0,0);this.constant=void 0!==b?b:0}function Ed(a,b,c,d,e,f){this.planes=[void 0!==a?a:new cb,void 0!==b?b:new cb,void 0!==c?c:new cb,void 0!==d?d:new cb,void 0!==e?e:new cb,void 0!==f?f:new cb]}function Xf(){function a(e,f){!1!==c&&(d(e,f),b.requestAnimationFrame(a))}var b=null,c=!1,d=null;return{start:function(){!0!== -c&&null!==d&&(b.requestAnimationFrame(a),c=!0)},stop:function(){c=!1},setAnimationLoop:function(a){d=a},setContext:function(a){b=a}}}function Pi(a){function b(b,c){var d=b.array,e=b.dynamic?35048:35044,h=a.createBuffer();a.bindBuffer(c,h);a.bufferData(c,d,e);b.onUploadCallback();c=5126;d instanceof Float32Array?c=5126:d instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?c=5123:d instanceof Int16Array?c=5122:d instanceof +c&&null!==d&&(b.requestAnimationFrame(a),c=!0)},stop:function(){c=!1},setAnimationLoop:function(a){d=a},setContext:function(a){b=a}}}function Si(a){function b(b,c){var d=b.array,e=b.dynamic?35048:35044,h=a.createBuffer();a.bindBuffer(c,h);a.bufferData(c,d,e);b.onUploadCallback();c=5126;d instanceof Float32Array?c=5126:d instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?c=5123:d instanceof Int16Array?c=5122:d instanceof Uint32Array?c=5125:d instanceof Int32Array?c=5124:d instanceof Int8Array?c=5120:d instanceof Uint8Array&&(c=5121);return{buffer:h,type:c,bytesPerElement:d.BYTES_PER_ELEMENT,version:b.version}}var c=new WeakMap;return{get:function(a){a.isInterleavedBufferAttribute&&(a=a.data);return c.get(a)},remove:function(b){b.isInterleavedBufferAttribute&&(b=b.data);var d=c.get(b);d&&(a.deleteBuffer(d.buffer),c.delete(b))},update:function(d,e){d.isInterleavedBufferAttribute&&(d=d.data);var f=c.get(d);if(void 0=== f)c.set(d,b(d,e));else if(f.versionm;m++){if(u=d[m])if(h=u[0],l=u[1]){p&&e.addAttribute("morphTarget"+m,p[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=l;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function $i(a,b){var c={};return{update:function(d){var e=b.render.frame,f=d.geometry,g=a.get(d,f);c[g.id]!==e&&(f.isGeometry&&g.updateFromObject(d),a.update(g),c[g.id]=e);return g},dispose:function(){c={}}}} -function ob(a,b,c,d,e,f,g,h,l,m){a=void 0!==a?a:[];V.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,l,m);this.flipY=!1}function Ec(a,b,c,d){V.call(this,null);this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Fc(a,b,c,d){V.call(this,null);this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Gc(a,b,c){var d=a[0];if(0>= -d||0/gm,function(a,c){a=M[c];if(void 0===a)throw Error("Can not resolve #include <"+c+">");return Zf(a)})}function zh(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g, -function(a,c,d,e){a="";for(c=parseInt(c);cm;m++){if(u=d[m])if(h=u[0],l=u[1]){p&&e.addAttribute("morphTarget"+m,p[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=l;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function cj(a,b){var c={};return{update:function(d){var e=b.render.frame,f=d.geometry,g=a.get(d,f);c[g.id]!==e&&(f.isGeometry&&g.updateFromObject(d),a.update(g),c[g.id]=e);return g},dispose:function(){c={}}}} +function ob(a,b,c,d,e,f,g,h,l,m){a=void 0!==a?a:[];Z.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,l,m);this.flipY=!1}function Ec(a,b,c,d){Z.call(this,null);this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Fc(a,b,c,d){Z.call(this,null);this.image={data:a,width:b,height:c,depth:d};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1}function Gc(a,b,c){var d=a[0];if(0>= +d||0/gm,function(a,c){a=O[c];if(void 0===a)throw Error("Can not resolve #include <"+c+">");return Zf(a)})}function Ch(a){return a.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g, +function(a,c,d,e){a="";for(c=parseInt(c);cc;c++)b.probe.push(new n);var d=new n,e=new W,f=new W;return{setup:function(c,h,l){for(var g=0,p=0,u=0,k=0;9>k;k++)b.probe[k].set(0,0,0);var r=h=0,t=0,z=0,n=0,y=0,x=0,U=0;l=l.matrixWorldInverse;c.sort(Tj);k=0;for(var R=c.length;kCa;Ca++)b.probe[Ca].addScaledVector(E.sh.coefficients[Ca],v);else if(E.isDirectionalLight){var H=a.get(E);H.color.copy(E.color).multiplyScalar(E.intensity);H.direction.setFromMatrixPosition(E.matrixWorld);d.setFromMatrixPosition(E.target.matrixWorld);H.direction.sub(d);H.direction.transformDirection(l);if(H.shadow=E.castShadow)v=E.shadow,H.shadowBias=v.bias,H.shadowRadius=v.radius,H.shadowMapSize=v.mapSize,b.directionalShadowMap[h]=Ca,b.directionalShadowMatrix[h]= -E.shadow.matrix,y++;b.directional[h]=H;h++}else if(E.isSpotLight){H=a.get(E);H.position.setFromMatrixPosition(E.matrixWorld);H.position.applyMatrix4(l);H.color.copy(Cb).multiplyScalar(v);H.distance=B;H.direction.setFromMatrixPosition(E.matrixWorld);d.setFromMatrixPosition(E.target.matrixWorld);H.direction.sub(d);H.direction.transformDirection(l);H.coneCos=Math.cos(E.angle);H.penumbraCos=Math.cos(E.angle*(1-E.penumbra));H.decay=E.decay;if(H.shadow=E.castShadow)v=E.shadow,H.shadowBias=v.bias,H.shadowRadius= -v.radius,H.shadowMapSize=v.mapSize,b.spotShadowMap[t]=Ca,b.spotShadowMatrix[t]=E.shadow.matrix,U++;b.spot[t]=H;t++}else if(E.isRectAreaLight)H=a.get(E),H.color.copy(Cb).multiplyScalar(v),H.position.setFromMatrixPosition(E.matrixWorld),H.position.applyMatrix4(l),f.identity(),e.copy(E.matrixWorld),e.premultiply(l),f.extractRotation(e),H.halfWidth.set(.5*E.width,0,0),H.halfHeight.set(0,.5*E.height,0),H.halfWidth.applyMatrix4(f),H.halfHeight.applyMatrix4(f),b.rectArea[z]=H,z++;else if(E.isPointLight){H= -a.get(E);H.position.setFromMatrixPosition(E.matrixWorld);H.position.applyMatrix4(l);H.color.copy(E.color).multiplyScalar(E.intensity);H.distance=E.distance;H.decay=E.decay;if(H.shadow=E.castShadow)v=E.shadow,H.shadowBias=v.bias,H.shadowRadius=v.radius,H.shadowMapSize=v.mapSize,H.shadowCameraNear=v.camera.near,H.shadowCameraFar=v.camera.far,b.pointShadowMap[r]=Ca,b.pointShadowMatrix[r]=E.shadow.matrix,x++;b.point[r]=H;r++}else E.isHemisphereLight&&(H=a.get(E),H.direction.setFromMatrixPosition(E.matrixWorld), -H.direction.transformDirection(l),H.direction.normalize(),H.skyColor.copy(E.color).multiplyScalar(v),H.groundColor.copy(E.groundColor).multiplyScalar(v),b.hemi[n]=H,n++)}b.ambient[0]=g;b.ambient[1]=p;b.ambient[2]=u;c=b.hash;if(c.directionalLength!==h||c.pointLength!==r||c.spotLength!==t||c.rectAreaLength!==z||c.hemiLength!==n||c.numDirectionalShadows!==y||c.numPointShadows!==x||c.numSpotShadows!==U)b.directional.length=h,b.spot.length=t,b.rectArea.length=z,b.point.length=r,b.hemi.length=n,b.directionalShadowMap.length= -y,b.pointShadowMap.length=x,b.spotShadowMap.length=U,b.directionalShadowMatrix.length=y,b.pointShadowMatrix.length=x,b.spotShadowMatrix.length=U,c.directionalLength=h,c.pointLength=r,c.spotLength=t,c.rectAreaLength=z,c.hemiLength=n,c.numDirectionalShadows=y,c.numPointShadows=x,c.numSpotShadows=U,b.version=Vj++},state:b}}function Bh(){var a=new Uj,b=[],c=[];return{init:function(){b.length=0;c.length=0},state:{lightsArray:b,shadowsArray:c,lights:a},setupLights:function(d){a.setup(b,c,d)},pushLight:function(a){b.push(a)}, -pushShadow:function(a){c.push(a)}}}function Wj(){function a(c){c=c.target;c.removeEventListener("dispose",a);b.delete(c)}var b=new WeakMap;return{get:function(c,d){if(!1===b.has(c)){var e=new Bh;b.set(c,new WeakMap);b.get(c).set(d,e);c.addEventListener("dispose",a)}else!1===b.get(c).has(d)?(e=new Bh,b.get(c).set(d,e)):e=b.get(c).get(d);return e},dispose:function(){b=new WeakMap}}}function Db(a){O.call(this);this.type="MeshDepthMaterial";this.depthPacking=3200;this.morphTargets=this.skinning=!1;this.displacementMap= -this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.lights=this.fog=!1;this.setValues(a)}function Eb(a){O.call(this);this.type="MeshDistanceMaterial";this.referencePosition=new n;this.nearDistance=1;this.farDistance=1E3;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.lights=this.fog=!1;this.setValues(a)}function Ch(a,b,c){function d(b, +d.sort(Sj);1c;c++)b.probe.push(new n);var d=new n,e=new M,f=new M;return{setup:function(c,h,l){for(var g=0,p=0,u=0,k=0;9>k;k++)b.probe[k].set(0,0,0);var r=h=0,q=0,v=0,n=0,z=0,x=0,F=0;l=l.matrixWorldInverse;c.sort(Wj);k=0;for(var V=c.length;kva;va++)b.probe[va].addScaledVector(B.sh.coefficients[va],w);else if(B.isDirectionalLight){var H=a.get(B);H.color.copy(B.color).multiplyScalar(B.intensity);H.direction.setFromMatrixPosition(B.matrixWorld);d.setFromMatrixPosition(B.target.matrixWorld);H.direction.sub(d);H.direction.transformDirection(l);if(H.shadow=B.castShadow)w=B.shadow,H.shadowBias=w.bias,H.shadowRadius=w.radius,H.shadowMapSize=w.mapSize,b.directionalShadowMap[h]=va,b.directionalShadowMatrix[h]= +B.shadow.matrix,z++;b.directional[h]=H;h++}else if(B.isSpotLight){H=a.get(B);H.position.setFromMatrixPosition(B.matrixWorld);H.position.applyMatrix4(l);H.color.copy(Cb).multiplyScalar(w);H.distance=A;H.direction.setFromMatrixPosition(B.matrixWorld);d.setFromMatrixPosition(B.target.matrixWorld);H.direction.sub(d);H.direction.transformDirection(l);H.coneCos=Math.cos(B.angle);H.penumbraCos=Math.cos(B.angle*(1-B.penumbra));H.decay=B.decay;if(H.shadow=B.castShadow)w=B.shadow,H.shadowBias=w.bias,H.shadowRadius= +w.radius,H.shadowMapSize=w.mapSize,b.spotShadowMap[q]=va,b.spotShadowMatrix[q]=B.shadow.matrix,F++;b.spot[q]=H;q++}else if(B.isRectAreaLight)H=a.get(B),H.color.copy(Cb).multiplyScalar(w),H.position.setFromMatrixPosition(B.matrixWorld),H.position.applyMatrix4(l),f.identity(),e.copy(B.matrixWorld),e.premultiply(l),f.extractRotation(e),H.halfWidth.set(.5*B.width,0,0),H.halfHeight.set(0,.5*B.height,0),H.halfWidth.applyMatrix4(f),H.halfHeight.applyMatrix4(f),b.rectArea[v]=H,v++;else if(B.isPointLight){H= +a.get(B);H.position.setFromMatrixPosition(B.matrixWorld);H.position.applyMatrix4(l);H.color.copy(B.color).multiplyScalar(B.intensity);H.distance=B.distance;H.decay=B.decay;if(H.shadow=B.castShadow)w=B.shadow,H.shadowBias=w.bias,H.shadowRadius=w.radius,H.shadowMapSize=w.mapSize,H.shadowCameraNear=w.camera.near,H.shadowCameraFar=w.camera.far,b.pointShadowMap[r]=va,b.pointShadowMatrix[r]=B.shadow.matrix,x++;b.point[r]=H;r++}else B.isHemisphereLight&&(H=a.get(B),H.direction.setFromMatrixPosition(B.matrixWorld), +H.direction.transformDirection(l),H.direction.normalize(),H.skyColor.copy(B.color).multiplyScalar(w),H.groundColor.copy(B.groundColor).multiplyScalar(w),b.hemi[n]=H,n++)}b.ambient[0]=g;b.ambient[1]=p;b.ambient[2]=u;c=b.hash;if(c.directionalLength!==h||c.pointLength!==r||c.spotLength!==q||c.rectAreaLength!==v||c.hemiLength!==n||c.numDirectionalShadows!==z||c.numPointShadows!==x||c.numSpotShadows!==F)b.directional.length=h,b.spot.length=q,b.rectArea.length=v,b.point.length=r,b.hemi.length=n,b.directionalShadowMap.length= +z,b.pointShadowMap.length=x,b.spotShadowMap.length=F,b.directionalShadowMatrix.length=z,b.pointShadowMatrix.length=x,b.spotShadowMatrix.length=F,c.directionalLength=h,c.pointLength=r,c.spotLength=q,c.rectAreaLength=v,c.hemiLength=n,c.numDirectionalShadows=z,c.numPointShadows=x,c.numSpotShadows=F,b.version=Yj++},state:b}}function Eh(){var a=new Xj,b=[],c=[];return{init:function(){b.length=0;c.length=0},state:{lightsArray:b,shadowsArray:c,lights:a},setupLights:function(d){a.setup(b,c,d)},pushLight:function(a){b.push(a)}, +pushShadow:function(a){c.push(a)}}}function Zj(){function a(c){c=c.target;c.removeEventListener("dispose",a);b.delete(c)}var b=new WeakMap;return{get:function(c,d){if(!1===b.has(c)){var e=new Eh;b.set(c,new WeakMap);b.get(c).set(d,e);c.addEventListener("dispose",a)}else!1===b.get(c).has(d)?(e=new Eh,b.get(c).set(d,e)):e=b.get(c).get(d);return e},dispose:function(){b=new WeakMap}}}function Db(a){P.call(this);this.type="MeshDepthMaterial";this.depthPacking=3200;this.morphTargets=this.skinning=!1;this.displacementMap= +this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.lights=this.fog=!1;this.setValues(a)}function Eb(a){P.call(this);this.type="MeshDistanceMaterial";this.referencePosition=new n;this.nearDistance=1;this.farDistance=1E3;this.morphTargets=this.skinning=!1;this.displacementMap=this.alphaMap=this.map=null;this.displacementScale=1;this.displacementBias=0;this.lights=this.fog=!1;this.setValues(a)}function Fh(a,b,c){function d(b, c,d,e,f,g){var h=b.geometry;var l=m;var q=b.customDepthMaterial;d.isPointLight&&(l=p,q=b.customDistanceMaterial);q?l=q:(q=!1,c.morphTargets&&(h&&h.isBufferGeometry?q=h.morphAttributes&&h.morphAttributes.position&&0\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n \n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = decodeHalfRGBA ( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = pow( squared_mean - mean * mean, 0.5 );\n gl_FragColor = encodeHalfRGBA( vec2( mean, std_dev ) );\n}"}), -t=r.clone();t.defines.HORIZONAL_PASS=1;var n=new D;n.addAttribute("position",new L(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var w=new ia(n,r);for(n=0;4!==n;++n){var y=0!==(n&1),x=0!==(n&2),U=new Db({depthPacking:3201,morphTargets:y,skinning:x});m[n]=U;y=new Eb({morphTargets:y,skinning:x});p[n]=y}var R=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(d,m,p){if(!1!==R.enabled&&(!1!==R.autoUpdate||!1!==R.needsUpdate)&&0!==d.length){var u=a.getRenderTarget(), -k=a.getActiveCubeFace(),q=a.getActiveMipmapLevel(),n=a.state;n.setBlending(0);n.buffers.color.setClear(1,1,1,1);n.buffers.depth.setTest(!0);n.setScissorTest(!1);for(var z=0,x=d.length;zc||g.y>c)console.warn("THREE.WebGLShadowMap:",y,"has shadow exceeding max texture size, reducing"),g.x>c&&(h.x=Math.floor(c/X.x), -g.x=h.x*X.x,T.mapSize.x=h.x),g.y>c&&(h.y=Math.floor(c/X.y),g.y=h.y*X.y,T.mapSize.y=h.y);null!==T.map||T.isPointLightShadow||3!==this.type||(X={minFilter:1006,magFilter:1006,format:1023},T.map=new Ka(g.x,g.y,X),T.map.texture.name=y.name+".shadowMap",T.mapPass=new Ka(g.x,g.y,X),T.camera.updateProjectionMatrix());null===T.map&&(X={minFilter:1003,magFilter:1003,format:1023},T.map=new Ka(g.x,g.y,X),T.map.texture.name=y.name+".shadowMap",T.camera.updateProjectionMatrix());a.setRenderTarget(T.map);a.clear(); -X=T.getViewportCount();for(var U=0;Ud||a.height>d)e=d/Math.max(a.width,a.height);if(1>e||!0===b){if("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&a instanceof ImageBitmap)return d=b?N.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height),void 0=== -H&&(H=h(b,e)),c=c?h(b,e):H,c.width=b,c.height=e,c.getContext("2d").drawImage(a,0,0,b,e),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+b+"x"+e+")."),c;"data"in a&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").")}return a}function m(a){return N.isPowerOfTwo(a.width)&&N.isPowerOfTwo(a.height)}function p(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function u(b,c,e,f){a.generateMipmap(b); -d.get(c).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function k(a,c){if(!e.isWebGL2)return a;var d=a;6403===a&&(5126===c&&(d=33326),5131===c&&(d=33325),5121===c&&(d=33321));6407===a&&(5126===c&&(d=34837),5131===c&&(d=34843),5121===c&&(d=32849));6408===a&&(5126===c&&(d=34836),5131===c&&(d=34842),5121===c&&(d=32856));33325===d||33326===d||34842===d||34836===d?b.get("EXT_color_buffer_float"):(34843===d||34837===d)&&console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."); -return d}function r(a){return 1003===a||1004===a||1005===a?9728:9729}function t(b){b=b.target;b.removeEventListener("dispose",t);var c=d.get(b);void 0!==c.__webglInit&&(a.deleteTexture(c.__webglTexture),d.remove(b));b.isVideoTexture&&Ca.delete(b);g.memory.textures--}function n(b){b=b.target;b.removeEventListener("dispose",n);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&&a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e= -0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);d.remove(b.texture);d.remove(b)}g.memory.textures--}function w(a,b){var e=d.get(a);if(a.isVideoTexture){var f=g.render.frame;Ca.get(a)!==f&&(Ca.set(a,f),a.update())}if(0r;r++)t[r]=q||g?g?b.image[r].image: -b.image[r]:l(b.image[r],!1,!0,e.maxCubemapSize);var n=t[0],z=m(n)||e.isWebGL2,w=f.convert(b.format),x=f.convert(b.type),y=k(w,x);U(34067,b,z);if(q){for(r=0;6>r;r++){var T=t[r].mipmaps;for(q=0;qr;r++)if(g)for(c.texImage2D(34069+r,0,y,t[r].width,t[r].height,0,w,x,t[r].data),q=0;q=e.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+e.maxTextures);G+=1;return a};this.resetTextureUnits=function(){G=0};this.setTexture2D=w;this.setTexture2DArray= -function(a,b){var e=d.get(a);0r;r++)h.__webglFramebuffer[r]=a.createFramebuffer();else if(h.__webglFramebuffer=a.createFramebuffer(),r)if(e.isWebGL2){h.__webglMultisampledFramebuffer=a.createFramebuffer();h.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,h.__webglColorRenderbuffer);r=f.convert(b.texture.format);var z=f.convert(b.texture.type);r=k(r,z);z=A(b);a.renderbufferStorageMultisample(36161, -z,r,b.width,b.height);a.bindFramebuffer(36160,h.__webglMultisampledFramebuffer);a.framebufferRenderbuffer(36160,36064,36161,h.__webglColorRenderbuffer);a.bindRenderbuffer(36161,null);b.depthBuffer&&(h.__webglDepthRenderbuffer=a.createRenderbuffer(),B(h.__webglDepthRenderbuffer,b,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(q){c.bindTexture(34067,l.__webglTexture);U(34067,b.texture,t);for(r=0;6>r;r++)v(h.__webglFramebuffer[r], -b,36064,34069+r);p(b.texture,t)&&u(34067,b.texture,b.width,b.height);c.bindTexture(34067,null)}else c.bindTexture(3553,l.__webglTexture),U(3553,b.texture,t),v(h.__webglFramebuffer,b,36064,3553),p(b.texture,t)&&u(3553,b.texture,b.width,b.height),c.bindTexture(3553,null);if(b.depthBuffer){h=d.get(b);l=!0===b.isWebGLRenderTargetCube;if(b.depthTexture){if(l)throw Error("target.depthTexture not supported in Cube render targets");if(b&&b.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported"); -a.bindFramebuffer(36160,h.__webglFramebuffer);if(!b.depthTexture||!b.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");d.get(b.depthTexture).__webglTexture&&b.depthTexture.image.width===b.width&&b.depthTexture.image.height===b.height||(b.depthTexture.image.width=b.width,b.depthTexture.image.height=b.height,b.depthTexture.needsUpdate=!0);w(b.depthTexture,0);h=d.get(b.depthTexture).__webglTexture;if(1026===b.depthTexture.format)a.framebufferTexture2D(36160, -36096,3553,h,0);else if(1027===b.depthTexture.format)a.framebufferTexture2D(36160,33306,3553,h,0);else throw Error("Unknown depthTexture format");}else if(l)for(h.__webglDepthbuffer=[],l=0;6>l;l++)a.bindFramebuffer(36160,h.__webglFramebuffer[l]),h.__webglDepthbuffer[l]=a.createRenderbuffer(),B(h.__webglDepthbuffer[l],b);else a.bindFramebuffer(36160,h.__webglFramebuffer),h.__webglDepthbuffer=a.createRenderbuffer(),B(h.__webglDepthbuffer,b);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap= -function(a){var b=a.texture,f=m(a)||e.isWebGL2;if(p(b,f)){f=a.isWebGLRenderTargetCube?34067:3553;var g=d.get(b).__webglTexture;c.bindTexture(f,g);u(f,b,a.width,a.height);c.bindTexture(f,null)}};this.updateMultisampleRenderTarget=function(b){if(b.isWebGLMultisampleRenderTarget)if(e.isWebGL2){var c=d.get(b);a.bindFramebuffer(36008,c.__webglMultisampledFramebuffer);a.bindFramebuffer(36009,c.__webglFramebuffer);c=b.width;var f=b.height,g=16384;b.depthBuffer&&(g|=256);b.stencilBuffer&&(g|=1024);a.blitFramebuffer(0, -0,c,f,0,0,c,f,g,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")};this.safeSetTexture2D=function(a,b){a&&a.isWebGLRenderTarget&&(!1===I&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),I=!0),a=a.texture);w(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLRenderTargetCube&&(!1===C&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."), -C=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?y(a,b):x(a,b)}}function Dh(a,b,c){return{convert:function(a){if(1E3===a)return 10497;if(1001===a)return 33071;if(1002===a)return 33648;if(1003===a)return 9728;if(1004===a)return 9984;if(1005===a)return 9986;if(1006===a)return 9729;if(1007===a)return 9985;if(1008===a)return 9987;if(1009===a)return 5121;if(1017===a)return 32819;if(1018===a)return 32820;if(1019===a)return 33635;if(1010===a)return 5120;if(1011===a)return 5122; -if(1012===a)return 5123;if(1013===a)return 5124;if(1014===a)return 5125;if(1015===a)return 5126;if(1016===a){if(c.isWebGL2)return 5131;var d=b.get("OES_texture_half_float");if(null!==d)return d.HALF_FLOAT_OES}if(1021===a)return 6406;if(1022===a)return 6407;if(1023===a)return 6408;if(1024===a)return 6409;if(1025===a)return 6410;if(1026===a)return 6402;if(1027===a)return 34041;if(1028===a)return 6403;if(100===a)return 32774;if(101===a)return 32778;if(102===a)return 32779;if(200===a)return 0;if(201=== -a)return 1;if(202===a)return 768;if(203===a)return 769;if(204===a)return 770;if(205===a)return 771;if(206===a)return 772;if(207===a)return 773;if(208===a)return 774;if(209===a)return 775;if(210===a)return 776;if(33776===a||33777===a||33778===a||33779===a)if(d=b.get("WEBGL_compressed_texture_s3tc"),null!==d){if(33776===a)return d.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===a)return d.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===a)return d.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===a)return d.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840=== -a||35841===a||35842===a||35843===a)if(d=b.get("WEBGL_compressed_texture_pvrtc"),null!==d){if(35840===a)return d.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===a)return d.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===a)return d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===a)return d.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===a&&(d=b.get("WEBGL_compressed_texture_etc1"),null!==d))return d.COMPRESSED_RGB_ETC1_WEBGL;if(37808===a||37809===a||37810===a||37811===a||37812===a||37813===a||37814===a||37815===a||37816=== -a||37817===a||37818===a||37819===a||37820===a||37821===a)if(d=b.get("WEBGL_compressed_texture_astc"),null!==d)return a;if(103===a||104===a){if(c.isWebGL2){if(103===a)return 32775;if(104===a)return 32776}d=b.get("EXT_blend_minmax");if(null!==d){if(103===a)return d.MIN_EXT;if(104===a)return d.MAX_EXT}}if(1020===a){if(c.isWebGL2)return 34042;d=b.get("WEBGL_depth_texture");if(null!==d)return d.UNSIGNED_INT_24_8_WEBGL}return 0}}}function Hc(){A.call(this);this.type="Group"}function Jd(a){ja.call(this); -this.cameras=a||[]}function Eh(a,b,c){Fh.setFromMatrixPosition(b.matrixWorld);Gh.setFromMatrixPosition(c.matrixWorld);var d=Fh.distanceTo(Gh),e=b.projectionMatrix.elements,f=c.projectionMatrix.elements,g=e[14]/(e[10]-1);c=e[14]/(e[10]+1);var h=(e[9]+1)/e[5],l=(e[9]-1)/e[5],m=(e[8]-1)/e[0],p=(f[8]+1)/f[0];e=g*m;f=g*p;p=d/(-m+p);m=p*-m;b.matrixWorld.decompose(a.position,a.quaternion,a.scale);a.translateX(m);a.translateZ(p);a.matrixWorld.compose(a.position,a.quaternion,a.scale);a.matrixWorldInverse.getInverse(a.matrixWorld); -b=g+p;g=c+p;a.projectionMatrix.makePerspective(e-m,f+(d-m),h*c/g*b,l*c/g*b,b,g)}function cg(a){function b(){return null!==h&&!0===h.isPresenting}function c(){if(b()){var c=h.getEyeParameters("left");e=2*c.renderWidth*r;f=c.renderHeight*r;Cb=a.getPixelRatio();a.getSize(E);a.setDrawingBufferSize(e,f,1);x.viewport.set(0,0,e/2,f);U.viewport.set(e/2,0,e/2,f);A.start();g.dispatchEvent({type:"sessionstart"})}else g.enabled&&a.setDrawingBufferSize(E.width,E.height,Cb),A.stop(),g.dispatchEvent({type:"sessionend"})} -function d(a,b){null!==b&&4===b.length&&a.set(b[0]*e,b[1]*f,b[2]*e,b[3]*f)}var e,f,g=this,h=null,l=null,m=null,p=[],u=new W,k=new W,r=1,t="local-floor";"undefined"!==typeof window&&"VRFrameData"in window&&(l=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",c,!1));var z=new W,w=new sa,y=new n,x=new ja;x.viewport=new da;x.layers.enable(1);var U=new ja;U.viewport=new da;U.layers.enable(2);var R=new Jd([x,U]);R.layers.enable(1);R.layers.enable(2);var E=new v,Cb,B=[];this.enabled= -!1;this.getController=function(a){var b=p[a];void 0===b&&(b=new Hc,b.matrixAutoUpdate=!1,b.visible=!1,p[a]=b);return b};this.getDevice=function(){return h};this.setDevice=function(a){void 0!==a&&(h=a);A.setContext(a)};this.setFramebufferScaleFactor=function(a){r=a};this.setReferenceSpaceType=function(a){t=a};this.setPoseTarget=function(a){void 0!==a&&(m=a)};this.getCamera=function(a){var c="local-floor"===t?1.6:0;if(!1===b())return a.position.set(0,c,0),a.rotation.set(0,0,0),a;h.depthNear=a.near; -h.depthFar=a.far;h.getFrameData(l);if("local-floor"===t){var e=h.stageParameters;e?u.fromArray(e.sittingToStandingTransform):u.makeTranslation(0,c,0)}c=l.pose;e=null!==m?m:a;e.matrix.copy(u);e.matrix.decompose(e.position,e.quaternion,e.scale);null!==c.orientation&&(w.fromArray(c.orientation),e.quaternion.multiply(w));null!==c.position&&(w.setFromRotationMatrix(u),y.fromArray(c.position),y.applyQuaternion(w),e.position.add(y));e.updateMatrixWorld();x.near=a.near;U.near=a.near;x.far=a.far;U.far=a.far; -x.matrixWorldInverse.fromArray(l.leftViewMatrix);U.matrixWorldInverse.fromArray(l.rightViewMatrix);k.getInverse(u);"local-floor"===t&&(x.matrixWorldInverse.multiply(k),U.matrixWorldInverse.multiply(k));a=e.parent;null!==a&&(z.getInverse(a.matrixWorld),x.matrixWorldInverse.multiply(z),U.matrixWorldInverse.multiply(z));x.matrixWorld.getInverse(x.matrixWorldInverse);U.matrixWorld.getInverse(U.matrixWorldInverse);x.projectionMatrix.fromArray(l.leftProjectionMatrix);U.projectionMatrix.fromArray(l.rightProjectionMatrix); -Eh(R,x,U);a=h.getLayers();a.length&&(a=a[0],d(x.viewport,a.leftBounds),d(U.viewport,a.rightBounds));a:for(a=0;a\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n \n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = decodeHalfRGBA ( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = pow( squared_mean - mean * mean, 0.5 );\n gl_FragColor = encodeHalfRGBA( vec2( mean, std_dev ) );\n}"}), +q=r.clone();q.defines.HORIZONAL_PASS=1;var v=new D;v.addAttribute("position",new Q(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var n=new R(v,r);for(v=0;4!==v;++v){var z=0!==(v&1),x=0!==(v&2),F=new Db({depthPacking:3201,morphTargets:z,skinning:x});m[v]=F;z=new Eb({morphTargets:z,skinning:x});p[v]=z}var V=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(d,m,p){if(!1!==V.enabled&&(!1!==V.autoUpdate||!1!==V.needsUpdate)&&0!==d.length){var u=a.getRenderTarget(), +k=a.getActiveCubeFace(),t=a.getActiveMipmapLevel(),v=a.state;v.setBlending(0);v.buffers.color.setClear(1,1,1,1);v.buffers.depth.setTest(!0);v.setScissorTest(!1);for(var y=0,x=d.length;yc||g.y>c)console.warn("THREE.WebGLShadowMap:",F,"has shadow exceeding max texture size, reducing"),g.x>c&&(h.x=Math.floor(c/ia.x), +g.x=h.x*ia.x,W.mapSize.x=h.x),g.y>c&&(h.y=Math.floor(c/ia.y),g.y=h.y*ia.y,W.mapSize.y=h.y);null!==W.map||W.isPointLightShadow||3!==this.type||(ia={minFilter:1006,magFilter:1006,format:1023},W.map=new ka(g.x,g.y,ia),W.map.texture.name=F.name+".shadowMap",W.mapPass=new ka(g.x,g.y,ia),W.camera.updateProjectionMatrix());null===W.map&&(ia={minFilter:1003,magFilter:1003,format:1023},W.map=new ka(g.x,g.y,ia),W.map.texture.name=F.name+".shadowMap",W.camera.updateProjectionMatrix());a.setRenderTarget(W.map); +a.clear();ia=W.getViewportCount();for(var z=0;zd||a.height>d)e=d/Math.max(a.width,a.height);if(1>e||!0===b){if("undefined"!==typeof HTMLImageElement&&a instanceof HTMLImageElement||"undefined"!==typeof HTMLCanvasElement&&a instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&a instanceof +ImageBitmap)return d=b?N.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height),void 0===H&&(H=h(b,e)),c=c?h(b,e):H,c.width=b,c.height=e,c.getContext("2d").drawImage(a,0,0,b,e),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+a.width+"x"+a.height+") to ("+b+"x"+e+")."),c;"data"in a&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+a.width+"x"+a.height+").")}return a}function m(a){return N.isPowerOfTwo(a.width)&&N.isPowerOfTwo(a.height)}function p(a,b){return a.generateMipmaps&& +b&&1003!==a.minFilter&&1006!==a.minFilter}function u(b,c,e,f){a.generateMipmap(b);d.get(c).__maxMipLevel=Math.log(Math.max(e,f))*Math.LOG2E}function k(a,c){if(!e.isWebGL2)return a;var d=a;6403===a&&(5126===c&&(d=33326),5131===c&&(d=33325),5121===c&&(d=33321));6407===a&&(5126===c&&(d=34837),5131===c&&(d=34843),5121===c&&(d=32849));6408===a&&(5126===c&&(d=34836),5131===c&&(d=34842),5121===c&&(d=32856));33325===d||33326===d||34842===d||34836===d?b.get("EXT_color_buffer_float"):(34843===d||34837===d)&& +console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead.");return d}function r(a){return 1003===a||1004===a||1005===a?9728:9729}function q(b){b=b.target;b.removeEventListener("dispose",q);var c=d.get(b);void 0!==c.__webglInit&&(a.deleteTexture(c.__webglTexture),d.remove(b));b.isVideoTexture&&va.delete(b);g.memory.textures--}function v(b){b=b.target;b.removeEventListener("dispose",v);var c=d.get(b),e=d.get(b.texture);if(b){void 0!==e.__webglTexture&& +a.deleteTexture(e.__webglTexture);b.depthTexture&&b.depthTexture.dispose();if(b.isWebGLRenderTargetCube)for(e=0;6>e;e++)a.deleteFramebuffer(c.__webglFramebuffer[e]),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer[e]);else a.deleteFramebuffer(c.__webglFramebuffer),c.__webglDepthbuffer&&a.deleteRenderbuffer(c.__webglDepthbuffer);if(b.isWebGLMultiviewRenderTarget){a.deleteTexture(c.__webglColorTexture);a.deleteTexture(c.__webglDepthStencilTexture);g.memory.textures-=2;e=0;for(var f=c.__webglViewFramebuffers.length;e< +f;e++)a.deleteFramebuffer(c.__webglViewFramebuffers[e])}d.remove(b.texture);d.remove(b)}g.memory.textures--}function n(a,b){var e=d.get(a);if(a.isVideoTexture){var f=g.render.frame;va.get(a)!==f&&(va.set(a,f),a.update())}if(0r;r++)t[r]=q||g?g?b.image[r].image:b.image[r]:l(b.image[r],!1,!0,e.maxCubemapSize);var v=t[0],n=m(v)||e.isWebGL2,y=f.convert(b.format),x=f.convert(b.type),W=k(y,x);F(34067,b,n);if(q){for(r= +0;6>r;r++){var ia=t[r].mipmaps;for(q=0;qr;r++)if(g)for(c.texImage2D(34069+r,0,W,t[r].width,t[r].height,0,y, +x,t[r].data),q=0;q=e.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+e.maxTextures);J+=1;return a};this.resetTextureUnits=function(){J=0};this.setTexture2D=n;this.setTexture2DArray=function(a,b){var e=d.get(a);0z;z++)l.__webglFramebuffer[z]= +a.createFramebuffer()}else if(l.__webglFramebuffer=a.createFramebuffer(),t)if(e.isWebGL2){l.__webglMultisampledFramebuffer=a.createFramebuffer();l.__webglColorRenderbuffer=a.createRenderbuffer();a.bindRenderbuffer(36161,l.__webglColorRenderbuffer);t=f.convert(h.texture.format);var B=f.convert(h.texture.type);t=k(t,B);B=C(h);a.renderbufferStorageMultisample(36161,B,t,h.width,h.height);a.bindFramebuffer(36160,l.__webglMultisampledFramebuffer);a.framebufferRenderbuffer(36160,36064,36161,l.__webglColorRenderbuffer); +a.bindRenderbuffer(36161,null);h.depthBuffer&&(l.__webglDepthRenderbuffer=a.createRenderbuffer(),A(l.__webglDepthRenderbuffer,h,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(y)if(e.multiview){z=h.width;var V=h.height;t=h.numViews;a.bindFramebuffer(36160,l.__webglFramebuffer);var H=b.get("OVR_multiview2");g.memory.textures+=2;B=a.createTexture();a.bindTexture(35866,B);a.texParameteri(35866,10240,9728); +a.texParameteri(35866,10241,9728);a.texImage3D(35866,0,32856,z,V,t,0,6408,5121,null);H.framebufferTextureMultiviewOVR(36160,36064,B,0,0,t);var va=a.createTexture();a.bindTexture(35866,va);a.texParameteri(35866,10240,9728);a.texParameteri(35866,10241,9728);a.texImage3D(35866,0,35056,z,V,t,0,34041,34042,null);H.framebufferTextureMultiviewOVR(36160,33306,va,0,0,t);V=Array(t);for(z=0;zz;z++)w(l.__webglFramebuffer[z],h,36064,34069+z);p(h.texture,x)&&u(34067,h.texture,h.width,h.height);c.bindTexture(34067,null)}else y||(c.bindTexture(3553,q.__webglTexture),F(3553, +h.texture,x),w(l.__webglFramebuffer,h,36064,3553),p(h.texture,x)&&u(3553,h.texture,h.width,h.height),c.bindTexture(3553,null));if(h.depthBuffer){l=d.get(h);q=!0===h.isWebGLRenderTargetCube;if(h.depthTexture){if(q)throw Error("target.depthTexture not supported in Cube render targets");if(h&&h.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported");a.bindFramebuffer(36160,l.__webglFramebuffer);if(!h.depthTexture||!h.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture"); +d.get(h.depthTexture).__webglTexture&&h.depthTexture.image.width===h.width&&h.depthTexture.image.height===h.height||(h.depthTexture.image.width=h.width,h.depthTexture.image.height=h.height,h.depthTexture.needsUpdate=!0);n(h.depthTexture,0);l=d.get(h.depthTexture).__webglTexture;if(1026===h.depthTexture.format)a.framebufferTexture2D(36160,36096,3553,l,0);else if(1027===h.depthTexture.format)a.framebufferTexture2D(36160,33306,3553,l,0);else throw Error("Unknown depthTexture format");}else if(q)for(l.__webglDepthbuffer= +[],q=0;6>q;q++)a.bindFramebuffer(36160,l.__webglFramebuffer[q]),l.__webglDepthbuffer[q]=a.createRenderbuffer(),A(l.__webglDepthbuffer[q],h);else a.bindFramebuffer(36160,l.__webglFramebuffer),l.__webglDepthbuffer=a.createRenderbuffer(),A(l.__webglDepthbuffer,h);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var b=a.texture,f=m(a)||e.isWebGL2;if(p(b,f)){f=a.isWebGLRenderTargetCube?34067:3553;var g=d.get(b).__webglTexture;c.bindTexture(f,g);u(f,b,a.width,a.height);c.bindTexture(f, +null)}};this.updateMultisampleRenderTarget=function(b){if(b.isWebGLMultisampleRenderTarget)if(e.isWebGL2){var c=d.get(b);a.bindFramebuffer(36008,c.__webglMultisampledFramebuffer);a.bindFramebuffer(36009,c.__webglFramebuffer);c=b.width;var f=b.height,g=16384;b.depthBuffer&&(g|=256);b.stencilBuffer&&(g|=1024);a.blitFramebuffer(0,0,c,f,0,0,c,f,g,9728)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")};this.safeSetTexture2D=function(a,b){a&&a.isWebGLRenderTarget&& +(!1===I&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),I=!0),a=a.texture);n(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLRenderTargetCube&&(!1===E&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),E=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?z(a,b):x(a,b)}}function Gh(a,b,c){return{convert:function(a){if(1E3=== +a)return 10497;if(1001===a)return 33071;if(1002===a)return 33648;if(1003===a)return 9728;if(1004===a)return 9984;if(1005===a)return 9986;if(1006===a)return 9729;if(1007===a)return 9985;if(1008===a)return 9987;if(1009===a)return 5121;if(1017===a)return 32819;if(1018===a)return 32820;if(1019===a)return 33635;if(1010===a)return 5120;if(1011===a)return 5122;if(1012===a)return 5123;if(1013===a)return 5124;if(1014===a)return 5125;if(1015===a)return 5126;if(1016===a){if(c.isWebGL2)return 5131;var d=b.get("OES_texture_half_float"); +if(null!==d)return d.HALF_FLOAT_OES}if(1021===a)return 6406;if(1022===a)return 6407;if(1023===a)return 6408;if(1024===a)return 6409;if(1025===a)return 6410;if(1026===a)return 6402;if(1027===a)return 34041;if(1028===a)return 6403;if(100===a)return 32774;if(101===a)return 32778;if(102===a)return 32779;if(200===a)return 0;if(201===a)return 1;if(202===a)return 768;if(203===a)return 769;if(204===a)return 770;if(205===a)return 771;if(206===a)return 772;if(207===a)return 773;if(208===a)return 774;if(209=== +a)return 775;if(210===a)return 776;if(33776===a||33777===a||33778===a||33779===a)if(d=b.get("WEBGL_compressed_texture_s3tc"),null!==d){if(33776===a)return d.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===a)return d.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===a)return d.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===a)return d.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===a||35841===a||35842===a||35843===a)if(d=b.get("WEBGL_compressed_texture_pvrtc"),null!==d){if(35840===a)return d.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841=== +a)return d.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===a)return d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===a)return d.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===a&&(d=b.get("WEBGL_compressed_texture_etc1"),null!==d))return d.COMPRESSED_RGB_ETC1_WEBGL;if(37808===a||37809===a||37810===a||37811===a||37812===a||37813===a||37814===a||37815===a||37816===a||37817===a||37818===a||37819===a||37820===a||37821===a)if(d=b.get("WEBGL_compressed_texture_astc"),null!==d)return a;if(103===a||104===a){if(c.isWebGL2){if(103=== +a)return 32775;if(104===a)return 32776}d=b.get("EXT_blend_minmax");if(null!==d){if(103===a)return d.MIN_EXT;if(104===a)return d.MAX_EXT}}if(1020===a){if(c.isWebGL2)return 34042;d=b.get("WEBGL_depth_texture");if(null!==d)return d.UNSIGNED_INT_24_8_WEBGL}return 0}}}function eg(a,b,c,d){ka.call(this,a,b,d);this.stencilBuffer=this.depthBuffer=!1;this.numViews=c}function ck(a,b){function c(a){if(a.isArrayCamera)return a.cameras;k[0]=a;return k}function d(a){if(!a.isArrayCamera)return!0;a=a.cameras;if(a.length> +g)return!1;for(var b=1,c=a.length;bf.matrixWorld.determinant();ha.setMaterial(e, -h);var l=k(a,c,e,f),m=!1;if(b!==d.id||ac!==l.id||Z!==(!0===e.wireframe))b=d.id,ac=l.id,Z=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(wa.update(f,d,e,l),m=!0);h=d.index;var p=d.attributes.position;c=1;!0===e.wireframe&&(h=va.getWireframeAttribute(d),c=2);a=ya;if(null!==h){var u=ta.get(h);a=za;a.setIndex(u)}if(m){if(d&&d.isInstancedBufferGeometry&&!Da.isWebGL2&&null===pa.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); -else{ha.initAttributes();m=d.attributes;l=l.getAttributes();var r=e.defaultAttributeValues;for(v in l){var q=l[v];if(0<=q){var t=m[v];if(void 0!==t){var n=t.normalized,z=t.itemSize,w=ta.get(t);if(void 0!==w){var x=w.buffer,y=w.type;w=w.bytesPerElement;if(t.isInterleavedBufferAttribute){var E=t.data,U=E.stride;t=t.offset;E&&E.isInstancedInterleavedBuffer?(ha.enableAttributeAndDivisor(q,E.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=E.meshPerAttribute*E.count)):ha.enableAttribute(q); -K.bindBuffer(34962,x);K.vertexAttribPointer(q,z,y,n,U*w,t*w)}else t.isInstancedBufferAttribute?(ha.enableAttributeAndDivisor(q,t.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=t.meshPerAttribute*t.count)):ha.enableAttribute(q),K.bindBuffer(34962,x),K.vertexAttribPointer(q,z,y,n,0,0)}}else if(void 0!==r&&(n=r[v],void 0!==n))switch(n.length){case 2:K.vertexAttrib2fv(q,n);break;case 3:K.vertexAttrib3fv(q,n);break;case 4:K.vertexAttrib4fv(q,n);break;default:K.vertexAttrib1fv(q,n)}}}ha.disableUnusedAttributes()}null!== -h&&K.bindBuffer(34963,u.buffer)}u=Infinity;null!==h?u=h.count:void 0!==p&&(u=p.count);h=d.drawRange.start*c;p=null!==g?g.start*c:0;var v=Math.max(h,p);g=Math.max(0,Math.min(u,h+d.drawRange.count*c,p+(null!==g?g.count*c:Infinity))-1-v+1);if(0!==g){if(f.isMesh)if(!0===e.wireframe)ha.setLineWidth(e.wireframeLinewidth*(null===M?ea:1)),a.setMode(1);else switch(f.drawMode){case 0:a.setMode(4);break;case 1:a.setMode(5);break;case 2:a.setMode(6)}else f.isLine?(e=e.linewidth,void 0===e&&(e=1),ha.setLineWidth(e* -(null===M?ea:1)),f.isLineSegments?a.setMode(1):f.isLineLoop?a.setMode(2):a.setMode(3)):f.isPoints?a.setMode(0):f.isSprite&&a.setMode(4);d&&d.isInstancedBufferGeometry?0e.far||f.push({distance:a,distanceToRay:Math.sqrt(h), -point:c,index:b,face:null,object:g}))}function hg(a,b,c,d,e,f,g,h,l){V.call(this,a,b,c,d,e,f,g,h,l);this.format=void 0!==g?g:1022;this.minFilter=void 0!==f?f:1006;this.magFilter=void 0!==e?e:1006;this.generateMipmaps=!1}function Lc(a,b,c,d,e,f,g,h,l,m,p,k){V.call(this,null,f,g,h,l,m,d,e,p,k);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Pd(a,b,c,d,e,f,g,h,l){V.call(this,a,b,c,d,e,f,g,h,l);this.needsUpdate=!0}function Qd(a,b,c,d,e,f,g,h,l,m){m=void 0!==m? -m:1026;if(1026!==m&&1027!==m)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===c&&1026===m&&(c=1012);void 0===c&&1027===m&&(c=1020);V.call(this,null,d,e,f,g,h,m,c,l);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==h?h:1003;this.generateMipmaps=this.flipY=!1}function Mc(a){D.call(this);this.type="WireframeGeometry";var b=[],c,d,e,f=[0,0],g={},h=["a","b","c"];if(a&&a.isGeometry){var l=a.faces;var m=0;for(d= -l.length;mc;c++){var k=p[h[c]];var q=p[h[(c+1)%3]];f[0]=Math.min(k,q);f[1]=Math.max(k,q);k=f[0]+","+f[1];void 0===g[k]&&(g[k]={index1:f[0],index2:f[1]})}}for(k in g)m=g[k],h=a.vertices[m.index1],b.push(h.x,h.y,h.z),h=a.vertices[m.index2],b.push(h.x,h.y,h.z)}else if(a&&a.isBufferGeometry)if(h=new n,null!==a.index){l=a.attributes.position;p=a.index;var r=a.groups;0===r.length&&(r=[{start:0,count:p.count,materialIndex:0}]);a=0;for(e=r.length;ac;c++)k=p.getX(m+c),q=p.getX(m+(c+1)%3),f[0]=Math.min(k,q),f[1]=Math.max(k,q),k=f[0]+","+f[1],void 0===g[k]&&(g[k]={index1:f[0],index2:f[1]});for(k in g)m=g[k],h.fromBufferAttribute(l,m.index1),b.push(h.x,h.y,h.z),h.fromBufferAttribute(l,m.index2),b.push(h.x,h.y,h.z)}else for(l=a.attributes.position,m=0,d=l.count/3;mc;c++)g=3*m+c,h.fromBufferAttribute(l,g),b.push(h.x,h.y,h.z),g=3*m+(c+1)%3,h.fromBufferAttribute(l,g),b.push(h.x,h.y,h.z);this.addAttribute("position", -new B(b,3))}function Rd(a,b,c){F.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Nc(a,b,c));this.mergeVertices()}function Nc(a,b,c){D.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h=new n,l=new n,m=new n,p=new n,k=new n,q,r;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var t=b+1;for(q=0;q<=c;q++){var z= -q/c;for(r=0;r<=b;r++){var w=r/b;a(w,z,l);e.push(l.x,l.y,l.z);0<=w-1E-5?(a(w-1E-5,z,m),p.subVectors(l,m)):(a(w+1E-5,z,m),p.subVectors(m,l));0<=z-1E-5?(a(w,z-1E-5,m),k.subVectors(l,m)):(a(w,z+1E-5,m),k.subVectors(m,l));h.crossVectors(p,k).normalize();f.push(h.x,h.y,h.z);g.push(w,z)}}for(q=0;qd&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}D.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a,indices:b,radius:c,detail:d};c= -c||1;d=d||0;var h=[],l=[];(function(a){for(var c=new n,d=new n,g=new n,h=0;he&&(.2>b&&(l[a+0]+=1),.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.addAttribute("position",new B(h,3));this.addAttribute("normal",new B(h.slice(),3));this.addAttribute("uv",new B(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Td(a,b){F.call(this); -this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Oc(a,b));this.mergeVertices()}function Oc(a,b){Aa.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Ud(a,b){F.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new cc(a,b));this.mergeVertices()}function cc(a,b){Aa.call(this,[1,0,0,-1,0,0,0,1,0,0,-1, -0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Vd(a,b){F.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Pc(a,b));this.mergeVertices()}function Pc(a,b){var c=(1+Math.sqrt(5))/2;Aa.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7, -6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Wd(a,b){F.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Qc(a,b));this.mergeVertices()}function Qc(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;Aa.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,14,1,14,5,1,5,9],a,b);this.type="DodecahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Xd(a,b,c,d,e,f){F.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};void 0!== -f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new dc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function dc(a,b,c,d,e){function f(e){p=a.getPointAt(e/b,p);var f=g.normals[e];e=g.binormals[e];for(q=0;q<=d;q++){var m=q/d*Math.PI*2,k=Math.sin(m);m=-Math.cos(m);l.x=m*f.x+k*e.x;l.y=m*f.y+k*e.y;l.z=m*f.z+k*e.z;l.normalize();t.push(l.x,l.y,l.z);h.x=p.x+c*l.x;h.y=p.y+c*l.y;h.z=p.z+c*l.z;r.push(h.x, -h.y,h.z)}}D.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new n,l=new n,m=new v,p=new n,k,q,r=[],t=[],z=[],w=[];for(k=0;k=b;e-=d)f=Lh(e,a[e],a[e+1],f);f&&ec(f,f.next)&&($d(f),f=f.next);return f}function ae(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!ec(a,a.next)&&0!==qa(a.prev,a,a.next))a=a.next;else{$d(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b} -function be(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l.z=ig(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==h);l.prevZ.nextZ=null;l.prevZ=null;h=l;var m,p,k,q,r=1;do{l=h;var t=h=null;for(p=0;l;){p++;var n=l;for(m=k=0;mn!==t.next.y>n&&t.next.y!==t.y&&k<(t.next.x-t.x)*(n-t.y)/(t.next.y-t.y)+t.x&&(p=!p),t=t.next;while(t!==l);t=p}l=t}if(l){a=Nh(g,h);g=ae(g,g.next);a=ae(a,a.next);be(g,b,c,d,e,f);be(a,b,c,d,e,f);break a}h= -h.next}g=g.next}while(g!==a)}break}}}}function Zj(a,b,c,d){var e=a.prev,f=a.next;if(0<=qa(e,a,f))return!1;var g=e.x>a.x?e.x>f.x?e.x:f.x:a.x>f.x?a.x:f.x,h=e.y>a.y?e.y>f.y?e.y:f.y:a.y>f.y?a.y:f.y,l=ig(e.x=l&&d&&d.z<=b;){if(c!==a.prev&&c!==a.next&&Tc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=qa(c.prev,c,c.next))return!1;c=c.prevZ;if(d!==a.prev&&d!==a.next&&Tc(e.x,e.y,a.x,a.y, -f.x,f.y,d.x,d.y)&&0<=qa(d.prev,d,d.next))return!1;d=d.nextZ}for(;c&&c.z>=l;){if(c!==a.prev&&c!==a.next&&Tc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=qa(c.prev,c,c.next))return!1;c=c.prevZ}for(;d&&d.z<=b;){if(d!==a.prev&&d!==a.next&&Tc(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=qa(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function ak(a,b){return a.x-b.x}function bk(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f= -g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var h=c.x=c.x&&c.x>=g&&d!==c.x&&Tc(eh.x)&&ce(c,a)&&(h=c,m=p)}c=c.next}return h}function ig(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b| -b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function ck(a){var b=a,c=a;do{if(b.xqa(a.prev,a,a.next)?0<=qa(a,b,a.next)&&0<=qa(a,a.prev,b):0>qa(a,b,a.prev)||0>qa(a,a.next,b)}function Nh(a,b){var c=new jg(a.i,a.x,a.y),d=new jg(b.i,b.x,b.y),e=a.next,f=b.prev;a.next=b;b.prev=a;c.next=e;e.prev=c;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function Lh(a,b,c,d){a=new jg(a,b,c);d?(a.next=d.next,a.prev=d,d.next.prev=a,d.next=a):(a.prev=a,a.next=a);return a}function $d(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ= -a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function jg(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function Oh(a){var b=a.length;2Number.EPSILON){var l=Math.sqrt(h),m=Math.sqrt(f*f+g*g);h=b.x-e/l;b=b.y+d/l;g=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new v(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)=== -Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new v(f/e,d/e)}function h(a,b){for(J=a.length;0<=--J;){var c=J;var f=J-1;0>f&&(f=a.length-1);var g,h=x+2*D;for(g=0;ge.far||f.push({distance:a,distanceToRay:Math.sqrt(h),point:c,index:b,face:null,object:g}))}function kg(a,b,c,d,e,f,g,h,l){Z.call(this,a,b,c,d,e,f,g,h,l);this.format=void 0!==g?g:1022;this.minFilter=void 0!==f?f:1006;this.magFilter=void 0!==e?e:1006;this.generateMipmaps=!1}function Lc(a,b,c,d,e,f,g,h,l,m,p,k){Z.call(this,null,f,g,h,l,m,d,e,p,k);this.image={width:b,height:c};this.mipmaps=a;this.generateMipmaps=this.flipY=!1}function Pd(a, +b,c,d,e,f,g,h,l){Z.call(this,a,b,c,d,e,f,g,h,l);this.needsUpdate=!0}function Qd(a,b,c,d,e,f,g,h,l,m){m=void 0!==m?m:1026;if(1026!==m&&1027!==m)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===c&&1026===m&&(c=1012);void 0===c&&1027===m&&(c=1020);Z.call(this,null,d,e,f,g,h,m,c,l);this.image={width:a,height:b};this.magFilter=void 0!==g?g:1003;this.minFilter=void 0!==h?h:1003;this.generateMipmaps=this.flipY=!1}function Mc(a){D.call(this);this.type= +"WireframeGeometry";var b=[],c,d,e,f=[0,0],g={},h=["a","b","c"];if(a&&a.isGeometry){var l=a.faces;var m=0;for(d=l.length;mc;c++){var k=p[h[c]];var t=p[h[(c+1)%3]];f[0]=Math.min(k,t);f[1]=Math.max(k,t);k=f[0]+","+f[1];void 0===g[k]&&(g[k]={index1:f[0],index2:f[1]})}}for(k in g)m=g[k],h=a.vertices[m.index1],b.push(h.x,h.y,h.z),h=a.vertices[m.index2],b.push(h.x,h.y,h.z)}else if(a&&a.isBufferGeometry)if(h=new n,null!==a.index){l=a.attributes.position;p=a.index;var r=a.groups; +0===r.length&&(r=[{start:0,count:p.count,materialIndex:0}]);a=0;for(e=r.length;ac;c++)k=p.getX(m+c),t=p.getX(m+(c+1)%3),f[0]=Math.min(k,t),f[1]=Math.max(k,t),k=f[0]+","+f[1],void 0===g[k]&&(g[k]={index1:f[0],index2:f[1]});for(k in g)m=g[k],h.fromBufferAttribute(l,m.index1),b.push(h.x,h.y,h.z),h.fromBufferAttribute(l,m.index2),b.push(h.x,h.y,h.z)}else for(l=a.attributes.position,m=0,d=l.count/3;mc;c++)g=3*m+c,h.fromBufferAttribute(l, +g),b.push(h.x,h.y,h.z),g=3*m+(c+1)%3,h.fromBufferAttribute(l,g),b.push(h.x,h.y,h.z);this.addAttribute("position",new A(b,3))}function Rd(a,b,c){G.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Nc(a,b,c));this.mergeVertices()}function Nc(a,b,c){D.call(this);this.type="ParametricBufferGeometry";this.parameters={func:a,slices:b,stacks:c};var d=[],e=[],f=[],g=[],h=new n,l=new n,m=new n,p=new n,k=new n,t,r;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter."); +var q=b+1;for(t=0;t<=c;t++){var v=t/c;for(r=0;r<=b;r++){var y=r/b;a(y,v,l);e.push(l.x,l.y,l.z);0<=y-1E-5?(a(y-1E-5,v,m),p.subVectors(l,m)):(a(y+1E-5,v,m),p.subVectors(m,l));0<=v-1E-5?(a(y,v-1E-5,m),k.subVectors(l,m)):(a(y,v+1E-5,m),k.subVectors(m,l));h.crossVectors(p,k).normalize();f.push(h.x,h.y,h.z);g.push(y,v)}}for(t=0;td&&1===a.x&&(l[b]=a.x-1);0===c.x&&0===c.z&&(l[b]=d/2/Math.PI+.5)}D.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:a, +indices:b,radius:c,detail:d};c=c||1;d=d||0;var h=[],l=[];(function(a){for(var c=new n,d=new n,g=new n,h=0;he&&(.2>b&&(l[a+0]+=1),.2>c&&(l[a+2]+=1),.2>d&&(l[a+4]+=1))})();this.addAttribute("position",new A(h,3));this.addAttribute("normal",new A(h.slice(),3));this.addAttribute("uv",new A(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function Td(a, +b){G.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Oc(a,b));this.mergeVertices()}function Oc(a,b){Da.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],a,b);this.type="TetrahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Ud(a,b){G.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new cc(a,b));this.mergeVertices()}function cc(a,b){Da.call(this,[1,0,0, +-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],a,b);this.type="OctahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Vd(a,b){G.call(this);this.type="IcosahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Pc(a,b));this.mergeVertices()}function Pc(a,b){var c=(1+Math.sqrt(5))/2;Da.call(this,[-1,c,0,1,c,0,-1,-c,0,1,-c,0,0,-1,c,0,1,c,0,-1,-c,0,1,-c,c,0,-1,c,0,1,-c,0,-1,-c,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5, +11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],a,b);this.type="IcosahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Wd(a,b){G.call(this);this.type="DodecahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new Qc(a,b));this.mergeVertices()}function Qc(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;Da.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,14,1,14,5,1,5,9],a,b);this.type="DodecahedronBufferGeometry";this.parameters={radius:a,detail:b}}function Xd(a,b,c,d,e,f){G.call(this);this.type="TubeGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d, +closed:e};void 0!==f&&console.warn("THREE.TubeGeometry: taper has been removed.");a=new dc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function dc(a,b,c,d,e){function f(e){p=a.getPointAt(e/b,p);var f=g.normals[e];e=g.binormals[e];for(t=0;t<=d;t++){var m=t/d*Math.PI*2,k=Math.sin(m);m=-Math.cos(m);l.x=m*f.x+k*e.x;l.y=m*f.y+k*e.y;l.z=m*f.z+k*e.z;l.normalize();q.push(l.x,l.y,l.z);h.x=p.x+c*l.x;h.y=p.y+c*l.y;h.z= +p.z+c*l.z;r.push(h.x,h.y,h.z)}}D.call(this);this.type="TubeBufferGeometry";this.parameters={path:a,tubularSegments:b,radius:c,radialSegments:d,closed:e};b=b||64;c=c||1;d=d||8;e=e||!1;var g=a.computeFrenetFrames(b,e);this.tangents=g.tangents;this.normals=g.normals;this.binormals=g.binormals;var h=new n,l=new n,m=new w,p=new n,k,t,r=[],q=[],v=[],y=[];for(k=0;k=b;e-=d)f=Oh(e,a[e],a[e+1],f);f&&ec(f,f.next)&&($d(f),f=f.next);return f}function ae(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!ec(a,a.next)&&0!==qa(a.prev,a,a.next))a=a.next;else{$d(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b} +function be(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l.z=lg(l.x,l.y,d,e,f)),l.prevZ=l.prev,l=l.nextZ=l.next;while(l!==h);l.prevZ.nextZ=null;l.prevZ=null;h=l;var m,p,k,t,r=1;do{l=h;var q=h=null;for(p=0;l;){p++;var n=l;for(m=k=0;mn!==q.next.y>n&&q.next.y!==q.y&&k<(q.next.x-q.x)*(n-q.y)/(q.next.y-q.y)+q.x&&(p=!p),q=q.next;while(q!==l);q=p}l=q}if(l){a=Qh(g,h);g=ae(g,g.next);a=ae(a,a.next);be(g,b,c,d,e,f);be(a,b,c,d,e,f);break a}h= +h.next}g=g.next}while(g!==a)}break}}}}function dk(a,b,c,d){var e=a.prev,f=a.next;if(0<=qa(e,a,f))return!1;var g=e.x>a.x?e.x>f.x?e.x:f.x:a.x>f.x?a.x:f.x,h=e.y>a.y?e.y>f.y?e.y:f.y:a.y>f.y?a.y:f.y,l=lg(e.x=l&&d&&d.z<=b;){if(c!==a.prev&&c!==a.next&&Tc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=qa(c.prev,c,c.next))return!1;c=c.prevZ;if(d!==a.prev&&d!==a.next&&Tc(e.x,e.y,a.x,a.y, +f.x,f.y,d.x,d.y)&&0<=qa(d.prev,d,d.next))return!1;d=d.nextZ}for(;c&&c.z>=l;){if(c!==a.prev&&c!==a.next&&Tc(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=qa(c.prev,c,c.next))return!1;c=c.prevZ}for(;d&&d.z<=b;){if(d!==a.prev&&d!==a.next&&Tc(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=qa(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function ek(a,b){return a.x-b.x}function fk(a,b){var c=b,d=a.x,e=a.y,f=-Infinity;do{if(e<=c.y&&e>=c.next.y&&c.next.y!==c.y){var g=c.x+(e-c.y)*(c.next.x-c.x)/(c.next.y-c.y);if(g<=d&&g>f){f= +g;if(g===d){if(e===c.y)return c;if(e===c.next.y)return c.next}var h=c.x=c.x&&c.x>=g&&d!==c.x&&Tc(eh.x)&&ce(c,a)&&(h=c,m=p)}c=c.next}return h}function lg(a,b,c,d,e){a=32767*(a-c)*e;b=32767*(b-d)*e;a=(a|a<<8)&16711935;a=(a|a<<4)&252645135;a=(a|a<<2)&858993459;b=(b|b<<8)&16711935;b=(b| +b<<4)&252645135;b=(b|b<<2)&858993459;return(a|a<<1)&1431655765|((b|b<<1)&1431655765)<<1}function gk(a){var b=a,c=a;do{if(b.xqa(a.prev,a,a.next)?0<=qa(a,b,a.next)&&0<=qa(a,a.prev,b):0>qa(a,b,a.prev)||0>qa(a,a.next,b)}function Qh(a,b){var c=new mg(a.i,a.x,a.y),d=new mg(b.i,b.x,b.y),e=a.next,f=b.prev;a.next=b;b.prev=a;c.next=e;e.prev=c;d.next=c;c.prev=d;f.next=d;d.prev=f;return d}function Oh(a,b,c,d){a=new mg(a,b,c);d?(a.next=d.next,a.prev=d,d.next.prev=a,d.next=a):(a.prev=a,a.next=a);return a}function $d(a){a.next.prev=a.prev;a.prev.next=a.next;a.prevZ&&(a.prevZ.nextZ= +a.nextZ);a.nextZ&&(a.nextZ.prevZ=a.prevZ)}function mg(a,b,c){this.i=a;this.x=b;this.y=c;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function Rh(a){var b=a.length;2Number.EPSILON){var l=Math.sqrt(h),m=Math.sqrt(f*f+g*g);h=b.x-e/l;b=b.y+d/l;g=((c.x-g/m-h)*g-(c.y+f/m-b)*f)/(d*g-e*f);f=h+d*g-a.x;d=b+e*g-a.y;e=f*f+d*d;if(2>=e)return new w(f,d);e=Math.sqrt(e/2)}else a=!1,d>Number.EPSILON?f>Number.EPSILON&&(a=!0):d<-Number.EPSILON?f<-Number.EPSILON&&(a=!0):Math.sign(e)=== +Math.sign(g)&&(a=!0),a?(f=-e,e=Math.sqrt(h)):(f=d,d=e,e=Math.sqrt(h/2));return new w(f/e,d/e)}function h(a,b){for(L=a.length;0<=--L;){var c=L;var f=L-1;0>f&&(f=a.length-1);var g,h=x+2*D;for(g=0;gk;k++){var n=m[f[k]];var q=m[f[(k+1)%3]];d[0]=Math.min(n,q);d[1]=Math.max(n,q);n=d[0]+","+d[1];void 0===e[n]?e[n]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[n].face2=h}for(n in e)if(d=e[n],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.addAttribute("position",new B(c,3))}function ic(a,b,c,d, -e,f,g,h){F.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new qb(a,b,c,d,e,f,g,h));this.mergeVertices()}function qb(a,b,c,d,e,f,g,h){function l(c){var e,f=new v,l=new n,p=0,z=!0===c?a:b,x=!0===c?1:-1;var B=t;for(e=1;e<=d;e++)u.push(0,w*x,0),q.push(0,x,0),r.push(.5,.5),t++;var A=t;for(e=0;e<=d;e++){var D=e/d*h+g,C=Math.cos(D);D=Math.sin(D);l.x=z*D;l.y=w*x; -l.z=z*C;u.push(l.x,l.y,l.z);q.push(0,x,0);f.x=.5*C+.5;f.y=.5*D*x+.5;r.push(f.x,f.y);t++}for(e=0;ethis.duration&&this.resetDuration()}function ek(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return $c; -case "vector":case "vector2":case "vector3":case "vector4":return ad;case "color":return Qe;case "quaternion":return le;case "bool":case "boolean":return Pe;case "string":return Se}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function fk(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var b=ek(a.type);if(void 0===a.times){var c=[],d=[];ta.flattenJSON(a.keys,c,d,"value");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name, -a.times,a.values,a.interpolation)}function kg(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0;this.onStart=void 0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()};this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return h?h(a):a};this.setURLModifier=function(a){h=a; -return this}}function Z(a){this.manager=void 0!==a?a:Sh;this.crossOrigin="anonymous";this.resourcePath=this.path=""}function Na(a){Z.call(this,a)}function lg(a){Z.call(this,a)}function mg(a){Z.call(this,a)}function Te(a){Z.call(this,a)}function bd(a){Z.call(this,a)}function Ue(a){Z.call(this,a)}function Ve(a){Z.call(this,a)}function C(){this.type="Curve";this.arcLengthDivisions=200}function Ia(a,b,c,d,e,f,g,h){C.call(this);this.type="EllipseCurve";this.aX=a||0;this.aY=b||0;this.xRadius=c||1;this.yRadius= -d||1;this.aStartAngle=e||0;this.aEndAngle=f||2*Math.PI;this.aClockwise=g||!1;this.aRotation=h||0}function cd(a,b,c,d,e,f){Ia.call(this,a,b,c,c,d,e,f);this.type="ArcCurve"}function ng(){var a=0,b=0,c=0,d=0;return{initCatmullRom:function(e,f,g,h,l){e=l*(g-e);h=l*(h-f);a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},initNonuniformCatmullRom:function(e,f,g,h,l,m,k){e=((f-e)/l-(g-e)/(l+m)+(g-f)/m)*m;h=((g-f)/m-(h-f)/(m+k)+(h-g)/k)*m;a=f;b=e;c=-3*f+3*g-2*e-h;d=2*f-2*g+e+h},calc:function(e){var f=e*e;return a+b* -e+c*f+d*f*e}}}function wa(a,b,c,d){C.call(this);this.type="CatmullRomCurve3";this.points=a||[];this.closed=b||!1;this.curveType=c||"centripetal";this.tension=d||.5}function Th(a,b,c,d,e){b=.5*(d-b);e=.5*(e-c);var f=a*a;return(2*c-2*d+b+e)*a*f+(-3*c+3*d-2*b-e)*f+b*a+c}function me(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}function ne(a,b,c,d,e){var f=1-a,g=1-a;return f*f*f*b+3*g*g*a*c+3*(1-a)*a*a*d+a*a*a*e}function Sa(a,b,c,d){C.call(this);this.type="CubicBezierCurve";this.v0=a||new v;this.v1= -b||new v;this.v2=c||new v;this.v3=d||new v}function gb(a,b,c,d){C.call(this);this.type="CubicBezierCurve3";this.v0=a||new n;this.v1=b||new n;this.v2=c||new n;this.v3=d||new n}function xa(a,b){C.call(this);this.type="LineCurve";this.v1=a||new v;this.v2=b||new v}function Ta(a,b){C.call(this);this.type="LineCurve3";this.v1=a||new n;this.v2=b||new n}function Ua(a,b,c){C.call(this);this.type="QuadraticBezierCurve";this.v0=a||new v;this.v1=b||new v;this.v2=c||new v}function hb(a,b,c){C.call(this);this.type= -"QuadraticBezierCurve3";this.v0=a||new n;this.v1=b||new n;this.v2=c||new n}function Va(a){C.call(this);this.type="SplineCurve";this.points=a||[]}function rb(){C.call(this);this.type="CurvePath";this.curves=[];this.autoClose=!1}function Wa(a){rb.call(this);this.type="Path";this.currentPoint=new v;a&&this.setFromPoints(a)}function Ib(a){Wa.call(this,a);this.uuid=N.generateUUID();this.type="Shape";this.holes=[]}function ba(a,b){A.call(this);this.type="Light";this.color=new I(a);this.intensity=void 0!== -b?b:1;this.receiveShadow=void 0}function We(a,b,c){ba.call(this,a,c);this.type="HemisphereLight";this.castShadow=void 0;this.position.copy(A.DefaultUp);this.updateMatrix();this.groundColor=new I(b)}function ib(a){this.camera=a;this.bias=0;this.radius=1;this.mapSize=new v(512,512);this.mapPass=this.map=null;this.matrix=new W;this._frustum=new Ed;this._frameExtents=new v(1,1);this._viewportCount=1;this._viewports=[new da(0,0,1,1)]}function Xe(){ib.call(this,new ja(50,1,.5,500))}function Ye(a,b,c,d, -e,f){ba.call(this,a,b);this.type="SpotLight";this.position.copy(A.DefaultUp);this.updateMatrix();this.target=new A;Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(a){this.intensity=a/Math.PI}});this.distance=void 0!==c?c:0;this.angle=void 0!==d?d:Math.PI/3;this.penumbra=void 0!==e?e:0;this.decay=void 0!==f?f:1;this.shadow=new Xe}function og(){ib.call(this,new ja(90,1,.5,500));this._frameExtents=new v(4,2);this._viewportCount=6;this._viewports=[new da(2, -1,1,1),new da(0,1,1,1),new da(3,1,1,1),new da(1,1,1,1),new da(3,0,1,1),new da(1,0,1,1)];this._cubeDirections=[new n(1,0,0),new n(-1,0,0),new n(0,0,1),new n(0,0,-1),new n(0,1,0),new n(0,-1,0)];this._cubeUps=[new n(0,1,0),new n(0,1,0),new n(0,1,0),new n(0,1,0),new n(0,0,1),new n(0,0,-1)]}function Ze(a,b,c,d){ba.call(this,a,b);this.type="PointLight";Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(a){this.intensity=a/(4*Math.PI)}});this.distance=void 0!== -c?c:0;this.decay=void 0!==d?d:1;this.shadow=new og}function oe(a,b,c,d,e,f){bb.call(this);this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=void 0!==a?a:-1;this.right=void 0!==b?b:1;this.top=void 0!==c?c:1;this.bottom=void 0!==d?d:-1;this.near=void 0!==e?e:.1;this.far=void 0!==f?f:2E3;this.updateProjectionMatrix()}function $e(){ib.call(this,new oe(-5,5,5,-5,.5,500))}function af(a,b){ba.call(this,a,b);this.type="DirectionalLight";this.position.copy(A.DefaultUp);this.updateMatrix(); -this.target=new A;this.shadow=new $e}function bf(a,b){ba.call(this,a,b);this.type="AmbientLight";this.castShadow=void 0}function cf(a,b,c,d){ba.call(this,a,b);this.type="RectAreaLight";this.width=void 0!==c?c:10;this.height=void 0!==d?d:10}function df(a){Z.call(this,a);this.textures={}}function ef(){D.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0}function ff(a,b,c,d){"number"===typeof c&&(d=c,c=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")); -L.call(this,a,b,c);this.meshPerAttribute=d||1}function gf(a){Z.call(this,a)}function hf(a){Z.call(this,a)}function pg(a){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");"undefined"===typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported.");Z.call(this,a);this.options=void 0}function qg(){this.type="ShapePath";this.color=new I;this.subPaths=[];this.currentPath=null}function rg(a){this.type="Font";this.data=a}function sg(a){Z.call(this, -a)}function jf(a){Z.call(this,a)}function kf(){this.coefficients=[];for(var a=0;9>a;a++)this.coefficients.push(new n)}function Xa(a,b){ba.call(this,void 0,b);this.sh=void 0!==a?a:new kf}function tg(a,b,c){Xa.call(this,void 0,c);a=(new I).set(a);c=(new I).set(b);b=new n(a.r,a.g,a.b);a=new n(c.r,c.g,c.b);c=Math.sqrt(Math.PI);var d=c*Math.sqrt(.75);this.sh.coefficients[0].copy(b).add(a).multiplyScalar(c);this.sh.coefficients[1].copy(b).sub(a).multiplyScalar(d)}function ug(a,b){Xa.call(this,void 0,b); -a=(new I).set(a);this.sh.coefficients[0].set(a.r,a.g,a.b).multiplyScalar(2*Math.sqrt(Math.PI))}function Uh(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new ja;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new ja;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1;this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function vg(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime= -0;this.running=!1}function wg(){A.call(this);this.type="AudioListener";this.context=xg.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0;this._clock=new vg}function dd(a){A.call(this);this.type="Audio";this.listener=a;this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset=this.startTime=0;this.duration=void 0;this.playbackRate= -1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function yg(a){dd.call(this,a);this.panner=this.context.createPanner();this.panner.panningModel="HRTF";this.panner.connect(this.gain)}function zg(a,b){this.analyser=a.context.createAnalyser();this.analyser.fftSize=void 0!==b?b:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function Ag(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch(b){case "quaternion":b= -this._slerp;break;case "string":case "bool":a=Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function Vh(a,b,c){c=c||ya.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function ya(a,b,c){this.path=b;this.parsedPath=c||ya.parseTrackName(b);this.node=ya.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function Wh(){this.uuid=N.generateUUID();this._objects=Array.prototype.slice.call(arguments); -this.nCachedObjects_=0;var a={};this._indicesByUUID=a;for(var b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats={objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}}function Xh(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=b.tracks;b=a.length;c=Array(b);for(var d={endingStart:2400, -endingEnd:2400},e=0;e!==b;++e){var f=a[e].createInterpolant(null);c[e]=f;f.settings=d}this._interpolantSettings=d;this._interpolants=c;this._propertyBindings=Array(b);this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null;this.loop=2201;this._loopCount=-1;this._startTime=null;this.time=0;this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtEnd= -this.zeroSlopeAtStart=!0}function Bg(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function lf(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=b);this.value=a}function Cg(a,b,c){bc.call(this,a,b);this.meshPerAttribute=c||1}function Yh(a,b,c,d){this.ray=new Rb(a,b);this.near=c||0;this.far=d||Infinity;this.camera=null;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params, -{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points.");return this.Points}}})}function Zh(a,b){return a.distance-b.distance}function Dg(a,b,c,d){if(!1!==a.visible&&(a.raycast(b,c),!0===d)){a=a.children;d=0;for(var e=a.length;dc;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.addAttribute("position",new B(b,3)); -b=new P({fog:!1});this.cone=new aa(a,b);this.add(this.cone);this.update()}function bi(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;ca?-1:0k;k++){var u=m[f[k]];var t=m[f[(k+1)%3]];d[0]=Math.min(u,t);d[1]=Math.max(u,t);u=d[0]+","+d[1];void 0===e[u]?e[u]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[u].face2=h}for(u in e)if(d=e[u],void 0===d.face2||g[d.face1].normal.dot(g[d.face2].normal)<=b)f=a[d.index1],c.push(f.x,f.y,f.z),f=a[d.index2],c.push(f.x,f.y,f.z);this.addAttribute("position",new A(c,3))}function ic(a,b,c,d, +e,f,g,h){G.call(this);this.type="CylinderGeometry";this.parameters={radiusTop:a,radiusBottom:b,height:c,radialSegments:d,heightSegments:e,openEnded:f,thetaStart:g,thetaLength:h};this.fromBufferGeometry(new qb(a,b,c,d,e,f,g,h));this.mergeVertices()}function qb(a,b,c,d,e,f,g,h){function l(c){var e,f=new w,l=new n,p=0,v=!0===c?a:b,x=!0===c?1:-1;var A=q;for(e=1;e<=d;e++)u.push(0,y*x,0),t.push(0,x,0),r.push(.5,.5),q++;var C=q;for(e=0;e<=d;e++){var D=e/d*h+g,E=Math.cos(D);D=Math.sin(D);l.x=v*D;l.y=y*x; +l.z=v*E;u.push(l.x,l.y,l.z);t.push(0,x,0);f.x=.5*E+.5;f.y=.5*D*x+.5;r.push(f.x,f.y);q++}for(e=0;ethis.duration&&this.resetDuration()}function ik(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return $c; +case "vector":case "vector2":case "vector3":case "vector4":return ad;case "color":return Qe;case "quaternion":return le;case "bool":case "boolean":return Pe;case "string":return Se}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function jk(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var b=ik(a.type);if(void 0===a.times){var c=[],d=[];ta.flattenJSON(a.keys,c,d,"value");a.times=c;a.values=d}return void 0!==b.parse?b.parse(a):new b(a.name, +a.times,a.values,a.interpolation)}function ng(a,b,c){var d=this,e=!1,f=0,g=0,h=void 0,l=[];this.onStart=void 0;this.onLoad=a;this.onProgress=b;this.onError=c;this.itemStart=function(a){g++;if(!1===e&&void 0!==d.onStart)d.onStart(a,f,g);e=!0};this.itemEnd=function(a){f++;if(void 0!==d.onProgress)d.onProgress(a,f,g);if(f===g&&(e=!1,void 0!==d.onLoad))d.onLoad()};this.itemError=function(a){if(void 0!==d.onError)d.onError(a)};this.resolveURL=function(a){return h?h(a):a};this.setURLModifier=function(a){h= +a;return this};this.addHandler=function(a,b){l.push(a,b);return this};this.removeHandler=function(a){a=l.indexOf(a);-1!==a&&l.splice(a,2);return this};this.getHandler=function(a){for(var b=0,c=l.length;ba;a++)this.coefficients.push(new n)}function Xa(a,b){da.call(this,void 0,b);this.sh=void 0!==a?a:new kf}function wg(a,b,c){Xa.call(this, +void 0,c);a=(new I).set(a);c=(new I).set(b);b=new n(a.r,a.g,a.b);a=new n(c.r,c.g,c.b);c=Math.sqrt(Math.PI);var d=c*Math.sqrt(.75);this.sh.coefficients[0].copy(b).add(a).multiplyScalar(c);this.sh.coefficients[1].copy(b).sub(a).multiplyScalar(d)}function xg(a,b){Xa.call(this,void 0,b);a=(new I).set(a);this.sh.coefficients[0].set(a.r,a.g,a.b).multiplyScalar(2*Math.sqrt(Math.PI))}function Xh(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new ja;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate= +!1;this.cameraR=new ja;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1;this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function yg(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function zg(){C.call(this);this.type="AudioListener";this.context=Ag.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0;this._clock=new yg}function dd(a){C.call(this); +this.type="Audio";this.listener=a;this.context=a.context;this.gain=this.context.createGain();this.gain.connect(a.getInput());this.autoplay=!1;this.buffer=null;this.detune=0;this.loop=!1;this.offset=this.startTime=0;this.duration=void 0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function Bg(a){dd.call(this,a);this.panner=this.context.createPanner();this.panner.panningModel="HRTF";this.panner.connect(this.gain)}function Cg(a,b){this.analyser= +a.context.createAnalyser();this.analyser.fftSize=void 0!==b?b:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);a.getOutput().connect(this.analyser)}function Dg(a,b,c){this.binding=a;this.valueSize=c;a=Float64Array;switch(b){case "quaternion":b=this._slerp;break;case "string":case "bool":a=Array;b=this._select;break;default:b=this._lerp}this.buffer=new a(4*c);this._mixBufferRegion=b;this.referenceCount=this.useCount=this.cumulativeWeight=0}function Yh(a,b,c){c=c||Aa.parseTrackName(b); +this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function Aa(a,b,c){this.path=b;this.parsedPath=c||Aa.parseTrackName(b);this.node=Aa.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function Zh(){this.uuid=N.generateUUID();this._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_=0;var a={};this._indicesByUUID=a;for(var b=0,c=arguments.length;b!==c;++b)a[arguments[b].uuid]=b;this._paths=[];this._parsedPaths=[];this._bindings=[];this._bindingsIndicesByPath={};var d=this;this.stats= +{objects:{get total(){return d._objects.length},get inUse(){return this.total-d.nCachedObjects_}},get bindingsPerObject(){return d._bindings.length}}}function $h(a,b,c){this._mixer=a;this._clip=b;this._localRoot=c||null;a=b.tracks;b=a.length;c=Array(b);for(var d={endingStart:2400,endingEnd:2400},e=0;e!==b;++e){var f=a[e].createInterpolant(null);c[e]=f;f.settings=d}this._interpolantSettings=d;this._interpolants=c;this._propertyBindings=Array(b);this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex= +this._cacheIndex=null;this.loop=2201;this._loopCount=-1;this._startTime=null;this.time=0;this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1;this.repetitions=Infinity;this.paused=!1;this.enabled=!0;this.clampWhenFinished=!1;this.zeroSlopeAtEnd=this.zeroSlopeAtStart=!0}function Eg(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function lf(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=b); +this.value=a}function Fg(a,b,c){bc.call(this,a,b);this.meshPerAttribute=c||1}function ai(a,b,c,d){this.ray=new Rb(a,b);this.near=c||0;this.far=d||Infinity;this.camera=null;this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}};Object.defineProperties(this.params,{PointCloud:{get:function(){console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points.");return this.Points}}})}function bi(a,b){return a.distance-b.distance}function Gg(a,b,c,d){if(!1!==a.visible&&(a.raycast(b, +c),!0===d)){a=a.children;d=0;for(var e=a.length;dc;c++,d++){var e=c/32*Math.PI*2,f=d/32*Math.PI*2;b.push(Math.cos(e),Math.sin(e),1,Math.cos(f),Math.sin(f),1)}a.addAttribute("position",new A(b,3));b=new U({fog:!1});this.cone=new T(a,b);this.add(this.cone);this.update()}function ei(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;ca?-1:0we;we++)ua[we]=(16>we?"0":"")+ we.toString(16);var N={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var a=4294967295*Math.random()|0,b=4294967295*Math.random()|0,c=4294967295*Math.random()|0,d=4294967295*Math.random()|0;return(ua[a&255]+ua[a>>8&255]+ua[a>>16&255]+ua[a>>24&255]+"-"+ua[b&255]+ua[b>>8&255]+"-"+ua[b>>16&15|64]+ua[b>>24&255]+"-"+ua[c&63|128]+ua[c>>8&255]+"-"+ua[c>>16&255]+ua[c>>24&255]+ua[d&255]+ua[d>>8&255]+ua[d>>16&255]+ua[d>>24&255]).toUpperCase()},clamp:function(a,b,c){return Math.max(b,Math.min(c, a))},euclideanModulo:function(a,b){return(a%b+b)%b},mapLinear:function(a,b,c,d,e){return d+(a-b)*(e-d)/(c-b)},lerp:function(a,b,c){return(1-c)*a+c*b},smoothstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*(3-2*a)},smootherstep:function(a,b,c){if(a<=b)return 0;if(a>=c)return 1;a=(a-b)/(c-b);return a*a*a*(a*(6*a-15)+10)},randInt:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},randFloat:function(a,b){return a+Math.random()*(b-a)},randFloatSpread:function(a){return a* -(.5-Math.random())},degToRad:function(a){return a*N.DEG2RAD},radToDeg:function(a){return a*N.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}};Object.defineProperties(v.prototype,{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(v.prototype, +(.5-Math.random())},degToRad:function(a){return a*N.DEG2RAD},radToDeg:function(a){return a*N.RAD2DEG},isPowerOfTwo:function(a){return 0===(a&a-1)&&0!==a},ceilPowerOfTwo:function(a){return Math.pow(2,Math.ceil(Math.log(a)/Math.LN2))},floorPowerOfTwo:function(a){return Math.pow(2,Math.floor(Math.log(a)/Math.LN2))}};Object.defineProperties(w.prototype,{width:{get:function(){return this.x},set:function(a){this.x=a}},height:{get:function(){return this.y},set:function(a){this.y=a}}});Object.assign(w.prototype, {isVector2:!0,set:function(a,b){this.x=a;this.y=b;return this},setScalar:function(a){this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x, this.y)},copy:function(a){this.x=a.x;this.y=a.y;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;return this},addScalar:function(a){this.x+=a;this.y+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(a,b);this.x-=a.x;this.y-=a.y;return this},subScalar:function(a){this.x-=a;this.y-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this},multiply:function(a){this.x*=a.x;this.y*=a.y;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;return this},divide:function(a){this.x/=a.x;this.y/=a.y;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},applyMatrix3:function(a){var b=this.x,c=this.y;a=a.elements;this.x=a[0]*b+a[3]*c+a[6];this.y= @@ -341,7 +348,7 @@ a[1]*b+a[4]*c+a[7];return this},min:function(a){this.x=Math.min(this.x,a.x);this a.x+this.y*a.y},cross:function(a){return this.x*a.y-this.y*a.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var a=Math.atan2(this.y,this.x);0>a&&(a+=2*Math.PI);return a},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))},distanceToSquared:function(a){var b= this.x-a.x;a=this.y-a.y;return b*b+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];return this},toArray:function(a, b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);return this},rotateAround:function(a,b){var c=Math.cos(b);b=Math.sin(b);var d=this.x-a.x,e=this.y-a.y;this.x=d*c-e*b+a.x;this.y=d*b+e*c+a.y;return this}});Object.assign(sa,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,d)},slerpFlat:function(a,b,c,d,e,f,g){var h= -c[d+0],l=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var k=e[f+1],n=e[f+2];e=e[f+3];if(c!==e||h!==d||l!==k||m!==n){f=1-g;var q=h*d+l*k+m*n+c*e,r=0<=q?1:-1,t=1-q*q;t>Number.EPSILON&&(t=Math.sqrt(t),q=Math.atan2(t,q*r),f=Math.sin(f*q)/t,g=Math.sin(g*q)/t);r*=g;h=h*f+d*r;l=l*f+k*r;m=m*f+n*r;c=c*f+e*r;f===1-g&&(g=1/Math.sqrt(h*h+l*l+m*m+c*c),h*=g,l*=g,m*=g,c*=g)}a[b]=h;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(sa.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this._onChangeCallback()}}, +c[d+0],l=c[d+1],m=c[d+2];c=c[d+3];d=e[f+0];var k=e[f+1],u=e[f+2];e=e[f+3];if(c!==e||h!==d||l!==k||m!==u){f=1-g;var t=h*d+l*k+m*u+c*e,r=0<=t?1:-1,q=1-t*t;q>Number.EPSILON&&(q=Math.sqrt(q),t=Math.atan2(q,t*r),f=Math.sin(f*t)/q,g=Math.sin(g*t)/q);r*=g;h=h*f+d*r;l=l*f+k*r;m=m*f+u*r;c=c*f+e*r;f===1-g&&(g=1/Math.sqrt(h*h+l*l+m*m+c*c),h*=g,l*=g,m*=g,c*=g)}a[b]=h;a[b+1]=l;a[b+2]=m;a[b+3]=c}});Object.defineProperties(sa.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this._onChangeCallback()}}, y:{get:function(){return this._y},set:function(a){this._y=a;this._onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this._onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this._onChangeCallback()}}});Object.assign(sa.prototype,{isQuaternion:!0,set:function(a,b,c,d){this._x=a;this._y=b;this._z=c;this._w=d;this._onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(a){this._x= a.x;this._y=a.y;this._z=a.z;this._w=a.w;this._onChangeCallback();return this},setFromEuler:function(a,b){if(!a||!a.isEuler)throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var c=a._x,d=a._y,e=a._z;a=a.order;var f=Math.cos,g=Math.sin,h=f(c/2),l=f(d/2);f=f(e/2);c=g(c/2);d=g(d/2);e=g(e/2);"XYZ"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f-c*d*e):"YXZ"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f-c*l*e,this._z= h*l*e-c*d*f,this._w=h*l*f+c*d*e):"ZXY"===a?(this._x=c*l*f-h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f-c*d*e):"ZYX"===a?(this._x=c*l*f-h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f+c*d*e):"YZX"===a?(this._x=c*l*f+h*d*e,this._y=h*d*f+c*l*e,this._z=h*l*e-c*d*f,this._w=h*l*f-c*d*e):"XZY"===a&&(this._x=c*l*f-h*d*e,this._y=h*d*f-c*l*e,this._z=h*l*e+c*d*f,this._w=h*l*f+c*d*e);!1!==b&&this._onChangeCallback();return this},setFromAxisAngle:function(a,b){b/=2;var c=Math.sin(b); @@ -351,34 +358,34 @@ b){var c=this.angleTo(a);if(0===c)return this;this.slerp(a,Math.min(1,b/c));retu this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);this._onChangeCallback();return this},multiply:function(a,b){return void 0!==b?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(a,b)):this.multiplyQuaternions(this,a)},premultiply:function(a){return this.multiplyQuaternions(a,this)},multiplyQuaternions:function(a,b){var c=a._x,d=a._y,e=a._z;a=a._w; var f=b._x,g=b._y,h=b._z;b=b._w;this._x=c*b+a*f+d*h-e*g;this._y=d*b+a*g+e*f-c*h;this._z=e*b+a*h+c*g-d*f;this._w=a*b-c*f-d*g-e*h;this._onChangeCallback();return this},slerp:function(a,b){if(0===b)return this;if(1===b)return this.copy(a);var c=this._x,d=this._y,e=this._z,f=this._w,g=f*a._w+c*a._x+d*a._y+e*a._z;0>g?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,g=-g):this.copy(a);if(1<=g)return this._w=f,this._x=c,this._y=d,this._z=e,this;a=1-g*g;if(a<=Number.EPSILON)return g=1-b,this._w=g* f+b*this._w,this._x=g*c+b*this._x,this._y=g*d+b*this._y,this._z=g*e+b*this._z,this.normalize(),this._onChangeCallback(),this;a=Math.sqrt(a);var h=Math.atan2(a,g);g=Math.sin((1-b)*h)/a;b=Math.sin(b*h)/a;this._w=f*g+this._w*b;this._x=c*g+this._x*b;this._y=d*g+this._y*b;this._z=e*g+this._z*b;this._onChangeCallback();return this},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._w===this._w},fromArray:function(a,b){void 0===b&&(b=0);this._x=a[b];this._y=a[b+1];this._z=a[b+2]; -this._w=a[b+3];this._onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},_onChange:function(a){this._onChangeCallback=a;return this},_onChangeCallback:function(){}});var Ig=new n,ei=new sa;Object.assign(n.prototype,{isVector3:!0,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setScalar:function(a){this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y= +this._w=a[b+3];this._onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._w;return a},_onChange:function(a){this._onChangeCallback=a;return this},_onChangeCallback:function(){}});var Lg=new n,hi=new sa;Object.assign(n.prototype,{isVector3:!0,set:function(a,b,c){this.x=a;this.y=b;this.z=c;return this},setScalar:function(a){this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y= a;return this},setZ:function(a){this.z=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;return this}, add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;return this},addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."), this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;return this},subScalar:function(a){this.x-=a;this.y-=a;this.z-=a;return this},subVectors:function(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this},multiply:function(a,b){if(void 0!==b)return console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(a,b);this.x*=a.x;this.y*=a.y;this.z*=a.z;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*= -a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(a){a&&a.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");return this.applyQuaternion(ei.setFromEuler(a))},applyAxisAngle:function(a,b){return this.applyQuaternion(ei.setFromAxisAngle(a,b))},applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]* +a;return this},multiplyVectors:function(a,b){this.x=a.x*b.x;this.y=a.y*b.y;this.z=a.z*b.z;return this},applyEuler:function(a){a&&a.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");return this.applyQuaternion(hi.setFromEuler(a))},applyAxisAngle:function(a,b){return this.applyQuaternion(hi.setFromAxisAngle(a,b))},applyMatrix3:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[3]*c+a[6]*d;this.y=a[1]*b+a[4]*c+a[7]* d;this.z=a[2]*b+a[5]*c+a[8]*d;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;var e=1/(a[3]*b+a[7]*c+a[11]*d+a[15]);this.x=(a[0]*b+a[4]*c+a[8]*d+a[12])*e;this.y=(a[1]*b+a[5]*c+a[9]*d+a[13])*e;this.z=(a[2]*b+a[6]*c+a[10]*d+a[14])*e;return this},applyQuaternion:function(a){var b=this.x,c=this.y,d=this.z,e=a.x,f=a.y,g=a.z;a=a.w;var h=a*b+f*d-g*c,l=a*c+g*b-e*d,m=a*d+e*c-f*b;b=-e*b-f*c-g*d;this.x=h*a+b*-e+l*-g-m*-f;this.y=l*a+b*-f+m*-e-h*-g;this.z=m*a+b*-g+h*-f-l*-e;return this}, project:function(a){return this.applyMatrix4(a.matrixWorldInverse).applyMatrix4(a.projectionMatrix)},unproject:function(a){return this.applyMatrix4(a.projectionMatrixInverse).applyMatrix4(a.matrixWorld)},transformDirection:function(a){var b=this.x,c=this.y,d=this.z;a=a.elements;this.x=a[0]*b+a[4]*c+a[8]*d;this.y=a[1]*b+a[5]*c+a[9]*d;this.z=a[2]*b+a[6]*c+a[10]*d;return this.normalize()},divide:function(a){this.x/=a.x;this.y/=a.y;this.z/=a.z;return this},divideScalar:function(a){return this.multiplyScalar(1/ a)},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);this.z=Math.min(this.z,a.z);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);this.z=Math.max(this.z,a.z);return this},clamp:function(a,b){this.x=Math.max(a.x,Math.min(b.x,this.x));this.y=Math.max(a.y,Math.min(b.y,this.y));this.z=Math.max(a.z,Math.min(b.z,this.z));return this},clampScalar:function(a,b){this.x=Math.max(a,Math.min(b,this.x));this.y=Math.max(a,Math.min(b,this.y));this.z=Math.max(a, Math.min(b,this.z));return this},clampLength:function(a,b){var c=this.length();return this.divideScalar(c||1).multiplyScalar(Math.max(a,Math.min(b,c)))},floor:function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this},roundToZero:function(){this.x= 0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z*a.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+ Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z-this.z)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},cross:function(a,b){return void 0!==b?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(a,b)):this.crossVectors(this, -a)},crossVectors:function(a,b){var c=a.x,d=a.y;a=a.z;var e=b.x,f=b.y;b=b.z;this.x=d*b-a*f;this.y=a*e-c*b;this.z=c*f-d*e;return this},projectOnVector:function(a){var b=a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(b)},projectOnPlane:function(a){Ig.copy(this).projectOnVector(a);return this.sub(Ig)},reflect:function(a){return this.sub(Ig.copy(a).multiplyScalar(2*this.dot(a)))},angleTo:function(a){a=this.dot(a)/Math.sqrt(this.lengthSq()*a.lengthSq());return Math.acos(N.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))}, +a)},crossVectors:function(a,b){var c=a.x,d=a.y;a=a.z;var e=b.x,f=b.y;b=b.z;this.x=d*b-a*f;this.y=a*e-c*b;this.z=c*f-d*e;return this},projectOnVector:function(a){var b=a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(b)},projectOnPlane:function(a){Lg.copy(this).projectOnVector(a);return this.sub(Lg)},reflect:function(a){return this.sub(Lg.copy(a).multiplyScalar(2*this.dot(a)))},angleTo:function(a){a=this.dot(a)/Math.sqrt(this.lengthSq()*a.lengthSq());return Math.acos(N.clamp(a,-1,1))},distanceTo:function(a){return Math.sqrt(this.distanceToSquared(a))}, distanceToSquared:function(a){var b=this.x-a.x,c=this.y-a.y;a=this.z-a.z;return b*b+c*c+a*a},manhattanDistanceTo:function(a){return Math.abs(this.x-a.x)+Math.abs(this.y-a.y)+Math.abs(this.z-a.z)},setFromSpherical:function(a){return this.setFromSphericalCoords(a.radius,a.phi,a.theta)},setFromSphericalCoords:function(a,b,c){var d=Math.sin(b)*a;this.x=d*Math.sin(c);this.y=Math.cos(b)*a;this.z=d*Math.cos(c);return this},setFromCylindrical:function(a){return this.setFromCylindricalCoords(a.radius,a.theta, a.y)},setFromCylindricalCoords:function(a,b,c){this.x=a*Math.sin(b);this.y=c;this.z=a*Math.cos(b);return this},setFromMatrixPosition:function(a){a=a.elements;this.x=a[12];this.y=a[13];this.z=a[14];return this},setFromMatrixScale:function(a){var b=this.setFromMatrixColumn(a,0).length(),c=this.setFromMatrixColumn(a,1).length();a=this.setFromMatrixColumn(a,2).length();this.x=b;this.y=c;this.z=a;return this},setFromMatrixColumn:function(a,b){return this.fromArray(a.elements,4*b)},equals:function(a){return a.x=== this.x&&a.y===this.y&&a.z===this.z},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute().");this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);return this}});var qc=new n;Object.assign(S.prototype,{isMatrix3:!0,set:function(a, b,c,d,e,f,g,h,l){var m=this.elements;m[0]=a;m[1]=d;m[2]=g;m[3]=b;m[4]=e;m[5]=h;m[6]=c;m[7]=f;m[8]=l;return this},identity:function(){this.set(1,0,0,0,1,0,0,0,1);return this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];return this},setFromMatrix4:function(a){a=a.elements;this.set(a[0],a[4],a[8],a[1],a[5],a[9],a[2],a[6],a[10]);return this}, -applyToBufferAttribute:function(a){for(var b=0,c=a.count;bc;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;9>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];return a}});var md,Jb={getDataURL:function(a){if("undefined"==typeof HTMLCanvasElement)return a.src;if(!(a instanceof HTMLCanvasElement)){void 0===md&&(md=document.createElementNS("http://www.w3.org/1999/xhtml", -"canvas"));md.width=a.width;md.height=a.height;var b=md.getContext("2d");a instanceof ImageData?b.putImageData(a,0,0):b.drawImage(a,0,0,a.width,a.height);a=md}return 2048a.x||1a.x?0:1;break;case 1002:a.x=1===Math.abs(Math.floor(a.x)%2)?Math.ceil(a.x)-a.x:a.x-Math.floor(a.x)}if(0>a.y||1a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y);return a}});Object.defineProperty(V.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.defineProperties(da.prototype,{width:{get:function(){return this.z},set:function(a){this.z=a}},height:{get:function(){return this.w},set:function(a){this.w=a}}});Object.assign(da.prototype,{isVector4:!0,set:function(a,b,c,d){this.x= +Math.floor(a.y);break;case 1001:a.y=0>a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y);return a}});Object.defineProperty(Z.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.defineProperties(ca.prototype,{width:{get:function(){return this.z},set:function(a){this.z=a}},height:{get:function(){return this.w},set:function(a){this.w=a}}});Object.assign(ca.prototype,{isVector4:!0,set:function(a,b,c,d){this.x= a;this.y=b;this.z=c;this.w=d;return this},setScalar:function(a){this.w=this.z=this.y=this.x=a;return this},setX:function(a){this.x=a;return this},setY:function(a){this.y=a;return this},setZ:function(a){this.z=a;return this},setW:function(a){this.w=a;return this},setComponent:function(a,b){switch(a){case 0:this.x=b;break;case 1:this.y=b;break;case 2:this.z=b;break;case 3:this.w=b;break;default:throw Error("index is out of range: "+a);}return this},getComponent:function(a){switch(a){case 0:return this.x; case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+a);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=void 0!==a.w?a.w:1;return this},add:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(a,b);this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this}, addScalar:function(a){this.x+=a;this.y+=a;this.z+=a;this.w+=a;return this},addVectors:function(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;this.w=a.w+b.w;return this},addScaledVector:function(a,b){this.x+=a.x*b;this.y+=a.y*b;this.z+=a.z*b;this.w+=a.w*b;return this},sub:function(a,b){if(void 0!==b)return console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(a,b);this.x-=a.x;this.y-=a.y;this.z-=a.z;this.w-=a.w;return this},subScalar:function(a){this.x-= @@ -390,48 +397,48 @@ this.y));this.z=Math.max(a,Math.min(b,this.z));this.w=Math.max(a,Math.min(b,this Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){this.x=-this.x;this.y=-this.y;this.z=-this.z;this.w=-this.w;return this},dot:function(a){return this.x*a.x+this.y*a.y+this.z* a.z+this.w*a.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(a){return this.normalize().multiplyScalar(a)},lerp:function(a,b){this.x+=(a.x-this.x)*b;this.y+=(a.y-this.y)*b;this.z+=(a.z- this.z)*b;this.w+=(a.w-this.w)*b;return this},lerpVectors:function(a,b,c){return this.subVectors(b,a).multiplyScalar(c).add(a)},equals:function(a){return a.x===this.x&&a.y===this.y&&a.z===this.z&&a.w===this.w},fromArray:function(a,b){void 0===b&&(b=0);this.x=a[b];this.y=a[b+1];this.z=a[b+2];this.w=a[b+3];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.x;a[b+1]=this.y;a[b+2]=this.z;a[b+3]=this.w;return a},fromBufferAttribute:function(a,b,c){void 0!==c&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."); -this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this}});Ka.prototype=Object.assign(Object.create(za.prototype),{constructor:Ka,isWebGLRenderTarget:!0,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.texture.image.width=a,this.texture.image.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport); -this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Of.prototype=Object.assign(Object.create(Ka.prototype),{constructor:Of,isWebGLMultisampleRenderTarget:!0,copy:function(a){Ka.prototype.copy.call(this,a);this.samples=a.samples;return this}});var Ja=new n,ra=new W,gk=new n(0,0,0),hk=new n(1,1,1),Kb=new n,qf=new n,ka=new n;Object.assign(W.prototype,{isMatrix4:!0, -set:function(a,b,c,d,e,f,g,h,l,m,k,n,q,r,t,z){var p=this.elements;p[0]=a;p[4]=b;p[8]=c;p[12]=d;p[1]=e;p[5]=f;p[9]=g;p[13]=h;p[2]=l;p[6]=m;p[10]=k;p[14]=n;p[3]=q;p[7]=r;p[11]=t;p[15]=z;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new W).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11]; -b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return this},copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){a.setFromMatrixColumn(this,0);b.setFromMatrixColumn(this,1);c.setFromMatrixColumn(this,2);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(a){var b=this.elements,c=a.elements,d=1/Ja.setFromMatrixColumn(a,0).length(), -e=1/Ja.setFromMatrixColumn(a,1).length();a=1/Ja.setFromMatrixColumn(a,2).length();b[0]=c[0]*d;b[1]=c[1]*d;b[2]=c[2]*d;b[3]=0;b[4]=c[4]*e;b[5]=c[5]*e;b[6]=c[6]*e;b[7]=0;b[8]=c[8]*a;b[9]=c[9]*a;b[10]=c[10]*a;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromEuler:function(a){a&&a.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c);c=Math.sin(c);var g=Math.cos(d); +this.x=a.getX(b);this.y=a.getY(b);this.z=a.getZ(b);this.w=a.getW(b);return this}});ka.prototype=Object.assign(Object.create(Ba.prototype),{constructor:ka,isWebGLRenderTarget:!0,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.texture.image.width=a,this.texture.image.height=b,this.dispose();this.viewport.set(0,0,a,b);this.scissor.set(0,0,a,b)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.width=a.width;this.height=a.height;this.viewport.copy(a.viewport); +this.texture=a.texture.clone();this.depthBuffer=a.depthBuffer;this.stencilBuffer=a.stencilBuffer;this.depthTexture=a.depthTexture;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Of.prototype=Object.assign(Object.create(ka.prototype),{constructor:Of,isWebGLMultisampleRenderTarget:!0,copy:function(a){ka.prototype.copy.call(this,a);this.samples=a.samples;return this}});var Ka=new n,ra=new M,kk=new n(0,0,0),lk=new n(1,1,1),Kb=new n,qf=new n,oa=new n;Object.assign(M.prototype,{isMatrix4:!0, +set:function(a,b,c,d,e,f,g,h,l,m,k,u,t,r,q,n){var p=this.elements;p[0]=a;p[4]=b;p[8]=c;p[12]=d;p[1]=e;p[5]=f;p[9]=g;p[13]=h;p[2]=l;p[6]=m;p[10]=k;p[14]=u;p[3]=t;p[7]=r;p[11]=q;p[15]=n;return this},identity:function(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this},clone:function(){return(new M).fromArray(this.elements)},copy:function(a){var b=this.elements;a=a.elements;b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[5]=a[5];b[6]=a[6];b[7]=a[7];b[8]=a[8];b[9]=a[9];b[10]=a[10];b[11]=a[11]; +b[12]=a[12];b[13]=a[13];b[14]=a[14];b[15]=a[15];return this},copyPosition:function(a){var b=this.elements;a=a.elements;b[12]=a[12];b[13]=a[13];b[14]=a[14];return this},extractBasis:function(a,b,c){a.setFromMatrixColumn(this,0);b.setFromMatrixColumn(this,1);c.setFromMatrixColumn(this,2);return this},makeBasis:function(a,b,c){this.set(a.x,b.x,c.x,0,a.y,b.y,c.y,0,a.z,b.z,c.z,0,0,0,0,1);return this},extractRotation:function(a){var b=this.elements,c=a.elements,d=1/Ka.setFromMatrixColumn(a,0).length(), +e=1/Ka.setFromMatrixColumn(a,1).length();a=1/Ka.setFromMatrixColumn(a,2).length();b[0]=c[0]*d;b[1]=c[1]*d;b[2]=c[2]*d;b[3]=0;b[4]=c[4]*e;b[5]=c[5]*e;b[6]=c[6]*e;b[7]=0;b[8]=c[8]*a;b[9]=c[9]*a;b[10]=c[10]*a;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},makeRotationFromEuler:function(a){a&&a.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var b=this.elements,c=a.x,d=a.y,e=a.z,f=Math.cos(c);c=Math.sin(c);var g=Math.cos(d); d=Math.sin(d);var h=Math.cos(e);e=Math.sin(e);if("XYZ"===a.order){a=f*h;var l=f*e,m=c*h,k=c*e;b[0]=g*h;b[4]=-g*e;b[8]=d;b[1]=l+m*d;b[5]=a-k*d;b[9]=-c*g;b[2]=k-a*d;b[6]=m+l*d;b[10]=f*g}else"YXZ"===a.order?(a=g*h,l=g*e,m=d*h,k=d*e,b[0]=a+k*c,b[4]=m*c-l,b[8]=f*d,b[1]=f*e,b[5]=f*h,b[9]=-c,b[2]=l*c-m,b[6]=k+a*c,b[10]=f*g):"ZXY"===a.order?(a=g*h,l=g*e,m=d*h,k=d*e,b[0]=a-k*c,b[4]=-f*e,b[8]=m+l*c,b[1]=l+m*c,b[5]=f*h,b[9]=k-a*c,b[2]=-f*d,b[6]=c,b[10]=f*g):"ZYX"===a.order?(a=f*h,l=f*e,m=c*h,k=c*e,b[0]=g*h, -b[4]=m*d-l,b[8]=a*d+k,b[1]=g*e,b[5]=k*d+a,b[9]=l*d-m,b[2]=-d,b[6]=c*g,b[10]=f*g):"YZX"===a.order?(a=f*g,l=f*d,m=c*g,k=c*d,b[0]=g*h,b[4]=k-a*e,b[8]=m*e+l,b[1]=e,b[5]=f*h,b[9]=-c*h,b[2]=-d*h,b[6]=l*e+m,b[10]=a-k*e):"XZY"===a.order&&(a=f*g,l=f*d,m=c*g,k=c*d,b[0]=g*h,b[4]=-e,b[8]=d*h,b[1]=a*e+k,b[5]=f*h,b[9]=l*e-m,b[2]=m*e-l,b[6]=c*h,b[10]=k*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},makeRotationFromQuaternion:function(a){return this.compose(gk,a,hk)},lookAt:function(a,b, -c){var d=this.elements;ka.subVectors(a,b);0===ka.lengthSq()&&(ka.z=1);ka.normalize();Kb.crossVectors(c,ka);0===Kb.lengthSq()&&(1===Math.abs(c.z)?ka.x+=1E-4:ka.z+=1E-4,ka.normalize(),Kb.crossVectors(c,ka));Kb.normalize();qf.crossVectors(ka,Kb);d[0]=Kb.x;d[4]=qf.x;d[8]=ka.x;d[1]=Kb.y;d[5]=qf.y;d[9]=ka.y;d[2]=Kb.z;d[6]=qf.z;d[10]=ka.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)},premultiply:function(a){return this.multiplyMatrices(a,this)},multiplyMatrices:function(a,b){var c=a.elements,d=b.elements;b=this.elements;a=c[0];var e=c[4],f=c[8],g=c[12],h=c[1],l=c[5],m=c[9],k=c[13],n=c[2],q=c[6],r=c[10],t=c[14],z=c[3],w=c[7],y=c[11];c=c[15];var x=d[0],v=d[4],B=d[8],E=d[12],A=d[1],D=d[5],C=d[9],F=d[13],H=d[2],G=d[6],I=d[10],L=d[14],M=d[3],N=d[7],O=d[11];d=d[15];b[0]=a*x+e*A+f*H+g*M;b[4]=a*v+e*D+f*G+g*N;b[8]=a*B+e*C+f*I+ -g*O;b[12]=a*E+e*F+f*L+g*d;b[1]=h*x+l*A+m*H+k*M;b[5]=h*v+l*D+m*G+k*N;b[9]=h*B+l*C+m*I+k*O;b[13]=h*E+l*F+m*L+k*d;b[2]=n*x+q*A+r*H+t*M;b[6]=n*v+q*D+r*G+t*N;b[10]=n*B+q*C+r*I+t*O;b[14]=n*E+q*F+r*L+t*d;b[3]=z*x+w*A+y*H+c*M;b[7]=z*v+w*D+y*G+c*N;b[11]=z*B+w*C+y*I+c*O;b[15]=z*E+w*F+y*L+c*d;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},applyToBufferAttribute:function(a){for(var b= -0,c=a.count;bthis.determinant()&&(e=-e);a.x=d[12];a.y=d[13];a.z=d[14];ra.copy(this);a=1/e;d=1/f;var h=1/g;ra.elements[0]*=a;ra.elements[1]*=a;ra.elements[2]*=a;ra.elements[4]*=d;ra.elements[5]*=d;ra.elements[6]*=d;ra.elements[8]*=h;ra.elements[9]*=h;ra.elements[10]*=h;b.setFromRotationMatrix(ra);c.x=e;c.y=f;c.z=g;return this},makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); +b,c){this.set(1,b,c,0,a,1,c,0,a,b,1,0,0,0,0,1);return this},compose:function(a,b,c){var d=this.elements,e=b._x,f=b._y,g=b._z,h=b._w,l=e+e,m=f+f,k=g+g;b=e*l;var n=e*m;e*=k;var t=f*m;f*=k;g*=k;l*=h;m*=h;h*=k;k=c.x;var r=c.y;c=c.z;d[0]=(1-(t+g))*k;d[1]=(n+h)*k;d[2]=(e-m)*k;d[3]=0;d[4]=(n-h)*r;d[5]=(1-(b+g))*r;d[6]=(f+l)*r;d[7]=0;d[8]=(e+m)*c;d[9]=(f-l)*c;d[10]=(1-(b+t))*c;d[11]=0;d[12]=a.x;d[13]=a.y;d[14]=a.z;d[15]=1;return this},decompose:function(a,b,c){var d=this.elements,e=Ka.set(d[0],d[1],d[2]).length(), +f=Ka.set(d[4],d[5],d[6]).length(),g=Ka.set(d[8],d[9],d[10]).length();0>this.determinant()&&(e=-e);a.x=d[12];a.y=d[13];a.z=d[14];ra.copy(this);a=1/e;d=1/f;var h=1/g;ra.elements[0]*=a;ra.elements[1]*=a;ra.elements[2]*=a;ra.elements[4]*=d;ra.elements[5]*=d;ra.elements[6]*=d;ra.elements[8]*=h;ra.elements[9]*=h;ra.elements[10]*=h;b.setFromRotationMatrix(ra);c.x=e;c.y=f;c.z=g;return this},makePerspective:function(a,b,c,d,e,f){void 0===f&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs."); var g=this.elements;g[0]=2*e/(b-a);g[4]=0;g[8]=(b+a)/(b-a);g[12]=0;g[1]=0;g[5]=2*e/(c-d);g[9]=(c+d)/(c-d);g[13]=0;g[2]=0;g[6]=0;g[10]=-(f+e)/(f-e);g[14]=-2*f*e/(f-e);g[3]=0;g[7]=0;g[11]=-1;g[15]=0;return this},makeOrthographic:function(a,b,c,d,e,f){var g=this.elements,h=1/(b-a),l=1/(c-d),m=1/(f-e);g[0]=2*h;g[4]=0;g[8]=0;g[12]=-((b+a)*h);g[1]=0;g[5]=2*l;g[9]=0;g[13]=-((c+d)*l);g[2]=0;g[6]=0;g[10]=-2*m;g[14]=-((f+e)*m);g[3]=0;g[7]=0;g[11]=0;g[15]=1;return this},equals:function(a){var b=this.elements; -a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}});var fi=new W,gi=new sa;Pb.RotationOrders= +a=a.elements;for(var c=0;16>c;c++)if(b[c]!==a[c])return!1;return!0},fromArray:function(a,b){void 0===b&&(b=0);for(var c=0;16>c;c++)this.elements[c]=a[c+b];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);var c=this.elements;a[b]=c[0];a[b+1]=c[1];a[b+2]=c[2];a[b+3]=c[3];a[b+4]=c[4];a[b+5]=c[5];a[b+6]=c[6];a[b+7]=c[7];a[b+8]=c[8];a[b+9]=c[9];a[b+10]=c[10];a[b+11]=c[11];a[b+12]=c[12];a[b+13]=c[13];a[b+14]=c[14];a[b+15]=c[15];return a}});var ii=new M,ji=new sa;Pb.RotationOrders= "XYZ YZX ZXY XZY YXZ ZYX".split(" ");Pb.DefaultOrder="XYZ";Object.defineProperties(Pb.prototype,{x:{get:function(){return this._x},set:function(a){this._x=a;this._onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this._onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this._onChangeCallback()}},order:{get:function(){return this._order},set:function(a){this._order=a;this._onChangeCallback()}}});Object.assign(Pb.prototype,{isEuler:!0,set:function(a, b,c,d){this._x=a;this._y=b;this._z=c;this._order=d||this._order;this._onChangeCallback();return this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(a){this._x=a._x;this._y=a._y;this._z=a._z;this._order=a._order;this._onChangeCallback();return this},setFromRotationMatrix:function(a,b,c){var d=N.clamp,e=a.elements;a=e[0];var f=e[4],g=e[8],h=e[1],l=e[5],m=e[9],k=e[2],n=e[6];e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(g,-1,1)),.9999999>Math.abs(g)? (this._x=Math.atan2(-m,e),this._z=Math.atan2(-f,a)):(this._x=Math.atan2(n,l),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(m,-1,1)),.9999999>Math.abs(m)?(this._y=Math.atan2(g,e),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-k,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(n,-1,1)),.9999999>Math.abs(n)?(this._y=Math.atan2(-k,e),this._z=Math.atan2(-f,l)):(this._y=0,this._z=Math.atan2(h,a))):"ZYX"===b?(this._y=Math.asin(-d(k,-1,1)),.9999999>Math.abs(k)?(this._x=Math.atan2(n,e),this._z=Math.atan2(h,a)): (this._x=0,this._z=Math.atan2(-f,l))):"YZX"===b?(this._z=Math.asin(d(h,-1,1)),.9999999>Math.abs(h)?(this._x=Math.atan2(-m,l),this._y=Math.atan2(-k,a)):(this._x=0,this._y=Math.atan2(g,e))):"XZY"===b?(this._z=Math.asin(-d(f,-1,1)),.9999999>Math.abs(f)?(this._x=Math.atan2(n,l),this._y=Math.atan2(g,a)):(this._x=Math.atan2(-m,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;!1!==c&&this._onChangeCallback();return this},setFromQuaternion:function(a, -b,c){fi.makeRotationFromQuaternion(a);return this.setFromRotationMatrix(fi,b,c)},setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(a){gi.setFromEuler(this);return this.setFromQuaternion(gi,a)},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this._onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a= +b,c){ii.makeRotationFromQuaternion(a);return this.setFromRotationMatrix(ii,b,c)},setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(a){ji.setFromEuler(this);return this.setFromQuaternion(ji,a)},equals:function(a){return a._x===this._x&&a._y===this._y&&a._z===this._z&&a._order===this._order},fromArray:function(a){this._x=a[0];this._y=a[1];this._z=a[2];void 0!==a[3]&&(this._order=a[3]);this._onChangeCallback();return this},toArray:function(a,b){void 0===a&&(a= []);void 0===b&&(b=0);a[b]=this._x;a[b+1]=this._y;a[b+2]=this._z;a[b+3]=this._order;return a},toVector3:function(a){return a?a.set(this._x,this._y,this._z):new n(this._x,this._y,this._z)},_onChange:function(a){this._onChangeCallback=a;return this},_onChangeCallback:function(){}});Object.assign(Pf.prototype,{set:function(a){this.mask=1<e&&(e=m);k>f&&(f=k);n>g&&(g=n)}this.min.set(b,c,d); this.max.set(e,f,g);return this},setFromBufferAttribute:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=-Infinity,h=0,l=a.count;he&&(e=m);k>f&&(f=k);n>g&&(g=n)}this.min.set(b,c,d);this.max.set(e,f,g);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b= +a.max.equals(this.max)}});var qk=new ab;Object.assign(nb.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(a,b){var c=this.center;void 0!==b?c.copy(b):qk.setFromPoints(a).getCenter(c);for(var d=b=0,e=a.length;d= this.radius},containsPoint:function(a){return a.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(a){return a.distanceTo(this.center)-this.radius},intersectsSphere:function(a){var b=this.radius+a.radius;return a.center.distanceToSquared(this.center)<=b*b},intersectsBox:function(a){return a.intersectsSphere(this)},intersectsPlane:function(a){return Math.abs(a.distanceToPoint(this.center))<=this.radius},clampPoint:function(a,b){var c=this.center.distanceToSquared(a); void 0===b&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),b=new n);b.copy(a);c>this.radius*this.radius&&(b.sub(this.center).normalize(),b.multiplyScalar(this.radius).add(this.center));return b},getBoundingBox:function(a){void 0===a&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),a=new ab);a.set(this.center,this.center);a.expandByScalar(this.radius);return a},applyMatrix4:function(a){this.center.applyMatrix4(a);this.radius*=a.getMaxScaleOnAxis();return this}, -translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius}});var wb=new n,Jg=new n,uf=new n,Nb=new n,Kg=new n,vf=new n,Lg=new n;Object.assign(Rb.prototype,{set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){void 0===b&&(console.warn("THREE.Ray: .at() target is now required"), +translate:function(a){this.center.add(a);return this},equals:function(a){return a.center.equals(this.center)&&a.radius===this.radius}});var wb=new n,Mg=new n,uf=new n,Nb=new n,Ng=new n,vf=new n,Og=new n;Object.assign(Rb.prototype,{set:function(a,b){this.origin.copy(a);this.direction.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.origin.copy(a.origin);this.direction.copy(a.direction);return this},at:function(a,b){void 0===b&&(console.warn("THREE.Ray: .at() target is now required"), b=new n);return b.copy(this.direction).multiplyScalar(a).add(this.origin)},lookAt:function(a){this.direction.copy(a).sub(this.origin).normalize();return this},recast:function(a){this.origin.copy(this.at(a,wb));return this},closestPointToPoint:function(a,b){void 0===b&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),b=new n);b.subVectors(a,this.origin);a=b.dot(this.direction);return 0>a?b.copy(this.origin):b.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(a){return Math.sqrt(this.distanceSqToPoint(a))}, -distanceSqToPoint:function(a){var b=wb.subVectors(a,this.origin).dot(this.direction);if(0>b)return this.origin.distanceToSquared(a);wb.copy(this.direction).multiplyScalar(b).add(this.origin);return wb.distanceToSquared(a)},distanceSqToSegment:function(a,b,c,d){Jg.copy(a).add(b).multiplyScalar(.5);uf.copy(b).sub(a).normalize();Nb.copy(this.origin).sub(Jg);var e=.5*a.distanceTo(b),f=-this.direction.dot(uf),g=Nb.dot(this.direction),h=-Nb.dot(uf),l=Nb.lengthSq(),m=Math.abs(1-f*f);if(0b)return this.origin.distanceToSquared(a);wb.copy(this.direction).multiplyScalar(b).add(this.origin);return wb.distanceToSquared(a)},distanceSqToSegment:function(a,b,c,d){Mg.copy(a).add(b).multiplyScalar(.5);uf.copy(b).sub(a).normalize();Nb.copy(this.origin).sub(Mg);var e=.5*a.distanceTo(b),f=-this.direction.dot(uf),g=Nb.dot(this.direction),h=-Nb.dot(uf),l=Nb.lengthSq(),m=Math.abs(1-f*f);if(0=-k?b<=k?(e=1/m,a*=e,b*=e,f=a*(a+f*b+2*g)+b*(f*a+b+2*h)+l):(b=e,a=Math.max(0,-(f*b+g)),f=-a*a+b*(b+2*h)+l):(b=-e,a=Math.max(0,-(f*b+g)),f=-a*a+b*(b+2*h)+l):b<=-k?(a=Math.max(0,-(-f*e+g)),b=0a)return null;a=Math.sqrt(a-d);d=c-a;c+=a;return 0>d&&0>c?null:0>d?this.at(c,b):this.at(d,b)},intersectsSphere:function(a){return this.distanceSqToPoint(a.center)<=a.radius*a.radius},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+ +d&&d.copy(uf).multiplyScalar(b).add(Mg);return f},intersectSphere:function(a,b){wb.subVectors(a.center,this.origin);var c=wb.dot(this.direction),d=wb.dot(wb)-c*c;a=a.radius*a.radius;if(d>a)return null;a=Math.sqrt(a-d);d=c-a;c+=a;return 0>d&&0>c?null:0>d?this.at(c,b):this.at(d,b)},intersectsSphere:function(a){return this.distanceSqToPoint(a.center)<=a.radius*a.radius},distanceToPlane:function(a){var b=a.normal.dot(this.direction);if(0===b)return 0===a.distanceToPoint(this.origin)?0:null;a=-(this.origin.dot(a.normal)+ a.constant)/b;return 0<=a?a:null},intersectPlane:function(a,b){a=this.distanceToPlane(a);return null===a?null:this.at(a,b)},intersectsPlane:function(a){var b=a.distanceToPoint(this.origin);return 0===b||0>a.normal.dot(this.direction)*b?!0:!1},intersectBox:function(a,b){var c=1/this.direction.x;var d=1/this.direction.y;var e=1/this.direction.z,f=this.origin;if(0<=c){var g=(a.min.x-f.x)*c;c*=a.max.x-f.x}else g=(a.max.x-f.x)*c,c*=a.min.x-f.x;if(0<=d){var h=(a.min.y-f.y)*d;d*=a.max.y-f.y}else h=(a.max.y- -f.y)*d,d*=a.min.y-f.y;if(g>d||h>c)return null;if(h>g||g!==g)g=h;if(da||h>c)return null;if(h>g||g!==g)g=h;if(ac?null:this.at(0<=g?g:c,b)},intersectsBox:function(a){return null!==this.intersectBox(a,wb)},intersectTriangle:function(a,b,c,d,e){Kg.subVectors(b,a);vf.subVectors(c,a);Lg.crossVectors(Kg,vf);b=this.direction.dot(Lg);if(0b)d=-1,b=-b;else return null; -Nb.subVectors(this.origin,a);a=d*this.direction.dot(vf.crossVectors(Nb,vf));if(0>a)return null;c=d*this.direction.dot(Kg.cross(Nb));if(0>c||a+c>b)return null;a=-d*Nb.dot(Lg);return 0>a?null:this.at(a/b,e)},applyMatrix4:function(a){this.origin.applyMatrix4(a);this.direction.transformDirection(a);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}});var Ya=new n,xb=new n,Mg=new n,yb=new n,rd=new n,sd=new n,li=new n,Ng=new n,Og=new n,Pg=new n;Object.assign(ca, -{getNormal:function(a,b,c,d){void 0===d&&(console.warn("THREE.Triangle: .getNormal() target is now required"),d=new n);d.subVectors(c,b);Ya.subVectors(a,b);d.cross(Ya);a=d.lengthSq();return 0=yb.x+yb.y},getUV:function(a,b,c,d,e,f,g,h){this.getBarycoord(a,b,c,d,yb);h.set(0,0);h.addScaledVector(e,yb.x);h.addScaledVector(f,yb.y);h.addScaledVector(g,yb.z);return h},isFrontFacing:function(a,b,c,d){Ya.subVectors(c,b);xb.subVectors(a,b);return 0>Ya.cross(xb).dot(d)?!0:!1}});Object.assign(ca.prototype,{set:function(a, +f.y)*d,d*=a.min.y-f.y;if(g>d||h>c)return null;if(h>g||g!==g)g=h;if(da||h>c)return null;if(h>g||g!==g)g=h;if(ac?null:this.at(0<=g?g:c,b)},intersectsBox:function(a){return null!==this.intersectBox(a,wb)},intersectTriangle:function(a,b,c,d,e){Ng.subVectors(b,a);vf.subVectors(c,a);Og.crossVectors(Ng,vf);b=this.direction.dot(Og);if(0b)d=-1,b=-b;else return null; +Nb.subVectors(this.origin,a);a=d*this.direction.dot(vf.crossVectors(Nb,vf));if(0>a)return null;c=d*this.direction.dot(Ng.cross(Nb));if(0>c||a+c>b)return null;a=-d*Nb.dot(Og);return 0>a?null:this.at(a/b,e)},applyMatrix4:function(a){this.origin.applyMatrix4(a);this.direction.transformDirection(a);return this},equals:function(a){return a.origin.equals(this.origin)&&a.direction.equals(this.direction)}});var Ya=new n,xb=new n,Pg=new n,yb=new n,rd=new n,sd=new n,oi=new n,Qg=new n,Rg=new n,Sg=new n;Object.assign(aa, +{getNormal:function(a,b,c,d){void 0===d&&(console.warn("THREE.Triangle: .getNormal() target is now required"),d=new n);d.subVectors(c,b);Ya.subVectors(a,b);d.cross(Ya);a=d.lengthSq();return 0=yb.x+yb.y},getUV:function(a,b,c,d,e,f,g,h){this.getBarycoord(a,b,c,d,yb);h.set(0,0);h.addScaledVector(e,yb.x);h.addScaledVector(f,yb.y);h.addScaledVector(g,yb.z);return h},isFrontFacing:function(a,b,c,d){Ya.subVectors(c,b);xb.subVectors(a,b);return 0>Ya.cross(xb).dot(d)?!0:!1}});Object.assign(aa.prototype,{set:function(a, b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this},setFromPointsAndIndices:function(a,b,c,d){this.a.copy(a[b]);this.b.copy(a[c]);this.c.copy(a[d]);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a.copy(a.a);this.b.copy(a.b);this.c.copy(a.c);return this},getArea:function(){Ya.subVectors(this.c,this.b);xb.subVectors(this.a,this.b);return.5*Ya.cross(xb).length()},getMidpoint:function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"), -a=new n);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return ca.getNormal(this.a,this.b,this.c,a)},getPlane:function(a){void 0===a&&(console.warn("THREE.Triangle: .getPlane() target is now required"),a=new n);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,b){return ca.getBarycoord(a,this.a,this.b,this.c,b)},getUV:function(a,b,c,d,e){return ca.getUV(a,this.a,this.b,this.c,b,c,d,e)},containsPoint:function(a){return ca.containsPoint(a, -this.a,this.b,this.c)},isFrontFacing:function(a){return ca.isFrontFacing(this.a,this.b,this.c,a)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(a,b){void 0===b&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),b=new n);var c=this.a,d=this.b,e=this.c;rd.subVectors(d,c);sd.subVectors(e,c);Ng.subVectors(a,c);var f=rd.dot(Ng),g=sd.dot(Ng);if(0>=f&&0>=g)return b.copy(c);Og.subVectors(a,d);var h=rd.dot(Og),l=sd.dot(Og);if(0<=h&&l<= -h)return b.copy(d);var m=f*l-h*g;if(0>=m&&0<=f&&0>=h)return d=f/(f-h),b.copy(c).addScaledVector(rd,d);Pg.subVectors(a,e);a=rd.dot(Pg);var k=sd.dot(Pg);if(0<=k&&a<=k)return b.copy(e);f=a*g-f*k;if(0>=f&&0<=g&&0>=k)return m=g/(g-k),b.copy(c).addScaledVector(sd,m);g=h*k-a*l;if(0>=g&&0<=l-h&&0<=a-k)return li.subVectors(e,d),m=(l-h)/(l-h+(a-k)),b.copy(d).addScaledVector(li,m);e=1/(g+f+m);d=f*e;m*=e;return b.copy(c).addScaledVector(rd,d).addScaledVector(sd,m)},equals:function(a){return a.a.equals(this.a)&& -a.b.equals(this.b)&&a.c.equals(this.c)}});var nk={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017, +a=new n);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return aa.getNormal(this.a,this.b,this.c,a)},getPlane:function(a){void 0===a&&(console.warn("THREE.Triangle: .getPlane() target is now required"),a=new n);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,b){return aa.getBarycoord(a,this.a,this.b,this.c,b)},getUV:function(a,b,c,d,e){return aa.getUV(a,this.a,this.b,this.c,b,c,d,e)},containsPoint:function(a){return aa.containsPoint(a, +this.a,this.b,this.c)},isFrontFacing:function(a){return aa.isFrontFacing(this.a,this.b,this.c,a)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(a,b){void 0===b&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),b=new n);var c=this.a,d=this.b,e=this.c;rd.subVectors(d,c);sd.subVectors(e,c);Qg.subVectors(a,c);var f=rd.dot(Qg),g=sd.dot(Qg);if(0>=f&&0>=g)return b.copy(c);Rg.subVectors(a,d);var h=rd.dot(Rg),l=sd.dot(Rg);if(0<=h&&l<= +h)return b.copy(d);var m=f*l-h*g;if(0>=m&&0<=f&&0>=h)return d=f/(f-h),b.copy(c).addScaledVector(rd,d);Sg.subVectors(a,e);a=rd.dot(Sg);var k=sd.dot(Sg);if(0<=k&&a<=k)return b.copy(e);f=a*g-f*k;if(0>=f&&0<=g&&0>=k)return m=g/(g-k),b.copy(c).addScaledVector(sd,m);g=h*k-a*l;if(0>=g&&0<=l-h&&0<=a-k)return oi.subVectors(e,d),m=(l-h)/(l-h+(a-k)),b.copy(d).addScaledVector(oi,m);e=1/(g+f+m);d=f*e;m*=e;return b.copy(c).addScaledVector(rd,d).addScaledVector(sd,m)},equals:function(a){return a.a.equals(this.a)&& +a.b.equals(this.b)&&a.c.equals(this.c)}});var rk={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017, darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504, green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734, lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734, palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407, -steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ea={h:0,s:0,l:0},wf={h:0,s:0,l:0};Object.assign(I.prototype,{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a); +steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Fa={h:0,s:0,l:0},wf={h:0,s:0,l:0};Object.assign(I.prototype,{isColor:!0,r:1,g:1,b:1,set:function(a){a&&a.isColor?this.copy(a):"number"===typeof a?this.setHex(a):"string"===typeof a&&this.setStyle(a);return this},setScalar:function(a){this.b=this.g=this.r=a;return this},setHex:function(a){a=Math.floor(a); this.r=(a>>16&255)/255;this.g=(a>>8&255)/255;this.b=(a&255)/255;return this},setRGB:function(a,b,c){this.r=a;this.g=b;this.b=c;return this},setHSL:function(a,b,c){a=N.euclideanModulo(a,1);b=N.clamp(b,0,1);c=N.clamp(c,0,1);0===b?this.r=this.g=this.b=c:(b=.5>=c?c*(1+b):c+b-c*b,c=2*c-b,this.r=Rf(c,b,a+1/3),this.g=Rf(c,b,a),this.b=Rf(c,b,a-1/3));return this},setStyle:function(a){function b(b){void 0!==b&&1>parseFloat(b)&&console.warn("THREE.Color: Alpha component of "+a+" will be ignored.")}var c;if(c= /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(a)){var d=c[2];switch(c[1]){case "rgb":case "rgba":if(c=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(255,parseInt(c[1],10))/255,this.g=Math.min(255,parseInt(c[2],10))/255,this.b=Math.min(255,parseInt(c[3],10))/255,b(c[5]),this;if(c=/^(\d+)%\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d))return this.r=Math.min(100,parseInt(c[1],10))/100,this.g=Math.min(100,parseInt(c[2],10))/100,this.b=Math.min(100, parseInt(c[3],10))/100,b(c[5]),this;break;case "hsl":case "hsla":if(c=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(d)){d=parseFloat(c[1])/360;var e=parseInt(c[2],10)/100,f=parseInt(c[3],10)/100;b(c[5]);return this.setHSL(d,e,f)}}}else if(c=/^#([A-Fa-f0-9]+)$/.exec(a)){c=c[1];d=c.length;if(3===d)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===d)return this.r= -parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}a&&0=h?l/(e+f):l/(2-e-f);switch(e){case b:g=(c- -d)/l+(cthis.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthFunc=this.depthFunc;d.depthTest=this.depthTest;d.depthWrite=this.depthWrite;d.stencilWrite=this.stencilWrite;d.stencilFunc= -this.stencilFunc;d.stencilRef=this.stencilRef;d.stencilMask=this.stencilMask;d.stencilFail=this.stencilFail;d.stencilZFail=this.stencilZFail;d.stencilZPass=this.stencilZPass;this.rotation&&0!==this.rotation&&(d.rotation=this.rotation);!0===this.polygonOffset&&(d.polygonOffset=!0);0!==this.polygonOffsetFactor&&(d.polygonOffsetFactor=this.polygonOffsetFactor);0!==this.polygonOffsetUnits&&(d.polygonOffsetUnits=this.polygonOffsetUnits);this.linewidth&&1!==this.linewidth&&(d.linewidth=this.linewidth); -void 0!==this.dashSize&&(d.dashSize=this.dashSize);void 0!==this.gapSize&&(d.gapSize=this.gapSize);void 0!==this.scale&&(d.scale=this.scale);!0===this.dithering&&(d.dithering=!0);0this.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthFunc=this.depthFunc;d.depthTest=this.depthTest;d.depthWrite=this.depthWrite;d.stencilWrite=this.stencilWrite; +d.stencilWriteMask=this.stencilWriteMask;d.stencilFunc=this.stencilFunc;d.stencilRef=this.stencilRef;d.stencilFuncMask=this.stencilFuncMask;d.stencilFail=this.stencilFail;d.stencilZFail=this.stencilZFail;d.stencilZPass=this.stencilZPass;this.rotation&&0!==this.rotation&&(d.rotation=this.rotation);!0===this.polygonOffset&&(d.polygonOffset=!0);0!==this.polygonOffsetFactor&&(d.polygonOffsetFactor=this.polygonOffsetFactor);0!==this.polygonOffsetUnits&&(d.polygonOffsetUnits=this.polygonOffsetUnits);this.linewidth&& +1!==this.linewidth&&(d.linewidth=this.linewidth);void 0!==this.dashSize&&(d.dashSize=this.dashSize);void 0!==this.gapSize&&(d.gapSize=this.gapSize);void 0!==this.scale&&(d.scale=this.scale);!0===this.dithering&&(d.dithering=!0);0g;g++)if(d[g]===d[(g+1)%3]){a.push(f);break}for(f=a.length-1;0<=f;f--)for(d=a[f],this.faces.splice(d,1),c=0,e=this.faceVertexUvs.length;c\n\t#include \n}", -fragmentShader:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}",side:1,blending:0});d.uniforms.tEquirect.value=b;b=new ia(new Gd(5, -5,5),d);c.add(b);d=new Dc(1,10,1);d.renderTarget=this;d.renderTarget.texture.name="CubeCameraTexture";d.update(a,c);b.geometry.dispose();b.material.dispose();return this};Yb.prototype=Object.create(V.prototype);Yb.prototype.constructor=Yb;Yb.prototype.isDataTexture=!0;var Vg=new n,pk=new n,qk=new S;Object.assign(cb.prototype,{isPlane:!0,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a, -b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(a,b,c){b=Vg.subVectors(c,b).cross(pk.subVectors(a,b)).normalize();this.setFromNormalAndCoplanarPoint(b,a);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*= +e+d,b,b-c,a,this.far);this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(a){a=C.prototype.toJSON.call(this,a);a.object.fov=this.fov;a.object.zoom=this.zoom;a.object.near=this.near;a.object.far=this.far;a.object.focus=this.focus;a.object.aspect=this.aspect;null!==this.view&&(a.object.view=Object.assign({},this.view));a.object.filmGauge=this.filmGauge;a.object.filmOffset=this.filmOffset;return a}});Dc.prototype=Object.create(C.prototype);Dc.prototype.constructor=Dc;Ab.prototype= +Object.create(ka.prototype);Ab.prototype.constructor=Ab;Ab.prototype.isWebGLRenderTargetCube=!0;Ab.prototype.fromEquirectangularTexture=function(a,b){this.texture.type=b.type;this.texture.format=b.format;this.texture.encoding=b.encoding;var c=new wd,d=new la({type:"CubemapFromEquirect",uniforms:Xb({tEquirect:{value:null}}),vertexShader:"varying vec3 vWorldDirection;\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}", +fragmentShader:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}",side:1,blending:0});d.uniforms.tEquirect.value=b;b=new R(new Gd(5, +5,5),d);c.add(b);d=new Dc(1,10,1);d.renderTarget=this;d.renderTarget.texture.name="CubeCameraTexture";d.update(a,c);b.geometry.dispose();b.material.dispose();return this};Yb.prototype=Object.create(Z.prototype);Yb.prototype.constructor=Yb;Yb.prototype.isDataTexture=!0;var Yg=new n,tk=new n,uk=new S;Object.assign(cb.prototype,{isPlane:!0,set:function(a,b){this.normal.copy(a);this.constant=b;return this},setComponents:function(a,b,c,d){this.normal.set(a,b,c);this.constant=d;return this},setFromNormalAndCoplanarPoint:function(a, +b){this.normal.copy(a);this.constant=-b.dot(this.normal);return this},setFromCoplanarPoints:function(a,b,c){b=Yg.subVectors(c,b).cross(tk.subVectors(a,b)).normalize();this.setFromNormalAndCoplanarPoint(b,a);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.normal.copy(a.normal);this.constant=a.constant;return this},normalize:function(){var a=1/this.normal.length();this.normal.multiplyScalar(a);this.constant*=a;return this},negate:function(){this.constant*= -1;this.normal.negate();return this},distanceToPoint:function(a){return this.normal.dot(a)+this.constant},distanceToSphere:function(a){return this.distanceToPoint(a.center)-a.radius},projectPoint:function(a,b){void 0===b&&(console.warn("THREE.Plane: .projectPoint() target is now required"),b=new n);return b.copy(this.normal).multiplyScalar(-this.distanceToPoint(a)).add(a)},intersectLine:function(a,b){void 0===b&&(console.warn("THREE.Plane: .intersectLine() target is now required"),b=new n);var c= -a.delta(Vg),d=this.normal.dot(c);if(0===d){if(0===this.distanceToPoint(a.start))return b.copy(a.start)}else if(d=-(a.start.dot(this.normal)+this.constant)/d,!(0>d||1b&&0a&&0c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],k=c[7],n=c[8],u=c[9],q=c[10],r=c[11],t=c[12],z=c[13],w=c[14];c=c[15];b[0].setComponents(f-a,k-g,r-n,c-t).normalize();b[1].setComponents(f+a,k+g,r+n,c+t).normalize();b[2].setComponents(f+ -d,k+h,r+u,c+z).normalize();b[3].setComponents(f-d,k-h,r-u,c-z).normalize();b[4].setComponents(f-e,k-l,r-q,c-w).normalize();b[5].setComponents(f+e,k+l,r+q,c+w).normalize();return this},intersectsObject:function(a){var b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere();td.copy(b.boundingSphere).applyMatrix4(a.matrixWorld);return this.intersectsSphere(td)},intersectsSprite:function(a){td.center.set(0,0,0);td.radius=.7071067811865476;td.applyMatrix4(a.matrixWorld);return this.intersectsSphere(td)}, -intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)c;c++){var d=b[c];zf.x=0d.distanceToPoint(zf))return!1}return!0},containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});var M={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif", +a.delta(Yg),d=this.normal.dot(c);if(0===d){if(0===this.distanceToPoint(a.start))return b.copy(a.start)}else if(d=-(a.start.dot(this.normal)+this.constant)/d,!(0>d||1b&&0a&&0c;c++)b[c].copy(a.planes[c]);return this},setFromMatrix:function(a){var b=this.planes,c=a.elements;a=c[0];var d=c[1],e=c[2],f=c[3],g=c[4],h=c[5],l=c[6],k=c[7],p=c[8],n=c[9],t=c[10],r=c[11],q=c[12],v=c[13],y=c[14];c=c[15];b[0].setComponents(f-a,k-g,r-p,c-q).normalize();b[1].setComponents(f+a,k+g,r+p,c+q).normalize();b[2].setComponents(f+ +d,k+h,r+n,c+v).normalize();b[3].setComponents(f-d,k-h,r-n,c-v).normalize();b[4].setComponents(f-e,k-l,r-t,c-y).normalize();b[5].setComponents(f+e,k+l,r+t,c+y).normalize();return this},intersectsObject:function(a){var b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere();td.copy(b.boundingSphere).applyMatrix4(a.matrixWorld);return this.intersectsSphere(td)},intersectsSprite:function(a){td.center.set(0,0,0);td.radius=.7071067811865476;td.applyMatrix4(a.matrixWorld);return this.intersectsSphere(td)}, +intersectsSphere:function(a){var b=this.planes,c=a.center;a=-a.radius;for(var d=0;6>d;d++)if(b[d].distanceToPoint(c)c;c++){var d=b[c];zf.x=0d.distanceToPoint(zf))return!1}return!0},containsPoint:function(a){for(var b=this.planes,c=0;6>c;c++)if(0>b[c].distanceToPoint(a))return!1;return!0}});var O={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif", alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif", aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif", bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif", @@ -640,230 +647,231 @@ points_vert:"uniform float size;\nuniform float scale;\n#include \n#incl shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n}",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}", sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"}, -G={common:{diffuse:{value:new I(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new S},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null}, -normalScale:{value:new v(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:2.5E-4},fogNear:{value:1},fogFar:{value:2E3},fogColor:{value:new I(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{}, +J={common:{diffuse:{value:new I(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new S},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null}, +normalScale:{value:new w(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:2.5E-4},fogNear:{value:1},fogFar:{value:2E3},fogColor:{value:new I(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{}, shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}}, -pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new I(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new S}},sprite:{diffuse:{value:new I(15658734)},opacity:{value:1},center:{value:new v(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new S}}},db= -{basic:{uniforms:Ba([G.common,G.specularmap,G.envmap,G.aomap,G.lightmap,G.fog]),vertexShader:M.meshbasic_vert,fragmentShader:M.meshbasic_frag},lambert:{uniforms:Ba([G.common,G.specularmap,G.envmap,G.aomap,G.lightmap,G.emissivemap,G.fog,G.lights,{emissive:{value:new I(0)}}]),vertexShader:M.meshlambert_vert,fragmentShader:M.meshlambert_frag},phong:{uniforms:Ba([G.common,G.specularmap,G.envmap,G.aomap,G.lightmap,G.emissivemap,G.bumpmap,G.normalmap,G.displacementmap,G.gradientmap,G.fog,G.lights,{emissive:{value:new I(0)}, -specular:{value:new I(1118481)},shininess:{value:30}}]),vertexShader:M.meshphong_vert,fragmentShader:M.meshphong_frag},standard:{uniforms:Ba([G.common,G.envmap,G.aomap,G.lightmap,G.emissivemap,G.bumpmap,G.normalmap,G.displacementmap,G.roughnessmap,G.metalnessmap,G.fog,G.lights,{emissive:{value:new I(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:M.meshphysical_vert,fragmentShader:M.meshphysical_frag},matcap:{uniforms:Ba([G.common,G.bumpmap,G.normalmap,G.displacementmap, -G.fog,{matcap:{value:null}}]),vertexShader:M.meshmatcap_vert,fragmentShader:M.meshmatcap_frag},points:{uniforms:Ba([G.points,G.fog]),vertexShader:M.points_vert,fragmentShader:M.points_frag},dashed:{uniforms:Ba([G.common,G.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:M.linedashed_vert,fragmentShader:M.linedashed_frag},depth:{uniforms:Ba([G.common,G.displacementmap]),vertexShader:M.depth_vert,fragmentShader:M.depth_frag},normal:{uniforms:Ba([G.common,G.bumpmap,G.normalmap, -G.displacementmap,{opacity:{value:1}}]),vertexShader:M.normal_vert,fragmentShader:M.normal_frag},sprite:{uniforms:Ba([G.sprite,G.fog]),vertexShader:M.sprite_vert,fragmentShader:M.sprite_frag},background:{uniforms:{uvTransform:{value:new S},t2D:{value:null}},vertexShader:M.background_vert,fragmentShader:M.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:M.cube_vert,fragmentShader:M.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:M.equirect_vert, -fragmentShader:M.equirect_frag},distanceRGBA:{uniforms:Ba([G.common,G.displacementmap,{referencePosition:{value:new n},nearDistance:{value:1},farDistance:{value:1E3}}]),vertexShader:M.distanceRGBA_vert,fragmentShader:M.distanceRGBA_frag},shadow:{uniforms:Ba([G.lights,G.fog,{color:{value:new I(0)},opacity:{value:1}}]),vertexShader:M.shadow_vert,fragmentShader:M.shadow_frag}};db.physical={uniforms:Ba([db.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new I(0)}, -clearcoatNormalScale:{value:new v(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:M.meshphysical_vert,fragmentShader:M.meshphysical_frag};Fd.prototype=Object.create(F.prototype);Fd.prototype.constructor=Fd;Zb.prototype=Object.create(D.prototype);Zb.prototype.constructor=Zb;ob.prototype=Object.create(V.prototype);ob.prototype.constructor=ob;ob.prototype.isCubeTexture=!0;Object.defineProperty(ob.prototype,"images",{get:function(){return this.image},set:function(a){this.image=a}});Ec.prototype= -Object.create(V.prototype);Ec.prototype.constructor=Ec;Ec.prototype.isDataTexture2DArray=!0;Fc.prototype=Object.create(V.prototype);Fc.prototype.constructor=Fc;Fc.prototype.isDataTexture3D=!0;var qh=new V,jj=new Ec,lj=new Fc,rh=new ob,kh=[],mh=[],ph=new Float32Array(16),oh=new Float32Array(9),nh=new Float32Array(4);sh.prototype.updateCache=function(a){var b=this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float32Array(a.length));Ga(b,a)};th.prototype.setValue=function(a, +pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new I(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new S}},sprite:{diffuse:{value:new I(15658734)},opacity:{value:1},center:{value:new w(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new S}}},db= +{basic:{uniforms:Ea([J.common,J.specularmap,J.envmap,J.aomap,J.lightmap,J.fog]),vertexShader:O.meshbasic_vert,fragmentShader:O.meshbasic_frag},lambert:{uniforms:Ea([J.common,J.specularmap,J.envmap,J.aomap,J.lightmap,J.emissivemap,J.fog,J.lights,{emissive:{value:new I(0)}}]),vertexShader:O.meshlambert_vert,fragmentShader:O.meshlambert_frag},phong:{uniforms:Ea([J.common,J.specularmap,J.envmap,J.aomap,J.lightmap,J.emissivemap,J.bumpmap,J.normalmap,J.displacementmap,J.gradientmap,J.fog,J.lights,{emissive:{value:new I(0)}, +specular:{value:new I(1118481)},shininess:{value:30}}]),vertexShader:O.meshphong_vert,fragmentShader:O.meshphong_frag},standard:{uniforms:Ea([J.common,J.envmap,J.aomap,J.lightmap,J.emissivemap,J.bumpmap,J.normalmap,J.displacementmap,J.roughnessmap,J.metalnessmap,J.fog,J.lights,{emissive:{value:new I(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:O.meshphysical_vert,fragmentShader:O.meshphysical_frag},matcap:{uniforms:Ea([J.common,J.bumpmap,J.normalmap,J.displacementmap, +J.fog,{matcap:{value:null}}]),vertexShader:O.meshmatcap_vert,fragmentShader:O.meshmatcap_frag},points:{uniforms:Ea([J.points,J.fog]),vertexShader:O.points_vert,fragmentShader:O.points_frag},dashed:{uniforms:Ea([J.common,J.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:O.linedashed_vert,fragmentShader:O.linedashed_frag},depth:{uniforms:Ea([J.common,J.displacementmap]),vertexShader:O.depth_vert,fragmentShader:O.depth_frag},normal:{uniforms:Ea([J.common,J.bumpmap,J.normalmap, +J.displacementmap,{opacity:{value:1}}]),vertexShader:O.normal_vert,fragmentShader:O.normal_frag},sprite:{uniforms:Ea([J.sprite,J.fog]),vertexShader:O.sprite_vert,fragmentShader:O.sprite_frag},background:{uniforms:{uvTransform:{value:new S},t2D:{value:null}},vertexShader:O.background_vert,fragmentShader:O.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:O.cube_vert,fragmentShader:O.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:O.equirect_vert, +fragmentShader:O.equirect_frag},distanceRGBA:{uniforms:Ea([J.common,J.displacementmap,{referencePosition:{value:new n},nearDistance:{value:1},farDistance:{value:1E3}}]),vertexShader:O.distanceRGBA_vert,fragmentShader:O.distanceRGBA_frag},shadow:{uniforms:Ea([J.lights,J.fog,{color:{value:new I(0)},opacity:{value:1}}]),vertexShader:O.shadow_vert,fragmentShader:O.shadow_frag}};db.physical={uniforms:Ea([db.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new I(0)}, +clearcoatNormalScale:{value:new w(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:O.meshphysical_vert,fragmentShader:O.meshphysical_frag};Fd.prototype=Object.create(G.prototype);Fd.prototype.constructor=Fd;Zb.prototype=Object.create(D.prototype);Zb.prototype.constructor=Zb;ob.prototype=Object.create(Z.prototype);ob.prototype.constructor=ob;ob.prototype.isCubeTexture=!0;Object.defineProperty(ob.prototype,"images",{get:function(){return this.image},set:function(a){this.image=a}});Ec.prototype= +Object.create(Z.prototype);Ec.prototype.constructor=Ec;Ec.prototype.isDataTexture2DArray=!0;Fc.prototype=Object.create(Z.prototype);Fc.prototype.constructor=Fc;Fc.prototype.isDataTexture3D=!0;var th=new Z,mj=new Ec,oj=new Fc,uh=new ob,nh=[],ph=[],sh=new Float32Array(16),rh=new Float32Array(9),qh=new Float32Array(4);vh.prototype.updateCache=function(a){var b=this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float32Array(a.length));Ha(b,a)};wh.prototype.setValue=function(a, b,c){for(var d=this.seq,e=0,f=d.length;e!==f;++e){var g=d[e];g.setValue(a,b[g.id],c)}};var Yf=/([\w\d_]+)(\])?(\[|\.)?/g;Bb.prototype.setValue=function(a,b,c,d){b=this.map[b];void 0!==b&&b.setValue(a,c,d)};Bb.prototype.setOptional=function(a,b,c){b=b[c];void 0!==b&&this.setValue(a,c,b)};Bb.upload=function(a,b,c,d){for(var e=0,f=b.length;e!==f;++e){var g=b[e],h=c[g.id];!1!==h.needsUpdate&&g.setValue(a,h.value,d)}};Bb.seqWithValue=function(a,b){for(var c=[],d=0,e=a.length;d!==e;++d){var f=a[d];f.id in -b&&c.push(f)}return c};var Mj=0,Vj=0;Db.prototype=Object.create(O.prototype);Db.prototype.constructor=Db;Db.prototype.isMeshDepthMaterial=!0;Db.prototype.copy=function(a){O.prototype.copy.call(this,a);this.depthPacking=a.depthPacking;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth= -a.wireframeLinewidth;return this};Eb.prototype=Object.create(O.prototype);Eb.prototype.constructor=Eb;Eb.prototype.isMeshDistanceMaterial=!0;Eb.prototype.copy=function(a){O.prototype.copy.call(this,a);this.referencePosition.copy(a.referencePosition);this.nearDistance=a.nearDistance;this.farDistance=a.farDistance;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.map=a.map;this.alphaMap=a.alphaMap;this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias= -a.displacementBias;return this};Hc.prototype=Object.assign(Object.create(A.prototype),{constructor:Hc,isGroup:!0});Jd.prototype=Object.assign(Object.create(ja.prototype),{constructor:Jd,isArrayCamera:!0});var Fh=new n,Gh=new n;Object.assign(cg.prototype,za.prototype);Object.assign(Hh.prototype,za.prototype);Object.assign(Ie.prototype,{isFogExp2:!0,clone:function(){return new Ie(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}});Object.assign(Je.prototype, -{isFog:!0,clone:function(){return new Je(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});Object.defineProperty(bc.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(bc.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(a){if(Array.isArray(a))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==a?a.length/this.stride: -0;this.array=a;return this},setDynamic:function(a){this.dynamic=a;return this},copy:function(a){this.array=new a.array.constructor(a.array);this.count=a.count;this.stride=a.stride;this.dynamic=a.dynamic;return this},copyAt:function(a,b,c){a*=this.stride;c*=b.stride;for(var d=0,e=this.stride;da.far||b.push({distance:e,point:ze.clone(),uv:ca.getUV(ze,Af,Ae,Bf,ni,Wg,oi,new v),face:null,object:this})},clone:function(){return(new this.constructor(this.material)).copy(this)},copy:function(a){A.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}});var Cf=new n,pi=new n;Nd.prototype=Object.assign(Object.create(A.prototype),{constructor:Nd,isLOD:!0,copy:function(a){A.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b=b[c].distance)b[c-1].object.visible=!1,b[c].object.visible=!0;else break;for(;cc||(h.applyMatrix4(this.matrixWorld),q=a.ray.origin.distanceTo(h),qa.far||b.push({distance:q,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}}else for(d=0,u=p.length/3-1;dc||(h.applyMatrix4(this.matrixWorld),q=a.ray.origin.distanceTo(h),qa.far||b.push({distance:q,point:e.clone().applyMatrix4(this.matrixWorld), -index:d,face:null,faceIndex:null,object:this}))}else if(d.isGeometry)for(f=d.vertices,g=f.length,d=0;dc||(h.applyMatrix4(this.matrixWorld),q=a.ray.origin.distanceTo(h),qa.far||b.push({distance:q,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}},clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});var Ef=new n,Ff=new n;aa.prototype=Object.assign(Object.create(va.prototype), -{constructor:aa,isLineSegments:!0,computeLineDistances:function(){var a=this.geometry;if(a.isBufferGeometry)if(null===a.index){for(var b=a.attributes.position,c=[],d=0,e=b.count;d=a.HAVE_CURRENT_DATA&& -(this.needsUpdate=!0)}});Lc.prototype=Object.create(V.prototype);Lc.prototype.constructor=Lc;Lc.prototype.isCompressedTexture=!0;Pd.prototype=Object.create(V.prototype);Pd.prototype.constructor=Pd;Pd.prototype.isCanvasTexture=!0;Qd.prototype=Object.create(V.prototype);Qd.prototype.constructor=Qd;Qd.prototype.isDepthTexture=!0;Mc.prototype=Object.create(D.prototype);Mc.prototype.constructor=Mc;Rd.prototype=Object.create(F.prototype);Rd.prototype.constructor=Rd;Nc.prototype=Object.create(D.prototype); -Nc.prototype.constructor=Nc;Sd.prototype=Object.create(F.prototype);Sd.prototype.constructor=Sd;Aa.prototype=Object.create(D.prototype);Aa.prototype.constructor=Aa;Td.prototype=Object.create(F.prototype);Td.prototype.constructor=Td;Oc.prototype=Object.create(Aa.prototype);Oc.prototype.constructor=Oc;Ud.prototype=Object.create(F.prototype);Ud.prototype.constructor=Ud;cc.prototype=Object.create(Aa.prototype);cc.prototype.constructor=cc;Vd.prototype=Object.create(F.prototype);Vd.prototype.constructor= -Vd;Pc.prototype=Object.create(Aa.prototype);Pc.prototype.constructor=Pc;Wd.prototype=Object.create(F.prototype);Wd.prototype.constructor=Wd;Qc.prototype=Object.create(Aa.prototype);Qc.prototype.constructor=Qc;Xd.prototype=Object.create(F.prototype);Xd.prototype.constructor=Xd;dc.prototype=Object.create(D.prototype);dc.prototype.constructor=dc;dc.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};Yd.prototype=Object.create(F.prototype);Yd.prototype.constructor= -Yd;Rc.prototype=Object.create(D.prototype);Rc.prototype.constructor=Rc;Zd.prototype=Object.create(F.prototype);Zd.prototype.constructor=Zd;Sc.prototype=Object.create(D.prototype);Sc.prototype.constructor=Sc;var sk={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?b[0]*c:a.length,f=Kh(a,0,e,c,!0),g=[];if(!f||f.next===f.prev)return g;var h;if(d){var l=c;d=[];var k;var n=0;for(k=b.length;n80*c){var r=h=a[0];var t=d=a[1];for(l=c;lh&&(h=n),b>d&&(d=b);h=Math.max(h-r,d-t);h=0!==h?1/h:0}be(f,g,c,r,t,h);return g}},pb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;epb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];Oh(a);Ph(c,a);var f=a.length;b.forEach(Oh); -for(a=0;aMath.abs(g-l)?[new v(a,1-c),new v(h,1-d),new v(k,1-e),new v(u,1-b)]:[new v(g,1-c),new v(l,1-d),new v(n,1-e),new v(q,1-b)]}};de.prototype=Object.create(F.prototype); -de.prototype.constructor=de;Uc.prototype=Object.create(eb.prototype);Uc.prototype.constructor=Uc;ee.prototype=Object.create(F.prototype);ee.prototype.constructor=ee;Hb.prototype=Object.create(D.prototype);Hb.prototype.constructor=Hb;fe.prototype=Object.create(F.prototype);fe.prototype.constructor=fe;Vc.prototype=Object.create(D.prototype);Vc.prototype.constructor=Vc;ge.prototype=Object.create(F.prototype);ge.prototype.constructor=ge;Wc.prototype=Object.create(D.prototype);Wc.prototype.constructor= -Wc;gc.prototype=Object.create(F.prototype);gc.prototype.constructor=gc;gc.prototype.toJSON=function(){var a=F.prototype.toJSON.call(this);return Rh(this.parameters.shapes,a)};hc.prototype=Object.create(D.prototype);hc.prototype.constructor=hc;hc.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);return Rh(this.parameters.shapes,a)};Xc.prototype=Object.create(D.prototype);Xc.prototype.constructor=Xc;ic.prototype=Object.create(F.prototype);ic.prototype.constructor=ic;qb.prototype=Object.create(D.prototype); -qb.prototype.constructor=qb;he.prototype=Object.create(ic.prototype);he.prototype.constructor=he;ie.prototype=Object.create(qb.prototype);ie.prototype.constructor=ie;je.prototype=Object.create(F.prototype);je.prototype.constructor=je;Yc.prototype=Object.create(D.prototype);Yc.prototype.constructor=Yc;var oa=Object.freeze({WireframeGeometry:Mc,ParametricGeometry:Rd,ParametricBufferGeometry:Nc,TetrahedronGeometry:Td,TetrahedronBufferGeometry:Oc,OctahedronGeometry:Ud,OctahedronBufferGeometry:cc,IcosahedronGeometry:Vd, -IcosahedronBufferGeometry:Pc,DodecahedronGeometry:Wd,DodecahedronBufferGeometry:Qc,PolyhedronGeometry:Sd,PolyhedronBufferGeometry:Aa,TubeGeometry:Xd,TubeBufferGeometry:dc,TorusKnotGeometry:Yd,TorusKnotBufferGeometry:Rc,TorusGeometry:Zd,TorusBufferGeometry:Sc,TextGeometry:de,TextBufferGeometry:Uc,SphereGeometry:ee,SphereBufferGeometry:Hb,RingGeometry:fe,RingBufferGeometry:Vc,PlaneGeometry:Fd,PlaneBufferGeometry:Zb,LatheGeometry:ge,LatheBufferGeometry:Wc,ShapeGeometry:gc,ShapeBufferGeometry:hc,ExtrudeGeometry:fc, -ExtrudeBufferGeometry:eb,EdgesGeometry:Xc,ConeGeometry:he,ConeBufferGeometry:ie,CylinderGeometry:ic,CylinderBufferGeometry:qb,CircleGeometry:je,CircleBufferGeometry:Yc,BoxGeometry:Ug,BoxBufferGeometry:Gd});jc.prototype=Object.create(O.prototype);jc.prototype.constructor=jc;jc.prototype.isShadowMaterial=!0;jc.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);return this};Zc.prototype=Object.create(la.prototype);Zc.prototype.constructor=Zc;Zc.prototype.isRawShaderMaterial= -!0;fb.prototype=Object.create(O.prototype);fb.prototype.constructor=fb;fb.prototype.isMeshStandardMaterial=!0;fb.prototype.copy=function(a){O.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color);this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity; -this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.roughnessMap=a.roughnessMap;this.metalnessMap=a.metalnessMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth= -a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};kc.prototype=Object.create(fb.prototype);kc.prototype.constructor=kc;kc.prototype.isMeshPhysicalMaterial=!0;kc.prototype.copy=function(a){fb.prototype.copy.call(this,a);this.defines={STANDARD:"",PHYSICAL:""};this.reflectivity=a.reflectivity;this.clearcoat=a.clearcoat;this.clearcoatRoughness= -a.clearcoatRoughness;this.sheen=a.sheen?(this.sheen||new I).copy(a.sheen):null;this.clearcoatNormalMap=a.clearcoatNormalMap;this.clearcoatNormalScale.copy(a.clearcoatNormalScale);this.transparency=a.transparency;return this};Ra.prototype=Object.create(O.prototype);Ra.prototype.constructor=Ra;Ra.prototype.isMeshPhongMaterial=!0;Ra.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightMap= -a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.specularMap= -a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};lc.prototype=Object.create(Ra.prototype);lc.prototype.constructor=lc;lc.prototype.isMeshToonMaterial= -!0;lc.prototype.copy=function(a){Ra.prototype.copy.call(this,a);this.gradientMap=a.gradientMap;return this};mc.prototype=Object.create(O.prototype);mc.prototype.constructor=mc;mc.prototype.isMeshNormalMaterial=!0;mc.prototype.copy=function(a){O.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale; -this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};nc.prototype=Object.create(O.prototype);nc.prototype.constructor=nc;nc.prototype.isMeshLambertMaterial=!0;nc.prototype.copy=function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap= -a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning; -this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};oc.prototype=Object.create(O.prototype);oc.prototype.constructor=oc;oc.prototype.isMeshMatcapMaterial=!0;oc.prototype.copy=function(a){O.prototype.copy.call(this,a);this.defines={MATCAP:""};this.color.copy(a.color);this.matcap=a.matcap;this.map=a.map;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap; -this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.alphaMap=a.alphaMap;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};pc.prototype=Object.create(P.prototype);pc.prototype.constructor=pc;pc.prototype.isLineDashedMaterial=!0;pc.prototype.copy=function(a){P.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var tk=Object.freeze({ShadowMaterial:jc,SpriteMaterial:Gb, -RawShaderMaterial:Zc,ShaderMaterial:la,PointsMaterial:Qa,MeshPhysicalMaterial:kc,MeshStandardMaterial:fb,MeshPhongMaterial:Ra,MeshToonMaterial:lc,MeshNormalMaterial:mc,MeshLambertMaterial:nc,MeshDepthMaterial:Db,MeshDistanceMaterial:Eb,MeshBasicMaterial:Fa,MeshMatcapMaterial:oc,LineDashedMaterial:pc,LineBasicMaterial:P,Material:O}),ta={arraySlice:function(a,b,c){return ta.isTypedArray(a)?new a.constructor(a.subarray(b,void 0!==c?c:a.length)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&& -a.constructor===b?a:"number"===typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)},getKeyframeOrder:function(a){for(var b=a.length,c=Array(b),d=0;d!==b;++d)c[d]=d;c.sort(function(b,c){return a[b]-a[c]});return c},sortedArray:function(a,b,c){for(var d=a.length,e=new a.constructor(d),f=0,g=0;g!==d;++f)for(var h=c[f]*b,l=0;l!==b;++l)e[g++]=a[h+l];return e},flattenJSON:function(a,b,c,d){for(var e=1,f=a[0];void 0!== -f&&void 0===f[d];)f=a[e++];if(void 0!==f){var g=f[d];if(void 0!==g)if(Array.isArray(g)){do g=f[d],void 0!==g&&(b.push(f.time),c.push.apply(c,g)),f=a[e++];while(void 0!==f)}else if(void 0!==g.toArray){do g=f[d],void 0!==g&&(b.push(f.time),g.toArray(c,c.length)),f=a[e++];while(void 0!==f)}else{do g=f[d],void 0!==g&&(b.push(f.time),c.push(g)),f=a[e++];while(void 0!==f)}}}};Object.assign(Ha.prototype,{evaluate:function(a){var b=this.parameterPositions,c=this._cachedIndex,d=b[c],e=b[c-1];a:{b:{c:{d:if(!(a< -d)){for(var f=c+2;;){if(void 0===d){if(a=e)break a;else{f=b[1];a=e)break b}d=c;c=0}}for(;c>>1,ab;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),a=this.getValueSize(),this.times=ta.arraySlice(c,e,f),this.values=ta.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),a=!1);var c=this.times; -b=this.values;var d=c.length;0===d&&(console.error("THREE.KeyframeTrack: Track is empty.",this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,f,g);a=!1;break}if(null!==e&&e>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&ta.isTypedArray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.", -this,f,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values,c=this.getValueSize(),d=2302===this.getInterpolation(),e=1,f=a.length-1,g=1;gg)e=a+1;else if(0b&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(N.clamp(d[l-1].dot(d[l]),-1,1)),e[l].applyMatrix4(h.makeRotationAxis(g, -c))),f[l].crossVectors(d[l],e[l]);if(!0===b)for(c=Math.acos(N.clamp(e[0].dot(e[a]),-1,1)),c/=a,0d;)d+=c;for(;d>c;)d-=c;de&&(e=1);1E-4>d&&(d=e);1E-4>l&&(l=e);Xg.initNonuniformCatmullRom(f.x,g.x,h.x,c.x,d,e,l);Yg.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,l);Zg.initNonuniformCatmullRom(f.z, -g.z,h.z,c.z,d,e,l)}else"catmullrom"===this.curveType&&(Xg.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),Yg.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),Zg.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(Xg.calc(a),Yg.calc(a),Zg.calc(a));return b};wa.prototype.copy=function(a){C.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;bc.length-2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(Th(d,e.x,f.x,g.x, -c.x),Th(d,e.y,f.y,g.y,c.y));return b};Va.prototype.copy=function(a){C.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths();return a[a.length-1]},updateArcLengths:function(){this.needsUpdate=!0;this.cacheLengths=null;this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var a=[], -b=0,c=0,d=this.curves.length;ca.far||b.push({distance:e,point:ze.clone(),uv:aa.getUV(ze,Af,Ae,Bf,qi,Zg,ri,new w),face:null,object:this})},clone:function(){return(new this.constructor(this.material)).copy(this)}, +copy:function(a){C.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}});var Cf=new n,si=new n;Nd.prototype=Object.assign(Object.create(C.prototype),{constructor:Nd,isLOD:!0,copy:function(a){C.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b=b[c].distance)b[c-1].object.visible=!1,b[c].object.visible=!0;else break;for(;cc||(h.applyMatrix4(this.matrixWorld),t=a.ray.origin.distanceTo(h),ta.far||b.push({distance:t,point:e.clone().applyMatrix4(this.matrixWorld), +index:d,face:null,faceIndex:null,object:this}))}}else for(d=0,u=p.length/3-1;dc||(h.applyMatrix4(this.matrixWorld),t=a.ray.origin.distanceTo(h),ta.far||b.push({distance:t,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}else if(d.isGeometry)for(f=d.vertices,g=f.length,d=0;dc||(h.applyMatrix4(this.matrixWorld), +t=a.ray.origin.distanceTo(h),ta.far||b.push({distance:t,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}},clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});var Ef=new n,Ff=new n;T.prototype=Object.assign(Object.create(wa.prototype),{constructor:T,isLineSegments:!0,computeLineDistances:function(){var a=this.geometry;if(a.isBufferGeometry)if(null===a.index){for(var b=a.attributes.position,c=[],d=0,e=b.count;d< +e;d+=2)Ef.fromBufferAttribute(b,d),Ff.fromBufferAttribute(b,d+1),c[d]=0===d?0:c[d-1],c[d+1]=c[d]+Ef.distanceTo(Ff);a.addAttribute("lineDistance",new A(c,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(a.isGeometry)for(b=a.vertices,c=a.lineDistances,d=0,e=b.length;d=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Lc.prototype=Object.create(Z.prototype);Lc.prototype.constructor=Lc;Lc.prototype.isCompressedTexture=!0;Pd.prototype=Object.create(Z.prototype);Pd.prototype.constructor=Pd;Pd.prototype.isCanvasTexture=!0;Qd.prototype=Object.create(Z.prototype); +Qd.prototype.constructor=Qd;Qd.prototype.isDepthTexture=!0;Mc.prototype=Object.create(D.prototype);Mc.prototype.constructor=Mc;Rd.prototype=Object.create(G.prototype);Rd.prototype.constructor=Rd;Nc.prototype=Object.create(D.prototype);Nc.prototype.constructor=Nc;Sd.prototype=Object.create(G.prototype);Sd.prototype.constructor=Sd;Da.prototype=Object.create(D.prototype);Da.prototype.constructor=Da;Td.prototype=Object.create(G.prototype);Td.prototype.constructor=Td;Oc.prototype=Object.create(Da.prototype); +Oc.prototype.constructor=Oc;Ud.prototype=Object.create(G.prototype);Ud.prototype.constructor=Ud;cc.prototype=Object.create(Da.prototype);cc.prototype.constructor=cc;Vd.prototype=Object.create(G.prototype);Vd.prototype.constructor=Vd;Pc.prototype=Object.create(Da.prototype);Pc.prototype.constructor=Pc;Wd.prototype=Object.create(G.prototype);Wd.prototype.constructor=Wd;Qc.prototype=Object.create(Da.prototype);Qc.prototype.constructor=Qc;Xd.prototype=Object.create(G.prototype);Xd.prototype.constructor= +Xd;dc.prototype=Object.create(D.prototype);dc.prototype.constructor=dc;dc.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};Yd.prototype=Object.create(G.prototype);Yd.prototype.constructor=Yd;Rc.prototype=Object.create(D.prototype);Rc.prototype.constructor=Rc;Zd.prototype=Object.create(G.prototype);Zd.prototype.constructor=Zd;Sc.prototype=Object.create(D.prototype);Sc.prototype.constructor=Sc;var wk={triangulate:function(a,b,c){c=c||2;var d= +b&&b.length,e=d?b[0]*c:a.length,f=Nh(a,0,e,c,!0),g=[];if(!f||f.next===f.prev)return g;var h;if(d){var l=c;d=[];var k;var p=0;for(k=b.length;p80*c){var r=h=a[0];var q=d=a[1];for(l=c;lh&&(h=p),b>d&&(d=b);h=Math.max(h-r,d-q);h=0!==h?1/h: +0}be(f,g,c,r,q,h);return g}},pb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;epb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];Rh(a);Sh(c,a);var f=a.length;b.forEach(Rh);for(a=0;aMath.abs(g-l)?[new w(a,1-c),new w(h,1-d),new w(k,1-e),new w(n,1-b)]:[new w(g,1-c),new w(l,1-d),new w(p,1-e),new w(t,1-b)]}};de.prototype=Object.create(G.prototype);de.prototype.constructor=de;Uc.prototype=Object.create(eb.prototype);Uc.prototype.constructor=Uc;ee.prototype=Object.create(G.prototype);ee.prototype.constructor=ee;Hb.prototype=Object.create(D.prototype);Hb.prototype.constructor= +Hb;fe.prototype=Object.create(G.prototype);fe.prototype.constructor=fe;Vc.prototype=Object.create(D.prototype);Vc.prototype.constructor=Vc;ge.prototype=Object.create(G.prototype);ge.prototype.constructor=ge;Wc.prototype=Object.create(D.prototype);Wc.prototype.constructor=Wc;gc.prototype=Object.create(G.prototype);gc.prototype.constructor=gc;gc.prototype.toJSON=function(){var a=G.prototype.toJSON.call(this);return Uh(this.parameters.shapes,a)};hc.prototype=Object.create(D.prototype);hc.prototype.constructor= +hc;hc.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);return Uh(this.parameters.shapes,a)};Xc.prototype=Object.create(D.prototype);Xc.prototype.constructor=Xc;ic.prototype=Object.create(G.prototype);ic.prototype.constructor=ic;qb.prototype=Object.create(D.prototype);qb.prototype.constructor=qb;he.prototype=Object.create(ic.prototype);he.prototype.constructor=he;ie.prototype=Object.create(qb.prototype);ie.prototype.constructor=ie;je.prototype=Object.create(G.prototype);je.prototype.constructor= +je;Yc.prototype=Object.create(D.prototype);Yc.prototype.constructor=Yc;var xa=Object.freeze({WireframeGeometry:Mc,ParametricGeometry:Rd,ParametricBufferGeometry:Nc,TetrahedronGeometry:Td,TetrahedronBufferGeometry:Oc,OctahedronGeometry:Ud,OctahedronBufferGeometry:cc,IcosahedronGeometry:Vd,IcosahedronBufferGeometry:Pc,DodecahedronGeometry:Wd,DodecahedronBufferGeometry:Qc,PolyhedronGeometry:Sd,PolyhedronBufferGeometry:Da,TubeGeometry:Xd,TubeBufferGeometry:dc,TorusKnotGeometry:Yd,TorusKnotBufferGeometry:Rc, +TorusGeometry:Zd,TorusBufferGeometry:Sc,TextGeometry:de,TextBufferGeometry:Uc,SphereGeometry:ee,SphereBufferGeometry:Hb,RingGeometry:fe,RingBufferGeometry:Vc,PlaneGeometry:Fd,PlaneBufferGeometry:Zb,LatheGeometry:ge,LatheBufferGeometry:Wc,ShapeGeometry:gc,ShapeBufferGeometry:hc,ExtrudeGeometry:fc,ExtrudeBufferGeometry:eb,EdgesGeometry:Xc,ConeGeometry:he,ConeBufferGeometry:ie,CylinderGeometry:ic,CylinderBufferGeometry:qb,CircleGeometry:je,CircleBufferGeometry:Yc,BoxGeometry:Xg,BoxBufferGeometry:Gd}); +jc.prototype=Object.create(P.prototype);jc.prototype.constructor=jc;jc.prototype.isShadowMaterial=!0;jc.prototype.copy=function(a){P.prototype.copy.call(this,a);this.color.copy(a.color);return this};Zc.prototype=Object.create(la.prototype);Zc.prototype.constructor=Zc;Zc.prototype.isRawShaderMaterial=!0;fb.prototype=Object.create(P.prototype);fb.prototype.constructor=fb;fb.prototype.isMeshStandardMaterial=!0;fb.prototype.copy=function(a){P.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color); +this.roughness=a.roughness;this.metalness=a.metalness;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale= +a.displacementScale;this.displacementBias=a.displacementBias;this.roughnessMap=a.roughnessMap;this.metalnessMap=a.metalnessMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.envMapIntensity=a.envMapIntensity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this}; +kc.prototype=Object.create(fb.prototype);kc.prototype.constructor=kc;kc.prototype.isMeshPhysicalMaterial=!0;kc.prototype.copy=function(a){fb.prototype.copy.call(this,a);this.defines={STANDARD:"",PHYSICAL:""};this.reflectivity=a.reflectivity;this.clearcoat=a.clearcoat;this.clearcoatRoughness=a.clearcoatRoughness;this.sheen=a.sheen?(this.sheen||new I).copy(a.sheen):null;this.clearcoatNormalMap=a.clearcoatNormalMap;this.clearcoatNormalScale.copy(a.clearcoatNormalScale);this.transparency=a.transparency; +return this};Ra.prototype=Object.create(P.prototype);Ra.prototype.constructor=Ra;Ra.prototype.isMeshPhongMaterial=!0;Ra.prototype.copy=function(a){P.prototype.copy.call(this,a);this.color.copy(a.color);this.specular.copy(a.specular);this.shininess=a.shininess;this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity; +this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap=a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth; +this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};lc.prototype=Object.create(Ra.prototype);lc.prototype.constructor=lc;lc.prototype.isMeshToonMaterial=!0;lc.prototype.copy=function(a){Ra.prototype.copy.call(this,a);this.gradientMap=a.gradientMap;return this};mc.prototype=Object.create(P.prototype);mc.prototype.constructor=mc;mc.prototype.isMeshNormalMaterial=!0; +mc.prototype.copy=function(a){P.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this}; +nc.prototype=Object.create(P.prototype);nc.prototype.constructor=nc;nc.prototype.isMeshLambertMaterial=!0;nc.prototype.copy=function(a){P.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.lightMap=a.lightMap;this.lightMapIntensity=a.lightMapIntensity;this.aoMap=a.aoMap;this.aoMapIntensity=a.aoMapIntensity;this.emissive.copy(a.emissive);this.emissiveMap=a.emissiveMap;this.emissiveIntensity=a.emissiveIntensity;this.specularMap=a.specularMap;this.alphaMap=a.alphaMap;this.envMap= +a.envMap;this.combine=a.combine;this.reflectivity=a.reflectivity;this.refractionRatio=a.refractionRatio;this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.wireframeLinecap=a.wireframeLinecap;this.wireframeLinejoin=a.wireframeLinejoin;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};oc.prototype=Object.create(P.prototype);oc.prototype.constructor=oc;oc.prototype.isMeshMatcapMaterial=!0;oc.prototype.copy=function(a){P.prototype.copy.call(this, +a);this.defines={MATCAP:""};this.color.copy(a.color);this.matcap=a.matcap;this.map=a.map;this.bumpMap=a.bumpMap;this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;this.normalMapType=a.normalMapType;this.normalScale.copy(a.normalScale);this.displacementMap=a.displacementMap;this.displacementScale=a.displacementScale;this.displacementBias=a.displacementBias;this.alphaMap=a.alphaMap;this.skinning=a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};pc.prototype= +Object.create(U.prototype);pc.prototype.constructor=pc;pc.prototype.isLineDashedMaterial=!0;pc.prototype.copy=function(a){U.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var xk=Object.freeze({ShadowMaterial:jc,SpriteMaterial:Gb,RawShaderMaterial:Zc,ShaderMaterial:la,PointsMaterial:Qa,MeshPhysicalMaterial:kc,MeshStandardMaterial:fb,MeshPhongMaterial:Ra,MeshToonMaterial:lc,MeshNormalMaterial:mc,MeshLambertMaterial:nc,MeshDepthMaterial:Db, +MeshDistanceMaterial:Eb,MeshBasicMaterial:Ga,MeshMatcapMaterial:oc,LineDashedMaterial:pc,LineBasicMaterial:U,Material:P}),ta={arraySlice:function(a,b,c){return ta.isTypedArray(a)?new a.constructor(a.subarray(b,void 0!==c?c:a.length)):a.slice(b,c)},convertArray:function(a,b,c){return!a||!c&&a.constructor===b?a:"number"===typeof b.BYTES_PER_ELEMENT?new b(a):Array.prototype.slice.call(a)},isTypedArray:function(a){return ArrayBuffer.isView(a)&&!(a instanceof DataView)},getKeyframeOrder:function(a){for(var b= +a.length,c=Array(b),d=0;d!==b;++d)c[d]=d;c.sort(function(b,c){return a[b]-a[c]});return c},sortedArray:function(a,b,c){for(var d=a.length,e=new a.constructor(d),f=0,g=0;g!==d;++f)for(var h=c[f]*b,l=0;l!==b;++l)e[g++]=a[h+l];return e},flattenJSON:function(a,b,c,d){for(var e=1,f=a[0];void 0!==f&&void 0===f[d];)f=a[e++];if(void 0!==f){var g=f[d];if(void 0!==g)if(Array.isArray(g)){do g=f[d],void 0!==g&&(b.push(f.time),c.push.apply(c,g)),f=a[e++];while(void 0!==f)}else if(void 0!==g.toArray){do g=f[d], +void 0!==g&&(b.push(f.time),g.toArray(c,c.length)),f=a[e++];while(void 0!==f)}else{do g=f[d],void 0!==g&&(b.push(f.time),c.push(g)),f=a[e++];while(void 0!==f)}}}};Object.assign(Ia.prototype,{evaluate:function(a){var b=this.parameterPositions,c=this._cachedIndex,d=b[c],e=b[c-1];a:{b:{c:{d:if(!(a=e)break a;else{f=b[1];a=e)break b}d=c;c=0}}for(;c>>1,ab;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f, +1),e=f-1),a=this.getValueSize(),this.times=ta.arraySlice(c,e,f),this.values=ta.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a=!0,b=this.getValueSize();0!==b-Math.floor(b)&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),a=!1);var c=this.times;b=this.values;var d=c.length;0===d&&(console.error("THREE.KeyframeTrack: Track is empty.",this),a=!1);for(var e=null,f=0;f!==d;f++){var g=c[f];if("number"===typeof g&&isNaN(g)){console.error("THREE.KeyframeTrack: Time is not a valid number.", +this,f,g);a=!1;break}if(null!==e&&e>g){console.error("THREE.KeyframeTrack: Out of order keys.",this,f,g,e);a=!1;break}e=g}if(void 0!==b&&ta.isTypedArray(b))for(f=0,c=b.length;f!==c;++f)if(d=b[f],isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,f,d);a=!1;break}return a},optimize:function(){for(var a=this.times,b=this.values,c=this.getValueSize(),d=2302===this.getInterpolation(),e=1,f=a.length-1,g=1;gg)e=a+1;else if(0b&&(b=0);1Number.EPSILON&&(g.normalize(),c=Math.acos(N.clamp(d[l- +1].dot(d[l]),-1,1)),e[l].applyMatrix4(h.makeRotationAxis(g,c))),f[l].crossVectors(d[l],e[l]);if(!0===b)for(c=Math.acos(N.clamp(e[0].dot(e[a]),-1,1)),c/=a,0d;)d+=c;for(;d>c;)d-=c;de&&(e=1);1E-4>d&&(d=e);1E-4>l&&(l=e);$g.initNonuniformCatmullRom(f.x,g.x,h.x,c.x,d,e,l);ah.initNonuniformCatmullRom(f.y, +g.y,h.y,c.y,d,e,l);bh.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,l)}else"catmullrom"===this.curveType&&($g.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),ah.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),bh.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set($g.calc(a),ah.calc(a),bh.calc(a));return b};ya.prototype.copy=function(a){E.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;bc.length-2?c.length-1:a+1];c=c[a>c.length- +3?c.length-1:a+2];b.set(Wh(d,e.x,f.x,g.x,c.x),Wh(d,e.y,f.y,g.y,c.y));return b};Va.prototype.copy=function(a){E.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b=b)return b=c[a]-b,a=this.curves[a],c=a.getLength(),a.getPointAt(0===c?0:1-b/c);a++}return null},getLength:function(){var a=this.getCurveLengths();return a[a.length-1]},updateArcLengths:function(){this.needsUpdate=!0;this.cacheLengths=null;this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths; +for(var a=[],b=0,c=0,d=this.curves.length;cNumber.EPSILON){if(0>k&&(g=b[f],l=-l,h=b[e],k=-k),!(a.yh.y))if(a.y===g.y){if(a.x===g.x)return!0}else{e=k*(a.x-g.x)-l*(a.y-g.y);if(0===e)return!0; -0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=pb.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new Ib;h.curves=g.curves;b.push(h);return b}var l=!e(f[0].getPoints());l=a?!l:l;h=[];var k=[],n=[],u=0;k[u]=void 0;n[u]=[];for(var q=0,r=f.length;qb;b++)this.coefficients[b].copy(a[b]);return this},zero:function(){for(var a=0;9>a;a++)this.coefficients[a].set(0, +0>e||(d=!d)}}else if(a.y===g.y&&(h.x<=a.x&&a.x<=g.x||g.x<=a.x&&a.x<=h.x))return!0}return d}var e=pb.isClockWise,f=this.subPaths;if(0===f.length)return[];if(!0===b)return c(f);b=[];if(1===f.length){var g=f[0];var h=new Ib;h.curves=g.curves;b.push(h);return b}var l=!e(f[0].getPoints());l=a?!l:l;h=[];var k=[],n=[],u=0;k[u]=void 0;n[u]=[];for(var t=0,r=f.length;tb;b++)this.coefficients[b].copy(a[b]);return this},zero:function(){for(var a=0;9>a;a++)this.coefficients[a].set(0, 0,0);return this},getAt:function(a,b){var c=a.x,d=a.y;a=a.z;var e=this.coefficients;b.copy(e[0]).multiplyScalar(.282095);b.addScale(e[1],.488603*d);b.addScale(e[2],.488603*a);b.addScale(e[3],.488603*c);b.addScale(e[4],1.092548*c*d);b.addScale(e[5],1.092548*d*a);b.addScale(e[6],.315392*(3*a*a-1));b.addScale(e[7],1.092548*c*a);b.addScale(e[8],.546274*(c*c-d*d));return b},getIrradianceAt:function(a,b){var c=a.x,d=a.y;a=a.z;var e=this.coefficients;b.copy(e[0]).multiplyScalar(.886227);b.addScale(e[1], 1.023328*d);b.addScale(e[2],1.023328*a);b.addScale(e[3],1.023328*c);b.addScale(e[4],.858086*c*d);b.addScale(e[5],.858086*d*a);b.addScale(e[6],.743125*a*a-.247708);b.addScale(e[7],.858086*c*a);b.addScale(e[8],.429043*(c*c-d*d));return b},add:function(a){for(var b=0;9>b;b++)this.coefficients[b].add(a.coefficients[b]);return this},scale:function(a){for(var b=0;9>b;b++)this.coefficients[b].multiplyScalar(a);return this},lerp:function(a,b){for(var c=0;9>c;c++)this.coefficients[c].lerp(a.coefficients[c], b);return this},equals:function(a){for(var b=0;9>b;b++)if(!this.coefficients[b].equals(a.coefficients[b]))return!1;return!0},copy:function(a){return this.set(a.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(a,b){void 0===b&&(b=0);for(var c=this.coefficients,d=0;9>d;d++)c[d].fromArray(a,b+3*d);return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);for(var c=this.coefficients,d=0;9>d;d++)c[d].toArray(a,b+3*d);return a}});Object.assign(kf, -{getBasisAt:function(a,b){var c=a.x,d=a.y;a=a.z;b[0]=.282095;b[1]=.488603*d;b[2]=.488603*a;b[3]=.488603*c;b[4]=1.092548*c*d;b[5]=1.092548*d*a;b[6]=.315392*(3*a*a-1);b[7]=1.092548*c*a;b[8]=.546274*(c*c-d*d)}});Xa.prototype=Object.assign(Object.create(ba.prototype),{constructor:Xa,isLightProbe:!0,copy:function(a){ba.prototype.copy.call(this,a);this.sh.copy(a.sh);this.intensity=a.intensity;return this},toJSON:function(a){return ba.prototype.toJSON.call(this,a)}});tg.prototype=Object.assign(Object.create(Xa.prototype), -{constructor:tg,isHemisphereLightProbe:!0,copy:function(a){Xa.prototype.copy.call(this,a);return this},toJSON:function(a){return Xa.prototype.toJSON.call(this,a)}});ug.prototype=Object.assign(Object.create(Xa.prototype),{constructor:ug,isAmbientLightProbe:!0,copy:function(a){Xa.prototype.copy.call(this,a);return this},toJSON:function(a){return Xa.prototype.toJSON.call(this,a)}});var xi=new W,yi=new W;Object.assign(Uh.prototype,{update:function(a){var b=this._cache;if(b.focus!==a.focus||b.fov!==a.fov|| -b.aspect!==a.aspect*this.aspect||b.near!==a.near||b.far!==a.far||b.zoom!==a.zoom||b.eyeSep!==this.eyeSep){b.focus=a.focus;b.fov=a.fov;b.aspect=a.aspect*this.aspect;b.near=a.near;b.far=a.far;b.zoom=a.zoom;b.eyeSep=this.eyeSep;var c=a.projectionMatrix.clone(),d=b.eyeSep/2,e=d*b.near/b.focus,f=b.near*Math.tan(N.DEG2RAD*b.fov*.5)/b.zoom;yi.elements[12]=-d;xi.elements[12]=d;d=-f*b.aspect+e;var g=f*b.aspect+e;c.elements[0]=2*b.near/(g-d);c.elements[8]=(g+d)/(g-d);this.cameraL.projectionMatrix.copy(c);d= --f*b.aspect-e;g=f*b.aspect-e;c.elements[0]=2*b.near/(g-d);c.elements[8]=(g+d)/(g-d);this.cameraR.projectionMatrix.copy(c)}this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(yi);this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(xi)}});Object.assign(vg.prototype,{start:function(){this.oldTime=this.startTime=("undefined"===typeof performance?Date:performance).now();this.elapsedTime=0;this.running=!0},stop:function(){this.getElapsedTime();this.autoStart=this.running=!1},getElapsedTime:function(){this.getDelta(); -return this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var b=("undefined"===typeof performance?Date:performance).now();a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}});var vc=new n,zi=new sa,vk=new n,wc=new n;wg.prototype=Object.assign(Object.create(A.prototype),{constructor:wg,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination), +{getBasisAt:function(a,b){var c=a.x,d=a.y;a=a.z;b[0]=.282095;b[1]=.488603*d;b[2]=.488603*a;b[3]=.488603*c;b[4]=1.092548*c*d;b[5]=1.092548*d*a;b[6]=.315392*(3*a*a-1);b[7]=1.092548*c*a;b[8]=.546274*(c*c-d*d)}});Xa.prototype=Object.assign(Object.create(da.prototype),{constructor:Xa,isLightProbe:!0,copy:function(a){da.prototype.copy.call(this,a);this.sh.copy(a.sh);this.intensity=a.intensity;return this},toJSON:function(a){return da.prototype.toJSON.call(this,a)}});wg.prototype=Object.assign(Object.create(Xa.prototype), +{constructor:wg,isHemisphereLightProbe:!0,copy:function(a){Xa.prototype.copy.call(this,a);return this},toJSON:function(a){return Xa.prototype.toJSON.call(this,a)}});xg.prototype=Object.assign(Object.create(Xa.prototype),{constructor:xg,isAmbientLightProbe:!0,copy:function(a){Xa.prototype.copy.call(this,a);return this},toJSON:function(a){return Xa.prototype.toJSON.call(this,a)}});var Ai=new M,Bi=new M;Object.assign(Xh.prototype,{update:function(a){var b=this._cache;if(b.focus!==a.focus||b.fov!==a.fov|| +b.aspect!==a.aspect*this.aspect||b.near!==a.near||b.far!==a.far||b.zoom!==a.zoom||b.eyeSep!==this.eyeSep){b.focus=a.focus;b.fov=a.fov;b.aspect=a.aspect*this.aspect;b.near=a.near;b.far=a.far;b.zoom=a.zoom;b.eyeSep=this.eyeSep;var c=a.projectionMatrix.clone(),d=b.eyeSep/2,e=d*b.near/b.focus,f=b.near*Math.tan(N.DEG2RAD*b.fov*.5)/b.zoom;Bi.elements[12]=-d;Ai.elements[12]=d;d=-f*b.aspect+e;var g=f*b.aspect+e;c.elements[0]=2*b.near/(g-d);c.elements[8]=(g+d)/(g-d);this.cameraL.projectionMatrix.copy(c);d= +-f*b.aspect-e;g=f*b.aspect-e;c.elements[0]=2*b.near/(g-d);c.elements[8]=(g+d)/(g-d);this.cameraR.projectionMatrix.copy(c)}this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(Bi);this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(Ai)}});Object.assign(yg.prototype,{start:function(){this.oldTime=this.startTime=("undefined"===typeof performance?Date:performance).now();this.elapsedTime=0;this.running=!0},stop:function(){this.getElapsedTime();this.autoStart=this.running=!1},getElapsedTime:function(){this.getDelta(); +return this.elapsedTime},getDelta:function(){var a=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var b=("undefined"===typeof performance?Date:performance).now();a=(b-this.oldTime)/1E3;this.oldTime=b;this.elapsedTime+=a}return a}});var vc=new n,Ci=new sa,zk=new n,wc=new n;zg.prototype=Object.assign(Object.create(C.prototype),{constructor:zg,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination),this.filter=null);return this},getFilter:function(){return this.filter},setFilter:function(a){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination);this.filter=a;this.gain.connect(this.filter);this.filter.connect(this.context.destination);return this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(a){this.gain.gain.setTargetAtTime(a, -this.context.currentTime,.01);return this},updateMatrixWorld:function(a){A.prototype.updateMatrixWorld.call(this,a);a=this.context.listener;var b=this.up;this.timeDelta=this._clock.getDelta();this.matrixWorld.decompose(vc,zi,vk);wc.set(0,0,-1).applyQuaternion(zi);if(a.positionX){var c=this.context.currentTime+this.timeDelta;a.positionX.linearRampToValueAtTime(vc.x,c);a.positionY.linearRampToValueAtTime(vc.y,c);a.positionZ.linearRampToValueAtTime(vc.z,c);a.forwardX.linearRampToValueAtTime(wc.x,c); -a.forwardY.linearRampToValueAtTime(wc.y,c);a.forwardZ.linearRampToValueAtTime(wc.z,c);a.upX.linearRampToValueAtTime(b.x,c);a.upY.linearRampToValueAtTime(b.y,c);a.upZ.linearRampToValueAtTime(b.z,c)}else a.setPosition(vc.x,vc.y,vc.z),a.setOrientation(wc.x,wc.y,wc.z,b.x,b.y,b.z)}});dd.prototype=Object.assign(Object.create(A.prototype),{constructor:dd,getOutput:function(){return this.gain},setNodeSource:function(a){this.hasPlaybackControl=!1;this.sourceType="audioNode";this.source=a;this.connect();return this}, +this.context.currentTime,.01);return this},updateMatrixWorld:function(a){C.prototype.updateMatrixWorld.call(this,a);a=this.context.listener;var b=this.up;this.timeDelta=this._clock.getDelta();this.matrixWorld.decompose(vc,Ci,zk);wc.set(0,0,-1).applyQuaternion(Ci);if(a.positionX){var c=this.context.currentTime+this.timeDelta;a.positionX.linearRampToValueAtTime(vc.x,c);a.positionY.linearRampToValueAtTime(vc.y,c);a.positionZ.linearRampToValueAtTime(vc.z,c);a.forwardX.linearRampToValueAtTime(wc.x,c); +a.forwardY.linearRampToValueAtTime(wc.y,c);a.forwardZ.linearRampToValueAtTime(wc.z,c);a.upX.linearRampToValueAtTime(b.x,c);a.upY.linearRampToValueAtTime(b.y,c);a.upZ.linearRampToValueAtTime(b.z,c)}else a.setPosition(vc.x,vc.y,vc.z),a.setOrientation(wc.x,wc.y,wc.z,b.x,b.y,b.z)}});dd.prototype=Object.assign(Object.create(C.prototype),{constructor:dd,getOutput:function(){return this.gain},setNodeSource:function(a){this.hasPlaybackControl=!1;this.sourceType="audioNode";this.source=a;this.connect();return this}, setMediaElementSource:function(a){this.hasPlaybackControl=!1;this.sourceType="mediaNode";this.source=this.context.createMediaElementSource(a);this.connect();return this},setBuffer:function(a){this.buffer=a;this.sourceType="buffer";this.autoplay&&this.play();return this},play:function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else{var a=this.context.createBufferSource(); a.buffer=this.buffer;a.loop=this.loop;a.onended=this.onEnded.bind(this);this.startTime=this.context.currentTime;a.start(this.startTime,this.offset,this.duration);this.isPlaying=!0;this.source=a;this.setDetune(this.detune);this.setPlaybackRate(this.playbackRate);return this.connect()}},pause:function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return!0===this.isPlaying&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime- this.startTime)*this.playbackRate,this.isPlaying=!1),this},stop:function(){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this},connect:function(){if(0d&&this._mixBufferRegion(c,a,3*b,1-d,b);d=b;for(var f=b+b;d!==f;++d)if(c[d]!==c[d+b]){e.setValue(c,a);break}},saveOriginalState:function(){var a=this.buffer,b=this.valueSize,c=3*b;this.binding.getValue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(a,b,c,d,e){if(.5<=d)for(d= -0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){sa.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var f=1-d,g=0;g!==e;++g){var h=b+g;a[h]=a[h]*f+a[c+g]*d}}});var xk=/[\[\]\.:\/]/g,yk="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",zk=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ak=/(WCOD+)?/.source.replace("WCOD",yk),Bk=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ck=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Dk=new RegExp("^"+zk+Ak+ -Bk+Ck+"$"),Ek=["material","materials","bones"];Object.assign(Vh.prototype,{getValue:function(a,b){this.bind();var c=this._bindings[this._targetGroup.nCachedObjects_];void 0!==c&&c.getValue(a,b)},setValue:function(a,b){for(var c=this._bindings,d=this._targetGroup.nCachedObjects_,e=c.length;d!==e;++d)c[d].setValue(a,b)},bind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_,c=a.length;b!==c;++b)a[b].bind()},unbind:function(){for(var a=this._bindings,b=this._targetGroup.nCachedObjects_, -c=a.length;b!==c;++b)a[b].unbind()}});Object.assign(ya,{Composite:Vh,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new ya.Composite(a,b,c):new ya(a,b,c)},sanitizeNodeName:function(a){return a.replace(/\s/g,"_").replace(xk,"")},parseTrackName:function(a){var b=Dk.exec(a);if(!b)throw Error("PropertyBinding: Cannot parse trackName: "+a);b={nodeName:b[2],objectName:b[3],objectIndex:b[4],propertyName:b[5],propertyIndex:b[6]};var c=b.nodeName&&b.nodeName.lastIndexOf(".");if(void 0!==c&&-1!== -c){var d=b.nodeName.substring(c+1);-1!==Ek.indexOf(d)&&(b.nodeName=b.nodeName.substring(0,c),b.objectName=d)}if(null===b.propertyName||0===b.propertyName.length)throw Error("PropertyBinding: can not parse propertyName from trackName: "+a);return b},findNode:function(a,b){if(!b||""===b||"root"===b||"."===b||-1===b||b===a.name||b===a.uuid)return a;if(a.skeleton){var c=a.skeleton.getBoneByName(b);if(void 0!==c)return c}if(a.children){var d=function(a){for(var c=0;c=b){var n=b++,u=a[n];c[u.uuid]=m;a[m]=u;c[k]=n;a[n]=h;h=0;for(k=e;h!==k;++h){u=d[h];var q=u[m];u[m]=u[n];u[n]=q}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var k=arguments[g].uuid,m=d[k];if(void 0!==m)if(delete d[k],m=b){var n=b++,u=a[n];c[u.uuid]=m;a[m]=u;c[k]=n;a[n]=h;h=0;for(k=e;h!==k;++h){u=d[h];var t=u[m];u[m]=u[n];u[n]=t}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,f=e.length,g=0,h=arguments.length;g!==h;++g){var k=arguments[g].uuid,m=d[k];if(void 0!==m)if(delete d[k],mc.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b},_updateTime:function(a){var b=this.time+a,c=this._clip.duration,d=this.loop,e=this._loopCount,f=2202===d;if(0===a)return-1===e?b:f&&1===(e&1)?c-b:b;if(2200===d)a:{if(-1===e&&(this._loopCount=0,this._setEndings(!0,!0,!1)),b>=c)b=c;else if(0>b)b=0;else{this.time=b;break a}this.clampWhenFinished?this.paused=!0:this.enabled=!1;this.time=b;this._mixer.dispatchEvent({type:"finished", action:this,direction:0>a?-1:1})}else{-1===e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,f)):this._setEndings(0===this.repetitions,!0,f));if(b>=c||0>b){d=Math.floor(b/c);b-=c*d;e+=Math.abs(d);var g=this.repetitions-e;0>=g?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=b=0a,this._setEndings(a,!a,f)):this._setEndings(!1,!1,f),this._loopCount=e,this.time=b,this._mixer.dispatchEvent({type:"loop", action:this,loopDelta:d}))}else this.time=b;if(f&&1===(e&1))return c-b}return b},_setEndings:function(a,b,c){var d=this._interpolantSettings;c?(d.endingStart=2401,d.endingEnd=2401):(d.endingStart=a?this.zeroSlopeAtStart?2401:2400:2402,d.endingEnd=b?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(a,b,c){var d=this._mixer,e=d.time,f=this._weightInterpolant;null===f&&(this._weightInterpolant=f=d._lendControlInterpolant());d=f.parameterPositions;f=f.sampleValues;d[0]=e;f[0]=b;d[1]=e+a;f[1]= -c;return this}});Bg.prototype=Object.assign(Object.create(za.prototype),{constructor:Bg,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var m=d[h],n=m.name,u=k[n];if(void 0===u){u=f[h];if(void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,g,n));continue}u=new Ag(ya.create(c,n,b&&b._propertyBindings[h].binding.parsedPath), +c;return this}});Eg.prototype=Object.assign(Object.create(Ba.prototype),{constructor:Eg,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,f=a._propertyBindings;a=a._interpolants;var g=c.uuid,h=this._bindingsByRootAndName,k=h[g];void 0===k&&(k={},h[g]=k);for(h=0;h!==e;++h){var m=d[h],n=m.name,u=k[n];if(void 0===u){u=f[h];if(void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,g,n));continue}u=new Dg(Aa.create(c,n,b&&b._propertyBindings[h].binding.parsedPath), m.ValueTypeName,m.getValueSize());++u.referenceCount;this._addInactiveBinding(u,g,n)}f[h]=u;a[h].resultBuffer=u.buffer}},_activateAction:function(a){if(!this._isActiveAction(a)){if(null===a._cacheIndex){var b=(a._localRoot||this._root).uuid,c=a._clip.uuid,d=this._actionsByClip[c];this._bindAction(a,d&&d.knownActions[0]);this._addInactiveAction(a,c,b)}b=a._propertyBindings;c=0;for(d=b.length;c!==d;++c){var e=b[c];0===e.useCount++&&(this._lendBinding(e),e.saveOriginalState())}this._lendAction(a)}}, _deactivateAction:function(a){if(this._isActiveAction(a)){for(var b=a._propertyBindings,c=0,d=b.length;c!==d;++c){var e=b[c];0===--e.useCount&&(e.restoreOriginalState(),this._takeBackBinding(e))}this._takeBackAction(a)}},_initMemoryManager:function(){this._actions=[];this._nActiveActions=0;this._actionsByClip={};this._bindings=[];this._nActiveBindings=0;this._bindingsByRootAndName={};this._controlInterpolants=[];this._nActiveControlInterpolants=0;var a=this;this.stats={actions:{get total(){return a._actions.length}, get inUse(){return a._nActiveActions}},bindings:{get total(){return a._bindings.length},get inUse(){return a._nActiveBindings}},controlInterpolants:{get total(){return a._controlInterpolants.length},get inUse(){return a._nActiveControlInterpolants}}}},_isActiveAction:function(a){a=a._cacheIndex;return null!==a&&athis.max.x||a.ythis.max.y?!1:!0},containsBox:function(a){return this.min.x<=a.min.x&&a.max.x<=this.max.x&&this.min.y<=a.min.y&&a.max.y<=this.max.y},getParameter:function(a,b){void 0===b&&(console.warn("THREE.Box2: .getParameter() target is now required"), -b=new v);return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"),b=new v);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){return Bi.copy(a).clamp(this.min,this.max).sub(a).length()},intersect:function(a){this.min.max(a.min); -this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});var Ci=new n,Jf=new n;Object.assign(Fg.prototype,{set:function(a,b){this.start.copy(a);this.end.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},getCenter:function(a){void 0=== +b=new w);return b.set((a.x-this.min.x)/(this.max.x-this.min.x),(a.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"),b=new w);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){return Ei.copy(a).clamp(this.min,this.max).sub(a).length()},intersect:function(a){this.min.max(a.min); +this.max.min(a.max);return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},translate:function(a){this.min.add(a);this.max.add(a);return this},equals:function(a){return a.min.equals(this.min)&&a.max.equals(this.max)}});var Fi=new n,Jf=new n;Object.assign(Ig.prototype,{set:function(a,b){this.start.copy(a);this.end.copy(b);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.start.copy(a.start);this.end.copy(a.end);return this},getCenter:function(a){void 0=== a&&(console.warn("THREE.Line3: .getCenter() target is now required"),a=new n);return a.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(a){void 0===a&&(console.warn("THREE.Line3: .delta() target is now required"),a=new n);return a.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(a,b){void 0===b&&(console.warn("THREE.Line3: .at() target is now required"),b= -new n);return this.delta(b).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(a,b){Ci.subVectors(a,this.start);Jf.subVectors(this.end,this.start);a=Jf.dot(Jf);a=Jf.dot(Ci)/a;b&&(a=N.clamp(a,0,1));return a},closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);void 0===c&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),c=new n);return this.delta(c).multiplyScalar(a).add(this.start)},applyMatrix4:function(a){this.start.applyMatrix4(a); -this.end.applyMatrix4(a);return this},equals:function(a){return a.start.equals(this.start)&&a.end.equals(this.end)}});pe.prototype=Object.create(A.prototype);pe.prototype.constructor=pe;pe.prototype.isImmediateRenderObject=!0;var mb=new n,zb=new n,ch=new S,Fk=["a","b","c"];qe.prototype=Object.create(aa.prototype);qe.prototype.constructor=qe;qe.prototype.update=function(){this.object.updateMatrixWorld(!0);ch.getNormalMatrix(this.object.matrixWorld);var a=this.object.matrixWorld,b=this.geometry.attributes.position, -c=this.object.geometry;if(c&&c.isGeometry)for(var d=c.vertices,e=c.faces,f=c=0,g=e.length;f -Math.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);A.prototype.updateMatrixWorld.call(this,a)};var Ji=new n,pf,Gg;tb.prototype=Object.create(A.prototype);tb.prototype.constructor=tb;tb.prototype.setDirection=function(a){.99999a.y?this.quaternion.set(1,0,0,0):(Ji.set(a.z,0,-a.x).normalize(),this.quaternion.setFromAxisAngle(Ji,Math.acos(a.y)))};tb.prototype.setLength=function(a, -b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(0,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};tb.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};tb.prototype.copy=function(a){A.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};tb.prototype.clone=function(){return(new this.constructor).copy(this)};ve.prototype=Object.create(aa.prototype); -ve.prototype.constructor=ve;C.create=function(a,b){console.log("THREE.Curve.create() has been deprecated");a.prototype=Object.create(C.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};Object.assign(rb.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getPoints(a);return this.createGeometry(a)},createSpacedPointsGeometry:function(a){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."); -a=this.getSpacedPoints(a);return this.createGeometry(a)},createGeometry:function(a){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var b=new F,c=0,d=a.length;cMath.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.children[0].material.side=0>b?1:0;this.lookAt(this.plane.normal);C.prototype.updateMatrixWorld.call(this,a)};var Mi=new n,pf,Jg;tb.prototype=Object.create(C.prototype);tb.prototype.constructor=tb;tb.prototype.setDirection=function(a){.99999a.y?this.quaternion.set(1,0,0,0):(Mi.set(a.z,0,-a.x).normalize(),this.quaternion.setFromAxisAngle(Mi,Math.acos(a.y)))};tb.prototype.setLength=function(a, +b,c){void 0===b&&(b=.2*a);void 0===c&&(c=.2*b);this.line.scale.set(1,Math.max(1E-4,a-b),1);this.line.updateMatrix();this.cone.scale.set(c,b,c);this.cone.position.y=a;this.cone.updateMatrix()};tb.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};tb.prototype.copy=function(a){C.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};tb.prototype.clone=function(){return(new this.constructor).copy(this)};ve.prototype=Object.create(T.prototype); +ve.prototype.constructor=ve;E.create=function(a,b){console.log("THREE.Curve.create() has been deprecated");a.prototype=Object.create(E.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};Object.assign(rb.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getPoints(a);return this.createGeometry(a)},createSpacedPointsGeometry:function(a){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."); +a=this.getSpacedPoints(a);return this.createGeometry(a)},createGeometry:function(a){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var b=new G,c=0,d=a.length;c 0 ? [ + 'uniform mat4 modelViewMatrices[' + numMultiviewViews + '];', + 'uniform mat3 normalMatrices[' + numMultiviewViews + '];', + 'uniform mat4 viewMatrices[' + numMultiviewViews + '];', + 'uniform mat4 projectionMatrices[' + numMultiviewViews + '];', + + '#define modelViewMatrix modelViewMatrices[VIEW_ID]', + '#define normalMatrix normalMatrices[VIEW_ID]', + '#define viewMatrix viewMatrices[VIEW_ID]', + '#define projectionMatrix projectionMatrices[VIEW_ID]' + + ].join( '\n' ) : [ + + 'uniform mat4 modelViewMatrix;', + 'uniform mat4 projectionMatrix;', + 'uniform mat4 viewMatrix;', + 'uniform mat3 normalMatrix;', + + ].join( '\n' ), + 'attribute vec3 position;', 'attribute vec3 normal;', 'attribute vec2 uv;', @@ -17797,9 +17826,15 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, ( ( material.extensions ? material.extensions.shaderTextureLOD : false ) || parameters.envMap ) && ( capabilities.isWebGL2 || extensions.get( 'EXT_shader_texture_lod' ) ) ? '#define TEXTURE_LOD_EXT' : '', - 'uniform mat4 viewMatrix;', 'uniform vec3 cameraPosition;', + numMultiviewViews > 0 ? [ + + 'uniform mat4 viewMatrices[' + numMultiviewViews + '];', + '#define viewMatrix viewMatrices[VIEW_ID]' + + ].join( '\n' ) : 'uniform mat4 viewMatrix;', + ( parameters.toneMapping !== NoToneMapping ) ? '#define TONE_MAPPING' : '', ( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below ( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '', @@ -17853,6 +17888,15 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, // GLSL 3.0 conversion prefixVertex = [ '#version 300 es\n', + + numMultiviewViews > 0 ? [ + + '#extension GL_OVR_multiview2 : require', + 'layout(num_views = ' + numMultiviewViews + ') in;', + '#define VIEW_ID gl_ViewID_OVR' + + ].join( '\n' ) : '', + '#define attribute in', '#define varying out', '#define texture2D texture' @@ -17860,6 +17904,12 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, prefixFragment = [ '#version 300 es\n', + numMultiviewViews > 0 ? [ + + '#extension GL_OVR_multiview2 : require', + '#define VIEW_ID gl_ViewID_OVR' + + ].join( '\n' ) : '', '#define varying in', isGLSL3ShaderMaterial ? '' : 'out highp vec4 pc_fragColor;', isGLSL3ShaderMaterial ? '' : '#define gl_FragColor pc_fragColor', @@ -18017,6 +18067,7 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, this.program = program; this.vertexShader = glVertexShader; this.fragmentShader = glFragmentShader; + this.numMultiviewViews = numMultiviewViews; return this; @@ -20385,7 +20436,8 @@ function WebGLState( gl, extensions, utils, capabilities ) { stencilBuffer.setTest( stencilWrite ); if ( stencilWrite ) { - stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilMask ); + stencilBuffer.setMask( material.stencilWriteMask ); + stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilFuncMask ); stencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass ); } @@ -20946,6 +20998,21 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } + if ( renderTarget.isWebGLMultiviewRenderTarget ) { + + _gl.deleteTexture( renderTargetProperties.__webglColorTexture ); + _gl.deleteTexture( renderTargetProperties.__webglDepthStencilTexture ); + + info.memory.textures -= 2; + + for ( var i = 0, il = renderTargetProperties.__webglViewFramebuffers.length; i < il; i ++ ) { + + _gl.deleteFramebuffer( renderTargetProperties.__webglViewFramebuffers[ i ] ); + + } + + } + properties.remove( renderTarget.texture ); properties.remove( renderTarget ); @@ -21632,6 +21699,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, var isCube = ( renderTarget.isWebGLRenderTargetCube === true ); var isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true ); + var isMultiview = ( renderTarget.isWebGLMultiviewRenderTarget === true ); var supportsMips = isPowerOfTwo( renderTarget ) || capabilities.isWebGL2; // Setup framebuffer @@ -21684,6 +21752,56 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } + } else if ( isMultiview ) { + + if ( capabilities.multiview ) { + + var width = renderTarget.width; + var height = renderTarget.height; + var numViews = renderTarget.numViews; + + _gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer ); + + var ext = extensions.get( 'OVR_multiview2' ); + + info.memory.textures += 2; + + var colorTexture = _gl.createTexture(); + _gl.bindTexture( 35866, colorTexture ); + _gl.texParameteri( 35866, 10240, 9728 ); + _gl.texParameteri( 35866, 10241, 9728 ); + _gl.texImage3D( 35866, 0, 32856, width, height, numViews, 0, 6408, 5121, null ); + ext.framebufferTextureMultiviewOVR( 36160, 36064, colorTexture, 0, 0, numViews ); + + var depthStencilTexture = _gl.createTexture(); + _gl.bindTexture( 35866, depthStencilTexture ); + _gl.texParameteri( 35866, 10240, 9728 ); + _gl.texParameteri( 35866, 10241, 9728 ); + _gl.texImage3D( 35866, 0, 35056, width, height, numViews, 0, 34041, 34042, null ); + ext.framebufferTextureMultiviewOVR( 36160, 33306, depthStencilTexture, 0, 0, numViews ); + + var viewFramebuffers = new Array( numViews ); + for ( var i = 0; i < numViews; ++ i ) { + + viewFramebuffers[ i ] = _gl.createFramebuffer(); + _gl.bindFramebuffer( 36160, viewFramebuffers[ i ] ); + _gl.framebufferTextureLayer( 36160, 36064, colorTexture, 0, i ); + + } + + renderTargetProperties.__webglColorTexture = colorTexture; + renderTargetProperties.__webglDepthStencilTexture = depthStencilTexture; + renderTargetProperties.__webglViewFramebuffers = viewFramebuffers; + + _gl.bindFramebuffer( 36160, null ); + _gl.bindTexture( 35866, null ); + + } else { + + console.warn( 'THREE.WebGLRenderer: WebGLMultiviewRenderTarget can only be used with WebGL2 and Multiview extension support.' ); + + } + } } @@ -21709,7 +21827,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, state.bindTexture( 34067, null ); - } else { + } else if ( ! isMultiview ) { state.bindTexture( 3553, textureProperties.__webglTexture ); setTextureParameters( 3553, renderTarget.texture, supportsMips ); @@ -22046,6 +22164,258 @@ function WebGLUtils( gl, extensions, capabilities ) { } +/** + * @author fernandojsg / http://fernandojsg.com + * @author Takahiro https://github.com/takahirox + */ + +function WebGLMultiviewRenderTarget( width, height, numViews, options ) { + + WebGLRenderTarget.call( this, width, height, options ); + + this.depthBuffer = false; + this.stencilBuffer = false; + + this.numViews = numViews; + +} + +WebGLMultiviewRenderTarget.prototype = Object.assign( Object.create( WebGLRenderTarget.prototype ), { + + constructor: WebGLMultiviewRenderTarget, + + isWebGLMultiviewRenderTarget: true, + + copy: function ( source ) { + + WebGLRenderTarget.prototype.copy.call( this, source ); + + this.numViews = source.numViews; + + return this; + + }, + + setNumViews: function ( numViews ) { + + if ( this.numViews !== numViews ) { + + this.numViews = numViews; + this.dispose(); + + } + + return this; + + } + +} ); + +/** + * @author fernandojsg / http://fernandojsg.com + * @author Takahiro https://github.com/takahirox + */ + +function WebGLMultiview( renderer, gl ) { + + var DEFAULT_NUMVIEWS = 2; + + var capabilities = renderer.capabilities; + var properties = renderer.properties; + + var maxNumViews = capabilities.maxMultiviewViews; + + var renderTarget, currentRenderTarget; + var mat3, mat4, cameraArray, renderSize; + + function getCameraArray( camera ) { + + if ( camera.isArrayCamera ) return camera.cameras; + + cameraArray[ 0 ] = camera; + + return cameraArray; + + } + + // + + function updateCameraProjectionMatricesUniform( camera, uniforms ) { + + var cameras = getCameraArray( camera ); + + for ( var i = 0; i < cameras.length; i ++ ) { + + mat4[ i ].copy( cameras[ i ].projectionMatrix ); + + } + + uniforms.setValue( gl, 'projectionMatrices', mat4 ); + + } + + function updateCameraViewMatricesUniform( camera, uniforms ) { + + var cameras = getCameraArray( camera ); + + for ( var i = 0; i < cameras.length; i ++ ) { + + mat4[ i ].copy( cameras[ i ].matrixWorldInverse ); + + } + + uniforms.setValue( gl, 'viewMatrices', mat4 ); + + } + + function updateObjectMatricesUniforms( object, camera, uniforms ) { + + var cameras = getCameraArray( camera ); + + for ( var i = 0; i < cameras.length; i ++ ) { + + mat4[ i ].multiplyMatrices( cameras[ i ].matrixWorldInverse, object.matrixWorld ); + mat3[ i ].getNormalMatrix( mat4[ i ] ); + + } + + uniforms.setValue( gl, 'modelViewMatrices', mat4 ); + uniforms.setValue( gl, 'normalMatrices', mat3 ); + + } + + function isMultiviewCompatible( camera ) { + + if ( ! camera.isArrayCamera ) return true; + + var cameras = camera.cameras; + + if ( cameras.length > maxNumViews ) return false; + + for ( var i = 1, il = cameras.length; i < il; i ++ ) { + + if ( cameras[ 0 ].viewport.z !== cameras[ i ].viewport.z || + cameras[ 0 ].viewport.w !== cameras[ i ].viewport.w ) return false; + + } + + return true; + + } + + function resizeRenderTarget( camera ) { + + if ( currentRenderTarget ) { + + renderSize.set( currentRenderTarget.width, currentRenderTarget.height ); + + } else { + + renderer.getDrawingBufferSize( renderSize ); + + } + + if ( camera.isArrayCamera ) { + + var viewport = camera.cameras[ 0 ].viewport; + + renderTarget.setSize( viewport.z, viewport.w ); + + renderTarget.setNumViews( camera.cameras.length ); + + } else { + + renderTarget.setSize( renderSize.x, renderSize.y ); + renderTarget.setNumViews( DEFAULT_NUMVIEWS ); + + } + + } + + function attachCamera( camera ) { + + if ( ! isMultiviewCompatible( camera ) ) return; + + currentRenderTarget = renderer.getRenderTarget(); + resizeRenderTarget( camera ); + renderer.setRenderTarget( renderTarget ); + + } + + function detachCamera( camera ) { + + if ( renderTarget !== renderer.getRenderTarget() ) return; + + renderer.setRenderTarget( currentRenderTarget ); + flush( camera ); + + } + + function flush( camera ) { + + var srcRenderTarget = renderTarget; + var numViews = srcRenderTarget.numViews; + + var srcFramebuffers = properties.get( srcRenderTarget ).__webglViewFramebuffers; + + var viewWidth = srcRenderTarget.width; + var viewHeight = srcRenderTarget.height; + + if ( camera.isArrayCamera ) { + + for ( var i = 0; i < numViews; i ++ ) { + + var viewport = camera.cameras[ i ].viewport; + + var x1 = viewport.x; + var y1 = viewport.y; + var x2 = x1 + viewport.z; + var y2 = y1 + viewport.w; + + gl.bindFramebuffer( 36008, srcFramebuffers[ i ] ); + gl.blitFramebuffer( 0, 0, viewWidth, viewHeight, x1, y1, x2, y2, 16384, 9728 ); + + } + + } else { + + gl.bindFramebuffer( 36008, srcFramebuffers[ 0 ] ); + gl.blitFramebuffer( 0, 0, viewWidth, viewHeight, 0, 0, renderSize.x, renderSize.y, 16384, 9728 ); + + } + + } + + + if ( renderer.capabilities.multiview ) { + + renderTarget = new WebGLMultiviewRenderTarget( 0, 0, DEFAULT_NUMVIEWS ); + + renderSize = new Vector2(); + mat4 = []; + mat3 = []; + cameraArray = []; + + var maxViews = capabilities.maxMultiviewViews; + + for ( var i = 0; i < maxViews; i ++ ) { + + mat4[ i ] = new Matrix4(); + mat3[ i ] = new Matrix3(); + + } + + } + + + this.attachCamera = attachCamera; + this.detachCamera = detachCamera; + this.updateCameraProjectionMatricesUniform = updateCameraProjectionMatricesUniform; + this.updateCameraViewMatricesUniform = updateCameraViewMatricesUniform; + this.updateObjectMatricesUniforms = updateObjectMatricesUniforms; + +} + /** * @author mrdoob / http://mrdoob.com/ */ @@ -23149,6 +23519,10 @@ function WebGLRenderer( parameters ) { this.vr = vr; + // Multiview + + var multiview = new WebGLMultiview( _this, _gl ); + // shadow map var shadowMap = new WebGLShadowMap( _this, objects, capabilities.maxTextureSize ); @@ -24012,6 +24386,12 @@ function WebGLRenderer( parameters ) { } + if ( capabilities.multiview ) { + + multiview.attachCamera( camera ); + + } + // background.render( currentRenderList, scene, camera, forceClear ); @@ -24066,6 +24446,12 @@ function WebGLRenderer( parameters ) { state.setPolygonOffset( false ); + if ( capabilities.multiview ) { + + multiview.detachCamera( camera ); + + } + if ( vr.enabled ) { vr.submitFrame(); @@ -24212,19 +24598,27 @@ function WebGLRenderer( parameters ) { _currentArrayCamera = camera; - var cameras = camera.cameras; + if ( capabilities.multiview ) { + + renderObject( object, scene, camera, geometry, material, group ); + + } else { + + var cameras = camera.cameras; + + for ( var j = 0, jl = cameras.length; j < jl; j ++ ) { - for ( var j = 0, jl = cameras.length; j < jl; j ++ ) { + var camera2 = cameras[ j ]; - var camera2 = cameras[ j ]; + if ( object.layers.test( camera2.layers ) ) { - if ( object.layers.test( camera2.layers ) ) { + state.viewport( _currentViewport.copy( camera2.viewport ) ); - state.viewport( _currentViewport.copy( camera2.viewport ) ); + currentRenderState.setupLights( camera2 ); - currentRenderState.setupLights( camera2 ); + renderObject( object, scene, camera2, geometry, material, group ); - renderObject( object, scene, camera2, geometry, material, group ); + } } @@ -24519,7 +24913,15 @@ function WebGLRenderer( parameters ) { if ( refreshProgram || _currentCamera !== camera ) { - p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + if ( program.numMultiviewViews > 0 ) { + + multiview.updateCameraProjectionMatricesUniform( camera, p_uniforms ); + + } else { + + p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + + } if ( capabilities.logarithmicDepthBuffer ) { @@ -24567,7 +24969,15 @@ function WebGLRenderer( parameters ) { material.isShaderMaterial || material.skinning ) { - p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + if ( program.numMultiviewViews > 0 ) { + + multiview.updateCameraViewMatricesUniform( camera, p_uniforms ); + + } else { + + p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + + } } @@ -24772,8 +25182,17 @@ function WebGLRenderer( parameters ) { // common matrices - p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix ); - p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix ); + if ( program.numMultiviewViews > 0 ) { + + multiview.updateObjectMatricesUniforms( object, camera, p_uniforms ); + + } else { + + p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix ); + p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix ); + + } + p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld ); return program; @@ -34468,6 +34887,7 @@ function LoadingManager( onLoad, onProgress, onError ) { var itemsLoaded = 0; var itemsTotal = 0; var urlModifier = undefined; + var handlers = []; // Refer to #5689 for the reason why we don't set .onStart // in the constructor @@ -34544,10 +34964,52 @@ function LoadingManager( onLoad, onProgress, onError ) { this.setURLModifier = function ( transform ) { urlModifier = transform; + return this; }; + this.addHandler = function ( regex, loader ) { + + handlers.push( regex, loader ); + + return this; + + }; + + this.removeHandler = function ( regex ) { + + var index = handlers.indexOf( regex ); + + if ( index !== - 1 ) { + + handlers.splice( index, 2 ); + + } + + return this; + + }; + + this.getHandler = function ( file ) { + + for ( var i = 0, l = handlers.length; i < l; i += 2 ) { + + var regex = handlers[ i ]; + var loader = handlers[ i + 1 ]; + + if ( regex.test( file ) ) { + + return loader; + + } + + } + + return null; + + }; + } var DefaultLoadingManager = new LoadingManager(); @@ -34595,41 +35057,6 @@ Object.assign( Loader.prototype, { } ); -// - -Loader.Handlers = { - - handlers: [], - - add: function ( regex, loader ) { - - this.handlers.push( regex, loader ); - - }, - - get: function ( file ) { - - var handlers = this.handlers; - - for ( var i = 0, l = handlers.length; i < l; i += 2 ) { - - var regex = handlers[ i ]; - var loader = handlers[ i + 1 ]; - - if ( regex.test( file ) ) { - - return loader; - - } - - } - - return null; - - } - -}; - /** * @author mrdoob / http://mrdoob.com/ */ @@ -38181,6 +38608,7 @@ MaterialLoader.prototype = Object.assign( Object.create( Loader.prototype ), { if ( json.color !== undefined ) material.color.setHex( json.color ); if ( json.roughness !== undefined ) material.roughness = json.roughness; if ( json.metalness !== undefined ) material.metalness = json.metalness; + if ( json.sheen !== undefined ) material.sheen = new Color().setHex( json.sheen ); if ( json.emissive !== undefined ) material.emissive.setHex( json.emissive ); if ( json.specular !== undefined ) material.specular.setHex( json.specular ); if ( json.shininess !== undefined ) material.shininess = json.shininess; @@ -38198,6 +38626,16 @@ MaterialLoader.prototype = Object.assign( Object.create( Loader.prototype ), { if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; + + if ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite; + if ( json.stencilWriteMask !== undefined ) material.stencilWriteMask = json.stencilWriteMask; + if ( json.stencilFunc !== undefined ) material.stencilFunc = json.stencilFunc; + if ( json.stencilRef !== undefined ) material.stencilRef = json.stencilRef; + if ( json.stencilFuncMask !== undefined ) material.stencilFuncMask = json.stencilFuncMask; + if ( json.stencilFail !== undefined ) material.stencilFail = json.stencilFail; + if ( json.stencilZFail !== undefined ) material.stencilZFail = json.stencilZFail; + if ( json.stencilZPass !== undefined ) material.stencilZPass = json.stencilZPass; + if ( json.wireframe !== undefined ) material.wireframe = json.wireframe; if ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth; if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap; @@ -46558,7 +46996,7 @@ ArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) { if ( headLength === undefined ) headLength = 0.2 * length; if ( headWidth === undefined ) headWidth = 0.2 * headLength; - this.line.scale.set( 1, Math.max( 0, length - headLength ), 1 ); + this.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458 this.line.updateMatrix(); this.cone.scale.set( headWidth, headLength, headWidth ); @@ -46971,6 +47409,22 @@ Object.assign( Loader.prototype, { } ); +Loader.Handlers = { + + add: function ( /* regex, loader */ ) { + + console.error( 'THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.' ); + + }, + + get: function ( /* file */ ) { + + console.error( 'THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.' ); + + } + +}; + function XHRLoader( manager ) { console.warn( 'THREE.XHRLoader has been renamed to THREE.FileLoader.' ); @@ -47858,6 +48312,21 @@ Object.defineProperties( Material.prototype, { console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' ); this.flatShading = ( value === FlatShading ); + } + }, + + stencilMask: { + get: function () { + + console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' ); + return this.stencilFuncMask; + + }, + set: function ( value ) { + + console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' ); + this.stencilFuncMask = value; + } } @@ -48489,4 +48958,14 @@ function LensFlare() { } +if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + + /* eslint-disable no-undef */ + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: { + revision: REVISION, + } } ) ); + /* eslint-enable no-undef */ + +} + export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveBlending, AlphaFormat, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightProbe, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, AxisHelper, BackSide, BasicDepthPacking, BasicShadowMap, BinaryTextureLoader, Bone, BooleanKeyframeTrack, BoundingBoxHelper, Box2, Box3, Box3Helper, BoxBufferGeometry, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasRenderer, CanvasTexture, CatmullRomCurve3, CineonToneMapping, CircleBufferGeometry, CircleGeometry, ClampToEdgeWrapping, Clock, ClosedSplineCurve3, Color, ColorKeyframeTrack, CompressedTexture, CompressedTextureLoader, ConeBufferGeometry, ConeGeometry, CubeCamera, BoxGeometry as CubeGeometry, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubeUVRefractionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CylinderBufferGeometry, CylinderGeometry, Cylindrical, DataTexture, DataTexture2DArray, DataTexture3D, DataTextureLoader, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DirectionalLight, DirectionalLightHelper, DirectionalLightShadow, DiscreteInterpolant, DodecahedronBufferGeometry, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicBufferAttribute, EdgesGeometry, EdgesHelper, EllipseCurve, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeBufferGeometry, ExtrudeGeometry, Face3, Face4, FaceColors, FaceNormalsHelper, FileLoader, FlatShading, Float32Attribute, Float32BufferAttribute, Float64Attribute, Float64BufferAttribute, FloatType, Fog, FogExp2, Font, FontLoader, FrontFaceDirectionCCW, FrontFaceDirectionCW, FrontSide, Frustum, GammaEncoding, Geometry, GeometryUtils, GreaterDepth, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, HemisphereLightProbe, IcosahedronBufferGeometry, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, ImmediateRenderObject, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, Int16Attribute, Int16BufferAttribute, Int32Attribute, Int32BufferAttribute, Int8Attribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, JSONLoader, KeepStencilOp, KeyframeTrack, LOD, LatheBufferGeometry, LatheGeometry, Layers, LensFlare, LessDepth, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, LightProbeHelper, LightShadow, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LinePieces, LineSegments, LineStrip, LinearEncoding, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearToneMapping, Loader, LoaderUtils, LoadingManager, LogLuvEncoding, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, _Math as Math, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshFaceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiMaterial, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeverDepth, NeverStencilFunc, NoBlending, NoColors, NoToneMapping, NormalBlending, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronBufferGeometry, OctahedronGeometry, OneFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, ParametricBufferGeometry, ParametricGeometry, Particle, ParticleBasicMaterial, ParticleSystem, ParticleSystemMaterial, Path, PerspectiveCamera, Plane, PlaneBufferGeometry, PlaneGeometry, PlaneHelper, PointCloud, PointCloudMaterial, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronBufferGeometry, PolyhedronGeometry, PositionalAudio, PositionalAudioHelper, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, REVISION, RGBADepthPacking, RGBAFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBDEncoding, RGBEEncoding, RGBEFormat, RGBFormat, RGBM16Encoding, RGBM7Encoding, RGB_ETC1_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RectAreaLightHelper, RedFormat, ReinhardToneMapping, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingBufferGeometry, RingGeometry, Scene, SceneUtils, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeBufferGeometry, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, SmoothShading, Sphere, SphereBufferGeometry, SphereGeometry, Spherical, SphericalHarmonics3, SphericalReflectionMapping, Spline, SplineCurve, SplineCurve3, SpotLight, SpotLightHelper, SpotLightShadow, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StereoCamera, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronBufferGeometry, TetrahedronGeometry, TextBufferGeometry, TextGeometry, Texture, TextureLoader, TorusBufferGeometry, TorusGeometry, TorusKnotBufferGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeBufferGeometry, TubeGeometry, UVMapping, Uint16Attribute, Uint16BufferAttribute, Uint32Attribute, Uint32BufferAttribute, Uint8Attribute, Uint8BufferAttribute, Uint8ClampedAttribute, Uint8ClampedBufferAttribute, Uncharted2ToneMapping, Uniform, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShort565Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, Vertex, VertexColors, VertexNormalsHelper, VideoTexture, WebGLMultisampleRenderTarget, WebGLRenderTarget, WebGLRenderTargetCube, WebGLRenderer, WebGLUtils, WireframeGeometry, WireframeHelper, WrapAroundEnding, XHRLoader, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, sRGBEncoding }; diff --git a/docs/api/en/materials/Material.html b/docs/api/en/materials/Material.html index fc56072ce3cf603c1d334c604b043a8a6bcbe679..1e73ee5e5fc9fe98d2600eddf6f75f0734d95402 100644 --- a/docs/api/en/materials/Material.html +++ b/docs/api/en/materials/Material.html @@ -128,6 +128,11 @@ Whether rendering this material has any effect on the stencil buffer. Default is *false*.

+

[property:Boolean stencilWriteMask]

+

+ The bit mask to use when writing to the stencil buffer. Default is *0xFF*. +

+

[property:Boolean stencilFunc]

The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values. @@ -138,9 +143,9 @@ The value to use when performing stencil comparisons or stencil operations. Default is *0*.

-

[property:Boolean stencilMask]

+

[property:Boolean stencilFuncMask]

- The bit mask to use when comparing against or writing to the stencil buffer. Default is *0xFF*. + The bit mask to use when comparing against the stencil buffer. Default is *0xFF*.

[property:Integer stencilFail]

diff --git a/docs/api/zh/materials/Material.html b/docs/api/zh/materials/Material.html index 4db830a1f5ed75be419ea6a656be663eca64487e..2e01a1d9cc89affe352f850a273f5a591905e1d5 100644 --- a/docs/api/zh/materials/Material.html +++ b/docs/api/zh/materials/Material.html @@ -108,6 +108,11 @@ Whether rendering this material has any effect on the stencil buffer. Default is *false*.

+

[property:Boolean stencilWriteMask]

+

+The bit mask to use when writing to the stencil buffer. Default is *0xFF*. +

+

[property:Boolean stencilFunc]

The stencil comparison function to use. Default is [page:Materials AlwaysStencilFunc]. See stencil function [page:Materials constants] for all possible values. @@ -118,9 +123,9 @@ The stencil comparison function to use. Default is [page:Materials AlwaysStencil The value to use when performing stencil comparisons or stencil operations. Default is *0*.

-

[property:Boolean stencilMask]

+

[property:Boolean stencilFuncMask]

-The bit mask to use when comparing against or writing to the stencil buffer. Default is *0xFF*. +The bit mask to use when comparing against the stencil buffer. Default is *0xFF*.

[property:Integer stencilFail]

diff --git a/docs/examples/en/controls/DeviceOrientationControls.html b/docs/examples/en/controls/DeviceOrientationControls.html new file mode 100644 index 0000000000000000000000000000000000000000..34cdd9ea0cb4b892e4dac56202cd7e8e3b0715dd --- /dev/null +++ b/docs/examples/en/controls/DeviceOrientationControls.html @@ -0,0 +1,89 @@ + + + + + + + + + + + +

[name]

+ +

+ Can be used to orient the camera based on the mobile device's orientation. +

+ +

Example

+ +

[example:misc_controls_deviceorientation misc / controls / deviceorientation ]

+ +

Constructor

+ +

[name]( [param:Camera object] )

+

+

+ [page:Camera object]: The camera to be controlled. +

+

+ Creates a new instance of [name]. +

+

+ +

Properties

+ +

[property:Number alphaOffset]

+

+ The alpha offset in radians. Default is *0*. +

+ +

[property:Object deviceOrientation]

+

+ The current *deviceorientation* event object. +

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. +

+ +

[property:Camera object]

+

+ The camera to be controlled. +

+ +

[property:Number screenOrientation]

+

+ The orientation in degrees (in 90-degree increments) of the viewport relative to the device's natural orientation. Default is *0*. +

+ +

Methods

+ +

[method:null connect] ()

+

+ Adds the event listeners of the controls and enables it. +

+ +

[method:null disconnect] ()

+

+ Removes the event listeners of the controls and disables it. +

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:null update] ()

+

+ Updates the controls. Usually called in the animation loop. +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/DeviceOrientationControls.js examples/js/controls/DeviceOrientationControls.js] +

+ + diff --git a/docs/examples/en/controls/DragControls.html b/docs/examples/en/controls/DragControls.html new file mode 100644 index 0000000000000000000000000000000000000000..a22c12445d66accfddb95de347f30e04bd8ae61d --- /dev/null +++ b/docs/examples/en/controls/DragControls.html @@ -0,0 +1,119 @@ + + + + + + + + + + + [page:EventDispatcher] → + +

[name]

+ +

+ This class can be used to provide a drag'n'drop interaction. +

+ +

Example

+ +

[example:misc_controls_drag misc / controls / drag ]

+ + +var controls = new THREE.DragControls( objects, camera, renderer.domElement ); + +// add event listener to highlight dragged objects + +controls.addEventListener( 'dragstart', function ( event ) { + + event.object.material.emissive.set( 0xaaaaaa ); + +} ); + +controls.addEventListener( 'dragend', function ( event ) { + + event.object.material.emissive.set( 0x000000 ); + +} ); + + + +

Constructor

+ +

[name]( [param:Array objects], [param:Camera camera], [param:HTMLDOMElement domElement] )

+

+

+ [page:Array objects]: An array of draggable 3D objects. +

+

+ [page:Camera camera]: The camera of the rendered scene. +

+

+ [page:HTMLDOMElement domElement]: The HTML element used for event listeners. +

+

+ Creates a new instance of [name]. +

+

+ +

Events

+ +

dragstart

+

+ Fires when the user starts to drag a 3D object. +

+ +

drag

+

+ Fires when the user drags a 3D object. +

+ +

dragend

+

+ Fires when the user has finished dragging a 3D object. +

+ +

hoveron

+

+ Fires when the pointer is moved onto a 3D object, or onto one of its children. +

+ +

hoveroff

+

+ Fires when the pointer is moved out of a 3D object. +

+ +

Properties

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. +

+ +

Methods

+ +

See the base [page:EventDispatcher] class for common methods.

+ +

[method:null activate] ()

+

+ Adds the event listeners of the controls. +

+ +

[method:null deactivate] ()

+

+ Removes the event listeners of the controls. +

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/DragControls.js examples/js/controls/DragControls.js] +

+ + diff --git a/docs/examples/en/controls/FirstPersonControls.html b/docs/examples/en/controls/FirstPersonControls.html new file mode 100644 index 0000000000000000000000000000000000000000..b1032350e86125b436a16f1b218695a5dcc3767e --- /dev/null +++ b/docs/examples/en/controls/FirstPersonControls.html @@ -0,0 +1,166 @@ + + + + + + + + + + + +

[name]

+ +

+ This class is an alternative implementation of [page:FlyControls]. +

+ +

Example

+ +

[example:webgl_geometry_terrain webgl / geometry / terrain ]

+ +

Constructor

+ +

[name]( [param:Camera object], [param:HTMLDOMElement domElement] )

+

+

+ [page:Camera object]: The camera to be controlled. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document, + however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here. +

+

+ Creates a new instance of [name]. +

+

+ +

Properties

+ +

[property:Boolean activeLook]

+

+ Whether or not it's possible to look around. Default is *true*. +

+ +

[property:Boolean autoForward]

+

+ Whether or not the camera is automatically moved forward. Default is *false*. +

+ +

[property:Boolean constrainVertical]

+

+ Whether or not looking around is vertically constrained by [[page:.verticalMin], [page:.verticalMax]]. Default is *false*. +

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the whole document. +

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. Default is *true*. +

+ +

[property:Number heightCoef]

+

+ Determines how much faster the camera moves when it's y-component is near [page:.heightMax]. Default is *1*. +

+ +

[property:Number heightMax]

+

+ Upper camera height limit used for movement speed adjusment. Default is *1*. +

+ +

[property:Number heightMin]

+

+ Lower camera height limit used for movement speed adjusment. Default is *0*. +

+ +

[property:Boolean heightSpeed]

+

+ Whether or not the camera's height influences the forward movement speed. Default is *false*. + Use the properties [page:.heightCoef], [page:.heightMin] and [page:.heightMax] for configuration. +

+ +

[property:Boolean lookVertical]

+

+ Whether or not it's possible to vertically look around. Default is *true*. +

+ +

[property:Number lookSpeed]

+

+ The look around speed. Default is *0.005*. +

+ +

[property:Boolean mouseDragOn]

+

+ Whether or not the mouse is pressed down. Read-only property. +

+ +

[property:Number movementSpeed]

+

+ The movement speed. Default is *1*. +

+ +

[property:Camera object]

+

+ The camera to be controlled. +

+ +

[property:Number verticalMax]

+

+ How far you can vertically look around, upper limit. Range is 0 to Math.PI radians. Default is *Math.PI*. +

+ +

[property:Number verticalMin]

+

+ How far you can vertically look around, lower limit. Range is 0 to Math.PI radians. Default is *0*. +

+ +

Methods

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:null handleResize] ()

+

+ Should be called if the application window is resized. +

+ +

[method:FirstPersonControls lookAt]( [param:Vector3 vector] )
+ [method:FirstPersonControls lookAt]( [param:Float x], [param:Float y], [param:Float z] )

+

+

+

+ vector - A vector representing the target position. +

+

+ Optionally, the x, y, z components of the world space position. +

+

+

+ Ensures the controls orient the camera towards the defined target position. +

+

+ +

[method:null update] ( [param:Number delta] )

+

+

+ [page:Number delta]: Time delta value. +

+

+ Updates the controls. Usually called in the animation loop. +

+

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/FirstPersonControls.js examples/js/controls/FirstPersonControls.js] +

+ + diff --git a/docs/examples/en/controls/FlyControls.html b/docs/examples/en/controls/FlyControls.html new file mode 100644 index 0000000000000000000000000000000000000000..06f1631e848d78f451c20c988ff960c1866f967b --- /dev/null +++ b/docs/examples/en/controls/FlyControls.html @@ -0,0 +1,95 @@ + + + + + + + + + + + +

[name]

+ +

+ [name] enables a navigation similar to fly modes in DCC tools like Blender. You can arbitrarily transform the camera in + 3D space without any limitations (e.g. focus on a specific target). +

+ +

Example

+ +

[example:misc_controls_fly misc / controls / fly ]

+ +

Constructor

+ +

[name]( [param:Camera object], [param:HTMLDOMElement domElement] )

+

+

+ [page:Camera object]: The camera to be controlled. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document, + however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here. +

+

+ Creates a new instance of [name]. +

+

+ +

Properties

+ +

[property:Boolean autoForward]

+

+ If set to *true*, the camera automatically moves forward (and does not stop) when initially translated. Default is *false*. +

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the whole document. +

+ +

[property:Boolean dragToLook]

+

+ If set to *true*, you can only look around by performing a drag interaction. Default is *false*. +

+ +

[property:Number movementSpeed]

+

+ The movement speed. Default is *1*. +

+ +

[property:Camera object]

+

+ The camera to be controlled. +

+ +

[property:Number rollSpeed]

+

+ The rotation speed. Default is *0.005*. +

+ +

Methods

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:null update] ( [param:Number delta] )

+

+

+ [page:Number delta]: Time delta value. +

+

+ Updates the controls. Usually called in the animation loop. +

+

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/FlyControls.js examples/js/controls/FlyControls.js] +

+ + diff --git a/docs/examples/en/controls/OrthographicTrackballControls.html b/docs/examples/en/controls/OrthographicTrackballControls.html new file mode 100644 index 0000000000000000000000000000000000000000..1b12f89a2975ed7b6a4b4cc0bce6f65c4218852e --- /dev/null +++ b/docs/examples/en/controls/OrthographicTrackballControls.html @@ -0,0 +1,187 @@ + + + + + + + + + + + [page:EventDispatcher] → + +

[name]

+ +

+

+ This class is a special version of [page:TrackballControls] which supports orthographic cameras. +

+

+ +

Example

+ +

[example:misc_controls_trackball_orthographic misc / controls / trackball / orthographic ]

+ +

Constructor

+ +

[name]( [param:OrthographicCamera camera], [param:HTMLDOMElement domElement] )

+

+

+ [page:OrthographicCamera camera]: The orthographic camera of the rendered scene. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document, + however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here. +

+

+ Creates a new instance of [name]. +

+

+ +

Events

+ +

change

+

+ Fires when the camera has been transformed by the controls. +

+ +

start

+

+ Fires when an interaction (e.g. touch) was initiated. +

+ +

end

+

+ Fires when an interaction has finished. +

+ +

Properties

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the whole document. +

+ +

[property:Number dynamicDampingFactor]

+

+ Defines the intensity of damping. Only considered if [page:.staticMoving staticMoving] is set to *false*. Default is *0.2*. +

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. +

+ +

[property:Array keys]

+

+ This array holds keycodes for controlling interactions. +

    +
  • When the first defined key is pressed, all mouse interactions (left, middle, right) performs orbiting.
  • +
  • When the second defined key is pressed, all mouse interactions (left, middle, right) performs zooming.
  • +
  • When the third defined key is pressed, all mouse interactions (left, middle, right) performs panning.
  • +
+ Default is *65, 83, 68* which represents A, S, D. +

+ +

[property:Boolean noPan]

+

+ Whether or not panning is disabled. Default is *false*. +

+ +

[property:Boolean noRoll]

+

+ Whether or not rolling is disabled. Default is *false*. +

+ +

[property:Boolean noRotate]

+

+ Whether or not rotation is disabled. Default is *false*. +

+ +

[property:Boolean noZoom]

+

+ Whether or not zooming is disabled. Default is *false*. +

+ +

[property:OrthographicCamera object]

+

+ The camera being controlled. +

+ +

[property:Number panSpeed]

+

+ The zoom speed. Default is *0.3*. +

+ +

[property:Number rotateSpeed]

+

+ The rotation speed. Default is *1.0*. +

+ +

[property:Object screen]

+

+ Represents the properties of the screen. Automatically set when [page:.handleResize handleResize]() is called. +

    +
  • left: Represents the offset in pixels to the screen's left boundary.
  • +
  • top: Represents the offset in pixels to the screen's top boundary.
  • +
  • width: Represents the screen width in pixels.
  • +
  • height: Represents the screen height in pixels.
  • +
+

+ +

[property:Boolean staticMoving]

+

+ Whether or not damping is disabled. Default is *false*. +

+ +

[property:Number zoomSpeed]

+

+ The zoom speed. Default is *1.2*. +

+ +

Methods

+ + +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:null handleResize] ()

+

+ Should be called if the application window is resized. +

+ +

[method:null panCamera] ()

+

+ Performs panning if necessary. Called by [page:.update update](). +

+ +

[method:null reset] ()

+

+ Resets the controls to its initial state. +

+ +

[method:null rotateCamera] ()

+

+ Rotates the camera if necessary. Called by [page:.update update](). +

+ +

[method:null update] ()

+

+ Updates the controls. Usually called in the animation loop. +

+ +

[method:null zoomCamera] ()

+

+ Performs zooming if necessary. Called by [page:.update update](). +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js examples/js/controls/TrackballControls.js] +

+ + diff --git a/docs/examples/en/controls/PointerLockControls.html b/docs/examples/en/controls/PointerLockControls.html new file mode 100644 index 0000000000000000000000000000000000000000..c36c54e6239f0179ef0d846cb7ffd60c894252fd --- /dev/null +++ b/docs/examples/en/controls/PointerLockControls.html @@ -0,0 +1,149 @@ + + + + + + + + + + + [page:EventDispatcher] → + +

[name]

+ +

+ The implementation of this class is based on the [link:https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API Pointer Lock API]. + [name] is a perfect choice for first person 3D games. +

+ +

Example

+ +

[example:misc_controls_pointerlock misc / controls / pointerlock ]

+ + +var controls = new PointerLockControls( camera ); + +// add event listener to show/hide a UI (e.g. the game's menu) + +controls.addEventListener( 'lock', function () { + + menu.style.display = 'none'; + +} ); + +controls.addEventListener( 'unlock', function () { + + menu.style.display = 'block'; + +} ); + + + +

Constructor

+ +

[name]( [param:Camera camera], [param:HTMLDOMElement domElement] )

+

+

+ [page:Camera camera]: The camera of the rendered scene. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the document's body. +

+

+ Creates a new instance of [name]. +

+

+ +

Events

+ +

change

+

+ Fires when the user moves the mouse. +

+ +

lock

+

+ Fires when the pointer lock status is "locked" (in other words: the mouse is captured). +

+ +

unlock

+

+ Fires when the pointer lock status is "unlocked" (in other words: the mouse is not captured anymore). +

+ +

Properties

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the document's body. +

+ + +

[property:Boolean isLocked]

+

+ Whether or not the controls are locked. +

+ +

Methods

+ +

See the base [page:EventDispatcher] class for common methods.

+ +

[method:null connect] ()

+

+ Adds the event listeners of the controls. +

+ +

[method:null disconnect] ()

+

+ Removes the event listeners of the controls. +

+ +

[method:Vector3 getDirection] ( [param:Vector3 target] )

+

+

+ [page:Vector3 target]: The target vector. +

+

+ Returns the look direction of the camera. +

+

+ +

[method:null lock] ()

+

+ Activates the pointer lock. +

+ +

[method:null moveForward] ( [param:Number distance] )

+

+

+ [page:Number distance]: The signed distance. +

+

+ Moves the camera forward parallel to the xz-plane. Assumes camera.up is y-up. +

+

+ +

[method:null moveRight] ( [param:Number distance] )

+

+

+ [page:Number distance]: The signed distance. +

+

+ Moves the camera sidewards parallel to the xz-plane. +

+

+ +

[method:null unlock] ()

+

+ Exits the pointer lock. +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/PointerLockControls.js examples/js/controls/PointerLockControls.js] +

+ + diff --git a/docs/examples/en/controls/TrackballControls.html b/docs/examples/en/controls/TrackballControls.html new file mode 100644 index 0000000000000000000000000000000000000000..c460af81ef6a7f8d38023d21bc5c8048c117865c --- /dev/null +++ b/docs/examples/en/controls/TrackballControls.html @@ -0,0 +1,211 @@ + + + + + + + + + + + [page:EventDispatcher] → + +

[name]

+ +

+

+ [name] is similar to [page:OrbitControls]. However, it does not maintain a constant camera [page:Object3D.up up] vector. + That means if the camera orbits over the “north” and “south” poles, it does not flip to stay "right side up". +

+

+ Notice that [name] can only be used with a perspective camera. Use [page:OrthographicTrackballControls] when working with an orthographic camera. +

+

+ +

Example

+ +

[example:misc_controls_trackball misc / controls / trackball ]

+ +

Constructor

+ +

[name]( [param:PerspectiveCamera camera], [param:HTMLDOMElement domElement] )

+

+

+ [page:PerspectiveCamera camera]: The perspective camera of the rendered scene. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document, + however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here. +

+

+ Creates a new instance of [name]. +

+

+ +

Events

+ +

change

+

+ Fires when the camera has been transformed by the controls. +

+ +

start

+

+ Fires when an interaction (e.g. touch) was initiated. +

+ +

end

+

+ Fires when an interaction has finished. +

+ +

Properties

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the whole document. +

+ +

[property:Number dynamicDampingFactor]

+

+ Defines the intensity of damping. Only considered if [page:.staticMoving staticMoving] is set to *false*. Default is *0.2*. +

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. +

+ +

[property:Array keys]

+

+ This array holds keycodes for controlling interactions. +

    +
  • When the first defined key is pressed, all mouse interactions (left, middle, right) performs orbiting.
  • +
  • When the second defined key is pressed, all mouse interactions (left, middle, right) performs zooming.
  • +
  • When the third defined key is pressed, all mouse interactions (left, middle, right) performs panning.
  • +
+ Default is *65, 83, 68* which represents A, S, D. +

+ +

[property:Number maxDistance]

+

+ How far you can zoom in. Default is *Infinity*. +

+ +

[property:Number minDistance]

+

+ How far you can zoom in. Default is *0*. +

+ +

+ [property:Object mouseButtons]

+

+ This object contains references to the mouse actions used by the controls. +

    +
  • .LEFT is assinged with *THREE.MOUSE.ROTATE*
  • +
  • .MIDDLE is assinged with *THREE.MOUSE.ZOOM*
  • +
  • .RIGHT is assinged with *THREE.MOUSE.PAN*
  • +
+

+ +

[property:Boolean noPan]

+

+ Whether or not panning is disabled. Default is *false*. +

+ +

[property:Boolean noRotate]

+

+ Whether or not rotation is disabled. Default is *false*. +

+ +

[property:Boolean noZoom]

+

+ Whether or not zooming is disabled. Default is *false*. +

+ +

[property:PerspectiveCamera object]

+

+ The camera being controlled. +

+ +

[property:Number panSpeed]

+

+ The zoom speed. Default is *0.3*. +

+ +

[property:Number rotateSpeed]

+

+ The rotation speed. Default is *1.0*. +

+ +

[property:Object screen]

+

+ Represents the properties of the screen. Automatically set when [page:.handleResize handleResize]() is called. +

    +
  • left: Represents the offset in pixels to the screen's left boundary.
  • +
  • top: Represents the offset in pixels to the screen's top boundary.
  • +
  • width: Represents the screen width in pixels.
  • +
  • height: Represents the screen height in pixels.
  • +
+

+ +

[property:Boolean staticMoving]

+

+ Whether or not damping is disabled. Default is *false*. +

+ +

[property:Number zoomSpeed]

+

+ The zoom speed. Default is *1.2*. +

+ +

Methods

+ +

[method:null checkDistances] ()

+

+ Ensures the controls stay in the range [minDistance, maxDistance]. Called by [page:.update update](). +

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:null handleResize] ()

+

+ Should be called if the application window is resized. +

+ +

[method:null panCamera] ()

+

+ Performs panning if necessary. Called by [page:.update update](). +

+ +

[method:null reset] ()

+

+ Resets the controls to its initial state. +

+ +

[method:null rotateCamera] ()

+

+ Rotates the camera if necessary. Called by [page:.update update](). +

+ +

[method:null update] ()

+

+ Updates the controls. Usually called in the animation loop. +

+ +

[method:null zoomCamera] ()

+

+ Performs zooming if necessary. Called by [page:.update update](). +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js examples/js/controls/TrackballControls.js] +

+ + diff --git a/docs/examples/en/controls/TransformControls.html b/docs/examples/en/controls/TransformControls.html new file mode 100644 index 0000000000000000000000000000000000000000..b4bcc5b253db41c4f7d6b8417736c157d98f8469 --- /dev/null +++ b/docs/examples/en/controls/TransformControls.html @@ -0,0 +1,225 @@ + + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ This class can be used to transform objects in 3D space by adapting a similar interaction model of DCC tools like Blender. + Unlike other controls, it is not intended to transform the scene's camera. +

+ +

Example

+ +

[example:misc_controls_transform misc / controls / transform ]

+ +

Constructor

+ +

[name]( [param:Camera camera], [param:HTMLDOMElement domElement] )

+

+

+ [page:Camera camera]: The camera of the rendered scene. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document, + however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here. +

+

+ Creates a new instance of [name]. +

+

+ +

Events

+ +

change

+

+ Fires if any type of change (object or property change) is performed. Property changes + are separate events you can add event listeners to. The event type is "propertyname-changed". +

+ +

mouseDown

+

+ Fires if a pointer (mouse/touch) becomes active. +

+ +

mouseUp

+

+ Fires if a pointer (mouse/touch) is no longer active. +

+ +

objectChange

+

+ Fires if the controlled 3D object is changed. +

+ +

Properties

+ +

See the base [page:Object3D] class for common properties.

+ +

[property:String axis]

+

+ The current transformation axis. +

+ +

[property:Camera camera]

+

+ The camera of the rendered scene. +

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the whole document. +

+ +

[property:Boolean dragging]

+

+ Whether or not dragging is currently performed. Read-only property. +

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. +

+ +

[property:String mode]

+

+ The current transformation mode. Possible values are "translate", "rotate" and "scale". Default is *translate*. +

+ +

[property:Object3D object]

+

+ The 3D object being controlled. +

+ +

[property:Number rotationSnap]

+

+ By default, 3D objects are continously rotated. If you set this property to a numeric value (radians), you can define in which + steps the 3D object should be rotated. Deault is *null*. +

+ +

[property:Boolean showX]

+

+ Whether or not the x-axis helper should be visible. Default is *true*. +

+ +

[property:Boolean showY]

+

+ Whether or not the y-axis helper should be visible. Default is *true*. +

+ +

[property:Boolean showZ]

+

+ Whether or not the z-axis helper should be visible. Default is *true*. +

+ +

[property:Number size]

+

+ The size of the helper UI (axes/planes). Default is *1*. +

+ +

[property:String space]

+

+ Defines in which coordinate space transformations should be performed. Possible values are "world" and "local". Default is *world*. +

+ +

[property:Number translationSnap]

+

+ By default, 3D objects are continously translated. If you set this property to a numeric value (world units), you can define in which + steps the 3D object should be translated. Deault is *null*. +

+ +

Methods

+ +

See the base [page:Object3D] class for common methods.

+ +

[method:TransformControls attach] ( [param:Object3D object] )

+

+

+ [page:Object3D object]: The 3D object that should be transformed. +

+

+ Sets the 3D object that should be transformed and ensures the controls UI is visible. +

+

+ +

[method:TransformControls detach] ()

+

+ Removes the current 3D object from the controls and makes the helper UI is invisible. +

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:String getMode] ()

+

+ Returns the transformation mode. +

+ +

[method:null setMode] ( [param:String mode] )

+

+

+ [page:String mode]: The transformation mode. +

+

+ Sets the transformation mode. +

+

+ +

[method:null setRotationSnap] ( [param:Number rotationSnap] )

+

+

+ [page:Number rotationSnap]: The rotation snap. +

+

+ Sets the rotation snap. +

+

+ +

[method:null setSize] ( [param:Number size] )

+

+

+ [page:Number size]: The size of the helper UI. +

+

+ Sets the size of the helper UI. +

+

+ +

[method:null setSpace] ( [param:String space] )

+

+

+ [page:String space]: The coordinate space in which transformations are applied. +

+

+ Sets the coordinate space in which transformations are applied. +

+

+ +

[method:null setTranslationSnap] ( [param:Number translationSnap] )

+

+

+ [page:Number translationSnap]: The translation snap. +

+

+ Sets the translation snap. +

+

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TransformControls.js examples/js/controls/TransformControls.js] +

+ + diff --git a/docs/examples/zh/controls/DeviceOrientationControls.html b/docs/examples/zh/controls/DeviceOrientationControls.html new file mode 100644 index 0000000000000000000000000000000000000000..34cdd9ea0cb4b892e4dac56202cd7e8e3b0715dd --- /dev/null +++ b/docs/examples/zh/controls/DeviceOrientationControls.html @@ -0,0 +1,89 @@ + + + + + + + + + + + +

[name]

+ +

+ Can be used to orient the camera based on the mobile device's orientation. +

+ +

Example

+ +

[example:misc_controls_deviceorientation misc / controls / deviceorientation ]

+ +

Constructor

+ +

[name]( [param:Camera object] )

+

+

+ [page:Camera object]: The camera to be controlled. +

+

+ Creates a new instance of [name]. +

+

+ +

Properties

+ +

[property:Number alphaOffset]

+

+ The alpha offset in radians. Default is *0*. +

+ +

[property:Object deviceOrientation]

+

+ The current *deviceorientation* event object. +

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. +

+ +

[property:Camera object]

+

+ The camera to be controlled. +

+ +

[property:Number screenOrientation]

+

+ The orientation in degrees (in 90-degree increments) of the viewport relative to the device's natural orientation. Default is *0*. +

+ +

Methods

+ +

[method:null connect] ()

+

+ Adds the event listeners of the controls and enables it. +

+ +

[method:null disconnect] ()

+

+ Removes the event listeners of the controls and disables it. +

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:null update] ()

+

+ Updates the controls. Usually called in the animation loop. +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/DeviceOrientationControls.js examples/js/controls/DeviceOrientationControls.js] +

+ + diff --git a/docs/examples/zh/controls/DragControls.html b/docs/examples/zh/controls/DragControls.html new file mode 100644 index 0000000000000000000000000000000000000000..a22c12445d66accfddb95de347f30e04bd8ae61d --- /dev/null +++ b/docs/examples/zh/controls/DragControls.html @@ -0,0 +1,119 @@ + + + + + + + + + + + [page:EventDispatcher] → + +

[name]

+ +

+ This class can be used to provide a drag'n'drop interaction. +

+ +

Example

+ +

[example:misc_controls_drag misc / controls / drag ]

+ + +var controls = new THREE.DragControls( objects, camera, renderer.domElement ); + +// add event listener to highlight dragged objects + +controls.addEventListener( 'dragstart', function ( event ) { + + event.object.material.emissive.set( 0xaaaaaa ); + +} ); + +controls.addEventListener( 'dragend', function ( event ) { + + event.object.material.emissive.set( 0x000000 ); + +} ); + + + +

Constructor

+ +

[name]( [param:Array objects], [param:Camera camera], [param:HTMLDOMElement domElement] )

+

+

+ [page:Array objects]: An array of draggable 3D objects. +

+

+ [page:Camera camera]: The camera of the rendered scene. +

+

+ [page:HTMLDOMElement domElement]: The HTML element used for event listeners. +

+

+ Creates a new instance of [name]. +

+

+ +

Events

+ +

dragstart

+

+ Fires when the user starts to drag a 3D object. +

+ +

drag

+

+ Fires when the user drags a 3D object. +

+ +

dragend

+

+ Fires when the user has finished dragging a 3D object. +

+ +

hoveron

+

+ Fires when the pointer is moved onto a 3D object, or onto one of its children. +

+ +

hoveroff

+

+ Fires when the pointer is moved out of a 3D object. +

+ +

Properties

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. +

+ +

Methods

+ +

See the base [page:EventDispatcher] class for common methods.

+ +

[method:null activate] ()

+

+ Adds the event listeners of the controls. +

+ +

[method:null deactivate] ()

+

+ Removes the event listeners of the controls. +

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/DragControls.js examples/js/controls/DragControls.js] +

+ + diff --git a/docs/examples/zh/controls/FirstPersonControls.html b/docs/examples/zh/controls/FirstPersonControls.html new file mode 100644 index 0000000000000000000000000000000000000000..b1032350e86125b436a16f1b218695a5dcc3767e --- /dev/null +++ b/docs/examples/zh/controls/FirstPersonControls.html @@ -0,0 +1,166 @@ + + + + + + + + + + + +

[name]

+ +

+ This class is an alternative implementation of [page:FlyControls]. +

+ +

Example

+ +

[example:webgl_geometry_terrain webgl / geometry / terrain ]

+ +

Constructor

+ +

[name]( [param:Camera object], [param:HTMLDOMElement domElement] )

+

+

+ [page:Camera object]: The camera to be controlled. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document, + however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here. +

+

+ Creates a new instance of [name]. +

+

+ +

Properties

+ +

[property:Boolean activeLook]

+

+ Whether or not it's possible to look around. Default is *true*. +

+ +

[property:Boolean autoForward]

+

+ Whether or not the camera is automatically moved forward. Default is *false*. +

+ +

[property:Boolean constrainVertical]

+

+ Whether or not looking around is vertically constrained by [[page:.verticalMin], [page:.verticalMax]]. Default is *false*. +

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the whole document. +

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. Default is *true*. +

+ +

[property:Number heightCoef]

+

+ Determines how much faster the camera moves when it's y-component is near [page:.heightMax]. Default is *1*. +

+ +

[property:Number heightMax]

+

+ Upper camera height limit used for movement speed adjusment. Default is *1*. +

+ +

[property:Number heightMin]

+

+ Lower camera height limit used for movement speed adjusment. Default is *0*. +

+ +

[property:Boolean heightSpeed]

+

+ Whether or not the camera's height influences the forward movement speed. Default is *false*. + Use the properties [page:.heightCoef], [page:.heightMin] and [page:.heightMax] for configuration. +

+ +

[property:Boolean lookVertical]

+

+ Whether or not it's possible to vertically look around. Default is *true*. +

+ +

[property:Number lookSpeed]

+

+ The look around speed. Default is *0.005*. +

+ +

[property:Boolean mouseDragOn]

+

+ Whether or not the mouse is pressed down. Read-only property. +

+ +

[property:Number movementSpeed]

+

+ The movement speed. Default is *1*. +

+ +

[property:Camera object]

+

+ The camera to be controlled. +

+ +

[property:Number verticalMax]

+

+ How far you can vertically look around, upper limit. Range is 0 to Math.PI radians. Default is *Math.PI*. +

+ +

[property:Number verticalMin]

+

+ How far you can vertically look around, lower limit. Range is 0 to Math.PI radians. Default is *0*. +

+ +

Methods

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:null handleResize] ()

+

+ Should be called if the application window is resized. +

+ +

[method:FirstPersonControls lookAt]( [param:Vector3 vector] )
+ [method:FirstPersonControls lookAt]( [param:Float x], [param:Float y], [param:Float z] )

+

+

+

+ vector - A vector representing the target position. +

+

+ Optionally, the x, y, z components of the world space position. +

+

+

+ Ensures the controls orient the camera towards the defined target position. +

+

+ +

[method:null update] ( [param:Number delta] )

+

+

+ [page:Number delta]: Time delta value. +

+

+ Updates the controls. Usually called in the animation loop. +

+

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/FirstPersonControls.js examples/js/controls/FirstPersonControls.js] +

+ + diff --git a/docs/examples/zh/controls/FlyControls.html b/docs/examples/zh/controls/FlyControls.html new file mode 100644 index 0000000000000000000000000000000000000000..06f1631e848d78f451c20c988ff960c1866f967b --- /dev/null +++ b/docs/examples/zh/controls/FlyControls.html @@ -0,0 +1,95 @@ + + + + + + + + + + + +

[name]

+ +

+ [name] enables a navigation similar to fly modes in DCC tools like Blender. You can arbitrarily transform the camera in + 3D space without any limitations (e.g. focus on a specific target). +

+ +

Example

+ +

[example:misc_controls_fly misc / controls / fly ]

+ +

Constructor

+ +

[name]( [param:Camera object], [param:HTMLDOMElement domElement] )

+

+

+ [page:Camera object]: The camera to be controlled. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document, + however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here. +

+

+ Creates a new instance of [name]. +

+

+ +

Properties

+ +

[property:Boolean autoForward]

+

+ If set to *true*, the camera automatically moves forward (and does not stop) when initially translated. Default is *false*. +

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the whole document. +

+ +

[property:Boolean dragToLook]

+

+ If set to *true*, you can only look around by performing a drag interaction. Default is *false*. +

+ +

[property:Number movementSpeed]

+

+ The movement speed. Default is *1*. +

+ +

[property:Camera object]

+

+ The camera to be controlled. +

+ +

[property:Number rollSpeed]

+

+ The rotation speed. Default is *0.005*. +

+ +

Methods

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:null update] ( [param:Number delta] )

+

+

+ [page:Number delta]: Time delta value. +

+

+ Updates the controls. Usually called in the animation loop. +

+

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/FlyControls.js examples/js/controls/FlyControls.js] +

+ + diff --git a/docs/examples/zh/controls/OrthographicTrackballControls.html b/docs/examples/zh/controls/OrthographicTrackballControls.html new file mode 100644 index 0000000000000000000000000000000000000000..1b12f89a2975ed7b6a4b4cc0bce6f65c4218852e --- /dev/null +++ b/docs/examples/zh/controls/OrthographicTrackballControls.html @@ -0,0 +1,187 @@ + + + + + + + + + + + [page:EventDispatcher] → + +

[name]

+ +

+

+ This class is a special version of [page:TrackballControls] which supports orthographic cameras. +

+

+ +

Example

+ +

[example:misc_controls_trackball_orthographic misc / controls / trackball / orthographic ]

+ +

Constructor

+ +

[name]( [param:OrthographicCamera camera], [param:HTMLDOMElement domElement] )

+

+

+ [page:OrthographicCamera camera]: The orthographic camera of the rendered scene. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document, + however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here. +

+

+ Creates a new instance of [name]. +

+

+ +

Events

+ +

change

+

+ Fires when the camera has been transformed by the controls. +

+ +

start

+

+ Fires when an interaction (e.g. touch) was initiated. +

+ +

end

+

+ Fires when an interaction has finished. +

+ +

Properties

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the whole document. +

+ +

[property:Number dynamicDampingFactor]

+

+ Defines the intensity of damping. Only considered if [page:.staticMoving staticMoving] is set to *false*. Default is *0.2*. +

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. +

+ +

[property:Array keys]

+

+ This array holds keycodes for controlling interactions. +

    +
  • When the first defined key is pressed, all mouse interactions (left, middle, right) performs orbiting.
  • +
  • When the second defined key is pressed, all mouse interactions (left, middle, right) performs zooming.
  • +
  • When the third defined key is pressed, all mouse interactions (left, middle, right) performs panning.
  • +
+ Default is *65, 83, 68* which represents A, S, D. +

+ +

[property:Boolean noPan]

+

+ Whether or not panning is disabled. Default is *false*. +

+ +

[property:Boolean noRoll]

+

+ Whether or not rolling is disabled. Default is *false*. +

+ +

[property:Boolean noRotate]

+

+ Whether or not rotation is disabled. Default is *false*. +

+ +

[property:Boolean noZoom]

+

+ Whether or not zooming is disabled. Default is *false*. +

+ +

[property:OrthographicCamera object]

+

+ The camera being controlled. +

+ +

[property:Number panSpeed]

+

+ The zoom speed. Default is *0.3*. +

+ +

[property:Number rotateSpeed]

+

+ The rotation speed. Default is *1.0*. +

+ +

[property:Object screen]

+

+ Represents the properties of the screen. Automatically set when [page:.handleResize handleResize]() is called. +

    +
  • left: Represents the offset in pixels to the screen's left boundary.
  • +
  • top: Represents the offset in pixels to the screen's top boundary.
  • +
  • width: Represents the screen width in pixels.
  • +
  • height: Represents the screen height in pixels.
  • +
+

+ +

[property:Boolean staticMoving]

+

+ Whether or not damping is disabled. Default is *false*. +

+ +

[property:Number zoomSpeed]

+

+ The zoom speed. Default is *1.2*. +

+ +

Methods

+ + +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:null handleResize] ()

+

+ Should be called if the application window is resized. +

+ +

[method:null panCamera] ()

+

+ Performs panning if necessary. Called by [page:.update update](). +

+ +

[method:null reset] ()

+

+ Resets the controls to its initial state. +

+ +

[method:null rotateCamera] ()

+

+ Rotates the camera if necessary. Called by [page:.update update](). +

+ +

[method:null update] ()

+

+ Updates the controls. Usually called in the animation loop. +

+ +

[method:null zoomCamera] ()

+

+ Performs zooming if necessary. Called by [page:.update update](). +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js examples/js/controls/TrackballControls.js] +

+ + diff --git a/docs/examples/zh/controls/PointerLockControls.html b/docs/examples/zh/controls/PointerLockControls.html new file mode 100644 index 0000000000000000000000000000000000000000..c36c54e6239f0179ef0d846cb7ffd60c894252fd --- /dev/null +++ b/docs/examples/zh/controls/PointerLockControls.html @@ -0,0 +1,149 @@ + + + + + + + + + + + [page:EventDispatcher] → + +

[name]

+ +

+ The implementation of this class is based on the [link:https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API Pointer Lock API]. + [name] is a perfect choice for first person 3D games. +

+ +

Example

+ +

[example:misc_controls_pointerlock misc / controls / pointerlock ]

+ + +var controls = new PointerLockControls( camera ); + +// add event listener to show/hide a UI (e.g. the game's menu) + +controls.addEventListener( 'lock', function () { + + menu.style.display = 'none'; + +} ); + +controls.addEventListener( 'unlock', function () { + + menu.style.display = 'block'; + +} ); + + + +

Constructor

+ +

[name]( [param:Camera camera], [param:HTMLDOMElement domElement] )

+

+

+ [page:Camera camera]: The camera of the rendered scene. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the document's body. +

+

+ Creates a new instance of [name]. +

+

+ +

Events

+ +

change

+

+ Fires when the user moves the mouse. +

+ +

lock

+

+ Fires when the pointer lock status is "locked" (in other words: the mouse is captured). +

+ +

unlock

+

+ Fires when the pointer lock status is "unlocked" (in other words: the mouse is not captured anymore). +

+ +

Properties

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the document's body. +

+ + +

[property:Boolean isLocked]

+

+ Whether or not the controls are locked. +

+ +

Methods

+ +

See the base [page:EventDispatcher] class for common methods.

+ +

[method:null connect] ()

+

+ Adds the event listeners of the controls. +

+ +

[method:null disconnect] ()

+

+ Removes the event listeners of the controls. +

+ +

[method:Vector3 getDirection] ( [param:Vector3 target] )

+

+

+ [page:Vector3 target]: The target vector. +

+

+ Returns the look direction of the camera. +

+

+ +

[method:null lock] ()

+

+ Activates the pointer lock. +

+ +

[method:null moveForward] ( [param:Number distance] )

+

+

+ [page:Number distance]: The signed distance. +

+

+ Moves the camera forward parallel to the xz-plane. Assumes camera.up is y-up. +

+

+ +

[method:null moveRight] ( [param:Number distance] )

+

+

+ [page:Number distance]: The signed distance. +

+

+ Moves the camera sidewards parallel to the xz-plane. +

+

+ +

[method:null unlock] ()

+

+ Exits the pointer lock. +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/PointerLockControls.js examples/js/controls/PointerLockControls.js] +

+ + diff --git a/docs/examples/zh/controls/TrackballControls.html b/docs/examples/zh/controls/TrackballControls.html new file mode 100644 index 0000000000000000000000000000000000000000..c460af81ef6a7f8d38023d21bc5c8048c117865c --- /dev/null +++ b/docs/examples/zh/controls/TrackballControls.html @@ -0,0 +1,211 @@ + + + + + + + + + + + [page:EventDispatcher] → + +

[name]

+ +

+

+ [name] is similar to [page:OrbitControls]. However, it does not maintain a constant camera [page:Object3D.up up] vector. + That means if the camera orbits over the “north” and “south” poles, it does not flip to stay "right side up". +

+

+ Notice that [name] can only be used with a perspective camera. Use [page:OrthographicTrackballControls] when working with an orthographic camera. +

+

+ +

Example

+ +

[example:misc_controls_trackball misc / controls / trackball ]

+ +

Constructor

+ +

[name]( [param:PerspectiveCamera camera], [param:HTMLDOMElement domElement] )

+

+

+ [page:PerspectiveCamera camera]: The perspective camera of the rendered scene. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document, + however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here. +

+

+ Creates a new instance of [name]. +

+

+ +

Events

+ +

change

+

+ Fires when the camera has been transformed by the controls. +

+ +

start

+

+ Fires when an interaction (e.g. touch) was initiated. +

+ +

end

+

+ Fires when an interaction has finished. +

+ +

Properties

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the whole document. +

+ +

[property:Number dynamicDampingFactor]

+

+ Defines the intensity of damping. Only considered if [page:.staticMoving staticMoving] is set to *false*. Default is *0.2*. +

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. +

+ +

[property:Array keys]

+

+ This array holds keycodes for controlling interactions. +

    +
  • When the first defined key is pressed, all mouse interactions (left, middle, right) performs orbiting.
  • +
  • When the second defined key is pressed, all mouse interactions (left, middle, right) performs zooming.
  • +
  • When the third defined key is pressed, all mouse interactions (left, middle, right) performs panning.
  • +
+ Default is *65, 83, 68* which represents A, S, D. +

+ +

[property:Number maxDistance]

+

+ How far you can zoom in. Default is *Infinity*. +

+ +

[property:Number minDistance]

+

+ How far you can zoom in. Default is *0*. +

+ +

+ [property:Object mouseButtons]

+

+ This object contains references to the mouse actions used by the controls. +

    +
  • .LEFT is assinged with *THREE.MOUSE.ROTATE*
  • +
  • .MIDDLE is assinged with *THREE.MOUSE.ZOOM*
  • +
  • .RIGHT is assinged with *THREE.MOUSE.PAN*
  • +
+

+ +

[property:Boolean noPan]

+

+ Whether or not panning is disabled. Default is *false*. +

+ +

[property:Boolean noRotate]

+

+ Whether or not rotation is disabled. Default is *false*. +

+ +

[property:Boolean noZoom]

+

+ Whether or not zooming is disabled. Default is *false*. +

+ +

[property:PerspectiveCamera object]

+

+ The camera being controlled. +

+ +

[property:Number panSpeed]

+

+ The zoom speed. Default is *0.3*. +

+ +

[property:Number rotateSpeed]

+

+ The rotation speed. Default is *1.0*. +

+ +

[property:Object screen]

+

+ Represents the properties of the screen. Automatically set when [page:.handleResize handleResize]() is called. +

    +
  • left: Represents the offset in pixels to the screen's left boundary.
  • +
  • top: Represents the offset in pixels to the screen's top boundary.
  • +
  • width: Represents the screen width in pixels.
  • +
  • height: Represents the screen height in pixels.
  • +
+

+ +

[property:Boolean staticMoving]

+

+ Whether or not damping is disabled. Default is *false*. +

+ +

[property:Number zoomSpeed]

+

+ The zoom speed. Default is *1.2*. +

+ +

Methods

+ +

[method:null checkDistances] ()

+

+ Ensures the controls stay in the range [minDistance, maxDistance]. Called by [page:.update update](). +

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:null handleResize] ()

+

+ Should be called if the application window is resized. +

+ +

[method:null panCamera] ()

+

+ Performs panning if necessary. Called by [page:.update update](). +

+ +

[method:null reset] ()

+

+ Resets the controls to its initial state. +

+ +

[method:null rotateCamera] ()

+

+ Rotates the camera if necessary. Called by [page:.update update](). +

+ +

[method:null update] ()

+

+ Updates the controls. Usually called in the animation loop. +

+ +

[method:null zoomCamera] ()

+

+ Performs zooming if necessary. Called by [page:.update update](). +

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js examples/js/controls/TrackballControls.js] +

+ + diff --git a/docs/examples/zh/controls/TransformControls.html b/docs/examples/zh/controls/TransformControls.html new file mode 100644 index 0000000000000000000000000000000000000000..b4bcc5b253db41c4f7d6b8417736c157d98f8469 --- /dev/null +++ b/docs/examples/zh/controls/TransformControls.html @@ -0,0 +1,225 @@ + + + + + + + + + + + [page:Object3D] → + +

[name]

+ +

+ This class can be used to transform objects in 3D space by adapting a similar interaction model of DCC tools like Blender. + Unlike other controls, it is not intended to transform the scene's camera. +

+ +

Example

+ +

[example:misc_controls_transform misc / controls / transform ]

+ +

Constructor

+ +

[name]( [param:Camera camera], [param:HTMLDOMElement domElement] )

+

+

+ [page:Camera camera]: The camera of the rendered scene. +

+

+ [page:HTMLDOMElement domElement]: (optional) The HTML element used for event listeners. By default this is the whole document, + however if you only want the controls to work over a specific element (e.g. the canvas) you can specify that here. +

+

+ Creates a new instance of [name]. +

+

+ +

Events

+ +

change

+

+ Fires if any type of change (object or property change) is performed. Property changes + are separate events you can add event listeners to. The event type is "propertyname-changed". +

+ +

mouseDown

+

+ Fires if a pointer (mouse/touch) becomes active. +

+ +

mouseUp

+

+ Fires if a pointer (mouse/touch) is no longer active. +

+ +

objectChange

+

+ Fires if the controlled 3D object is changed. +

+ +

Properties

+ +

See the base [page:Object3D] class for common properties.

+ +

[property:String axis]

+

+ The current transformation axis. +

+ +

[property:Camera camera]

+

+ The camera of the rendered scene. +

+ +

[property:HTMLDOMElement domElement]

+

+ The HTMLDOMElement used to listen for mouse / touch events. This must be passed in the constructor; changing it here will + not set up new event listeners. Default is the whole document. +

+ +

[property:Boolean dragging]

+

+ Whether or not dragging is currently performed. Read-only property. +

+ +

[property:Boolean enabled]

+

+ Whether or not the controls are enabled. +

+ +

[property:String mode]

+

+ The current transformation mode. Possible values are "translate", "rotate" and "scale". Default is *translate*. +

+ +

[property:Object3D object]

+

+ The 3D object being controlled. +

+ +

[property:Number rotationSnap]

+

+ By default, 3D objects are continously rotated. If you set this property to a numeric value (radians), you can define in which + steps the 3D object should be rotated. Deault is *null*. +

+ +

[property:Boolean showX]

+

+ Whether or not the x-axis helper should be visible. Default is *true*. +

+ +

[property:Boolean showY]

+

+ Whether or not the y-axis helper should be visible. Default is *true*. +

+ +

[property:Boolean showZ]

+

+ Whether or not the z-axis helper should be visible. Default is *true*. +

+ +

[property:Number size]

+

+ The size of the helper UI (axes/planes). Default is *1*. +

+ +

[property:String space]

+

+ Defines in which coordinate space transformations should be performed. Possible values are "world" and "local". Default is *world*. +

+ +

[property:Number translationSnap]

+

+ By default, 3D objects are continously translated. If you set this property to a numeric value (world units), you can define in which + steps the 3D object should be translated. Deault is *null*. +

+ +

Methods

+ +

See the base [page:Object3D] class for common methods.

+ +

[method:TransformControls attach] ( [param:Object3D object] )

+

+

+ [page:Object3D object]: The 3D object that should be transformed. +

+

+ Sets the 3D object that should be transformed and ensures the controls UI is visible. +

+

+ +

[method:TransformControls detach] ()

+

+ Removes the current 3D object from the controls and makes the helper UI is invisible. +

+ +

[method:null dispose] ()

+

+ Should be called if the controls is no longer required. +

+ +

[method:String getMode] ()

+

+ Returns the transformation mode. +

+ +

[method:null setMode] ( [param:String mode] )

+

+

+ [page:String mode]: The transformation mode. +

+

+ Sets the transformation mode. +

+

+ +

[method:null setRotationSnap] ( [param:Number rotationSnap] )

+

+

+ [page:Number rotationSnap]: The rotation snap. +

+

+ Sets the rotation snap. +

+

+ +

[method:null setSize] ( [param:Number size] )

+

+

+ [page:Number size]: The size of the helper UI. +

+

+ Sets the size of the helper UI. +

+

+ +

[method:null setSpace] ( [param:String space] )

+

+

+ [page:String space]: The coordinate space in which transformations are applied. +

+

+ Sets the coordinate space in which transformations are applied. +

+

+ +

[method:null setTranslationSnap] ( [param:Number translationSnap] )

+

+

+ [page:Number translationSnap]: The translation snap. +

+

+ Sets the translation snap. +

+

+ +

Source

+ +

+ [link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TransformControls.js examples/js/controls/TransformControls.js] +

+ + diff --git a/docs/list.js b/docs/list.js index 06a3cc356592dae90623899a2a1bb669f8751e3a..e024da377606716022ceecf23988d61431dbd960 100644 --- a/docs/list.js +++ b/docs/list.js @@ -354,7 +354,15 @@ var list = { }, "Controls": { - "OrbitControls": "examples/en/controls/OrbitControls" + "DeviceOrientationControls": "examples/en/controls/DeviceOrientationControls", + "DragControls": "examples/en/controls/DragControls", + "FirstPersonControls": "examples/en/controls/FirstPersonControls", + "FlyControls": "examples/en/controls/FlyControls", + "OrbitControls": "examples/en/controls/OrbitControls", + "OrthographicTrackballControls": "examples/en/controls/OrthographicTrackballControls", + "PointerLockControls": "examples/en/controls/PointerLockControls", + "TrackballControls": "examples/en/controls/TrackballControls", + "TransformControls": "examples/en/controls/TransformControls" }, "Geometries": { @@ -790,7 +798,15 @@ var list = { }, "控制": { - "OrbitControls": "examples/zh/controls/OrbitControls" + "DeviceOrientationControls": "examples/zh/controls/DeviceOrientationControls", + "DragControls": "examples/zh/controls/DragControls", + "FirstPersonControls": "examples/zh/controls/FirstPersonControls", + "FlyControls": "examples/zh/controls/FlyControls", + "OrbitControls": "examples/zh/controls/OrbitControls", + "OrthographicTrackballControls": "examples/zh/controls/OrthographicTrackballControls", + "PointerLockControls": "examples/zh/controls/PointerLockControls", + "TrackballControls": "examples/zh/controls/TrackballControls", + "TransformControls": "examples/zh/controls/TransformControls" }, "几何体": { diff --git a/editor/index.html b/editor/index.html index 48bd5f0de0965b06f927a3dcffc0c50a046e642c..520d9f5fab3d8939c80edc26377dde6d97d81d31 100644 --- a/editor/index.html +++ b/editor/index.html @@ -7,8 +7,8 @@ - - + + @@ -126,6 +126,7 @@ + diff --git a/editor/js/Menubar.Add.js b/editor/js/Menubar.Add.js index 39439d5e4a8d07e2720bab290c5f61d447ed911f..447c9fcb260bc1546bd12129832dd7cc28917f68 100644 --- a/editor/js/Menubar.Add.js +++ b/editor/js/Menubar.Add.js @@ -85,6 +85,22 @@ Menubar.Add = function ( editor ) { } ); options.add( option ); + // Dodecahedron + + var option = new UI.Row(); + option.setClass( 'option' ); + option.setTextContent( strings.getKey( 'menubar/add/dodecahedron' ) ); + option.onClick( function () { + + var geometry = new THREE.DodecahedronBufferGeometry( 1, 0 ); + var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() ); + mesh.name = 'Dodecahedron'; + + editor.execute( new AddObjectCommand( editor, mesh ) ); + + } ); + options.add( option ); + // Icosahedron var option = new UI.Row(); @@ -162,7 +178,7 @@ Menubar.Add = function ( editor ) { editor.execute( new AddObjectCommand( editor, mesh ) ); } ); - options.add( option ) + options.add( option ); // Ring diff --git a/editor/js/Sidebar.Geometry.BoxGeometry.js b/editor/js/Sidebar.Geometry.BoxGeometry.js index e158f673099b027ecc431e7b6a14a4bc77dad641..bc93ed6610231eaec9effd3017b49b32272a22ed 100644 --- a/editor/js/Sidebar.Geometry.BoxGeometry.js +++ b/editor/js/Sidebar.Geometry.BoxGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.BoxGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.CircleGeometry.js b/editor/js/Sidebar.Geometry.CircleGeometry.js index ce3a52514d2cc077333dc13ae6e38a27050f48a8..081b98a16730f7396cdb925df5063ad3653e1ac0 100644 --- a/editor/js/Sidebar.Geometry.CircleGeometry.js +++ b/editor/js/Sidebar.Geometry.CircleGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.CircleGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.CylinderGeometry.js b/editor/js/Sidebar.Geometry.CylinderGeometry.js index a4d64b6b47afdeaebb69b79a399506b17b984fc7..8dc208e2f0e023087980eeb3a778939e8f33a762 100644 --- a/editor/js/Sidebar.Geometry.CylinderGeometry.js +++ b/editor/js/Sidebar.Geometry.CylinderGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.CylinderGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.DodecahedronGeometry.js b/editor/js/Sidebar.Geometry.DodecahedronGeometry.js new file mode 100644 index 0000000000000000000000000000000000000000..aa19bff668861a15ca6325ad0f7ee77988616d0c --- /dev/null +++ b/editor/js/Sidebar.Geometry.DodecahedronGeometry.js @@ -0,0 +1,49 @@ +/** + * @author mrdoob / http://mrdoob.com/ + */ + +Sidebar.Geometry.DodecahedronGeometry = function ( editor, object ) { + + var strings = editor.strings; + + var container = new UI.Row(); + + var geometry = object.geometry; + var parameters = geometry.parameters; + + // radius + + var radiusRow = new UI.Row(); + var radius = new UI.Number( parameters.radius ).onChange( update ); + + radiusRow.add( new UI.Text( strings.getKey( 'sidebar/geometry/dodecahedron_geometry/radius' ) ).setWidth( '90px' ) ); + radiusRow.add( radius ); + + container.add( radiusRow ); + + // detail + + var detailRow = new UI.Row(); + var detail = new UI.Integer( parameters.detail ).setRange( 0, Infinity ).onChange( update ); + + detailRow.add( new UI.Text( strings.getKey( 'sidebar/geometry/dodecahedron_geometry/detail' ) ).setWidth( '90px' ) ); + detailRow.add( detail ); + + container.add( detailRow ); + + // + + function update() { + + editor.execute( new SetGeometryCommand( editor, object, new THREE[ geometry.type ]( + radius.getValue(), + detail.getValue() + ) ) ); + + } + + return container; + +}; + +Sidebar.Geometry.DodecahedronBufferGeometry = Sidebar.Geometry.DodecahedronGeometry; diff --git a/editor/js/Sidebar.Geometry.ExtrudeGeometry.js b/editor/js/Sidebar.Geometry.ExtrudeGeometry.js index 99f5e9a38f86895592335f864638a158b458c5d2..f43344c86e082b3f205e67b7828e23d0fe82e15a 100644 --- a/editor/js/Sidebar.Geometry.ExtrudeGeometry.js +++ b/editor/js/Sidebar.Geometry.ExtrudeGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.ExtrudeGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.IcosahedronGeometry.js b/editor/js/Sidebar.Geometry.IcosahedronGeometry.js index 8309f5acfc2ae5cec5bdce17818bed11063b8e52..e5f4082a94efb29bd314de119464bb01402f6e12 100644 --- a/editor/js/Sidebar.Geometry.IcosahedronGeometry.js +++ b/editor/js/Sidebar.Geometry.IcosahedronGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.IcosahedronGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; @@ -33,7 +31,6 @@ Sidebar.Geometry.IcosahedronGeometry = function ( editor, object ) { container.add( detailRow ); - // function update() { @@ -43,8 +40,6 @@ Sidebar.Geometry.IcosahedronGeometry = function ( editor, object ) { detail.getValue() ) ) ); - signals.objectChanged.dispatch( object ); - } return container; diff --git a/editor/js/Sidebar.Geometry.LatheGeometry.js b/editor/js/Sidebar.Geometry.LatheGeometry.js index 93dbde8e9a026ce842b0eb65cb3059764f66a9c6..2fd691c7fbf54d6f5da7f1a15f4434258c5b7921 100644 --- a/editor/js/Sidebar.Geometry.LatheGeometry.js +++ b/editor/js/Sidebar.Geometry.LatheGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.LatheGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.OctahedronGeometry.js b/editor/js/Sidebar.Geometry.OctahedronGeometry.js index 16d99f805dae20e128ac8d1284819ec41cdb4b6e..30eab9ed72e9d5411e3eb9ada1bdbc6e05b2e040 100644 --- a/editor/js/Sidebar.Geometry.OctahedronGeometry.js +++ b/editor/js/Sidebar.Geometry.OctahedronGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.OctahedronGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; @@ -43,8 +41,6 @@ Sidebar.Geometry.OctahedronGeometry = function ( editor, object ) { detail.getValue() ) ) ); - signals.objectChanged.dispatch( object ); - } return container; diff --git a/editor/js/Sidebar.Geometry.PlaneGeometry.js b/editor/js/Sidebar.Geometry.PlaneGeometry.js index 0afbd984a59db03d626779268b40e25e3f17cccd..e789a196d3a4ad614bf5514930544b0133b66bca 100644 --- a/editor/js/Sidebar.Geometry.PlaneGeometry.js +++ b/editor/js/Sidebar.Geometry.PlaneGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.PlaneGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.RingGeometry.js b/editor/js/Sidebar.Geometry.RingGeometry.js index f455a9b4ab548bc121e569fb6aeb4c6d99216dac..1bcea461cabb761ddef2fa6671cb6c6d76f16bb8 100644 --- a/editor/js/Sidebar.Geometry.RingGeometry.js +++ b/editor/js/Sidebar.Geometry.RingGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.RingGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.ShapeGeometry.js b/editor/js/Sidebar.Geometry.ShapeGeometry.js index 7c287bbca292ddb9474dd1a01fe50cb1bfdc699b..12b2b8a68e1052a46fb99a34217c996577309cfb 100644 --- a/editor/js/Sidebar.Geometry.ShapeGeometry.js +++ b/editor/js/Sidebar.Geometry.ShapeGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.ShapeGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.SphereGeometry.js b/editor/js/Sidebar.Geometry.SphereGeometry.js index 4baa21cf967cdfe9cad8b8055b79d153d420fa57..d904524a1ffd56caa65c2a532e050fe07d74248a 100644 --- a/editor/js/Sidebar.Geometry.SphereGeometry.js +++ b/editor/js/Sidebar.Geometry.SphereGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.SphereGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.TetrahedronGeometry.js b/editor/js/Sidebar.Geometry.TetrahedronGeometry.js index 51423a79cd96742b96e88f872bcb966e419f21ef..20787c7183e22fde7694c5e5d918da335df10bb8 100644 --- a/editor/js/Sidebar.Geometry.TetrahedronGeometry.js +++ b/editor/js/Sidebar.Geometry.TetrahedronGeometry.js @@ -7,8 +7,6 @@ Sidebar.Geometry.TetrahedronGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; @@ -44,8 +42,6 @@ Sidebar.Geometry.TetrahedronGeometry = function ( editor, object ) { detail.getValue() ) ) ); - signals.objectChanged.dispatch( object ); - } return container; diff --git a/editor/js/Sidebar.Geometry.TorusGeometry.js b/editor/js/Sidebar.Geometry.TorusGeometry.js index ff196cefd10a84989f75bb092a58c894023f8883..d1fd8480fcde284088bbba53f4d18fb58e2b2f92 100644 --- a/editor/js/Sidebar.Geometry.TorusGeometry.js +++ b/editor/js/Sidebar.Geometry.TorusGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.TorusGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.TorusKnotGeometry.js b/editor/js/Sidebar.Geometry.TorusKnotGeometry.js index dfdaf2aa9af1ccd68103216bfcfe8f30129fa60e..d4fbf2d1c92e4c43ae6bce89eafb712085ddb8c8 100644 --- a/editor/js/Sidebar.Geometry.TorusKnotGeometry.js +++ b/editor/js/Sidebar.Geometry.TorusKnotGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.TorusKnotGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Geometry.TubeGeometry.js b/editor/js/Sidebar.Geometry.TubeGeometry.js index 24405fa7ddcfa2899dc769df9192228e7117764a..e04d778e26ae888b6ace27ec7bc2007263a7d89e 100644 --- a/editor/js/Sidebar.Geometry.TubeGeometry.js +++ b/editor/js/Sidebar.Geometry.TubeGeometry.js @@ -6,8 +6,6 @@ Sidebar.Geometry.TubeGeometry = function ( editor, object ) { var strings = editor.strings; - var signals = editor.signals; - var container = new UI.Row(); var geometry = object.geometry; diff --git a/editor/js/Sidebar.Properties.js b/editor/js/Sidebar.Properties.js index 0aed9bd77f3bbf50f7fe9cda386a1a2abc2fdba5..5cf9c3e5b89c7786093bd4213aa5800f849dd90e 100644 --- a/editor/js/Sidebar.Properties.js +++ b/editor/js/Sidebar.Properties.js @@ -9,9 +9,9 @@ Sidebar.Properties = function ( editor ) { var container = new UI.TabbedPanel(); container.setId( 'properties' ); - container.addPanel( 'object', strings.getKey( 'sidebar/properties/object' ), new Sidebar.Object( editor ) ); - container.addPanel( 'geometry', strings.getKey( 'sidebar/properties/geometry' ), new Sidebar.Geometry( editor ) ); - container.addPanel( 'material', strings.getKey( 'sidebar/properties/material' ), new Sidebar.Material( editor ) ); + container.addTab( 'object', strings.getKey( 'sidebar/properties/object' ), new Sidebar.Object( editor ) ); + container.addTab( 'geometry', strings.getKey( 'sidebar/properties/geometry' ), new Sidebar.Geometry( editor ) ); + container.addTab( 'material', strings.getKey( 'sidebar/properties/material' ), new Sidebar.Material( editor ) ); return container; diff --git a/editor/js/Sidebar.js b/editor/js/Sidebar.js index 129a2eaf89aced4193d9edad3e9f6dcb0f36620c..e3d3e9023f083e9178e29da71a3d9559a1c22f25 100644 --- a/editor/js/Sidebar.js +++ b/editor/js/Sidebar.js @@ -21,9 +21,9 @@ var Sidebar = function ( editor ) { new Sidebar.History( editor ) ); - container.addPanel( 'scene', strings.getKey( 'sidebar/scene' ), scene ); - container.addPanel( 'project', strings.getKey( 'sidebar/project' ), new Sidebar.Project( editor ) ); - container.addPanel( 'settings', strings.getKey( 'sidebar/settings' ), settings ); + container.addTab( 'scene', strings.getKey( 'sidebar/scene' ), scene ); + container.addTab( 'project', strings.getKey( 'sidebar/project' ), new Sidebar.Project( editor ) ); + container.addTab( 'settings', strings.getKey( 'sidebar/settings' ), settings ); return container; diff --git a/editor/js/Strings.js b/editor/js/Strings.js index 3c05ce0eff504777df5eb46075fd1871ff098899..975db9132627bd8a37d98e73a44154c8608e8efe 100644 --- a/editor/js/Strings.js +++ b/editor/js/Strings.js @@ -41,6 +41,7 @@ var Strings = function ( config ) { 'menubar/add/cylinder': 'Cylinder', 'menubar/add/ring': 'Ring', 'menubar/add/sphere': 'Sphere', + 'menubar/add/dodecahedron': 'Dodecahedron', 'menubar/add/icosahedron': 'Icosahedron', 'menubar/add/octahedron': 'Octahedron', 'menubar/add/tetrahedron': 'Tetrahedron', @@ -148,6 +149,9 @@ var Strings = function ( config ) { 'sidebar/geometry/geometry/vertices': 'Vertices', 'sidebar/geometry/geometry/faces': 'Faces', + 'sidebar/geometry/dodecahedron_geometry/radius': 'Radius', + 'sidebar/geometry/dodecahedron_geometry/detail': 'Detail', + 'sidebar/geometry/icosahedron_geometry/radius': 'Radius', 'sidebar/geometry/icosahedron_geometry/detail': 'Detail', @@ -338,6 +342,7 @@ var Strings = function ( config ) { 'menubar/add/cylinder': '圆柱体', 'menubar/add/ring': '环', 'menubar/add/sphere': '球体', + 'menubar/add/dodecahedron': 'Dodecahedron', 'menubar/add/icosahedron': '二十面体', 'menubar/add/octahedron': '八面体', 'menubar/add/tetrahedron': '四面体', @@ -435,6 +440,9 @@ var Strings = function ( config ) { 'sidebar/geometry/geometry/vertices': '顶点', 'sidebar/geometry/geometry/faces': '面', + 'sidebar/geometry/dodecahedron_geometry/radius': '半径', + 'sidebar/geometry/dodecahedron_geometry/detail': '面片分段', + 'sidebar/geometry/icosahedron_geometry/radius': '半径', 'sidebar/geometry/icosahedron_geometry/detail': '面片分段', diff --git a/editor/js/libs/ui.js b/editor/js/libs/ui.js index 2a7c2e38d7c5aa652135812a884fcfa851085fbf..17a2d8d8fc84e0f1c9f61d87f0432309298e3b3b 100644 --- a/editor/js/libs/ui.js +++ b/editor/js/libs/ui.js @@ -1098,7 +1098,7 @@ UI.TabbedPanel.prototype.select = function ( id ) { } -UI.TabbedPanel.prototype.addPanel = function ( id, label, items ) { +UI.TabbedPanel.prototype.addTab = function ( id, label, items ) { var tab = new UI.TabbedPanel.Tab( label, this ); tab.setId( id ); diff --git a/examples/files.js b/examples/files.js index 5af31eb9b3b73d8a32373443e1068dd538ca5577..c82359328113065bfe8a92cd8a609d6e94532623 100644 --- a/examples/files.js +++ b/examples/files.js @@ -52,7 +52,6 @@ var files = { "webgl_interactive_cubes_gpu", "webgl_interactive_instances_gpu", "webgl_interactive_cubes_ortho", - "webgl_interactive_draggablecubes", "webgl_interactive_lines", "webgl_interactive_points", "webgl_interactive_raycasting_points", @@ -338,6 +337,7 @@ var files = { "webvr_cubes", "webvr_dragging", "webvr_lorenzattractor", + "webvr_multiview", "webvr_panorama", "webvr_paint", "webvr_rollercoaster", @@ -360,6 +360,7 @@ var files = { "misc_animation_keys", "misc_boxselection", "misc_controls_deviceorientation", + "misc_controls_drag", "misc_controls_fly", "misc_controls_map", "misc_controls_orbit", diff --git a/examples/js/controls/FirstPersonControls.js b/examples/js/controls/FirstPersonControls.js index 34c255109891346efd4dfbfbacd5c25074e54a1b..b3332b1f17b9d50fa6b9d502025864c8d228e154 100644 --- a/examples/js/controls/FirstPersonControls.js +++ b/examples/js/controls/FirstPersonControls.js @@ -10,6 +10,8 @@ THREE.FirstPersonControls = function ( object, domElement ) { this.domElement = ( domElement !== undefined ) ? domElement : document; + // API + this.enabled = true; this.movementSpeed = 1.0; @@ -29,6 +31,10 @@ THREE.FirstPersonControls = function ( object, domElement ) { this.verticalMin = 0; this.verticalMax = Math.PI; + this.mouseDragOn = false; + + // internals + this.autoSpeedFactor = 0.0; this.mouseX = 0; @@ -39,8 +45,6 @@ THREE.FirstPersonControls = function ( object, domElement ) { this.moveLeft = false; this.moveRight = false; - this.mouseDragOn = false; - this.viewHalfX = 0; this.viewHalfY = 0; diff --git a/examples/js/controls/OrthographicTrackballControls.js b/examples/js/controls/OrthographicTrackballControls.js index 1d5e4f909e95943639029fc5f42e2e1d46f8b235..156a6b4202ee3b2469539ccb48b9aca169343889 100644 --- a/examples/js/controls/OrthographicTrackballControls.js +++ b/examples/js/controls/OrthographicTrackballControls.js @@ -19,8 +19,6 @@ THREE.OrthographicTrackballControls = function ( object, domElement ) { this.screen = { left: 0, top: 0, width: 0, height: 0 }; - this.radius = 0; - this.rotateSpeed = 1.0; this.zoomSpeed = 1.2; @@ -36,6 +34,8 @@ THREE.OrthographicTrackballControls = function ( object, domElement ) { // internals + this.radius = 0; + this.target = new THREE.Vector3(); var EPS = 0.000001; diff --git a/examples/js/controls/PointerLockControls.js b/examples/js/controls/PointerLockControls.js index 38d9e02d6c68ae2761f58c54436a6f51d1f6d74a..6ba64529788d8e4ee7af06755c2aaf653b08a61d 100644 --- a/examples/js/controls/PointerLockControls.js +++ b/examples/js/controls/PointerLockControls.js @@ -22,7 +22,7 @@ THREE.PointerLockControls = function ( camera, domElement ) { var PI_2 = Math.PI / 2; - var vec = new Vector3(); + var vec = new THREE.Vector3(); function onMouseMove( event ) { diff --git a/examples/js/postprocessing/OutlinePass.js b/examples/js/postprocessing/OutlinePass.js index 8c9fd452c7de3727ff2bc6a4f7b960a6acc36cad..84d93a730a0780a67b59aa4948ce6aa5c92aa33d 100644 --- a/examples/js/postprocessing/OutlinePass.js +++ b/examples/js/postprocessing/OutlinePass.js @@ -510,18 +510,18 @@ THREE.OutlinePass.prototype = Object.assign( Object.create( THREE.Pass.prototype void main() {\ vec2 invSize = 1.0 / texSize;\ float weightSum = gaussianPdf(0.0, kernelRadius);\ - vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\ + vec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\ vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\ vec2 uvOffset = delta;\ for( int i = 1; i <= MAX_RADIUS; i ++ ) {\ float w = gaussianPdf(uvOffset.x, kernelRadius);\ - vec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\ - vec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\ + vec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\ + vec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\ diffuseSum += ((sample1 + sample2) * w);\ weightSum += (2.0 * w);\ uvOffset += delta;\ }\ - gl_FragColor = vec4(diffuseSum/weightSum, 1.0);\ + gl_FragColor = diffuseSum/weightSum;\ }" } ); diff --git a/examples/jsm/controls/DeviceOrientationControls.d.ts b/examples/jsm/controls/DeviceOrientationControls.d.ts index 17b5c9d18062eb83a368be9246181ea4be5f3a6e..56a855bff19f630edd89d40f130022b93e950a4a 100644 --- a/examples/jsm/controls/DeviceOrientationControls.d.ts +++ b/examples/jsm/controls/DeviceOrientationControls.d.ts @@ -1,6 +1,5 @@ import { - Camera, - Vector3 + Camera } from '../../../src/Three'; export class DeviceOrientationControls { @@ -14,7 +13,6 @@ export class DeviceOrientationControls { deviceOrientation: any; enabled: boolean; screenOrientation: number; - target: Vector3; connect(): void; disconnect(): void; diff --git a/examples/jsm/controls/FirstPersonControls.d.ts b/examples/jsm/controls/FirstPersonControls.d.ts index 31b6e4d239826e9a2be8e3e10f8113a4d1bd339c..7ad6791711ef807582f594e952af699c1f7e7970 100644 --- a/examples/jsm/controls/FirstPersonControls.d.ts +++ b/examples/jsm/controls/FirstPersonControls.d.ts @@ -22,7 +22,7 @@ export class FirstPersonControls { constrainVertical: boolean; verticalMin: number; verticalMax: number; - autoSpeedFactor: number; + mouseDragOn: boolean; handleResize(): void; lookAt(x: number | Vector3, y: number, z: number): this; diff --git a/examples/jsm/controls/FirstPersonControls.js b/examples/jsm/controls/FirstPersonControls.js index 772fc5b198906e21a47de664d152869336d74ab4..fd1449bb9c14732c4ba02040150fa47188244638 100644 --- a/examples/jsm/controls/FirstPersonControls.js +++ b/examples/jsm/controls/FirstPersonControls.js @@ -16,6 +16,8 @@ var FirstPersonControls = function ( object, domElement ) { this.domElement = ( domElement !== undefined ) ? domElement : document; + // API + this.enabled = true; this.movementSpeed = 1.0; @@ -35,11 +37,6 @@ var FirstPersonControls = function ( object, domElement ) { this.verticalMin = 0; this.verticalMax = Math.PI; - this.autoSpeedFactor = 0.0; - - this.mouseX = 0; - this.mouseY = 0; - this.moveForward = false; this.moveBackward = false; this.moveLeft = false; @@ -47,6 +44,13 @@ var FirstPersonControls = function ( object, domElement ) { this.mouseDragOn = false; + // internals + + this.autoSpeedFactor = 0.0; + + this.mouseX = 0; + this.mouseY = 0; + this.viewHalfX = 0; this.viewHalfY = 0; diff --git a/examples/jsm/controls/OrthographicTrackballControls.d.ts b/examples/jsm/controls/OrthographicTrackballControls.d.ts index f647a3f0971fd1815775c565078f3d5e7d3f9354..ffa937386d1cd751b09e9a5379456eb4c93599fa 100644 --- a/examples/jsm/controls/OrthographicTrackballControls.d.ts +++ b/examples/jsm/controls/OrthographicTrackballControls.d.ts @@ -8,7 +8,6 @@ export class OrthographicTrackballControls extends EventDispatcher { enabled: boolean; screen: {left: number; top: number; width: number; height: number}; - radius: number; rotateSpeed: number; zoomSpeed: number; noRotate: boolean; diff --git a/examples/jsm/controls/OrthographicTrackballControls.js b/examples/jsm/controls/OrthographicTrackballControls.js index 0c49d9453ef556d73f238cf06a32805564b22492..60734eb709ff6cbedf5834580c7451121f85b5f4 100644 --- a/examples/jsm/controls/OrthographicTrackballControls.js +++ b/examples/jsm/controls/OrthographicTrackballControls.js @@ -26,8 +26,6 @@ var OrthographicTrackballControls = function ( object, domElement ) { this.screen = { left: 0, top: 0, width: 0, height: 0 }; - this.radius = 0; - this.rotateSpeed = 1.0; this.zoomSpeed = 1.2; @@ -43,6 +41,8 @@ var OrthographicTrackballControls = function ( object, domElement ) { // internals + this.radius = 0; + this.target = new Vector3(); var EPS = 0.000001; diff --git a/examples/jsm/controls/PointerLockControls.d.ts b/examples/jsm/controls/PointerLockControls.d.ts index 64b419220f15fca2cc7b2fd6c9a3a3fc19d73c03..bf57c1840c518c72c714f32f41947c6b875cc440 100644 --- a/examples/jsm/controls/PointerLockControls.d.ts +++ b/examples/jsm/controls/PointerLockControls.d.ts @@ -8,7 +8,6 @@ export class PointerLockControls extends EventDispatcher { constructor(camera: Camera, domElement?: HTMLElement); domElement: HTMLElement; - object: Camera; // API @@ -19,6 +18,8 @@ export class PointerLockControls extends EventDispatcher { dispose(): void; getObject(): Camera; getDirection(v: Vector3): Vector3; + moveForward(distance: number): void; + moveRight(distance: number): void; lock(): void; unlock(): void; diff --git a/examples/jsm/controls/TrackballControls.d.ts b/examples/jsm/controls/TrackballControls.d.ts index 46ea05898eeecd0333a426e6d1553120d4357b6a..01b33d424d6708a65336f60753ef54e9b34257b7 100644 --- a/examples/jsm/controls/TrackballControls.d.ts +++ b/examples/jsm/controls/TrackballControls.d.ts @@ -42,6 +42,4 @@ export class TrackballControls extends EventDispatcher { rotateCamera(): void; handleResize(): void; - - handleEvent(event: any): void; } diff --git a/examples/jsm/controls/TransformControls.d.ts b/examples/jsm/controls/TransformControls.d.ts index d03c2e27f52afaf3273442a36d7b718aac374e6c..2aa9d237a450760c71914b9aa3d8b7e8e64b0291 100644 --- a/examples/jsm/controls/TransformControls.d.ts +++ b/examples/jsm/controls/TransformControls.d.ts @@ -14,12 +14,12 @@ export class TransformControls extends Object3D { // API camera: Camera; - object: Object3D; + object: Object3D | undefined; enabled: boolean; - axis: string; + axis: string | null; mode: string; - translationSnap: Vector3; - rotationSnap: Vector3; + translationSnap: number | null; + rotationSnap: number | null; space: string; size: number; dragging: boolean; @@ -27,19 +27,14 @@ export class TransformControls extends Object3D { showY: boolean; showZ: boolean; isTransformControls: boolean; - visible: boolean; mouseButtons: { - LEFT: MOUSE; + LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE; }; attach(object: Object3D): this; detach(): this; - pointerHover(pointer: Object): void; - pointerDown(pointer: Object): void; - pointerMove(pointer: Object): void; - pointerUp(pointer: Object): void; getMode(): string; setMode(mode: string): void; setTranslationSnap(translationSnap: Number | null): void; @@ -47,6 +42,5 @@ export class TransformControls extends Object3D { setSize(size: number): void; setSpace(space: string): void; dispose(): void; - update(): void; } diff --git a/examples/jsm/loaders/MMDLoader.d.ts b/examples/jsm/loaders/MMDLoader.d.ts index 70de07275d2b4df62222015ec399fc373f67ab66..c77056dbec0c38149e65a83cda1449f2a19a12a9 100644 --- a/examples/jsm/loaders/MMDLoader.d.ts +++ b/examples/jsm/loaders/MMDLoader.d.ts @@ -20,11 +20,11 @@ export class MMDLoader extends Loader { parser: object | null; load(url: string, onLoad: (mesh: SkinnedMesh) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; - loadAnimation(url: string, onLoad: (object: SkinnedMesh | AnimationClip) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; + loadAnimation(url: string, object: SkinnedMesh | THREE.Camera, onLoad: (object: SkinnedMesh | AnimationClip) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; loadPMD(url: string, onLoad: (object: object) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; loadPMX(url: string, onLoad: (object: object) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; loadVMD(url: string, onLoad: (object: object) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; - loadVPD(url: string, onLoad: (object: object) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; + loadVPD(url: string, isUnicode: boolean, onLoad: (object: object) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; loadWithAnimation(url: string, vmdUrl: string | string[], onLoad: (object: MMDLoaderAnimationObject) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; setAnimationPath(animationPath: string): this; } diff --git a/examples/jsm/loaders/VTKLoader.d.ts b/examples/jsm/loaders/VTKLoader.d.ts index c7c411d822f8a334e472eac803f0ef0f6e535fa5..7b72ffaa8bd22f5882a06a4a532adf35e38b17b3 100644 --- a/examples/jsm/loaders/VTKLoader.d.ts +++ b/examples/jsm/loaders/VTKLoader.d.ts @@ -4,7 +4,7 @@ import { LoadingManager } from '../../../src/Three'; -export class VRMLLoader extends Loader { +export class VTKLoader extends Loader { constructor(manager?: LoadingManager); load(url: string, onLoad: (geometry: BufferGeometry) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; diff --git a/examples/jsm/loaders/obj2/utils/CodeSerializer.js b/examples/jsm/loaders/obj2/utils/CodeSerializer.js index a8c484a3385b2c472c44f44498597a3a58b52ae7..8b9ccf73336d03036a4b70880f98a3da60542e1d 100644 --- a/examples/jsm/loaders/obj2/utils/CodeSerializer.js +++ b/examples/jsm/loaders/obj2/utils/CodeSerializer.js @@ -21,8 +21,8 @@ const CodeSerializer = { part = serializationTarget[ name ]; if ( typeof ( part ) === 'string' || part instanceof String ) { - part = part.replace( '\n', '\\n' ); - part = part.replace( '\r', '\\r' ); + part = part.replace( /\n/g, '\\n' ); + part = part.replace( /\r/g, '\\r' ); objectString += '\t' + name + ': "' + part + '",\n'; } else if ( part instanceof Array ) { @@ -31,7 +31,7 @@ const CodeSerializer = { } else if ( typeof part === 'object' ) { - console.log( 'Omitting object "' + name + '" and replace it with empty object.'); + console.log( 'Omitting object "' + name + '" and replace it with empty object.' ); objectString += '\t' + name + ': {},\n'; } else { @@ -75,7 +75,7 @@ const CodeSerializer = { if ( name === 'constructor' ) { - if ( !funcInstructions.isRemoveCode() ) { + if ( ! funcInstructions.isRemoveCode() ) { constructorString = fullObjectName + ' = ' + funcInstructions.getCode() + ';\n\n'; @@ -89,7 +89,7 @@ const CodeSerializer = { funcInstructions = funcTemp; } - if ( !funcInstructions.isRemoveCode() ) { + if ( ! funcInstructions.isRemoveCode() ) { if ( isExtended ) { @@ -136,7 +136,7 @@ const CodeSerializer = { } else if ( typeof objectPart === 'object' ) { - console.log( 'Omitting object "' + funcInstructions.getName() + '" and replace it with empty object.'); + console.log( 'Omitting object "' + funcInstructions.getName() + '" and replace it with empty object.' ); funcInstructions.setCode( "{}" ); } else { @@ -257,7 +257,7 @@ CodeSerializationInstruction.prototype = { * Returns the serialized function code * @return {String} */ - getCode: function() { + getCode: function () { return this.code; diff --git a/examples/jsm/postprocessing/OutlinePass.js b/examples/jsm/postprocessing/OutlinePass.js index e5515e73a479e84d9c993b167ff4de9cd7159db4..7f909b5195e34d1a32994509ece1b6d369278c23 100644 --- a/examples/jsm/postprocessing/OutlinePass.js +++ b/examples/jsm/postprocessing/OutlinePass.js @@ -530,18 +530,18 @@ OutlinePass.prototype = Object.assign( Object.create( Pass.prototype ), { void main() {\ vec2 invSize = 1.0 / texSize;\ float weightSum = gaussianPdf(0.0, kernelRadius);\ - vec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\ + vec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\ vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\ vec2 uvOffset = delta;\ for( int i = 1; i <= MAX_RADIUS; i ++ ) {\ float w = gaussianPdf(uvOffset.x, kernelRadius);\ - vec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\ - vec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\ + vec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\ + vec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\ diffuseSum += ((sample1 + sample2) * w);\ weightSum += (2.0 * w);\ uvOffset += delta;\ }\ - gl_FragColor = vec4(diffuseSum/weightSum, 1.0);\ + gl_FragColor = diffuseSum/weightSum;\ }" } ); diff --git a/examples/jsm/renderers/WebGLDeferredRenderer.d.ts b/examples/jsm/renderers/WebGLDeferredRenderer.d.ts index 8f6b68800f559015fd6c60eb73dc224a4fe69ae6..76b5463e7266ef0de49dab12c1fe64154cf03cea 100644 --- a/examples/jsm/renderers/WebGLDeferredRenderer.d.ts +++ b/examples/jsm/renderers/WebGLDeferredRenderer.d.ts @@ -8,9 +8,9 @@ import { export interface WebGLDeferredRendererParameters { antialias?: boolean; cacheKeepAlive?: boolean; - height?: Vector2; + height?: number; renderer?: WebGLRenderer; - width?: Vector2; + width?: number; } export class WebGLDeferredRenderer { diff --git a/examples/webgl_interactive_draggablecubes.html b/examples/misc_controls_drag.html similarity index 78% rename from examples/webgl_interactive_draggablecubes.html rename to examples/misc_controls_drag.html index 3d3aa6380b5438a492cd83df78d47a0376315107..f11a947ce1b78d1ef17dc647cc5ff4ec53f939ca 100644 --- a/examples/webgl_interactive_draggablecubes.html +++ b/examples/misc_controls_drag.html @@ -1,7 +1,7 @@ - three.js webgl - draggable cubes + three.js webgl - drag controls @@ -18,7 +18,7 @@
- three.js webgl - draggable cubes + three.js webgl - drag controls
+ + diff --git a/examples/webvr_paint.html b/examples/webvr_paint.html index 19f38304b9fb66bd915a9b60bd7ad950bb9cc146..21e48ec66974ede3d61766b1daf06af541223c65 100644 --- a/examples/webvr_paint.html +++ b/examples/webvr_paint.html @@ -5,8 +5,8 @@ - - + + diff --git a/examples/webvr_panorama.html b/examples/webvr_panorama.html index 2d66ddfacbfd73dd3b6aa2c58d3cc6ae71a71efe..d749d0766636053bbb7304db821ae873a8fe73cd 100644 --- a/examples/webvr_panorama.html +++ b/examples/webvr_panorama.html @@ -5,8 +5,8 @@ - - + + diff --git a/examples/webvr_rollercoaster.html b/examples/webvr_rollercoaster.html index 511951472d3cd6db1ff33be44ce99e750ce97a11..82fef21d9b489a430ad3e687737664dcd24e963b 100644 --- a/examples/webvr_rollercoaster.html +++ b/examples/webvr_rollercoaster.html @@ -5,8 +5,8 @@ - - + + diff --git a/examples/webvr_sandbox.html b/examples/webvr_sandbox.html index 1ab1bae0605fc25012aefefe0be8eeda3b1f05b2..4a5498fd79d0465677706a9cb5aca786a5b5aacb 100644 --- a/examples/webvr_sandbox.html +++ b/examples/webvr_sandbox.html @@ -5,8 +5,8 @@ - - + + diff --git a/examples/webvr_sculpt.html b/examples/webvr_sculpt.html index fd8070a03bc46e7d78cb611ef6a8bce42c323534..68a7fd47512855ba2affc9ee573aa56bd758e51e 100644 --- a/examples/webvr_sculpt.html +++ b/examples/webvr_sculpt.html @@ -5,8 +5,8 @@ - - + + diff --git a/examples/webvr_video.html b/examples/webvr_video.html index c83f834193fd4673a95b36fd11ea6c122d991e83..1c7581dfcaca9616aa770d7a079d26d046ef7d01 100644 --- a/examples/webvr_video.html +++ b/examples/webvr_video.html @@ -5,8 +5,8 @@ - - + +
diff --git a/examples/webvr_vive_paint.html b/examples/webvr_vive_paint.html index d8e5eced23390c3e1935c8e671b6951efb338a24..2b3bb0ff759f8db263eb1bfec285b0b947683fc5 100644 --- a/examples/webvr_vive_paint.html +++ b/examples/webvr_vive_paint.html @@ -5,8 +5,8 @@ - - + + diff --git a/examples/webvr_vive_sculpt.html b/examples/webvr_vive_sculpt.html index f820560addaa0db3f408736d36b8ba0dc4300d5c..c2eba7a5cecd2b879d0a9ff05cf5c8a6aaf6d8be 100644 --- a/examples/webvr_vive_sculpt.html +++ b/examples/webvr_vive_sculpt.html @@ -5,8 +5,8 @@ - - + + diff --git a/package.json b/package.json index 6fbf8d596441c46c721c67cdbbf3351091fd5b5f..cf3c88783ab2c29c0f2621786cc43b5b90ac6bc4 100644 --- a/package.json +++ b/package.json @@ -45,12 +45,12 @@ } }, "scripts": { - "build": "rollup -c", + "build": "rollup -c utils/build/rollup.config.js", "build-test": "rollup -c test/rollup.unit.config.js", - "build-closure": "rollup -c && google-closure-compiler --warning_level=VERBOSE --jscomp_off=globalThis --jscomp_off=checkTypes --externs utils/build/externs.js --language_in=ECMASCRIPT5_STRICT --js build/three.js --js_output_file build/three.min.js", - "build-examples": "rollup -c rollup-examples.config.js", - "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c -w -m inline\" \"http-server -c-1 -p 8080\"", - "dev-test": "concurrently --names \"ROLLUP,ROLLUPTEST,HTTP\" -c \"bgBlue.bold,bgRed.bold,bgGreen.bold\" \"rollup -c -w -m inline\" \"rollup -c test/rollup.unit.config.js -w -m inline\" \"http-server -p 8080\"", + "build-closure": "rollup -c utils/build/rollup.config.js && google-closure-compiler --warning_level=VERBOSE --jscomp_off=globalThis --jscomp_off=checkTypes --externs utils/build/externs.js --language_in=ECMASCRIPT5_STRICT --js build/three.js --js_output_file build/three.min.js", + "build-examples": "rollup -c utils/build/rollup-examples.config.js", + "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"http-server -c-1 -p 8080\"", + "dev-test": "concurrently --names \"ROLLUP,ROLLUPTEST,HTTP\" -c \"bgBlue.bold,bgRed.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"rollup -c test/rollup.unit.config.js -w -m inline\" \"http-server -p 8080\"", "start": "npm run dev", "lint": "eslint src --ext js --ext ts && tsc src/Three.d.ts --noEmit", "test": "npm run build-test && qunit -r failonlyreporter test/unit/three.source.unit.js", diff --git a/src/Three.Legacy.js b/src/Three.Legacy.js index 419cbbceb9b06b76c13a61b2f3a66635529404cc..0b3ef60bfb5688e0815867df8316b1df388e3927 100644 --- a/src/Three.Legacy.js +++ b/src/Three.Legacy.js @@ -1327,6 +1327,21 @@ Object.defineProperties( Material.prototype, { console.warn( 'THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.' ); this.flatShading = ( value === FlatShading ); + } + }, + + stencilMask: { + get: function () { + + console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' ); + return this.stencilFuncMask; + + }, + set: function ( value ) { + + console.warn( 'THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.' ); + this.stencilFuncMask = value; + } } diff --git a/src/Three.js b/src/Three.js index f6816d4eeab73ee3ff8cc80dc5f517b566012ae9..11165d499205cdf22a61a626007e04ca285beb0f 100644 --- a/src/Three.js +++ b/src/Three.js @@ -1,4 +1,5 @@ import './polyfills.js'; +import { REVISION } from './constants.js'; export { WebGLMultisampleRenderTarget } from './renderers/WebGLMultisampleRenderTarget.js'; export { WebGLRenderTargetCube } from './renderers/WebGLRenderTargetCube.js'; @@ -158,3 +159,13 @@ export { ShapeUtils } from './extras/ShapeUtils.js'; export { WebGLUtils } from './renderers/webgl/WebGLUtils.js'; export * from './constants.js'; export * from './Three.Legacy.js'; + +if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) { + + /* eslint-disable no-undef */ + __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: { + revision: REVISION, + } } ) ); + /* eslint-enable no-undef */ + +} diff --git a/src/animation/KeyframeTrack.d.ts b/src/animation/KeyframeTrack.d.ts index 73035c6b3e29944fc17fcea73ea5d17773cd6e92..eab8ce6b16ddf7159b1079fe24be7636f976471e 100644 --- a/src/animation/KeyframeTrack.d.ts +++ b/src/animation/KeyframeTrack.d.ts @@ -13,8 +13,8 @@ export class KeyframeTrack { ); name: string; - times: any[]; - values: any[]; + times: Float32Array; + values: Float32Array; ValueTypeName: string; TimeBufferType: Float32Array; diff --git a/src/helpers/ArrowHelper.js b/src/helpers/ArrowHelper.js index 34c35096fd183c1fc5cdcb1fd367496975085d20..bc73e592546dbb89fceb839cc2aacd9b245f10cf 100644 --- a/src/helpers/ArrowHelper.js +++ b/src/helpers/ArrowHelper.js @@ -97,7 +97,7 @@ ArrowHelper.prototype.setLength = function ( length, headLength, headWidth ) { if ( headLength === undefined ) headLength = 0.2 * length; if ( headWidth === undefined ) headWidth = 0.2 * headLength; - this.line.scale.set( 1, Math.max( 0, length - headLength ), 1 ); + this.line.scale.set( 1, Math.max( 0.0001, length - headLength ), 1 ); // see #17458 this.line.updateMatrix(); this.cone.scale.set( headWidth, headLength, headWidth ); diff --git a/src/loaders/MaterialLoader.js b/src/loaders/MaterialLoader.js index 2d639bcfcaf0d782f47cf184eb52916faf52b113..25932f801597560c763c3b5421442929a4002c07 100644 --- a/src/loaders/MaterialLoader.js +++ b/src/loaders/MaterialLoader.js @@ -79,6 +79,16 @@ MaterialLoader.prototype = Object.assign( Object.create( Loader.prototype ), { if ( json.depthTest !== undefined ) material.depthTest = json.depthTest; if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite; if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite; + + if ( json.stencilWrite !== undefined ) material.stencilWrite = json.stencilWrite; + if ( json.stencilWriteMask !== undefined ) material.stencilWriteMask = json.stencilWriteMask; + if ( json.stencilFunc !== undefined ) material.stencilFunc = json.stencilFunc; + if ( json.stencilRef !== undefined ) material.stencilRef = json.stencilRef; + if ( json.stencilFuncMask !== undefined ) material.stencilFuncMask = json.stencilFuncMask; + if ( json.stencilFail !== undefined ) material.stencilFail = json.stencilFail; + if ( json.stencilZFail !== undefined ) material.stencilZFail = json.stencilZFail; + if ( json.stencilZPass !== undefined ) material.stencilZPass = json.stencilZPass; + if ( json.wireframe !== undefined ) material.wireframe = json.wireframe; if ( json.wireframeLinewidth !== undefined ) material.wireframeLinewidth = json.wireframeLinewidth; if ( json.wireframeLinecap !== undefined ) material.wireframeLinecap = json.wireframeLinecap; diff --git a/src/materials/Material.js b/src/materials/Material.js index de49d8fc6dcb7fa35226ab7f6653996dc25c76a3..ee22bec3fa1c79ae3938d9c242aa560929590e81 100644 --- a/src/materials/Material.js +++ b/src/materials/Material.js @@ -41,9 +41,10 @@ function Material() { this.depthTest = true; this.depthWrite = true; + this.stencilWriteMask = 0xff; this.stencilFunc = AlwaysStencilFunc; this.stencilRef = 0; - this.stencilMask = 0xff; + this.stencilFuncMask = 0xff; this.stencilFail = KeepStencilOp; this.stencilZFail = KeepStencilOp; this.stencilZPass = KeepStencilOp; @@ -259,9 +260,10 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ), data.depthWrite = this.depthWrite; data.stencilWrite = this.stencilWrite; + data.stencilWriteMask = this.stencilWriteMask; data.stencilFunc = this.stencilFunc; data.stencilRef = this.stencilRef; - data.stencilMask = this.stencilMask; + data.stencilFuncMask = this.stencilFuncMask; data.stencilFail = this.stencilFail; data.stencilZFail = this.stencilZFail; data.stencilZPass = this.stencilZPass; @@ -363,9 +365,10 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ), this.depthWrite = source.depthWrite; this.stencilWrite = source.stencilWrite; + this.stencilWriteMask = source.stencilWriteMask; this.stencilFunc = source.stencilFunc; this.stencilRef = source.stencilRef; - this.stencilMask = source.stencilMask; + this.stencilFuncMask = source.stencilFuncMask; this.stencilFail = source.stencilFail; this.stencilZFail = source.stencilZFail; this.stencilZPass = source.stencilZPass; diff --git a/src/renderers/WebGLMultiviewRenderTarget.js b/src/renderers/WebGLMultiviewRenderTarget.js new file mode 100644 index 0000000000000000000000000000000000000000..fc3e22a576ecec54dbde2f47f20400bc7420d827 --- /dev/null +++ b/src/renderers/WebGLMultiviewRenderTarget.js @@ -0,0 +1,50 @@ +/** + * @author fernandojsg / http://fernandojsg.com + * @author Takahiro https://github.com/takahirox + */ + +import { WebGLRenderTarget } from './WebGLRenderTarget.js'; + +function WebGLMultiviewRenderTarget( width, height, numViews, options ) { + + WebGLRenderTarget.call( this, width, height, options ); + + this.depthBuffer = false; + this.stencilBuffer = false; + + this.numViews = numViews; + +} + +WebGLMultiviewRenderTarget.prototype = Object.assign( Object.create( WebGLRenderTarget.prototype ), { + + constructor: WebGLMultiviewRenderTarget, + + isWebGLMultiviewRenderTarget: true, + + copy: function ( source ) { + + WebGLRenderTarget.prototype.copy.call( this, source ); + + this.numViews = source.numViews; + + return this; + + }, + + setNumViews: function ( numViews ) { + + if ( this.numViews !== numViews ) { + + this.numViews = numViews; + this.dispose(); + + } + + return this; + + } + +} ); + +export { WebGLMultiviewRenderTarget }; diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 7f0cfbd62baab1c1c8502d3504cec57e7c84fe7a..d09b2c3f3e18b6d388a51713fb142d2c6472a32b 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -40,6 +40,7 @@ import { WebGLState } from './webgl/WebGLState.js'; import { WebGLTextures } from './webgl/WebGLTextures.js'; import { WebGLUniforms } from './webgl/WebGLUniforms.js'; import { WebGLUtils } from './webgl/WebGLUtils.js'; +import { WebGLMultiview } from './webgl/WebGLMultiview.js'; import { WebVRManager } from './webvr/WebVRManager.js'; import { WebXRManager } from './webvr/WebXRManager.js'; @@ -312,6 +313,10 @@ function WebGLRenderer( parameters ) { this.vr = vr; + // Multiview + + var multiview = new WebGLMultiview( _this, _gl ); + // shadow map var shadowMap = new WebGLShadowMap( _this, objects, capabilities.maxTextureSize ); @@ -1175,6 +1180,12 @@ function WebGLRenderer( parameters ) { } + if ( capabilities.multiview ) { + + multiview.attachCamera( camera ); + + } + // background.render( currentRenderList, scene, camera, forceClear ); @@ -1229,6 +1240,12 @@ function WebGLRenderer( parameters ) { state.setPolygonOffset( false ); + if ( capabilities.multiview ) { + + multiview.detachCamera( camera ); + + } + if ( vr.enabled ) { vr.submitFrame(); @@ -1375,19 +1392,27 @@ function WebGLRenderer( parameters ) { _currentArrayCamera = camera; - var cameras = camera.cameras; + if ( capabilities.multiview ) { + + renderObject( object, scene, camera, geometry, material, group ); + + } else { + + var cameras = camera.cameras; - for ( var j = 0, jl = cameras.length; j < jl; j ++ ) { + for ( var j = 0, jl = cameras.length; j < jl; j ++ ) { - var camera2 = cameras[ j ]; + var camera2 = cameras[ j ]; - if ( object.layers.test( camera2.layers ) ) { + if ( object.layers.test( camera2.layers ) ) { - state.viewport( _currentViewport.copy( camera2.viewport ) ); + state.viewport( _currentViewport.copy( camera2.viewport ) ); - currentRenderState.setupLights( camera2 ); + currentRenderState.setupLights( camera2 ); - renderObject( object, scene, camera2, geometry, material, group ); + renderObject( object, scene, camera2, geometry, material, group ); + + } } @@ -1682,7 +1707,15 @@ function WebGLRenderer( parameters ) { if ( refreshProgram || _currentCamera !== camera ) { - p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + if ( program.numMultiviewViews > 0 ) { + + multiview.updateCameraProjectionMatricesUniform( camera, p_uniforms ); + + } else { + + p_uniforms.setValue( _gl, 'projectionMatrix', camera.projectionMatrix ); + + } if ( capabilities.logarithmicDepthBuffer ) { @@ -1730,7 +1763,15 @@ function WebGLRenderer( parameters ) { material.isShaderMaterial || material.skinning ) { - p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + if ( program.numMultiviewViews > 0 ) { + + multiview.updateCameraViewMatricesUniform( camera, p_uniforms ); + + } else { + + p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse ); + + } } @@ -1935,8 +1976,17 @@ function WebGLRenderer( parameters ) { // common matrices - p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix ); - p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix ); + if ( program.numMultiviewViews > 0 ) { + + multiview.updateObjectMatricesUniforms( object, camera, p_uniforms ); + + } else { + + p_uniforms.setValue( _gl, 'modelViewMatrix', object.modelViewMatrix ); + p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix ); + + } + p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld ); return program; diff --git a/src/renderers/webgl/WebGLCapabilities.js b/src/renderers/webgl/WebGLCapabilities.js index 4eafd2132f9ce2ed650c59fbc35611190a4c0bdd..9e0b045f0d7203048b94e87b75add979c7ebbb51 100644 --- a/src/renderers/webgl/WebGLCapabilities.js +++ b/src/renderers/webgl/WebGLCapabilities.js @@ -86,6 +86,10 @@ function WebGLCapabilities( gl, extensions, parameters ) { var maxSamples = isWebGL2 ? gl.getParameter( gl.MAX_SAMPLES ) : 0; + var multiviewExt = extensions.get( 'OVR_multiview2' ); + var multiview = isWebGL2 && !! multiviewExt && ! gl.getContextAttributes().antialias; + var maxMultiviewViews = multiview ? gl.getParameter( multiviewExt.MAX_VIEWS_OVR ) : 0; + return { isWebGL2: isWebGL2, @@ -110,7 +114,10 @@ function WebGLCapabilities( gl, extensions, parameters ) { floatFragmentTextures: floatFragmentTextures, floatVertexTextures: floatVertexTextures, - maxSamples: maxSamples + maxSamples: maxSamples, + + multiview: multiview, + maxMultiviewViews: maxMultiviewViews }; diff --git a/src/renderers/webgl/WebGLMultiview.js b/src/renderers/webgl/WebGLMultiview.js new file mode 100644 index 0000000000000000000000000000000000000000..a8b78d4ffb19a4757c6aae6dbd717486d2345996 --- /dev/null +++ b/src/renderers/webgl/WebGLMultiview.js @@ -0,0 +1,211 @@ +/** + * @author fernandojsg / http://fernandojsg.com + * @author Takahiro https://github.com/takahirox + */ + +import { WebGLMultiviewRenderTarget } from '../WebGLMultiviewRenderTarget.js'; +import { Matrix3 } from '../../math/Matrix3.js'; +import { Matrix4 } from '../../math/Matrix4.js'; +import { Vector2 } from '../../math/Vector2.js'; + +function WebGLMultiview( renderer, gl ) { + + var DEFAULT_NUMVIEWS = 2; + + var capabilities = renderer.capabilities; + var properties = renderer.properties; + + var maxNumViews = capabilities.maxMultiviewViews; + + var renderTarget, currentRenderTarget; + var mat3, mat4, cameraArray, renderSize; + + function getCameraArray( camera ) { + + if ( camera.isArrayCamera ) return camera.cameras; + + cameraArray[ 0 ] = camera; + + return cameraArray; + + } + + // + + function updateCameraProjectionMatricesUniform( camera, uniforms ) { + + var cameras = getCameraArray( camera ); + + for ( var i = 0; i < cameras.length; i ++ ) { + + mat4[ i ].copy( cameras[ i ].projectionMatrix ); + + } + + uniforms.setValue( gl, 'projectionMatrices', mat4 ); + + } + + function updateCameraViewMatricesUniform( camera, uniforms ) { + + var cameras = getCameraArray( camera ); + + for ( var i = 0; i < cameras.length; i ++ ) { + + mat4[ i ].copy( cameras[ i ].matrixWorldInverse ); + + } + + uniforms.setValue( gl, 'viewMatrices', mat4 ); + + } + + function updateObjectMatricesUniforms( object, camera, uniforms ) { + + var cameras = getCameraArray( camera ); + + for ( var i = 0; i < cameras.length; i ++ ) { + + mat4[ i ].multiplyMatrices( cameras[ i ].matrixWorldInverse, object.matrixWorld ); + mat3[ i ].getNormalMatrix( mat4[ i ] ); + + } + + uniforms.setValue( gl, 'modelViewMatrices', mat4 ); + uniforms.setValue( gl, 'normalMatrices', mat3 ); + + } + + function isMultiviewCompatible( camera ) { + + if ( ! camera.isArrayCamera ) return true; + + var cameras = camera.cameras; + + if ( cameras.length > maxNumViews ) return false; + + for ( var i = 1, il = cameras.length; i < il; i ++ ) { + + if ( cameras[ 0 ].viewport.z !== cameras[ i ].viewport.z || + cameras[ 0 ].viewport.w !== cameras[ i ].viewport.w ) return false; + + } + + return true; + + } + + function resizeRenderTarget( camera ) { + + if ( currentRenderTarget ) { + + renderSize.set( currentRenderTarget.width, currentRenderTarget.height ); + + } else { + + renderer.getDrawingBufferSize( renderSize ); + + } + + if ( camera.isArrayCamera ) { + + var viewport = camera.cameras[ 0 ].viewport; + + renderTarget.setSize( viewport.z, viewport.w ); + + renderTarget.setNumViews( camera.cameras.length ); + + } else { + + renderTarget.setSize( renderSize.x, renderSize.y ); + renderTarget.setNumViews( DEFAULT_NUMVIEWS ); + + } + + } + + function attachCamera( camera ) { + + if ( ! isMultiviewCompatible( camera ) ) return; + + currentRenderTarget = renderer.getRenderTarget(); + resizeRenderTarget( camera ); + renderer.setRenderTarget( renderTarget ); + + } + + function detachCamera( camera ) { + + if ( renderTarget !== renderer.getRenderTarget() ) return; + + renderer.setRenderTarget( currentRenderTarget ); + flush( camera ); + + } + + function flush( camera ) { + + var srcRenderTarget = renderTarget; + var numViews = srcRenderTarget.numViews; + + var srcFramebuffers = properties.get( srcRenderTarget ).__webglViewFramebuffers; + + var viewWidth = srcRenderTarget.width; + var viewHeight = srcRenderTarget.height; + + if ( camera.isArrayCamera ) { + + for ( var i = 0; i < numViews; i ++ ) { + + var viewport = camera.cameras[ i ].viewport; + + var x1 = viewport.x; + var y1 = viewport.y; + var x2 = x1 + viewport.z; + var y2 = y1 + viewport.w; + + gl.bindFramebuffer( gl.READ_FRAMEBUFFER, srcFramebuffers[ i ] ); + gl.blitFramebuffer( 0, 0, viewWidth, viewHeight, x1, y1, x2, y2, gl.COLOR_BUFFER_BIT, gl.NEAREST ); + + } + + } else { + + gl.bindFramebuffer( gl.READ_FRAMEBUFFER, srcFramebuffers[ 0 ] ); + gl.blitFramebuffer( 0, 0, viewWidth, viewHeight, 0, 0, renderSize.x, renderSize.y, gl.COLOR_BUFFER_BIT, gl.NEAREST ); + + } + + } + + + if ( renderer.capabilities.multiview ) { + + renderTarget = new WebGLMultiviewRenderTarget( 0, 0, DEFAULT_NUMVIEWS ); + + renderSize = new Vector2(); + mat4 = []; + mat3 = []; + cameraArray = []; + + var maxViews = capabilities.maxMultiviewViews; + + for ( var i = 0; i < maxViews; i ++ ) { + + mat4[ i ] = new Matrix4(); + mat3[ i ] = new Matrix3(); + + } + + } + + + this.attachCamera = attachCamera; + this.detachCamera = detachCamera; + this.updateCameraProjectionMatricesUniform = updateCameraProjectionMatricesUniform; + this.updateCameraViewMatricesUniform = updateCameraViewMatricesUniform; + this.updateObjectMatricesUniforms = updateObjectMatricesUniforms; + +} + +export { WebGLMultiview }; diff --git a/src/renderers/webgl/WebGLProgram.js b/src/renderers/webgl/WebGLProgram.js index 81b47a2866b2c03601a7ea010ffbe7d4e445af68..528ab6868078e5c33dc911abb15ef11cc0fea31e 100644 --- a/src/renderers/webgl/WebGLProgram.js +++ b/src/renderers/webgl/WebGLProgram.js @@ -340,6 +340,9 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, var prefixVertex, prefixFragment; + var renderTarget = renderer.getRenderTarget(); + var numMultiviewViews = renderTarget && renderTarget.isWebGLMultiviewRenderTarget ? renderTarget.numViews : 0; + if ( material.isRawShaderMaterial ) { prefixVertex = [ @@ -427,14 +430,29 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', parameters.logarithmicDepthBuffer && ( capabilities.isWebGL2 || extensions.get( 'EXT_frag_depth' ) ) ? '#define USE_LOGDEPTHBUF_EXT' : '', - 'uniform mat4 modelMatrix;', - 'uniform mat4 modelViewMatrix;', - 'uniform mat4 projectionMatrix;', - 'uniform mat4 viewMatrix;', - 'uniform mat3 normalMatrix;', 'uniform vec3 cameraPosition;', + numMultiviewViews > 0 ? [ + 'uniform mat4 modelViewMatrices[' + numMultiviewViews + '];', + 'uniform mat3 normalMatrices[' + numMultiviewViews + '];', + 'uniform mat4 viewMatrices[' + numMultiviewViews + '];', + 'uniform mat4 projectionMatrices[' + numMultiviewViews + '];', + + '#define modelViewMatrix modelViewMatrices[VIEW_ID]', + '#define normalMatrix normalMatrices[VIEW_ID]', + '#define viewMatrix viewMatrices[VIEW_ID]', + '#define projectionMatrix projectionMatrices[VIEW_ID]' + + ].join( '\n' ) : [ + + 'uniform mat4 modelViewMatrix;', + 'uniform mat4 projectionMatrix;', + 'uniform mat4 viewMatrix;', + 'uniform mat3 normalMatrix;', + + ].join( '\n' ), + 'attribute vec3 position;', 'attribute vec3 normal;', 'attribute vec2 uv;', @@ -551,9 +569,15 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, ( ( material.extensions ? material.extensions.shaderTextureLOD : false ) || parameters.envMap ) && ( capabilities.isWebGL2 || extensions.get( 'EXT_shader_texture_lod' ) ) ? '#define TEXTURE_LOD_EXT' : '', - 'uniform mat4 viewMatrix;', 'uniform vec3 cameraPosition;', + numMultiviewViews > 0 ? [ + + 'uniform mat4 viewMatrices[' + numMultiviewViews + '];', + '#define viewMatrix viewMatrices[VIEW_ID]' + + ].join( '\n' ) : 'uniform mat4 viewMatrix;', + ( parameters.toneMapping !== NoToneMapping ) ? '#define TONE_MAPPING' : '', ( parameters.toneMapping !== NoToneMapping ) ? ShaderChunk[ 'tonemapping_pars_fragment' ] : '', // this code is required here because it is used by the toneMapping() function defined below ( parameters.toneMapping !== NoToneMapping ) ? getToneMappingFunction( 'toneMapping', parameters.toneMapping ) : '', @@ -607,6 +631,15 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, // GLSL 3.0 conversion prefixVertex = [ '#version 300 es\n', + + numMultiviewViews > 0 ? [ + + '#extension GL_OVR_multiview2 : require', + 'layout(num_views = ' + numMultiviewViews + ') in;', + '#define VIEW_ID gl_ViewID_OVR' + + ].join( '\n' ) : '', + '#define attribute in', '#define varying out', '#define texture2D texture' @@ -614,6 +647,12 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, prefixFragment = [ '#version 300 es\n', + numMultiviewViews > 0 ? [ + + '#extension GL_OVR_multiview2 : require', + '#define VIEW_ID gl_ViewID_OVR' + + ].join( '\n' ) : '', '#define varying in', isGLSL3ShaderMaterial ? '' : 'out highp vec4 pc_fragColor;', isGLSL3ShaderMaterial ? '' : '#define gl_FragColor pc_fragColor', @@ -771,6 +810,7 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, this.program = program; this.vertexShader = glVertexShader; this.fragmentShader = glFragmentShader; + this.numMultiviewViews = numMultiviewViews; return this; diff --git a/src/renderers/webgl/WebGLState.js b/src/renderers/webgl/WebGLState.js index 435e287290a96cb1ccf95a7752e0dec1e87f7c00..84ca3965c453df691c1b966711863fa6361342f5 100644 --- a/src/renderers/webgl/WebGLState.js +++ b/src/renderers/webgl/WebGLState.js @@ -685,7 +685,8 @@ function WebGLState( gl, extensions, utils, capabilities ) { stencilBuffer.setTest( stencilWrite ); if ( stencilWrite ) { - stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilMask ); + stencilBuffer.setMask( material.stencilWriteMask ); + stencilBuffer.setFunc( material.stencilFunc, material.stencilRef, material.stencilFuncMask ); stencilBuffer.setOp( material.stencilFail, material.stencilZFail, material.stencilZPass ); } diff --git a/src/renderers/webgl/WebGLTextures.js b/src/renderers/webgl/WebGLTextures.js index 337ed326d4afaadeeb7758fbb4d9ab84d6006cf7..363212325565eccbc47d78b44d38d0e1b8539b26 100644 --- a/src/renderers/webgl/WebGLTextures.js +++ b/src/renderers/webgl/WebGLTextures.js @@ -260,6 +260,21 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } + if ( renderTarget.isWebGLMultiviewRenderTarget ) { + + _gl.deleteTexture( renderTargetProperties.__webglColorTexture ); + _gl.deleteTexture( renderTargetProperties.__webglDepthStencilTexture ); + + info.memory.textures -= 2; + + for ( var i = 0, il = renderTargetProperties.__webglViewFramebuffers.length; i < il; i ++ ) { + + _gl.deleteFramebuffer( renderTargetProperties.__webglViewFramebuffers[ i ] ); + + } + + } + properties.remove( renderTarget.texture ); properties.remove( renderTarget ); @@ -946,6 +961,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, var isCube = ( renderTarget.isWebGLRenderTargetCube === true ); var isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true ); + var isMultiview = ( renderTarget.isWebGLMultiviewRenderTarget === true ); var supportsMips = isPowerOfTwo( renderTarget ) || capabilities.isWebGL2; // Setup framebuffer @@ -998,6 +1014,56 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, } + } else if ( isMultiview ) { + + if ( capabilities.multiview ) { + + var width = renderTarget.width; + var height = renderTarget.height; + var numViews = renderTarget.numViews; + + _gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer ); + + var ext = extensions.get( 'OVR_multiview2' ); + + info.memory.textures += 2; + + var colorTexture = _gl.createTexture(); + _gl.bindTexture( _gl.TEXTURE_2D_ARRAY, colorTexture ); + _gl.texParameteri( _gl.TEXTURE_2D_ARRAY, _gl.TEXTURE_MAG_FILTER, _gl.NEAREST ); + _gl.texParameteri( _gl.TEXTURE_2D_ARRAY, _gl.TEXTURE_MIN_FILTER, _gl.NEAREST ); + _gl.texImage3D( _gl.TEXTURE_2D_ARRAY, 0, _gl.RGBA8, width, height, numViews, 0, _gl.RGBA, _gl.UNSIGNED_BYTE, null ); + ext.framebufferTextureMultiviewOVR( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, colorTexture, 0, 0, numViews ); + + var depthStencilTexture = _gl.createTexture(); + _gl.bindTexture( _gl.TEXTURE_2D_ARRAY, depthStencilTexture ); + _gl.texParameteri( _gl.TEXTURE_2D_ARRAY, _gl.TEXTURE_MAG_FILTER, _gl.NEAREST ); + _gl.texParameteri( _gl.TEXTURE_2D_ARRAY, _gl.TEXTURE_MIN_FILTER, _gl.NEAREST ); + _gl.texImage3D( _gl.TEXTURE_2D_ARRAY, 0, _gl.DEPTH24_STENCIL8, width, height, numViews, 0, _gl.DEPTH_STENCIL, _gl.UNSIGNED_INT_24_8, null ); + ext.framebufferTextureMultiviewOVR( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, depthStencilTexture, 0, 0, numViews ); + + var viewFramebuffers = new Array( numViews ); + for ( var i = 0; i < numViews; ++ i ) { + + viewFramebuffers[ i ] = _gl.createFramebuffer(); + _gl.bindFramebuffer( _gl.FRAMEBUFFER, viewFramebuffers[ i ] ); + _gl.framebufferTextureLayer( _gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, colorTexture, 0, i ); + + } + + renderTargetProperties.__webglColorTexture = colorTexture; + renderTargetProperties.__webglDepthStencilTexture = depthStencilTexture; + renderTargetProperties.__webglViewFramebuffers = viewFramebuffers; + + _gl.bindFramebuffer( _gl.FRAMEBUFFER, null ); + _gl.bindTexture( _gl.TEXTURE_2D_ARRAY, null ); + + } else { + + console.warn( 'THREE.WebGLRenderer: WebGLMultiviewRenderTarget can only be used with WebGL2 and Multiview extension support.' ); + + } + } } @@ -1023,7 +1089,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils, state.bindTexture( _gl.TEXTURE_CUBE_MAP, null ); - } else { + } else if ( ! isMultiview ) { state.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture ); setTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, supportsMips ); diff --git a/src/utils.d.ts b/src/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d74f7bf918f45d902e50e694307975ee98ac8f57 --- /dev/null +++ b/src/utils.d.ts @@ -0,0 +1,2 @@ +export function arrayMin( array: number[] ): number; +export function arrayMax( array: number[] ): number; diff --git a/rollup-examples.config.js b/utils/build/rollup-examples.config.js similarity index 100% rename from rollup-examples.config.js rename to utils/build/rollup-examples.config.js diff --git a/rollup.config.js b/utils/build/rollup.config.js similarity index 100% rename from rollup.config.js rename to utils/build/rollup.config.js