diff --git a/build/three.js b/build/three.js index a78cbe71aa17b8557a5f5ccb76a2914b38788fb7..519b3da8bcb9104e4f9161d7bc6865cf1bcc316c 100644 --- a/build/three.js +++ b/build/three.js @@ -61,31 +61,27 @@ // Missing in IE // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign - ( function () { + Object.assign = function ( target ) { - Object.assign = function ( target ) { + if ( target === undefined || target === null ) { - if ( target === undefined || target === null ) { + throw new TypeError( 'Cannot convert undefined or null to object' ); - throw new TypeError( 'Cannot convert undefined or null to object' ); - - } + } - var output = Object( target ); + var output = Object( target ); - for ( var index = 1; index < arguments.length; index ++ ) { + for ( var index = 1; index < arguments.length; index ++ ) { - var source = arguments[ index ]; + var source = arguments[ index ]; - if ( source !== undefined && source !== null ) { + if ( source !== undefined && source !== null ) { - for ( var nextKey in source ) { + for ( var nextKey in source ) { - if ( Object.prototype.hasOwnProperty.call( source, nextKey ) ) { + if ( Object.prototype.hasOwnProperty.call( source, nextKey ) ) { - output[ nextKey ] = source[ nextKey ]; - - } + output[ nextKey ] = source[ nextKey ]; } @@ -93,11 +89,11 @@ } - return output; + } - }; + return output; - } )(); + }; } @@ -5186,11 +5182,14 @@ * @author elephantatwork / www.elephantatwork.ch */ - var object3DId = 0; + var _object3DId = 0; + var _m1$1, _q1, _v1$1; + var _xAxis, _yAxis, _zAxis; + var _target, _position, _scale, _quaternion$2; function Object3D() { - Object.defineProperty( this, 'id', { value: object3DId ++ } ); + Object.defineProperty( this, 'id', { value: _object3DId ++ } ); this.uuid = _Math.generateUUID(); @@ -5330,135 +5329,99 @@ }, - rotateOnAxis: function () { + rotateOnAxis: function ( axis, angle ) { // rotate object on axis in object space // axis is assumed to be normalized - var q1 = new Quaternion(); - - return function rotateOnAxis( axis, angle ) { + if ( _q1 === undefined ) _q1 = new Quaternion(); - q1.setFromAxisAngle( axis, angle ); + _q1.setFromAxisAngle( axis, angle ); - this.quaternion.multiply( q1 ); + this.quaternion.multiply( _q1 ); - return this; - - }; + return this; - }(), + }, - rotateOnWorldAxis: function () { + rotateOnWorldAxis: function ( axis, angle ) { // rotate object on axis in world space // axis is assumed to be normalized // method assumes no rotated parent - var q1 = new Quaternion(); - - return function rotateOnWorldAxis( axis, angle ) { - - q1.setFromAxisAngle( axis, angle ); - - this.quaternion.premultiply( q1 ); - - return this; - - }; - - }(), - - rotateX: function () { - - var v1 = new Vector3( 1, 0, 0 ); + if ( _q1 === undefined ) _q1 = new Quaternion(); - return function rotateX( angle ) { + _q1.setFromAxisAngle( axis, angle ); - return this.rotateOnAxis( v1, angle ); + this.quaternion.premultiply( _q1 ); - }; + return this; - }(), + }, - rotateY: function () { + rotateX: function ( angle ) { - var v1 = new Vector3( 0, 1, 0 ); + if ( _xAxis === undefined ) _xAxis = new Vector3( 1, 0, 0 ); - return function rotateY( angle ) { + return this.rotateOnAxis( _xAxis, angle ); - return this.rotateOnAxis( v1, angle ); + }, - }; + rotateY: function ( angle ) { - }(), + if ( _yAxis === undefined ) _yAxis = new Vector3( 0, 1, 0 ); - rotateZ: function () { + return this.rotateOnAxis( _yAxis, angle ); - var v1 = new Vector3( 0, 0, 1 ); + }, - return function rotateZ( angle ) { + rotateZ: function ( angle ) { - return this.rotateOnAxis( v1, angle ); + if ( _zAxis === undefined ) _zAxis = new Vector3( 0, 0, 1 ); - }; + return this.rotateOnAxis( _zAxis, angle ); - }(), + }, - translateOnAxis: function () { + translateOnAxis: function ( axis, distance ) { // translate object by distance along axis in object space // axis is assumed to be normalized - var v1 = new Vector3(); - - return function translateOnAxis( axis, distance ) { - - v1.copy( axis ).applyQuaternion( this.quaternion ); - - this.position.add( v1.multiplyScalar( distance ) ); + if ( _v1$1 === undefined ) _v1$1 = new Vector3(); - return this; - - }; - - }(), - - translateX: function () { - - var v1 = new Vector3( 1, 0, 0 ); - - return function translateX( distance ) { + _v1$1.copy( axis ).applyQuaternion( this.quaternion ); - return this.translateOnAxis( v1, distance ); + this.position.add( _v1$1.multiplyScalar( distance ) ); - }; + return this; - }(), + }, - translateY: function () { + translateX: function ( distance ) { - var v1 = new Vector3( 0, 1, 0 ); + if ( _xAxis === undefined ) _xAxis = new Vector3( 1, 0, 0 ); - return function translateY( distance ) { + return this.translateOnAxis( _xAxis, distance ); - return this.translateOnAxis( v1, distance ); + }, - }; + translateY: function ( distance ) { - }(), + if ( _yAxis === undefined ) _yAxis = new Vector3( 0, 1, 0 ); - translateZ: function () { + return this.translateOnAxis( _yAxis, distance ); - var v1 = new Vector3( 0, 0, 1 ); + }, - return function translateZ( distance ) { + translateZ: function ( distance ) { - return this.translateOnAxis( v1, distance ); + if ( _zAxis === undefined ) _zAxis = new Vector3( 0, 0, 1 ); - }; + return this.translateOnAxis( _zAxis, distance ); - }(), + }, localToWorld: function ( vector ) { @@ -5466,68 +5429,64 @@ }, - worldToLocal: function () { + worldToLocal: function ( vector ) { - var m1 = new Matrix4(); + if ( _m1$1 === undefined ) _m1$1 = new Matrix4(); - return function worldToLocal( vector ) { + return vector.applyMatrix4( _m1$1.getInverse( this.matrixWorld ) ); - return vector.applyMatrix4( m1.getInverse( this.matrixWorld ) ); - - }; - - }(), + }, - lookAt: function () { + lookAt: function ( x, y, z ) { // This method does not support objects having non-uniformly-scaled parent(s) - var q1 = new Quaternion(); - var m1 = new Matrix4(); - var target = new Vector3(); - var position = new Vector3(); + if ( _position === undefined ) { - return function lookAt( x, y, z ) { + _q1 = new Quaternion(); + _m1$1 = new Matrix4(); + _target = new Vector3(); + _position = new Vector3(); - if ( x.isVector3 ) { + } - target.copy( x ); + if ( x.isVector3 ) { - } else { + _target.copy( x ); - target.set( x, y, z ); + } else { - } + _target.set( x, y, z ); - var parent = this.parent; + } - this.updateWorldMatrix( true, false ); + var parent = this.parent; - position.setFromMatrixPosition( this.matrixWorld ); + this.updateWorldMatrix( true, false ); - if ( this.isCamera || this.isLight ) { + _position.setFromMatrixPosition( this.matrixWorld ); - m1.lookAt( position, target, this.up ); + if ( this.isCamera || this.isLight ) { - } else { + _m1$1.lookAt( _position, _target, this.up ); - m1.lookAt( target, position, this.up ); + } else { - } + _m1$1.lookAt( _target, _position, this.up ); - this.quaternion.setFromRotationMatrix( m1 ); + } - if ( parent ) { + this.quaternion.setFromRotationMatrix( _m1$1 ); - m1.extractRotation( parent.matrixWorld ); - q1.setFromRotationMatrix( m1 ); - this.quaternion.premultiply( q1.inverse() ); + if ( parent ) { - } + _m1$1.extractRotation( parent.matrixWorld ); + _q1.setFromRotationMatrix( _m1$1 ); + this.quaternion.premultiply( _q1.inverse() ); - }; + } - }(), + }, add: function ( object ) { @@ -5602,37 +5561,33 @@ }, - attach: function () { + attach: function ( object ) { // adds object as a child of this, while maintaining the object's world transform - var m = new Matrix4(); - - return function attach( object ) { - - this.updateWorldMatrix( true, false ); + if ( _m1$1 === undefined ) _m1$1 = new Matrix4(); - m.getInverse( this.matrixWorld ); + this.updateWorldMatrix( true, false ); - if ( object.parent !== null ) { + _m1$1.getInverse( this.matrixWorld ); - object.parent.updateWorldMatrix( true, false ); + if ( object.parent !== null ) { - m.multiply( object.parent.matrixWorld ); + object.parent.updateWorldMatrix( true, false ); - } + _m1$1.multiply( object.parent.matrixWorld ); - object.applyMatrix( m ); + } - object.updateWorldMatrix( false, false ); + object.applyMatrix( _m1$1 ); - this.add( object ); + object.updateWorldMatrix( false, false ); - return this; + this.add( object ); - }; + return this; - }(), + }, getObjectById: function ( id ) { @@ -5682,53 +5637,53 @@ }, - getWorldQuaternion: function () { + getWorldQuaternion: function ( target ) { - var position = new Vector3(); - var scale = new Vector3(); + if ( _scale === undefined ) { - return function getWorldQuaternion( target ) { + _position = new Vector3(); + _scale = new Vector3(); - if ( target === undefined ) { + } - console.warn( 'THREE.Object3D: .getWorldQuaternion() target is now required' ); - target = new Quaternion(); + if ( target === undefined ) { - } + console.warn( 'THREE.Object3D: .getWorldQuaternion() target is now required' ); + target = new Quaternion(); - this.updateMatrixWorld( true ); + } - this.matrixWorld.decompose( position, target, scale ); + this.updateMatrixWorld( true ); - return target; + this.matrixWorld.decompose( _position, target, _scale ); - }; + return target; - }(), + }, - getWorldScale: function () { + getWorldScale: function ( target ) { - var position = new Vector3(); - var quaternion = new Quaternion(); + if ( _quaternion$2 === undefined ) { - return function getWorldScale( target ) { + _position = new Vector3(); + _quaternion$2 = new Quaternion(); - if ( target === undefined ) { + } - console.warn( 'THREE.Object3D: .getWorldScale() target is now required' ); - target = new Vector3(); + if ( target === undefined ) { - } + console.warn( 'THREE.Object3D: .getWorldScale() target is now required' ); + target = new Vector3(); - this.updateMatrixWorld( true ); + } - this.matrixWorld.decompose( position, quaternion, target ); + this.updateMatrixWorld( true ); - return target; + this.matrixWorld.decompose( _position, _quaternion$2, target ); - }; + return target; - }(), + }, getWorldDirection: function ( target ) { @@ -6169,7 +6124,7 @@ var _points; var _vector$2; - var _v0, _v1$1, _v2; + var _v0, _v1$2, _v2; var _f0, _f1, _f2; var _center; var _extents; @@ -6554,7 +6509,7 @@ // triangle centered vertices _v0 = new Vector3(); - _v1$1 = new Vector3(); + _v1$2 = new Vector3(); _v2 = new Vector3(); // triangle edge vectors @@ -6581,12 +6536,12 @@ // translate triangle to aabb origin _v0.subVectors( triangle.a, _center ); - _v1$1.subVectors( triangle.b, _center ); + _v1$2.subVectors( triangle.b, _center ); _v2.subVectors( triangle.c, _center ); // compute edge vectors for triangle - _f0.subVectors( _v1$1, _v0 ); - _f1.subVectors( _v2, _v1$1 ); + _f0.subVectors( _v1$2, _v0 ); + _f1.subVectors( _v2, _v1$2 ); _f2.subVectors( _v0, _v2 ); // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb @@ -6597,7 +6552,7 @@ _f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x, - _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0 ]; - if ( ! satForAxes( axes, _v0, _v1$1, _v2, _extents ) ) { + if ( ! satForAxes( axes, _v0, _v1$2, _v2, _extents ) ) { return false; @@ -6605,7 +6560,7 @@ // test 3 face normals from the aabb axes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ]; - if ( ! satForAxes( axes, _v0, _v1$1, _v2, _extents ) ) { + if ( ! satForAxes( axes, _v0, _v1$2, _v2, _extents ) ) { return false; @@ -6616,7 +6571,7 @@ _triangleNormal.crossVectors( _f0, _f1 ); axes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ]; - return satForAxes( axes, _v0, _v1$1, _v2, _extents ); + return satForAxes( axes, _v0, _v1$2, _v2, _extents ); }, @@ -7477,7 +7432,7 @@ * @author mrdoob / http://mrdoob.com/ */ - var _v0$1, _v1$2, _v2$1, _v3; + var _v0$1, _v1$3, _v2$1, _v3; var _vab, _vac, _vbc, _vap, _vbp, _vcp; function Triangle( a, b, c ) { @@ -7523,20 +7478,20 @@ if ( _v2$1 === undefined ) { _v0$1 = new Vector3(); - _v1$2 = new Vector3(); + _v1$3 = new Vector3(); _v2$1 = new Vector3(); } _v0$1.subVectors( c, a ); - _v1$2.subVectors( b, a ); + _v1$3.subVectors( b, a ); _v2$1.subVectors( point, a ); var dot00 = _v0$1.dot( _v0$1 ); - var dot01 = _v0$1.dot( _v1$2 ); + var dot01 = _v0$1.dot( _v1$3 ); var dot02 = _v0$1.dot( _v2$1 ); - var dot11 = _v1$2.dot( _v1$2 ); - var dot12 = _v1$2.dot( _v2$1 ); + var dot11 = _v1$3.dot( _v1$3 ); + var dot12 = _v1$3.dot( _v2$1 ); var denom = ( dot00 * dot11 - dot01 * dot01 ); @@ -7592,18 +7547,18 @@ isFrontFacing: function ( a, b, c, direction ) { - if ( _v1$2 === undefined ) { + if ( _v1$3 === undefined ) { _v0$1 = new Vector3(); - _v1$2 = new Vector3(); + _v1$3 = new Vector3(); } _v0$1.subVectors( c, b ); - _v1$2.subVectors( a, b ); + _v1$3.subVectors( a, b ); // strictly front facing - return ( _v0$1.cross( _v1$2 ).dot( direction ) < 0 ) ? true : false; + return ( _v0$1.cross( _v1$3 ).dot( direction ) < 0 ) ? true : false; } @@ -7649,17 +7604,17 @@ getArea: function () { - if ( _v1$2 === undefined ) { + if ( _v1$3 === undefined ) { _v0$1 = new Vector3(); - _v1$2 = new Vector3(); + _v1$3 = new Vector3(); } _v0$1.subVectors( this.c, this.b ); - _v1$2.subVectors( this.a, this.b ); + _v1$3.subVectors( this.a, this.b ); - return _v0$1.cross( _v1$2 ).length() * 0.5; + return _v0$1.cross( _v1$3 ).length() * 0.5; }, @@ -9723,11 +9678,14 @@ * @author mrdoob / http://mrdoob.com/ */ - var bufferGeometryId = 1; // BufferGeometry uses odd numbers as Id + var _bufferGeometryId = 1; // BufferGeometry uses odd numbers as Id + var _m1$2, _obj, _offset; + var _box$1, _boxMorphTargets; + var _vector$4; function BufferGeometry() { - Object.defineProperty( this, 'id', { value: bufferGeometryId += 2 } ); + Object.defineProperty( this, 'id', { value: _bufferGeometryId += 2 } ); this.uuid = _Math.generateUUID(); @@ -9890,129 +9848,103 @@ }, - rotateX: function () { + rotateX: function ( angle ) { // rotate geometry around world x-axis - var m1 = new Matrix4(); + if ( _m1$2 === undefined ) _m1$2 = new Matrix4(); - return function rotateX( angle ) { + _m1$2.makeRotationX( angle ); - m1.makeRotationX( angle ); - - this.applyMatrix( m1 ); - - return this; + this.applyMatrix( _m1$2 ); - }; + return this; - }(), + }, - rotateY: function () { + rotateY: function ( angle ) { // rotate geometry around world y-axis - var m1 = new Matrix4(); - - return function rotateY( angle ) { - - m1.makeRotationY( angle ); + if ( _m1$2 === undefined ) _m1$2 = new Matrix4(); - this.applyMatrix( m1 ); + _m1$2.makeRotationY( angle ); - return this; + this.applyMatrix( _m1$2 ); - }; + return this; - }(), + }, - rotateZ: function () { + rotateZ: function ( angle ) { // rotate geometry around world z-axis - var m1 = new Matrix4(); - - return function rotateZ( angle ) { + if ( _m1$2 === undefined ) _m1$2 = new Matrix4(); - m1.makeRotationZ( angle ); + _m1$2.makeRotationZ( angle ); - this.applyMatrix( m1 ); + this.applyMatrix( _m1$2 ); - return this; - - }; + return this; - }(), + }, - translate: function () { + translate: function ( x, y, z ) { // translate geometry - var m1 = new Matrix4(); - - return function translate( x, y, z ) { + if ( _m1$2 === undefined ) _m1$2 = new Matrix4(); - m1.makeTranslation( x, y, z ); + _m1$2.makeTranslation( x, y, z ); - this.applyMatrix( m1 ); + this.applyMatrix( _m1$2 ); - return this; - - }; + return this; - }(), + }, - scale: function () { + scale: function ( x, y, z ) { // scale geometry - var m1 = new Matrix4(); - - return function scale( x, y, z ) { + if ( _m1$2 === undefined ) _m1$2 = new Matrix4(); - m1.makeScale( x, y, z ); + _m1$2.makeScale( x, y, z ); - this.applyMatrix( m1 ); + this.applyMatrix( _m1$2 ); - return this; - - }; - - }(), + return this; - lookAt: function () { + }, - var obj = new Object3D(); + lookAt: function ( vector ) { - return function lookAt( vector ) { + if ( _obj === undefined ) _obj = new Object3D(); - obj.lookAt( vector ); + _obj.lookAt( vector ); - obj.updateMatrix(); + _obj.updateMatrix(); - this.applyMatrix( obj.matrix ); + this.applyMatrix( _obj.matrix ); - }; + return this; - }(), + }, center: function () { - var offset = new Vector3(); + if ( _offset === undefined ) _offset = new Vector3(); - return function center() { - - this.computeBoundingBox(); + this.computeBoundingBox(); - this.boundingBox.getCenter( offset ).negate(); + this.boundingBox.getCenter( _offset ).negate(); - this.translate( offset.x, offset.y, offset.z ); + this.translate( _offset.x, _offset.y, _offset.z ); - return this; - - }; + return this; - }(), + }, setFromObject: function ( object ) { @@ -10309,144 +10241,144 @@ computeBoundingBox: function () { - var box = new Box3(); + if ( _box$1 === undefined ) { - return function computeBoundingBox() { + _box$1 = new Box3(); - if ( this.boundingBox === null ) { + } - this.boundingBox = new Box3(); + if ( this.boundingBox === null ) { - } + this.boundingBox = new Box3(); - var position = this.attributes.position; - var morphAttributesPosition = this.morphAttributes.position; + } - if ( position !== undefined ) { + var position = this.attributes.position; + var morphAttributesPosition = this.morphAttributes.position; - this.boundingBox.setFromBufferAttribute( position ); + if ( position !== undefined ) { - // process morph attributes if present + this.boundingBox.setFromBufferAttribute( position ); - if ( morphAttributesPosition ) { + // process morph attributes if present - for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { + if ( morphAttributesPosition ) { - var morphAttribute = morphAttributesPosition[ i ]; - box.setFromBufferAttribute( morphAttribute ); + for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { - this.boundingBox.expandByPoint( box.min ); - this.boundingBox.expandByPoint( box.max ); + var morphAttribute = morphAttributesPosition[ i ]; + _box$1.setFromBufferAttribute( morphAttribute ); - } + this.boundingBox.expandByPoint( _box$1.min ); + this.boundingBox.expandByPoint( _box$1.max ); } - } else { + } - this.boundingBox.makeEmpty(); + } else { - } + this.boundingBox.makeEmpty(); - if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { + } - console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ); + if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) { - } + console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this ); - }; + } - }(), + }, computeBoundingSphere: function () { - var box = new Box3(); - var boxMorphTargets = new Box3(); - var vector = new Vector3(); + if ( _boxMorphTargets === undefined ) { - return function computeBoundingSphere() { + _box$1 = new Box3(); + _vector$4 = new Vector3(); + _boxMorphTargets = new Box3(); - if ( this.boundingSphere === null ) { + } - this.boundingSphere = new Sphere(); + if ( this.boundingSphere === null ) { - } + this.boundingSphere = new Sphere(); - var position = this.attributes.position; - var morphAttributesPosition = this.morphAttributes.position; + } - if ( position ) { + var position = this.attributes.position; + var morphAttributesPosition = this.morphAttributes.position; - // first, find the center of the bounding sphere + if ( position ) { - var center = this.boundingSphere.center; + // first, find the center of the bounding sphere - box.setFromBufferAttribute( position ); + var center = this.boundingSphere.center; - // process morph attributes if present + _box$1.setFromBufferAttribute( position ); - if ( morphAttributesPosition ) { + // process morph attributes if present - for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { + if ( morphAttributesPosition ) { - var morphAttribute = morphAttributesPosition[ i ]; - boxMorphTargets.setFromBufferAttribute( morphAttribute ); + for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { - box.expandByPoint( boxMorphTargets.min ); - box.expandByPoint( boxMorphTargets.max ); + var morphAttribute = morphAttributesPosition[ i ]; + _boxMorphTargets.setFromBufferAttribute( morphAttribute ); - } + _box$1.expandByPoint( _boxMorphTargets.min ); + _box$1.expandByPoint( _boxMorphTargets.max ); } - box.getCenter( center ); + } - // second, try to find a boundingSphere with a radius smaller than the - // boundingSphere of the boundingBox: sqrt(3) smaller in the best case + _box$1.getCenter( center ); - var maxRadiusSq = 0; + // second, try to find a boundingSphere with a radius smaller than the + // boundingSphere of the boundingBox: sqrt(3) smaller in the best case - for ( var i = 0, il = position.count; i < il; i ++ ) { + var maxRadiusSq = 0; - vector.fromBufferAttribute( position, i ); + for ( var i = 0, il = position.count; i < il; i ++ ) { - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) ); + _vector$4.fromBufferAttribute( position, i ); - } + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$4 ) ); - // process morph attributes if present + } - if ( morphAttributesPosition ) { + // process morph attributes if present - for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { + if ( morphAttributesPosition ) { - var morphAttribute = morphAttributesPosition[ i ]; + for ( var i = 0, il = morphAttributesPosition.length; i < il; i ++ ) { - for ( var j = 0, jl = morphAttribute.count; j < jl; j ++ ) { + var morphAttribute = morphAttributesPosition[ i ]; - vector.fromBufferAttribute( morphAttribute, j ); + for ( var j = 0, jl = morphAttribute.count; j < jl; j ++ ) { - maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( vector ) ); + _vector$4.fromBufferAttribute( morphAttribute, j ); - } + maxRadiusSq = Math.max( maxRadiusSq, center.distanceToSquared( _vector$4 ) ); } } - this.boundingSphere.radius = Math.sqrt( maxRadiusSq ); + } - if ( isNaN( this.boundingSphere.radius ) ) { + this.boundingSphere.radius = Math.sqrt( maxRadiusSq ); - console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this ); + if ( isNaN( this.boundingSphere.radius ) ) { - } + console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this ); } - }; + } - }(), + }, computeFaceNormals: function () { @@ -10608,27 +10540,23 @@ normalizeNormals: function () { - var vector = new Vector3(); - - return function normalizeNormals() { - - var normals = this.attributes.normal; + if ( _vector$4 === undefined ) _vector$4 = new Vector3(); - for ( var i = 0, il = normals.count; i < il; i ++ ) { + var normals = this.attributes.normal; - vector.x = normals.getX( i ); - vector.y = normals.getY( i ); - vector.z = normals.getZ( i ); + for ( var i = 0, il = normals.count; i < il; i ++ ) { - vector.normalize(); + _vector$4.x = normals.getX( i ); + _vector$4.y = normals.getY( i ); + _vector$4.z = normals.getZ( i ); - normals.setXYZ( i, vector.x, vector.y, vector.z ); + _vector$4.normalize(); - } + normals.setXYZ( i, _vector$4.x, _vector$4.y, _vector$4.z ); - }; + } - }(), + }, toNonIndexed: function () { @@ -11444,11 +11372,12 @@ * @author bhouston / http://clara.io */ - var geometryId = 0; // Geometry uses even numbers as Id + var _geometryId = 0; // Geometry uses even numbers as Id + var _m1$3, _obj$1, _offset$1; function Geometry() { - Object.defineProperty( this, 'id', { value: geometryId += 2 } ); + Object.defineProperty( this, 'id', { value: _geometryId += 2 } ); this.uuid = _Math.generateUUID(); @@ -11532,111 +11461,89 @@ }, - rotateX: function () { + rotateX: function ( angle ) { // rotate geometry around world x-axis - var m1 = new Matrix4(); - - return function rotateX( angle ) { + if ( _m1$3 === undefined ) _m1$3 = new Matrix4(); - m1.makeRotationX( angle ); + _m1$3.makeRotationX( angle ); - this.applyMatrix( m1 ); + this.applyMatrix( _m1$3 ); - return this; + return this; - }; + }, - }(), - - rotateY: function () { + rotateY: function ( angle ) { // rotate geometry around world y-axis - var m1 = new Matrix4(); - - return function rotateY( angle ) { - - m1.makeRotationY( angle ); + if ( _m1$3 === undefined ) _m1$3 = new Matrix4(); - this.applyMatrix( m1 ); + _m1$3.makeRotationY( angle ); - return this; + this.applyMatrix( _m1$3 ); - }; + return this; - }(), + }, - rotateZ: function () { + rotateZ: function ( angle ) { // rotate geometry around world z-axis - var m1 = new Matrix4(); + if ( _m1$3 === undefined ) _m1$3 = new Matrix4(); - return function rotateZ( angle ) { + _m1$3.makeRotationZ( angle ); - m1.makeRotationZ( angle ); + this.applyMatrix( _m1$3 ); - this.applyMatrix( m1 ); - - return this; - - }; + return this; - }(), + }, - translate: function () { + translate: function ( x, y, z ) { // translate geometry - var m1 = new Matrix4(); - - return function translate( x, y, z ) { + if ( _m1$3 === undefined ) _m1$3 = new Matrix4(); - m1.makeTranslation( x, y, z ); + _m1$3.makeTranslation( x, y, z ); - this.applyMatrix( m1 ); + this.applyMatrix( _m1$3 ); - return this; - - }; + return this; - }(), + }, - scale: function () { + scale: function ( x, y, z ) { // scale geometry - var m1 = new Matrix4(); - - return function scale( x, y, z ) { - - m1.makeScale( x, y, z ); + if ( _m1$3 === undefined ) _m1$3 = new Matrix4(); - this.applyMatrix( m1 ); + _m1$3.makeScale( x, y, z ); - return this; - - }; + this.applyMatrix( _m1$3 ); - }(), + return this; - lookAt: function () { + }, - var obj = new Object3D(); + lookAt: function ( vector ) { - return function lookAt( vector ) { + if ( _obj$1 === undefined ) _obj$1 = new Object3D(); - obj.lookAt( vector ); + _obj$1.lookAt( vector ); - obj.updateMatrix(); + _obj$1.updateMatrix(); - this.applyMatrix( obj.matrix ); + this.applyMatrix( _obj$1.matrix ); - }; + return this; - }(), + }, fromBufferGeometry: function ( geometry ) { @@ -11773,21 +11680,17 @@ center: function () { - var offset = new Vector3(); - - return function center() { + if ( _offset$1 === undefined ) _offset$1 = new Vector3(); - this.computeBoundingBox(); - - this.boundingBox.getCenter( offset ).negate(); + this.computeBoundingBox(); - this.translate( offset.x, offset.y, offset.z ); + this.boundingBox.getCenter( _offset$1 ).negate(); - return this; + this.translate( _offset$1.x, _offset$1.y, _offset$1.z ); - }; + return this; - }(), + }, normalize: function () { @@ -14120,7 +14023,7 @@ */ var _sphere$1; - var _vector$4; + var _vector$5; function Frustum( p0, p1, p2, p3, p4, p5 ) { @@ -14244,7 +14147,7 @@ intersectsBox: function ( box ) { - if ( _vector$4 === undefined ) _vector$4 = new Vector3(); + if ( _vector$5 === undefined ) _vector$5 = new Vector3(); var planes = this.planes; @@ -14254,11 +14157,11 @@ // corner at max distance - _vector$4.x = plane.normal.x > 0 ? box.max.x : box.min.x; - _vector$4.y = plane.normal.y > 0 ? box.max.y : box.min.y; - _vector$4.z = plane.normal.z > 0 ? box.max.z : box.min.z; + _vector$5.x = plane.normal.x > 0 ? box.max.x : box.min.x; + _vector$5.y = plane.normal.y > 0 ? box.max.y : box.min.y; + _vector$5.z = plane.normal.z > 0 ? box.max.z : box.min.z; - if ( plane.distanceToPoint( _vector$4 ) < 0 ) { + if ( plane.distanceToPoint( _vector$5 ) < 0 ) { return false; @@ -14428,9 +14331,9 @@ var project_vertex = "vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;"; - var dithering_fragment = "#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif"; + var dithering_fragment = "#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif"; - var dithering_pars_fragment = "#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif"; + var dithering_pars_fragment = "#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif"; var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif"; @@ -14460,11 +14363,11 @@ var tonemapping_pars_fragment = "#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}"; - var uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif"; + var uv_pars_fragment = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif"; - var uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif"; + var uv_pars_vertex = "#ifdef USE_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif"; - var uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif"; + var uv_vertex = "#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif"; var uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif"; @@ -17933,6 +17836,7 @@ parameters.vertexTangents ? '#define USE_TANGENT' : '', parameters.vertexColors ? '#define USE_COLOR' : '', + parameters.vertexUvs ? '#define USE_UV' : '', parameters.flatShading ? '#define FLAT_SHADED' : '', @@ -18049,6 +17953,7 @@ parameters.vertexTangents ? '#define USE_TANGENT' : '', parameters.vertexColors ? '#define USE_COLOR' : '', + parameters.vertexUvs ? '#define USE_UV' : '', parameters.gradientMap ? '#define USE_GRADIENTMAP' : '', @@ -18459,6 +18364,7 @@ vertexTangents: ( material.normalMap && material.vertexTangents ), vertexColors: material.vertexColors, + vertexUvs: !! material.map || !! material.bumpMap || !! material.normalMap || !! material.specularMap || !! material.alphaMap || !! material.emissiveMap || !! material.roughnessMap || !! material.metalnessMap || !! material.clearCoatNormalMap, fog: !! fog, useFog: material.fog, @@ -26255,7 +26161,7 @@ * @author mrdoob / http://mrdoob.com/ */ - var _v1$3, _v2$2; + var _v1$4, _v2$2; function LOD() { @@ -26344,11 +26250,11 @@ raycast: function ( raycaster, intersects ) { - if ( _v1$3 === undefined ) _v1$3 = new Vector3(); + if ( _v1$4 === undefined ) _v1$4 = new Vector3(); - _v1$3.setFromMatrixPosition( this.matrixWorld ); + _v1$4.setFromMatrixPosition( this.matrixWorld ); - var distance = raycaster.ray.origin.distanceTo( _v1$3 ); + var distance = raycaster.ray.origin.distanceTo( _v1$4 ); this.getObjectForDistance( distance ).raycast( raycaster, intersects ); @@ -26358,7 +26264,7 @@ if ( _v2$2 === undefined ) { - _v1$3 = new Vector3(); + _v1$4 = new Vector3(); _v2$2 = new Vector3(); } @@ -26367,10 +26273,10 @@ if ( levels.length > 1 ) { - _v1$3.setFromMatrixPosition( camera.matrixWorld ); + _v1$4.setFromMatrixPosition( camera.matrixWorld ); _v2$2.setFromMatrixPosition( this.matrixWorld ); - var distance = _v1$3.distanceTo( _v2$2 ); + var distance = _v1$4.distanceTo( _v2$2 ); levels[ 0 ].object.visible = true; @@ -40323,6 +40229,8 @@ * @author alteredq / http://alteredqualia.com/ */ + var _BlendingMode, _color, _textureLoader, _materialLoader; + function Loader() {} Loader.Handlers = { @@ -40382,261 +40290,261 @@ }, - createMaterial: ( function () { + createMaterial: function ( m, texturePath, crossOrigin ) { - var BlendingMode = { - NoBlending: NoBlending, - NormalBlending: NormalBlending, - AdditiveBlending: AdditiveBlending, - SubtractiveBlending: SubtractiveBlending, - MultiplyBlending: MultiplyBlending, - CustomBlending: CustomBlending - }; + if ( _materialLoader === undefined ) { - var color = new Color(); - var textureLoader = new TextureLoader(); - var materialLoader = new MaterialLoader(); + _BlendingMode = { + NoBlending: NoBlending, + NormalBlending: NormalBlending, + AdditiveBlending: AdditiveBlending, + SubtractiveBlending: SubtractiveBlending, + MultiplyBlending: MultiplyBlending, + CustomBlending: CustomBlending + }; - return function createMaterial( m, texturePath, crossOrigin ) { + _color = new Color(); + _textureLoader = new TextureLoader(); + _materialLoader = new MaterialLoader(); - // convert from old material format + } - var textures = {}; + // convert from old material format - function loadTexture( path, repeat, offset, wrap, anisotropy ) { + var textures = {}; - var fullPath = texturePath + path; - var loader = Loader.Handlers.get( fullPath ); + // - var texture; + var json = { + uuid: _Math.generateUUID(), + type: 'MeshLambertMaterial' + }; - if ( loader !== null ) { + for ( var name in m ) { - texture = loader.load( fullPath ); + var value = m[ name ]; - } else { + switch ( name ) { - textureLoader.setCrossOrigin( crossOrigin ); - texture = textureLoader.load( fullPath ); + case 'DbgColor': + case 'DbgIndex': + case 'opticalDensity': + case 'illumination': + break; + case 'DbgName': + json.name = value; + break; + case 'blending': + json.blending = _BlendingMode[ value ]; + break; + case 'colorAmbient': + case 'mapAmbient': + console.warn( 'THREE.Loader.createMaterial:', name, 'is no longer supported.' ); + break; + case 'colorDiffuse': + json.color = _color.fromArray( value ).getHex(); + break; + case 'colorSpecular': + json.specular = _color.fromArray( value ).getHex(); + break; + case 'colorEmissive': + json.emissive = _color.fromArray( value ).getHex(); + break; + case 'specularCoef': + json.shininess = value; + break; + case 'shading': + if ( value.toLowerCase() === 'basic' ) json.type = 'MeshBasicMaterial'; + if ( value.toLowerCase() === 'phong' ) json.type = 'MeshPhongMaterial'; + if ( value.toLowerCase() === 'standard' ) json.type = 'MeshStandardMaterial'; + break; + case 'mapDiffuse': + json.map = loadTexture( value, m.mapDiffuseRepeat, m.mapDiffuseOffset, m.mapDiffuseWrap, m.mapDiffuseAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapDiffuseRepeat': + case 'mapDiffuseOffset': + case 'mapDiffuseWrap': + case 'mapDiffuseAnisotropy': + break; + case 'mapEmissive': + json.emissiveMap = loadTexture( value, m.mapEmissiveRepeat, m.mapEmissiveOffset, m.mapEmissiveWrap, m.mapEmissiveAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapEmissiveRepeat': + case 'mapEmissiveOffset': + case 'mapEmissiveWrap': + case 'mapEmissiveAnisotropy': + break; + case 'mapLight': + json.lightMap = loadTexture( value, m.mapLightRepeat, m.mapLightOffset, m.mapLightWrap, m.mapLightAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapLightRepeat': + case 'mapLightOffset': + case 'mapLightWrap': + case 'mapLightAnisotropy': + break; + case 'mapAO': + json.aoMap = loadTexture( value, m.mapAORepeat, m.mapAOOffset, m.mapAOWrap, m.mapAOAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapAORepeat': + case 'mapAOOffset': + case 'mapAOWrap': + case 'mapAOAnisotropy': + break; + case 'mapBump': + json.bumpMap = loadTexture( value, m.mapBumpRepeat, m.mapBumpOffset, m.mapBumpWrap, m.mapBumpAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapBumpScale': + json.bumpScale = value; + break; + case 'mapBumpRepeat': + case 'mapBumpOffset': + case 'mapBumpWrap': + case 'mapBumpAnisotropy': + break; + case 'mapNormal': + json.normalMap = loadTexture( value, m.mapNormalRepeat, m.mapNormalOffset, m.mapNormalWrap, m.mapNormalAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapNormalFactor': + json.normalScale = value; + break; + case 'mapNormalRepeat': + case 'mapNormalOffset': + case 'mapNormalWrap': + case 'mapNormalAnisotropy': + break; + case 'mapSpecular': + json.specularMap = loadTexture( value, m.mapSpecularRepeat, m.mapSpecularOffset, m.mapSpecularWrap, m.mapSpecularAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapSpecularRepeat': + case 'mapSpecularOffset': + case 'mapSpecularWrap': + case 'mapSpecularAnisotropy': + break; + case 'mapMetalness': + json.metalnessMap = loadTexture( value, m.mapMetalnessRepeat, m.mapMetalnessOffset, m.mapMetalnessWrap, m.mapMetalnessAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapMetalnessRepeat': + case 'mapMetalnessOffset': + case 'mapMetalnessWrap': + case 'mapMetalnessAnisotropy': + break; + case 'mapRoughness': + json.roughnessMap = loadTexture( value, m.mapRoughnessRepeat, m.mapRoughnessOffset, m.mapRoughnessWrap, m.mapRoughnessAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapRoughnessRepeat': + case 'mapRoughnessOffset': + case 'mapRoughnessWrap': + case 'mapRoughnessAnisotropy': + break; + case 'mapAlpha': + json.alphaMap = loadTexture( value, m.mapAlphaRepeat, m.mapAlphaOffset, m.mapAlphaWrap, m.mapAlphaAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapAlphaRepeat': + case 'mapAlphaOffset': + case 'mapAlphaWrap': + case 'mapAlphaAnisotropy': + break; + case 'flipSided': + json.side = BackSide; + break; + case 'doubleSided': + json.side = DoubleSide; + break; + case 'transparency': + console.warn( 'THREE.Loader.createMaterial: transparency has been renamed to opacity' ); + json.opacity = value; + break; + case 'depthTest': + case 'depthWrite': + case 'colorWrite': + case 'opacity': + case 'reflectivity': + case 'transparent': + case 'visible': + case 'wireframe': + json[ name ] = value; + break; + case 'vertexColors': + if ( value === true ) json.vertexColors = VertexColors; + if ( value === 'face' ) json.vertexColors = FaceColors; + break; + default: + console.error( 'THREE.Loader.createMaterial: Unsupported', name, value ); + break; - } + } - if ( repeat !== undefined ) { + } - texture.repeat.fromArray( repeat ); + if ( json.type === 'MeshBasicMaterial' ) delete json.emissive; + if ( json.type !== 'MeshPhongMaterial' ) delete json.specular; - if ( repeat[ 0 ] !== 1 ) texture.wrapS = RepeatWrapping; - if ( repeat[ 1 ] !== 1 ) texture.wrapT = RepeatWrapping; + if ( json.opacity < 1 ) json.transparent = true; - } + _materialLoader.setTextures( textures ); - if ( offset !== undefined ) { + return _materialLoader.parse( json ); - texture.offset.fromArray( offset ); + } - } + } ); - if ( wrap !== undefined ) { + function loadTexture( path, repeat, offset, wrap, anisotropy, textures, texturePath, crossOrigin ) { - if ( wrap[ 0 ] === 'repeat' ) texture.wrapS = RepeatWrapping; - if ( wrap[ 0 ] === 'mirror' ) texture.wrapS = MirroredRepeatWrapping; + var fullPath = texturePath + path; + var loader = Loader.Handlers.get( fullPath ); - if ( wrap[ 1 ] === 'repeat' ) texture.wrapT = RepeatWrapping; - if ( wrap[ 1 ] === 'mirror' ) texture.wrapT = MirroredRepeatWrapping; + var texture; - } + if ( loader !== null ) { - if ( anisotropy !== undefined ) { + texture = loader.load( fullPath ); - texture.anisotropy = anisotropy; + } else { - } + _textureLoader.setCrossOrigin( crossOrigin ); + texture = _textureLoader.load( fullPath ); - var uuid = _Math.generateUUID(); + } - textures[ uuid ] = texture; + if ( repeat !== undefined ) { - return uuid; + texture.repeat.fromArray( repeat ); - } + if ( repeat[ 0 ] !== 1 ) texture.wrapS = RepeatWrapping; + if ( repeat[ 1 ] !== 1 ) texture.wrapT = RepeatWrapping; - // + } - var json = { - uuid: _Math.generateUUID(), - type: 'MeshLambertMaterial' - }; + if ( offset !== undefined ) { - for ( var name in m ) { + texture.offset.fromArray( offset ); - var value = m[ name ]; + } - switch ( name ) { + if ( wrap !== undefined ) { - case 'DbgColor': - case 'DbgIndex': - case 'opticalDensity': - case 'illumination': - break; - case 'DbgName': - json.name = value; - break; - case 'blending': - json.blending = BlendingMode[ value ]; - break; - case 'colorAmbient': - case 'mapAmbient': - console.warn( 'THREE.Loader.createMaterial:', name, 'is no longer supported.' ); - break; - case 'colorDiffuse': - json.color = color.fromArray( value ).getHex(); - break; - case 'colorSpecular': - json.specular = color.fromArray( value ).getHex(); - break; - case 'colorEmissive': - json.emissive = color.fromArray( value ).getHex(); - break; - case 'specularCoef': - json.shininess = value; - break; - case 'shading': - if ( value.toLowerCase() === 'basic' ) json.type = 'MeshBasicMaterial'; - if ( value.toLowerCase() === 'phong' ) json.type = 'MeshPhongMaterial'; - if ( value.toLowerCase() === 'standard' ) json.type = 'MeshStandardMaterial'; - break; - case 'mapDiffuse': - json.map = loadTexture( value, m.mapDiffuseRepeat, m.mapDiffuseOffset, m.mapDiffuseWrap, m.mapDiffuseAnisotropy ); - break; - case 'mapDiffuseRepeat': - case 'mapDiffuseOffset': - case 'mapDiffuseWrap': - case 'mapDiffuseAnisotropy': - break; - case 'mapEmissive': - json.emissiveMap = loadTexture( value, m.mapEmissiveRepeat, m.mapEmissiveOffset, m.mapEmissiveWrap, m.mapEmissiveAnisotropy ); - break; - case 'mapEmissiveRepeat': - case 'mapEmissiveOffset': - case 'mapEmissiveWrap': - case 'mapEmissiveAnisotropy': - break; - case 'mapLight': - json.lightMap = loadTexture( value, m.mapLightRepeat, m.mapLightOffset, m.mapLightWrap, m.mapLightAnisotropy ); - break; - case 'mapLightRepeat': - case 'mapLightOffset': - case 'mapLightWrap': - case 'mapLightAnisotropy': - break; - case 'mapAO': - json.aoMap = loadTexture( value, m.mapAORepeat, m.mapAOOffset, m.mapAOWrap, m.mapAOAnisotropy ); - break; - case 'mapAORepeat': - case 'mapAOOffset': - case 'mapAOWrap': - case 'mapAOAnisotropy': - break; - case 'mapBump': - json.bumpMap = loadTexture( value, m.mapBumpRepeat, m.mapBumpOffset, m.mapBumpWrap, m.mapBumpAnisotropy ); - break; - case 'mapBumpScale': - json.bumpScale = value; - break; - case 'mapBumpRepeat': - case 'mapBumpOffset': - case 'mapBumpWrap': - case 'mapBumpAnisotropy': - break; - case 'mapNormal': - json.normalMap = loadTexture( value, m.mapNormalRepeat, m.mapNormalOffset, m.mapNormalWrap, m.mapNormalAnisotropy ); - break; - case 'mapNormalFactor': - json.normalScale = value; - break; - case 'mapNormalRepeat': - case 'mapNormalOffset': - case 'mapNormalWrap': - case 'mapNormalAnisotropy': - break; - case 'mapSpecular': - json.specularMap = loadTexture( value, m.mapSpecularRepeat, m.mapSpecularOffset, m.mapSpecularWrap, m.mapSpecularAnisotropy ); - break; - case 'mapSpecularRepeat': - case 'mapSpecularOffset': - case 'mapSpecularWrap': - case 'mapSpecularAnisotropy': - break; - case 'mapMetalness': - json.metalnessMap = loadTexture( value, m.mapMetalnessRepeat, m.mapMetalnessOffset, m.mapMetalnessWrap, m.mapMetalnessAnisotropy ); - break; - case 'mapMetalnessRepeat': - case 'mapMetalnessOffset': - case 'mapMetalnessWrap': - case 'mapMetalnessAnisotropy': - break; - case 'mapRoughness': - json.roughnessMap = loadTexture( value, m.mapRoughnessRepeat, m.mapRoughnessOffset, m.mapRoughnessWrap, m.mapRoughnessAnisotropy ); - break; - case 'mapRoughnessRepeat': - case 'mapRoughnessOffset': - case 'mapRoughnessWrap': - case 'mapRoughnessAnisotropy': - break; - case 'mapAlpha': - json.alphaMap = loadTexture( value, m.mapAlphaRepeat, m.mapAlphaOffset, m.mapAlphaWrap, m.mapAlphaAnisotropy ); - break; - case 'mapAlphaRepeat': - case 'mapAlphaOffset': - case 'mapAlphaWrap': - case 'mapAlphaAnisotropy': - break; - case 'flipSided': - json.side = BackSide; - break; - case 'doubleSided': - json.side = DoubleSide; - break; - case 'transparency': - console.warn( 'THREE.Loader.createMaterial: transparency has been renamed to opacity' ); - json.opacity = value; - break; - case 'depthTest': - case 'depthWrite': - case 'colorWrite': - case 'opacity': - case 'reflectivity': - case 'transparent': - case 'visible': - case 'wireframe': - json[ name ] = value; - break; - case 'vertexColors': - if ( value === true ) json.vertexColors = VertexColors; - if ( value === 'face' ) json.vertexColors = FaceColors; - break; - default: - console.error( 'THREE.Loader.createMaterial: Unsupported', name, value ); - break; + if ( wrap[ 0 ] === 'repeat' ) texture.wrapS = RepeatWrapping; + if ( wrap[ 0 ] === 'mirror' ) texture.wrapS = MirroredRepeatWrapping; - } + if ( wrap[ 1 ] === 'repeat' ) texture.wrapT = RepeatWrapping; + if ( wrap[ 1 ] === 'mirror' ) texture.wrapT = MirroredRepeatWrapping; - } + } - if ( json.type === 'MeshBasicMaterial' ) delete json.emissive; - if ( json.type !== 'MeshPhongMaterial' ) delete json.specular; + if ( anisotropy !== undefined ) { - if ( json.opacity < 1 ) json.transparent = true; + texture.anisotropy = anisotropy; - materialLoader.setTextures( textures ); + } - return materialLoader.parse( json ); + var uuid = _Math.generateUUID(); - }; + textures[ uuid ] = texture; - } )() + return uuid; - } ); + } /** * @author mrdoob / http://mrdoob.com/ @@ -41258,7 +41166,7 @@ * @author mrdoob / http://mrdoob.com/ */ - var _position, _quaternion$2, _scale; + var _position$1, _quaternion$3, _scale$1; var _orientation; function AudioListener() { @@ -41352,11 +41260,11 @@ Object3D.prototype.updateMatrixWorld.call( this, force ); - if ( _position === undefined ) { + if ( _position$1 === undefined ) { - _position = new Vector3(); - _quaternion$2 = new Quaternion(); - _scale = new Vector3(); + _position$1 = new Vector3(); + _quaternion$3 = new Quaternion(); + _scale$1 = new Vector3(); _orientation = new Vector3(); } @@ -41366,9 +41274,9 @@ this.timeDelta = this._clock.getDelta(); - this.matrixWorld.decompose( _position, _quaternion$2, _scale ); + this.matrixWorld.decompose( _position$1, _quaternion$3, _scale$1 ); - _orientation.set( 0, 0, - 1 ).applyQuaternion( _quaternion$2 ); + _orientation.set( 0, 0, - 1 ).applyQuaternion( _quaternion$3 ); if ( listener.positionX ) { @@ -41376,9 +41284,9 @@ var endTime = this.context.currentTime + this.timeDelta; - listener.positionX.linearRampToValueAtTime( _position.x, endTime ); - listener.positionY.linearRampToValueAtTime( _position.y, endTime ); - listener.positionZ.linearRampToValueAtTime( _position.z, endTime ); + listener.positionX.linearRampToValueAtTime( _position$1.x, endTime ); + listener.positionY.linearRampToValueAtTime( _position$1.y, endTime ); + listener.positionZ.linearRampToValueAtTime( _position$1.z, endTime ); listener.forwardX.linearRampToValueAtTime( _orientation.x, endTime ); listener.forwardY.linearRampToValueAtTime( _orientation.y, endTime ); listener.forwardZ.linearRampToValueAtTime( _orientation.z, endTime ); @@ -41388,7 +41296,7 @@ } else { - listener.setPosition( _position.x, _position.y, _position.z ); + listener.setPosition( _position$1.x, _position$1.y, _position$1.z ); listener.setOrientation( _orientation.x, _orientation.y, _orientation.z, up.x, up.y, up.z ); } @@ -41743,7 +41651,7 @@ * @author mrdoob / http://mrdoob.com/ */ - var _position$1, _quaternion$3, _scale$1; + var _position$2, _quaternion$4, _scale$2; var _orientation$1; function PositionalAudio( listener ) { @@ -41836,20 +41744,20 @@ Object3D.prototype.updateMatrixWorld.call( this, force ); - if ( _position$1 === undefined ) { + if ( _position$2 === undefined ) { - _position$1 = new Vector3(); - _quaternion$3 = new Quaternion(); - _scale$1 = new Vector3(); + _position$2 = new Vector3(); + _quaternion$4 = new Quaternion(); + _scale$2 = new Vector3(); _orientation$1 = new Vector3(); } if ( this.hasPlaybackControl === true && this.isPlaying === false ) return; - this.matrixWorld.decompose( _position$1, _quaternion$3, _scale$1 ); + this.matrixWorld.decompose( _position$2, _quaternion$4, _scale$2 ); - _orientation$1.set( 0, 0, 1 ).applyQuaternion( _quaternion$3 ); + _orientation$1.set( 0, 0, 1 ).applyQuaternion( _quaternion$4 ); var panner = this.panner; @@ -41859,16 +41767,16 @@ var endTime = this.context.currentTime + this.listener.timeDelta; - panner.positionX.linearRampToValueAtTime( _position$1.x, endTime ); - panner.positionY.linearRampToValueAtTime( _position$1.y, endTime ); - panner.positionZ.linearRampToValueAtTime( _position$1.z, endTime ); + panner.positionX.linearRampToValueAtTime( _position$2.x, endTime ); + panner.positionY.linearRampToValueAtTime( _position$2.y, endTime ); + panner.positionZ.linearRampToValueAtTime( _position$2.z, endTime ); panner.orientationX.linearRampToValueAtTime( _orientation$1.x, endTime ); panner.orientationY.linearRampToValueAtTime( _orientation$1.y, endTime ); panner.orientationZ.linearRampToValueAtTime( _orientation$1.z, endTime ); } else { - panner.setPosition( _position$1.x, _position$1.y, _position$1.z ); + panner.setPosition( _position$2.x, _position$2.y, _position$2.z ); panner.setOrientation( _orientation$1.x, _orientation$1.y, _orientation$1.z ); } @@ -42134,7 +42042,10 @@ */ // Characters [].:/ are reserved for track binding syntax. - var RESERVED_CHARS_RE = '\\[\\]\\.:\\/'; + var _RESERVED_CHARS_RE = '\\[\\]\\.:\\/'; + + var _reservedRe; + var _trackRe, _supportedObjectNames; function Composite( targetGroup, path, optionalParsedPath ) { @@ -42234,101 +42145,101 @@ * @param {string} name Node name to be sanitized. * @return {string} */ - sanitizeNodeName: ( function () { + sanitizeNodeName: function ( name ) { - var reservedRe = new RegExp( '[' + RESERVED_CHARS_RE + ']', 'g' ); + if ( _reservedRe === undefined ) { - return function sanitizeNodeName( name ) { + _reservedRe = new RegExp( '[' + _RESERVED_CHARS_RE + ']', 'g' ); - return name.replace( /\s/g, '_' ).replace( reservedRe, '' ); + } - }; + return name.replace( /\s/g, '_' ).replace( _reservedRe, '' ); - }() ), + }, - parseTrackName: function () { + parseTrackName: function ( trackName ) { - // Attempts to allow node names from any language. ES5's `\w` regexp matches - // only latin characters, and the unicode \p{L} is not yet supported. So - // instead, we exclude reserved characters and match everything else. - var wordChar = '[^' + RESERVED_CHARS_RE + ']'; - var wordCharOrDot = '[^' + RESERVED_CHARS_RE.replace( '\\.', '' ) + ']'; + if ( _supportedObjectNames === undefined ) { - // Parent directories, delimited by '/' or ':'. Currently unused, but must - // be matched to parse the rest of the track name. - var directoryRe = /((?:WC+[\/:])*)/.source.replace( 'WC', wordChar ); + // Attempts to allow node names from any language. ES5's `\w` regexp matches + // only latin characters, and the unicode \p{L} is not yet supported. So + // instead, we exclude reserved characters and match everything else. + var wordChar = '[^' + _RESERVED_CHARS_RE + ']'; + var wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\.', '' ) + ']'; - // Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'. - var nodeRe = /(WCOD+)?/.source.replace( 'WCOD', wordCharOrDot ); + // Parent directories, delimited by '/' or ':'. Currently unused, but must + // be matched to parse the rest of the track name. + var directoryRe = /((?:WC+[\/:])*)/.source.replace( 'WC', wordChar ); - // Object on target node, and accessor. May not contain reserved - // characters. Accessor may contain any character except closing bracket. - var objectRe = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace( 'WC', wordChar ); + // Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'. + var nodeRe = /(WCOD+)?/.source.replace( 'WCOD', wordCharOrDot ); - // Property and accessor. May not contain reserved characters. Accessor may - // contain any non-bracket characters. - var propertyRe = /\.(WC+)(?:\[(.+)\])?/.source.replace( 'WC', wordChar ); + // Object on target node, and accessor. May not contain reserved + // characters. Accessor may contain any character except closing bracket. + var objectRe = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace( 'WC', wordChar ); - var trackRe = new RegExp( '' - + '^' - + directoryRe - + nodeRe - + objectRe - + propertyRe - + '$' - ); + // Property and accessor. May not contain reserved characters. Accessor may + // contain any non-bracket characters. + var propertyRe = /\.(WC+)(?:\[(.+)\])?/.source.replace( 'WC', wordChar ); - var supportedObjectNames = [ 'material', 'materials', 'bones' ]; + _trackRe = new RegExp( '' + + '^' + + directoryRe + + nodeRe + + objectRe + + propertyRe + + '$' + ); - return function parseTrackName( trackName ) { + _supportedObjectNames = [ 'material', 'materials', 'bones' ]; - var matches = trackRe.exec( trackName ); + } - if ( ! matches ) { + var matches = _trackRe.exec( trackName ); - throw new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName ); + if ( ! matches ) { - } + throw new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName ); - var results = { - // directoryName: matches[ 1 ], // (tschw) currently unused - nodeName: matches[ 2 ], - objectName: matches[ 3 ], - objectIndex: matches[ 4 ], - propertyName: matches[ 5 ], // required - propertyIndex: matches[ 6 ] - }; + } - var lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' ); + var results = { + // directoryName: matches[ 1 ], // (tschw) currently unused + nodeName: matches[ 2 ], + objectName: matches[ 3 ], + objectIndex: matches[ 4 ], + propertyName: matches[ 5 ], // required + propertyIndex: matches[ 6 ] + }; - if ( lastDot !== undefined && lastDot !== - 1 ) { + var lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' ); - var objectName = results.nodeName.substring( lastDot + 1 ); + if ( lastDot !== undefined && lastDot !== - 1 ) { - // Object names must be checked against a whitelist. Otherwise, there - // is no way to parse 'foo.bar.baz': 'baz' must be a property, but - // 'bar' could be the objectName, or part of a nodeName (which can - // include '.' characters). - if ( supportedObjectNames.indexOf( objectName ) !== - 1 ) { + var objectName = results.nodeName.substring( lastDot + 1 ); - results.nodeName = results.nodeName.substring( 0, lastDot ); - results.objectName = objectName; + // Object names must be checked against a whitelist. Otherwise, there + // is no way to parse 'foo.bar.baz': 'baz' must be a property, but + // 'bar' could be the objectName, or part of a nodeName (which can + // include '.' characters). + if ( _supportedObjectNames.indexOf( objectName ) !== - 1 ) { - } + results.nodeName = results.nodeName.substring( 0, lastDot ); + results.objectName = objectName; } - if ( results.propertyName === null || results.propertyName.length === 0 ) { + } - throw new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName ); + if ( results.propertyName === null || results.propertyName.length === 0 ) { - } + throw new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName ); - return results; + } - }; + return results; - }(), + }, findNode: function ( root, nodeName ) { @@ -44993,7 +44904,7 @@ * @author bhouston / http://clara.io */ - var _vector$5; + var _vector$6; function Box2( min, max ) { @@ -45029,9 +44940,9 @@ setFromCenterAndSize: function ( center, size ) { - if ( _vector$5 === undefined ) _vector$5 = new Vector2(); + if ( _vector$6 === undefined ) _vector$6 = new Vector2(); - var halfSize = _vector$5.copy( size ).multiplyScalar( 0.5 ); + var halfSize = _vector$6.copy( size ).multiplyScalar( 0.5 ); this.min.copy( center ).sub( halfSize ); this.max.copy( center ).add( halfSize ); @@ -45181,9 +45092,9 @@ distanceToPoint: function ( point ) { - if ( _vector$5 === undefined ) _vector$5 = new Vector2(); + if ( _vector$6 === undefined ) _vector$6 = new Vector2(); - var clampedPoint = _vector$5.copy( point ).clamp( this.min, this.max ); + var clampedPoint = _vector$6.copy( point ).clamp( this.min, this.max ); return clampedPoint.sub( point ).length(); }, @@ -45395,7 +45306,7 @@ * @author WestLangley / http://github.com/WestLangley */ - var _v1$4, _v2$3, _normalMatrix$1, _keys; + var _v1$5, _v2$3, _normalMatrix$1, _keys; function VertexNormalsHelper( object, size, hex, linewidth ) { @@ -45448,7 +45359,7 @@ if ( _normalMatrix$1 === undefined ) { - _v1$4 = new Vector3(); + _v1$5 = new Vector3(); _v2$3 = new Vector3(); _normalMatrix$1 = new Matrix3(); _keys = [ 'a', 'b', 'c' ]; @@ -45485,11 +45396,11 @@ var normal = face.vertexNormals[ j ]; - _v1$4.copy( vertex ).applyMatrix4( matrixWorld ); + _v1$5.copy( vertex ).applyMatrix4( matrixWorld ); - _v2$3.copy( normal ).applyMatrix3( _normalMatrix$1 ).normalize().multiplyScalar( this.size ).add( _v1$4 ); + _v2$3.copy( normal ).applyMatrix3( _normalMatrix$1 ).normalize().multiplyScalar( this.size ).add( _v1$5 ); - position.setXYZ( idx, _v1$4.x, _v1$4.y, _v1$4.z ); + position.setXYZ( idx, _v1$5.x, _v1$5.y, _v1$5.z ); idx = idx + 1; @@ -45513,13 +45424,13 @@ for ( var j = 0, jl = objPos.count; j < jl; j ++ ) { - _v1$4.set( objPos.getX( j ), objPos.getY( j ), objPos.getZ( j ) ).applyMatrix4( matrixWorld ); + _v1$5.set( objPos.getX( j ), objPos.getY( j ), objPos.getZ( j ) ).applyMatrix4( matrixWorld ); _v2$3.set( objNorm.getX( j ), objNorm.getY( j ), objNorm.getZ( j ) ); - _v2$3.applyMatrix3( _normalMatrix$1 ).normalize().multiplyScalar( this.size ).add( _v1$4 ); + _v2$3.applyMatrix3( _normalMatrix$1 ).normalize().multiplyScalar( this.size ).add( _v1$5 ); - position.setXYZ( idx, _v1$4.x, _v1$4.y, _v1$4.z ); + position.setXYZ( idx, _v1$5.x, _v1$5.y, _v1$5.z ); idx = idx + 1; @@ -45541,7 +45452,7 @@ * @author WestLangley / http://github.com/WestLangley */ - var _vector$6; + var _vector$7; function SpotLightHelper( light, color ) { @@ -45600,7 +45511,7 @@ SpotLightHelper.prototype.update = function () { - if ( _vector$6 === undefined ) _vector$6 = new Vector3(); + if ( _vector$7 === undefined ) _vector$7 = new Vector3(); this.light.updateMatrixWorld(); @@ -45609,9 +45520,9 @@ this.cone.scale.set( coneWidth, coneWidth, coneLength ); - _vector$6.setFromMatrixPosition( this.light.target.matrixWorld ); + _vector$7.setFromMatrixPosition( this.light.target.matrixWorld ); - this.cone.lookAt( _vector$6 ); + this.cone.lookAt( _vector$7 ); if ( this.color !== undefined ) { @@ -45633,7 +45544,7 @@ * @author Mugen87 / https://github.com/Mugen87 */ - var _vector$7, _boneMatrix, _matrixWorldInv; + var _vector$8, _boneMatrix, _matrixWorldInv; function getBoneList( object ) { @@ -45704,7 +45615,7 @@ if ( _matrixWorldInv === undefined ) { - _vector$7 = new Vector3(); + _vector$8 = new Vector3(); _boneMatrix = new Matrix4(); _matrixWorldInv = new Matrix4(); @@ -45724,12 +45635,12 @@ if ( bone.parent && bone.parent.isBone ) { _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld ); - _vector$7.setFromMatrixPosition( _boneMatrix ); - position.setXYZ( j, _vector$7.x, _vector$7.y, _vector$7.z ); + _vector$8.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j, _vector$8.x, _vector$8.y, _vector$8.z ); _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld ); - _vector$7.setFromMatrixPosition( _boneMatrix ); - position.setXYZ( j + 1, _vector$7.x, _vector$7.y, _vector$7.z ); + _vector$8.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j + 1, _vector$8.x, _vector$8.y, _vector$8.z ); j += 2; @@ -45911,7 +45822,7 @@ * @author Mugen87 / https://github.com/Mugen87 */ - var _vector$8, _color1, _color2; + var _vector$9, _color1, _color2; function HemisphereLightHelper( light, size, color ) { @@ -45956,7 +45867,7 @@ if ( _color2 === undefined ) { - _vector$8 = new Vector3(); + _vector$9 = new Vector3(); _color1 = new Color(); _color2 = new Color(); @@ -45987,7 +45898,7 @@ } - mesh.lookAt( _vector$8.setFromMatrixPosition( this.light.matrixWorld ).negate() ); + mesh.lookAt( _vector$9.setFromMatrixPosition( this.light.matrixWorld ).negate() ); }; @@ -46393,7 +46304,7 @@ * @author WestLangley / http://github.com/WestLangley */ - var _v1$5, _v2$4, _normalMatrix$2; + var _v1$6, _v2$4, _normalMatrix$2; function FaceNormalsHelper( object, size, hex, linewidth ) { @@ -46447,7 +46358,7 @@ if ( _normalMatrix$2 === undefined ) { - _v1$5 = new Vector3(); + _v1$6 = new Vector3(); _v2$4 = new Vector3(); _normalMatrix$2 = new Matrix3(); @@ -46477,15 +46388,15 @@ var normal = face.normal; - _v1$5.copy( vertices[ face.a ] ) + _v1$6.copy( vertices[ face.a ] ) .add( vertices[ face.b ] ) .add( vertices[ face.c ] ) .divideScalar( 3 ) .applyMatrix4( matrixWorld ); - _v2$4.copy( normal ).applyMatrix3( _normalMatrix$2 ).normalize().multiplyScalar( this.size ).add( _v1$5 ); + _v2$4.copy( normal ).applyMatrix3( _normalMatrix$2 ).normalize().multiplyScalar( this.size ).add( _v1$6 ); - position.setXYZ( idx, _v1$5.x, _v1$5.y, _v1$5.z ); + position.setXYZ( idx, _v1$6.x, _v1$6.y, _v1$6.z ); idx = idx + 1; @@ -46505,7 +46416,7 @@ * @author WestLangley / http://github.com/WestLangley */ - var _v1$6, _v2$5, _v3$1; + var _v1$7, _v2$5, _v3$1; function DirectionalLightHelper( light, size, color ) { @@ -46561,15 +46472,15 @@ if ( _v3$1 === undefined ) { - _v1$6 = new Vector3(); + _v1$7 = new Vector3(); _v2$5 = new Vector3(); _v3$1 = new Vector3(); } - _v1$6.setFromMatrixPosition( this.light.matrixWorld ); + _v1$7.setFromMatrixPosition( this.light.matrixWorld ); _v2$5.setFromMatrixPosition( this.light.target.matrixWorld ); - _v3$1.subVectors( _v2$5, _v1$6 ); + _v3$1.subVectors( _v2$5, _v1$7 ); this.lightPlane.lookAt( _v2$5 ); @@ -46600,7 +46511,7 @@ * http://evanw.github.com/lightgl.js/tests/shadowmap.html */ - var _vector$9, _camera; + var _vector$a, _camera; function CameraHelper( camera ) { @@ -46766,9 +46677,9 @@ function setPoint( point, pointMap, geometry, camera, x, y, z ) { - if ( _vector$9 === undefined ) _vector$9 = new Vector3(); + if ( _vector$a === undefined ) _vector$a = new Vector3(); - _vector$9.set( x, y, z ).unproject( camera ); + _vector$a.set( x, y, z ).unproject( camera ); var points = pointMap[ point ]; @@ -46778,7 +46689,7 @@ for ( var i = 0, l = points.length; i < l; i ++ ) { - position.setXYZ( points[ i ], _vector$9.x, _vector$9.y, _vector$9.z ); + position.setXYZ( points[ i ], _vector$a.x, _vector$a.y, _vector$a.z ); } @@ -46791,7 +46702,7 @@ * @author Mugen87 / http://github.com/Mugen87 */ - var _box$1; + var _box$2; function BoxHelper( object, color ) { @@ -46819,7 +46730,7 @@ BoxHelper.prototype.update = function ( object ) { - if ( _box$1 === undefined ) _box$1 = new Box3(); + if ( _box$2 === undefined ) _box$2 = new Box3(); if ( object !== undefined ) { @@ -46829,14 +46740,14 @@ if ( this.object !== undefined ) { - _box$1.setFromObject( this.object ); + _box$2.setFromObject( this.object ); } - if ( _box$1.isEmpty() ) return; + if ( _box$2.isEmpty() ) return; - var min = _box$1.min; - var max = _box$1.max; + var min = _box$2.min; + var max = _box$2.max; /* 5____4 @@ -47672,17 +47583,10 @@ }, getPosition: function () { - var v1; - - return function getPosition() { - - if ( v1 === undefined ) v1 = new Vector3(); - console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' ); - return v1.setFromMatrixColumn( this, 3 ); + console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' ); + return new Vector3().setFromMatrixColumn( this, 3 ); - }; - - }(), + }, setRotationFromQuaternion: function ( q ) { console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' ); diff --git a/build/three.min.js b/build/three.min.js index a01db58594c6d64eb8d4f3f10dc9b8b6a0a6d4fe..14f35ba490f1ddb6e68e3526047cfb00beac9c12 100644 --- a/build/three.min.js +++ b/build/three.min.js @@ -1,481 +1,482 @@ // threejs.org/license -(function(k,la){"object"===typeof exports&&"undefined"!==typeof module?la(exports):"function"===typeof define&&define.amd?define(["exports"],la):(k=k||self,la(k.THREE={}))})(this,function(k){function la(){}function z(a,b){this.x=a||0;this.y=b||0}function ta(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 va(){this.elements=[1,0,0,0,1,0,0,0,1];0h)return!1}return!0}function ib(a,b){this.center=void 0!==a?a:new n;this.radius=void 0!==b?b:0}function bc(a,b){this.origin=void 0!==a?a:new n;this.direction=void 0!==b?b:new n}function U(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 K(a,b,c){return void 0=== -b&&void 0===c?this.set(a):this.setRGB(a,b,c)}function gg(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a}function hg(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}function ig(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}function Lc(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 K;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex= -void 0!==f?f:0}function R(){Object.defineProperty(this,"id",{value:Ci++});this.uuid=P.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.visible=!0;this.userData={};this.needsUpdate=!0}function Ka(a){R.call(this);this.type="MeshBasicMaterial";this.color=new K(16777215);this.lightMap=this.map= +(function(k,Da){"object"===typeof exports&&"undefined"!==typeof module?Da(exports):"function"===typeof define&&define.amd?define(["exports"],Da):(k=k||self,Da(k.THREE={}))})(this,function(k){function Da(){}function y(a,b){this.x=a||0;this.y=b||0}function ia(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 jc(a,b){this.origin=void 0!==a?a:new n;this.direction=void 0!==b?b:new n}function ea(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 K(a,b,c){return void 0=== +b&&void 0===c?this.set(a):this.setRGB(a,b,c)}function Ag(a,b,c){0>c&&(c+=1);1c?b:c<2/3?a+6*(b-a)*(2/3-c):a}function Bg(a){return.04045>a?.0773993808*a:Math.pow(.9478672986*a+.0521327014,2.4)}function Cg(a){return.0031308>a?12.92*a:1.055*Math.pow(a,.41666)-.055}function Tc(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 K;this.vertexColors=Array.isArray(e)?e:[];this.materialIndex= +void 0!==f?f:0}function R(){Object.defineProperty(this,"id",{value:cj++});this.uuid=P.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.visible=!0;this.userData={};this.needsUpdate=!0}function Oa(a){R.call(this);this.type="MeshBasicMaterial";this.color=new K(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 O(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 Jd(a,b,c){O.call(this,new Int8Array(a),b,c)}function Kd(a,b,c){O.call(this,new Uint8Array(a),b,c)}function Ld(a,b,c){O.call(this,new Uint8ClampedArray(a),b,c)}function Md(a,b,c){O.call(this,new Int16Array(a),b,c)}function cc(a,b,c){O.call(this,new Uint16Array(a),b,c)}function Nd(a,b,c){O.call(this,new Int32Array(a),b,c)}function dc(a,b,c){O.call(this,new Uint32Array(a),b,c)} -function A(a,b,c){O.call(this,new Float32Array(a),b,c)}function Od(a,b,c){O.call(this,new Float64Array(a),b,c)}function sh(){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 th(a){if(0===a.length)return-Infinity;for(var b=a[0],c=1,d=a.length;c< -d;++c)a[c]>b&&(b=a[c]);return b}function D(){Object.defineProperty(this,"id",{value:Di+=2});this.uuid=P.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 S(a,b){C.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new Ka({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()} -function uh(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;Mc.copy(h);Mc.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(Mc);return bc.far?null:{distance:b,point:Mc.clone(),object:a}}function Ye(a,b,c,d,e,f,g,h,l,m,p){Hb.fromBufferAttribute(e,l);Ib.fromBufferAttribute(e,m);Jb.fromBufferAttribute(e,p);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){Ze.set(0,0,0);$e.set(0,0,0);af.set(0,0,0);for(var t=0, -u=f.length;tg;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function Lb(a,b,c){hb.call(this,a,b,c)}function ic(a,b,c,d,e,f,g,h,l,m,p,t){Y.call(this,null,f,g,h,l,m,d,e,p,t);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 kb(a,b){this.normal=void 0!==a?a:new n(1,0,0);this.constant=void 0!==b?b:0}function bf(a,b,c,d,e,f){this.planes=[void 0!==a?a:new kb, -void 0!==b?b:new kb,void 0!==c?c:new kb,void 0!==d?d:new kb,void 0!==e?e:new kb,void 0!==f?f:new kb]}function ng(){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 Fi(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(); +void 0!==a?a.length/b:0;this.normalized=!0===c;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function Wd(a,b,c){O.call(this,new Int8Array(a),b,c)}function Xd(a,b,c){O.call(this,new Uint8Array(a),b,c)}function Yd(a,b,c){O.call(this,new Uint8ClampedArray(a),b,c)}function Zd(a,b,c){O.call(this,new Int16Array(a),b,c)}function kc(a,b,c){O.call(this,new Uint16Array(a),b,c)}function $d(a,b,c){O.call(this,new Int32Array(a),b,c)}function lc(a,b,c){O.call(this,new Uint32Array(a),b,c)} +function z(a,b,c){O.call(this,new Float32Array(a),b,c)}function ae(a,b,c){O.call(this,new Float64Array(a),b,c)}function Rh(){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 Sh(a){if(0===a.length)return-Infinity;for(var b=a[0],c=1,d=a.length;c< +d;++c)a[c]>b&&(b=a[c]);return b}function D(){Object.defineProperty(this,"id",{value:dj+=2});this.uuid=P.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 va(a,b){C.call(this);this.type="Mesh";this.geometry=void 0!==a?a:new D;this.material=void 0!==b?b:new Oa({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()} +function Th(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;Uc.copy(h);Uc.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(Uc);return bc.far?null:{distance:b,point:Uc.clone(),object:a}}function pf(a,b,c,d,e,f,g,h,l,m,r){Pb.fromBufferAttribute(e,l);Qb.fromBufferAttribute(e,m);Rb.fromBufferAttribute(e,r);e=a.morphTargetInfluences;if(b.morphTargets&&f&&e){qf.set(0,0,0);rf.set(0,0,0);sf.set(0,0,0);for(var t=0, +u=f.length;tg;g++)a.setRenderTarget(f,g),a.clear(b,c,d);a.setRenderTarget(e)}}function Tb(a,b,c){mb.call(this,a,b,c)}function qc(a,b,c,d,e,f,g,h,l,m,r,t){Y.call(this,null,f,g,h,l,m,d,e,r,t);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 pb(a,b){this.normal=void 0!==a?a:new n(1,0,0);this.constant=void 0!==b?b:0}function tf(a,b,c,d,e,f){this.planes=[void 0!==a?a:new pb, +void 0!==b?b:new pb,void 0!==c?c:new pb,void 0!==d?d:new pb,void 0!==e?e:new pb,void 0!==f?f:new pb]}function Hg(){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 fj(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(t=d[m])if(h=t[0],l=t[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 Qi(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 vb(a,b,c,d,e,f,g,h,l,m){a= -void 0!==a?a:[];Y.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,l,m);this.flipY=!1}function Qc(a,b,c,d){Y.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 Rc(a,b,c,d){Y.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 Sc(a,b,c){var d=a[0];if(0>=d||0/gm,function(a,c){a=L[c];if(void 0===a)throw Error("Can not resolve #include <"+c+">");return pg(a)})}function Lh(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(t=d[m])if(h=t[0],l=t[1]){r&&e.addAttribute("morphTarget"+m,r[h]);f&&e.addAttribute("morphNormal"+m,f[h]);c[m]=l;continue}c[m]=0}g.getUniforms().setValue(a,"morphTargetInfluences",c)}}}function qj(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 Cb(a,b,c,d,e,f,g,h,l,m){a= +void 0!==a?a:[];Y.call(this,a,void 0!==b?b:301,c,d,e,f,void 0!==g?g:1022,h,l,m);this.flipY=!1}function Yc(a,b,c,d){Y.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 Zc(a,b,c,d){Y.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 $c(a,b,c){var d=a[0];if(0>=d||0/gm,function(a,c){a=L[c];if(void 0===a)throw Error("Can not resolve #include <"+c+">");return Jg(a)})}function ji(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 Q,f=new Q;return{setup:function(c,h,l){for(var g=0,p=0,t=0,k=0;9>k;k++)b.probe[k].set(0, -0,0);var r=h=0,q=0,n=0,v=0,y=0,w=0,I=0;l=l.matrixWorldInverse;c.sort(Jj);k=0;for(var G=c.length;kEa;Ea++)b.probe[Ea].addScaledVector(B.sh.coefficients[Ea],Z);else if(B.isDirectionalLight){var E=a.get(B);E.color.copy(B.color).multiplyScalar(B.intensity);E.direction.setFromMatrixPosition(B.matrixWorld);d.setFromMatrixPosition(B.target.matrixWorld); -E.direction.sub(d);E.direction.transformDirection(l);if(E.shadow=B.castShadow)Z=B.shadow,E.shadowBias=Z.bias,E.shadowRadius=Z.radius,E.shadowMapSize=Z.mapSize,b.directionalShadowMap[h]=Ea,b.directionalShadowMatrix[h]=B.shadow.matrix,y++;b.directional[h]=E;h++}else if(B.isSpotLight){E=a.get(B);E.position.setFromMatrixPosition(B.matrixWorld);E.position.applyMatrix4(l);E.color.copy(La).multiplyScalar(Z);E.distance=z;E.direction.setFromMatrixPosition(B.matrixWorld);d.setFromMatrixPosition(B.target.matrixWorld); -E.direction.sub(d);E.direction.transformDirection(l);E.coneCos=Math.cos(B.angle);E.penumbraCos=Math.cos(B.angle*(1-B.penumbra));E.decay=B.decay;if(E.shadow=B.castShadow)Z=B.shadow,E.shadowBias=Z.bias,E.shadowRadius=Z.radius,E.shadowMapSize=Z.mapSize,b.spotShadowMap[q]=Ea,b.spotShadowMatrix[q]=B.shadow.matrix,I++;b.spot[q]=E;q++}else if(B.isRectAreaLight)E=a.get(B),E.color.copy(La).multiplyScalar(Z),E.position.setFromMatrixPosition(B.matrixWorld),E.position.applyMatrix4(l),f.identity(),e.copy(B.matrixWorld), -e.premultiply(l),f.extractRotation(e),E.halfWidth.set(.5*B.width,0,0),E.halfHeight.set(0,.5*B.height,0),E.halfWidth.applyMatrix4(f),E.halfHeight.applyMatrix4(f),b.rectArea[n]=E,n++;else if(B.isPointLight){E=a.get(B);E.position.setFromMatrixPosition(B.matrixWorld);E.position.applyMatrix4(l);E.color.copy(B.color).multiplyScalar(B.intensity);E.distance=B.distance;E.decay=B.decay;if(E.shadow=B.castShadow)Z=B.shadow,E.shadowBias=Z.bias,E.shadowRadius=Z.radius,E.shadowMapSize=Z.mapSize,E.shadowCameraNear= -Z.camera.near,E.shadowCameraFar=Z.camera.far,b.pointShadowMap[r]=Ea,b.pointShadowMatrix[r]=B.shadow.matrix,w++;b.point[r]=E;r++}else B.isHemisphereLight&&(E=a.get(B),E.direction.setFromMatrixPosition(B.matrixWorld),E.direction.transformDirection(l),E.direction.normalize(),E.skyColor.copy(B.color).multiplyScalar(Z),E.groundColor.copy(B.groundColor).multiplyScalar(Z),b.hemi[v]=E,v++)}b.ambient[0]=g;b.ambient[1]=p;b.ambient[2]=t;c=b.hash;if(c.directionalLength!==h||c.pointLength!==r||c.spotLength!== -q||c.rectAreaLength!==n||c.hemiLength!==v||c.numDirectionalShadows!==y||c.numPointShadows!==w||c.numSpotShadows!==I)b.directional.length=h,b.spot.length=q,b.rectArea.length=n,b.point.length=r,b.hemi.length=v,b.directionalShadowMap.length=y,b.pointShadowMap.length=w,b.spotShadowMap.length=I,b.directionalShadowMatrix.length=y,b.pointShadowMatrix.length=w,b.spotShadowMatrix.length=I,c.directionalLength=h,c.pointLength=r,c.spotLength=q,c.rectAreaLength=n,c.hemiLength=v,c.numDirectionalShadows=y,c.numPointShadows= -w,c.numSpotShadows=I,b.version=Lj++},state:b}}function Nh(){var a=new Kj,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 Mj(){function a(c){c=c.target;c.removeEventListener("dispose",a);delete b[c.id]}var b={};return{get:function(c,d){if(void 0===b[c.id]){var e=new Nh;b[c.id]={};b[c.id][d.id]=e;c.addEventListener("dispose",a)}else void 0=== -b[c.id][d.id]?(e=new Nh,b[c.id][d.id]=e):e=b[c.id][d.id];return e},dispose:function(){b={}}}}function Nb(a){R.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 Ob(a){R.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 Oh(a,b,c){function d(b,c,d,e,f,g){var h=b.geometry;var l=t;var m=b.customDepthMaterial;d&&(l=k,m=b.customDistanceMaterial);m?l=m:(m=!1,c.morphTargets&&(h&&h.isBufferGeometry?m=h.morphAttributes&&h.morphAttributes.position&&0d||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?P.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height),void 0===E&&(E=h(b,e)),c=c?h(b,e):E,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 P.isPowerOfTwo(a.width)&&P.isPowerOfTwo(a.height)}function p(a,b){return a.generateMipmaps&& -b&&1003!==a.minFilter&&1006!==a.minFilter}function t(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&&delete Ea[b.id];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 v(a,b){var e=d.get(a);if(a.isVideoTexture){var f=a.id,h=g.render.frame;Ea[f]!==h&&(Ea[f]=h,a.update())}if(0< -a.version&&e.__version!==a.version)if(f=a.image,void 0===f)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else if(!1===f.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{B(e,a,b);return}c.activeTexture(33984+b);c.bindTexture(3553,e.__webglTexture)}function y(b,g){var h=d.get(b);if(6===b.image.length)if(0r;r++)q[r]=g||u?u?b.image[r].image:b.image[r]:l(b.image[r],!1,!0,e.maxCubemapSize);var n=q[0],x=m(n)||e.isWebGL2,v=f.convert(b.format),w=f.convert(b.type),V=k(v,w);I(34067,b,x);var y=b.mipmaps;for(r=0;6>r;r++)if(g){y=q[r].mipmaps;ja=0;for(var B=y.length;ja=e.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+a+" texture units while this GPU supports only "+e.maxTextures);D+=1;return a}; -this.resetTextureUnits=function(){D=0};this.setTexture2D=v;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 x=f.convert(b.texture.type);r=k(r,x);x=A(b);a.renderbufferStorageMultisample(36161,x,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(),Z(h.__webglDepthRenderbuffer,b,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); -if(u){c.bindTexture(34067,l.__webglTexture);I(34067,b.texture,q);for(r=0;6>r;r++)z(h.__webglFramebuffer[r],b,36064,34069+r);p(b.texture,q)&&t(34067,b.texture,b.width,b.height);c.bindTexture(34067,null)}else c.bindTexture(3553,l.__webglTexture),I(3553,b.texture,q),z(h.__webglFramebuffer,b,36064,3553),p(b.texture,q)&&t(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"); +a.gammaInput),bumpMap:!!b.bumpMap,normalMap:!!b.normalMap,objectSpaceNormalMap:1===b.normalMapType,clearCoatNormalMap:!!b.clearCoatNormalMap,displacementMap:!!b.displacementMap,roughnessMap:!!b.roughnessMap,metalnessMap:!!b.metalnessMap,specularMap:!!b.specularMap,alphaMap:!!b.alphaMap,gradientMap:!!b.gradientMap,combine:b.combine,vertexTangents:b.normalMap&&b.vertexTangents,vertexColors:b.vertexColors,vertexUvs:!!b.map||!!b.bumpMap||!!b.normalMap||!!b.specularMap||!!b.alphaMap||!!b.emissiveMap|| +!!b.roughnessMap||!!b.metalnessMap||!!b.clearCoatNormalMap,fog:!!r,useFog:b.fog,fogExp:r&&r.isFogExp2,flatShading:b.flatShading,sizeAttenuation:b.sizeAttenuation,logarithmicDepthBuffer:c.logarithmicDepthBuffer,skinning:b.skinning&&0c;c++)b.probe.push(new n);var d=new n,e=new Q,f=new Q;return{setup:function(c,h,l){for(var g=0,r=0,t=0,k=0;9>k;k++)b.probe[k].set(0,0,0);var q=h=0,p=0,n=0,w=0,B=0,x=0,I=0;l=l.matrixWorldInverse;c.sort(kk);k=0;for(var G=c.length;kEa;Ea++)b.probe[Ea].addScaledVector(A.sh.coefficients[Ea], +Z);else if(A.isDirectionalLight){var E=a.get(A);E.color.copy(A.color).multiplyScalar(A.intensity);E.direction.setFromMatrixPosition(A.matrixWorld);d.setFromMatrixPosition(A.target.matrixWorld);E.direction.sub(d);E.direction.transformDirection(l);if(E.shadow=A.castShadow)Z=A.shadow,E.shadowBias=Z.bias,E.shadowRadius=Z.radius,E.shadowMapSize=Z.mapSize,b.directionalShadowMap[h]=Ea,b.directionalShadowMatrix[h]=A.shadow.matrix,B++;b.directional[h]=E;h++}else if(A.isSpotLight){E=a.get(A);E.position.setFromMatrixPosition(A.matrixWorld); +E.position.applyMatrix4(l);E.color.copy(Pa).multiplyScalar(Z);E.distance=y;E.direction.setFromMatrixPosition(A.matrixWorld);d.setFromMatrixPosition(A.target.matrixWorld);E.direction.sub(d);E.direction.transformDirection(l);E.coneCos=Math.cos(A.angle);E.penumbraCos=Math.cos(A.angle*(1-A.penumbra));E.decay=A.decay;if(E.shadow=A.castShadow)Z=A.shadow,E.shadowBias=Z.bias,E.shadowRadius=Z.radius,E.shadowMapSize=Z.mapSize,b.spotShadowMap[p]=Ea,b.spotShadowMatrix[p]=A.shadow.matrix,I++;b.spot[p]=E;p++}else if(A.isRectAreaLight)E= +a.get(A),E.color.copy(Pa).multiplyScalar(Z),E.position.setFromMatrixPosition(A.matrixWorld),E.position.applyMatrix4(l),f.identity(),e.copy(A.matrixWorld),e.premultiply(l),f.extractRotation(e),E.halfWidth.set(.5*A.width,0,0),E.halfHeight.set(0,.5*A.height,0),E.halfWidth.applyMatrix4(f),E.halfHeight.applyMatrix4(f),b.rectArea[n]=E,n++;else if(A.isPointLight){E=a.get(A);E.position.setFromMatrixPosition(A.matrixWorld);E.position.applyMatrix4(l);E.color.copy(A.color).multiplyScalar(A.intensity);E.distance= +A.distance;E.decay=A.decay;if(E.shadow=A.castShadow)Z=A.shadow,E.shadowBias=Z.bias,E.shadowRadius=Z.radius,E.shadowMapSize=Z.mapSize,E.shadowCameraNear=Z.camera.near,E.shadowCameraFar=Z.camera.far,b.pointShadowMap[q]=Ea,b.pointShadowMatrix[q]=A.shadow.matrix,x++;b.point[q]=E;q++}else A.isHemisphereLight&&(E=a.get(A),E.direction.setFromMatrixPosition(A.matrixWorld),E.direction.transformDirection(l),E.direction.normalize(),E.skyColor.copy(A.color).multiplyScalar(Z),E.groundColor.copy(A.groundColor).multiplyScalar(Z), +b.hemi[w]=E,w++)}b.ambient[0]=g;b.ambient[1]=r;b.ambient[2]=t;c=b.hash;if(c.directionalLength!==h||c.pointLength!==q||c.spotLength!==p||c.rectAreaLength!==n||c.hemiLength!==w||c.numDirectionalShadows!==B||c.numPointShadows!==x||c.numSpotShadows!==I)b.directional.length=h,b.spot.length=p,b.rectArea.length=n,b.point.length=q,b.hemi.length=w,b.directionalShadowMap.length=B,b.pointShadowMap.length=x,b.spotShadowMap.length=I,b.directionalShadowMatrix.length=B,b.pointShadowMatrix.length=x,b.spotShadowMatrix.length= +I,c.directionalLength=h,c.pointLength=q,c.spotLength=p,c.rectAreaLength=n,c.hemiLength=w,c.numDirectionalShadows=B,c.numPointShadows=x,c.numSpotShadows=I,b.version=mk++},state:b}}function li(){var a=new lk,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 nk(){function a(c){c=c.target;c.removeEventListener("dispose",a);delete b[c.id]} +var b={};return{get:function(c,d){if(void 0===b[c.id]){var e=new li;b[c.id]={};b[c.id][d.id]=e;c.addEventListener("dispose",a)}else void 0===b[c.id][d.id]?(e=new li,b[c.id][d.id]=e):e=b[c.id][d.id];return e},dispose:function(){b={}}}}function Vb(a){R.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 Wb(a){R.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 mi(a,b,c){function d(b,c,d,e,f,g){var h=b.geometry;var l=t;var m=b.customDepthMaterial;d&&(l=k,m=b.customDistanceMaterial);m?l=m:(m=!1,c.morphTargets&&(h&&h.isBufferGeometry? +m=h.morphAttributes&&h.morphAttributes.position&&0d||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?P.floorPowerOfTwo:Math.floor,b=d(e*a.width),e=d(e*a.height),void 0===E&&(E=h(b,e)),c=c?h(b,e):E,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 P.isPowerOfTwo(a.width)&&P.isPowerOfTwo(a.height)}function r(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function t(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 q(a){return 1003===a||1004===a||1005===a?9728:9729}function p(b){b=b.target;b.removeEventListener("dispose",p);var c=d.get(b);void 0!==c.__webglInit&&(a.deleteTexture(c.__webglTexture),d.remove(b));b.isVideoTexture&&delete Ea[b.id];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=a.id,h=g.render.frame;Ea[f]!==h&&(Ea[f]=h,a.update())}if(0p;p++)q[p]=g||u?u?b.image[p].image:b.image[p]:l(b.image[p],!1,!0,e.maxCubemapSize);var n=q[0],v=m(n)||e.isWebGL2,w=f.convert(b.format),x=f.convert(b.type),V=k(w,x);I(34067,b,v);var A=b.mipmaps;for(p=0;6>p;p++)if(g){A=q[p].mipmaps;ja=0;for(var B=A.length;ja=e.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+ +a+" texture units while this GPU supports only "+e.maxTextures);D+=1;return a};this.resetTextureUnits=function(){D=0};this.setTexture2D=w;this.setTexture2DArray=function(a,b){var e=d.get(a);0p;p++)h.__webglFramebuffer[p]=a.createFramebuffer();else if(h.__webglFramebuffer=a.createFramebuffer(),p)if(e.isWebGL2){h.__webglMultisampledFramebuffer=a.createFramebuffer();h.__webglColorRenderbuffer=a.createRenderbuffer(); +a.bindRenderbuffer(36161,h.__webglColorRenderbuffer);p=f.convert(b.texture.format);var v=f.convert(b.texture.type);p=k(p,v);v=z(b);a.renderbufferStorageMultisample(36161,v,p,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(),Z(h.__webglDepthRenderbuffer,b,!0));a.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."); +if(u){c.bindTexture(34067,l.__webglTexture);I(34067,b.texture,q);for(p=0;6>p;p++)y(h.__webglFramebuffer[p],b,36064,34069+p);r(b.texture,q)&&t(34067,b.texture,b.width,b.height);c.bindTexture(34067,null)}else c.bindTexture(3553,l.__webglTexture),I(3553,b.texture,q),y(h.__webglFramebuffer,b,36064,3553),r(b.texture,q)&&t(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); -v(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(),Z(h.__webglDepthbuffer[l],b);else a.bindFramebuffer(36160,h.__webglFramebuffer),h.__webglDepthbuffer= -a.createRenderbuffer(),Z(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);t(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===J&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),J=!0),a=a.texture);v(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLRenderTargetCube&& -(!1===K&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),K=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?y(a,b):w(a,b)}}function Qh(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; +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(),Z(h.__webglDepthbuffer[l],b);else a.bindFramebuffer(36160,h.__webglFramebuffer),h.__webglDepthbuffer= +a.createRenderbuffer(),Z(h.__webglDepthbuffer,b);a.bindFramebuffer(36160,null)}};this.updateRenderTargetMipmap=function(a){var b=a.texture,f=m(a)||e.isWebGL2;if(r(b,f)){f=a.isWebGLRenderTargetCube?34067:3553;var g=d.get(b).__webglTexture;c.bindTexture(f,g);t(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===J&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),J=!0),a=a.texture);w(a,b)};this.safeSetTextureCube=function(a,b){a&&a.isWebGLRenderTargetCube&& +(!1===K&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),K=!0),a=a.texture);a&&a.isCubeTexture||Array.isArray(a.image)&&6===a.image.length?B(a,b):x(a,b)}}function oi(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 Tc(){C.call(this);this.type="Group"}function Sd(a){na.call(this);this.cameras=a||[]}function Rh(a,b,c){Sh.setFromMatrixPosition(b.matrixWorld);Th.setFromMatrixPosition(c.matrixWorld);var d=Sh.distanceTo(Th),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 rg(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;La=a.getPixelRatio();a.getSize(B);a.setDrawingBufferSize(e,f,1);w.viewport.set(0,0,e/2,f);I.viewport.set(e/ -2,0,e/2,f);A.start();g.dispatchEvent({type:"sessionstart"})}else g.enabled&&a.setDrawingBufferSize(B.width,B.height,La),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=[],t=new Q,k=new Q,r=1,q="local-floor";"undefined"!==typeof window&&"VRFrameData"in window&&(l=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",c,!1));var x=new Q,v=new ta,y=new n,w=new na;w.viewport= -new ia;w.layers.enable(1);var I=new na;I.viewport=new ia;I.layers.enable(2);var G=new Sd([w,I]);G.layers.enable(1);G.layers.enable(2);var B=new z,La,Z=[];this.enabled=!1;this.getController=function(a){var b=p[a];void 0===b&&(b=new Tc,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){q=a};this.setPoseTarget=function(a){void 0!== -a&&(m=a)};this.getCamera=function(a){var c="local-floor"===q?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"===q){var e=h.stageParameters;e?t.fromArray(e.sittingToStandingTransform):t.makeTranslation(0,c,0)}c=l.pose;e=null!==m?m:a;e.matrix.copy(t);e.matrix.decompose(e.position,e.quaternion,e.scale);null!==c.orientation&&(v.fromArray(c.orientation),e.quaternion.multiply(v));null!==c.position&&(v.setFromRotationMatrix(t), -y.fromArray(c.position),y.applyQuaternion(v),e.position.add(y));e.updateMatrixWorld();w.near=a.near;I.near=a.near;w.far=a.far;I.far=a.far;w.matrixWorldInverse.fromArray(l.leftViewMatrix);I.matrixWorldInverse.fromArray(l.rightViewMatrix);k.getInverse(t);"local-floor"===q&&(w.matrixWorldInverse.multiply(k),I.matrixWorldInverse.multiply(k));a=e.parent;null!==a&&(x.getInverse(a.matrixWorld),w.matrixWorldInverse.multiply(x),I.matrixWorldInverse.multiply(x));w.matrixWorld.getInverse(w.matrixWorldInverse); -I.matrixWorld.getInverse(I.matrixWorldInverse);w.projectionMatrix.fromArray(l.leftProjectionMatrix);I.projectionMatrix.fromArray(l.rightProjectionMatrix);Rh(G,w,I);a=h.getLayers();a.length&&(a=a[0],d(w.viewport,a.leftBounds),d(I.viewport,a.rightBounds));a:for(a=0;af.matrixWorld.determinant();fa.setMaterial(e,h);var l=k(a,c,e,f),m=!1;if(b!==d.id||Y!==l.id||aa!==(!0===e.wireframe))b=d.id,Y=l.id,aa=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(za.update(f,d,e,l),m=!0);h=d.index;var p=d.attributes.position;c=1;!0===e.wireframe&&(h=xa.getWireframeAttribute(d),c=2);a=Aa;if(null!==h){var t=ua.get(h);a=Ba;a.setIndex(t)}if(m){if(d&&d.isInstancedBufferGeometry&&!Fa.isWebGL2&&null===qa.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."); -else{fa.initAttributes();m=d.attributes;l=l.getAttributes();var r=e.defaultAttributeValues;for(G in l){var u=l[G];if(0<=u){var q=m[G];if(void 0!==q){var n=q.normalized,x=q.itemSize,v=ua.get(q);if(void 0!==v){var w=v.buffer,y=v.type;v=v.bytesPerElement;if(q.isInterleavedBufferAttribute){var B=q.data,I=B.stride;q=q.offset;B&&B.isInstancedInterleavedBuffer?(fa.enableAttributeAndDivisor(u,B.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=B.meshPerAttribute*B.count)):fa.enableAttribute(u); -N.bindBuffer(34962,w);N.vertexAttribPointer(u,x,y,n,I*v,q*v)}else q.isInstancedBufferAttribute?(fa.enableAttributeAndDivisor(u,q.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=q.meshPerAttribute*q.count)):fa.enableAttribute(u),N.bindBuffer(34962,w),N.vertexAttribPointer(u,x,y,n,0,0)}}else if(void 0!==r&&(n=r[G],void 0!==n))switch(n.length){case 2:N.vertexAttrib2fv(u,n);break;case 3:N.vertexAttrib3fv(u,n);break;case 4:N.vertexAttrib4fv(u,n);break;default:N.vertexAttrib1fv(u,n)}}}fa.disableUnusedAttributes()}null!== -h&&N.bindBuffer(34963,t.buffer)}t=Infinity;null!==h?t=h.count:void 0!==p&&(t=p.count);h=d.drawRange.start*c;p=null!==g?g.start*c:0;var G=Math.max(h,p);g=Math.max(0,Math.min(t,h+d.drawRange.count*c,p+(null!==g?g.count*c:Infinity))-1-G+1);if(0!==g){if(f.isMesh)if(!0===e.wireframe)fa.setLineWidth(e.wireframeLinewidth*(null===L?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),fa.setLineWidth(e* -(null===L?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?0c;c++){var t=p[h[c]];var k=p[h[(c+1)%3]];f[0]=Math.min(t,k);f[1]=Math.max(t,k);t=f[0]+","+f[1];void 0===g[t]&&(g[t]={index1:f[0],index2:f[1]})}}for(t in g)m=g[t],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++)t=p.getX(m+c),k=p.getX(m+(c+1)%3),f[0]=Math.min(t,k),f[1]=Math.max(t,k),t=f[0]+","+f[1],void 0===g[t]&&(g[t]={index1:f[0],index2:f[1]});for(t in g)m=g[t],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 Zd(a,b,c){F.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new Zc(a,b,c));this.mergeVertices()}function Zc(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,t=new n,k,r;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var q=b+1;for(k=0;k<=c;k++){var x=k/c;for(r=0;r<=b;r++){var v=r/b;a(v,x,l);e.push(l.x,l.y,l.z);0<=v-1E-5?(a(v-1E-5,x,m),p.subVectors(l,m)):(a(v+1E-5,x,m),p.subVectors(m,l));0<=x-1E-5?(a(v,x-1E-5,m),t.subVectors(l,m)):(a(v,x+1E-5,m),t.subVectors(m, -l));h.crossVectors(p,t).normalize();f.push(h.x,h.y,h.z);g.push(v,x)}}for(k=0;kd&&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 ae(a,b){F.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new $c(a,b));this.mergeVertices()}function $c(a,b){ya.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 be(a,b){F.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new mc(a,b));this.mergeVertices()}function mc(a,b){ya.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 ce(a,b){F.call(this);this.type="IcosahedronGeometry";this.parameters= -{radius:a,detail:b};this.fromBufferGeometry(new ad(a,b));this.mergeVertices()}function ad(a,b){var c=(1+Math.sqrt(5))/2;ya.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 de(a,b){F.call(this);this.type="DodecahedronGeometry";this.parameters= -{radius:a,detail:b};this.fromBufferGeometry(new bd(a,b));this.mergeVertices()}function bd(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;ya.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 ee(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 nc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function nc(a, -b,c,d,e){function f(e){p=a.getPointAt(e/b,p);var f=g.normals[e];e=g.binormals[e];for(u=0;u<=d;u++){var m=u/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 z,p=new n,k,u,r=[],q=[],x=[],v=[];for(k=0;k=b;e-=d)f=Xh(e,a[e],a[e+1],f);f&&oc(f,f.next)&&(he(f),f=f.next);return f}function ie(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!oc(a,a.next)&&0!==ra(a.prev,a,a.next))a=a.next;else{he(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function je(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l.z=wg(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,u,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=Zh(g,h);g=ie(g,g.next);a=ie(a,a.next);je(g,b,c,d,e,f);je(a,b,c,d,e,f);break a}h=h.next}g=g.next}while(g!==a)}break}}}}function Pj(a,b,c,d){var e=a.prev,f=a.next;if(0<=ra(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=wg(e.x=l&&d&&d.z<=b;){if(c!==a.prev&&c!==a.next&&ed(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=ra(c.prev,c,c.next))return!1;c=c.prevZ;if(d!==a.prev&&d!==a.next&&ed(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=ra(d.prev,d,d.next))return!1;d=d.nextZ}for(;c&&c.z>=l;){if(c!==a.prev&&c!==a.next&&ed(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=ra(c.prev,c,c.next))return!1;c=c.prevZ}for(;d&&d.z<=b;){if(d!==a.prev&&d!==a.next&&ed(e.x,e.y, -a.x,a.y,f.x,f.y,d.x,d.y)&&0<=ra(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function Qj(a,b){return a.x-b.x}function Rj(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&&ed(e< -l?d:f,e,g,l,eh.x)&&ke(c,a)&&(h=c,m=p)}c=c.next}return h}function wg(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 Sj(a){var b=a,c=a;do{if(b.xra(a.prev,a,a.next)?0<=ra(a,b,a.next)&&0<=ra(a,a.prev,b):0>ra(a,b,a.prev)||0>ra(a,a.next,b)}function Zh(a,b){var c=new xg(a.i,a.x,a.y),d=new xg(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 Xh(a,b,c,d){a=new xg(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 he(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 xg(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 $h(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 z(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 z(f/e,d/e)}function h(a,b){for(M=a.length;0<=--M;){var c=M;var f=M-1;0>f&&(f=a.length-1);var g,h=w+2*C;for(g=0;gf.matrixWorld.determinant();ha.setMaterial(e,h);var l=u(a,c,e,f),m=!1;if(b!==d.id||Y!==l.id||aa!==(!0===e.wireframe))b=d.id,Y=l.id,aa=!0===e.wireframe,m=!0;f.morphTargetInfluences&&(ya.update(f,d,e,l),m=!0);h=d.index;var r=d.attributes.position;c=1;!0===e.wireframe&&(h=xa.getWireframeAttribute(d),c=2);a=Ba;if(null!==h){var k=va.get(h);a=Ca;a.setIndex(k)}if(m){if(d&&d.isInstancedBufferGeometry&&!Fa.isWebGL2&&null===ra.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 t=e.defaultAttributeValues;for(G in l){var p=l[G];if(0<=p){var q=m[G];if(void 0!==q){var n=q.normalized,v=q.itemSize,w=va.get(q);if(void 0!==w){var x=w.buffer,B=w.type;w=w.bytesPerElement;if(q.isInterleavedBufferAttribute){var A=q.data,I=A.stride;q=q.offset;A&&A.isInstancedInterleavedBuffer?(ha.enableAttributeAndDivisor(p,A.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=A.meshPerAttribute*A.count)):ha.enableAttribute(p); +N.bindBuffer(34962,x);N.vertexAttribPointer(p,v,B,n,I*w,q*w)}else q.isInstancedBufferAttribute?(ha.enableAttributeAndDivisor(p,q.meshPerAttribute),void 0===d.maxInstancedCount&&(d.maxInstancedCount=q.meshPerAttribute*q.count)):ha.enableAttribute(p),N.bindBuffer(34962,x),N.vertexAttribPointer(p,v,B,n,0,0)}}else if(void 0!==t&&(n=t[G],void 0!==n))switch(n.length){case 2:N.vertexAttrib2fv(p,n);break;case 3:N.vertexAttrib3fv(p,n);break;case 4:N.vertexAttrib4fv(p,n);break;default:N.vertexAttrib1fv(p,n)}}}ha.disableUnusedAttributes()}null!== +h&&N.bindBuffer(34963,k.buffer)}k=Infinity;null!==h?k=h.count:void 0!==r&&(k=r.count);h=d.drawRange.start*c;r=null!==g?g.start*c:0;var G=Math.max(h,r);g=Math.max(0,Math.min(k,h+d.drawRange.count*c,r+(null!==g?g.count*c:Infinity))-1-G+1);if(0!==g){if(f.isMesh)if(!0===e.wireframe)ha.setLineWidth(e.wireframeLinewidth*(null===L?fa: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===L?fa: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?0c;c++){var k=r[h[c]];var u=r[h[(c+1)%3]];f[0]=Math.min(k,u);f[1]=Math.max(k,u);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;r=a.index;var q=a.groups;0===q.length&&(q=[{start:0,count:r.count,materialIndex:0}]);a=0;for(e=q.length;ac;c++)k=r.getX(m+c),u=r.getX(m+(c+1)%3),f[0]=Math.min(k,u),f[1]=Math.max(k,u),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 z(b,3))}function le(a,b,c){F.call(this);this.type="ParametricGeometry";this.parameters={func:a,slices:b,stacks:c};this.fromBufferGeometry(new gd(a,b,c));this.mergeVertices()}function gd(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,r=new n,k=new n,u,q;3>a.length&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");var p=b+1;for(u=0;u<=c;u++){var v=u/c;for(q=0;q<=b;q++){var w=q/b;a(w,v,l);e.push(l.x,l.y,l.z);0<=w-1E-5?(a(w-1E-5,v,m),r.subVectors(l,m)):(a(w+1E-5,v,m),r.subVectors(m,l));0<=v-1E-5?(a(w,v-1E-5,m),k.subVectors(l,m)):(a(w,v+1E-5,m),k.subVectors(m, +l));h.crossVectors(r,k).normalize();f.push(h.x,h.y,h.z);g.push(w,v)}}for(u=0;ud&&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 z(h,3));this.addAttribute("normal",new z(h.slice(),3));this.addAttribute("uv",new z(l,2));0===d?this.computeVertexNormals():this.normalizeNormals()}function ne(a,b){F.call(this);this.type="TetrahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new hd(a,b));this.mergeVertices()}function hd(a,b){Ha.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 oe(a,b){F.call(this);this.type="OctahedronGeometry";this.parameters={radius:a,detail:b};this.fromBufferGeometry(new uc(a,b));this.mergeVertices()}function uc(a,b){Ha.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 pe(a,b){F.call(this);this.type="IcosahedronGeometry";this.parameters= +{radius:a,detail:b};this.fromBufferGeometry(new id(a,b));this.mergeVertices()}function id(a,b){var c=(1+Math.sqrt(5))/2;Ha.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 qe(a,b){F.call(this);this.type="DodecahedronGeometry";this.parameters= +{radius:a,detail:b};this.fromBufferGeometry(new jd(a,b));this.mergeVertices()}function jd(a,b){var c=(1+Math.sqrt(5))/2,d=1/c;Ha.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 re(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 vc(a,b,c,d,e);this.tangents=a.tangents;this.normals=a.normals;this.binormals=a.binormals;this.fromBufferGeometry(a);this.mergeVertices()}function vc(a, +b,c,d,e){function f(e){r=a.getPointAt(e/b,r);var f=g.normals[e];e=g.binormals[e];for(u=0;u<=d;u++){var m=u/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();p.push(l.x,l.y,l.z);h.x=r.x+c*l.x;h.y=r.y+c*l.y;h.z=r.z+c*l.z;q.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 y,r=new n,k,u,q=[],p=[],v=[],w=[];for(k=0;k=b;e-=d)f=vi(e,a[e],a[e+1],f);f&&wc(f,f.next)&&(ue(f),f=f.next);return f}function ve(a,b){if(!a)return a;b||(b=a);do{var c=!1;if(a.steiner||!wc(a,a.next)&&0!==wa(a.prev,a,a.next))a=a.next;else{ue(a);a=b=a.prev;if(a===a.next)break;c=!0}}while(c||a!==b);return b}function we(a,b,c,d,e,f,g){if(a){if(!g&&f){var h=a,l=h;do null===l.z&&(l.z=Qg(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,r,k,n,q=1;do{l=h;var p=h=null;for(r=0;l;){r++; +var v=l;for(m=k=0;mv!==p.next.y>v&&p.next.y!==p.y&&k<(p.next.x-p.x)*(v-p.y)/(p.next.y-p.y)+p.x&&(r=!r),p=p.next;while(p!==l);p=r}l=p}if(l){a=xi(g,h);g=ve(g,g.next);a=ve(a,a.next);we(g,b,c,d,e,f);we(a,b,c,d,e,f);break a}h=h.next}g=g.next}while(g!==a)}break}}}}function qk(a,b,c,d){var e=a.prev,f=a.next;if(0<=wa(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=Qg(e.x=l&&d&&d.z<=b;){if(c!==a.prev&&c!==a.next&&md(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=wa(c.prev,c,c.next))return!1;c=c.prevZ;if(d!==a.prev&&d!==a.next&&md(e.x,e.y,a.x,a.y,f.x,f.y,d.x,d.y)&&0<=wa(d.prev,d,d.next))return!1;d=d.nextZ}for(;c&&c.z>=l;){if(c!==a.prev&&c!==a.next&&md(e.x,e.y,a.x,a.y,f.x,f.y,c.x,c.y)&&0<=wa(c.prev,c,c.next))return!1;c=c.prevZ}for(;d&&d.z<=b;){if(d!==a.prev&&d!==a.next&&md(e.x,e.y, +a.x,a.y,f.x,f.y,d.x,d.y)&&0<=wa(d.prev,d,d.next))return!1;d=d.nextZ}return!0}function rk(a,b){return a.x-b.x}function sk(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&&md(e< +l?d:f,e,g,l,eh.x)&&xe(c,a)&&(h=c,m=r)}c=c.next}return h}function Qg(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 tk(a){var b=a,c=a;do{if(b.xwa(a.prev,a,a.next)?0<=wa(a,b,a.next)&&0<=wa(a,a.prev,b):0>wa(a,b,a.prev)||0>wa(a,a.next,b)}function xi(a,b){var c=new Rg(a.i,a.x,a.y),d=new Rg(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 vi(a,b,c,d){a=new Rg(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 ue(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 Rg(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 yi(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 y(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 y(f/e,d/e)}function h(a,b){for(M=a.length;0<=--M;){var c=M;var f=M-1;0>f&&(f=a.length-1);var g,h=x+2*C;for(g=0;gk;k++){var t=m[f[k]];var n=m[f[(k+1)%3]];d[0]=Math.min(t,n);d[1]=Math.max(t,n);t=d[0]+","+d[1];void 0===e[t]?e[t]={index1:d[0],index2:d[1],face1:h,face2:void 0}:e[t].face2=h}for(t in e)if(d=e[t], -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 sc(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 xb(a,b,c,d,e,f,g,h));this.mergeVertices()}function xb(a,b,c,d,e,f,g,h){function l(c){var e,f=new z,l=new n, -p=0,w=!0===c?a:b,x=!0===c?1:-1;var A=q;for(e=1;e<=d;e++)t.push(0,v*x,0),u.push(0,x,0),r.push(.5,.5),q++;var E=q;for(e=0;e<=d;e++){var C=e/d*h+g,D=Math.cos(C);C=Math.sin(C);l.x=w*C;l.y=v*x;l.z=w*D;t.push(l.x,l.y,l.z);u.push(0,x,0);f.x=.5*D+.5;f.y=.5*C*x+.5;r.push(f.x,f.y);q++}for(e=0;ethis.duration&& -this.resetDuration()}function Uj(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return ld;case "vector":case "vector2":case "vector3":case "vector4":return md;case "color":return nf;case "quaternion":return te;case "bool":case "boolean":return mf;case "string":return pf}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function Vj(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var b=Uj(a.type); -if(void 0===a.times){var c=[],d=[];ha.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 yg(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 Xa(a){this.manager=void 0!==a?a:Ga}function di(a){this.manager=void 0!==a?a:Ga}function ei(a){this.manager=void 0!==a?a:Ga;this._parser=null}function zg(a){this.manager=void 0!==a?a:Ga;this._parser=null}function ue(a){this.manager=void 0!==a?a:Ga}function Ag(a){this.manager=void 0!==a?a:Ga}function qf(a){this.manager=void 0!==a?a:Ga}function H(){this.type= -"Curve";this.arcLengthDivisions=200}function Oa(a,b,c,d,e,f,g,h){H.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 nd(a,b,c,d,e,f){Oa.call(this,a,b,c,c,d,e,f);this.type="ArcCurve"}function Bg(){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 pa(a,b,c,d){H.call(this);this.type="CatmullRomCurve3";this.points=a||[];this.closed=b||!1;this.curveType=c||"centripetal";this.tension=d||.5}function fi(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 ve(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}function we(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 Ya(a,b,c,d){H.call(this);this.type="CubicBezierCurve";this.v0=a||new z;this.v1=b||new z;this.v2=c||new z;this.v3=d||new z}function ob(a,b,c,d){H.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 Ha(a,b){H.call(this);this.type="LineCurve";this.v1=a||new z;this.v2=b||new z}function Za(a,b){H.call(this);this.type="LineCurve3";this.v1=a||new n;this.v2=b|| -new n}function $a(a,b,c){H.call(this);this.type="QuadraticBezierCurve";this.v0=a||new z;this.v1=b||new z;this.v2=c||new z}function pb(a,b,c){H.call(this);this.type="QuadraticBezierCurve3";this.v0=a||new n;this.v1=b||new n;this.v2=c||new n}function ab(a){H.call(this);this.type="SplineCurve";this.points=a||[]}function yb(){H.call(this);this.type="CurvePath";this.curves=[];this.autoClose=!1}function bb(a){yb.call(this);this.type="Path";this.currentPoint=new z;a&&this.setFromPoints(a)}function Sb(a){bb.call(this, -a);this.uuid=P.generateUUID();this.type="Shape";this.holes=[]}function T(a,b){C.call(this);this.type="Light";this.color=new K(a);this.intensity=void 0!==b?b:1;this.receiveShadow=void 0}function rf(a,b,c){T.call(this,a,c);this.type="HemisphereLight";this.castShadow=void 0;this.position.copy(C.DefaultUp);this.updateMatrix();this.groundColor=new K(b)}function Ac(a){this.camera=a;this.bias=0;this.radius=1;this.mapSize=new z(512,512);this.map=null;this.matrix=new Q}function sf(){Ac.call(this,new na(50, -1,.5,500))}function tf(a,b,c,d,e,f){T.call(this,a,b);this.type="SpotLight";this.position.copy(C.DefaultUp);this.updateMatrix();this.target=new C;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 sf}function uf(a,b,c,d){T.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 Ac(new na(90,1,.5,500))}function xe(a,b,c,d,e,f){jb.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 vf(){Ac.call(this, -new xe(-5,5,5,-5,.5,500))}function wf(a,b){T.call(this,a,b);this.type="DirectionalLight";this.position.copy(C.DefaultUp);this.updateMatrix();this.target=new C;this.shadow=new vf}function xf(a,b){T.call(this,a,b);this.type="AmbientLight";this.castShadow=void 0}function yf(a,b,c,d){T.call(this,a,b);this.type="RectAreaLight";this.width=void 0!==c?c:10;this.height=void 0!==d?d:10}function zf(a){this.manager=void 0!==a?a:Ga;this.textures={}}function Af(){D.call(this);this.type="InstancedBufferGeometry"; -this.maxInstancedCount=void 0}function Bf(a,b,c,d){"number"===typeof c&&(d=c,c=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument."));O.call(this,a,b,c);this.meshPerAttribute=d||1}function Cg(a){this.manager=void 0!==a?a:Ga}function Dg(a){this.manager=void 0!==a?a:Ga;this.resourcePath=""}function Eg(a){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");"undefined"===typeof fetch&& -console.warn("THREE.ImageBitmapLoader: fetch() not supported.");this.manager=void 0!==a?a:Ga;this.options=void 0}function Fg(){this.type="ShapePath";this.color=new K;this.subPaths=[];this.currentPath=null}function Gg(a){this.type="Font";this.data=a}function gi(a){this.manager=void 0!==a?a:Ga}function ye(){}function Hg(a){this.manager=void 0!==a?a:Ga}function Cf(){this.coefficients=[];for(var a=0;9>a;a++)this.coefficients.push(new n)}function cb(a,b){T.call(this,void 0,b);this.sh=void 0!==a?a:new Cf} -function Ig(a,b,c){cb.call(this,void 0,c);a=(new K).set(a);c=(new K).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 Jg(a,b){cb.call(this,void 0,b);a=(new K).set(a);this.sh.coefficients[0].set(a.r,a.g,a.b).multiplyScalar(2*Math.sqrt(Math.PI))}function hi(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new na; -this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new na;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 Kg(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function Lg(){C.call(this);this.type="AudioListener";this.context=Mg.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination); -this.filter=null;this.timeDelta=0;this._clock=new Kg}function od(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.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function Ng(a){od.call(this,a);this.panner=this.context.createPanner();this.panner.panningModel="HRTF"; -this.panner.connect(this.gain)}function Og(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 Pg(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 ii(a,b,c){c=c||za.parseTrackName(b);this._targetGroup=a;this._bindings=a.subscribe_(b,c)}function za(a,b,c){this.path=b;this.parsedPath=c||za.parseTrackName(b);this.node=za.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function ji(){this.uuid=P.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 ki(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 Qg(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Df(a,b){"string"===typeof a&& -(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=b);this.value=a}function Rg(a,b,c){kc.call(this,a,b);this.meshPerAttribute=c||1}function li(a,b,c,d){this.ray=new bc(a,b);this.near=c||0;this.far=d||Infinity;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 mi(a,b){return a.distance- -b.distance}function Sg(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 ba({fog:!1});this.cone=new aa(a,b);this.add(this.cone);this.update()}function pi(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;ca?-1:0Ge;Ge++)wa[Ge]=(16>Ge?"0":"")+Ge.toString(16);var P={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(wa[a&255]+wa[a>>8&255]+wa[a>>16&255]+wa[a>>24&255]+"-"+wa[b&255]+wa[b>>8&255]+"-"+wa[b>>16&15|64]+wa[b>>24&255]+"-"+wa[c&63|128]+wa[c>>8&255]+"-"+wa[c>>16&255]+wa[c>>24&255]+wa[d&255]+wa[d>>8&255]+wa[d>>16& -255]+wa[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*P.DEG2RAD},radToDeg:function(a){return a*P.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(z.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(z.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=a[1]*b+a[4]*c+a[7];return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);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));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));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);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);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);return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*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(ta,{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],t=e[f+2];e=e[f+3];if(c!==e||h!==d||l!==k||m!==t){f=1-g;var n=h*d+l*k+m*t+c*e,r=0<=n?1:-1,q=1-n*n;q>Number.EPSILON&&(q=Math.sqrt(q),n=Math.atan2(q,n*r),f=Math.sin(f*n)/q,g=Math.sin(g*n)/q);r*=g;h=h*f+d*r;l=l*f+k*r;m=m*f+t*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(ta.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(ta.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);this._x=a.x*c;this._y=a.y*c;this._z=a.z*c;this._w=Math.cos(b);this._onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],l=b[6];b=b[10];var m=c+f+b;0f&&c>b? -(c=2*Math.sqrt(1+c-f-b),this._w=(l-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c,this._y=.25*c,this._z=(g+l)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+l)/c,this._z=.25*c);this._onChangeCallback();return this},setFromUnitVectors:function(a,b){var c=a.dot(b)+1;1E-6>c?(c=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x=a.y*b.z-a.z*b.y,this._y= -a.z*b.x-a.x*b.z,this._z=a.x*b.y-a.y*b.x);this._w=c;return this.normalize()},angleTo:function(a){return 2*Math.acos(Math.abs(P.clamp(this.dot(a),-1,1)))},rotateTowards:function(a,b){var c=this.angleTo(a);if(0===c)return this;this.slerp(a,Math.min(1,b/c));return this},inverse:function(){return this.conjugate()},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this._onChangeCallback();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)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);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 Bc,yd;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){void 0===yd&&(yd=new ta);a&&a.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");return this.applyQuaternion(yd.setFromEuler(a))},applyAxisAngle:function(a,b){void 0===yd&&(yd=new ta); -return this.applyQuaternion(yd.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){void 0===Bc&&(Bc=new n);Bc.copy(this).projectOnVector(a); -return this.sub(Bc)},reflect:function(a){void 0===Bc&&(Bc=new n);return this.sub(Bc.copy(a).multiplyScalar(2*this.dot(a)))},angleTo:function(a){a=this.dot(a)/Math.sqrt(this.lengthSq()*a.lengthSq());return Math.acos(P.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 Bb;Object.assign(va.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){void 0===Bb&&(Bb=new n);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 zd,Tb={getDataURL:function(a){if("undefined"==typeof HTMLCanvasElement)return a.src;if(!(a instanceof HTMLCanvasElement)){void 0===zd&&(zd=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"));zd.width=a.width;zd.height=a.height;var b=zd.getContext("2d");a instanceof ImageData?b.putImageData(a,0,0):b.drawImage(a,0,0,a.width,a.height);a=zd}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(Y.prototype,"needsUpdate", -{set:function(a){!0===a&&this.version++}});Object.defineProperties(ia.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(ia.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-=a;this.y-=a;this.z-=a;this.w-=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;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*= -a;this.w*=a;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a=a.elements;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;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},setAxisAngleFromRotationMatrix:function(a){a= -a.elements;var b=a[0];var c=a[4];var d=a[8],e=a[1],f=a[5],g=a[9];var h=a[2];var l=a[6];var m=a[10];if(.01>Math.abs(c-e)&&.01>Math.abs(d-h)&&.01>Math.abs(g-l)){if(.1>Math.abs(c+e)&&.1>Math.abs(d+h)&&.1>Math.abs(g+l)&&.1>Math.abs(b+f+m-3))return this.set(1,0,0,0),this;a=Math.PI;b=(b+1)/2;f=(f+1)/2;m=(m+1)/2;c=(c+e)/4;d=(d+h)/4;g=(g+l)/4;b>f&&b>m?.01>b?(l=0,c=h=.707106781):(l=Math.sqrt(b),h=c/l,c=d/l):f>m?.01>f?(l=.707106781,h=0,c=.707106781):(h=Math.sqrt(f),l=c/h,c=g/h):.01>m?(h=l=.707106781,c=0):(c= -Math.sqrt(m),l=d/c,h=g/c);this.set(l,h,c,a);return this}a=Math.sqrt((l-g)*(l-g)+(d-h)*(d-h)+(e-c)*(e-c));.001>Math.abs(a)&&(a=1);this.x=(l-g)/a;this.y=(d-h)/a;this.z=(e-c)/a;this.w=Math.acos((b+f+m-1)/2);return this},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);this.w=Math.min(this.w,a.w);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);this.w=Math.max(this.w,a.w);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));this.w=Math.max(a.w,Math.min(b.w,this.w));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));this.w=Math.max(a,Math.min(b,this.w));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);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y); -this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){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}});hb.prototype=Object.assign(Object.create(la.prototype),{constructor:hb,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"})}}); -dg.prototype=Object.assign(Object.create(hb.prototype),{constructor:dg,isWebGLMultisampleRenderTarget:!0,copy:function(a){hb.prototype.copy.call(this,a);this.samples=a.samples;return this}});var ua,da,Xg,si,qb,He,Aa;Object.assign(Q.prototype,{isMatrix4:!0,set:function(a,b,c,d,e,f,g,h,l,m,k,n,u,r,q,x){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]=u;p[7]=r;p[11]=q;p[15]=x;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 Q).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){void 0===ua&&(ua=new n);var b=this.elements,c=a.elements,d=1/ua.setFromMatrixColumn(a,0).length(),e=1/ua.setFromMatrixColumn(a,1).length();a=1/ua.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){void 0===Xg&&(Xg=new n(0,0,0),si=new n(1,1,1));return this.compose(Xg,a,si)},lookAt:function(a,b,c){void 0===qb&&(qb=new n,He=new n,Aa=new n);var d=this.elements;Aa.subVectors(a,b);0===Aa.lengthSq()&&(Aa.z=1);Aa.normalize();qb.crossVectors(c,Aa);0===qb.lengthSq()&&(1===Math.abs(c.z)? -Aa.x+=1E-4:Aa.z+=1E-4,Aa.normalize(),qb.crossVectors(c,Aa));qb.normalize();He.crossVectors(Aa,qb);d[0]=qb.x;d[4]=He.x;d[8]=Aa.x;d[1]=qb.y;d[5]=He.y;d[9]=Aa.y;d[2]=qb.z;d[6]=He.z;d[10]=Aa.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],u=c[6],r=c[10],q=c[14],x=c[3],v=c[7],y=c[11];c=c[15];var w=d[0],z=d[4],G=d[8],B=d[12],A=d[1],C=d[5],D=d[9],F=d[13],E=d[2],H=d[6],J=d[10],K=d[14],L=d[3],O=d[7],P=d[11];d=d[15];b[0]=a*w+e*A+f*E+g*L;b[4]=a*z+e*C+f*H+g*O;b[8]=a*G+e*D+f*J+g*P;b[12]=a*B+e*F+f*K+g*d;b[1]=h*w+l*A+m*E+k*L;b[5]=h*z+l*C+m*H+k*O;b[9]=h*G+l*D+m*J+k*P;b[13]=h*B+l*F+m*K+k*d;b[2]=n*w+u*A+r*E+q*L;b[6]=n*z+u*C+r*H+ -q*O;b[10]=n*G+u*D+r*J+q*P;b[14]=n*B+u*F+r*K+q*d;b[3]=x*w+v*A+y*E+c*L;b[7]=x*z+v*C+y*H+c*O;b[11]=x*G+v*D+y*J+c*P;b[15]=x*B+v*F+y*K+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){void 0===ua&&(ua=new n);for(var b=0,c=a.count;bthis.determinant()&&(e=-e);a.x=d[12];a.y=d[13];a.z=d[14];da.copy(this);a=1/e;d=1/f;var h=1/g;da.elements[0]*=a;da.elements[1]*=a;da.elements[2]*=a;da.elements[4]*=d;da.elements[5]*=d;da.elements[6]*=d;da.elements[8]*=h;da.elements[9]*=h;da.elements[10]*=h;b.setFromRotationMatrix(da);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 Hf,If;ac.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "); -ac.DefaultOrder="XYZ";Object.defineProperties(ac.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(ac.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=P.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){void 0===Hf&&(Hf=new Q); -Hf.makeRotationFromQuaternion(a);return this.setFromRotationMatrix(Hf,b,c)},setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(a){void 0===If&&(If=new ta);If.setFromEuler(this);return this.setFromQuaternion(If,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(eg.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;bthis.max.x||a.ythis.max.y|| -a.zthis.max.z?!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&&this.min.z<=a.min.z&&a.max.z<=this.max.z},getParameter:function(a,b){void 0===b&&(console.warn("THREE.Box3: .getParameter() target is now required"),b=new n);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),(a.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(a){return a.max.xthis.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},intersectsSphere:function(a){void 0===ka&&(ka=new n);this.clampPoint(a.center,ka);return ka.distanceToSquared(a.center)<=a.radius*a.radius},intersectsPlane:function(a){if(0=-a.constant},intersectsTriangle:function(a){void 0===Ub&&(Ub=new n,Cc=new n,Dc=new n,Cb=new n,Db=new n,Vb=new n,Ad=new n,Ie=new n,Je=new n);if(this.isEmpty())return!1;this.getCenter(Ad);Ie.subVectors(this.max,Ad);Ub.subVectors(a.a,Ad);Cc.subVectors(a.b,Ad);Dc.subVectors(a.c,Ad);Cb.subVectors(Cc,Ub);Db.subVectors(Dc,Cc);Vb.subVectors(Ub,Dc);a=[0, --Cb.z,Cb.y,0,-Db.z,Db.y,0,-Vb.z,Vb.y,Cb.z,0,-Cb.x,Db.z,0,-Db.x,Vb.z,0,-Vb.x,-Cb.y,Cb.x,0,-Db.y,Db.x,0,-Vb.y,Vb.x,0];if(!fg(a,Ub,Cc,Dc,Ie))return!1;a=[1,0,0,0,1,0,0,0,1];if(!fg(a,Ub,Cc,Dc,Ie))return!1;Je.crossVectors(Cb,Db);a=[Je.x,Je.y,Je.z];return fg(a,Ub,Cc,Dc,Ie)},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box3: .clampPoint() target is now required"),b=new n);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){void 0===ka&&(ka=new n);return ka.copy(a).clamp(this.min, -this.max).sub(a).length()},getBoundingSphere:function(a){void 0===ka&&(ka=new n);void 0===a&&console.error("THREE.Box3: .getBoundingSphere() target is now required");this.getCenter(a.center);a.radius=.5*this.getSize(ka).length();return a},intersect:function(a){this.min.max(a.min);this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(a){void 0===db&&(db=[new n,new n,new n,new n,new n,new n,new n, -new n]);if(this.isEmpty())return this;db[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(a);db[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(a);db[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(a);db[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(a);db[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(a);db[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(a);db[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(a);db[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(a); -this.setFromPoints(db);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 tb,Yg;Object.assign(ib.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(a,b){void 0===Yg&&(Yg=new Sa);var c=this.center;void 0!==b?c.copy(b):Yg.setFromPoints(a).getCenter(c);for(var d=b=0,e=a.length;dthis.duration&& +this.resetDuration()}function vk(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return td;case "vector":case "vector2":case "vector3":case "vector4":return ud;case "color":return Ef;case "quaternion":return Ge;case "bool":case "boolean":return Df;case "string":return Gf}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+a);}function wk(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var b=vk(a.type); +if(void 0===a.times){var c=[],d=[];xa.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 Sg(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 ab(a){this.manager=void 0!==a?a:Ia}function Ci(a){this.manager=void 0!==a?a:Ia}function Di(a){this.manager=void 0!==a?a:Ia;this._parser=null}function Tg(a){this.manager=void 0!==a?a:Ia;this._parser=null}function He(a){this.manager=void 0!==a?a:Ia}function Ug(a){this.manager=void 0!==a?a:Ia}function Hf(a){this.manager=void 0!==a?a:Ia}function H(){this.type= +"Curve";this.arcLengthDivisions=200}function Sa(a,b,c,d,e,f,g,h){H.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 vd(a,b,c,d,e,f){Sa.call(this,a,b,c,c,d,e,f);this.type="ArcCurve"}function Vg(){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 Ba(a,b,c,d){H.call(this);this.type="CatmullRomCurve3";this.points=a||[];this.closed=b||!1;this.curveType=c||"centripetal";this.tension=d||.5}function Ei(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 Ie(a,b,c,d){var e=1-a;return e*e*b+2*(1-a)*a*c+a*a*d}function Je(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 bb(a,b,c,d){H.call(this);this.type="CubicBezierCurve";this.v0=a||new y;this.v1=b||new y;this.v2=c||new y;this.v3=d||new y}function tb(a,b,c,d){H.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 Ja(a,b){H.call(this);this.type="LineCurve";this.v1=a||new y;this.v2=b||new y}function cb(a,b){H.call(this);this.type="LineCurve3";this.v1=a||new n;this.v2=b|| +new n}function db(a,b,c){H.call(this);this.type="QuadraticBezierCurve";this.v0=a||new y;this.v1=b||new y;this.v2=c||new y}function ub(a,b,c){H.call(this);this.type="QuadraticBezierCurve3";this.v0=a||new n;this.v1=b||new n;this.v2=c||new n}function eb(a){H.call(this);this.type="SplineCurve";this.points=a||[]}function Fb(){H.call(this);this.type="CurvePath";this.curves=[];this.autoClose=!1}function fb(a){Fb.call(this);this.type="Path";this.currentPoint=new y;a&&this.setFromPoints(a)}function $b(a){fb.call(this, +a);this.uuid=P.generateUUID();this.type="Shape";this.holes=[]}function T(a,b){C.call(this);this.type="Light";this.color=new K(a);this.intensity=void 0!==b?b:1;this.receiveShadow=void 0}function If(a,b,c){T.call(this,a,c);this.type="HemisphereLight";this.castShadow=void 0;this.position.copy(C.DefaultUp);this.updateMatrix();this.groundColor=new K(b)}function Ic(a){this.camera=a;this.bias=0;this.radius=1;this.mapSize=new y(512,512);this.map=null;this.matrix=new Q}function Jf(){Ic.call(this,new oa(50, +1,.5,500))}function Kf(a,b,c,d,e,f){T.call(this,a,b);this.type="SpotLight";this.position.copy(C.DefaultUp);this.updateMatrix();this.target=new C;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 Jf}function Lf(a,b,c,d){T.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 Ic(new oa(90,1,.5,500))}function Ke(a,b,c,d,e,f){ob.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 Mf(){Ic.call(this, +new Ke(-5,5,5,-5,.5,500))}function Nf(a,b){T.call(this,a,b);this.type="DirectionalLight";this.position.copy(C.DefaultUp);this.updateMatrix();this.target=new C;this.shadow=new Mf}function Of(a,b){T.call(this,a,b);this.type="AmbientLight";this.castShadow=void 0}function Pf(a,b,c,d){T.call(this,a,b);this.type="RectAreaLight";this.width=void 0!==c?c:10;this.height=void 0!==d?d:10}function Qf(a){this.manager=void 0!==a?a:Ia;this.textures={}}function Rf(){D.call(this);this.type="InstancedBufferGeometry"; +this.maxInstancedCount=void 0}function Sf(a,b,c,d){"number"===typeof c&&(d=c,c=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument."));O.call(this,a,b,c);this.meshPerAttribute=d||1}function Wg(a){this.manager=void 0!==a?a:Ia}function Xg(a){this.manager=void 0!==a?a:Ia;this.resourcePath=""}function Yg(a){"undefined"===typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported.");"undefined"===typeof fetch&& +console.warn("THREE.ImageBitmapLoader: fetch() not supported.");this.manager=void 0!==a?a:Ia;this.options=void 0}function Zg(){this.type="ShapePath";this.color=new K;this.subPaths=[];this.currentPath=null}function $g(a){this.type="Font";this.data=a}function Fi(a){this.manager=void 0!==a?a:Ia}function Le(){}function vb(a,b,c,d,e,f,g,h){a=g+a;g=Le.Handlers.get(a);null!==g?h=g.load(a):(ah.setCrossOrigin(h),h=ah.load(a));void 0!==b&&(h.repeat.fromArray(b),1!==b[0]&&(h.wrapS=1E3),1!==b[1]&&(h.wrapT=1E3)); +void 0!==c&&h.offset.fromArray(c);void 0!==d&&("repeat"===d[0]&&(h.wrapS=1E3),"mirror"===d[0]&&(h.wrapS=1002),"repeat"===d[1]&&(h.wrapT=1E3),"mirror"===d[1]&&(h.wrapT=1002));void 0!==e&&(h.anisotropy=e);b=P.generateUUID();f[b]=h;return b}function bh(a){this.manager=void 0!==a?a:Ia}function Tf(){this.coefficients=[];for(var a=0;9>a;a++)this.coefficients.push(new n)}function gb(a,b){T.call(this,void 0,b);this.sh=void 0!==a?a:new Tf}function ch(a,b,c){gb.call(this,void 0,c);a=(new K).set(a);c=(new K).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 dh(a,b){gb.call(this,void 0,b);a=(new K).set(a);this.sh.coefficients[0].set(a.r,a.g,a.b).multiplyScalar(2*Math.sqrt(Math.PI))}function Gi(){this.type="StereoCamera";this.aspect=1;this.eyeSep=.064;this.cameraL=new oa;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR= +new oa;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 eh(a){this.autoStart=void 0!==a?a:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function fh(){C.call(this);this.type="AudioListener";this.context=gh.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null;this.timeDelta=0;this._clock=new eh}function wd(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.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function hh(a){wd.call(this,a);this.panner=this.context.createPanner();this.panner.panningModel="HRTF";this.panner.connect(this.gain)}function ih(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 jh(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 Hi(a,b,c){c=c||Ca.parseTrackName(b);this._targetGroup=a;this._bindings= +a.subscribe_(b,c)}function Ca(a,b,c){this.path=b;this.parsedPath=c||Ca.parseTrackName(b);this.node=Ca.findNode(a,this.parsedPath.nodeName)||a;this.rootNode=a}function Ii(){this.uuid=P.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 Ji(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 kh(a){this._root=a;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function Uf(a,b){"string"===typeof a&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),a=b);this.value=a}function lh(a,b,c){sc.call(this, +a,b);this.meshPerAttribute=c||1}function Ki(a,b,c,d){this.ray=new jc(a,b);this.near=c||0;this.far=d||Infinity;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 Li(a,b){return a.distance-b.distance}function mh(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 z(b,3));b=new ba({fog:!1});this.cone=new aa(a,b);this.add(this.cone);this.update()}function Oi(a){var b=[];a&&a.isBone&&b.push(a);for(var c=0;ca?-1:0Te;Te++)ma[Te]=(16>Te?"0":"")+Te.toString(16);var P={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(ma[a&255]+ma[a>>8&255]+ma[a>>16&255]+ma[a>>24&255]+"-"+ma[b&255]+ma[b>>8&255]+"-"+ma[b>>16&15|64]+ma[b>>24&255]+"-"+ma[c&63|128]+ma[c>>8&255]+"-"+ma[c>>16&255]+ma[c>>24&255]+ma[d&255]+ma[d>>8&255]+ma[d>>16&255]+ma[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*P.DEG2RAD},radToDeg:function(a){return a*P.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(y.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(y.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=a[1]*b+a[4]*c+a[7];return this},min:function(a){this.x=Math.min(this.x,a.x);this.y=Math.min(this.y,a.y);return this},max:function(a){this.x=Math.max(this.x,a.x);this.y=Math.max(this.y,a.y);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));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));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);return this},ceil:function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);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); +return this},negate:function(){this.x=-this.x;this.y=-this.y;return this},dot:function(a){return this.x*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(ia, +{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],t=e[f+2];e=e[f+3];if(c!==e||h!==d||l!==k||m!==t){f=1-g;var n=h*d+l*k+m*t+c*e,q=0<=n?1:-1,p=1-n*n;p>Number.EPSILON&&(p=Math.sqrt(p),n=Math.atan2(p,n*q),f=Math.sin(f*n)/p,g=Math.sin(g*n)/p);q*=g;h=h*f+d*q;l=l*f+k*q;m=m*f+t*q;c=c*f+e*q;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(ia.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(ia.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);this._x=a.x*c;this._y=a.y*c;this._z=a.z*c;this._w=Math.cos(b);this._onChangeCallback();return this},setFromRotationMatrix:function(a){var b=a.elements,c=b[0];a=b[4];var d=b[8],e=b[1],f=b[5],g=b[9],h=b[2],l=b[6];b=b[10];var m=c+f+b;0f&&c>b?(c=2*Math.sqrt(1+c-f-b),this._w=(l-g)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+h)/c):f>b?(c=2*Math.sqrt(1+f-c-b),this._w=(d-h)/c,this._x=(a+e)/c, +this._y=.25*c,this._z=(g+l)/c):(c=2*Math.sqrt(1+b-c-f),this._w=(e-a)/c,this._x=(d+h)/c,this._y=(g+l)/c,this._z=.25*c);this._onChangeCallback();return this},setFromUnitVectors:function(a,b){var c=a.dot(b)+1;1E-6>c?(c=0,Math.abs(a.x)>Math.abs(a.z)?(this._x=-a.y,this._y=a.x,this._z=0):(this._x=0,this._y=-a.z,this._z=a.y)):(this._x=a.y*b.z-a.z*b.y,this._y=a.z*b.x-a.x*b.z,this._z=a.x*b.y-a.y*b.x);this._w=c;return this.normalize()},angleTo:function(a){return 2*Math.acos(Math.abs(P.clamp(this.dot(a),-1, +1)))},rotateTowards:function(a,b){var c=this.angleTo(a);if(0===c)return this;this.slerp(a,Math.min(1,b/c));return this},inverse:function(){return this.conjugate()},conjugate:function(){this._x*=-1;this._y*=-1;this._z*=-1;this._onChangeCallback();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)},normalize:function(){var a=this.length();0===a?(this._z=this._y=this._x=0,this._w=1):(a=1/a,this._x*=a,this._y*=a,this._z*=a,this._w*=a);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 Jc,Gd;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){void 0===Gd&&(Gd=new ia);a&&a.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");return this.applyQuaternion(Gd.setFromEuler(a))},applyAxisAngle:function(a,b){void 0===Gd&&(Gd=new ia);return this.applyQuaternion(Gd.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){void 0===Jc&&(Jc=new n);Jc.copy(this).projectOnVector(a);return this.sub(Jc)},reflect:function(a){void 0===Jc&&(Jc=new n);return this.sub(Jc.copy(a).multiplyScalar(2*this.dot(a)))},angleTo:function(a){a= +this.dot(a)/Math.sqrt(this.lengthSq()*a.lengthSq());return Math.acos(P.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 Ib;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){void 0===Ib&&(Ib=new n);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 Hd,ac={getDataURL:function(a){if("undefined"==typeof HTMLCanvasElement)return a.src;if(!(a instanceof HTMLCanvasElement)){void 0===Hd&&(Hd=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"));Hd.width=a.width;Hd.height=a.height;var b=Hd.getContext("2d");a instanceof ImageData?b.putImageData(a,0,0):b.drawImage(a,0,0,a.width,a.height);a=Hd}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(Y.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-=a;this.y-=a;this.z-=a;this.w-=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;this.w=a.w-b.w;return this},multiplyScalar:function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this},applyMatrix4:function(a){var b=this.x,c=this.y,d=this.z,e=this.w;a=a.elements;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;this.w=a[3]*b+a[7]*c+a[11]*d+a[15]*e;return this},divideScalar:function(a){return this.multiplyScalar(1/a)},setAxisAngleFromQuaternion:function(a){this.w=2*Math.acos(a.w);var b=Math.sqrt(1-a.w*a.w);1E-4>b?(this.x=1,this.z=this.y=0):(this.x=a.x/b,this.y=a.y/b,this.z=a.z/b);return this},setAxisAngleFromRotationMatrix:function(a){a=a.elements;var b=a[0];var c=a[4];var d=a[8],e=a[1],f=a[5],g=a[9];var h=a[2];var l=a[6];var m=a[10];if(.01>Math.abs(c-e)&&.01>Math.abs(d-h)&&.01>Math.abs(g-l)){if(.1>Math.abs(c+ +e)&&.1>Math.abs(d+h)&&.1>Math.abs(g+l)&&.1>Math.abs(b+f+m-3))return this.set(1,0,0,0),this;a=Math.PI;b=(b+1)/2;f=(f+1)/2;m=(m+1)/2;c=(c+e)/4;d=(d+h)/4;g=(g+l)/4;b>f&&b>m?.01>b?(l=0,c=h=.707106781):(l=Math.sqrt(b),h=c/l,c=d/l):f>m?.01>f?(l=.707106781,h=0,c=.707106781):(h=Math.sqrt(f),l=c/h,c=g/h):.01>m?(h=l=.707106781,c=0):(c=Math.sqrt(m),l=d/c,h=g/c);this.set(l,h,c,a);return this}a=Math.sqrt((l-g)*(l-g)+(d-h)*(d-h)+(e-c)*(e-c));.001>Math.abs(a)&&(a=1);this.x=(l-g)/a;this.y=(d-h)/a;this.z=(e-c)/a; +this.w=Math.acos((b+f+m-1)/2);return this},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);this.w=Math.min(this.w,a.w);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);this.w=Math.max(this.w,a.w);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));this.w=Math.max(a.w,Math.min(b.w, +this.w));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));this.w=Math.max(a,Math.min(b,this.w));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);this.w=Math.floor(this.w);return this},ceil:function(){this.x=Math.ceil(this.x); +this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);this.w=Math.ceil(this.w);return this},round:function(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);this.w=Math.round(this.w);return this},roundToZero:function(){this.x=0>this.x?Math.ceil(this.x):Math.floor(this.x);this.y=0>this.y?Math.ceil(this.y):Math.floor(this.y);this.z=0>this.z?Math.ceil(this.z):Math.floor(this.z);this.w=0>this.w?Math.ceil(this.w):Math.floor(this.w);return this},negate:function(){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}});mb.prototype=Object.assign(Object.create(Da.prototype),{constructor:mb,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"})}});xg.prototype=Object.assign(Object.create(mb.prototype),{constructor:xg,isWebGLMultisampleRenderTarget:!0,copy:function(a){mb.prototype.copy.call(this, +a);this.samples=a.samples;return this}});var qa,U,rh,Ri,wb,Ue,ka;Object.assign(Q.prototype,{isMatrix4:!0,set:function(a,b,c,d,e,f,g,h,l,m,k,n,u,q,p,v){var r=this.elements;r[0]=a;r[4]=b;r[8]=c;r[12]=d;r[1]=e;r[5]=f;r[9]=g;r[13]=h;r[2]=l;r[6]=m;r[10]=k;r[14]=n;r[3]=u;r[7]=q;r[11]=p;r[15]=v;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 Q).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){void 0===qa&&(qa=new n);var b=this.elements,c=a.elements,d=1/qa.setFromMatrixColumn(a,0).length(),e=1/qa.setFromMatrixColumn(a,1).length();a=1/qa.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){void 0=== +rh&&(rh=new n(0,0,0),Ri=new n(1,1,1));return this.compose(rh,a,Ri)},lookAt:function(a,b,c){void 0===wb&&(wb=new n,Ue=new n,ka=new n);var d=this.elements;ka.subVectors(a,b);0===ka.lengthSq()&&(ka.z=1);ka.normalize();wb.crossVectors(c,ka);0===wb.lengthSq()&&(1===Math.abs(c.z)?ka.x+=1E-4:ka.z+=1E-4,ka.normalize(),wb.crossVectors(c,ka));wb.normalize();Ue.crossVectors(ka,wb);d[0]=wb.x;d[4]=Ue.x;d[8]=ka.x;d[1]=wb.y;d[5]=Ue.y;d[9]=ka.y;d[2]=wb.z;d[6]=Ue.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],u=c[6],q=c[10],p=c[14],v=c[3],w=c[7],B=c[11];c=c[15];var x=d[0],y=d[4],G=d[8],A=d[12],z=d[1],C=d[5],D=d[9],F=d[13],E=d[2], +H=d[6],J=d[10],K=d[14],L=d[3],O=d[7],P=d[11];d=d[15];b[0]=a*x+e*z+f*E+g*L;b[4]=a*y+e*C+f*H+g*O;b[8]=a*G+e*D+f*J+g*P;b[12]=a*A+e*F+f*K+g*d;b[1]=h*x+l*z+m*E+k*L;b[5]=h*y+l*C+m*H+k*O;b[9]=h*G+l*D+m*J+k*P;b[13]=h*A+l*F+m*K+k*d;b[2]=n*x+u*z+q*E+p*L;b[6]=n*y+u*C+q*H+p*O;b[10]=n*G+u*D+q*J+p*P;b[14]=n*A+u*F+q*K+p*d;b[3]=v*x+w*z+B*E+c*L;b[7]=v*y+w*C+B*H+c*O;b[11]=v*G+w*D+B*J+c*P;b[15]=v*A+w*F+B*K+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){void 0===qa&&(qa=new n);for(var b=0,c=a.count;bthis.determinant()&&(e=-e);a.x=d[12];a.y=d[13];a.z=d[14];U.copy(this);a=1/e;d=1/f;var h=1/g;U.elements[0]*=a;U.elements[1]*=a;U.elements[2]*=a;U.elements[4]*=d;U.elements[5]*=d;U.elements[6]*=d;U.elements[8]*=h;U.elements[9]*= +h;U.elements[10]*=h;b.setFromRotationMatrix(U);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 Yf,Zf;ic.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");ic.DefaultOrder="XYZ";Object.defineProperties(ic.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(ic.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=P.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){void 0===Yf&&(Yf=new Q);Yf.makeRotationFromQuaternion(a);return this.setFromRotationMatrix(Yf,b,c)},setFromVector3:function(a,b){return this.set(a.x,a.y,a.z,b||this._order)},reorder:function(a){void 0===Zf&&(Zf=new ia);Zf.setFromEuler(this);return this.setFromQuaternion(Zf,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(yg.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;bthis.max.x||a.ythis.max.y||a.zthis.max.z?!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&&this.min.z<=a.min.z&&a.max.z<=this.max.z},getParameter:function(a,b){void 0===b&&(console.warn("THREE.Box3: .getParameter() target is now required"),b=new n);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),(a.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(a){return a.max.x< +this.min.x||a.min.x>this.max.x||a.max.ythis.max.y||a.max.zthis.max.z?!1:!0},intersectsSphere:function(a){void 0===la&&(la=new n);this.clampPoint(a.center,la);return la.distanceToSquared(a.center)<=a.radius*a.radius},intersectsPlane:function(a){if(0=-a.constant},intersectsTriangle:function(a){void 0===bc&&(bc=new n,Kc=new n,Lc=new n,Kb=new n,Lb=new n,cc=new n,Ld=new n,We=new n,Xe=new n);if(this.isEmpty())return!1;this.getCenter(Ld);We.subVectors(this.max,Ld);bc.subVectors(a.a,Ld);Kc.subVectors(a.b,Ld);Lc.subVectors(a.c,Ld);Kb.subVectors(Kc,bc);Lb.subVectors(Lc,Kc);cc.subVectors(bc, +Lc);a=[0,-Kb.z,Kb.y,0,-Lb.z,Lb.y,0,-cc.z,cc.y,Kb.z,0,-Kb.x,Lb.z,0,-Lb.x,cc.z,0,-cc.x,-Kb.y,Kb.x,0,-Lb.y,Lb.x,0,-cc.y,cc.x,0];if(!zg(a,bc,Kc,Lc,We))return!1;a=[1,0,0,0,1,0,0,0,1];if(!zg(a,bc,Kc,Lc,We))return!1;Xe.crossVectors(Kb,Lb);a=[Xe.x,Xe.y,Xe.z];return zg(a,bc,Kc,Lc,We)},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box3: .clampPoint() target is now required"),b=new n);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){void 0===la&&(la=new n);return la.copy(a).clamp(this.min, +this.max).sub(a).length()},getBoundingSphere:function(a){void 0===la&&(la=new n);void 0===a&&console.error("THREE.Box3: .getBoundingSphere() target is now required");this.getCenter(a.center);a.radius=.5*this.getSize(la).length();return a},intersect:function(a){this.min.max(a.min);this.max.min(a.max);this.isEmpty()&&this.makeEmpty();return this},union:function(a){this.min.min(a.min);this.max.max(a.max);return this},applyMatrix4:function(a){void 0===ib&&(ib=[new n,new n,new n,new n,new n,new n,new n, +new n]);if(this.isEmpty())return this;ib[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(a);ib[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(a);ib[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(a);ib[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(a);ib[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(a);ib[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(a);ib[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(a);ib[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(a); +this.setFromPoints(ib);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 Ab,uh;Object.assign(nb.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(a,b){void 0===uh&&(uh=new Wa);var c=this.center;void 0!==b?c.copy(b):uh.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 Sa);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 sa,Ke,Le,eb,Jf,Me,Kf;Object.assign(bc.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){void 0===sa&&(sa=new n);this.origin.copy(this.at(a,sa));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){void 0===sa&&(sa=new n);var b=sa.subVectors(a,this.origin).dot(this.direction);if(0>b)return this.origin.distanceToSquared(a);sa.copy(this.direction).multiplyScalar(b).add(this.origin);return sa.distanceToSquared(a)},distanceSqToSegment:function(a,b, -c,d){void 0===Ke&&(Ke=new n,Le=new n,eb=new n);Ke.copy(a).add(b).multiplyScalar(.5);Le.copy(b).sub(a).normalize();eb.copy(this.origin).sub(Ke);var e=.5*a.distanceTo(b),f=-this.direction.dot(Le),g=eb.dot(this.direction),h=-eb.dot(Le),l=eb.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=0this.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 Wa);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 ya,Ye,Ze,jb,ag,$e,bg;Object.assign(jc.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){void 0===ya&&(ya=new n);this.origin.copy(this.at(a,ya));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){void 0===ya&&(ya=new n);var b=ya.subVectors(a,this.origin).dot(this.direction);if(0>b)return this.origin.distanceToSquared(a);ya.copy(this.direction).multiplyScalar(b).add(this.origin);return ya.distanceToSquared(a)},distanceSqToSegment:function(a,b, +c,d){void 0===Ye&&(Ye=new n,Ze=new n,jb=new n);Ye.copy(a).add(b).multiplyScalar(.5);Ze.copy(b).sub(a).normalize();jb.copy(this.origin).sub(Ye);var e=.5*a.distanceTo(b),f=-this.direction.dot(Ze),g=jb.dot(this.direction),h=-jb.dot(Ze),l=jb.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)+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){void 0===sa&&(sa=new n);return null!==this.intersectBox(a,sa)},intersectTriangle:function(a,b,c,d,e){void 0===eb&&(eb=new n,Jf=new n,Me=new n,Kf=new n);Jf.subVectors(b,a);Me.subVectors(c,a);Kf.crossVectors(Jf,Me);b=this.direction.dot(Kf);if(0b)d=-1,b=-b;else return null;eb.subVectors(this.origin,a);a=d*this.direction.dot(Me.crossVectors(eb, -Me));if(0>a)return null;c=d*this.direction.dot(Jf.cross(eb));if(0>c||a+c>b)return null;a=-d*eb.dot(Kf);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 Ba,Ia,Ne,Pa,Wb,Ec,Zg,Lf,Mf,Nf;Object.assign(U,{getNormal:function(a,b,c,d){void 0===Ba&&(Ba=new n);void 0===d&&(console.warn("THREE.Triangle: .getNormal() target is now required"), -d=new n);d.subVectors(c,b);Ba.subVectors(a,b);d.cross(Ba);a=d.lengthSq();return 0=Pa.x+Pa.y},getUV:function(a,b,c,d,e,f,g,h){void 0===Pa&&(Pa=new n);this.getBarycoord(a,b,c,d,Pa);h.set(0,0);h.addScaledVector(e,Pa.x);h.addScaledVector(f,Pa.y);h.addScaledVector(g,Pa.z);return h},isFrontFacing:function(a,b,c,d){void 0===Ia&&(Ba=new n,Ia=new n);Ba.subVectors(c,b);Ia.subVectors(a,b);return 0>Ba.cross(Ia).dot(d)?!0:!1}});Object.assign(U.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(){void 0===Ia&&(Ba=new n,Ia=new n);Ba.subVectors(this.c,this.b);Ia.subVectors(this.a,this.b);return.5*Ba.cross(Ia).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 U.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 U.getBarycoord(a,this.a,this.b,this.c,b)},getUV:function(a,b,c,d,e){return U.getUV(a,this.a, -this.b,this.c,b,c,d,e)},containsPoint:function(a){return U.containsPoint(a,this.a,this.b,this.c)},isFrontFacing:function(a){return U.isFrontFacing(this.a,this.b,this.c,a)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(a,b){void 0===Wb&&(Wb=new n,Ec=new n,Zg=new n,Lf=new n,Mf=new n,Nf=new n);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;Wb.subVectors(d,c);Ec.subVectors(e, -c);Lf.subVectors(a,c);var f=Wb.dot(Lf),g=Ec.dot(Lf);if(0>=f&&0>=g)return b.copy(c);Mf.subVectors(a,d);var h=Wb.dot(Mf),l=Ec.dot(Mf);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(Wb,d);Nf.subVectors(a,e);a=Wb.dot(Nf);var k=Ec.dot(Nf);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(Ec,m);g=h*k-a*l;if(0>=g&&0<=l-h&&0<=a-k)return Zg.subVectors(e,d),m=(l-h)/(l-h+(a-k)),b.copy(d).addScaledVector(Zg, -m);e=1/(g+f+m);d=f*e;m*=e;return b.copy(c).addScaledVector(Wb,d).addScaledVector(Ec,m)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});var Wj={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, +f.z)*e);if(g>a||h>c)return null;if(h>g||g!==g)g=h;if(ac?null:this.at(0<=g?g:c,b)},intersectsBox:function(a){void 0===ya&&(ya=new n);return null!==this.intersectBox(a,ya)},intersectTriangle:function(a,b,c,d,e){void 0===jb&&(jb=new n,ag=new n,$e=new n,bg=new n);ag.subVectors(b,a);$e.subVectors(c,a);bg.crossVectors(ag,$e);b=this.direction.dot(bg);if(0b)d=-1,b=-b;else return null;jb.subVectors(this.origin,a);a=d*this.direction.dot($e.crossVectors(jb, +$e));if(0>a)return null;c=d*this.direction.dot(ag.cross(jb));if(0>c||a+c>b)return null;a=-d*jb.dot(bg);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 na,La,af,Ta,dc,Mc,vh,cg,dg,eg;Object.assign(ea,{getNormal:function(a,b,c,d){void 0===na&&(na=new n);void 0===d&&(console.warn("THREE.Triangle: .getNormal() target is now required"), +d=new n);d.subVectors(c,b);na.subVectors(a,b);d.cross(na);a=d.lengthSq();return 0=Ta.x+Ta.y},getUV:function(a,b,c,d,e,f,g,h){void 0===Ta&&(Ta=new n);this.getBarycoord(a,b,c,d,Ta);h.set(0,0);h.addScaledVector(e,Ta.x);h.addScaledVector(f,Ta.y);h.addScaledVector(g,Ta.z);return h},isFrontFacing:function(a,b,c,d){void 0===La&&(na=new n,La=new n);na.subVectors(c,b);La.subVectors(a,b);return 0>na.cross(La).dot(d)?!0:!1}});Object.assign(ea.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(){void 0===La&&(na=new n,La=new n);na.subVectors(this.c,this.b);La.subVectors(this.a,this.b);return.5*na.cross(La).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 ea.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 ea.getBarycoord(a,this.a,this.b,this.c,b)},getUV:function(a,b,c,d,e){return ea.getUV(a, +this.a,this.b,this.c,b,c,d,e)},containsPoint:function(a){return ea.containsPoint(a,this.a,this.b,this.c)},isFrontFacing:function(a){return ea.isFrontFacing(this.a,this.b,this.c,a)},intersectsBox:function(a){return a.intersectsTriangle(this)},closestPointToPoint:function(a,b){void 0===dc&&(dc=new n,Mc=new n,vh=new n,cg=new n,dg=new n,eg=new n);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;dc.subVectors(d,c);Mc.subVectors(e, +c);cg.subVectors(a,c);var f=dc.dot(cg),g=Mc.dot(cg);if(0>=f&&0>=g)return b.copy(c);dg.subVectors(a,d);var h=dc.dot(dg),l=Mc.dot(dg);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(dc,d);eg.subVectors(a,e);a=dc.dot(eg);var k=Mc.dot(eg);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(Mc,m);g=h*k-a*l;if(0>=g&&0<=l-h&&0<=a-k)return vh.subVectors(e,d),m=(l-h)/(l-h+(a-k)),b.copy(d).addScaledVector(vh, +m);e=1/(g+f+m);d=f*e;m*=e;return b.copy(c).addScaledVector(dc,d).addScaledVector(Mc,m)},equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});var xk={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},Ja={h:0,s:0,l:0},Of={h:0,s:0,l:0};Object.assign(K.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=P.euclideanModulo(a,1);b=P.clamp(b,0,1);c=P.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=gg(c,b,a+1/3),this.g=gg(c,b,a),this.b=gg(c,b,a-1/3));return this},setStyle:function(a){function b(b){void 0!== +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},Ma={h:0,s:0,l:0},fg={h:0,s:0,l:0};Object.assign(K.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=P.euclideanModulo(a,1);b=P.clamp(b,0,1);c=P.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=Ag(c,b,a+1/3),this.g=Ag(c,b,a),this.b=Ag(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+(c=h?l/(e+f):l/(2-e-f);switch(e){case b:g=(c-d)/l+(cg;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 S(new Kb(5,5,5),d);c.add(b);d=new Pc(1,10,1);d.renderTarget=this;d.renderTarget.texture.name="CubeCameraTexture";d.update(a,c);b.geometry.dispose();b.material.dispose();return this};ic.prototype=Object.create(Y.prototype);ic.prototype.constructor=ic;ic.prototype.isDataTexture=!0;var Yb,ti,ah;Object.assign(kb.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){void 0===Yb&&(Yb=new n,ti=new n);b=Yb.subVectors(c,b).cross(ti.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(); +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}});Xc.prototype=Object.create(C.prototype);Xc.prototype.constructor=Xc;Tb.prototype=Object.create(mb.prototype);Tb.prototype.constructor=Tb;Tb.prototype.isWebGLRenderTargetCube=!0;Tb.prototype.fromEquirectangularTexture= +function(a,b){this.texture.type=b.type;this.texture.format=b.format;this.texture.encoding=b.encoding;var c=new Vd,d=new Aa({type:"CubemapFromEquirect",uniforms:pc({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 va(new Sb(5,5,5),d);c.add(b);d=new Xc(1,10,1);d.renderTarget=this;d.renderTarget.texture.name="CubeCameraTexture";d.update(a,c);b.geometry.dispose();b.material.dispose();return this};qc.prototype=Object.create(Y.prototype);qc.prototype.constructor=qc;qc.prototype.isDataTexture=!0;var fc,Si,xh;Object.assign(pb.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){void 0===fc&&(fc=new n,Si=new n);b=fc.subVectors(c,b).cross(Si.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=== -Yb&&(Yb=new n);void 0===b&&(console.warn("THREE.Plane: .intersectLine() target is now required"),b=new n);var c=a.delta(Yb),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],m=c[7],k=c[8],n=c[9],u=c[10],r=c[11],q=c[12],x=c[13],v=c[14];c=c[15];b[0].setComponents(f-a,m-g,r-k,c-q).normalize();b[1].setComponents(f+a,m+g,r+k,c+q).normalize();b[2].setComponents(f+d,m+h,r+n,c+x).normalize();b[3].setComponents(f-d,m-h,r-n,c-x).normalize();b[4].setComponents(f-e,m-l,r-u,c-v).normalize();b[5].setComponents(f+e,m+l,r+u,c+v).normalize();return this},intersectsObject:function(a){void 0===rb&&(rb=new ib);var b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere(); -rb.copy(b.boundingSphere).applyMatrix4(a.matrixWorld);return this.intersectsSphere(rb)},intersectsSprite:function(a){void 0===rb&&(rb=new ib);rb.center.set(0,0,0);rb.radius=.7071067811865476;rb.applyMatrix4(a.matrixWorld);return this.intersectsSphere(rb)},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];Bd.x=0d.distanceToPoint(Bd))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 L={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", +fc&&(fc=new n);void 0===b&&(console.warn("THREE.Plane: .intersectLine() target is now required"),b=new n);var c=a.delta(fc),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],m=c[7],k=c[8],n=c[9],u=c[10],q=c[11],p=c[12],v=c[13],w=c[14];c=c[15];b[0].setComponents(f-a,m-g,q-k,c-p).normalize();b[1].setComponents(f+a,m+g,q+k,c+p).normalize();b[2].setComponents(f+d,m+h,q+n,c+v).normalize();b[3].setComponents(f-d,m-h,q-n,c-v).normalize();b[4].setComponents(f-e,m-l,q-u,c-w).normalize();b[5].setComponents(f+e,m+l,q+u,c+w).normalize();return this},intersectsObject:function(a){void 0===yb&&(yb=new nb);var b=a.geometry;null===b.boundingSphere&&b.computeBoundingSphere(); +yb.copy(b.boundingSphere).applyMatrix4(a.matrixWorld);return this.intersectsSphere(yb)},intersectsSprite:function(a){void 0===yb&&(yb=new nb);yb.center.set(0,0,0);yb.radius=.7071067811865476;yb.applyMatrix4(a.matrixWorld);return this.intersectsSphere(yb)},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];Od.x=0d.distanceToPoint(Od))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 L={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( PHYSICAL )\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}", 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", @@ -603,7 +604,7 @@ normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\t normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#endif\n#endif\n#if ( defined ( USE_NORMALMAP ) && !defined ( OBJECTSPACE_NORMALMAP )) || defined ( USE_CLEARCOAT_NORMALMAP )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec2 normalScale, in sampler2D normalMap ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy *= normalScale;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvec3 NfromST = cross( S, T );\n\t\t\tif( dot( NfromST, N ) > 0.0 ) {\n\t\t\t\tS *= -1.0;\n\t\t\t\tT *= -1.0;\n\t\t\t}\n\t\t#else\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif", clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT_NORMALMAP\n vec3 clearCoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 vTBN = mat3( tangent, bitangent, clearCoatNormal );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = clearCoatNormalScale * mapN.xy;\n\t\tclearCoatNormal = normalize( vTBN * mapN );\n\t#else\n\t\tclearCoatNormal = perturbNormal2Arb( - vViewPosition, clearCoatNormal, clearCoatNormalScale, clearCoatNormalMap );\n\t#endif\n#endif", clearcoat_normalmap_pars_fragment:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearCoatNormalMap;\n\tuniform vec2 clearCoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}", -premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif", +premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif", roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = ( floor( uv * size - 0.5 ) + 0.5 ) * texelSize;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif", shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif", shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif", @@ -611,9 +612,8 @@ shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifd skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif", skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif", specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}", -uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif", -uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif", -uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}", +uv_pars_fragment:"#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif", +worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}", cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}", depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}", depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}", @@ -639,236 +639,235 @@ 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}"}, -J={common:{diffuse:{value:new K(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new va},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 z(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 K(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{}, +J={common:{diffuse:{value:new K(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 y(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 K(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 K(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new va}},sprite:{diffuse:{value:new K(15658734)},opacity:{value:1},center:{value:new z(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new va}}}, -lb={basic:{uniforms:Ca([J.common,J.specularmap,J.envmap,J.aomap,J.lightmap,J.fog]),vertexShader:L.meshbasic_vert,fragmentShader:L.meshbasic_frag},lambert:{uniforms:Ca([J.common,J.specularmap,J.envmap,J.aomap,J.lightmap,J.emissivemap,J.fog,J.lights,{emissive:{value:new K(0)}}]),vertexShader:L.meshlambert_vert,fragmentShader:L.meshlambert_frag},phong:{uniforms:Ca([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 K(0)}, -specular:{value:new K(1118481)},shininess:{value:30}}]),vertexShader:L.meshphong_vert,fragmentShader:L.meshphong_frag},standard:{uniforms:Ca([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 K(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:L.meshphysical_vert,fragmentShader:L.meshphysical_frag},matcap:{uniforms:Ca([J.common,J.bumpmap,J.normalmap,J.displacementmap, -J.fog,{matcap:{value:null}}]),vertexShader:L.meshmatcap_vert,fragmentShader:L.meshmatcap_frag},points:{uniforms:Ca([J.points,J.fog]),vertexShader:L.points_vert,fragmentShader:L.points_frag},dashed:{uniforms:Ca([J.common,J.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:L.linedashed_vert,fragmentShader:L.linedashed_frag},depth:{uniforms:Ca([J.common,J.displacementmap]),vertexShader:L.depth_vert,fragmentShader:L.depth_frag},normal:{uniforms:Ca([J.common,J.bumpmap,J.normalmap, -J.displacementmap,{opacity:{value:1}}]),vertexShader:L.normal_vert,fragmentShader:L.normal_frag},sprite:{uniforms:Ca([J.sprite,J.fog]),vertexShader:L.sprite_vert,fragmentShader:L.sprite_frag},background:{uniforms:{uvTransform:{value:new va},t2D:{value:null}},vertexShader:L.background_vert,fragmentShader:L.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:L.cube_vert,fragmentShader:L.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:L.equirect_vert, -fragmentShader:L.equirect_frag},distanceRGBA:{uniforms:Ca([J.common,J.displacementmap,{referencePosition:{value:new n},nearDistance:{value:1},farDistance:{value:1E3}}]),vertexShader:L.distanceRGBA_vert,fragmentShader:L.distanceRGBA_frag},shadow:{uniforms:Ca([J.lights,J.fog,{color:{value:new K(0)},opacity:{value:1}}]),vertexShader:L.shadow_vert,fragmentShader:L.shadow_frag}};lb.physical={uniforms:Ca([lb.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0},clearCoatNormalScale:{value:new z(1, -1)},clearCoatNormalMap:{value:null}}]),vertexShader:L.meshphysical_vert,fragmentShader:L.meshphysical_frag};Pd.prototype=Object.create(F.prototype);Pd.prototype.constructor=Pd;jc.prototype=Object.create(D.prototype);jc.prototype.constructor=jc;vb.prototype=Object.create(Y.prototype);vb.prototype.constructor=vb;vb.prototype.isCubeTexture=!0;Object.defineProperty(vb.prototype,"images",{get:function(){return this.image},set:function(a){this.image=a}});Qc.prototype=Object.create(Y.prototype);Qc.prototype.constructor= -Qc;Qc.prototype.isDataTexture2DArray=!0;Rc.prototype=Object.create(Y.prototype);Rc.prototype.constructor=Rc;Rc.prototype.isDataTexture3D=!0;var Ch=new Y,$i=new Qc,bj=new Rc,Dh=new vb,wh=[],yh=[],Bh=new Float32Array(16),Ah=new Float32Array(9),zh=new Float32Array(4);Eh.prototype.updateCache=function(a){var b=this.cache;a instanceof Float32Array&&b.length!==a.length&&(this.cache=new Float32Array(a.length));Ma(b,a)};Fh.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 og=/([\w\d_]+)(\])?(\[|\.)?/g;Mb.prototype.setValue=function(a,b,c,d){b=this.map[b];void 0!==b&&b.setValue(a,c,d)};Mb.prototype.setOptional=function(a,b,c){b=b[c];void 0!==b&&this.setValue(a,c,b)};Mb.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)}};Mb.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 Cj=0,Lj=0;Nb.prototype=Object.create(R.prototype); -Nb.prototype.constructor=Nb;Nb.prototype.isMeshDepthMaterial=!0;Nb.prototype.copy=function(a){R.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};Ob.prototype=Object.create(R.prototype); -Ob.prototype.constructor=Ob;Ob.prototype.isMeshDistanceMaterial=!0;Ob.prototype.copy=function(a){R.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};Tc.prototype=Object.assign(Object.create(C.prototype), -{constructor:Tc,isGroup:!0});Sd.prototype=Object.assign(Object.create(na.prototype),{constructor:Sd,isArrayCamera:!0});var Sh=new n,Th=new n;Object.assign(rg.prototype,la.prototype);Object.assign(Uh.prototype,la.prototype);Object.assign(ef.prototype,{isFogExp2:!0,clone:function(){return new ef(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}});Object.assign(ff.prototype,{isFog:!0,clone:function(){return new ff(this.color,this.near, -this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}});Object.defineProperty(kc.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(kc.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:Cd.clone(),uv:U.getUV(Cd,Oe,Dd,Pe,bh,Qf, -Rf,new z),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 Hc,Sf;Vd.prototype=Object.assign(Object.create(C.prototype),{constructor:Vd,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(;ca.far||b.push({distance:e,point:Pd.clone(),uv:ea.getUV(Pd,ef,Qd,ff,yh,hg, +ig,new y),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 Pc,jg;he.prototype=Object.assign(Object.create(C.prototype),{constructor:he,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),u=a.ray.origin.distanceTo(h),ua.far||b.push({distance:u,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}}else for(d=0,t=k.length/3-1;dc||(h.applyMatrix4(this.matrixWorld),u=a.ray.origin.distanceTo(h),ua.far||b.push({distance:u, -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),u=a.ray.origin.distanceTo(h),ua.far||b.push({distance:u,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 Re,Ed; -aa.prototype=Object.assign(Object.create(xa.prototype),{constructor:aa,isLineSegments:!0,computeLineDistances:function(){void 0===Ed&&(Re=new n,Ed=new n);var a=this.geometry;if(a.isBufferGeometry)if(null===a.index){for(var b=a.attributes.position,c=[],d=0,e=b.count;da.far||b.push({distance:c,distanceToRay:Math.sqrt(g),point:l.clone(),index:e,face:null,object:d}))}void 0===Jc&&(gh=new Q,Uf=new bc,Jc=new ib);var d=this,e=this.geometry,f=this.matrixWorld, -g=a.params.Points.threshold;null===e.boundingSphere&&e.computeBoundingSphere();Jc.copy(e.boundingSphere);Jc.applyMatrix4(f);Jc.radius+=g;if(!1!==a.ray.intersectsSphere(Jc)){gh.getInverse(f);Uf.copy(a.ray).applyMatrix4(gh);g/=(this.scale.x+this.scale.y+this.scale.z)/3;var h=g*g;g=new n;var l=new n;if(e.isBufferGeometry){var m=e.index;e=e.attributes.position.array;if(null!==m){var k=m.array;m=0;for(var t=k.length;mc||(h.applyMatrix4(this.matrixWorld),u=a.ray.origin.distanceTo(h),ua.far||b.push({distance:u,point:e.clone().applyMatrix4(this.matrixWorld),index:d,face:null,faceIndex:null,object:this}))}}else for(d=0,t=k.length/3-1;dc||(h.applyMatrix4(this.matrixWorld),u=a.ray.origin.distanceTo(h),ua.far||b.push({distance:u, +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),u=a.ray.origin.distanceTo(h),ua.far||b.push({distance:u,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 hf,Rd; +aa.prototype=Object.assign(Object.create(pa.prototype),{constructor:aa,isLineSegments:!0,computeLineDistances:function(){void 0===Rd&&(hf=new n,Rd=new n);var a=this.geometry;if(a.isBufferGeometry)if(null===a.index){for(var b=a.attributes.position,c=[],d=0,e=b.count;da.far||b.push({distance:c,distanceToRay:Math.sqrt(g),point:l.clone(),index:e,face:null,object:d}))}void 0===Rc&&(Dh=new Q,lg=new jc,Rc=new nb);var d=this,e=this.geometry,f=this.matrixWorld, +g=a.params.Points.threshold;null===e.boundingSphere&&e.computeBoundingSphere();Rc.copy(e.boundingSphere);Rc.applyMatrix4(f);Rc.radius+=g;if(!1!==a.ray.intersectsSphere(Rc)){Dh.getInverse(f);lg.copy(a.ray).applyMatrix4(Dh);g/=(this.scale.x+this.scale.y+this.scale.z)/3;var h=g*g;g=new n;var l=new n;if(e.isBufferGeometry){var m=e.index;e=e.attributes.position.array;if(null!==m){var k=m.array;m=0;for(var t=k.length;m=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});Xc.prototype=Object.create(Y.prototype);Xc.prototype.constructor=Xc;Xc.prototype.isCompressedTexture=!0;Xd.prototype=Object.create(Y.prototype);Xd.prototype.constructor=Xd;Xd.prototype.isCanvasTexture=!0;Yd.prototype=Object.create(Y.prototype); -Yd.prototype.constructor=Yd;Yd.prototype.isDepthTexture=!0;Yc.prototype=Object.create(D.prototype);Yc.prototype.constructor=Yc;Zd.prototype=Object.create(F.prototype);Zd.prototype.constructor=Zd;Zc.prototype=Object.create(D.prototype);Zc.prototype.constructor=Zc;$d.prototype=Object.create(F.prototype);$d.prototype.constructor=$d;ya.prototype=Object.create(D.prototype);ya.prototype.constructor=ya;ae.prototype=Object.create(F.prototype);ae.prototype.constructor=ae;$c.prototype=Object.create(ya.prototype); -$c.prototype.constructor=$c;be.prototype=Object.create(F.prototype);be.prototype.constructor=be;mc.prototype=Object.create(ya.prototype);mc.prototype.constructor=mc;ce.prototype=Object.create(F.prototype);ce.prototype.constructor=ce;ad.prototype=Object.create(ya.prototype);ad.prototype.constructor=ad;de.prototype=Object.create(F.prototype);de.prototype.constructor=de;bd.prototype=Object.create(ya.prototype);bd.prototype.constructor=bd;ee.prototype=Object.create(F.prototype);ee.prototype.constructor= -ee;nc.prototype=Object.create(D.prototype);nc.prototype.constructor=nc;nc.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};fe.prototype=Object.create(F.prototype);fe.prototype.constructor=fe;cd.prototype=Object.create(D.prototype);cd.prototype.constructor=cd;ge.prototype=Object.create(F.prototype);ge.prototype.constructor=ge;dd.prototype=Object.create(D.prototype);dd.prototype.constructor=dd;var Yj={triangulate:function(a,b,c){c=c||2;var d= -b&&b.length,e=d?b[0]*c:a.length,f=Wh(a,0,e,c,!0),g=[];if(!f||f.next===f.prev)return g;var h;if(d){var l=c;d=[];var m;var k=0;for(m=b.length;k80*c){var r=h=a[0];var q=d=a[1];for(l=c;lh&&(h=k),b>d&&(d=b);h=Math.max(h-r,d-q);h=0!==h?1/h: -0}je(f,g,c,r,q,h);return g}},wb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;ewb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];$h(a);ai(c,a);var f=a.length;b.forEach($h);for(a=0;aMath.abs(g-l)?[new z(a,1-c),new z(h,1-d),new z(m,1-e),new z(n,1-b)]:[new z(g,1-c),new z(l,1-d),new z(k,1-e),new z(u,1-b)]}};le.prototype=Object.create(F.prototype);le.prototype.constructor=le;fd.prototype=Object.create(mb.prototype);fd.prototype.constructor=fd;me.prototype=Object.create(F.prototype);me.prototype.constructor=me;Rb.prototype=Object.create(D.prototype);Rb.prototype.constructor= -Rb;ne.prototype=Object.create(F.prototype);ne.prototype.constructor=ne;gd.prototype=Object.create(D.prototype);gd.prototype.constructor=gd;oe.prototype=Object.create(F.prototype);oe.prototype.constructor=oe;hd.prototype=Object.create(D.prototype);hd.prototype.constructor=hd;qc.prototype=Object.create(F.prototype);qc.prototype.constructor=qc;qc.prototype.toJSON=function(){var a=F.prototype.toJSON.call(this);return ci(this.parameters.shapes,a)};rc.prototype=Object.create(D.prototype);rc.prototype.constructor= -rc;rc.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);return ci(this.parameters.shapes,a)};id.prototype=Object.create(D.prototype);id.prototype.constructor=id;sc.prototype=Object.create(F.prototype);sc.prototype.constructor=sc;xb.prototype=Object.create(D.prototype);xb.prototype.constructor=xb;pe.prototype=Object.create(sc.prototype);pe.prototype.constructor=pe;qe.prototype=Object.create(xb.prototype);qe.prototype.constructor=qe;re.prototype=Object.create(F.prototype);re.prototype.constructor= -re;jd.prototype=Object.create(D.prototype);jd.prototype.constructor=jd;var Da=Object.freeze({WireframeGeometry:Yc,ParametricGeometry:Zd,ParametricBufferGeometry:Zc,TetrahedronGeometry:ae,TetrahedronBufferGeometry:$c,OctahedronGeometry:be,OctahedronBufferGeometry:mc,IcosahedronGeometry:ce,IcosahedronBufferGeometry:ad,DodecahedronGeometry:de,DodecahedronBufferGeometry:bd,PolyhedronGeometry:$d,PolyhedronBufferGeometry:ya,TubeGeometry:ee,TubeBufferGeometry:nc,TorusKnotGeometry:fe,TorusKnotBufferGeometry:cd, -TorusGeometry:ge,TorusBufferGeometry:dd,TextGeometry:le,TextBufferGeometry:fd,SphereGeometry:me,SphereBufferGeometry:Rb,RingGeometry:ne,RingBufferGeometry:gd,PlaneGeometry:Pd,PlaneBufferGeometry:jc,LatheGeometry:oe,LatheBufferGeometry:hd,ShapeGeometry:qc,ShapeBufferGeometry:rc,ExtrudeGeometry:pc,ExtrudeBufferGeometry:mb,EdgesGeometry:id,ConeGeometry:pe,ConeBufferGeometry:qe,CylinderGeometry:sc,CylinderBufferGeometry:xb,CircleGeometry:re,CircleBufferGeometry:jd,BoxGeometry:Oc,BoxBufferGeometry:Kb}); -tc.prototype=Object.create(R.prototype);tc.prototype.constructor=tc;tc.prototype.isShadowMaterial=!0;tc.prototype.copy=function(a){R.prototype.copy.call(this,a);this.color.copy(a.color);return this};kd.prototype=Object.create(ma.prototype);kd.prototype.constructor=kd;kd.prototype.isRawShaderMaterial=!0;nb.prototype=Object.create(R.prototype);nb.prototype.constructor=nb;nb.prototype.isMeshStandardMaterial=!0;nb.prototype.copy=function(a){R.prototype.copy.call(this,a);this.defines={STANDARD:""};this.color.copy(a.color); +clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});Pg.prototype=Object.assign(Object.create(Y.prototype),{constructor:Pg,isVideoTexture:!0,update:function(){var a=this.image;a.readyState>=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});ed.prototype=Object.create(Y.prototype);ed.prototype.constructor=ed;ed.prototype.isCompressedTexture=!0;je.prototype=Object.create(Y.prototype);je.prototype.constructor=je;je.prototype.isCanvasTexture=!0;ke.prototype=Object.create(Y.prototype); +ke.prototype.constructor=ke;ke.prototype.isDepthTexture=!0;fd.prototype=Object.create(D.prototype);fd.prototype.constructor=fd;le.prototype=Object.create(F.prototype);le.prototype.constructor=le;gd.prototype=Object.create(D.prototype);gd.prototype.constructor=gd;me.prototype=Object.create(F.prototype);me.prototype.constructor=me;Ha.prototype=Object.create(D.prototype);Ha.prototype.constructor=Ha;ne.prototype=Object.create(F.prototype);ne.prototype.constructor=ne;hd.prototype=Object.create(Ha.prototype); +hd.prototype.constructor=hd;oe.prototype=Object.create(F.prototype);oe.prototype.constructor=oe;uc.prototype=Object.create(Ha.prototype);uc.prototype.constructor=uc;pe.prototype=Object.create(F.prototype);pe.prototype.constructor=pe;id.prototype=Object.create(Ha.prototype);id.prototype.constructor=id;qe.prototype=Object.create(F.prototype);qe.prototype.constructor=qe;jd.prototype=Object.create(Ha.prototype);jd.prototype.constructor=jd;re.prototype=Object.create(F.prototype);re.prototype.constructor= +re;vc.prototype=Object.create(D.prototype);vc.prototype.constructor=vc;vc.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);a.path=this.parameters.path.toJSON();return a};se.prototype=Object.create(F.prototype);se.prototype.constructor=se;kd.prototype=Object.create(D.prototype);kd.prototype.constructor=kd;te.prototype=Object.create(F.prototype);te.prototype.constructor=te;ld.prototype=Object.create(D.prototype);ld.prototype.constructor=ld;var zk={triangulate:function(a,b,c){c=c||2;var d= +b&&b.length,e=d?b[0]*c:a.length,f=ui(a,0,e,c,!0),g=[];if(!f||f.next===f.prev)return g;var h;if(d){var l=c;d=[];var m;var k=0;for(m=b.length;k80*c){var q=h=a[0];var p=d=a[1];for(l=c;lh&&(h=k),b>d&&(d=b);h=Math.max(h-q,d-p);h=0!==h?1/h: +0}we(f,g,c,q,p,h);return g}},Db={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;eDb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];yi(a);zi(c,a);var f=a.length;b.forEach(yi);for(a=0;aMath.abs(g-l)?[new y(a,1-c),new y(h,1-d),new y(k,1-e),new y(t,1-b)]:[new y(g,1-c),new y(l,1-d),new y(n,1-e),new y(u,1-b)]}};ye.prototype=Object.create(F.prototype);ye.prototype.constructor=ye;nd.prototype=Object.create(rb.prototype);nd.prototype.constructor=nd;ze.prototype=Object.create(F.prototype);ze.prototype.constructor=ze;Zb.prototype=Object.create(D.prototype);Zb.prototype.constructor= +Zb;Ae.prototype=Object.create(F.prototype);Ae.prototype.constructor=Ae;od.prototype=Object.create(D.prototype);od.prototype.constructor=od;Be.prototype=Object.create(F.prototype);Be.prototype.constructor=Be;pd.prototype=Object.create(D.prototype);pd.prototype.constructor=pd;yc.prototype=Object.create(F.prototype);yc.prototype.constructor=yc;yc.prototype.toJSON=function(){var a=F.prototype.toJSON.call(this);return Bi(this.parameters.shapes,a)};zc.prototype=Object.create(D.prototype);zc.prototype.constructor= +zc;zc.prototype.toJSON=function(){var a=D.prototype.toJSON.call(this);return Bi(this.parameters.shapes,a)};qd.prototype=Object.create(D.prototype);qd.prototype.constructor=qd;Ac.prototype=Object.create(F.prototype);Ac.prototype.constructor=Ac;Eb.prototype=Object.create(D.prototype);Eb.prototype.constructor=Eb;Ce.prototype=Object.create(Ac.prototype);Ce.prototype.constructor=Ce;De.prototype=Object.create(Eb.prototype);De.prototype.constructor=De;Ee.prototype=Object.create(F.prototype);Ee.prototype.constructor= +Ee;rd.prototype=Object.create(D.prototype);rd.prototype.constructor=rd;var za=Object.freeze({WireframeGeometry:fd,ParametricGeometry:le,ParametricBufferGeometry:gd,TetrahedronGeometry:ne,TetrahedronBufferGeometry:hd,OctahedronGeometry:oe,OctahedronBufferGeometry:uc,IcosahedronGeometry:pe,IcosahedronBufferGeometry:id,DodecahedronGeometry:qe,DodecahedronBufferGeometry:jd,PolyhedronGeometry:me,PolyhedronBufferGeometry:Ha,TubeGeometry:re,TubeBufferGeometry:vc,TorusKnotGeometry:se,TorusKnotBufferGeometry:kd, +TorusGeometry:te,TorusBufferGeometry:ld,TextGeometry:ye,TextBufferGeometry:nd,SphereGeometry:ze,SphereBufferGeometry:Zb,RingGeometry:Ae,RingBufferGeometry:od,PlaneGeometry:be,PlaneBufferGeometry:rc,LatheGeometry:Be,LatheBufferGeometry:pd,ShapeGeometry:yc,ShapeBufferGeometry:zc,ExtrudeGeometry:xc,ExtrudeBufferGeometry:rb,EdgesGeometry:qd,ConeGeometry:Ce,ConeBufferGeometry:De,CylinderGeometry:Ac,CylinderBufferGeometry:Eb,CircleGeometry:Ee,CircleBufferGeometry:rd,BoxGeometry:Wc,BoxBufferGeometry:Sb}); +Bc.prototype=Object.create(R.prototype);Bc.prototype.constructor=Bc;Bc.prototype.isShadowMaterial=!0;Bc.prototype.copy=function(a){R.prototype.copy.call(this,a);this.color.copy(a.color);return this};sd.prototype=Object.create(Aa.prototype);sd.prototype.constructor=sd;sd.prototype.isRawShaderMaterial=!0;sb.prototype=Object.create(R.prototype);sb.prototype.constructor=sb;sb.prototype.isMeshStandardMaterial=!0;sb.prototype.copy=function(a){R.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}; -uc.prototype=Object.create(nb.prototype);uc.prototype.constructor=uc;uc.prototype.isMeshPhysicalMaterial=!0;uc.prototype.copy=function(a){nb.prototype.copy.call(this,a);this.defines={PHYSICAL:""};this.reflectivity=a.reflectivity;this.clearCoat=a.clearCoat;this.clearCoatRoughness=a.clearCoatRoughness;this.clearCoatNormalMap=a.clearCoatNormalMap;this.clearCoatNormalScale.copy(a.clearCoatNormalScale);return this};Wa.prototype=Object.create(R.prototype);Wa.prototype.constructor=Wa;Wa.prototype.isMeshPhongMaterial= -!0;Wa.prototype.copy=function(a){R.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; +Cc.prototype=Object.create(sb.prototype);Cc.prototype.constructor=Cc;Cc.prototype.isMeshPhysicalMaterial=!0;Cc.prototype.copy=function(a){sb.prototype.copy.call(this,a);this.defines={PHYSICAL:""};this.reflectivity=a.reflectivity;this.clearCoat=a.clearCoat;this.clearCoatRoughness=a.clearCoatRoughness;this.clearCoatNormalMap=a.clearCoatNormalMap;this.clearCoatNormalScale.copy(a.clearCoatNormalScale);return this};$a.prototype=Object.create(R.prototype);$a.prototype.constructor=$a;$a.prototype.isMeshPhongMaterial= +!0;$a.prototype.copy=function(a){R.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};vc.prototype=Object.create(Wa.prototype);vc.prototype.constructor=vc;vc.prototype.isMeshToonMaterial=!0;vc.prototype.copy=function(a){Wa.prototype.copy.call(this,a);this.gradientMap=a.gradientMap;return this};wc.prototype=Object.create(R.prototype);wc.prototype.constructor=wc;wc.prototype.isMeshNormalMaterial=!0;wc.prototype.copy=function(a){R.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};xc.prototype=Object.create(R.prototype);xc.prototype.constructor=xc;xc.prototype.isMeshLambertMaterial= -!0;xc.prototype.copy=function(a){R.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};yc.prototype=Object.create(R.prototype);yc.prototype.constructor=yc;yc.prototype.isMeshMatcapMaterial=!0;yc.prototype.copy=function(a){R.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};zc.prototype=Object.create(ba.prototype);zc.prototype.constructor=zc;zc.prototype.isLineDashedMaterial= -!0;zc.prototype.copy=function(a){ba.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var Zj=Object.freeze({ShadowMaterial:tc,SpriteMaterial:Qb,RawShaderMaterial:kd,ShaderMaterial:ma,PointsMaterial:Va,MeshPhysicalMaterial:uc,MeshStandardMaterial:nb,MeshPhongMaterial:Wa,MeshToonMaterial:vc,MeshNormalMaterial:wc,MeshLambertMaterial:xc,MeshDepthMaterial:Nb,MeshDistanceMaterial:Ob,MeshBasicMaterial:Ka,MeshMatcapMaterial:yc,LineDashedMaterial:zc, -LineBasicMaterial:ba,Material:R}),ha={arraySlice:function(a,b,c){return ha.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]}); +a.skinning;this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;return this};Dc.prototype=Object.create($a.prototype);Dc.prototype.constructor=Dc;Dc.prototype.isMeshToonMaterial=!0;Dc.prototype.copy=function(a){$a.prototype.copy.call(this,a);this.gradientMap=a.gradientMap;return this};Ec.prototype=Object.create(R.prototype);Ec.prototype.constructor=Ec;Ec.prototype.isMeshNormalMaterial=!0;Ec.prototype.copy=function(a){R.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};Fc.prototype=Object.create(R.prototype);Fc.prototype.constructor=Fc;Fc.prototype.isMeshLambertMaterial= +!0;Fc.prototype.copy=function(a){R.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};Gc.prototype=Object.create(R.prototype);Gc.prototype.constructor=Gc;Gc.prototype.isMeshMatcapMaterial=!0;Gc.prototype.copy=function(a){R.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};Hc.prototype=Object.create(ba.prototype);Hc.prototype.constructor=Hc;Hc.prototype.isLineDashedMaterial= +!0;Hc.prototype.copy=function(a){ba.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var Ak=Object.freeze({ShadowMaterial:Bc,SpriteMaterial:Yb,RawShaderMaterial:sd,ShaderMaterial:Aa,PointsMaterial:Za,MeshPhysicalMaterial:Cc,MeshStandardMaterial:sb,MeshPhongMaterial:$a,MeshToonMaterial:Dc,MeshNormalMaterial:Ec,MeshLambertMaterial:Fc,MeshDepthMaterial:Vb,MeshDistanceMaterial:Wb,MeshBasicMaterial:Oa,MeshMatcapMaterial:Gc,LineDashedMaterial:Hc, +LineBasicMaterial:ba,Material:R}),xa={arraySlice:function(a,b,c){return xa.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(Na.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 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=ha.arraySlice(c,e,f),this.values=ha.arraySlice(this.values,e*a,f*a);return this},validate:function(){var a= +this.times.length},shift:function(a){if(0!==a)for(var b=this.times,c=0,d=b.length;c!==d;++c)b[c]+=a;return this},scale:function(a){if(1!==a)for(var b=this.times,c=0,d=b.length;c!==d;++c)b[c]*=a;return this},trim:function(a,b){for(var c=this.times,d=c.length,e=0,f=d-1;e!==d&&c[e]b;)--f;++f;if(0!==e||f!==d)e>=f&&(f=Math.max(f,1),e=f-1),a=this.getValueSize(),this.times=xa.arraySlice(c,e,f),this.values=xa.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&&ha.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(P.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=== +f[0]=new n;l=Number.MAX_VALUE;k=Math.abs(d[0].x);var r=Math.abs(d[0].y),t=Math.abs(d[0].z);k<=l&&(l=k,c.set(1,0,0));r<=l&&(l=r,c.set(0,1,0));t<=l&&c.set(0,0,1);g.crossVectors(d[0],c).normalize();e[0].crossVectors(d[0],g);f[0].crossVectors(d[0],e[0]);for(l=1;l<=a;l++)e[l]=e[l-1].clone(),f[l]=f[l-1].clone(),g.crossVectors(d[l-1],d[l]),g.length()>Number.EPSILON&&(g.normalize(),c=Math.acos(P.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(P.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);hh.initNonuniformCatmullRom(f.x,g.x,h.x,c.x,d,e,l);ih.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,l);jh.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,l)}else"catmullrom"===this.curveType&& -(hh.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),ih.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),jh.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(hh.calc(a),ih.calc(a),jh.calc(a));return b};pa.prototype.copy=function(a){H.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(fi(d,e.x,f.x,g.x,c.x),fi(d,e.y,f.y,g.y,c.y));return b};ab.prototype.copy=function(a){H.prototype.copy.call(this,a);this.points=[];for(var b= -0,c=a.points.length;b=b)return b=c[a]-b, +this.type;return a},fromJSON:function(a){this.arcLengthDivisions=a.arcLengthDivisions;return this}});Sa.prototype=Object.create(H.prototype);Sa.prototype.constructor=Sa;Sa.prototype.isEllipseCurve=!0;Sa.prototype.getPoint=function(a,b){b=b||new y;for(var c=2*Math.PI,d=this.aEndAngle-this.aStartAngle,e=Math.abs(d)d;)d+=c;for(;d>c;)d-=c;de&&(e=1);1E-4>d&&(d=e);1E-4>l&&(l=e);Eh.initNonuniformCatmullRom(f.x,g.x,h.x,c.x,d,e,l);Fh.initNonuniformCatmullRom(f.y,g.y,h.y,c.y,d,e,l);Gh.initNonuniformCatmullRom(f.z,g.z,h.z,c.z,d,e,l)}else"catmullrom"===this.curveType&& +(Eh.initCatmullRom(f.x,g.x,h.x,c.x,this.tension),Fh.initCatmullRom(f.y,g.y,h.y,c.y,this.tension),Gh.initCatmullRom(f.z,g.z,h.z,c.z,this.tension));b.set(Eh.calc(a),Fh.calc(a),Gh.calc(a));return b};Ba.prototype.copy=function(a){H.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(Ei(d,e.x,f.x,g.x,c.x),Ei(d,e.y,f.y,g.y,c.y));return b};eb.prototype.copy=function(a){H.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=wb.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 Sb;h.curves=g.curves;b.push(h);return b}var l=!e(f[0].getPoints());l=a?!l:l;h=[];var k=[],n=[],t=0;k[t]=void 0;n[t]=[];for(var u=0,r=f.length;uk.opacity&&(k.transparent=!0);d.setTextures(l);return d.parse(k)}}()});var Wf, -Mg={getContext:function(){void 0===Wf&&(Wf=new (window.AudioContext||window.webkitAudioContext));return Wf},setContext:function(a){Wf=a}};Object.assign(Hg.prototype,{load:function(a,b,c,d){var e=new Xa(this.manager);e.setResponseType("arraybuffer");e.setPath(this.path);e.load(a,function(a){a=a.slice(0);Mg.getContext().decodeAudioData(a,function(a){b(a)})},c,d)},setPath:function(a){this.path=a;return this}});Object.assign(Cf.prototype,{isSphericalHarmonics3:!0,set:function(a){for(var b=0;9>b;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){for(var b=this.coefficients,c=0;9>c;c++)b[c].fromArray(a,3*c);return this},toArray:function(){for(var a=[],b=this.coefficients,c=0;9>c;c++)b[c].toArray(a,3*c);return a}});Object.assign(Cf, -{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)}});cb.prototype=Object.assign(Object.create(T.prototype),{constructor:cb,isLightProbe:!0,copy:function(a){T.prototype.copy.call(this,a);this.sh.copy(a.sh);this.intensity=a.intensity;return this},toJSON:function(a){return T.prototype.toJSON.call(this,a)}});Ig.prototype=Object.assign(Object.create(cb.prototype), -{constructor:Ig,isHemisphereLightProbe:!0,copy:function(a){cb.prototype.copy.call(this,a);return this},toJSON:function(a){return cb.prototype.toJSON.call(this,a)}});Jg.prototype=Object.assign(Object.create(cb.prototype),{constructor:Jg,isAmbientLightProbe:!0,copy:function(a){cb.prototype.copy.call(this,a);return this},toJSON:function(a){return cb.prototype.toJSON.call(this,a)}});var Xf,nh;Object.assign(hi.prototype,{update:function(a){void 0===Xf&&(Xf=new Q,nh=new Q);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(P.DEG2RAD*b.fov*.5)/b.zoom;nh.elements[12]=-d;Xf.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(nh);this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(Xf)}});Object.assign(Kg.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 Eb,oh,wi,Zb;Lg.prototype=Object.assign(Object.create(C.prototype),{constructor:Lg,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){C.prototype.updateMatrixWorld.call(this,a);void 0===Eb&&(Eb=new n,oh=new ta,wi=new n,Zb=new n);a=this.context.listener;var b=this.up;this.timeDelta=this._clock.getDelta();this.matrixWorld.decompose(Eb,oh,wi);Zb.set(0,0,-1).applyQuaternion(oh);if(a.positionX){var c=this.context.currentTime+this.timeDelta;a.positionX.linearRampToValueAtTime(Eb.x,c);a.positionY.linearRampToValueAtTime(Eb.y,c);a.positionZ.linearRampToValueAtTime(Eb.z, -c);a.forwardX.linearRampToValueAtTime(Zb.x,c);a.forwardY.linearRampToValueAtTime(Zb.y,c);a.forwardZ.linearRampToValueAtTime(Zb.z,c);a.upX.linearRampToValueAtTime(b.x,c);a.upY.linearRampToValueAtTime(b.y,c);a.upZ.linearRampToValueAtTime(b.z,c)}else a.setPosition(Eb.x,Eb.y,Eb.z),a.setOrientation(Zb.x,Zb.y,Zb.z,b.x,b.y,b.z)}});od.prototype=Object.assign(Object.create(C.prototype),{constructor:od,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.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(0Number.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=Db.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 $b;h.curves=g.curves;b.push(h);return b}var l=!e(f[0].getPoints());l=a?!l:l;h=[];var k=[],n=[],t=0;k[t]=void 0;n[t]=[];for(var u=0,q=f.length;ue.opacity&&(e.transparent=!0);og.setTextures(d);return og.parse(e)}});var pg,gh={getContext:function(){void 0===pg&&(pg=new (window.AudioContext||window.webkitAudioContext));return pg},setContext:function(a){pg=a}};Object.assign(bh.prototype,{load:function(a,b,c,d){var e=new ab(this.manager);e.setResponseType("arraybuffer");e.setPath(this.path);e.load(a,function(a){a=a.slice(0);gh.getContext().decodeAudioData(a,function(a){b(a)})},c,d)},setPath:function(a){this.path=a; +return this}});Object.assign(Tf.prototype,{isSphericalHarmonics3:!0,set:function(a){for(var b=0;9>b;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){for(var b=this.coefficients,c=0;9>c;c++)b[c].fromArray(a,3*c); +return this},toArray:function(){for(var a=[],b=this.coefficients,c=0;9>c;c++)b[c].toArray(a,3*c);return a}});Object.assign(Tf,{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)}});gb.prototype=Object.assign(Object.create(T.prototype),{constructor:gb,isLightProbe:!0,copy:function(a){T.prototype.copy.call(this,a);this.sh.copy(a.sh);this.intensity= +a.intensity;return this},toJSON:function(a){return T.prototype.toJSON.call(this,a)}});ch.prototype=Object.assign(Object.create(gb.prototype),{constructor:ch,isHemisphereLightProbe:!0,copy:function(a){gb.prototype.copy.call(this,a);return this},toJSON:function(a){return gb.prototype.toJSON.call(this,a)}});dh.prototype=Object.assign(Object.create(gb.prototype),{constructor:dh,isAmbientLightProbe:!0,copy:function(a){gb.prototype.copy.call(this,a);return this},toJSON:function(a){return gb.prototype.toJSON.call(this, +a)}});var qg,Kh;Object.assign(Gi.prototype,{update:function(a){void 0===qg&&(qg=new Q,Kh=new Q);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(P.DEG2RAD*b.fov*.5)/b.zoom;Kh.elements[12]= +-d;qg.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(Kh);this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(qg)}});Object.assign(eh.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 Mb,Lh,Wi,gc;fh.prototype=Object.assign(Object.create(C.prototype),{constructor:fh, +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){C.prototype.updateMatrixWorld.call(this,a);void 0===Mb&&(Mb=new n,Lh=new ia,Wi=new n,gc=new n);a=this.context.listener;var b=this.up;this.timeDelta=this._clock.getDelta();this.matrixWorld.decompose(Mb,Lh,Wi);gc.set(0,0,-1).applyQuaternion(Lh);if(a.positionX){var c=this.context.currentTime+this.timeDelta; +a.positionX.linearRampToValueAtTime(Mb.x,c);a.positionY.linearRampToValueAtTime(Mb.y,c);a.positionZ.linearRampToValueAtTime(Mb.z,c);a.forwardX.linearRampToValueAtTime(gc.x,c);a.forwardY.linearRampToValueAtTime(gc.y,c);a.forwardZ.linearRampToValueAtTime(gc.z,c);a.upX.linearRampToValueAtTime(b.x,c);a.upY.linearRampToValueAtTime(b.y,c);a.upZ.linearRampToValueAtTime(b.z,c)}else a.setPosition(Mb.x,Mb.y,Mb.z),a.setOrientation(gc.x,gc.y,gc.z,b.x,b.y,b.z)}});wd.prototype=Object.assign(Object.create(C.prototype), +{constructor:wd,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.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){ta.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}}});Object.assign(ii.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(za,{Composite:ii,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new za.Composite(a,b,c):new za(a,b,c)},sanitizeNodeName:function(){var a=/[\[\]\.:\/]/g;return function(b){return b.replace(/\s/g,"_").replace(a,"")}}(),parseTrackName:function(){var a= -"[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",b=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]");a=/(WCOD+)?/.source.replace("WCOD",a);var c=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),d=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),e=new RegExp("^"+b+a+c+d+"$"),f=["material","materials","bones"];return function(a){var b=e.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!==f.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++,t=a[n];c[t.uuid]=m;a[m]=t;c[k]=n;a[n]=h;h=0;for(k=e;h!==k;++h){t=d[h];var u=t[m];t[m]=t[n];t[n]=u}}}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++,t=a[n];c[t.uuid]=k;a[k]=t;c[l]=n;a[n]=h;h=0;for(l=e;h!==l;++h){t=d[h];var u=t[k];t[k]=t[n];t[n]=u}}}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}});Qg.prototype=Object.assign(Object.create(la.prototype),{constructor:Qg,_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,t=k[n];if(void 0===t){t=f[h];if(void 0!==t){null===t._cacheIndex&&(++t.referenceCount,this._addInactiveBinding(t,g,n));continue}t=new Pg(za.create(c,n,b&&b._propertyBindings[h].binding.parsedPath), +c;return this}});kh.prototype=Object.assign(Object.create(Da.prototype),{constructor:kh,_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,t=k[n];if(void 0===t){t=f[h];if(void 0!==t){null===t._cacheIndex&&(++t.referenceCount,this._addInactiveBinding(t,g,n));continue}t=new jh(Ca.create(c,n,b&&b._propertyBindings[h].binding.parsedPath), m.ValueTypeName,m.getValueSize());++t.referenceCount;this._addInactiveBinding(t,g,n)}f[h]=t;a[h].resultBuffer=t.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 z);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 z);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){void 0===Fd&& -(Fd=new z);return Fd.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 Yf,Se;Object.assign(Ug.prototype,{set:function(a,b){this.start.copy(a);this.end.copy(b);return this},clone:function(){return(new this.constructor).copy(this)}, +b){void 0===b&&(console.warn("THREE.Box2: .getParameter() target is now required"),b=new y);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 y);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(a){void 0===Sd&& +(Sd=new y);return Sd.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 rg,jf;Object.assign(oh.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){void 0===Yf&&(Yf=new n,Se=new n);Yf.subVectors(a,this.start);Se.subVectors(this.end,this.start);a=Se.dot(Se);a=Se.dot(Yf)/a;b&&(a=P.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)}});ze.prototype=Object.create(C.prototype);ze.prototype.constructor=ze;ze.prototype.isImmediateRenderObject=!0;var gb,sb,Te,yi;Ae.prototype=Object.create(aa.prototype);Ae.prototype.constructor=Ae;Ae.prototype.update=function(){void 0===Te&&(gb=new n,sb=new n,Te=new va, -yi=["a","b","c"]);this.object.updateMatrixWorld(!0);Te.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;fMath.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 cg,Gf,Vg;Ab.prototype=Object.create(C.prototype);Ab.prototype.constructor=Ab;Ab.prototype.setDirection=function(a){void 0===cg&& -(cg=new n);.99999a.y?this.quaternion.set(1,0,0,0):(cg.set(a.z,0,-a.x).normalize(),this.quaternion.setFromAxisAngle(cg,Math.acos(a.y)))};Ab.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()};Ab.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};Ab.prototype.copy= -function(a){C.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};Ab.prototype.clone=function(){return(new this.constructor).copy(this)};Fe.prototype=Object.create(aa.prototype);Fe.prototype.constructor=Fe;H.create=function(a,b){console.log("THREE.Curve.create() has been deprecated");a.prototype=Object.create(H.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};Object.assign(yb.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead."); +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){void 0===rg&&(rg=new n,jf=new n);rg.subVectors(a,this.start);jf.subVectors(this.end,this.start);a=jf.dot(jf);a=jf.dot(rg)/a;b&&(a=P.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)}});Me.prototype=Object.create(C.prototype);Me.prototype.constructor=Me;Me.prototype.isImmediateRenderObject=!0;var lb,zb,kf,Zi;Ne.prototype=Object.create(aa.prototype);Ne.prototype.constructor=Ne;Ne.prototype.update=function(){void 0===kf&&(lb=new n,zb=new n,kf=new S,Zi= +["a","b","c"]);this.object.updateMatrixWorld(!0);kf.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;fMath.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 wg,Xf,ph;Hb.prototype=Object.create(C.prototype);Hb.prototype.constructor=Hb;Hb.prototype.setDirection=function(a){void 0===wg&& +(wg=new n);.99999a.y?this.quaternion.set(1,0,0,0):(wg.set(a.z,0,-a.x).normalize(),this.quaternion.setFromAxisAngle(wg,Math.acos(a.y)))};Hb.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()};Hb.prototype.setColor=function(a){this.line.material.color.set(a);this.cone.material.color.set(a)};Hb.prototype.copy= +function(a){C.prototype.copy.call(this,a,!1);this.line.copy(a.line);this.cone.copy(a.cone);return this};Hb.prototype.clone=function(){return(new this.constructor).copy(this)};Se.prototype=Object.create(aa.prototype);Se.prototype.constructor=Se;H.create=function(a,b){console.log("THREE.Curve.create() has been deprecated");a.prototype=Object.create(H.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};Object.assign(Fb.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;c 0 ? box.max.x : box.min.x; - _vector$4.y = plane.normal.y > 0 ? box.max.y : box.min.y; - _vector$4.z = plane.normal.z > 0 ? box.max.z : box.min.z; + _vector$5.x = plane.normal.x > 0 ? box.max.x : box.min.x; + _vector$5.y = plane.normal.y > 0 ? box.max.y : box.min.y; + _vector$5.z = plane.normal.z > 0 ? box.max.z : box.min.z; - if ( plane.distanceToPoint( _vector$4 ) < 0 ) { + if ( plane.distanceToPoint( _vector$5 ) < 0 ) { return false; @@ -14422,9 +14325,9 @@ var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.r var project_vertex = "vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;"; -var dithering_fragment = "#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif"; +var dithering_fragment = "#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif"; -var dithering_pars_fragment = "#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif"; +var dithering_pars_fragment = "#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif"; var roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif"; @@ -14454,11 +14357,11 @@ var tonemapping_fragment = "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = to var tonemapping_pars_fragment = "#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}"; -var uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif"; +var uv_pars_fragment = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif"; -var uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif"; +var uv_pars_vertex = "#ifdef USE_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif"; -var uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif"; +var uv_vertex = "#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif"; var uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif"; @@ -17927,6 +17830,7 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, parameters.vertexTangents ? '#define USE_TANGENT' : '', parameters.vertexColors ? '#define USE_COLOR' : '', + parameters.vertexUvs ? '#define USE_UV' : '', parameters.flatShading ? '#define FLAT_SHADED' : '', @@ -18043,6 +17947,7 @@ function WebGLProgram( renderer, extensions, code, material, shader, parameters, parameters.vertexTangents ? '#define USE_TANGENT' : '', parameters.vertexColors ? '#define USE_COLOR' : '', + parameters.vertexUvs ? '#define USE_UV' : '', parameters.gradientMap ? '#define USE_GRADIENTMAP' : '', @@ -18453,6 +18358,7 @@ function WebGLPrograms( renderer, extensions, capabilities ) { vertexTangents: ( material.normalMap && material.vertexTangents ), vertexColors: material.vertexColors, + vertexUvs: !! material.map || !! material.bumpMap || !! material.normalMap || !! material.specularMap || !! material.alphaMap || !! material.emissiveMap || !! material.roughnessMap || !! material.metalnessMap || !! material.clearCoatNormalMap, fog: !! fog, useFog: material.fog, @@ -26249,7 +26155,7 @@ function transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) * @author mrdoob / http://mrdoob.com/ */ -var _v1$3, _v2$2; +var _v1$4, _v2$2; function LOD() { @@ -26338,11 +26244,11 @@ LOD.prototype = Object.assign( Object.create( Object3D.prototype ), { raycast: function ( raycaster, intersects ) { - if ( _v1$3 === undefined ) _v1$3 = new Vector3(); + if ( _v1$4 === undefined ) _v1$4 = new Vector3(); - _v1$3.setFromMatrixPosition( this.matrixWorld ); + _v1$4.setFromMatrixPosition( this.matrixWorld ); - var distance = raycaster.ray.origin.distanceTo( _v1$3 ); + var distance = raycaster.ray.origin.distanceTo( _v1$4 ); this.getObjectForDistance( distance ).raycast( raycaster, intersects ); @@ -26352,7 +26258,7 @@ LOD.prototype = Object.assign( Object.create( Object3D.prototype ), { if ( _v2$2 === undefined ) { - _v1$3 = new Vector3(); + _v1$4 = new Vector3(); _v2$2 = new Vector3(); } @@ -26361,10 +26267,10 @@ LOD.prototype = Object.assign( Object.create( Object3D.prototype ), { if ( levels.length > 1 ) { - _v1$3.setFromMatrixPosition( camera.matrixWorld ); + _v1$4.setFromMatrixPosition( camera.matrixWorld ); _v2$2.setFromMatrixPosition( this.matrixWorld ); - var distance = _v1$3.distanceTo( _v2$2 ); + var distance = _v1$4.distanceTo( _v2$2 ); levels[ 0 ].object.visible = true; @@ -40317,6 +40223,8 @@ Object.assign( FontLoader.prototype, { * @author alteredq / http://alteredqualia.com/ */ +var _BlendingMode, _color, _textureLoader, _materialLoader; + function Loader() {} Loader.Handlers = { @@ -40376,261 +40284,261 @@ Object.assign( Loader.prototype, { }, - createMaterial: ( function () { + createMaterial: function ( m, texturePath, crossOrigin ) { - var BlendingMode = { - NoBlending: NoBlending, - NormalBlending: NormalBlending, - AdditiveBlending: AdditiveBlending, - SubtractiveBlending: SubtractiveBlending, - MultiplyBlending: MultiplyBlending, - CustomBlending: CustomBlending - }; + if ( _materialLoader === undefined ) { - var color = new Color(); - var textureLoader = new TextureLoader(); - var materialLoader = new MaterialLoader(); + _BlendingMode = { + NoBlending: NoBlending, + NormalBlending: NormalBlending, + AdditiveBlending: AdditiveBlending, + SubtractiveBlending: SubtractiveBlending, + MultiplyBlending: MultiplyBlending, + CustomBlending: CustomBlending + }; - return function createMaterial( m, texturePath, crossOrigin ) { + _color = new Color(); + _textureLoader = new TextureLoader(); + _materialLoader = new MaterialLoader(); - // convert from old material format + } - var textures = {}; + // convert from old material format - function loadTexture( path, repeat, offset, wrap, anisotropy ) { + var textures = {}; - var fullPath = texturePath + path; - var loader = Loader.Handlers.get( fullPath ); + // - var texture; + var json = { + uuid: _Math.generateUUID(), + type: 'MeshLambertMaterial' + }; - if ( loader !== null ) { + for ( var name in m ) { - texture = loader.load( fullPath ); + var value = m[ name ]; - } else { + switch ( name ) { - textureLoader.setCrossOrigin( crossOrigin ); - texture = textureLoader.load( fullPath ); + case 'DbgColor': + case 'DbgIndex': + case 'opticalDensity': + case 'illumination': + break; + case 'DbgName': + json.name = value; + break; + case 'blending': + json.blending = _BlendingMode[ value ]; + break; + case 'colorAmbient': + case 'mapAmbient': + console.warn( 'THREE.Loader.createMaterial:', name, 'is no longer supported.' ); + break; + case 'colorDiffuse': + json.color = _color.fromArray( value ).getHex(); + break; + case 'colorSpecular': + json.specular = _color.fromArray( value ).getHex(); + break; + case 'colorEmissive': + json.emissive = _color.fromArray( value ).getHex(); + break; + case 'specularCoef': + json.shininess = value; + break; + case 'shading': + if ( value.toLowerCase() === 'basic' ) json.type = 'MeshBasicMaterial'; + if ( value.toLowerCase() === 'phong' ) json.type = 'MeshPhongMaterial'; + if ( value.toLowerCase() === 'standard' ) json.type = 'MeshStandardMaterial'; + break; + case 'mapDiffuse': + json.map = loadTexture( value, m.mapDiffuseRepeat, m.mapDiffuseOffset, m.mapDiffuseWrap, m.mapDiffuseAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapDiffuseRepeat': + case 'mapDiffuseOffset': + case 'mapDiffuseWrap': + case 'mapDiffuseAnisotropy': + break; + case 'mapEmissive': + json.emissiveMap = loadTexture( value, m.mapEmissiveRepeat, m.mapEmissiveOffset, m.mapEmissiveWrap, m.mapEmissiveAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapEmissiveRepeat': + case 'mapEmissiveOffset': + case 'mapEmissiveWrap': + case 'mapEmissiveAnisotropy': + break; + case 'mapLight': + json.lightMap = loadTexture( value, m.mapLightRepeat, m.mapLightOffset, m.mapLightWrap, m.mapLightAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapLightRepeat': + case 'mapLightOffset': + case 'mapLightWrap': + case 'mapLightAnisotropy': + break; + case 'mapAO': + json.aoMap = loadTexture( value, m.mapAORepeat, m.mapAOOffset, m.mapAOWrap, m.mapAOAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapAORepeat': + case 'mapAOOffset': + case 'mapAOWrap': + case 'mapAOAnisotropy': + break; + case 'mapBump': + json.bumpMap = loadTexture( value, m.mapBumpRepeat, m.mapBumpOffset, m.mapBumpWrap, m.mapBumpAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapBumpScale': + json.bumpScale = value; + break; + case 'mapBumpRepeat': + case 'mapBumpOffset': + case 'mapBumpWrap': + case 'mapBumpAnisotropy': + break; + case 'mapNormal': + json.normalMap = loadTexture( value, m.mapNormalRepeat, m.mapNormalOffset, m.mapNormalWrap, m.mapNormalAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapNormalFactor': + json.normalScale = value; + break; + case 'mapNormalRepeat': + case 'mapNormalOffset': + case 'mapNormalWrap': + case 'mapNormalAnisotropy': + break; + case 'mapSpecular': + json.specularMap = loadTexture( value, m.mapSpecularRepeat, m.mapSpecularOffset, m.mapSpecularWrap, m.mapSpecularAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapSpecularRepeat': + case 'mapSpecularOffset': + case 'mapSpecularWrap': + case 'mapSpecularAnisotropy': + break; + case 'mapMetalness': + json.metalnessMap = loadTexture( value, m.mapMetalnessRepeat, m.mapMetalnessOffset, m.mapMetalnessWrap, m.mapMetalnessAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapMetalnessRepeat': + case 'mapMetalnessOffset': + case 'mapMetalnessWrap': + case 'mapMetalnessAnisotropy': + break; + case 'mapRoughness': + json.roughnessMap = loadTexture( value, m.mapRoughnessRepeat, m.mapRoughnessOffset, m.mapRoughnessWrap, m.mapRoughnessAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapRoughnessRepeat': + case 'mapRoughnessOffset': + case 'mapRoughnessWrap': + case 'mapRoughnessAnisotropy': + break; + case 'mapAlpha': + json.alphaMap = loadTexture( value, m.mapAlphaRepeat, m.mapAlphaOffset, m.mapAlphaWrap, m.mapAlphaAnisotropy, textures, texturePath, crossOrigin ); + break; + case 'mapAlphaRepeat': + case 'mapAlphaOffset': + case 'mapAlphaWrap': + case 'mapAlphaAnisotropy': + break; + case 'flipSided': + json.side = BackSide; + break; + case 'doubleSided': + json.side = DoubleSide; + break; + case 'transparency': + console.warn( 'THREE.Loader.createMaterial: transparency has been renamed to opacity' ); + json.opacity = value; + break; + case 'depthTest': + case 'depthWrite': + case 'colorWrite': + case 'opacity': + case 'reflectivity': + case 'transparent': + case 'visible': + case 'wireframe': + json[ name ] = value; + break; + case 'vertexColors': + if ( value === true ) json.vertexColors = VertexColors; + if ( value === 'face' ) json.vertexColors = FaceColors; + break; + default: + console.error( 'THREE.Loader.createMaterial: Unsupported', name, value ); + break; - } + } - if ( repeat !== undefined ) { + } - texture.repeat.fromArray( repeat ); + if ( json.type === 'MeshBasicMaterial' ) delete json.emissive; + if ( json.type !== 'MeshPhongMaterial' ) delete json.specular; - if ( repeat[ 0 ] !== 1 ) texture.wrapS = RepeatWrapping; - if ( repeat[ 1 ] !== 1 ) texture.wrapT = RepeatWrapping; + if ( json.opacity < 1 ) json.transparent = true; - } + _materialLoader.setTextures( textures ); - if ( offset !== undefined ) { + return _materialLoader.parse( json ); - texture.offset.fromArray( offset ); + } - } +} ); - if ( wrap !== undefined ) { +function loadTexture( path, repeat, offset, wrap, anisotropy, textures, texturePath, crossOrigin ) { - if ( wrap[ 0 ] === 'repeat' ) texture.wrapS = RepeatWrapping; - if ( wrap[ 0 ] === 'mirror' ) texture.wrapS = MirroredRepeatWrapping; + var fullPath = texturePath + path; + var loader = Loader.Handlers.get( fullPath ); - if ( wrap[ 1 ] === 'repeat' ) texture.wrapT = RepeatWrapping; - if ( wrap[ 1 ] === 'mirror' ) texture.wrapT = MirroredRepeatWrapping; + var texture; - } + if ( loader !== null ) { - if ( anisotropy !== undefined ) { + texture = loader.load( fullPath ); - texture.anisotropy = anisotropy; + } else { - } + _textureLoader.setCrossOrigin( crossOrigin ); + texture = _textureLoader.load( fullPath ); - var uuid = _Math.generateUUID(); + } - textures[ uuid ] = texture; + if ( repeat !== undefined ) { - return uuid; + texture.repeat.fromArray( repeat ); - } + if ( repeat[ 0 ] !== 1 ) texture.wrapS = RepeatWrapping; + if ( repeat[ 1 ] !== 1 ) texture.wrapT = RepeatWrapping; - // + } - var json = { - uuid: _Math.generateUUID(), - type: 'MeshLambertMaterial' - }; + if ( offset !== undefined ) { - for ( var name in m ) { + texture.offset.fromArray( offset ); - var value = m[ name ]; + } - switch ( name ) { + if ( wrap !== undefined ) { - case 'DbgColor': - case 'DbgIndex': - case 'opticalDensity': - case 'illumination': - break; - case 'DbgName': - json.name = value; - break; - case 'blending': - json.blending = BlendingMode[ value ]; - break; - case 'colorAmbient': - case 'mapAmbient': - console.warn( 'THREE.Loader.createMaterial:', name, 'is no longer supported.' ); - break; - case 'colorDiffuse': - json.color = color.fromArray( value ).getHex(); - break; - case 'colorSpecular': - json.specular = color.fromArray( value ).getHex(); - break; - case 'colorEmissive': - json.emissive = color.fromArray( value ).getHex(); - break; - case 'specularCoef': - json.shininess = value; - break; - case 'shading': - if ( value.toLowerCase() === 'basic' ) json.type = 'MeshBasicMaterial'; - if ( value.toLowerCase() === 'phong' ) json.type = 'MeshPhongMaterial'; - if ( value.toLowerCase() === 'standard' ) json.type = 'MeshStandardMaterial'; - break; - case 'mapDiffuse': - json.map = loadTexture( value, m.mapDiffuseRepeat, m.mapDiffuseOffset, m.mapDiffuseWrap, m.mapDiffuseAnisotropy ); - break; - case 'mapDiffuseRepeat': - case 'mapDiffuseOffset': - case 'mapDiffuseWrap': - case 'mapDiffuseAnisotropy': - break; - case 'mapEmissive': - json.emissiveMap = loadTexture( value, m.mapEmissiveRepeat, m.mapEmissiveOffset, m.mapEmissiveWrap, m.mapEmissiveAnisotropy ); - break; - case 'mapEmissiveRepeat': - case 'mapEmissiveOffset': - case 'mapEmissiveWrap': - case 'mapEmissiveAnisotropy': - break; - case 'mapLight': - json.lightMap = loadTexture( value, m.mapLightRepeat, m.mapLightOffset, m.mapLightWrap, m.mapLightAnisotropy ); - break; - case 'mapLightRepeat': - case 'mapLightOffset': - case 'mapLightWrap': - case 'mapLightAnisotropy': - break; - case 'mapAO': - json.aoMap = loadTexture( value, m.mapAORepeat, m.mapAOOffset, m.mapAOWrap, m.mapAOAnisotropy ); - break; - case 'mapAORepeat': - case 'mapAOOffset': - case 'mapAOWrap': - case 'mapAOAnisotropy': - break; - case 'mapBump': - json.bumpMap = loadTexture( value, m.mapBumpRepeat, m.mapBumpOffset, m.mapBumpWrap, m.mapBumpAnisotropy ); - break; - case 'mapBumpScale': - json.bumpScale = value; - break; - case 'mapBumpRepeat': - case 'mapBumpOffset': - case 'mapBumpWrap': - case 'mapBumpAnisotropy': - break; - case 'mapNormal': - json.normalMap = loadTexture( value, m.mapNormalRepeat, m.mapNormalOffset, m.mapNormalWrap, m.mapNormalAnisotropy ); - break; - case 'mapNormalFactor': - json.normalScale = value; - break; - case 'mapNormalRepeat': - case 'mapNormalOffset': - case 'mapNormalWrap': - case 'mapNormalAnisotropy': - break; - case 'mapSpecular': - json.specularMap = loadTexture( value, m.mapSpecularRepeat, m.mapSpecularOffset, m.mapSpecularWrap, m.mapSpecularAnisotropy ); - break; - case 'mapSpecularRepeat': - case 'mapSpecularOffset': - case 'mapSpecularWrap': - case 'mapSpecularAnisotropy': - break; - case 'mapMetalness': - json.metalnessMap = loadTexture( value, m.mapMetalnessRepeat, m.mapMetalnessOffset, m.mapMetalnessWrap, m.mapMetalnessAnisotropy ); - break; - case 'mapMetalnessRepeat': - case 'mapMetalnessOffset': - case 'mapMetalnessWrap': - case 'mapMetalnessAnisotropy': - break; - case 'mapRoughness': - json.roughnessMap = loadTexture( value, m.mapRoughnessRepeat, m.mapRoughnessOffset, m.mapRoughnessWrap, m.mapRoughnessAnisotropy ); - break; - case 'mapRoughnessRepeat': - case 'mapRoughnessOffset': - case 'mapRoughnessWrap': - case 'mapRoughnessAnisotropy': - break; - case 'mapAlpha': - json.alphaMap = loadTexture( value, m.mapAlphaRepeat, m.mapAlphaOffset, m.mapAlphaWrap, m.mapAlphaAnisotropy ); - break; - case 'mapAlphaRepeat': - case 'mapAlphaOffset': - case 'mapAlphaWrap': - case 'mapAlphaAnisotropy': - break; - case 'flipSided': - json.side = BackSide; - break; - case 'doubleSided': - json.side = DoubleSide; - break; - case 'transparency': - console.warn( 'THREE.Loader.createMaterial: transparency has been renamed to opacity' ); - json.opacity = value; - break; - case 'depthTest': - case 'depthWrite': - case 'colorWrite': - case 'opacity': - case 'reflectivity': - case 'transparent': - case 'visible': - case 'wireframe': - json[ name ] = value; - break; - case 'vertexColors': - if ( value === true ) json.vertexColors = VertexColors; - if ( value === 'face' ) json.vertexColors = FaceColors; - break; - default: - console.error( 'THREE.Loader.createMaterial: Unsupported', name, value ); - break; + if ( wrap[ 0 ] === 'repeat' ) texture.wrapS = RepeatWrapping; + if ( wrap[ 0 ] === 'mirror' ) texture.wrapS = MirroredRepeatWrapping; - } + if ( wrap[ 1 ] === 'repeat' ) texture.wrapT = RepeatWrapping; + if ( wrap[ 1 ] === 'mirror' ) texture.wrapT = MirroredRepeatWrapping; - } + } - if ( json.type === 'MeshBasicMaterial' ) delete json.emissive; - if ( json.type !== 'MeshPhongMaterial' ) delete json.specular; + if ( anisotropy !== undefined ) { - if ( json.opacity < 1 ) json.transparent = true; + texture.anisotropy = anisotropy; - materialLoader.setTextures( textures ); + } - return materialLoader.parse( json ); + var uuid = _Math.generateUUID(); - }; + textures[ uuid ] = texture; - } )() + return uuid; -} ); +} /** * @author mrdoob / http://mrdoob.com/ @@ -41252,7 +41160,7 @@ Object.assign( Clock.prototype, { * @author mrdoob / http://mrdoob.com/ */ -var _position, _quaternion$2, _scale; +var _position$1, _quaternion$3, _scale$1; var _orientation; function AudioListener() { @@ -41346,11 +41254,11 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { Object3D.prototype.updateMatrixWorld.call( this, force ); - if ( _position === undefined ) { + if ( _position$1 === undefined ) { - _position = new Vector3(); - _quaternion$2 = new Quaternion(); - _scale = new Vector3(); + _position$1 = new Vector3(); + _quaternion$3 = new Quaternion(); + _scale$1 = new Vector3(); _orientation = new Vector3(); } @@ -41360,9 +41268,9 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { this.timeDelta = this._clock.getDelta(); - this.matrixWorld.decompose( _position, _quaternion$2, _scale ); + this.matrixWorld.decompose( _position$1, _quaternion$3, _scale$1 ); - _orientation.set( 0, 0, - 1 ).applyQuaternion( _quaternion$2 ); + _orientation.set( 0, 0, - 1 ).applyQuaternion( _quaternion$3 ); if ( listener.positionX ) { @@ -41370,9 +41278,9 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { var endTime = this.context.currentTime + this.timeDelta; - listener.positionX.linearRampToValueAtTime( _position.x, endTime ); - listener.positionY.linearRampToValueAtTime( _position.y, endTime ); - listener.positionZ.linearRampToValueAtTime( _position.z, endTime ); + listener.positionX.linearRampToValueAtTime( _position$1.x, endTime ); + listener.positionY.linearRampToValueAtTime( _position$1.y, endTime ); + listener.positionZ.linearRampToValueAtTime( _position$1.z, endTime ); listener.forwardX.linearRampToValueAtTime( _orientation.x, endTime ); listener.forwardY.linearRampToValueAtTime( _orientation.y, endTime ); listener.forwardZ.linearRampToValueAtTime( _orientation.z, endTime ); @@ -41382,7 +41290,7 @@ AudioListener.prototype = Object.assign( Object.create( Object3D.prototype ), { } else { - listener.setPosition( _position.x, _position.y, _position.z ); + listener.setPosition( _position$1.x, _position$1.y, _position$1.z ); listener.setOrientation( _orientation.x, _orientation.y, _orientation.z, up.x, up.y, up.z ); } @@ -41737,7 +41645,7 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), { * @author mrdoob / http://mrdoob.com/ */ -var _position$1, _quaternion$3, _scale$1; +var _position$2, _quaternion$4, _scale$2; var _orientation$1; function PositionalAudio( listener ) { @@ -41830,20 +41738,20 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), { Object3D.prototype.updateMatrixWorld.call( this, force ); - if ( _position$1 === undefined ) { + if ( _position$2 === undefined ) { - _position$1 = new Vector3(); - _quaternion$3 = new Quaternion(); - _scale$1 = new Vector3(); + _position$2 = new Vector3(); + _quaternion$4 = new Quaternion(); + _scale$2 = new Vector3(); _orientation$1 = new Vector3(); } if ( this.hasPlaybackControl === true && this.isPlaying === false ) return; - this.matrixWorld.decompose( _position$1, _quaternion$3, _scale$1 ); + this.matrixWorld.decompose( _position$2, _quaternion$4, _scale$2 ); - _orientation$1.set( 0, 0, 1 ).applyQuaternion( _quaternion$3 ); + _orientation$1.set( 0, 0, 1 ).applyQuaternion( _quaternion$4 ); var panner = this.panner; @@ -41853,16 +41761,16 @@ PositionalAudio.prototype = Object.assign( Object.create( Audio.prototype ), { var endTime = this.context.currentTime + this.listener.timeDelta; - panner.positionX.linearRampToValueAtTime( _position$1.x, endTime ); - panner.positionY.linearRampToValueAtTime( _position$1.y, endTime ); - panner.positionZ.linearRampToValueAtTime( _position$1.z, endTime ); + panner.positionX.linearRampToValueAtTime( _position$2.x, endTime ); + panner.positionY.linearRampToValueAtTime( _position$2.y, endTime ); + panner.positionZ.linearRampToValueAtTime( _position$2.z, endTime ); panner.orientationX.linearRampToValueAtTime( _orientation$1.x, endTime ); panner.orientationY.linearRampToValueAtTime( _orientation$1.y, endTime ); panner.orientationZ.linearRampToValueAtTime( _orientation$1.z, endTime ); } else { - panner.setPosition( _position$1.x, _position$1.y, _position$1.z ); + panner.setPosition( _position$2.x, _position$2.y, _position$2.z ); panner.setOrientation( _orientation$1.x, _orientation$1.y, _orientation$1.z ); } @@ -42128,7 +42036,10 @@ Object.assign( PropertyMixer.prototype, { */ // Characters [].:/ are reserved for track binding syntax. -var RESERVED_CHARS_RE = '\\[\\]\\.:\\/'; +var _RESERVED_CHARS_RE = '\\[\\]\\.:\\/'; + +var _reservedRe; +var _trackRe, _supportedObjectNames; function Composite( targetGroup, path, optionalParsedPath ) { @@ -42228,101 +42139,101 @@ Object.assign( PropertyBinding, { * @param {string} name Node name to be sanitized. * @return {string} */ - sanitizeNodeName: ( function () { + sanitizeNodeName: function ( name ) { - var reservedRe = new RegExp( '[' + RESERVED_CHARS_RE + ']', 'g' ); + if ( _reservedRe === undefined ) { - return function sanitizeNodeName( name ) { + _reservedRe = new RegExp( '[' + _RESERVED_CHARS_RE + ']', 'g' ); - return name.replace( /\s/g, '_' ).replace( reservedRe, '' ); + } - }; + return name.replace( /\s/g, '_' ).replace( _reservedRe, '' ); - }() ), + }, - parseTrackName: function () { + parseTrackName: function ( trackName ) { - // Attempts to allow node names from any language. ES5's `\w` regexp matches - // only latin characters, and the unicode \p{L} is not yet supported. So - // instead, we exclude reserved characters and match everything else. - var wordChar = '[^' + RESERVED_CHARS_RE + ']'; - var wordCharOrDot = '[^' + RESERVED_CHARS_RE.replace( '\\.', '' ) + ']'; + if ( _supportedObjectNames === undefined ) { - // Parent directories, delimited by '/' or ':'. Currently unused, but must - // be matched to parse the rest of the track name. - var directoryRe = /((?:WC+[\/:])*)/.source.replace( 'WC', wordChar ); + // Attempts to allow node names from any language. ES5's `\w` regexp matches + // only latin characters, and the unicode \p{L} is not yet supported. So + // instead, we exclude reserved characters and match everything else. + var wordChar = '[^' + _RESERVED_CHARS_RE + ']'; + var wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\.', '' ) + ']'; - // Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'. - var nodeRe = /(WCOD+)?/.source.replace( 'WCOD', wordCharOrDot ); + // Parent directories, delimited by '/' or ':'. Currently unused, but must + // be matched to parse the rest of the track name. + var directoryRe = /((?:WC+[\/:])*)/.source.replace( 'WC', wordChar ); - // Object on target node, and accessor. May not contain reserved - // characters. Accessor may contain any character except closing bracket. - var objectRe = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace( 'WC', wordChar ); + // Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'. + var nodeRe = /(WCOD+)?/.source.replace( 'WCOD', wordCharOrDot ); - // Property and accessor. May not contain reserved characters. Accessor may - // contain any non-bracket characters. - var propertyRe = /\.(WC+)(?:\[(.+)\])?/.source.replace( 'WC', wordChar ); + // Object on target node, and accessor. May not contain reserved + // characters. Accessor may contain any character except closing bracket. + var objectRe = /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace( 'WC', wordChar ); - var trackRe = new RegExp( '' - + '^' - + directoryRe - + nodeRe - + objectRe - + propertyRe - + '$' - ); + // Property and accessor. May not contain reserved characters. Accessor may + // contain any non-bracket characters. + var propertyRe = /\.(WC+)(?:\[(.+)\])?/.source.replace( 'WC', wordChar ); - var supportedObjectNames = [ 'material', 'materials', 'bones' ]; + _trackRe = new RegExp( '' + + '^' + + directoryRe + + nodeRe + + objectRe + + propertyRe + + '$' + ); - return function parseTrackName( trackName ) { + _supportedObjectNames = [ 'material', 'materials', 'bones' ]; - var matches = trackRe.exec( trackName ); + } - if ( ! matches ) { + var matches = _trackRe.exec( trackName ); - throw new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName ); + if ( ! matches ) { - } + throw new Error( 'PropertyBinding: Cannot parse trackName: ' + trackName ); - var results = { - // directoryName: matches[ 1 ], // (tschw) currently unused - nodeName: matches[ 2 ], - objectName: matches[ 3 ], - objectIndex: matches[ 4 ], - propertyName: matches[ 5 ], // required - propertyIndex: matches[ 6 ] - }; + } - var lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' ); + var results = { + // directoryName: matches[ 1 ], // (tschw) currently unused + nodeName: matches[ 2 ], + objectName: matches[ 3 ], + objectIndex: matches[ 4 ], + propertyName: matches[ 5 ], // required + propertyIndex: matches[ 6 ] + }; - if ( lastDot !== undefined && lastDot !== - 1 ) { + var lastDot = results.nodeName && results.nodeName.lastIndexOf( '.' ); - var objectName = results.nodeName.substring( lastDot + 1 ); + if ( lastDot !== undefined && lastDot !== - 1 ) { - // Object names must be checked against a whitelist. Otherwise, there - // is no way to parse 'foo.bar.baz': 'baz' must be a property, but - // 'bar' could be the objectName, or part of a nodeName (which can - // include '.' characters). - if ( supportedObjectNames.indexOf( objectName ) !== - 1 ) { + var objectName = results.nodeName.substring( lastDot + 1 ); - results.nodeName = results.nodeName.substring( 0, lastDot ); - results.objectName = objectName; + // Object names must be checked against a whitelist. Otherwise, there + // is no way to parse 'foo.bar.baz': 'baz' must be a property, but + // 'bar' could be the objectName, or part of a nodeName (which can + // include '.' characters). + if ( _supportedObjectNames.indexOf( objectName ) !== - 1 ) { - } + results.nodeName = results.nodeName.substring( 0, lastDot ); + results.objectName = objectName; } - if ( results.propertyName === null || results.propertyName.length === 0 ) { + } - throw new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName ); + if ( results.propertyName === null || results.propertyName.length === 0 ) { - } + throw new Error( 'PropertyBinding: can not parse propertyName from trackName: ' + trackName ); - return results; + } - }; + return results; - }(), + }, findNode: function ( root, nodeName ) { @@ -44987,7 +44898,7 @@ Object.assign( Cylindrical.prototype, { * @author bhouston / http://clara.io */ -var _vector$5; +var _vector$6; function Box2( min, max ) { @@ -45023,9 +44934,9 @@ Object.assign( Box2.prototype, { setFromCenterAndSize: function ( center, size ) { - if ( _vector$5 === undefined ) _vector$5 = new Vector2(); + if ( _vector$6 === undefined ) _vector$6 = new Vector2(); - var halfSize = _vector$5.copy( size ).multiplyScalar( 0.5 ); + var halfSize = _vector$6.copy( size ).multiplyScalar( 0.5 ); this.min.copy( center ).sub( halfSize ); this.max.copy( center ).add( halfSize ); @@ -45175,9 +45086,9 @@ Object.assign( Box2.prototype, { distanceToPoint: function ( point ) { - if ( _vector$5 === undefined ) _vector$5 = new Vector2(); + if ( _vector$6 === undefined ) _vector$6 = new Vector2(); - var clampedPoint = _vector$5.copy( point ).clamp( this.min, this.max ); + var clampedPoint = _vector$6.copy( point ).clamp( this.min, this.max ); return clampedPoint.sub( point ).length(); }, @@ -45389,7 +45300,7 @@ ImmediateRenderObject.prototype.isImmediateRenderObject = true; * @author WestLangley / http://github.com/WestLangley */ -var _v1$4, _v2$3, _normalMatrix$1, _keys; +var _v1$5, _v2$3, _normalMatrix$1, _keys; function VertexNormalsHelper( object, size, hex, linewidth ) { @@ -45442,7 +45353,7 @@ VertexNormalsHelper.prototype.update = function () { if ( _normalMatrix$1 === undefined ) { - _v1$4 = new Vector3(); + _v1$5 = new Vector3(); _v2$3 = new Vector3(); _normalMatrix$1 = new Matrix3(); _keys = [ 'a', 'b', 'c' ]; @@ -45479,11 +45390,11 @@ VertexNormalsHelper.prototype.update = function () { var normal = face.vertexNormals[ j ]; - _v1$4.copy( vertex ).applyMatrix4( matrixWorld ); + _v1$5.copy( vertex ).applyMatrix4( matrixWorld ); - _v2$3.copy( normal ).applyMatrix3( _normalMatrix$1 ).normalize().multiplyScalar( this.size ).add( _v1$4 ); + _v2$3.copy( normal ).applyMatrix3( _normalMatrix$1 ).normalize().multiplyScalar( this.size ).add( _v1$5 ); - position.setXYZ( idx, _v1$4.x, _v1$4.y, _v1$4.z ); + position.setXYZ( idx, _v1$5.x, _v1$5.y, _v1$5.z ); idx = idx + 1; @@ -45507,13 +45418,13 @@ VertexNormalsHelper.prototype.update = function () { for ( var j = 0, jl = objPos.count; j < jl; j ++ ) { - _v1$4.set( objPos.getX( j ), objPos.getY( j ), objPos.getZ( j ) ).applyMatrix4( matrixWorld ); + _v1$5.set( objPos.getX( j ), objPos.getY( j ), objPos.getZ( j ) ).applyMatrix4( matrixWorld ); _v2$3.set( objNorm.getX( j ), objNorm.getY( j ), objNorm.getZ( j ) ); - _v2$3.applyMatrix3( _normalMatrix$1 ).normalize().multiplyScalar( this.size ).add( _v1$4 ); + _v2$3.applyMatrix3( _normalMatrix$1 ).normalize().multiplyScalar( this.size ).add( _v1$5 ); - position.setXYZ( idx, _v1$4.x, _v1$4.y, _v1$4.z ); + position.setXYZ( idx, _v1$5.x, _v1$5.y, _v1$5.z ); idx = idx + 1; @@ -45535,7 +45446,7 @@ VertexNormalsHelper.prototype.update = function () { * @author WestLangley / http://github.com/WestLangley */ -var _vector$6; +var _vector$7; function SpotLightHelper( light, color ) { @@ -45594,7 +45505,7 @@ SpotLightHelper.prototype.dispose = function () { SpotLightHelper.prototype.update = function () { - if ( _vector$6 === undefined ) _vector$6 = new Vector3(); + if ( _vector$7 === undefined ) _vector$7 = new Vector3(); this.light.updateMatrixWorld(); @@ -45603,9 +45514,9 @@ SpotLightHelper.prototype.update = function () { this.cone.scale.set( coneWidth, coneWidth, coneLength ); - _vector$6.setFromMatrixPosition( this.light.target.matrixWorld ); + _vector$7.setFromMatrixPosition( this.light.target.matrixWorld ); - this.cone.lookAt( _vector$6 ); + this.cone.lookAt( _vector$7 ); if ( this.color !== undefined ) { @@ -45627,7 +45538,7 @@ SpotLightHelper.prototype.update = function () { * @author Mugen87 / https://github.com/Mugen87 */ -var _vector$7, _boneMatrix, _matrixWorldInv; +var _vector$8, _boneMatrix, _matrixWorldInv; function getBoneList( object ) { @@ -45698,7 +45609,7 @@ SkeletonHelper.prototype.updateMatrixWorld = function ( force ) { if ( _matrixWorldInv === undefined ) { - _vector$7 = new Vector3(); + _vector$8 = new Vector3(); _boneMatrix = new Matrix4(); _matrixWorldInv = new Matrix4(); @@ -45718,12 +45629,12 @@ SkeletonHelper.prototype.updateMatrixWorld = function ( force ) { if ( bone.parent && bone.parent.isBone ) { _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.matrixWorld ); - _vector$7.setFromMatrixPosition( _boneMatrix ); - position.setXYZ( j, _vector$7.x, _vector$7.y, _vector$7.z ); + _vector$8.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j, _vector$8.x, _vector$8.y, _vector$8.z ); _boneMatrix.multiplyMatrices( _matrixWorldInv, bone.parent.matrixWorld ); - _vector$7.setFromMatrixPosition( _boneMatrix ); - position.setXYZ( j + 1, _vector$7.x, _vector$7.y, _vector$7.z ); + _vector$8.setFromMatrixPosition( _boneMatrix ); + position.setXYZ( j + 1, _vector$8.x, _vector$8.y, _vector$8.z ); j += 2; @@ -45905,7 +45816,7 @@ RectAreaLightHelper.prototype.dispose = function () { * @author Mugen87 / https://github.com/Mugen87 */ -var _vector$8, _color1, _color2; +var _vector$9, _color1, _color2; function HemisphereLightHelper( light, size, color ) { @@ -45950,7 +45861,7 @@ HemisphereLightHelper.prototype.update = function () { if ( _color2 === undefined ) { - _vector$8 = new Vector3(); + _vector$9 = new Vector3(); _color1 = new Color(); _color2 = new Color(); @@ -45981,7 +45892,7 @@ HemisphereLightHelper.prototype.update = function () { } - mesh.lookAt( _vector$8.setFromMatrixPosition( this.light.matrixWorld ).negate() ); + mesh.lookAt( _vector$9.setFromMatrixPosition( this.light.matrixWorld ).negate() ); }; @@ -46387,7 +46298,7 @@ PositionalAudioHelper.prototype.dispose = function () { * @author WestLangley / http://github.com/WestLangley */ -var _v1$5, _v2$4, _normalMatrix$2; +var _v1$6, _v2$4, _normalMatrix$2; function FaceNormalsHelper( object, size, hex, linewidth ) { @@ -46441,7 +46352,7 @@ FaceNormalsHelper.prototype.update = function () { if ( _normalMatrix$2 === undefined ) { - _v1$5 = new Vector3(); + _v1$6 = new Vector3(); _v2$4 = new Vector3(); _normalMatrix$2 = new Matrix3(); @@ -46471,15 +46382,15 @@ FaceNormalsHelper.prototype.update = function () { var normal = face.normal; - _v1$5.copy( vertices[ face.a ] ) + _v1$6.copy( vertices[ face.a ] ) .add( vertices[ face.b ] ) .add( vertices[ face.c ] ) .divideScalar( 3 ) .applyMatrix4( matrixWorld ); - _v2$4.copy( normal ).applyMatrix3( _normalMatrix$2 ).normalize().multiplyScalar( this.size ).add( _v1$5 ); + _v2$4.copy( normal ).applyMatrix3( _normalMatrix$2 ).normalize().multiplyScalar( this.size ).add( _v1$6 ); - position.setXYZ( idx, _v1$5.x, _v1$5.y, _v1$5.z ); + position.setXYZ( idx, _v1$6.x, _v1$6.y, _v1$6.z ); idx = idx + 1; @@ -46499,7 +46410,7 @@ FaceNormalsHelper.prototype.update = function () { * @author WestLangley / http://github.com/WestLangley */ -var _v1$6, _v2$5, _v3$1; +var _v1$7, _v2$5, _v3$1; function DirectionalLightHelper( light, size, color ) { @@ -46555,15 +46466,15 @@ DirectionalLightHelper.prototype.update = function () { if ( _v3$1 === undefined ) { - _v1$6 = new Vector3(); + _v1$7 = new Vector3(); _v2$5 = new Vector3(); _v3$1 = new Vector3(); } - _v1$6.setFromMatrixPosition( this.light.matrixWorld ); + _v1$7.setFromMatrixPosition( this.light.matrixWorld ); _v2$5.setFromMatrixPosition( this.light.target.matrixWorld ); - _v3$1.subVectors( _v2$5, _v1$6 ); + _v3$1.subVectors( _v2$5, _v1$7 ); this.lightPlane.lookAt( _v2$5 ); @@ -46594,7 +46505,7 @@ DirectionalLightHelper.prototype.update = function () { * http://evanw.github.com/lightgl.js/tests/shadowmap.html */ -var _vector$9, _camera; +var _vector$a, _camera; function CameraHelper( camera ) { @@ -46760,9 +46671,9 @@ CameraHelper.prototype.update = function () { function setPoint( point, pointMap, geometry, camera, x, y, z ) { - if ( _vector$9 === undefined ) _vector$9 = new Vector3(); + if ( _vector$a === undefined ) _vector$a = new Vector3(); - _vector$9.set( x, y, z ).unproject( camera ); + _vector$a.set( x, y, z ).unproject( camera ); var points = pointMap[ point ]; @@ -46772,7 +46683,7 @@ function setPoint( point, pointMap, geometry, camera, x, y, z ) { for ( var i = 0, l = points.length; i < l; i ++ ) { - position.setXYZ( points[ i ], _vector$9.x, _vector$9.y, _vector$9.z ); + position.setXYZ( points[ i ], _vector$a.x, _vector$a.y, _vector$a.z ); } @@ -46785,7 +46696,7 @@ function setPoint( point, pointMap, geometry, camera, x, y, z ) { * @author Mugen87 / http://github.com/Mugen87 */ -var _box$1; +var _box$2; function BoxHelper( object, color ) { @@ -46813,7 +46724,7 @@ BoxHelper.prototype.constructor = BoxHelper; BoxHelper.prototype.update = function ( object ) { - if ( _box$1 === undefined ) _box$1 = new Box3(); + if ( _box$2 === undefined ) _box$2 = new Box3(); if ( object !== undefined ) { @@ -46823,14 +46734,14 @@ BoxHelper.prototype.update = function ( object ) { if ( this.object !== undefined ) { - _box$1.setFromObject( this.object ); + _box$2.setFromObject( this.object ); } - if ( _box$1.isEmpty() ) return; + if ( _box$2.isEmpty() ) return; - var min = _box$1.min; - var max = _box$1.max; + var min = _box$2.min; + var max = _box$2.max; /* 5____4 @@ -47666,17 +47577,10 @@ Object.assign( Matrix4.prototype, { }, getPosition: function () { - var v1; - - return function getPosition() { - - if ( v1 === undefined ) v1 = new Vector3(); - console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' ); - return v1.setFromMatrixColumn( this, 3 ); + console.warn( 'THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.' ); + return new Vector3().setFromMatrixColumn( this, 3 ); - }; - - }(), + }, setRotationFromQuaternion: function ( q ) { console.warn( 'THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().' );