/* 2020-9-22 15:23:18 | 版权所有 军懋国兴 */ "use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var THREE={REVISION:"73"};"function"==typeof define&&define.amd?define("three",THREE):"undefined"!=typeof exports&&"undefined"!=typeof module&&(module.exports=THREE),void 0!==self.requestAnimationFrame&&void 0!==self.cancelAnimationFrame||function(){for(var n=0,t=["ms","moz","webkit","o"],e=0;e>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,r){return this.r=t,this.g=e,this.b=r,this},setHSL:function(){function i(t,e,r){return r<0&&(r+=1),1Math.abs(t.z)?r.set(-t.y,t.x,0):r.set(0,-t.z,t.y)):r.crossVectors(t,e),this._x=r.x,this._y=r.y,this._z=r.z,this._w=i,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._z=this._y=this._x=0,this._w=1):(t=1/t,this._x*=t,this._y*=t,this._z*=t,this._w*=t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},multiplyQuaternions:function(t,e){var r=t._x,i=t._y,n=t._z,o=t._w,a=e._x,s=e._y,h=e._z,c=e._w;return this._x=r*c+o*a+i*h-n*s,this._y=i*c+o*s+n*a-r*h,this._z=n*c+o*h+r*s-i*a,this._w=o*c-r*a-i*s-n*h,this.onChangeCallback(),this},multiplyVector3:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var r=this._x,i=this._y,n=this._z,o=this._w,a=o*t._w+r*t._x+i*t._y+n*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),1<=a)return this._w=o,this._x=r,this._y=i,this._z=n,this;var s=Math.acos(a),h=Math.sqrt(1-a*a);return Math.abs(h)<.001?(this._w=.5*(o+this._w),this._x=.5*(r+this._x),this._y=.5*(i+this._y),this._z=.5*(n+this._z)):(a=Math.sin((1-e)*s)/h,s=Math.sin(e*s)/h,this._w=o*a+this._w*s,this._x=r*a+this._x*s,this._y=i*a+this._y*s,this._z=n*a+this._z*s,this.onChangeCallback()),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},THREE.Quaternion.slerp=function(t,e,r,i){return r.copy(t).slerp(e,i)},THREE.Vector2=function(t,e){this.x=t||0,this.y=e||0},THREE.Vector2.prototype={constructor:THREE.Vector2,get width(){return this.x},set width(t){this.x=t},get height(){return this.y},set height(t){this.y=t},set:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t):this.y=this.x=0,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var r,i;return function(t,e){return void 0===r&&(r=new THREE.Vector2,i=new THREE.Vector2),r.set(t,t),i.set(e,e),this.clamp(r,i)}}(),clampLength:function(t,e){var r=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,r))/r),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x;return e*e+(t=this.y-t.y)*t},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t),this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromAttribute:function(t,e,r){return void 0===r&&(r=0),e=e*t.itemSize+r,this.x=t.array[e],this.y=t.array[e+1],this},rotateAround:function(t,e){var r=Math.cos(e),i=Math.sin(e),n=this.x-t.x,o=this.y-t.y;return this.x=n*r-o*i+t.x,this.y=n*i+o*r+t.y,this}},THREE.Vector3=function(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0},THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(t,e,r){return this.x=t,this.y=e,this.z=r,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):this.z=this.y=this.x=0,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var e;return function(t){return!1==t instanceof THREE.Euler&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===e&&(e=new THREE.Quaternion),this.applyQuaternion(e.setFromEuler(t)),this}}(),applyAxisAngle:function(){var r;return function(t,e){return void 0===r&&(r=new THREE.Quaternion),this.applyQuaternion(r.setFromAxisAngle(t,e)),this}}(),applyMatrix3:function(t){var e=this.x,r=this.y,i=this.z;return t=t.elements,this.x=t[0]*e+t[3]*r+t[6]*i,this.y=t[1]*e+t[4]*r+t[7]*i,this.z=t[2]*e+t[5]*r+t[8]*i,this},applyMatrix4:function(t){var e=this.x,r=this.y,i=this.z;return t=t.elements,this.x=t[0]*e+t[4]*r+t[8]*i+t[12],this.y=t[1]*e+t[5]*r+t[9]*i+t[13],this.z=t[2]*e+t[6]*r+t[10]*i+t[14],this},applyProjection:function(t){var e=this.x,r=this.y,i=this.z,n=1/((t=t.elements)[3]*e+t[7]*r+t[11]*i+t[15]);return this.x=(t[0]*e+t[4]*r+t[8]*i+t[12])*n,this.y=(t[1]*e+t[5]*r+t[9]*i+t[13])*n,this.z=(t[2]*e+t[6]*r+t[10]*i+t[14])*n,this},applyQuaternion:function(t){var e=this.x,r=this.y,i=this.z,n=t.x,o=t.y,a=t.z,s=(t=t.w)*e+o*i-a*r,h=t*r+a*e-n*i,c=t*i+n*r-o*e,e=-n*e-o*r-a*i;return this.x=s*t+e*-n+h*-a-c*-o,this.y=h*t+e*-o+c*-n-s*-a,this.z=c*t+e*-a+s*-o-h*-n,this},project:function(){var e;return function(t){return void 0===e&&(e=new THREE.Matrix4),e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyProjection(e)}}(),unproject:function(){var e;return function(t){return void 0===e&&(e=new THREE.Matrix4),e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyProjection(e)}}(),transformDirection:function(t){var e=this.x,r=this.y,i=this.z;return t=t.elements,this.x=t[0]*e+t[4]*r+t[8]*i,this.y=t[1]*e+t[5]*r+t[9]*i,this.z=t[2]*e+t[6]*r+t[10]*i,this.normalize(),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var r,i;return function(t,e){return void 0===r&&(r=new THREE.Vector3,i=new THREE.Vector3),r.set(t,t,t),i.set(e,e,e),this.clamp(r,i)}}(),clampLength:function(t,e){var r=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,r))/r),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.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)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t),this},cross:function(t,e){if(void 0!==e)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var r=this.x,i=this.y,n=this.z;return this.x=i*t.z-n*t.y,this.y=n*t.x-r*t.z,this.z=r*t.y-i*t.x,this},crossVectors:function(t,e){var r=t.x,i=t.y,n=t.z,o=e.x,a=e.y,s=e.z;return this.x=i*s-n*a,this.y=n*o-r*s,this.z=r*a-i*o,this},projectOnVector:function(){var e,r;return function(t){return void 0===e&&(e=new THREE.Vector3),e.copy(t).normalize(),r=this.dot(e),this.copy(e).multiplyScalar(r)}}(),projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new THREE.Vector3),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new THREE.Vector3),this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(t){return t=this.dot(t)/(this.length()*t.length()),Math.acos(THREE.Math.clamp(t,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r+(t=this.z-t.z)*t},setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},setFromMatrixPosition:function(t){return this.x=t.elements[12],this.y=t.elements[13],this.z=t.elements[14],this},setFromMatrixScale:function(t){var e=this.set(t.elements[0],t.elements[1],t.elements[2]).length(),r=this.set(t.elements[4],t.elements[5],t.elements[6]).length();return t=this.set(t.elements[8],t.elements[9],t.elements[10]).length(),this.x=e,this.y=r,this.z=t,this},setFromMatrixColumn:function(t,e){var r=4*t,i=e.elements;return this.x=i[r],this.y=i[1+r],this.z=i[2+r],this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromAttribute:function(t,e,r){return void 0===r&&(r=0),e=e*t.itemSize+r,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this}},THREE.Vector4=function(t,e,r,i){this.x=t||0,this.y=e||0,this.z=r||0,this.w=void 0!==i?i:1},THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(t,e,r,i){return this.x=t,this.y=e,this.z=r,this.w=i,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){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: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):this.w=this.z=this.y=this.x=0,this},applyMatrix4:function(t){var e=this.x,r=this.y,i=this.z,n=this.w;return t=t.elements,this.x=t[0]*e+t[4]*r+t[8]*i+t[12]*n,this.y=t[1]*e+t[5]*r+t[9]*i+t[13]*n,this.z=t[2]*e+t[6]*r+t[10]*i+t[14]*n,this.w=t[3]*e+t[7]*r+t[11]*i+t[15]*n,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.z=this.y=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e=(t=t.elements)[0],r=t[4],i=t[8],n=t[1],o=t[5],a=t[9],s=t[2],h=t[6],c=t[10];return Math.abs(r-n)<.01&&Math.abs(i-s)<.01&&Math.abs(a-h)<.01?Math.abs(r+n)<.1&&Math.abs(i+s)<.1&&Math.abs(a+h)<.1&&Math.abs(e+o+c-3)<.1?this.set(1,0,0,0):(t=Math.PI,c=(c+1)/2,r=(r+n)/4,i=(i+s)/4,a=(a+h)/4,(o=(o+1)/2)<(e=(e+1)/2)&&cthis.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return(e||new THREE.Vector2).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){return(e||new THREE.Vector2).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var e=new THREE.Vector2;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},THREE.Box3=function(t,e){this.min=void 0!==t?t:new THREE.Vector3(1/0,1/0,1/0),this.max=void 0!==e?e:new THREE.Vector3(-1/0,-1/0,-1/0)},THREE.Box3.prototype={constructor:THREE.Box3,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return(e||new THREE.Vector3).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},clampPoint:function(t,e){return(e||new THREE.Vector3).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var e=new THREE.Vector3;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new THREE.Vector3;return function(t){return(t=t||new THREE.Sphere).center=this.center(),t.radius=.5*this.size(e).length(),t}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var e=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(t){return e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.makeEmpty(),this.setFromPoints(e),this}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),0this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(t){return(t=t||new THREE.Box3).set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius*=t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},THREE.Frustum=function(t,e,r,i,n,o){this.planes=[void 0!==t?t:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==r?r:new THREE.Plane,void 0!==i?i:new THREE.Plane,void 0!==n?n:new THREE.Plane,void 0!==o?o:new THREE.Plane]},THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(t,e,r,i,n,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(r),a[3].copy(i),a[4].copy(n),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,r=0;r<6;r++)e[r].copy(t.planes[r]);return this},setFromMatrix:function(t){var e=this.planes;t=(m=t.elements)[0];var r=m[1],i=m[2],n=m[3],o=m[4],a=m[5],s=m[6],h=m[7],c=m[8],u=m[9],l=m[10],E=m[11],p=m[12],d=m[13],f=m[14],m=m[15];return e[0].setComponents(n-t,h-o,E-c,m-p).normalize(),e[1].setComponents(n+t,h+o,E+c,m+p).normalize(),e[2].setComponents(n+r,h+a,E+u,m+d).normalize(),e[3].setComponents(n-r,h-a,E-u,m-d).normalize(),e[4].setComponents(n-i,h-s,E-l,m-f).normalize(),e[5].setComponents(n+i,h+s,E+l,m+f).normalize(),this},intersectsObject:function(){var r=new THREE.Sphere;return function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),r.copy(e.boundingSphere),r.applyMatrix4(t.matrixWorld),this.intersectsSphere(r)}}(),intersectsSphere:function(t){var e=this.planes,r=t.center;t=-t.radius;for(var i=0;i<6;i++)if(e[i].distanceToPoint(r)>=4,i[t]=r[19===t?3&e|8:e]);return i.join("")}}(),clamp:function(t,e,r){return Math.max(e,Math.min(r,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,r,i,n){return i+(t-e)*(n-i)/(r-e)},smoothstep:function(t,e,r){return t<=e?0:r<=t?1:(t=(t-e)/(r-e))*t*(3-2*t)},smootherstep:function(t,e,r){return t<=e?0:r<=t?1:(t=(t-e)/(r-e))*t*t*(t*(6*t-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(){var e=Math.PI/180;return function(t){return t*e}}(),radToDeg:function(){var e=180/Math.PI;return function(t){return t*e}}(),isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}},THREE.Spline=function(t){function e(t,e,r,i,n,o,a){return(2*(e-r)+(t=.5*(r-t))+(i=.5*(i-e)))*a+(-3*(e-r)-2*t-i)*o+t*n+e}this.points=t;var r,i,n,o,a,s,h,c,u,l=[],E={x:0,y:0,z:0};this.initFromArray=function(t){this.points=[];for(var e=0;ethis.points.length-2?this.points.length-1:i+1,l[3]=i>this.points.length-3?this.points.length-1:i+2,s=this.points[l[0]],h=this.points[l[1]],c=this.points[l[2]],u=this.points[l[3]],a=n*(o=n*n),E.x=e(s.x,h.x,c.x,u.x,n,o,a),E.y=e(s.y,h.y,c.y,u.y,n,o,a),E.z=e(s.z,h.z,c.z,u.z,n,o,a),E},this.getControlPointsArray=function(){for(var t,e=this.points.length,r=[],i=0;i=this.keys[this.lastIndex].time;)this.lastIndex++;for(;0=this.keys.length)return this.setResult(this.keys[this.keys.length-1].value),this.result;if(0===this.lastIndex)return this.setResult(this.keys[0].value),this.result;var e=this.keys[this.lastIndex-1];if(this.setResult(e.value),e.constantToNext)return this.result;var r=this.keys[this.lastIndex];return this.result=this.lerpValues(this.result,r.value,(t-e.time)/(r.time-e.time))},shift:function(t){if(0!==t)for(var e=0;e=e;i++)n++;return 0r.time)return void console.error(" key.time is less than previous key time, out of order keys",this,e,r,t);t=r}return this}console.error(" track is empty, no keys",this)},optimize:function(){var t=[],e=this.keys[0];t.push(e),THREE.AnimationUtils.getEqualsFunc(e.value);for(var r=1;ro.far||a.push({distance:i,distanceToRay:Math.sqrt(n),point:r.clone(),index:e,face:null,object:s}))}var s=this,e=s.geometry,r=o.params.Points.threshold;if(l.getInverse(this.matrixWorld),E.copy(o.ray).applyMatrix4(l),null===e.boundingBox||!1!==E.isIntersectionBox(e.boundingBox)){var h=(r=r/((this.scale.x+this.scale.y+this.scale.z)/3))*r,r=new THREE.Vector3;if(e instanceof THREE.BufferGeometry){var i=e.index,e=e.attributes.position.array;if(null!==i)for(var n=i.array,i=0,c=n.length;it.far||e.push({distance:E,point:o.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}))}else for(h=0,l=(c=c.position.array).length/3-1;ht.far||e.push({distance:E,point:o.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}))}else if(u instanceof THREE.Geometry)for(n=(i=u.vertices).length,h=0;ht.far||e.push({distance:E,point:o.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}))}}}(),THREE.Line.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},THREE.LineStrip=0,THREE.LinePieces=1,THREE.LineSegments=function(t,e){THREE.Line.call(this,t,e),this.type="LineSegments"},THREE.LineSegments.prototype=Object.create(THREE.Line.prototype),THREE.LineSegments.prototype.constructor=THREE.LineSegments,THREE.Mesh=function(t,e){THREE.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new THREE.Geometry,this.material=void 0!==e?e:new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0e.far?null:{distance:r,point:h.clone(),object:t})}function x(t,e,r,i,n,o,a,s){return S.fromArray(i,3*o),_.fromArray(i,3*a),A.fromArray(i,3*s),(t=H(t,e,r,S,_,A,F))&&(n&&(D.fromArray(n,2*o),k.fromArray(n,2*a),V.fromArray(n,2*s),t.uv=v(F,S,_,A,D,k,V)),t.face=new THREE.Face3(o,a,s,THREE.Triangle.normal(S,_,A)),t.faceIndex=o),t}var b=new THREE.Matrix4,w=new THREE.Ray,M=new THREE.Sphere,S=new THREE.Vector3,_=new THREE.Vector3,A=new THREE.Vector3,C=new THREE.Vector3,L=new THREE.Vector3,P=new THREE.Vector3,D=new THREE.Vector2,k=new THREE.Vector2,V=new THREE.Vector2,s=new THREE.Vector3,F=new THREE.Vector3,h=new THREE.Vector3;return function(t,e){var r=this.geometry;if(void 0!==(o=this.material)){null===r.boundingSphere&&r.computeBoundingSphere();var i,n=this.matrixWorld;if(M.copy(r.boundingSphere),M.applyMatrix4(n),!1!==t.ray.isIntersectionSphere(M)&&(b.getInverse(n),w.copy(t.ray).applyMatrix4(b),null===r.boundingBox||!1!==w.isIntersectionBox(r.boundingBox)))if(r instanceof THREE.BufferGeometry){var o=r.index,r=(n=r.attributes).position.array;if(void 0!==n.uv&&(i=n.uv.array),null!==o)for(var a=0,s=(n=o.array).length;a=e[r].distance;r++)e[r-1].object.visible=!1,e[r].object.visible=!0;for(;rthis.scale.x*this.scale.y||e.push({distance:Math.sqrt(r),point:this.position,face:null,object:this})}}(),THREE.Sprite.prototype.clone=function(){return new this.constructor(this.material).copy(this)},THREE.Particle=THREE.Sprite,THREE.LensFlare=function(t,e,r,i,n){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,(this.customUpdateCallback=void 0)!==t&&this.add(t,e,r,i,n)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.constructor=THREE.LensFlare,THREE.LensFlare.prototype.add=function(t,e,r,i,n,o){void 0===e&&(e=-1),void 0===r&&(r=0),void 0===o&&(o=1),void 0===n&&(n=new THREE.Color(16777215)),void 0===i&&(i=THREE.NormalBlending),r=Math.min(r,Math.max(0,r)),this.lensFlares.push({texture:t,size:e,distance:r,x:0,y:0,z:0,scale:1,rotation:0,opacity:o,color:n,blending:i})},THREE.LensFlare.prototype.updateLensFlares=function(){for(var t,e=this.lensFlares.length,r=2*-this.positionScreen.x,i=2*-this.positionScreen.y,n=0;n dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")},distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new THREE.Vector3(0,0,0)}},vertexShader:["varying vec4 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.begin_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.project_vertex,THREE.ShaderChunk.worldpos_vertex,"vWorldPosition = worldPosition;\n}"].join("\n"),fragmentShader:["uniform vec3 lightPos;\nvarying vec4 vWorldPosition;",THREE.ShaderChunk.common,"vec4 pack1K ( float depth ) {\n depth /= 1000.0;\n const vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = fract( depth * bitSh );\n\tres -= res.xxyz * bitMsk;\n\treturn res; \n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}"].join("\n")}},THREE.WebGLRenderer=function(t){function r(t,e,r,i){!0===A&&(t*=i,e*=i,r*=i),tt.clearColor(t,e,r,i)}function e(){yt.init(),tt.viewport(z,W,j,at),r(L.r,L.g,L.b,P)}function i(){nt=rt=null,it=-1,pt=!(I=""),yt.reset()}function n(t){t.preventDefault(),i(),e(),Rt.clear()}function d(t){(t=t.target).removeEventListener("dispose",d);t:{var e=Rt.get(t);if(t.image&&e.__image__webglTextureCube)tt.deleteTexture(e.__image__webglTextureCube);else{if(void 0===e.__webglInit)break t;tt.deleteTexture(e.__webglTexture)}Rt.delete(t)}ft.textures--}function s(t){(t=t.target).removeEventListener("dispose",s);var e=Rt.get(t),r=Rt.get(t.texture);if(t&&void 0!==r.__webglTexture){if(tt.deleteTexture(r.__webglTexture),t instanceof THREE.WebGLRenderTargetCube)for(r=0;r<6;r++)tt.deleteFramebuffer(e.__webglFramebuffer[r]),tt.deleteRenderbuffer(e.__webglRenderbuffer[r]);else tt.deleteFramebuffer(e.__webglFramebuffer),tt.deleteRenderbuffer(e.__webglRenderbuffer);Rt.delete(t.texture),Rt.delete(t)}ft.textures--}function X(t){(t=t.target).removeEventListener("dispose",X),q(t),Rt.delete(t)}function q(t){var e=Rt.get(t).program;(t.program=void 0)!==e&&Ht.releaseProgram(e)}function y(t,e){return e[0]-t[0]}function o(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function a(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function u(t,e,r,i,n){var o=r.transparent?(i=F,++U):(i=k,++V);void 0!==(o=i[o])?(o.id=t.id,o.object=t,o.geometry=e,o.material=r,o.z=lt.z,o.group=n):(o={id:t.id,object:t,geometry:e,material:r,z:lt.z,group:n},i.push(o))}function h(t,e,r,i,n){for(var o=0,a=t.length;o=gt.maxTextures&&console.warn("WebGLRenderer: trying to use "+t+" texture units while this GPU supports only "+gt.maxTextures),ot+=1,t}function Q(t,e,r,i){t[e+0]=r.r*i,t[e+1]=r.g*i,t[e+2]=r.b*i}function f(t,e,r){r?(tt.texParameteri(t,tt.TEXTURE_WRAP_S,g(e.wrapS)),tt.texParameteri(t,tt.TEXTURE_WRAP_T,g(e.wrapT)),tt.texParameteri(t,tt.TEXTURE_MAG_FILTER,g(e.magFilter)),tt.texParameteri(t,tt.TEXTURE_MIN_FILTER,g(e.minFilter))):(tt.texParameteri(t,tt.TEXTURE_WRAP_S,tt.CLAMP_TO_EDGE),tt.texParameteri(t,tt.TEXTURE_WRAP_T,tt.CLAMP_TO_EDGE),e.wrapS===THREE.ClampToEdgeWrapping&&e.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",e),tt.texParameteri(t,tt.TEXTURE_MAG_FILTER,E(e.magFilter)),tt.texParameteri(t,tt.TEXTURE_MIN_FILTER,E(e.minFilter)),e.minFilter!==THREE.NearestFilter&&e.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",e)),!(r=Tt.get("EXT_texture_filter_anisotropic"))||e.type===THREE.FloatType&&null===Tt.get("OES_texture_float_linear")||e.type===THREE.HalfFloatType&&null===Tt.get("OES_texture_half_float_linear")||!(1e||t.height>e){var r=e/Math.max(t.width,t.height),i=document.createElement("canvas");return i.width=Math.floor(t.width*r),i.height=Math.floor(t.height*r),i.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+i.width+"x"+i.height,t),i}return t}function T(t){return THREE.Math.isPowerOfTwo(t.width)&&THREE.Math.isPowerOfTwo(t.height)}function Z(t,e){var r=Rt.get(t);if(6===t.image.length)if(0 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),D.compileShader(i),D.compileShader(n),D.attachShader(r,i),D.attachShader(r,n),D.linkProgram(r),L=r,M=D.getAttribLocation(L,"position"),S=D.getAttribLocation(L,"uv"),l=D.getUniformLocation(L,"uvOffset"),E=D.getUniformLocation(L,"uvScale"),p=D.getUniformLocation(L,"rotation"),d=D.getUniformLocation(L,"scale"),f=D.getUniformLocation(L,"color"),m=D.getUniformLocation(L,"map"),T=D.getUniformLocation(L,"opacity"),g=D.getUniformLocation(L,"modelViewMatrix"),y=D.getUniformLocation(L,"projectionMatrix"),R=D.getUniformLocation(L,"fogType"),v=D.getUniformLocation(L,"fogDensity"),H=D.getUniformLocation(L,"fogNear"),x=D.getUniformLocation(L,"fogFar"),b=D.getUniformLocation(L,"fogColor"),w=D.getUniformLocation(L,"alphaTest"),(r=document.createElement("canvas")).width=8,r.height=8,(i=r.getContext("2d")).fillStyle="white",i.fillRect(0,0,8,8),(P=new THREE.Texture(r)).needsUpdate=!0),D.useProgram(L),k.initAttributes(),k.enableAttribute(M),k.enableAttribute(S),k.disableUnusedAttributes(),k.disable(D.CULL_FACE),k.enable(D.BLEND),D.bindBuffer(D.ARRAY_BUFFER,A),D.vertexAttribPointer(M,2,D.FLOAT,!1,16,0),D.vertexAttribPointer(S,2,D.FLOAT,!1,16,8),D.bindBuffer(D.ELEMENT_ARRAY_BUFFER,C),D.uniformMatrix4fv(y,!1,e.projectionMatrix.elements),k.activeTexture(D.TEXTURE0),D.uniform1i(m,0),i=r=0,(n=t.fog)?(D.uniform3f(b,n.color.r,n.color.g,n.color.b),n instanceof THREE.Fog?(D.uniform1f(H,n.near),D.uniform1f(x,n.far),D.uniform1i(R,1),i=r=1):n instanceof THREE.FogExp2&&(D.uniform1f(v,n.density),D.uniform1i(R,2),i=r=2)):(D.uniform1i(R,0),i=r=0);for(var n=0,o=u.length;n(d-u)*(T-p)-(f-p)*(m-u))_=!1;else{for(var g,y,R,v=E=l=void 0,H=m-d,x=T-f,b=u-m,w=p-T,M=d-u,S=f-p,_=0;_=-Number.EPSILON&&y>=-Number.EPSILON&&g>=-Number.EPSILON)){_=!1;break t}_=!0}}if(_){for(n.push([t[o[s]],t[o[c]],t[o[i]]]),a.push([o[s],o[c],o[i]]),i=(s=c)+1;iNumber.EPSILON){if(0Number.EPSILON?(e=a*r-i*e,0=e)return t=this.curves[i],e=1-(r[i]-e)/t.getLength(),t.getPointAt(e);i++}return null},THREE.CurvePath.prototype.getLength=function(){var t=this.getCurveLengths();return t[t.length-1]},THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,r=0,i=this.curves.length;rNumber.EPSILON){if(c<0&&(a=e[o],h=-h,s=e[n],c=-c),!(t.ys.y))if(t.y===a.y){if(t.x===a.x)return 1}else{if(0===(n=c*(t.x-a.x)-h*(t.y-a.y)))return 1;n<0||(i=!i)}}else if(t.y===a.y&&(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x))return 1}return i}(p.p,l[f].p)||(i!==f&&a.push({froms:i,tos:f,hole:c}),h?(h=!1,u[f].push(p)):d=!0);h&&u[i].push(p)}0n.length-2?n.length-1:o+1],n=n[o>n.length-3?n.length-1:o+2],o=THREE.CurveUtils.interpolate;return new THREE.Vector2(o(e.x,r.x,i.x,n.x,t),o(e.y,r.y,i.y,n.y,t))},THREE.EllipseCurve=function(t,e,r,i,n,o,a,s){this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0},THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype),THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve,THREE.EllipseCurve.prototype.getPoint=function(t){var e=this.aEndAngle-this.aStartAngle;e<0&&(e+=2*Math.PI),e>2*Math.PI&&(e-=2*Math.PI),e=!0===this.aClockwise?this.aEndAngle+(1-t)*(2*Math.PI-e):this.aStartAngle+t*e,t=this.aX+this.xRadius*Math.cos(e);var r,i,n=this.aY+this.yRadius*Math.sin(e);return 0!==this.aRotation&&(e=Math.cos(this.aRotation),r=Math.sin(this.aRotation),t=((i=t)-this.aX)*e-(n-this.aY)*r+this.aX,n=(i-this.aX)*r+(n-this.aY)*e+this.aY),new THREE.Vector2(t,n)},THREE.ArcCurve=function(t,e,r,i,n,o){THREE.EllipseCurve.call(this,t,e,r,r,i,n,o)},THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.ArcCurve.prototype.constructor=THREE.ArcCurve,THREE.LineCurve3=THREE.Curve.create(function(t,e){this.v1=t,this.v2=e},function(t){var e=new THREE.Vector3;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(t,e,r){this.v0=t,this.v1=e,this.v2=r},function(t){var e=THREE.ShapeUtils.b2;return new THREE.Vector3(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y),e(t,this.v0.z,this.v1.z,this.v2.z))}),THREE.CubicBezierCurve3=THREE.Curve.create(function(t,e,r,i){this.v0=t,this.v1=e,this.v2=r,this.v3=i},function(t){var e=THREE.ShapeUtils.b3;return new THREE.Vector3(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e(t,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),THREE.SplineCurve3=THREE.Curve.create(function(t){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),this.points=null==t?[]:t},function(t){t*=(n=this.points).length-1,t-=o=Math.floor(t);var e=n[0==o?o:o-1],r=n[o],i=n[o>n.length-2?n.length-1:o+1],n=n[o>n.length-3?n.length-1:o+2],o=THREE.CurveUtils.interpolate;return new THREE.Vector3(o(e.x,r.x,i.x,n.x,t),o(e.y,r.y,i.y,n.y,t),o(e.z,r.z,i.z,n.z,t))}),THREE.CatmullRomCurve3=function(){function t(){}var h=new THREE.Vector3,c=new t,u=new t,l=new t;return t.prototype.init=function(t,e,r,i){this.c0=t,this.c1=r,this.c2=-3*t+3*e-2*r-i,this.c3=2*t-2*e+r+i},t.prototype.initNonuniformCatmullRom=function(t,e,r,i,n,o,a){t=((e-t)/n-(r-t)/(n+o)+(r-e)/o)*o,i=((r-e)/o-(i-e)/(o+a)+(i-r)/a)*o,this.init(e,r,t,i)},t.prototype.initCatmullRom=function(t,e,r,i,n){this.init(e,r,n*(r-t),n*(i-e))},t.prototype.calc=function(t){var e=t*t;return this.c0+this.c1*t+this.c2*e+this.c3*e*t},THREE.Curve.create(function(t){this.points=t||[]},function(t){var e,r,i,n,o,a,s=this.points;return(n=s.length)<2&&console.log("duh, you need at least 2 points"),t*=n-1,0===(t-=o=Math.floor(t))&&o===n-1&&(o=n-2,t=1),e=0===o?(h.subVectors(s[0],s[1]).add(s[0]),h):s[o-1],r=s[o],i=s[o+1],s=o+2Number.EPSILON){var h=Math.sqrt(s),c=Math.sqrt(o*o+a*a),s=e.x-n/h;if(e=e.y+i/h,(i=(r=s+i*(o=((r.x-a/c-s)*a-(r.y+o/c-e)*o)/(i*a-n*o))-t.x)*r+(t=e+n*o-t.y)*t)<=2)return new THREE.Vector2(r,t);i=Math.sqrt(i/2)}else t=!1,i>Number.EPSILON?o>Number.EPSILON&&(t=!0):i<-Number.EPSILON?o<-Number.EPSILON&&(t=!0):Math.sign(n)===Math.sign(a)&&(t=!0),i=t?(r=-n,t=i,Math.sqrt(s)):(r=i,t=n,Math.sqrt(s/2));return new THREE.Vector2(r/i,t/i)}function n(t,e){var r,i;for(V=t.length;0<=--V;){(i=(r=V)-1)<0&&(i=t.length-1);for(var n=0,o=g+2*f,n=0;nNumber.EPSILON&&(u.normalize(),a=Math.acos(THREE.Math.clamp(s[i-1].dot(s[i]),-1,1)),h[i].applyMatrix4(l.makeRotationAxis(u,a))),c[i].crossVectors(s[i],h[i]);if(r)for(a=Math.acos(THREE.Math.clamp(h[0].dot(h[e-1]),-1,1)),a/=e-1,0h.end&&(h.end=o),e=e||s)}for(s in i)h=i[s],this.createAnimation(s,h.start,h.end,t);this.firstAnimation=e},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(t){(t=this.animationsMap[t])&&(t.direction=1,t.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(t){(t=this.animationsMap[t])&&(t.direction=-1,t.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(t,e){var r=this.animationsMap[t];r&&(r.fps=e,r.duration=(r.end-r.start)/r.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(t,e){var r=this.animationsMap[t];r&&(r.duration=e,r.fps=(r.end-r.start)/r.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(t,e){var r=this.animationsMap[t];r&&(r.weight=e)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(t,e){var r=this.animationsMap[t];r&&(r.time=e)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(t){var e=0;return(t=this.animationsMap[t])&&(e=t.time),e},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(t){var e=-1;return(t=this.animationsMap[t])&&(e=t.duration),e},THREE.MorphBlendMesh.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(t){(t=this.animationsMap[t])&&(t.active=!1)},THREE.MorphBlendMesh.prototype.update=function(t){for(var e=0,r=this.animationsList.length;ea.duration||a.time<0)&&(a.direction*=-1,a.time>a.duration&&(a.time=a.duration,a.directionBackwards=!0),a.time<0&&(a.time=0,a.directionBackwards=!1)):(a.time%=a.duration,a.time<0&&(a.time+=a.duration)),n=a.start+THREE.Math.clamp(Math.floor(a.time/i),0,a.length-1),o=a.weight,n!==a.currentFrame&&(this.morphTargetInfluences[a.lastFrame]=0,this.morphTargetInfluences[a.currentFrame]=+o,this.morphTargetInfluences[n]=0,a.lastFrame=a.currentFrame,a.currentFrame=n),i=a.time%i/i,a.directionBackwards&&(i=1-i),a.currentFrame!==a.lastFrame?(this.morphTargetInfluences[a.currentFrame]=i*o,this.morphTargetInfluences[a.lastFrame]=(1-i)*o):this.morphTargetInfluences[a.currentFrame]=o)}};