1241 lines
776 KiB
JavaScript
1241 lines
776 KiB
JavaScript
|
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(q,G,ba){q!=Array.prototype&&q!=Object.prototype&&(q[G]=ba.value)};$jscomp.getGlobal=function(q){return"undefined"!=typeof window&&window===q?q:"undefined"!=typeof global&&null!=global?global:q};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
|
||
|
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.Symbol=function(){var q=0;return function(G){return $jscomp.SYMBOL_PREFIX+(G||"")+q++}}();
|
||
|
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var q=$jscomp.global.Symbol.iterator;q||(q=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[q]&&$jscomp.defineProperty(Array.prototype,q,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(q){var G=0;return $jscomp.iteratorPrototype(function(){return G<q.length?{done:!1,value:q[G++]}:{done:!0}})};
|
||
|
$jscomp.iteratorPrototype=function(q){$jscomp.initSymbolIterator();q={next:q};q[$jscomp.global.Symbol.iterator]=function(){return this};return q};$jscomp.makeIterator=function(q){$jscomp.initSymbolIterator();var G=q[Symbol.iterator];return G?G.call(q):$jscomp.arrayIterator(q)};
|
||
|
$jscomp.polyfill=function(q,G,ba,ka){if(G){ba=$jscomp.global;q=q.split(".");for(ka=0;ka<q.length-1;ka++){var K=q[ka];K in ba||(ba[K]={});ba=ba[K]}q=q[q.length-1];ka=ba[q];G=G(ka);G!=ka&&null!=G&&$jscomp.defineProperty(ba,q,{configurable:!0,writable:!0,value:G})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
|
||
|
$jscomp.polyfill("Promise",function(q){function G(){this.batch_=null}function ba(q){return q instanceof K?q:new K(function(x,p){x(q)})}if(q&&!$jscomp.FORCE_POLYFILL_PROMISE)return q;G.prototype.asyncExecute=function(q){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(q);return this};G.prototype.asyncExecuteBatch_=function(){var q=this;this.asyncExecuteFunction(function(){q.executeBatch_()})};var ka=$jscomp.global.setTimeout;G.prototype.asyncExecuteFunction=function(q){ka(q,
|
||
|
0)};G.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var q=this.batch_;this.batch_=[];for(var x=0;x<q.length;++x){var p=q[x];q[x]=null;try{p()}catch(Ja){this.asyncThrow_(Ja)}}}this.batch_=null};G.prototype.asyncThrow_=function(q){this.asyncExecuteFunction(function(){throw q;})};var K=function(q){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var x=this.createResolveAndReject_();try{q(x.resolve,x.reject)}catch(p){x.reject(p)}};K.prototype.createResolveAndReject_=
|
||
|
function(){function q(q){return function(V){p||(p=!0,q.call(x,V))}}var x=this,p=!1;return{resolve:q(this.resolveTo_),reject:q(this.reject_)}};K.prototype.resolveTo_=function(q){if(q===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(q instanceof K)this.settleSameAsPromise_(q);else{a:switch(typeof q){case "object":var x=null!=q;break a;case "function":x=!0;break a;default:x=!1}x?this.resolveToNonPromiseObj_(q):this.fulfill_(q)}};K.prototype.resolveToNonPromiseObj_=function(q){var x=
|
||
|
void 0;try{x=q.then}catch(p){this.reject_(p);return}"function"==typeof x?this.settleSameAsThenable_(x,q):this.fulfill_(q)};K.prototype.reject_=function(q){this.settle_(2,q)};K.prototype.fulfill_=function(q){this.settle_(1,q)};K.prototype.settle_=function(q,x){if(0!=this.state_)throw Error("Cannot settle("+q+", "+x+"): Promise already settled in state"+this.state_);this.state_=q;this.result_=x;this.executeOnSettledCallbacks_()};K.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var q=
|
||
|
0;q<this.onSettledCallbacks_.length;++q)x.asyncExecute(this.onSettledCallbacks_[q]);this.onSettledCallbacks_=null}};var x=new G;K.prototype.settleSameAsPromise_=function(q){var x=this.createResolveAndReject_();q.callWhenSettled_(x.resolve,x.reject)};K.prototype.settleSameAsThenable_=function(q,x){var p=this.createResolveAndReject_();try{q.call(x,p.resolve,p.reject)}catch(Ja){p.reject(Ja)}};K.prototype.then=function(q,x){function p(p,q){return"function"==typeof p?function(q){try{G(p(q))}catch(nb){V(nb)}}:
|
||
|
q}var G,V,sa=new K(function(p,q){G=p;V=q});this.callWhenSettled_(p(q,G),p(x,V));return sa};K.prototype.catch=function(q){return this.then(void 0,q)};K.prototype.callWhenSettled_=function(q,G){function p(){switch(V.state_){case 1:q(V.result_);break;case 2:G(V.result_);break;default:throw Error("Unexpected state: "+V.state_);}}var V=this;null==this.onSettledCallbacks_?x.asyncExecute(p):this.onSettledCallbacks_.push(p)};K.resolve=ba;K.reject=function(q){return new K(function(x,p){p(q)})};K.race=function(q){return new K(function(x,
|
||
|
p){for(var G=$jscomp.makeIterator(q),V=G.next();!V.done;V=G.next())ba(V.value).callWhenSettled_(x,p)})};K.all=function(q){var x=$jscomp.makeIterator(q),p=x.next();return p.done?ba([]):new K(function(q,G){function V(p){return function(x){K[p]=x;sa--;0==sa&&q(K)}}var K=[],sa=0;do K.push(void 0),sa++,ba(p.value).callWhenSettled_(V(K.length-1),G),p=x.next();while(!p.done)})};return K},"es6","es3");
|
||
|
$jscomp.iteratorFromArray=function(q,G){$jscomp.initSymbolIterator();q instanceof String&&(q+="");var ba=0,ka={next:function(){if(ba<q.length){var K=ba++;return{value:G(K,q[K]),done:!1}}ka.next=function(){return{done:!0,value:void 0}};return ka.next()}};ka[Symbol.iterator]=function(){return ka};return ka};$jscomp.polyfill("Array.prototype.keys",function(q){return q?q:function(){return $jscomp.iteratorFromArray(this,function(q){return q})}},"es6","es3");
|
||
|
$jscomp.polyfill("Array.prototype.entries",function(q){return q?q:function(){return $jscomp.iteratorFromArray(this,function(q,ba){return[q,ba]})}},"es6","es3");$jscomp.polyfill("Object.getOwnPropertySymbols",function(q){return q?q:function(){return[]}},"es6","es5");$jscomp.underscoreProtoCanBeSet=function(){var q={a:!0},G={};try{return G.__proto__=q,G.a}catch(ba){}return!1};
|
||
|
$jscomp.setPrototypeOf="function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(q,G){q.__proto__=G;if(q.__proto__!==G)throw new TypeError(q+" is not extensible");return q}:null;$jscomp.polyfill("Object.setPrototypeOf",function(q){return q||$jscomp.setPrototypeOf},"es6","es5");$jscomp.owns=function(q,G){return Object.prototype.hasOwnProperty.call(q,G)};
|
||
|
$jscomp.assign="function"==typeof Object.assign?Object.assign:function(q,G){for(var ba=1;ba<arguments.length;ba++){var ka=arguments[ba];if(ka)for(var K in ka)$jscomp.owns(ka,K)&&(q[K]=ka[K])}return q};$jscomp.polyfill("Object.assign",function(q){return q||$jscomp.assign},"es6","es3");$jscomp.polyfill("Number.EPSILON",function(q){return Math.pow(2,-52)},"es6","es3");
|
||
|
$jscomp.checkStringArgs=function(q,G,ba){if(null==q)throw new TypeError("The 'this' value for String.prototype."+ba+" must not be null or undefined");if(G instanceof RegExp)throw new TypeError("First argument to String.prototype."+ba+" must not be a regular expression");return q+""};
|
||
|
$jscomp.polyfill("String.prototype.repeat",function(q){return q?q:function(q){var G=$jscomp.checkStringArgs(this,null,"repeat");if(0>q||1342177279<q)throw new RangeError("Invalid count value");q|=0;for(var ka="";q;)if(q&1&&(ka+=G),q>>>=1)G+=G;return ka}},"es6","es3");$jscomp.checkEs6ConformanceViaProxy=function(){try{var q={},G=Object.create(new $jscomp.global.Proxy(q,{get:function(ba,ka,K){return ba==q&&"q"==ka&&K==G}}));return!0===G.q}catch(ba){return!1}};
|
||
|
$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS=!1;$jscomp.ES6_CONFORMANCE=$jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS&&$jscomp.checkEs6ConformanceViaProxy();
|
||
|
$jscomp.polyfill("WeakMap",function(q){function G(){if(!q||!Object.seal)return!1;try{var x=Object.seal({}),p=Object.seal({}),G=new q([[x,2],[p,3]]);if(2!=G.get(x)||3!=G.get(p))return!1;G.delete(x);G.set(p,4);return!G.has(x)&&4==G.get(p)}catch(ra){return!1}}function ba(q){$jscomp.owns(q,K)||$jscomp.defineProperty(q,K,{value:{}})}function ka(q){var p=Object[q];p&&(Object[q]=function(q){ba(q);return p(q)})}if($jscomp.USE_PROXY_FOR_ES6_CONFORMANCE_CHECKS){if(q&&$jscomp.ES6_CONFORMANCE)return q}else if(G())return q;
|
||
|
var K="$jscomp_hidden_"+Math.random();ka("freeze");ka("preventExtensions");ka("seal");var x=0,V=function(q){this.id_=(x+=Math.random()+1).toString();if(q){$jscomp.initSymbol();$jscomp.initSymbolIterator();q=$jscomp.makeIterator(q);for(var p;!(p=q.next()).done;)p=p.value,this.set(p[0],p[1])}};V.prototype.set=function(q,p){ba(q);if(!$jscomp.owns(q,K))throw Error("WeakMap key fail: "+q);q[K][this.id_]=p;return this};V.prototype.get=function(q){return $jscomp.owns(q,K)?q[K][this.id_]:void 0};V.prototype.has=
|
||
|
function(q){return $jscomp.owns(q,K)&&$jscomp.owns(q[K],this.id_)};V.prototype.delete=function(q){return $jscomp.owns(q,K)&&$jscomp.owns(q[K],this.id_)?delete q[K][this.id_]:!1};return V},"es6","es3");$jscomp.polyfill("Math.sign",function(q){return q?q:function(q){q=Number(q);return 0===q||isNaN(q)?q:0<q?1:-1}},"es6","es3");$jscomp.polyfill("Array.prototype.values",function(q){return q?q:function(){return $jscomp.iteratorFromArray(this,function(q,ba){return ba})}},"es8","es3");
|
||
|
$jscomp.polyfill("Number.isFinite",function(q){return q?q:function(q){return"number"!==typeof q?!1:!isNaN(q)&&Infinity!==q&&-Infinity!==q}},"es6","es3");$jscomp.polyfill("Number.isInteger",function(q){return q?q:function(q){return Number.isFinite(q)?q===Math.floor(q):!1}},"es6","es3");$jscomp.polyfill("Number.parseInt",function(q){return q||parseInt},"es6","es3");$jscomp.polyfill("Math.log2",function(q){return q?q:function(q){return Math.log(q)/Math.LN2}},"es6","es3");
|
||
|
(function(q,G){"object"===typeof exports&&"undefined"!==typeof module?G(exports):"function"===typeof define&&define.amd?define(["exports"],G):G(q.WHS={})})(this,function(q){function G(f,h){return h={exports:{}},f(h,h.exports),h.exports}function ba(f){var h,a;this.promise=new f(function(b,c){if(void 0!==h||void 0!==a)throw TypeError("Bad Promise constructor");h=b;a=c});this.resolve=ob(h);this.reject=ob(a)}function ka(f,h){for(var a=0;a<h.length;a++){var b=h[a];b.enumerable=b.enumerable||!1;b.configurable=
|
||
|
!0;"value"in b&&(b.writable=!0);Mg.defineProperty(f,b.key,b)}}function K(){}function x(f,h){this.x=f||0;this.y=h||0}function V(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function sa(f,h,a,b){this._x=f||0;this._y=h||0;this._z=a||0;this._w=void 0!==b?b:1}function p(f,h,a){this.x=f||0;this.y=h||0;this.z=a||0}function Ja(){this.elements=[1,0,0,0,1,0,0,0,1];0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}
|
||
|
function ra(f,h,a,b,c,d,e,g,k,l){Object.defineProperty(this,"id",{value:dk++});this.uuid=ja.generateUUID();this.name="";this.image=void 0!==f?f:ra.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==h?h:ra.DEFAULT_MAPPING;this.wrapS=void 0!==a?a:1001;this.wrapT=void 0!==b?b:1001;this.magFilter=void 0!==c?c:1006;this.minFilter=void 0!==d?d:1008;this.anisotropy=void 0!==k?k:1;this.format=void 0!==e?e:1023;this.type=void 0!==g?g:1009;this.offset=new x(0,0);this.repeat=new x(1,1);this.center=new x(0,
|
||
|
0);this.rotation=0;this.matrixAutoUpdate=!0;this.matrix=new Ja;this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this.encoding=void 0!==l?l:3E3;this.version=0;this.onUpdate=null}function ya(f,h,a,b){this.x=f||0;this.y=h||0;this.z=a||0;this.w=void 0!==b?b:1}function Oa(f,h,a){this.width=f;this.height=h;this.scissor=new ya(0,0,f,h);this.scissorTest=!1;this.viewport=new ya(0,0,f,h);a=a||{};void 0===a.minFilter&&(a.minFilter=1006);this.texture=new ra(void 0,void 0,
|
||
|
a.wrapS,a.wrapT,a.magFilter,a.minFilter,a.format,a.type,a.anisotropy,a.encoding);this.depthBuffer=void 0!==a.depthBuffer?a.depthBuffer:!0;this.stencilBuffer=void 0!==a.stencilBuffer?a.stencilBuffer:!0;this.depthTexture=void 0!==a.depthTexture?a.depthTexture:null}function Yc(f,h,a){Oa.call(this,f,h,a);this.activeMipMapLevel=this.activeCubeFace=0}function Yb(f,h,a,b,c,d,e,g,k,l,n,m){ra.call(this,null,d,e,g,k,l,b,c,n,m);this.image={data:f,width:h,height:a};this.magFilter=void 0!==k?k:1003;this.minFilter=
|
||
|
void 0!==l?l:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1}function nb(f,h){this.min=void 0!==f?f:new p(Infinity,Infinity,Infinity);this.max=void 0!==h?h:new p(-Infinity,-Infinity,-Infinity)}function pb(f,h){this.center=void 0!==f?f:new p;this.radius=void 0!==h?h:0}function ib(f,h){this.normal=void 0!==f?f:new p(1,0,0);this.constant=void 0!==h?h:0}function Ye(f,h,a,b,c,d){this.planes=[void 0!==f?f:new ib,void 0!==h?h:new ib,void 0!==a?a:new ib,void 0!==b?b:new ib,void 0!==c?c:new ib,
|
||
|
void 0!==d?d:new ib]}function S(f,h,a){return void 0===h&&void 0===a?this.set(f):this.setRGB(f,h,a)}function ek(f){function h(a,c){var b=a.array,e=a.dynamic?f.DYNAMIC_DRAW:f.STATIC_DRAW,g=f.createBuffer();f.bindBuffer(c,g);f.bufferData(c,b,e);a.onUploadCallback();c=f.FLOAT;b instanceof Float32Array?c=f.FLOAT:b instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):b instanceof Uint16Array?c=f.UNSIGNED_SHORT:b instanceof Int16Array?c=f.SHORT:b instanceof
|
||
|
Uint32Array?c=f.UNSIGNED_INT:b instanceof Int32Array?c=f.INT:b instanceof Int8Array?c=f.BYTE:b instanceof Uint8Array&&(c=f.UNSIGNED_BYTE);return{buffer:g,type:c,bytesPerElement:b.BYTES_PER_ELEMENT,version:a.version}}var a=new WeakMap;return{get:function(b){b.isInterleavedBufferAttribute&&(b=b.data);return a.get(b)},remove:function(b){b.isInterleavedBufferAttribute&&(b=b.data);var c=a.get(b);c&&(f.deleteBuffer(c.buffer),a.delete(b))},update:function(b,c){b.isInterleavedBufferAttribute&&(b=b.data);
|
||
|
var d=a.get(b);if(void 0===d)a.set(b,h(b,c));else if(d.version<b.version){var e=b,g=e.array,k=e.updateRange;f.bindBuffer(c,d.buffer);!1===e.dynamic?f.bufferData(c,g,f.STATIC_DRAW):-1===k.count?f.bufferSubData(c,0,g):0===k.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(f.bufferSubData(c,k.offset*g.BYTES_PER_ELEMENT,g.subarray(k.offset,k.offset+k.count)),k.count=
|
||
|
-1);d.version=b.version}}}}function rc(f,h,a,b){this._x=f||0;this._y=h||0;this._z=a||0;this._order=b||rc.DefaultOrder}function Ng(){this.mask=1}function O(){Object.defineProperty(this,"id",{value:fk++});this.uuid=ja.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=O.DefaultUp.clone();var f=new p,h=new rc,a=new sa,b=new p(1,1,1);h.onChange(function(){a.setFromEuler(h,!1)});a.onChange(function(){h.setFromQuaternion(a,void 0,!1)});Object.defineProperties(this,
|
||
|
{position:{enumerable:!0,value:f},rotation:{enumerable:!0,value:h},quaternion:{enumerable:!0,value:a},scale:{enumerable:!0,value:b},modelViewMatrix:{value:new V},normalMatrix:{value:new Ja}});this.matrix=new V;this.matrixWorld=new V;this.matrixAutoUpdate=O.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.layers=new Ng;this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={}}function Ab(){O.call(this);this.type="Camera";this.matrixWorldInverse=
|
||
|
new V;this.projectionMatrix=new V}function qb(f,h,a,b,c,d){Ab.call(this);this.type="OrthographicCamera";this.zoom=1;this.view=null;this.left=f;this.right=h;this.top=a;this.bottom=b;this.near=void 0!==c?c:.1;this.far=void 0!==d?d:2E3;this.updateProjectionMatrix()}function Zb(f,h,a,b,c,d){this.a=f;this.b=h;this.c=a;this.normal=b&&b.isVector3?b:new p;this.vertexNormals=Array.isArray(b)?b:[];this.color=c&&c.isColor?c:new S;this.vertexColors=Array.isArray(c)?c:[];this.materialIndex=void 0!==d?d:0}function ca(){Object.defineProperty(this,
|
||
|
"id",{value:gk+=2});this.uuid=ja.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function fa(f,h,a){if(Array.isArray(f))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
|
||
|
this.name="";this.array=f;this.itemSize=h;this.count=void 0!==f?f.length/h:0;this.normalized=!0===a;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function Ze(f,h,a){fa.call(this,new Int8Array(f),h,a)}function $e(f,h,a){fa.call(this,new Uint8Array(f),h,a)}function af(f,h,a){fa.call(this,new Uint8ClampedArray(f),h,a)}function bf(f,h,a){fa.call(this,new Int16Array(f),h,a)}function Zc(f,h,a){fa.call(this,new Uint16Array(f),h,a)}function cf(f,h,a){fa.call(this,new Int32Array(f),h,
|
||
|
a)}function $c(f,h,a){fa.call(this,new Uint32Array(f),h,a)}function J(f,h,a){fa.call(this,new Float32Array(f),h,a)}function df(f,h,a){fa.call(this,new Float64Array(f),h,a)}function Og(){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 Pg(f){if(0===
|
||
|
f.length)return-Infinity;for(var h=f[0],a=1,b=f.length;a<b;++a)f[a]>h&&(h=f[a]);return h}function R(){Object.defineProperty(this,"id",{value:hk+=2});this.uuid=ja.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}}function ad(f,h,a,b,c,d){ca.call(this);this.type="BoxGeometry";this.parameters={width:f,height:h,depth:a,widthSegments:b,heightSegments:c,
|
||
|
depthSegments:d};this.fromBufferGeometry(new $b(f,h,a,b,c,d));this.mergeVertices()}function $b(f,h,a,b,c,d){function e(a,b,c,d,e,f,h,wa,q,I,x){var t=f/q,u=h/I,v=f/2,y=h/2,A=wa/2;h=q+1;var Q=I+1,C=f=0,E,Ka,U=new p;for(Ka=0;Ka<Q;Ka++){var B=Ka*u-y;for(E=0;E<h;E++)U[a]=(E*t-v)*d,U[b]=B*e,U[c]=A,l.push(U.x,U.y,U.z),U[a]=0,U[b]=0,U[c]=0<wa?1:-1,n.push(U.x,U.y,U.z),m.push(E/q),m.push(1-Ka/I),f+=1}for(Ka=0;Ka<I;Ka++)for(E=0;E<q;E++)a=r+E+h*(Ka+1),b=r+(E+1)+h*(Ka+1),c=r+(E+1)+h*Ka,k.push(r+E+h*Ka,a,c),k.push(a,
|
||
|
b,c),C+=6;g.addGroup(w,C,x);w+=C;r+=f}R.call(this);this.type="BoxBufferGeometry";this.parameters={width:f,height:h,depth:a,widthSegments:b,heightSegments:c,depthSegments:d};var g=this;f=f||1;h=h||1;a=a||1;b=Math.floor(b)||1;c=Math.floor(c)||1;d=Math.floor(d)||1;var k=[],l=[],n=[],m=[],r=0,w=0;e("z","y","x",-1,-1,a,h,f,d,c,0);e("z","y","x",1,-1,a,h,-f,d,c,1);e("x","z","y",1,1,f,a,h,b,d,2);e("x","z","y",1,-1,f,a,-h,b,d,3);e("x","y","z",1,-1,f,h,a,b,c,4);e("x","y","z",-1,-1,f,h,-a,b,c,5);this.setIndex(k);
|
||
|
this.addAttribute("position",new J(l,3));this.addAttribute("normal",new J(n,3));this.addAttribute("uv",new J(m,2))}function cd(f,h,a,b){ca.call(this);this.type="PlaneGeometry";this.parameters={width:f,height:h,widthSegments:a,heightSegments:b};this.fromBufferGeometry(new Mb(f,h,a,b));this.mergeVertices()}function Mb(f,h,a,b){R.call(this);this.type="PlaneBufferGeometry";this.parameters={width:f,height:h,widthSegments:a,heightSegments:b};f=f||1;h=h||1;var c=f/2,d=h/2;a=Math.floor(a)||1;b=Math.floor(b)||
|
||
|
1;var e=a+1,g=b+1,k=f/a,l=h/b,n=[],m=[],r=[],w=[];for(f=0;f<g;f++){var t=f*l-d;for(h=0;h<e;h++)m.push(h*k-c,-t,0),r.push(0,0,1),w.push(h/a),w.push(1-f/b)}for(f=0;f<b;f++)for(h=0;h<a;h++)c=h+e*(f+1),d=h+1+e*(f+1),g=h+1+e*f,n.push(h+e*f,c,g),n.push(c,d,g);this.setIndex(n);this.addAttribute("position",new J(m,3));this.addAttribute("normal",new J(r,3));this.addAttribute("uv",new J(w,2))}function da(){Object.defineProperty(this,"id",{value:ik++});this.uuid=ja.generateUUID();this.name="";this.type="Material";
|
||
|
this.lights=this.fog=!0;this.blending=1;this.side=0;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.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.overdraw=0;this.visible=!0;this.userData={};this.needsUpdate=!0}function Ua(f){da.call(this);this.type="MeshBasicMaterial";this.color=new S(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(f)}function la(f){da.call(this);this.type="ShaderMaterial";this.defines={};this.uniforms={};this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=
|
||
|
!1;this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1};this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.uniformsNeedUpdate=!1;void 0!==f&&(void 0!==f.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(f))}function sc(f,h){this.origin=void 0!==f?f:new p;this.direction=void 0!==h?h:new p}function dd(f,h){this.start=void 0!==f?f:new p;this.end=
|
||
|
void 0!==h?h:new p}function cb(f,h,a){this.a=void 0!==f?f:new p;this.b=void 0!==h?h:new p;this.c=void 0!==a?a:new p}function ha(f,h){O.call(this);this.type="Mesh";this.geometry=void 0!==f?f:new R;this.material=void 0!==h?h:new Ua({color:16777215*Math.random()});this.drawMode=0;this.updateMorphTargets()}function jk(f,h,a,b){function c(a,c){h.buffers.color.setClear(a.r,a.g,a.b,c,b)}var d=new S(0),e=0,g,k,l;return{getClearColor:function(){return d},setClearColor:function(a,b){d.set(a);e=void 0!==b?b:
|
||
|
1;c(d,e)},getClearAlpha:function(){return e},setClearAlpha:function(a){e=a;c(d,e)},render:function(b,h,r,w){h=h.background;null===h?c(d,e):h&&h.isColor&&(c(h,1),w=!0);(f.autoClear||w)&&f.clear(f.autoClearColor,f.autoClearDepth,f.autoClearStencil);h&&h.isCubeTexture?(void 0===l&&(l=new ha(new $b(1,1,1),new la({uniforms:tc.cube.uniforms,vertexShader:tc.cube.vertexShader,fragmentShader:tc.cube.fragmentShader,side:1,depthTest:!0,depthWrite:!1,fog:!1})),l.geometry.removeAttribute("normal"),l.geometry.removeAttribute("uv"),
|
||
|
l.onBeforeRender=function(a,b,c){this.matrixWorld.copyPosition(c.matrixWorld)},a.update(l.geometry)),l.material.uniforms.tCube.value=h,b.push(l,l.geometry,l.material,0,null)):h&&h.isTexture&&(void 0===g&&(g=new qb(-1,1,1,-1,0,1),k=new ha(new Mb(2,2),new Ua({depthTest:!1,depthWrite:!1,fog:!1})),a.update(k.geometry)),k.material.map=h,f.renderBufferDirect(g,null,k.geometry,k.material,k,null))}}}function kk(f,h,a){var b;this.setMode=function(a){b=a};this.render=function(c,d){f.drawArrays(b,c,d);a.update(d,
|
||
|
b)};this.renderInstances=function(c,d,e){var g=h.get("ANGLE_instanced_arrays");if(null===g)console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{var f=c.attributes.position;f.isInterleavedBufferAttribute?(e=f.data.count,g.drawArraysInstancedANGLE(b,0,e,c.maxInstancedCount)):g.drawArraysInstancedANGLE(b,d,e,c.maxInstancedCount);a.update(e,b,c.maxInstancedCount)}}}function lk(f,h,a){function b(a){if("highp"===
|
||
|
a){if(0<f.getShaderPrecisionFormat(f.VERTEX_SHADER,f.HIGH_FLOAT).precision&&0<f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT).precision)return"highp";a="mediump"}return"mediump"===a&&0<f.getShaderPrecisionFormat(f.VERTEX_SHADER,f.MEDIUM_FLOAT).precision&&0<f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.MEDIUM_FLOAT).precision?"mediump":"lowp"}var c,d=void 0!==a.precision?a.precision:"highp",e=b(d);e!==d&&(console.warn("THREE.WebGLRenderer:",d,"not supported, using",e,"instead."),d=e);a=
|
||
|
!0===a.logarithmicDepthBuffer;e=f.getParameter(f.MAX_TEXTURE_IMAGE_UNITS);var g=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS),k=f.getParameter(f.MAX_TEXTURE_SIZE),l=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),n=f.getParameter(f.MAX_VERTEX_ATTRIBS),m=f.getParameter(f.MAX_VERTEX_UNIFORM_VECTORS),r=f.getParameter(f.MAX_VARYING_VECTORS),w=f.getParameter(f.MAX_FRAGMENT_UNIFORM_VECTORS),t=0<g,u=!!h.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==c)return c;var a=h.get("EXT_texture_filter_anisotropic");
|
||
|
return c=null!==a?f.getParameter(a.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:b,precision:d,logarithmicDepthBuffer:a,maxTextures:e,maxVertexTextures:g,maxTextureSize:k,maxCubemapSize:l,maxAttributes:n,maxVertexUniforms:m,maxVaryings:r,maxFragmentUniforms:w,vertexTextures:t,floatFragmentTextures:u,floatVertexTextures:t&&u}}function mk(){function f(){l.value!==b&&(l.value=b,l.needsUpdate=0<c);a.numPlanes=c;a.numIntersection=0}function h(b,c,d,e){var f=null!==b?b.length:0,h=null;if(0!==f){h=
|
||
|
l.value;if(!0!==e||null===h){e=d+4*f;c=c.matrixWorldInverse;k.getNormalMatrix(c);if(null===h||h.length<e)h=new Float32Array(e);for(e=0;e!==f;++e,d+=4)g.copy(b[e]).applyMatrix4(c,k),g.normal.toArray(h,d),h[d+3]=g.constant}l.value=h;l.needsUpdate=!0}a.numPlanes=f;return h}var a=this,b=null,c=0,d=!1,e=!1,g=new ib,k=new Ja,l={value:null,needsUpdate:!1};this.uniform=l;this.numIntersection=this.numPlanes=0;this.init=function(a,e,g){var f=0!==a.length||e||0!==c||d;d=e;b=h(a,g,0);c=a.length;return f};this.beginShadows=
|
||
|
function(){e=!0;h(null)};this.endShadows=function(){e=!1;f()};this.setState=function(a,g,k,w,t,u){if(!d||null===a||0===a.length||e&&!k)e?h(null):f();else{k=e?0:c;var n=4*k,m=t.clippingState||null;l.value=m;m=h(a,w,n,u);for(a=0;a!==n;++a)m[a]=b[a];t.clippingState=m;this.numIntersection=g?this.numPlanes:0;this.numPlanes+=k}}}function nk(f){var h={};return{get:function(a){if(void 0!==h[a])return h[a];switch(a){case "WEBGL_depth_texture":var b=f.getExtension("WEBGL_depth_texture")||f.getExtension("MOZ_WEBGL_depth_texture")||
|
||
|
f.getExtension("WEBKIT_WEBGL_depth_texture");break;case "EXT_texture_filter_anisotropic":b=f.getExtension("EXT_texture_filter_anisotropic")||f.getExtension("MOZ_EXT_texture_filter_anisotropic")||f.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case "WEBGL_compressed_texture_s3tc":b=f.getExtension("WEBGL_compressed_texture_s3tc")||f.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||f.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case "WEBGL_compressed_texture_pvrtc":b=f.getExtension("WEBGL_compressed_texture_pvrtc")||
|
||
|
f.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:b=f.getExtension(a)}null===b&&console.warn("THREE.WebGLRenderer: "+a+" extension not supported.");return h[a]=b}}}function ok(f,h,a){function b(e){e=e.target;var g=c[e.id];null!==g.index&&h.remove(g.index);for(var f in g.attributes)h.remove(g.attributes[f]);e.removeEventListener("dispose",b);delete c[e.id];if(f=d[e.id])h.remove(f),delete d[e.id];if(f=d[g.id])h.remove(f),delete d[g.id];a.memory.geometries--}var c={},d={};return{get:function(d,
|
||
|
g){var e=c[g.id];if(e)return e;g.addEventListener("dispose",b);g.isBufferGeometry?e=g:g.isGeometry&&(void 0===g._bufferGeometry&&(g._bufferGeometry=(new R).setFromObject(d)),e=g._bufferGeometry);c[g.id]=e;a.memory.geometries++;return e},update:function(a){var b=a.index,c=a.attributes;null!==b&&h.update(b,f.ELEMENT_ARRAY_BUFFER);for(var d in c)h.update(c[d],f.ARRAY_BUFFER);a=a.morphAttributes;for(d in a){b=a[d];c=0;for(var e=b.length;c<e;c++)h.update(b[c],f.ARRAY_BUFFER)}},getWireframeAttribute:function(a){var b=
|
||
|
d[a.id];if(b)return b;b=[];var c=a.index,e=a.attributes;if(null!==c){c=c.array;e=0;for(var n=c.length;e<n;e+=3){var m=c[e+0],r=c[e+1],w=c[e+2];b.push(m,r,r,w,w,m)}}else for(c=e.position.array,e=0,n=c.length/3-1;e<n;e+=3)m=e+0,r=e+1,w=e+2,b.push(m,r,r,w,w,m);b=new (65535<Pg(b)?$c:Zc)(b,1);h.update(b,f.ELEMENT_ARRAY_BUFFER);return d[a.id]=b}}}function pk(f,h,a){var b,c,d;this.setMode=function(a){b=a};this.setIndex=function(a){c=a.type;d=a.bytesPerElement};this.render=function(e,g){f.drawElements(b,
|
||
|
g,c,e*d);a.update(g,b)};this.renderInstances=function(e,g,f){var k=h.get("ANGLE_instanced_arrays");null===k?console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(k.drawElementsInstancedANGLE(b,f,c,g*d,e.maxInstancedCount),a.update(f,b,e.maxInstancedCount))}}function qk(f){var h={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:h,programs:null,autoReset:!0,reset:function(){h.frame++;
|
||
|
h.calls=0;h.triangles=0;h.points=0;h.lines=0},update:function(a,b,c){c=c||1;h.calls++;switch(b){case f.TRIANGLES:h.triangles+=a/3*c;break;case f.TRIANGLE_STRIP:case f.TRIANGLE_FAN:h.triangles+=c*(a-2);break;case f.LINES:h.lines+=a/2*c;break;case f.LINE_STRIP:h.lines+=c*(a-1);break;case f.LINE_LOOP:h.lines+=c*a;break;case f.POINTS:h.points+=c*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",b)}}}}function rk(f,h){return Math.abs(h[1])-Math.abs(f[1])}function sk(f){var h={},a=new Float32Array(8);
|
||
|
return{update:function(b,c,d,e){var g=b.morphTargetInfluences,k=g.length;b=h[c.id];if(void 0===b){b=[];for(var l=0;l<k;l++)b[l]=[l,0];h[c.id]=b}var n=d.morphTargets&&c.morphAttributes.position;d=d.morphNormals&&c.morphAttributes.normal;for(l=0;l<k;l++){var m=b[l];0!==m[1]&&(n&&c.removeAttribute("morphTarget"+l),d&&c.removeAttribute("morphNormal"+l))}for(l=0;l<k;l++)m=b[l],m[0]=l,m[1]=g[l];b.sort(rk);for(l=0;8>l;l++){if(m=b[l])if(g=m[0],k=m[1]){n&&c.addAttribute("morphTarget"+l,n[g]);d&&c.addAttribute("morphNormal"+
|
||
|
l,d[g]);a[l]=k;continue}a[l]=0}e.getUniforms().setValue(f,"morphTargetInfluences",a)}}}function tk(f,h){var a={};return{update:function(b){var c=h.render.frame,d=b.geometry,e=f.get(b,d);a[e.id]!==c&&(d.isGeometry&&e.updateFromObject(b),f.update(e),a[e.id]=c);return e},dispose:function(){a={}}}}function ac(f,h,a,b,c,d,e,g,k,l){f=void 0!==f?f:[];ra.call(this,f,void 0!==h?h:301,a,b,c,d,e,g,k,l);this.flipY=!1}function uc(f,h,a){var b=f[0];if(0>=b||0<b)return f;var c=h*a,d=Qg[c];void 0===d&&(d=new Float32Array(c),
|
||
|
Qg[c]=d);if(0!==h)for(b.toArray(d,0),b=1,c=0;b!==h;++b)c+=a,f[b].toArray(d,c);return d}function Rg(f,h){var a=Sg[h];void 0===a&&(a=new Int32Array(h),Sg[h]=a);for(var b=0;b!==h;++b)a[b]=f.allocTextureUnit();return a}function uk(f,h){f.uniform1f(this.addr,h)}function vk(f,h){f.uniform1i(this.addr,h)}function wk(f,h){void 0===h.x?f.uniform2fv(this.addr,h):f.uniform2f(this.addr,h.x,h.y)}function xk(f,h){void 0!==h.x?f.uniform3f(this.addr,h.x,h.y,h.z):void 0!==h.r?f.uniform3f(this.addr,h.r,h.g,h.b):f.uniform3fv(this.addr,
|
||
|
h)}function yk(f,h){void 0===h.x?f.uniform4fv(this.addr,h):f.uniform4f(this.addr,h.x,h.y,h.z,h.w)}function zk(f,h){f.uniformMatrix2fv(this.addr,!1,h.elements||h)}function Ak(f,h){void 0===h.elements?f.uniformMatrix3fv(this.addr,!1,h):(Tg.set(h.elements),f.uniformMatrix3fv(this.addr,!1,Tg))}function Bk(f,h){void 0===h.elements?f.uniformMatrix4fv(this.addr,!1,h):(Ug.set(h.elements),f.uniformMatrix4fv(this.addr,!1,Ug))}function Ck(f,h,a){var b=a.allocTextureUnit();f.uniform1i(this.addr,b);a.setTexture2D(h||
|
||
|
Vg,b)}function Dk(f,h,a){var b=a.allocTextureUnit();f.uniform1i(this.addr,b);a.setTextureCube(h||Wg,b)}function Xg(f,h){f.uniform2iv(this.addr,h)}function Yg(f,h){f.uniform3iv(this.addr,h)}function Zg(f,h){f.uniform4iv(this.addr,h)}function Ek(f){switch(f){case 5126:return uk;case 35664:return wk;case 35665:return xk;case 35666:return yk;case 35674:return zk;case 35675:return Ak;case 35676:return Bk;case 35678:case 36198:return Ck;case 35680:return Dk;case 5124:case 35670:return vk;case 35667:case 35671:return Xg;
|
||
|
case 35668:case 35672:return Yg;case 35669:case 35673:return Zg}}function Fk(f,h){f.uniform1fv(this.addr,h)}function Gk(f,h){f.uniform1iv(this.addr,h)}function Hk(f,h){f.uniform2fv(this.addr,uc(h,this.size,2))}function Ik(f,h){f.uniform3fv(this.addr,uc(h,this.size,3))}function Jk(f,h){f.uniform4fv(this.addr,uc(h,this.size,4))}function Kk(f,h){f.uniformMatrix2fv(this.addr,!1,uc(h,this.size,4))}function Lk(f,h){f.uniformMatrix3fv(this.addr,!1,uc(h,this.size,9))}function Mk(f,h){f.uniformMatrix4fv(this.addr,
|
||
|
!1,uc(h,this.size,16))}function Nk(f,h,a){var b=h.length,c=Rg(a,b);f.uniform1iv(this.addr,c);for(f=0;f!==b;++f)a.setTexture2D(h[f]||Vg,c[f])}function Ok(f,h,a){var b=h.length,c=Rg(a,b);f.uniform1iv(this.addr,c);for(f=0;f!==b;++f)a.setTextureCube(h[f]||Wg,c[f])}function Pk(f){switch(f){case 5126:return Fk;case 35664:return Hk;case 35665:return Ik;case 35666:return Jk;case 35674:return Kk;case 35675:return Lk;case 35676:return Mk;case 35678:return Nk;case 35680:return Ok;case 5124:case 35670:return Gk;
|
||
|
case 35667:case 35671:return Xg;case 35668:case 35672:return Yg;case 35669:case 35673:return Zg}}function Qk(f,h,a){this.id=f;this.addr=a;this.setValue=Ek(h.type)}function Rk(f,h,a){this.id=f;this.addr=a;this.size=h.size;this.setValue=Pk(h.type)}function $g(f){this.id=f;this.seq=[];this.map={}}function Nb(f,h,a){this.seq=[];this.map={};this.renderer=a;a=f.getProgramParameter(h,f.ACTIVE_UNIFORMS);for(var b=0;b<a;++b){var c=f.getActiveUniform(h,b),d=f.getUniformLocation(h,c.name),e=this,g=c.name,k=
|
||
|
g.length;for(ff.lastIndex=0;;){var l=ff.exec(g),n=ff.lastIndex,m=l[1],r=l[3];"]"===l[2]&&(m|=0);if(void 0===r||"["===r&&n+2===k){g=e;c=void 0===r?new Qk(m,c,d):new Rk(m,c,d);g.seq.push(c);g.map[c.id]=c;break}else r=e.map[m],void 0===r&&(r=new $g(m),m=e,e=r,m.seq.push(e),m.map[e.id]=e),e=r}}}function Sk(f){f=f.split("\n");for(var h=0;h<f.length;h++)f[h]=h+1+": "+f[h];return f.join("\n")}function ah(f,h,a){var b=f.createShader(h);f.shaderSource(b,a);f.compileShader(b);!1===f.getShaderParameter(b,f.COMPILE_STATUS)&&
|
||
|
console.error("THREE.WebGLShader: Shader couldn't compile.");""!==f.getShaderInfoLog(b)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",h===f.VERTEX_SHADER?"vertex":"fragment",f.getShaderInfoLog(b),Sk(a));return b}function bh(f){switch(f){case 3E3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma",
|
||
|
"( value, float( GAMMA_FACTOR ) )"];default:throw Error("unsupported encoding: "+f);}}function gf(f,h){h=bh(h);return"vec4 "+f+"( vec4 value ) { return "+h[0]+"ToLinear"+h[1]+"; }"}function Tk(f,h){h=bh(h);return"vec4 "+f+"( vec4 value ) { return LinearTo"+h[0]+h[1]+"; }"}function Uk(f,h){switch(h){case 1:h="Linear";break;case 2:h="Reinhard";break;case 3:h="Uncharted2";break;case 4:h="OptimizedCineon";break;default:throw Error("unsupported toneMapping: "+h);}return"vec3 "+f+"( vec3 color ) { return "+
|
||
|
h+"ToneMapping( color ); }"}function Vk(f,h,a){f=f||{};return[f.derivatives||h.envMapCubeUV||h.bumpMap||h.normalMap||h.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(f.fragDepth||h.logarithmicDepthBuffer)&&a.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",f.drawBuffers&&a.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(f.shaderTextureLOD||h.envMap)&&a.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ed).join("\n")}
|
||
|
function Wk(f){var h=[],a;for(a in f){var b=f[a];!1!==b&&h.push("#define "+a+" "+b)}return h.join("\n")}function ed(f){return""!==f}function ch(f,h){return f.replace(/NUM_DIR_LIGHTS/g,h.numDirLights).replace(/NUM_SPOT_LIGHTS/g,h.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,h.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,h.numPointLights).replace(/NUM_HEMI_LIGHTS/g,h.numHemiLights)}function dh(f,h){return f.replace(/NUM_CLIPPING_PLANES/g,h.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,h.numClippingPlanes-
|
||
|
h.numClipIntersection)}function hf(f){return f.replace(/^[ \t]*#include +<([\w\d.]+)>/gm,function(f,a){f=pa[a];if(void 0===f)throw Error("Can not resolve #include <"+a+">");return hf(f)})}function eh(f){return f.replace(/#pragma unroll_loop[\s]+?for \( int i = (\d+); i < (\d+); i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(f,a,b,c){f="";for(a=parseInt(a);a<parseInt(b);a++)f+=c.replace(/\[ i \]/g,"[ "+a+" ]");return f})}function Xk(f,h,a,b,c,d){var e=f.context,g=b.defines,k=c.vertexShader,l=c.fragmentShader,
|
||
|
n="SHADOWMAP_TYPE_BASIC";1===d.shadowMapType?n="SHADOWMAP_TYPE_PCF":2===d.shadowMapType&&(n="SHADOWMAP_TYPE_PCF_SOFT");var m="ENVMAP_TYPE_CUBE",r="ENVMAP_MODE_REFLECTION",w="ENVMAP_BLENDING_MULTIPLY";if(d.envMap){switch(b.envMap.mapping){case 301:case 302:m="ENVMAP_TYPE_CUBE";break;case 306:case 307:m="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:m="ENVMAP_TYPE_EQUIREC";break;case 305:m="ENVMAP_TYPE_SPHERE"}switch(b.envMap.mapping){case 302:case 304:r="ENVMAP_MODE_REFRACTION"}switch(b.combine){case 0:w=
|
||
|
"ENVMAP_BLENDING_MULTIPLY";break;case 1:w="ENVMAP_BLENDING_MIX";break;case 2:w="ENVMAP_BLENDING_ADD"}}var t=0<f.gammaFactor?f.gammaFactor:1,u=Vk(b.extensions,d,h),v=Wk(g),p=e.createProgram();b.isRawShaderMaterial?(g=[v].filter(ed).join("\n"),0<g.length&&(g+="\n"),h=[u,v].filter(ed).join("\n"),0<h.length&&(h+="\n")):(g=["precision "+d.precision+" float;","precision "+d.precision+" int;","#define SHADER_NAME "+c.name,v,d.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+t,
|
||
|
"#define MAX_BONES "+d.maxBones,d.useFog&&d.fog?"#define USE_FOG":"",d.useFog&&d.fogExp?"#define FOG_EXP2":"",d.map?"#define USE_MAP":"",d.envMap?"#define USE_ENVMAP":"",d.envMap?"#define "+r:"",d.lightMap?"#define USE_LIGHTMAP":"",d.aoMap?"#define USE_AOMAP":"",d.emissiveMap?"#define USE_EMISSIVEMAP":"",d.bumpMap?"#define USE_BUMPMAP":"",d.normalMap?"#define USE_NORMALMAP":"",d.displacementMap&&d.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",d.specularMap?"#define USE_SPECULARMAP":"",d.roughnessMap?
|
||
|
"#define USE_ROUGHNESSMAP":"",d.metalnessMap?"#define USE_METALNESSMAP":"",d.alphaMap?"#define USE_ALPHAMAP":"",d.vertexColors?"#define USE_COLOR":"",d.flatShading?"#define FLAT_SHADED":"",d.skinning?"#define USE_SKINNING":"",d.useVertexTexture?"#define BONE_TEXTURE":"",d.morphTargets?"#define USE_MORPHTARGETS":"",d.morphNormals&&!1===d.flatShading?"#define USE_MORPHNORMALS":"",d.doubleSided?"#define DOUBLE_SIDED":"",d.flipSided?"#define FLIP_SIDED":"",d.shadowMapEnabled?"#define USE_SHADOWMAP":"",
|
||
|
d.shadowMapEnabled?"#define "+n:"",d.sizeAttenuation?"#define USE_SIZEATTENUATION":"",d.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",d.logarithmicDepthBuffer&&h.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;",
|
||
|
"#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif",
|
||
|
"#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(ed).join("\n"),h=[u,"precision "+d.precision+" float;","precision "+d.precision+" int;","#define SHADER_NAME "+c.name,v,d.alphaTest?"#define ALPHATEST "+d.alphaTest:"","#define GAMMA_FACTOR "+t,d.useFog&&d.fog?"#define USE_FOG":"",d.useFog&&d.fogExp?"#define FOG_EXP2":"",d.map?"#define USE_MAP":"",d.envMap?"#define USE_ENVMAP":"",d.envMap?"#define "+m:"",d.envMap?"#define "+r:"",d.envMap?"#define "+
|
||
|
w:"",d.lightMap?"#define USE_LIGHTMAP":"",d.aoMap?"#define USE_AOMAP":"",d.emissiveMap?"#define USE_EMISSIVEMAP":"",d.bumpMap?"#define USE_BUMPMAP":"",d.normalMap?"#define USE_NORMALMAP":"",d.specularMap?"#define USE_SPECULARMAP":"",d.roughnessMap?"#define USE_ROUGHNESSMAP":"",d.metalnessMap?"#define USE_METALNESSMAP":"",d.alphaMap?"#define USE_ALPHAMAP":"",d.vertexColors?"#define USE_COLOR":"",d.gradientMap?"#define USE_GRADIENTMAP":"",d.flatShading?"#define FLAT_SHADED":"",d.doubleSided?"#define DOUBLE_SIDED":
|
||
|
"",d.flipSided?"#define FLIP_SIDED":"",d.shadowMapEnabled?"#define USE_SHADOWMAP":"",d.shadowMapEnabled?"#define "+n:"",d.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",d.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",d.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",d.logarithmicDepthBuffer&&h.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",d.envMap&&h.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",
|
||
|
0!==d.toneMapping?"#define TONE_MAPPING":"",0!==d.toneMapping?pa.tonemapping_pars_fragment:"",0!==d.toneMapping?Uk("toneMapping",d.toneMapping):"",d.dithering?"#define DITHERING":"",d.outputEncoding||d.mapEncoding||d.envMapEncoding||d.emissiveMapEncoding?pa.encodings_pars_fragment:"",d.mapEncoding?gf("mapTexelToLinear",d.mapEncoding):"",d.envMapEncoding?gf("envMapTexelToLinear",d.envMapEncoding):"",d.emissiveMapEncoding?gf("emissiveMapTexelToLinear",d.emissiveMapEncoding):"",d.outputEncoding?Tk("linearToOutputTexel",
|
||
|
d.outputEncoding):"",d.depthPacking?"#define DEPTH_PACKING "+b.depthPacking:"","\n"].filter(ed).join("\n"));k=hf(k);k=ch(k,d);k=dh(k,d);l=hf(l);l=ch(l,d);l=dh(l,d);k=eh(k);l=eh(l);l=h+l;k=ah(e,e.VERTEX_SHADER,g+k);l=ah(e,e.FRAGMENT_SHADER,l);e.attachShader(p,k);e.attachShader(p,l);void 0!==b.index0AttributeName?e.bindAttribLocation(p,0,b.index0AttributeName):!0===d.morphTargets&&e.bindAttribLocation(p,0,"position");e.linkProgram(p);d=e.getProgramInfoLog(p).trim();n=e.getShaderInfoLog(k).trim();m=
|
||
|
e.getShaderInfoLog(l).trim();w=r=!0;if(!1===e.getProgramParameter(p,e.LINK_STATUS))r=!1,console.error("THREE.WebGLProgram: shader error: ",e.getError(),"gl.VALIDATE_STATUS",e.getProgramParameter(p,e.VALIDATE_STATUS),"gl.getProgramInfoLog",d,n,m);else if(""!==d)console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",d);else if(""===n||""===m)w=!1;w&&(this.diagnostics={runnable:r,material:b,programLog:d,vertexShader:{log:n,prefix:g},fragmentShader:{log:m,prefix:h}});e.deleteShader(k);e.deleteShader(l);
|
||
|
var A;this.getUniforms=function(){void 0===A&&(A=new Nb(e,p,f));return A};var q;this.getAttributes=function(){if(void 0===q){for(var a={},b=e.getProgramParameter(p,e.ACTIVE_ATTRIBUTES),c=0;c<b;c++){var d=e.getActiveAttrib(p,c).name;a[d]=e.getAttribLocation(p,d)}q=a}return q};this.destroy=function(){e.deleteProgram(p);this.program=void 0};Object.defineProperties(this,{uniforms:{get:function(){console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms().");return this.getUniforms()}},attributes:{get:function(){console.warn("THREE.WebGLProgram: .attributes is now .getAttributes().");
|
||
|
return this.getAttributes()}}});this.name=c.name;this.id=Yk++;this.code=a;this.usedTimes=1;this.program=p;this.vertexShader=k;this.fragmentShader=l;return this}function Zk(f,h,a){function b(a,b){if(a)a.isTexture?c=a.encoding:a.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),c=a.texture.encoding);else var c=3E3;3E3===c&&b&&(c=3007);return c}var c=[],d={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",
|
||
|
MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow"},e="precision supportsVertexTextures map mapEncoding envMap envMapMode envMapEncoding lightMap aoMap emissiveMap emissiveMapEncoding bumpMap normalMap displacementMap specularMap roughnessMap metalnessMap gradientMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights numRectAreaLights shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes numClipIntersection depthPacking dithering".split(" ");
|
||
|
this.getParameters=function(c,e,h,n,m,r,w){var g=d[c.type];if(w.isSkinnedMesh){var k=w.skeleton.bones;if(a.floatVertexTextures)k=1024;else{var l=Math.min(Math.floor((a.maxVertexUniforms-20)/4),k.length);l<k.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+k.length+" bones. This GPU supports "+l+"."),k=0):k=l}}else k=0;l=a.precision;null!==c.precision&&(l=a.getMaxPrecision(c.precision),l!==c.precision&&console.warn("THREE.WebGLProgram.getParameters:",c.precision,"not supported, using",l,"instead."));
|
||
|
var p=f.getRenderTarget();return{shaderID:g,precision:l,supportsVertexTextures:a.vertexTextures,outputEncoding:b(p?p.texture:null,f.gammaOutput),map:!!c.map,mapEncoding:b(c.map,f.gammaInput),envMap:!!c.envMap,envMapMode:c.envMap&&c.envMap.mapping,envMapEncoding:b(c.envMap,f.gammaInput),envMapCubeUV:!!c.envMap&&(306===c.envMap.mapping||307===c.envMap.mapping),lightMap:!!c.lightMap,aoMap:!!c.aoMap,emissiveMap:!!c.emissiveMap,emissiveMapEncoding:b(c.emissiveMap,f.gammaInput),bumpMap:!!c.bumpMap,normalMap:!!c.normalMap,
|
||
|
displacementMap:!!c.displacementMap,roughnessMap:!!c.roughnessMap,metalnessMap:!!c.metalnessMap,specularMap:!!c.specularMap,alphaMap:!!c.alphaMap,gradientMap:!!c.gradientMap,combine:c.combine,vertexColors:c.vertexColors,fog:!!n,useFog:c.fog,fogExp:n&&n.isFogExp2,flatShading:c.flatShading,sizeAttenuation:c.sizeAttenuation,logarithmicDepthBuffer:a.logarithmicDepthBuffer,skinning:c.skinning&&0<k,maxBones:k,useVertexTexture:a.floatVertexTextures,morphTargets:c.morphTargets,morphNormals:c.morphNormals,
|
||
|
maxMorphTargets:f.maxMorphTargets,maxMorphNormals:f.maxMorphNormals,numDirLights:e.directional.length,numPointLights:e.point.length,numSpotLights:e.spot.length,numRectAreaLights:e.rectArea.length,numHemiLights:e.hemi.length,numClippingPlanes:m,numClipIntersection:r,dithering:c.dithering,shadowMapEnabled:f.shadowMap.enabled&&w.receiveShadow&&0<h.length,shadowMapType:f.shadowMap.type,toneMapping:f.toneMapping,physicallyCorrectLights:f.physicallyCorrectLights,premultipliedAlpha:c.premultipliedAlpha,
|
||
|
alphaTest:c.alphaTest,doubleSided:2===c.side,flipSided:1===c.side,depthPacking:void 0!==c.depthPacking?c.depthPacking:!1}};this.getProgramCode=function(a,b){var c=[];b.shaderID?c.push(b.shaderID):(c.push(a.fragmentShader),c.push(a.vertexShader));if(void 0!==a.defines)for(var d in a.defines)c.push(d),c.push(a.defines[d]);for(d=0;d<e.length;d++)c.push(b[e[d]]);c.push(a.onBeforeCompile.toString());c.push(f.gammaOutput);return c.join()};this.acquireProgram=function(a,b,d,e){for(var g,k=0,l=c.length;k<
|
||
|
l;k++){var n=c[k];if(n.code===e){g=n;++g.usedTimes;break}}void 0===g&&(g=new Xk(f,h,e,a,b,d),c.push(g));return g};this.releaseProgram=function(a){if(0===--a.usedTimes){var b=c.indexOf(a);c[b]=c[c.length-1];c.pop();a.destroy()}};this.programs=c}function $k(){var f=new WeakMap;return{get:function(h){var a=f.get(h);void 0===a&&(a={},f.set(h,a));return a},remove:function(h){f.delete(h)},update:function(h,a,b){f.get(h)[a]=b},dispose:function(){f=new WeakMap}}}function al(f,h){return f.renderOrder!==h.renderOrder?
|
||
|
f.renderOrder-h.renderOrder:f.program&&h.program&&f.program!==h.program?f.program.id-h.program.id:f.material.id!==h.material.id?f.material.id-h.material.id:f.z!==h.z?f.z-h.z:f.id-h.id}function bl(f,h){return f.renderOrder!==h.renderOrder?f.renderOrder-h.renderOrder:f.z!==h.z?h.z-f.z:f.id-h.id}function cl(){var f=[],h=0,a=[],b=[];return{opaque:a,transparent:b,init:function(){h=0;a.length=0;b.length=0},push:function(c,d,e,g,k){var l=f[h];void 0===l?(l={id:c.id,object:c,geometry:d,material:e,program:e.program,
|
||
|
renderOrder:c.renderOrder,z:g,group:k},f[h]=l):(l.id=c.id,l.object=c,l.geometry=d,l.material=e,l.program=e.program,l.renderOrder=c.renderOrder,l.z=g,l.group=k);(!0===e.transparent?b:a).push(l);h++},sort:function(){1<a.length&&a.sort(al);1<b.length&&b.sort(bl)}}}function dl(){var f={};return{get:function(h,a){h=h.id+","+a.id;a=f[h];void 0===a&&(a=new cl,f[h]=a);return a},dispose:function(){f={}}}}function el(){var f={};return{get:function(h){if(void 0!==f[h.id])return f[h.id];switch(h.type){case "DirectionalLight":var a=
|
||
|
{direction:new p,color:new S,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new x};break;case "SpotLight":a={position:new p,direction:new p,color:new S,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new x};break;case "PointLight":a={position:new p,color:new S,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new x,shadowCameraNear:1,shadowCameraFar:1E3};break;case "HemisphereLight":a={direction:new p,skyColor:new S,groundColor:new S};
|
||
|
break;case "RectAreaLight":a={color:new S,position:new p,halfWidth:new p,halfHeight:new p}}return f[h.id]=a}}}function fl(){var f=new el,h={id:gl++,hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},a=new p,b=new V,c=new V;return{setup:function(d,e,g){var k=0,l=0,n=0,m=0,r=0,w=0,t=0,u=0;g=g.matrixWorldInverse;for(var v=0,p=d.length;v<p;v++){var q=
|
||
|
d[v],C=q.color,E=q.intensity,wa=q.distance,Q=q.shadow&&q.shadow.map?q.shadow.map.texture:null;if(q.isAmbientLight)k+=C.r*E,l+=C.g*E,n+=C.b*E;else if(q.isDirectionalLight){var I=f.get(q);I.color.copy(q.color).multiplyScalar(q.intensity);I.direction.setFromMatrixPosition(q.matrixWorld);a.setFromMatrixPosition(q.target.matrixWorld);I.direction.sub(a);I.direction.transformDirection(g);if(I.shadow=q.castShadow)C=q.shadow,I.shadowBias=C.bias,I.shadowRadius=C.radius,I.shadowMapSize=C.mapSize;h.directionalShadowMap[m]=
|
||
|
Q;h.directionalShadowMatrix[m]=q.shadow.matrix;h.directional[m]=I;m++}else if(q.isSpotLight){I=f.get(q);I.position.setFromMatrixPosition(q.matrixWorld);I.position.applyMatrix4(g);I.color.copy(C).multiplyScalar(E);I.distance=wa;I.direction.setFromMatrixPosition(q.matrixWorld);a.setFromMatrixPosition(q.target.matrixWorld);I.direction.sub(a);I.direction.transformDirection(g);I.coneCos=Math.cos(q.angle);I.penumbraCos=Math.cos(q.angle*(1-q.penumbra));I.decay=0===q.distance?0:q.decay;if(I.shadow=q.castShadow)C=
|
||
|
q.shadow,I.shadowBias=C.bias,I.shadowRadius=C.radius,I.shadowMapSize=C.mapSize;h.spotShadowMap[w]=Q;h.spotShadowMatrix[w]=q.shadow.matrix;h.spot[w]=I;w++}else if(q.isRectAreaLight)I=f.get(q),I.color.copy(C).multiplyScalar(E),I.position.setFromMatrixPosition(q.matrixWorld),I.position.applyMatrix4(g),c.identity(),b.copy(q.matrixWorld),b.premultiply(g),c.extractRotation(b),I.halfWidth.set(.5*q.width,0,0),I.halfHeight.set(0,.5*q.height,0),I.halfWidth.applyMatrix4(c),I.halfHeight.applyMatrix4(c),h.rectArea[t]=
|
||
|
I,t++;else if(q.isPointLight){I=f.get(q);I.position.setFromMatrixPosition(q.matrixWorld);I.position.applyMatrix4(g);I.color.copy(q.color).multiplyScalar(q.intensity);I.distance=q.distance;I.decay=0===q.distance?0:q.decay;if(I.shadow=q.castShadow)C=q.shadow,I.shadowBias=C.bias,I.shadowRadius=C.radius,I.shadowMapSize=C.mapSize,I.shadowCameraNear=C.camera.near,I.shadowCameraFar=C.camera.far;h.pointShadowMap[r]=Q;h.pointShadowMatrix[r]=q.shadow.matrix;h.point[r]=I;r++}else q.isHemisphereLight&&(I=f.get(q),
|
||
|
I.direction.setFromMatrixPosition(q.matrixWorld),I.direction.transformDirection(g),I.direction.normalize(),I.skyColor.copy(q.color).multiplyScalar(E),I.groundColor.copy(q.groundColor).multiplyScalar(E),h.hemi[u]=I,u++)}h.ambient[0]=k;h.ambient[1]=l;h.ambient[2]=n;h.directional.length=m;h.spot.length=w;h.rectArea.length=t;h.point.length=r;h.hemi.length=u;h.hash=h.id+","+m+","+r+","+w+","+t+","+u+","+e.length},state:h}}function hl(){var f=new fl,h=[],a=[],b=[];return{init:function(){h.length=0;a.length=
|
||
|
0;b.length=0},state:{lightsArray:h,shadowsArray:a,spritesArray:b,lights:f},setupLights:function(b){f.setup(h,a,b)},pushLight:function(a){h.push(a)},pushShadow:function(b){a.push(b)},pushSprite:function(a){b.push(a)}}}function il(){var f={};return{get:function(h,a){h=h.id+","+a.id;a=f[h];void 0===a&&(a=new hl,f[h]=a);return a},dispose:function(){f={}}}}function Ob(f){da.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(f)}function bc(f){da.call(this);this.type="MeshDistanceMaterial";this.referencePosition=new p;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(f)}function fh(f,h,a){function b(a,b,c,d,e,g){var h=
|
||
|
a.geometry;var k=m;var l=a.customDepthMaterial;c&&(k=r,l=a.customDistanceMaterial);l?k=l:(l=!1,b.morphTargets&&(h&&h.isBufferGeometry?l=h.morphAttributes&&h.morphAttributes.position&&0<h.morphAttributes.position.length:h&&h.isGeometry&&(l=h.morphTargets&&0<h.morphTargets.length)),a.isSkinnedMesh&&!1===b.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",a),a=a.isSkinnedMesh&&b.skinning,h=0,l&&(h|=1),a&&(h|=2),k=k[h]);f.localClippingEnabled&&!0===
|
||
|
b.clipShadows&&0!==b.clippingPlanes.length&&(h=k.uuid,l=b.uuid,a=w[h],void 0===a&&(a={},w[h]=a),h=a[l],void 0===h&&(h=k.clone(),a[l]=h),k=h);k.visible=b.visible;k.wireframe=b.wireframe;k.side=null!=b.shadowSide?b.shadowSide:t[b.side];k.clipShadows=b.clipShadows;k.clippingPlanes=b.clippingPlanes;k.clipIntersection=b.clipIntersection;k.wireframeLinewidth=b.wireframeLinewidth;k.linewidth=b.linewidth;c&&k.isMeshDistanceMaterial&&(k.referencePosition.copy(d),k.nearDistance=e,k.farDistance=g);return k}
|
||
|
function c(a,e,g,k){if(!1!==a.visible){if(a.layers.test(e.layers)&&(a.isMesh||a.isLine||a.isPoints)&&a.castShadow&&(!a.frustumCulled||d.intersectsObject(a))){a.modelViewMatrix.multiplyMatrices(g.matrixWorldInverse,a.matrixWorld);var l=h.update(a),m=a.material;if(Array.isArray(m))for(var r=l.groups,w=0,t=r.length;w<t;w++){var u=r[w],v=m[u.materialIndex];v&&v.visible&&(v=b(a,v,k,n,g.near,g.far),f.renderBufferDirect(g,null,l,v,a,u))}else m.visible&&(v=b(a,m,k,n,g.near,g.far),f.renderBufferDirect(g,null,
|
||
|
l,v,a,null))}a=a.children;l=0;for(m=a.length;l<m;l++)c(a[l],e,g,k)}}var d=new Ye,e=new V,g=new x,k=new x(a,a),l=new p,n=new p,m=Array(4),r=Array(4),w={},t={0:1,1:0,2:2},u=[new p(1,0,0),new p(-1,0,0),new p(0,0,1),new p(0,0,-1),new p(0,1,0),new p(0,-1,0)],v=[new p(0,1,0),new p(0,1,0),new p(0,1,0),new p(0,1,0),new p(0,0,1),new p(0,0,-1)],q=[new ya,new ya,new ya,new ya,new ya,new ya];for(a=0;4!==a;++a){var A=0!==(a&1),C=0!==(a&2),E=new Ob({depthPacking:3201,morphTargets:A,skinning:C});m[a]=E;A=new bc({morphTargets:A,
|
||
|
skinning:C});r[a]=A}var wa=this;this.enabled=!1;this.autoUpdate=!0;this.needsUpdate=!1;this.type=1;this.render=function(a,b,h){if(!1!==wa.enabled&&(!1!==wa.autoUpdate||!1!==wa.needsUpdate)&&0!==a.length){var m=f.state;m.disable(f.context.BLEND);m.buffers.color.setClear(1,1,1,1);m.buffers.depth.setTest(!0);m.setScissorTest(!1);for(var r,w=0,t=a.length;w<t;w++){var p=a[w];r=p.shadow;var y=p&&p.isPointLight;if(void 0===r)console.warn("THREE.WebGLShadowMap:",p,"has no shadow.");else{var A=r.camera;g.copy(r.mapSize);
|
||
|
g.min(k);if(y){var I=g.x,Q=g.y;q[0].set(2*I,Q,I,Q);q[1].set(0,Q,I,Q);q[2].set(3*I,Q,I,Q);q[3].set(I,Q,I,Q);q[4].set(3*I,0,I,Q);q[5].set(I,0,I,Q);g.x*=4;g.y*=2}null===r.map&&(r.map=new Oa(g.x,g.y,{minFilter:1003,magFilter:1003,format:1023}),r.map.texture.name=p.name+".shadowMap",A.updateProjectionMatrix());r.isSpotLightShadow&&r.update(p);I=r.map;Q=r.matrix;n.setFromMatrixPosition(p.matrixWorld);A.position.copy(n);y?(r=6,Q.makeTranslation(-n.x,-n.y,-n.z)):(r=1,l.setFromMatrixPosition(p.target.matrixWorld),
|
||
|
A.lookAt(l),A.updateMatrixWorld(),Q.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),Q.multiply(A.projectionMatrix),Q.multiply(A.matrixWorldInverse));f.setRenderTarget(I);f.clear();for(p=0;p<r;p++)y&&(l.copy(A.position),l.add(u[p]),A.up.copy(v[p]),A.lookAt(l),A.updateMatrixWorld(),m.viewport(q[p])),e.multiplyMatrices(A.projectionMatrix,A.matrixWorldInverse),d.setFromMatrix(e),c(b,h,A,y)}}wa.needsUpdate=!1}}}function he(f,h,a,b,c,d,e,g,k){ra.call(this,f,h,a,b,c,d,e,g,k);this.needsUpdate=!0}function jl(f,
|
||
|
h,a,b,c){var d,e,g,k,l,n,m,r,w,t,u,v,q,A,C,E,wa,Q;function I(a,b){return a.renderOrder!==b.renderOrder?a.renderOrder-b.renderOrder:a.z!==b.z?b.z-a.z:b.id-a.id}var x,B,Aa,D,F=new p,z=new sa,La=new p;this.render=function(p,y,Ka){if(0!==p.length){if(void 0===Aa){var U=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),va=new Uint16Array([0,1,2,0,2,3]);x=h.createBuffer();B=h.createBuffer();h.bindBuffer(h.ARRAY_BUFFER,x);h.bufferData(h.ARRAY_BUFFER,U,h.STATIC_DRAW);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,
|
||
|
B);h.bufferData(h.ELEMENT_ARRAY_BUFFER,va,h.STATIC_DRAW);U=h.createProgram();va=h.createShader(h.VERTEX_SHADER);var ia=h.createShader(h.FRAGMENT_SHADER);h.shaderSource(va,["precision "+c.precision+" float;","#define SHADER_NAME SpriteMaterial\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 center;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float fogDepth;\nvoid main() {\n\tvUV = uvOffset + uv * uvScale;\n\tvec2 alignedPosition = ( position - center ) * 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\tvec4 mvPosition;\n\tmvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\tfogDepth = - mvPosition.z;\n}"].join("\n"));
|
||
|
h.shaderSource(ia,["precision "+c.precision+" float;","#define SHADER_NAME SpriteMaterial\nuniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvarying float fogDepth;\nvoid main() {\n\tvec4 texture = texture2D( map, vUV );\n\tgl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\n\tif ( gl_FragColor.a < alphaTest ) discard;\n\tif ( fogType > 0 ) {\n\t\tfloat fogFactor = 0.0;\n\t\tif ( fogType == 1 ) {\n\t\t\tfogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t\t} else {\n\t\t\tconst float LOG2 = 1.442695;\n\t\t\tfogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );\n\t\t\tfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\t\t}\n\t\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\t}\n}"].join("\n"));
|
||
|
h.compileShader(va);h.compileShader(ia);h.attachShader(U,va);h.attachShader(U,ia);h.linkProgram(U);Aa=U;wa=h.getAttribLocation(Aa,"position");Q=h.getAttribLocation(Aa,"uv");d=h.getUniformLocation(Aa,"uvOffset");e=h.getUniformLocation(Aa,"uvScale");g=h.getUniformLocation(Aa,"rotation");k=h.getUniformLocation(Aa,"center");l=h.getUniformLocation(Aa,"scale");n=h.getUniformLocation(Aa,"color");m=h.getUniformLocation(Aa,"map");r=h.getUniformLocation(Aa,"opacity");w=h.getUniformLocation(Aa,"modelViewMatrix");
|
||
|
t=h.getUniformLocation(Aa,"projectionMatrix");u=h.getUniformLocation(Aa,"fogType");v=h.getUniformLocation(Aa,"fogDensity");q=h.getUniformLocation(Aa,"fogNear");A=h.getUniformLocation(Aa,"fogFar");C=h.getUniformLocation(Aa,"fogColor");h.getUniformLocation(Aa,"fogDepth");E=h.getUniformLocation(Aa,"alphaTest");U=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");U.width=8;U.height=8;va=U.getContext("2d");va.fillStyle="white";va.fillRect(0,0,8,8);D=new he(U)}a.useProgram(Aa);a.initAttributes();
|
||
|
a.enableAttribute(wa);a.enableAttribute(Q);a.disableUnusedAttributes();a.disable(h.CULL_FACE);a.enable(h.BLEND);h.bindBuffer(h.ARRAY_BUFFER,x);h.vertexAttribPointer(wa,2,h.FLOAT,!1,16,0);h.vertexAttribPointer(Q,2,h.FLOAT,!1,16,8);h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,B);h.uniformMatrix4fv(t,!1,Ka.projectionMatrix.elements);a.activeTexture(h.TEXTURE0);h.uniform1i(m,0);va=U=0;(ia=y.fog)?(h.uniform3f(C,ia.color.r,ia.color.g,ia.color.b),ia.isFog?(h.uniform1f(q,ia.near),h.uniform1f(A,ia.far),h.uniform1i(u,
|
||
|
1),va=U=1):ia.isFogExp2&&(h.uniform1f(v,ia.density),h.uniform1i(u,2),va=U=2)):(h.uniform1i(u,0),va=U=0);ia=0;for(var ef=p.length;ia<ef;ia++){var Pa=p[ia];Pa.modelViewMatrix.multiplyMatrices(Ka.matrixWorldInverse,Pa.matrixWorld);Pa.z=-Pa.modelViewMatrix.elements[14]}p.sort(I);var bd=[],H=[];ia=0;for(ef=p.length;ia<ef;ia++){Pa=p[ia];var ta=Pa.material;if(!1!==ta.visible){Pa.onBeforeRender(f,y,Ka,void 0,ta,void 0);h.uniform1f(E,ta.alphaTest);h.uniformMatrix4fv(w,!1,Pa.modelViewMatrix.elements);Pa.matrixWorld.decompose(F,
|
||
|
z,La);bd[0]=La.x;bd[1]=La.y;H[0]=Pa.center.x-.5;H[1]=Pa.center.y-.5;var W=0;y.fog&&ta.fog&&(W=va);U!==W&&(h.uniform1i(u,W),U=W);null!==ta.map?(h.uniform2f(d,ta.map.offset.x,ta.map.offset.y),h.uniform2f(e,ta.map.repeat.x,ta.map.repeat.y)):(h.uniform2f(d,0,0),h.uniform2f(e,1,1));h.uniform1f(r,ta.opacity);h.uniform3f(n,ta.color.r,ta.color.g,ta.color.b);h.uniform1f(g,ta.rotation);h.uniform2fv(k,H);h.uniform2fv(l,bd);a.setBlending(ta.blending,ta.blendEquation,ta.blendSrc,ta.blendDst,ta.blendEquationAlpha,
|
||
|
ta.blendSrcAlpha,ta.blendDstAlpha,ta.premultipliedAlpha);a.buffers.depth.setTest(ta.depthTest);a.buffers.depth.setMask(ta.depthWrite);a.buffers.color.setMask(ta.colorWrite);b.setTexture2D(ta.map||D,0);h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0);Pa.onAfterRender(f,y,Ka,void 0,ta,void 0)}}a.enable(h.CULL_FACE);a.reset()}}}function kl(f,h,a){function b(a,b,c){var d=new Uint8Array(4),e=f.createTexture();f.bindTexture(a,e);f.texParameteri(a,f.TEXTURE_MIN_FILTER,f.NEAREST);f.texParameteri(a,f.TEXTURE_MAG_FILTER,
|
||
|
f.NEAREST);for(a=0;a<c;a++)f.texImage2D(b+a,0,f.RGBA,1,1,0,f.RGBA,f.UNSIGNED_BYTE,d);return e}function c(a){!0!==q[a]&&(f.enable(a),q[a]=!0)}function d(a){!1!==q[a]&&(f.disable(a),q[a]=!1)}function e(b,e,g,h,k,l,n,m){0!==b?c(f.BLEND):d(f.BLEND);if(5!==b){if(b!==wa||m!==D)switch(b){case 2:m?(f.blendEquationSeparate(f.FUNC_ADD,f.FUNC_ADD),f.blendFuncSeparate(f.ONE,f.ONE,f.ONE,f.ONE)):(f.blendEquation(f.FUNC_ADD),f.blendFunc(f.SRC_ALPHA,f.ONE));break;case 3:m?(f.blendEquationSeparate(f.FUNC_ADD,f.FUNC_ADD),
|
||
|
f.blendFuncSeparate(f.ZERO,f.ZERO,f.ONE_MINUS_SRC_COLOR,f.ONE_MINUS_SRC_ALPHA)):(f.blendEquation(f.FUNC_ADD),f.blendFunc(f.ZERO,f.ONE_MINUS_SRC_COLOR));break;case 4:m?(f.blendEquationSeparate(f.FUNC_ADD,f.FUNC_ADD),f.blendFuncSeparate(f.ZERO,f.SRC_COLOR,f.ZERO,f.SRC_ALPHA)):(f.blendEquation(f.FUNC_ADD),f.blendFunc(f.ZERO,f.SRC_COLOR));break;default:m?(f.blendEquationSeparate(f.FUNC_ADD,f.FUNC_ADD),f.blendFuncSeparate(f.ONE,f.ONE_MINUS_SRC_ALPHA,f.ONE,f.ONE_MINUS_SRC_ALPHA)):(f.blendEquationSeparate(f.FUNC_ADD,
|
||
|
f.FUNC_ADD),f.blendFuncSeparate(f.SRC_ALPHA,f.ONE_MINUS_SRC_ALPHA,f.ONE,f.ONE_MINUS_SRC_ALPHA))}Pa=Aa=B=x=I=Q=null}else{k=k||e;l=l||g;n=n||h;if(e!==Q||k!==B)f.blendEquationSeparate(a.convert(e),a.convert(k)),Q=e,B=k;if(g!==I||h!==x||l!==Aa||n!==Pa)f.blendFuncSeparate(a.convert(g),a.convert(h),a.convert(l),a.convert(n)),I=g,x=h,Aa=l,Pa=n}wa=b;D=m}function g(a){F!==a&&(a?f.frontFace(f.CW):f.frontFace(f.CCW),F=a)}function k(a){0!==a?(c(f.CULL_FACE),a!==La&&(1===a?f.cullFace(f.BACK):2===a?f.cullFace(f.FRONT):
|
||
|
f.cullFace(f.FRONT_AND_BACK))):d(f.CULL_FACE);La=a}function l(a,b,e){if(a){if(c(f.POLYGON_OFFSET_FILL),ia!==b||z!==e)f.polygonOffset(b,e),ia=b,z=e}else d(f.POLYGON_OFFSET_FILL)}function n(a){void 0===a&&(a=f.TEXTURE0+U-1);N!==a&&(f.activeTexture(a),N=a)}var m=new function(){var a=!1,b=new ya,c=null,d=new ya(0,0,0,0);return{setMask:function(b){c===b||a||(f.colorMask(b,b,b,b),c=b)},setLocked:function(b){a=b},setClear:function(a,c,e,g,h){!0===h&&(a*=g,c*=g,e*=g);b.set(a,c,e,g);!1===d.equals(b)&&(f.clearColor(a,
|
||
|
c,e,g),d.copy(b))},reset:function(){a=!1;c=null;d.set(-1,0,0,0)}}},r=new function(){var a=!1,b=null,e=null,g=null;return{setTest:function(a){a?c(f.DEPTH_TEST):d(f.DEPTH_TEST)},setMask:function(c){b===c||a||(f.depthMask(c),b=c)},setFunc:function(a){if(e!==a){if(a)switch(a){case 0:f.depthFunc(f.NEVER);break;case 1:f.depthFunc(f.ALWAYS);break;case 2:f.depthFunc(f.LESS);break;case 3:f.depthFunc(f.LEQUAL);break;case 4:f.depthFunc(f.EQUAL);break;case 5:f.depthFunc(f.GEQUAL);break;case 6:f.depthFunc(f.GREATER);
|
||
|
break;case 7:f.depthFunc(f.NOTEQUAL);break;default:f.depthFunc(f.LEQUAL)}else f.depthFunc(f.LEQUAL);e=a}},setLocked:function(b){a=b},setClear:function(a){g!==a&&(f.clearDepth(a),g=a)},reset:function(){a=!1;g=e=b=null}}},w=new function(){var a=!1,b=null,e=null,g=null,h=null,k=null,l=null,n=null,m=null;return{setTest:function(a){a?c(f.STENCIL_TEST):d(f.STENCIL_TEST)},setMask:function(c){b===c||a||(f.stencilMask(c),b=c)},setFunc:function(a,b,c){if(e!==a||g!==b||h!==c)f.stencilFunc(a,b,c),e=a,g=b,h=c},
|
||
|
setOp:function(a,b,c){if(k!==a||l!==b||n!==c)f.stencilOp(a,b,c),k=a,l=b,n=c},setLocked:function(b){a=b},setClear:function(a){m!==a&&(f.clearStencil(a),m=a)},reset:function(){a=!1;m=n=l=k=h=g=e=b=null}}},t=f.getParameter(f.MAX_VERTEX_ATTRIBS),u=new Uint8Array(t),v=new Uint8Array(t),p=new Uint8Array(t),q={},C=null,E=null,wa=null,Q=null,I=null,x=null,B=null,Aa=null,Pa=null,D=!1,F=null,La=null,va=null,ia=null,z=null,U=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),H=!1;t=0;t=f.getParameter(f.VERSION);
|
||
|
-1!==t.indexOf("WebGL")?(t=parseFloat(/^WebGL ([0-9])/.exec(t)[1]),H=1<=t):-1!==t.indexOf("OpenGL ES")&&(t=parseFloat(/^OpenGL ES ([0-9])/.exec(t)[1]),H=2<=t);var N=null,L={},G=new ya,O=new ya,J={};J[f.TEXTURE_2D]=b(f.TEXTURE_2D,f.TEXTURE_2D,1);J[f.TEXTURE_CUBE_MAP]=b(f.TEXTURE_CUBE_MAP,f.TEXTURE_CUBE_MAP_POSITIVE_X,6);m.setClear(0,0,0,1);r.setClear(1);w.setClear(0);c(f.DEPTH_TEST);r.setFunc(3);g(!1);k(1);c(f.CULL_FACE);c(f.BLEND);e(1);return{buffers:{color:m,depth:r,stencil:w},initAttributes:function(){for(var a=
|
||
|
0,b=u.length;a<b;a++)u[a]=0},enableAttribute:function(a){u[a]=1;0===v[a]&&(f.enableVertexAttribArray(a),v[a]=1);0!==p[a]&&(h.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(a,0),p[a]=0)},enableAttributeAndDivisor:function(a,b){u[a]=1;0===v[a]&&(f.enableVertexAttribArray(a),v[a]=1);p[a]!==b&&(h.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(a,b),p[a]=b)},disableUnusedAttributes:function(){for(var a=0,b=v.length;a!==b;++a)v[a]!==u[a]&&(f.disableVertexAttribArray(a),v[a]=0)},enable:c,
|
||
|
disable:d,getCompressedTextureFormats:function(){if(null===C&&(C=[],h.get("WEBGL_compressed_texture_pvrtc")||h.get("WEBGL_compressed_texture_s3tc")||h.get("WEBGL_compressed_texture_etc1")||h.get("WEBGL_compressed_texture_astc")))for(var a=f.getParameter(f.COMPRESSED_TEXTURE_FORMATS),b=0;b<a.length;b++)C.push(a[b]);return C},useProgram:function(a){return E!==a?(f.useProgram(a),E=a,!0):!1},setBlending:e,setMaterial:function(a,b){2===a.side?d(f.CULL_FACE):c(f.CULL_FACE);var h=1===a.side;b&&(h=!h);g(h);
|
||
|
!0===a.transparent?e(a.blending,a.blendEquation,a.blendSrc,a.blendDst,a.blendEquationAlpha,a.blendSrcAlpha,a.blendDstAlpha,a.premultipliedAlpha):e(0);r.setFunc(a.depthFunc);r.setTest(a.depthTest);r.setMask(a.depthWrite);m.setMask(a.colorWrite);l(a.polygonOffset,a.polygonOffsetFactor,a.polygonOffsetUnits)},setFlipSided:g,setCullFace:k,setLineWidth:function(a){a!==va&&(H&&f.lineWidth(a),va=a)},setPolygonOffset:l,setScissorTest:function(a){a?c(f.SCISSOR_TEST):d(f.SCISSOR_TEST)},activeTexture:n,bindTexture:function(a,
|
||
|
b){null===N&&n();var c=L[N];void 0===c&&(c={type:void 0,texture:void 0},L[N]=c);if(c.type!==a||c.texture!==b)f.bindTexture(a,b||J[a]),c.type=a,c.texture=b},compressedTexImage2D:function(){try{f.compressedTexImage2D.apply(f,arguments)}catch(ta){console.error("THREE.WebGLState:",ta)}},texImage2D:function(){try{f.texImage2D.apply(f,arguments)}catch(ta){console.error("THREE.WebGLState:",ta)}},scissor:function(a){!1===G.equals(a)&&(f.scissor(a.x,a.y,a.z,a.w),G.copy(a))},viewport:function(a){!1===O.equals(a)&&
|
||
|
(f.viewport(a.x,a.y,a.z,a.w),O.copy(a))},reset:function(){for(var a=0;a<v.length;a++)1===v[a]&&(f.disableVertexAttribArray(a),v[a]=0);q={};N=C=null;L={};La=F=wa=E=null;m.reset();r.reset();w.reset()}}}function ml(f,h,a,b,c,d,e){function g(a,b){if(a.width>b||a.height>b){if("data"in a){console.warn("THREE.WebGLRenderer: image in DataTexture is too big ("+a.width+"x"+a.height+").");return}b/=Math.max(a.width,a.height);var c=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");c.width=Math.floor(a.width*
|
||
|
b);c.height=Math.floor(a.height*b);c.getContext("2d").drawImage(a,0,0,a.width,a.height,0,0,c.width,c.height);console.warn("THREE.WebGLRenderer: image is too big ("+a.width+"x"+a.height+"). Resized to "+c.width+"x"+c.height,a);return c}return a}function k(a){return ja.isPowerOfTwo(a.width)&&ja.isPowerOfTwo(a.height)}function l(a,b){return a.generateMipmaps&&b&&1003!==a.minFilter&&1006!==a.minFilter}function n(a,c,d,e){f.generateMipmap(a);b.get(c).__maxMipLevel=Math.log(Math.max(d,e))*Math.LOG2E}function m(a){return 1003===
|
||
|
a||1004===a||1005===a?f.NEAREST:f.LINEAR}function r(a){a=a.target;a.removeEventListener("dispose",r);a:{var c=b.get(a);if(a.image&&c.__image__webglTextureCube)f.deleteTexture(c.__image__webglTextureCube);else{if(void 0===c.__webglInit)break a;f.deleteTexture(c.__webglTexture)}b.remove(a)}a.isVideoTexture&&delete C[a.id];e.memory.textures--}function w(a){a=a.target;a.removeEventListener("dispose",w);var c=b.get(a),d=b.get(a.texture);if(a){void 0!==d.__webglTexture&&f.deleteTexture(d.__webglTexture);
|
||
|
a.depthTexture&&a.depthTexture.dispose();if(a.isWebGLRenderTargetCube)for(d=0;6>d;d++)f.deleteFramebuffer(c.__webglFramebuffer[d]),c.__webglDepthbuffer&&f.deleteRenderbuffer(c.__webglDepthbuffer[d]);else f.deleteFramebuffer(c.__webglFramebuffer),c.__webglDepthbuffer&&f.deleteRenderbuffer(c.__webglDepthbuffer);b.remove(a.texture);b.remove(a)}e.memory.textures--}function t(h,m){var w=b.get(h);if(h.isVideoTexture){var t=h.id,v=e.render.frame;C[t]!==v&&(C[t]=v,h.update())}if(0<h.version&&w.__version!==
|
||
|
h.version)if(t=h.image,void 0===t)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",h);else if(!1===t.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",h);else{void 0===w.__webglInit&&(w.__webglInit=!0,h.addEventListener("dispose",r),w.__webglTexture=f.createTexture(),e.memory.textures++);a.activeTexture(f.TEXTURE0+m);a.bindTexture(f.TEXTURE_2D,w.__webglTexture);f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,h.flipY);f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
|
||
|
h.premultiplyAlpha);f.pixelStorei(f.UNPACK_ALIGNMENT,h.unpackAlignment);m=g(h.image,c.maxTextureSize);(1001!==h.wrapS||1001!==h.wrapT||1003!==h.minFilter&&1006!==h.minFilter)&&!1===k(m)&&(m instanceof HTMLImageElement||m instanceof HTMLCanvasElement||m instanceof ImageBitmap)&&(void 0===E&&(E=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),E.width=ja.floorPowerOfTwo(m.width),E.height=ja.floorPowerOfTwo(m.height),E.getContext("2d").drawImage(m,0,0,E.width,E.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+
|
||
|
m.width+"x"+m.height+"). Resized to "+E.width+"x"+E.height,m),m=E);t=k(m);v=d.convert(h.format);var p=d.convert(h.type);u(f.TEXTURE_2D,h,t);var y=h.mipmaps;if(h.isDepthTexture){var A=f.DEPTH_COMPONENT;if(1015===h.type){if(!q)throw Error("Float Depth Texture only supported in WebGL2.0");A=f.DEPTH_COMPONENT32F}else q&&(A=f.DEPTH_COMPONENT16);1026===h.format&&A===f.DEPTH_COMPONENT&&1012!==h.type&&1014!==h.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),
|
||
|
h.type=1012,p=d.convert(h.type));1027===h.format&&(A=f.DEPTH_STENCIL,1020!==h.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),h.type=1020,p=d.convert(h.type)));a.texImage2D(f.TEXTURE_2D,0,A,m.width,m.height,0,v,p,null)}else if(h.isDataTexture)if(0<y.length&&t){for(var Q=0,wa=y.length;Q<wa;Q++)A=y[Q],a.texImage2D(f.TEXTURE_2D,Q,v,A.width,A.height,0,v,p,A.data);h.generateMipmaps=!1;w.__maxMipLevel=y.length-1}else a.texImage2D(f.TEXTURE_2D,0,v,
|
||
|
m.width,m.height,0,v,p,m.data),w.__maxMipLevel=0;else if(h.isCompressedTexture){Q=0;for(wa=y.length;Q<wa;Q++)A=y[Q],1023!==h.format&&1022!==h.format?-1<a.getCompressedTextureFormats().indexOf(v)?a.compressedTexImage2D(f.TEXTURE_2D,Q,v,A.width,A.height,0,A.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):a.texImage2D(f.TEXTURE_2D,Q,v,A.width,A.height,0,v,p,A.data);w.__maxMipLevel=y.length-1}else if(0<y.length&&t){Q=0;for(wa=y.length;Q<
|
||
|
wa;Q++)A=y[Q],a.texImage2D(f.TEXTURE_2D,Q,v,v,p,A);h.generateMipmaps=!1;w.__maxMipLevel=y.length-1}else a.texImage2D(f.TEXTURE_2D,0,v,v,p,m),w.__maxMipLevel=0;l(h,t)&&n(f.TEXTURE_2D,h,m.width,m.height);w.__version=h.version;if(h.onUpdate)h.onUpdate(h);return}a.activeTexture(f.TEXTURE0+m);a.bindTexture(f.TEXTURE_2D,w.__webglTexture)}function u(a,e,g){g?(f.texParameteri(a,f.TEXTURE_WRAP_S,d.convert(e.wrapS)),f.texParameteri(a,f.TEXTURE_WRAP_T,d.convert(e.wrapT)),f.texParameteri(a,f.TEXTURE_MAG_FILTER,
|
||
|
d.convert(e.magFilter)),f.texParameteri(a,f.TEXTURE_MIN_FILTER,d.convert(e.minFilter))):(f.texParameteri(a,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(a,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),1001===e.wrapS&&1001===e.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",e),f.texParameteri(a,f.TEXTURE_MAG_FILTER,m(e.magFilter)),f.texParameteri(a,f.TEXTURE_MIN_FILTER,m(e.minFilter)),1003!==e.minFilter&&1006!==
|
||
|
e.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",e));!(g=h.get("EXT_texture_filter_anisotropic"))||1015===e.type&&null===h.get("OES_texture_float_linear")||1016===e.type&&null===h.get("OES_texture_half_float_linear")||!(1<e.anisotropy||b.get(e).__currentAnisotropy)||(f.texParameterf(a,g.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,c.getMaxAnisotropy())),b.get(e).__currentAnisotropy=e.anisotropy)}
|
||
|
function v(c,e,g,h){var k=d.convert(e.texture.format),l=d.convert(e.texture.type);a.texImage2D(h,0,k,e.width,e.height,0,k,l,null);f.bindFramebuffer(f.FRAMEBUFFER,c);f.framebufferTexture2D(f.FRAMEBUFFER,g,h,b.get(e.texture).__webglTexture,0);f.bindFramebuffer(f.FRAMEBUFFER,null)}function p(a,b){f.bindRenderbuffer(f.RENDERBUFFER,a);b.depthBuffer&&!b.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,b.width,b.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,
|
||
|
a)):b.depthBuffer&&b.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_STENCIL,b.width,b.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,a)):f.renderbufferStorage(f.RENDERBUFFER,f.RGBA4,b.width,b.height);f.bindRenderbuffer(f.RENDERBUFFER,null)}var q="undefined"!==typeof WebGL2RenderingContext&&f instanceof WebGL2RenderingContext,C={},E;this.setTexture2D=t;this.setTextureCube=function(h,m){var w=b.get(h);if(6===h.image.length)if(0<h.version&&w.__version!==
|
||
|
h.version){w.__image__webglTextureCube||(h.addEventListener("dispose",r),w.__image__webglTextureCube=f.createTexture(),e.memory.textures++);a.activeTexture(f.TEXTURE0+m);a.bindTexture(f.TEXTURE_CUBE_MAP,w.__image__webglTextureCube);f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,h.flipY);m=h&&h.isCompressedTexture;for(var t=h.image[0]&&h.image[0].isDataTexture,v=[],p=0;6>p;p++)v[p]=m||t?t?h.image[p].image:h.image[p]:g(h.image[p],c.maxCubemapSize);var q=v[0],y=k(q),A=d.convert(h.format),C=d.convert(h.type);u(f.TEXTURE_CUBE_MAP,
|
||
|
h,y);for(p=0;6>p;p++)if(m)for(var E,Q=v[p].mipmaps,wa=0,x=Q.length;wa<x;wa++)E=Q[wa],1023!==h.format&&1022!==h.format?-1<a.getCompressedTextureFormats().indexOf(A)?a.compressedTexImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+p,wa,A,E.width,E.height,0,E.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):a.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+p,wa,A,E.width,E.height,0,A,C,E.data);else t?a.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,A,v[p].width,
|
||
|
v[p].height,0,A,C,v[p].data):a.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+p,0,A,A,C,v[p]);w.__maxMipLevel=m?Q.length-1:0;l(h,y)&&n(f.TEXTURE_CUBE_MAP,h,q.width,q.height);w.__version=h.version;if(h.onUpdate)h.onUpdate(h)}else a.activeTexture(f.TEXTURE0+m),a.bindTexture(f.TEXTURE_CUBE_MAP,w.__image__webglTextureCube)};this.setTextureCubeDynamic=function(c,d){a.activeTexture(f.TEXTURE0+d);a.bindTexture(f.TEXTURE_CUBE_MAP,b.get(c).__webglTexture)};this.setupRenderTarget=function(c){var d=b.get(c),g=b.get(c.texture);
|
||
|
c.addEventListener("dispose",w);g.__webglTexture=f.createTexture();e.memory.textures++;var h=!0===c.isWebGLRenderTargetCube,m=k(c);if(h){d.__webglFramebuffer=[];for(var r=0;6>r;r++)d.__webglFramebuffer[r]=f.createFramebuffer()}else d.__webglFramebuffer=f.createFramebuffer();if(h){a.bindTexture(f.TEXTURE_CUBE_MAP,g.__webglTexture);u(f.TEXTURE_CUBE_MAP,c.texture,m);for(r=0;6>r;r++)v(d.__webglFramebuffer[r],c,f.COLOR_ATTACHMENT0,f.TEXTURE_CUBE_MAP_POSITIVE_X+r);l(c.texture,m)&&n(f.TEXTURE_CUBE_MAP,c.texture,
|
||
|
c.width,c.height);a.bindTexture(f.TEXTURE_CUBE_MAP,null)}else a.bindTexture(f.TEXTURE_2D,g.__webglTexture),u(f.TEXTURE_2D,c.texture,m),v(d.__webglFramebuffer,c,f.COLOR_ATTACHMENT0,f.TEXTURE_2D),l(c.texture,m)&&n(f.TEXTURE_2D,c.texture,c.width,c.height),a.bindTexture(f.TEXTURE_2D,null);if(c.depthBuffer){d=b.get(c);g=!0===c.isWebGLRenderTargetCube;if(c.depthTexture){if(g)throw Error("target.depthTexture not supported in Cube render targets");if(c&&c.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported");
|
||
|
f.bindFramebuffer(f.FRAMEBUFFER,d.__webglFramebuffer);if(!c.depthTexture||!c.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");b.get(c.depthTexture).__webglTexture&&c.depthTexture.image.width===c.width&&c.depthTexture.image.height===c.height||(c.depthTexture.image.width=c.width,c.depthTexture.image.height=c.height,c.depthTexture.needsUpdate=!0);t(c.depthTexture,0);d=b.get(c.depthTexture).__webglTexture;if(1026===c.depthTexture.format)f.framebufferTexture2D(f.FRAMEBUFFER,
|
||
|
f.DEPTH_ATTACHMENT,f.TEXTURE_2D,d,0);else if(1027===c.depthTexture.format)f.framebufferTexture2D(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.TEXTURE_2D,d,0);else throw Error("Unknown depthTexture format");}else if(g)for(d.__webglDepthbuffer=[],g=0;6>g;g++)f.bindFramebuffer(f.FRAMEBUFFER,d.__webglFramebuffer[g]),d.__webglDepthbuffer[g]=f.createRenderbuffer(),p(d.__webglDepthbuffer[g],c);else f.bindFramebuffer(f.FRAMEBUFFER,d.__webglFramebuffer),d.__webglDepthbuffer=f.createRenderbuffer(),p(d.__webglDepthbuffer,
|
||
|
c);f.bindFramebuffer(f.FRAMEBUFFER,null)}};this.updateRenderTargetMipmap=function(c){var d=c.texture,e=k(c);if(l(d,e)){e=c.isWebGLRenderTargetCube?f.TEXTURE_CUBE_MAP:f.TEXTURE_2D;var g=b.get(d).__webglTexture;a.bindTexture(e,g);n(e,d,c.width,c.height);a.bindTexture(e,null)}}}function nl(f,h){return{convert:function(a){if(1E3===a)return f.REPEAT;if(1001===a)return f.CLAMP_TO_EDGE;if(1002===a)return f.MIRRORED_REPEAT;if(1003===a)return f.NEAREST;if(1004===a)return f.NEAREST_MIPMAP_NEAREST;if(1005===
|
||
|
a)return f.NEAREST_MIPMAP_LINEAR;if(1006===a)return f.LINEAR;if(1007===a)return f.LINEAR_MIPMAP_NEAREST;if(1008===a)return f.LINEAR_MIPMAP_LINEAR;if(1009===a)return f.UNSIGNED_BYTE;if(1017===a)return f.UNSIGNED_SHORT_4_4_4_4;if(1018===a)return f.UNSIGNED_SHORT_5_5_5_1;if(1019===a)return f.UNSIGNED_SHORT_5_6_5;if(1010===a)return f.BYTE;if(1011===a)return f.SHORT;if(1012===a)return f.UNSIGNED_SHORT;if(1013===a)return f.INT;if(1014===a)return f.UNSIGNED_INT;if(1015===a)return f.FLOAT;if(1016===a){var b=
|
||
|
h.get("OES_texture_half_float");if(null!==b)return b.HALF_FLOAT_OES}if(1021===a)return f.ALPHA;if(1022===a)return f.RGB;if(1023===a)return f.RGBA;if(1024===a)return f.LUMINANCE;if(1025===a)return f.LUMINANCE_ALPHA;if(1026===a)return f.DEPTH_COMPONENT;if(1027===a)return f.DEPTH_STENCIL;if(100===a)return f.FUNC_ADD;if(101===a)return f.FUNC_SUBTRACT;if(102===a)return f.FUNC_REVERSE_SUBTRACT;if(200===a)return f.ZERO;if(201===a)return f.ONE;if(202===a)return f.SRC_COLOR;if(203===a)return f.ONE_MINUS_SRC_COLOR;
|
||
|
if(204===a)return f.SRC_ALPHA;if(205===a)return f.ONE_MINUS_SRC_ALPHA;if(206===a)return f.DST_ALPHA;if(207===a)return f.ONE_MINUS_DST_ALPHA;if(208===a)return f.DST_COLOR;if(209===a)return f.ONE_MINUS_DST_COLOR;if(210===a)return f.SRC_ALPHA_SATURATE;if(33776===a||33777===a||33778===a||33779===a)if(b=h.get("WEBGL_compressed_texture_s3tc"),null!==b){if(33776===a)return b.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===a)return b.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===a)return b.COMPRESSED_RGBA_S3TC_DXT3_EXT;
|
||
|
if(33779===a)return b.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===a||35841===a||35842===a||35843===a)if(b=h.get("WEBGL_compressed_texture_pvrtc"),null!==b){if(35840===a)return b.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===a)return b.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===a)return b.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===a)return b.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===a&&(b=h.get("WEBGL_compressed_texture_etc1"),null!==b))return b.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(b=h.get("WEBGL_compressed_texture_astc"),null!==b)return a;if(103===a||104===a)if(b=h.get("EXT_blend_minmax"),null!==b){if(103===a)return b.MIN_EXT;if(104===a)return b.MAX_EXT}return 1020===a&&(b=h.get("WEBGL_depth_texture"),null!==b)?b.UNSIGNED_INT_24_8_WEBGL:0}}}function Ba(f,h,a,b){Ab.call(this);this.type="PerspectiveCamera";this.fov=void 0!==f?f:50;this.zoom=1;this.near=
|
||
|
void 0!==a?a:.1;this.far=void 0!==b?b:2E3;this.focus=10;this.aspect=void 0!==h?h:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix()}function jf(f){Ba.call(this);this.cameras=f||[]}function gh(f){function h(){if(null!==b&&!0===b.isPresenting){var c=b.getEyeParameters("left"),d=c.renderWidth;c=c.renderHeight;u=f.getPixelRatio();t=f.getSize();f.setDrawingBufferSize(2*d,c,1)}else a.enabled&&f.setDrawingBufferSize(t.width,t.height,u)}var a=this,b=null,c=null,d=null,e=new V,
|
||
|
g=new V;"undefined"!==typeof window&&"VRFrameData"in window&&(c=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",h,!1));var k=new V,l=new sa,n=new p,m=new Ba;m.bounds=new ya(0,0,.5,1);m.layers.enable(1);var r=new Ba;r.bounds=new ya(.5,0,.5,1);r.layers.enable(2);var w=new jf([m,r]);w.layers.enable(1);w.layers.enable(2);var t,u;this.enabled=!1;this.userHeight=1.6;this.getDevice=function(){return b};this.setDevice=function(a){void 0!==a&&(b=a)};this.setPoseTarget=function(a){void 0!==
|
||
|
a&&(d=a)};this.getCamera=function(f){if(null===b)return f;b.depthNear=f.near;b.depthFar=f.far;b.getFrameData(c);var h=b.stageParameters;h?e.fromArray(h.sittingToStandingTransform):e.makeTranslation(0,a.userHeight,0);h=c.pose;var t=null!==d?d:f;t.matrix.copy(e);t.matrix.decompose(t.position,t.quaternion,t.scale);null!==h.orientation&&(l.fromArray(h.orientation),t.quaternion.multiply(l));null!==h.position&&(l.setFromRotationMatrix(e),n.fromArray(h.position),n.applyQuaternion(l),t.position.add(n));t.updateMatrixWorld();
|
||
|
if(!1===b.isPresenting)return f;m.near=f.near;r.near=f.near;m.far=f.far;r.far=f.far;w.matrixWorld.copy(f.matrixWorld);w.matrixWorldInverse.copy(f.matrixWorldInverse);m.matrixWorldInverse.fromArray(c.leftViewMatrix);r.matrixWorldInverse.fromArray(c.rightViewMatrix);g.getInverse(e);m.matrixWorldInverse.multiply(g);r.matrixWorldInverse.multiply(g);f=t.parent;null!==f&&(k.getInverse(f.matrixWorld),m.matrixWorldInverse.multiply(k),r.matrixWorldInverse.multiply(k));m.matrixWorld.getInverse(m.matrixWorldInverse);
|
||
|
r.matrixWorld.getInverse(r.matrixWorldInverse);m.projectionMatrix.fromArray(c.leftProjectionMatrix);r.projectionMatrix.fromArray(c.rightProjectionMatrix);w.projectionMatrix.copy(m.projectionMatrix);f=b.getLayers();f.length&&(f=f[0],null!==f.leftBounds&&4===f.leftBounds.length&&m.bounds.fromArray(f.leftBounds),null!==f.rightBounds&&4===f.rightBounds.length&&r.bounds.fromArray(f.rightBounds));return w};this.getStandingMatrix=function(){return e};this.submitFrame=function(){null!==b&&!0===b.isPresenting&&
|
||
|
b.submitFrame()};this.dispose=function(){"undefined"!==typeof window&&window.removeEventListener("vrdisplaypresentchange",h)}}function kf(f){function h(){Fa=new nk(M);Fa.get("WEBGL_depth_texture");Fa.get("OES_texture_float");Fa.get("OES_texture_float_linear");Fa.get("OES_texture_half_float");Fa.get("OES_texture_half_float_linear");Fa.get("OES_standard_derivatives");Fa.get("OES_element_index_uint");Fa.get("ANGLE_instanced_arrays");ua=new nl(M,Fa);da=new lk(M,Fa,f);na=new kl(M,Fa,ua);na.scissor(J.copy(ma).multiplyScalar(S));
|
||
|
na.viewport(G.copy(W).multiplyScalar(S));fa=new qk(M);ba=new $k;ha=new ml(M,Fa,na,ba,da,ua,fa);ka=new ek(M);la=new ok(M,ka,fa);pa=new tk(la,fa);za=new sk(M);oa=new Zk(z,Fa,da);sa=new dl;ra=new il;qa=new jk(z,na,la,Q);Ba=new kk(M,Fa,fa);Ca=new pk(M,Fa,fa);Da=new jl(z,M,na,ha,da);fa.programs=oa.programs;z.context=M;z.capabilities=da;z.extensions=Fa;z.properties=ba;z.renderLists=sa;z.state=na;z.info=fa}function a(a){a.preventDefault();console.log("THREE.WebGLRenderer: Context Lost.");H=!0}function b(){console.log("THREE.WebGLRenderer: Context Restored.");
|
||
|
H=!1;h()}function c(a){a=a.target;a.removeEventListener("dispose",c);d(a);ba.remove(a)}function d(a){var b=ba.get(a).program;a.program=void 0;void 0!==b&&oa.releaseProgram(b)}function e(a,b,c){a.render(function(a){z.renderBufferImmediate(a,b,c)})}function g(){var a=xa.getDevice();a&&a.isPresenting?a.requestAnimationFrame(k):window.requestAnimationFrame(k)}function k(a){!1!==Ea&&(Ha(a),g())}function l(a,b,c){if(!1!==a.visible){if(a.layers.test(b.layers))if(a.isLight)F.pushLight(a),a.castShadow&&F.pushShadow(a);
|
||
|
else if(a.isSprite)a.frustumCulled&&!X.intersectsSprite(a)||F.pushSprite(a);else if(a.isImmediateRenderObject)c&&ea.setFromMatrixPosition(a.matrixWorld).applyMatrix4(aa),D.push(a,null,a.material,ea.z,null);else if(a.isMesh||a.isLine||a.isPoints)if(a.isSkinnedMesh&&a.skeleton.update(),!a.frustumCulled||X.intersectsObject(a)){c&&ea.setFromMatrixPosition(a.matrixWorld).applyMatrix4(aa);var d=pa.update(a),e=a.material;if(Array.isArray(e))for(var g=d.groups,f=0,h=g.length;f<h;f++){var k=g[f],m=e[k.materialIndex];
|
||
|
m&&m.visible&&D.push(a,d,m,ea.z,k)}else e.visible&&D.push(a,d,e,ea.z,null)}a=a.children;f=0;for(h=a.length;f<h;f++)l(a[f],b,c)}}function n(a,b,c,d){for(var e=0,g=a.length;e<g;e++){var f=a[e],h=f.object,k=f.geometry,l=void 0===d?f.material:d;f=f.group;if(c.isArrayCamera){U=c;for(var n=c.cameras,r=0,w=n.length;r<w;r++){var t=n[r];if(h.layers.test(t.layers)){var u=t.bounds;na.viewport(G.set(u.x*R,u.y*K,u.z*R,u.w*K).multiplyScalar(S));m(h,b,t,k,l,f)}}}else U=null,m(h,b,c,k,l,f)}}function m(a,b,c,d,g,
|
||
|
f){a.onBeforeRender(z,b,c,d,g,f);F=ra.get(b,U||c);a.modelViewMatrix.multiplyMatrices(c.matrixWorldInverse,a.matrixWorld);a.normalMatrix.getNormalMatrix(a.modelViewMatrix);if(a.isImmediateRenderObject){var h=a.isMesh&&0>a.matrixWorld.determinant();na.setMaterial(g,h);h=w(c,b.fog,g,a);ia="";e(a,h,g)}else z.renderBufferDirect(c,b.fog,d,g,a,f);a.onAfterRender(z,b,c,d,g,f);F=ra.get(b,U||c)}function r(a,b,e){var g=ba.get(a),f=F.state.lights;e=oa.getParameters(a,f.state,F.state.shadowsArray,b,Y.numPlanes,
|
||
|
Y.numIntersection,e);var h=oa.getProgramCode(a,e),k=g.program,l=!0;if(void 0===k)a.addEventListener("dispose",c);else if(k.code!==h)d(a);else{if(g.lightsHash!==f.state.hash)ba.update(a,"lightsHash",f.state.hash);else if(void 0!==e.shaderID)return;l=!1}l&&(e.shaderID?(k=tc[e.shaderID],g.shader={name:a.type,uniforms:$a.clone(k.uniforms),vertexShader:k.vertexShader,fragmentShader:k.fragmentShader}):g.shader={name:a.type,uniforms:a.uniforms,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader},
|
||
|
a.onBeforeCompile(g.shader,z),k=oa.acquireProgram(a,g.shader,e,h),g.program=k,a.program=k);e=k.getAttributes();if(a.morphTargets)for(h=a.numSupportedMorphTargets=0;h<z.maxMorphTargets;h++)0<=e["morphTarget"+h]&&a.numSupportedMorphTargets++;if(a.morphNormals)for(h=a.numSupportedMorphNormals=0;h<z.maxMorphNormals;h++)0<=e["morphNormal"+h]&&a.numSupportedMorphNormals++;e=g.shader.uniforms;if(!a.isShaderMaterial&&!a.isRawShaderMaterial||!0===a.clipping)g.numClippingPlanes=Y.numPlanes,g.numIntersection=
|
||
|
Y.numIntersection,e.clippingPlanes=Y.uniform;g.fog=b;g.lightsHash=f.state.hash;a.lights&&(e.ambientLightColor.value=f.state.ambient,e.directionalLights.value=f.state.directional,e.spotLights.value=f.state.spot,e.rectAreaLights.value=f.state.rectArea,e.pointLights.value=f.state.point,e.hemisphereLights.value=f.state.hemi,e.directionalShadowMap.value=f.state.directionalShadowMap,e.directionalShadowMatrix.value=f.state.directionalShadowMatrix,e.spotShadowMap.value=f.state.spotShadowMap,e.spotShadowMatrix.value=
|
||
|
f.state.spotShadowMatrix,e.pointShadowMap.value=f.state.pointShadowMap,e.pointShadowMatrix.value=f.state.pointShadowMatrix);a=g.program.getUniforms();a=Nb.seqWithValue(a.seq,e);g.uniformsList=a}function w(a,b,c,d){P=0;var e=ba.get(c),g=F.state.lights;Z&&(ca||a!==L)&&Y.setState(c.clippingPlanes,c.clipIntersection,c.clipShadows,a,e,a===L&&c.id===va);!1===c.needsUpdate&&(void 0===e.program?c.needsUpdate=!0:c.fog&&e.fog!==b?c.needsUpdate=!0:c.lights&&e.lightsHash!==g.state.hash?c.needsUpdate=!0:void 0===
|
||
|
e.numClippingPlanes||e.numClippingPlanes===Y.numPlanes&&e.numIntersection===Y.numIntersection||(c.needsUpdate=!0));c.needsUpdate&&(r(c,b,d),c.needsUpdate=!1);var f=!1,h=!1,k=!1;g=e.program;var l=g.getUniforms(),m=e.shader.uniforms;na.useProgram(g.program)&&(k=h=f=!0);c.id!==va&&(va=c.id,h=!0);if(f||a!==L){l.setValue(M,"projectionMatrix",a.projectionMatrix);da.logarithmicDepthBuffer&&l.setValue(M,"logDepthBufFC",2/(Math.log(a.far+1)/Math.LN2));L!==(U||a)&&(L=U||a,k=h=!0);if(c.isShaderMaterial||c.isMeshPhongMaterial||
|
||
|
c.isMeshStandardMaterial||c.envMap)f=l.map.cameraPosition,void 0!==f&&f.setValue(M,ea.setFromMatrixPosition(a.matrixWorld));(c.isMeshPhongMaterial||c.isMeshLambertMaterial||c.isMeshBasicMaterial||c.isMeshStandardMaterial||c.isShaderMaterial||c.skinning)&&l.setValue(M,"viewMatrix",a.matrixWorldInverse)}if(c.skinning&&(l.setOptional(M,d,"bindMatrix"),l.setOptional(M,d,"bindMatrixInverse"),a=d.skeleton))if(f=a.bones,da.floatVertexTextures){if(void 0===a.boneTexture){f=Math.sqrt(4*f.length);f=ja.ceilPowerOfTwo(f);
|
||
|
f=Math.max(f,4);var n=new Float32Array(f*f*4);n.set(a.boneMatrices);var w=new Yb(n,f,f,1023,1015);w.needsUpdate=!0;a.boneMatrices=n;a.boneTexture=w;a.boneTextureSize=f}l.setValue(M,"boneTexture",a.boneTexture);l.setValue(M,"boneTextureSize",a.boneTextureSize)}else l.setOptional(M,a,"boneMatrices");h&&(l.setValue(M,"toneMappingExposure",z.toneMappingExposure),l.setValue(M,"toneMappingWhitePoint",z.toneMappingWhitePoint),c.lights&&(h=k,m.ambientLightColor.needsUpdate=h,m.directionalLights.needsUpdate=
|
||
|
h,m.pointLights.needsUpdate=h,m.spotLights.needsUpdate=h,m.rectAreaLights.needsUpdate=h,m.hemisphereLights.needsUpdate=h),b&&c.fog&&(m.fogColor.value=b.color,b.isFog?(m.fogNear.value=b.near,m.fogFar.value=b.far):b.isFogExp2&&(m.fogDensity.value=b.density)),c.isMeshBasicMaterial?t(m,c):c.isMeshLambertMaterial?(t(m,c),c.emissiveMap&&(m.emissiveMap.value=c.emissiveMap)):c.isMeshPhongMaterial?(t(m,c),c.isMeshToonMaterial?(u(m,c),c.gradientMap&&(m.gradientMap.value=c.gradientMap)):u(m,c)):c.isMeshStandardMaterial?
|
||
|
(t(m,c),c.isMeshPhysicalMaterial&&(m.clearCoat.value=c.clearCoat,m.clearCoatRoughness.value=c.clearCoatRoughness),m.roughness.value=c.roughness,m.metalness.value=c.metalness,c.roughnessMap&&(m.roughnessMap.value=c.roughnessMap),c.metalnessMap&&(m.metalnessMap.value=c.metalnessMap),c.emissiveMap&&(m.emissiveMap.value=c.emissiveMap),c.bumpMap&&(m.bumpMap.value=c.bumpMap,m.bumpScale.value=c.bumpScale),c.normalMap&&(m.normalMap.value=c.normalMap,m.normalScale.value.copy(c.normalScale)),c.displacementMap&&
|
||
|
(m.displacementMap.value=c.displacementMap,m.displacementScale.value=c.displacementScale,m.displacementBias.value=c.displacementBias),c.envMap&&(m.envMapIntensity.value=c.envMapIntensity)):c.isMeshDepthMaterial?(t(m,c),c.displacementMap&&(m.displacementMap.value=c.displacementMap,m.displacementScale.value=c.displacementScale,m.displacementBias.value=c.displacementBias)):c.isMeshDistanceMaterial?(t(m,c),c.displacementMap&&(m.displacementMap.value=c.displacementMap,m.displacementScale.value=c.displacementScale,
|
||
|
m.displacementBias.value=c.displacementBias),m.referencePosition.value.copy(c.referencePosition),m.nearDistance.value=c.nearDistance,m.farDistance.value=c.farDistance):c.isMeshNormalMaterial?(t(m,c),c.bumpMap&&(m.bumpMap.value=c.bumpMap,m.bumpScale.value=c.bumpScale),c.normalMap&&(m.normalMap.value=c.normalMap,m.normalScale.value.copy(c.normalScale)),c.displacementMap&&(m.displacementMap.value=c.displacementMap,m.displacementScale.value=c.displacementScale,m.displacementBias.value=c.displacementBias)):
|
||
|
c.isLineBasicMaterial?(m.diffuse.value=c.color,m.opacity.value=c.opacity,c.isLineDashedMaterial&&(m.dashSize.value=c.dashSize,m.totalSize.value=c.dashSize+c.gapSize,m.scale.value=c.scale)):c.isPointsMaterial?(m.diffuse.value=c.color,m.opacity.value=c.opacity,m.size.value=c.size*S,m.scale.value=.5*K,m.map.value=c.map,null!==c.map&&(!0===c.map.matrixAutoUpdate&&c.map.updateMatrix(),m.uvTransform.value.copy(c.map.matrix))):c.isShadowMaterial&&(m.color.value=c.color,m.opacity.value=c.opacity),void 0!==
|
||
|
m.ltc_1&&(m.ltc_1.value=T.LTC_1),void 0!==m.ltc_2&&(m.ltc_2.value=T.LTC_2),Nb.upload(M,e.uniformsList,m,z));c.isShaderMaterial&&!0===c.uniformsNeedUpdate&&(Nb.upload(M,e.uniformsList,m,z),c.uniformsNeedUpdate=!1);l.setValue(M,"modelViewMatrix",d.modelViewMatrix);l.setValue(M,"normalMatrix",d.normalMatrix);l.setValue(M,"modelMatrix",d.matrixWorld);return g}function t(a,b){a.opacity.value=b.opacity;b.color&&(a.diffuse.value=b.color);b.emissive&&a.emissive.value.copy(b.emissive).multiplyScalar(b.emissiveIntensity);
|
||
|
b.map&&(a.map.value=b.map);b.alphaMap&&(a.alphaMap.value=b.alphaMap);b.specularMap&&(a.specularMap.value=b.specularMap);b.envMap&&(a.envMap.value=b.envMap,a.flipEnvMap.value=b.envMap&&b.envMap.isCubeTexture?-1:1,a.reflectivity.value=b.reflectivity,a.refractionRatio.value=b.refractionRatio,a.maxMipLevel.value=ba.get(b.envMap).__maxMipLevel);b.lightMap&&(a.lightMap.value=b.lightMap,a.lightMapIntensity.value=b.lightMapIntensity);b.aoMap&&(a.aoMap.value=b.aoMap,a.aoMapIntensity.value=b.aoMapIntensity);
|
||
|
if(b.map)var c=b.map;else b.specularMap?c=b.specularMap:b.displacementMap?c=b.displacementMap:b.normalMap?c=b.normalMap:b.bumpMap?c=b.bumpMap:b.roughnessMap?c=b.roughnessMap:b.metalnessMap?c=b.metalnessMap:b.alphaMap?c=b.alphaMap:b.emissiveMap&&(c=b.emissiveMap);void 0!==c&&(c.isWebGLRenderTarget&&(c=c.texture),!0===c.matrixAutoUpdate&&c.updateMatrix(),a.uvTransform.value.copy(c.matrix))}function u(a,b){a.specular.value=b.specular;a.shininess.value=Math.max(b.shininess,1E-4);b.emissiveMap&&(a.emissiveMap.value=
|
||
|
b.emissiveMap);b.bumpMap&&(a.bumpMap.value=b.bumpMap,a.bumpScale.value=b.bumpScale);b.normalMap&&(a.normalMap.value=b.normalMap,a.normalScale.value.copy(b.normalScale));b.displacementMap&&(a.displacementMap.value=b.displacementMap,a.displacementScale.value=b.displacementScale,a.displacementBias.value=b.displacementBias)}console.log("THREE.WebGLRenderer","92");f=f||{};var v=void 0!==f.canvas?f.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),q=void 0!==f.context?f.context:null,
|
||
|
A=void 0!==f.alpha?f.alpha:!1,C=void 0!==f.depth?f.depth:!0,E=void 0!==f.stencil?f.stencil:!0,x=void 0!==f.antialias?f.antialias:!1,Q=void 0!==f.premultipliedAlpha?f.premultipliedAlpha:!0,I=void 0!==f.preserveDrawingBuffer?f.preserveDrawingBuffer:!1,B=void 0!==f.powerPreference?f.powerPreference:"default",D=null,F=null;this.domElement=v;this.context=null;this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0;this.clippingPlanes=[];this.localClippingEnabled=
|
||
|
!1;this.gammaFactor=2;this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1;this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1;this.maxMorphTargets=8;this.maxMorphNormals=4;var z=this,H=!1,N=null,La=null,va=-1,ia="",L=null,U=null,G=new ya,J=new ya,O=null,P=0,R=v.width,K=v.height,S=1,W=new ya(0,0,R,K),ma=new ya(0,0,R,K),Ia=!1,X=new Ye,Y=new mk,Z=!1,ca=!1,aa=new V,ea=new p;try{A={alpha:A,depth:C,stencil:E,antialias:x,premultipliedAlpha:Q,preserveDrawingBuffer:I,powerPreference:B};
|
||
|
v.addEventListener("webglcontextlost",a,!1);v.addEventListener("webglcontextrestored",b,!1);var M=q||v.getContext("webgl",A)||v.getContext("experimental-webgl",A);if(null===M){if(null!==v.getContext("webgl"))throw Error("Error creating WebGL context with your selected attributes.");throw Error("Error creating WebGL context.");}void 0===M.getShaderPrecisionFormat&&(M.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(ol){console.error("THREE.WebGLRenderer: "+ol.message)}var Fa,
|
||
|
da,na,fa,ba,ha,ka,la,pa,oa,sa,ra,qa,za,Ba,Ca,Da,ua;h();var xa=new gh(z);this.vr=xa;var Ga=new fh(z,pa,da.maxTextureSize);this.shadowMap=Ga;this.getContext=function(){return M};this.getContextAttributes=function(){return M.getContextAttributes()};this.forceContextLoss=function(){var a=Fa.get("WEBGL_lose_context");a&&a.loseContext()};this.forceContextRestore=function(){var a=Fa.get("WEBGL_lose_context");a&&a.restoreContext()};this.getPixelRatio=function(){return S};this.setPixelRatio=function(a){void 0!==
|
||
|
a&&(S=a,this.setSize(R,K,!1))};this.getSize=function(){return{width:R,height:K}};this.setSize=function(a,b,c){var d=xa.getDevice();d&&d.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(R=a,K=b,v.width=a*S,v.height=b*S,!1!==c&&(v.style.width=a+"px",v.style.height=b+"px"),this.setViewport(0,0,a,b))};this.getDrawingBufferSize=function(){return{width:R*S,height:K*S}};this.setDrawingBufferSize=function(a,b,c){R=a;K=b;S=c;v.width=a*c;v.height=b*c;this.setViewport(0,
|
||
|
0,a,b)};this.getCurrentViewport=function(){return G};this.setViewport=function(a,b,c,d){W.set(a,K-b-d,c,d);na.viewport(G.copy(W).multiplyScalar(S))};this.setScissor=function(a,b,c,d){ma.set(a,K-b-d,c,d);na.scissor(J.copy(ma).multiplyScalar(S))};this.setScissorTest=function(a){na.setScissorTest(Ia=a)};this.getClearColor=function(){return qa.getClearColor()};this.setClearColor=function(){qa.setClearColor.apply(qa,arguments)};this.getClearAlpha=function(){return qa.getClearAlpha()};this.setClearAlpha=
|
||
|
function(){qa.setClearAlpha.apply(qa,arguments)};this.clear=function(a,b,c){var d=0;if(void 0===a||a)d|=M.COLOR_BUFFER_BIT;if(void 0===b||b)d|=M.DEPTH_BUFFER_BIT;if(void 0===c||c)d|=M.STENCIL_BUFFER_BIT;M.clear(d)};this.clearColor=function(){this.clear(!0,!1,!1)};this.clearDepth=function(){this.clear(!1,!0,!1)};this.clearStencil=function(){this.clear(!1,!1,!0)};this.clearTarget=function(a,b,c,d){this.setRenderTarget(a);this.clear(b,c,d)};this.dispose=function(){v.removeEventListener("webglcontextlost",
|
||
|
a,!1);v.removeEventListener("webglcontextrestored",b,!1);sa.dispose();ra.dispose();ba.dispose();pa.dispose();xa.dispose();Ea=!1};this.renderBufferImmediate=function(a,b,c){na.initAttributes();var d=ba.get(a);a.hasPositions&&!d.position&&(d.position=M.createBuffer());a.hasNormals&&!d.normal&&(d.normal=M.createBuffer());a.hasUvs&&!d.uv&&(d.uv=M.createBuffer());a.hasColors&&!d.color&&(d.color=M.createBuffer());b=b.getAttributes();a.hasPositions&&(M.bindBuffer(M.ARRAY_BUFFER,d.position),M.bufferData(M.ARRAY_BUFFER,
|
||
|
a.positionArray,M.DYNAMIC_DRAW),na.enableAttribute(b.position),M.vertexAttribPointer(b.position,3,M.FLOAT,!1,0,0));if(a.hasNormals){M.bindBuffer(M.ARRAY_BUFFER,d.normal);if(!c.isMeshPhongMaterial&&!c.isMeshStandardMaterial&&!c.isMeshNormalMaterial&&!0===c.flatShading)for(var e=0,g=3*a.count;e<g;e+=9){var f=a.normalArray,h=(f[e+0]+f[e+3]+f[e+6])/3,k=(f[e+1]+f[e+4]+f[e+7])/3,l=(f[e+2]+f[e+5]+f[e+8])/3;f[e+0]=h;f[e+1]=k;f[e+2]=l;f[e+3]=h;f[e+4]=k;f[e+5]=l;f[e+6]=h;f[e+7]=k;f[e+8]=l}M.bufferData(M.ARRAY_BUFFER,
|
||
|
a.normalArray,M.DYNAMIC_DRAW);na.enableAttribute(b.normal);M.vertexAttribPointer(b.normal,3,M.FLOAT,!1,0,0)}a.hasUvs&&c.map&&(M.bindBuffer(M.ARRAY_BUFFER,d.uv),M.bufferData(M.ARRAY_BUFFER,a.uvArray,M.DYNAMIC_DRAW),na.enableAttribute(b.uv),M.vertexAttribPointer(b.uv,2,M.FLOAT,!1,0,0));a.hasColors&&0!==c.vertexColors&&(M.bindBuffer(M.ARRAY_BUFFER,d.color),M.bufferData(M.ARRAY_BUFFER,a.colorArray,M.DYNAMIC_DRAW),na.enableAttribute(b.color),M.vertexAttribPointer(b.color,3,M.FLOAT,!1,0,0));na.disableUnusedAttributes();
|
||
|
M.drawArrays(M.TRIANGLES,0,a.count);a.count=0};this.renderBufferDirect=function(a,b,c,d,e,f){var g=e.isMesh&&0>e.matrixWorld.determinant();na.setMaterial(d,g);var h=w(a,b,d,e);a=c.id+"_"+h.id+"_"+(!0===d.wireframe);var k=!1;a!==ia&&(ia=a,k=!0);e.morphTargetInfluences&&(za.update(e,c,d,h),k=!0);g=c.index;var l=c.attributes.position;b=1;!0===d.wireframe&&(g=la.getWireframeAttribute(c),b=2);a=Ba;if(null!==g){var m=ka.get(g);a=Ca;a.setIndex(m)}if(k){if(c&&c.isInstancedBufferGeometry&&null===Fa.get("ANGLE_instanced_arrays"))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
|
||
|
else{na.initAttributes();k=c.attributes;h=h.getAttributes();var n=d.defaultAttributeValues;for(E in h){var r=h[E];if(0<=r){var t=k[E];if(void 0!==t){var u=t.normalized,p=t.itemSize,v=ka.get(t);if(void 0!==v){var q=v.buffer,A=v.type;v=v.bytesPerElement;if(t.isInterleavedBufferAttribute){var y=t.data,C=y.stride;t=t.offset;y&&y.isInstancedInterleavedBuffer?(na.enableAttributeAndDivisor(r,y.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=y.meshPerAttribute*y.count)):na.enableAttribute(r);
|
||
|
M.bindBuffer(M.ARRAY_BUFFER,q);M.vertexAttribPointer(r,p,A,u,C*v,t*v)}else t.isInstancedBufferAttribute?(na.enableAttributeAndDivisor(r,t.meshPerAttribute),void 0===c.maxInstancedCount&&(c.maxInstancedCount=t.meshPerAttribute*t.count)):na.enableAttribute(r),M.bindBuffer(M.ARRAY_BUFFER,q),M.vertexAttribPointer(r,p,A,u,0,0)}}else if(void 0!==n&&(u=n[E],void 0!==u))switch(u.length){case 2:M.vertexAttrib2fv(r,u);break;case 3:M.vertexAttrib3fv(r,u);break;case 4:M.vertexAttrib4fv(r,u);break;default:M.vertexAttrib1fv(r,
|
||
|
u)}}}na.disableUnusedAttributes()}null!==g&&M.bindBuffer(M.ELEMENT_ARRAY_BUFFER,m.buffer)}m=Infinity;null!==g?m=g.count:void 0!==l&&(m=l.count);g=c.drawRange.start*b;l=null!==f?f.start*b:0;var E=Math.max(g,l);f=Math.max(0,Math.min(m,g+c.drawRange.count*b,l+(null!==f?f.count*b:Infinity))-1-E+1);if(0!==f){if(e.isMesh)if(!0===d.wireframe)na.setLineWidth(d.wireframeLinewidth*(null===N?S:1)),a.setMode(M.LINES);else switch(e.drawMode){case 0:a.setMode(M.TRIANGLES);break;case 1:a.setMode(M.TRIANGLE_STRIP);
|
||
|
break;case 2:a.setMode(M.TRIANGLE_FAN)}else e.isLine?(d=d.linewidth,void 0===d&&(d=1),na.setLineWidth(d*(null===N?S:1)),e.isLineSegments?a.setMode(M.LINES):e.isLineLoop?a.setMode(M.LINE_LOOP):a.setMode(M.LINE_STRIP)):e.isPoints&&a.setMode(M.POINTS);c&&c.isInstancedBufferGeometry?0<c.maxInstancedCount&&a.renderInstances(c,E,f):a.render(E,f)}};this.compile=function(a,b){F=ra.get(a,b);F.init();a.traverse(function(a){a.isLight&&(F.pushLight(a),a.castShadow&&F.pushShadow(a))});F.setupLights(b);a.traverse(function(b){if(b.material)if(Array.isArray(b.material))for(var c=
|
||
|
0;c<b.material.length;c++)r(b.material[c],a.fog,b);else r(b.material,a.fog,b)})};var Ea=!1,Ha=null;this.animate=function(a){Ha=a;null!==Ha?Ea||(g(),Ea=!0):Ea=!1};this.render=function(a,b,c,d){if(!b||!b.isCamera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else if(!H){ia="";va=-1;L=null;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();xa.enabled&&(b=xa.getCamera(b));F=ra.get(a,b);F.init();a.onBeforeRender(z,a,b,c);aa.multiplyMatrices(b.projectionMatrix,
|
||
|
b.matrixWorldInverse);X.setFromMatrix(aa);ca=this.localClippingEnabled;Z=Y.init(this.clippingPlanes,ca,b);D=sa.get(a,b);D.init();l(a,b,z.sortObjects);!0===z.sortObjects&&D.sort();Z&&Y.beginShadows();Ga.render(F.state.shadowsArray,a,b);F.setupLights(b);Z&&Y.endShadows();this.info.autoReset&&this.info.reset();void 0===c&&(c=null);this.setRenderTarget(c);qa.render(D,a,b,d);d=D.opaque;var e=D.transparent;if(a.overrideMaterial){var f=a.overrideMaterial;d.length&&n(d,a,b,f);e.length&&n(e,a,b,f)}else d.length&&
|
||
|
n(d,a,b),e.length&&n(e,a,b);Da.render(F.state.spritesArray,a,b);c&&ha.updateRenderTargetMipmap(c);na.buffers.depth.setTest(!0);na.buffers.depth.setMask(!0);na.buffers.color.setMask(!0);na.setPolygonOffset(!1);a.onAfterRender(z,a,b);xa.enabled&&xa.submitFrame();F=D=null}};this.allocTextureUnit=function(){var a=P;a>=da.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+a+" texture units while this GPU supports only "+da.maxTextures);P+=1;return a};this.setTexture2D=function(){var a=!1;
|
||
|
return function(b,c){b&&b.isWebGLRenderTarget&&(a||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),a=!0),b=b.texture);ha.setTexture2D(b,c)}}();this.setTexture=function(){var a=!1;return function(b,c){a||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),a=!0);ha.setTexture2D(b,c)}}();this.setTextureCube=function(){var a=!1;return function(b,c){b&&b.isWebGLRenderTargetCube&&(a||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),
|
||
|
a=!0),b=b.texture);b&&b.isCubeTexture||Array.isArray(b.image)&&6===b.image.length?ha.setTextureCube(b,c):ha.setTextureCubeDynamic(b,c)}}();this.getRenderTarget=function(){return N};this.setRenderTarget=function(a){(N=a)&&void 0===ba.get(a).__webglFramebuffer&&ha.setupRenderTarget(a);var b=null,c=!1;a?(b=ba.get(a).__webglFramebuffer,a.isWebGLRenderTargetCube&&(b=b[a.activeCubeFace],c=!0),G.copy(a.viewport),J.copy(a.scissor),O=a.scissorTest):(G.copy(W).multiplyScalar(S),J.copy(ma).multiplyScalar(S),
|
||
|
O=Ia);La!==b&&(M.bindFramebuffer(M.FRAMEBUFFER,b),La=b);na.viewport(G);na.scissor(J);na.setScissorTest(O);c&&(c=ba.get(a.texture),M.framebufferTexture2D(M.FRAMEBUFFER,M.COLOR_ATTACHMENT0,M.TEXTURE_CUBE_MAP_POSITIVE_X+a.activeCubeFace,c.__webglTexture,a.activeMipMapLevel))};this.readRenderTargetPixels=function(a,b,c,d,e,f){if(a&&a.isWebGLRenderTarget){var g=ba.get(a).__webglFramebuffer;if(g){var h=!1;g!==La&&(M.bindFramebuffer(M.FRAMEBUFFER,g),h=!0);try{var k=a.texture,l=k.format,m=k.type;1023!==l&&
|
||
|
ua.convert(l)!==M.getParameter(M.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===m||ua.convert(m)===M.getParameter(M.IMPLEMENTATION_COLOR_READ_TYPE)||1015===m&&(Fa.get("OES_texture_float")||Fa.get("WEBGL_color_buffer_float"))||1016===m&&Fa.get("EXT_color_buffer_half_float")?M.checkFramebufferStatus(M.FRAMEBUFFER)===M.FRAMEBUFFER_COMPLETE?0<=b&&b<=a.width-d&&0<=c&&c<=a.height-e&&M.readPixels(b,
|
||
|
c,d,e,ua.convert(l),ua.convert(m),f):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{h&&M.bindFramebuffer(M.FRAMEBUFFER,La)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")};this.copyFramebufferToTexture=function(a,b,c){var d=
|
||
|
b.image.width,e=b.image.height,f=ua.convert(b.format);this.setTexture2D(b,0);M.copyTexImage2D(M.TEXTURE_2D,c||0,f,a.x,a.y,d,e,0)};this.copyTextureToTexture=function(a,b,c,d){var e=b.image.width,f=b.image.height,g=ua.convert(c.format),h=ua.convert(c.type);b=b.isDataTexture?b.image.data:b.image;this.setTexture2D(c,0);M.texSubImage2D(M.TEXTURE_2D,d||0,a.x,a.y,e,f,g,h,b)}}function vc(f,h){this.name="";this.color=new S(f);this.density=void 0!==h?h:2.5E-4}function wc(f,h,a){this.name="";this.color=new S(f);
|
||
|
this.near=void 0!==h?h:1;this.far=void 0!==a?a:1E3}function xc(){O.call(this);this.type="Scene";this.overrideMaterial=this.fog=this.background=null;this.autoUpdate=!0}function cc(f){da.call(this);this.type="SpriteMaterial";this.color=new S(16777215);this.map=null;this.rotation=0;this.lights=this.fog=!1;this.setValues(f)}function lf(f){O.call(this);this.type="Sprite";this.material=void 0!==f?f:new cc;this.center=new x(.5,.5)}function ie(){O.call(this);this.type="LOD";Object.defineProperties(this,{levels:{enumerable:!0,
|
||
|
value:[]}})}function je(f,h){f=f||[];this.bones=f.slice(0);this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===h)this.calculateInverses();else if(this.bones.length===h.length)this.boneInverses=h.slice(0);else for(console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[],f=0,h=this.bones.length;f<h;f++)this.boneInverses.push(new V)}function mf(){O.call(this);this.type="Bone"}function ke(f,h){ha.call(this,f,h);this.type="SkinnedMesh";this.bindMode="attached";
|
||
|
this.bindMatrix=new V;this.bindMatrixInverse=new V;f=this.initBones();f=new je(f);this.bind(f,this.matrixWorld);this.normalizeSkinWeights()}function za(f){da.call(this);this.type="LineBasicMaterial";this.color=new S(16777215);this.linewidth=1;this.linejoin=this.linecap="round";this.lights=!1;this.setValues(f)}function Va(f,h,a){if(1===a)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new Ca(f,h);O.call(this);this.type="Line";this.geometry=
|
||
|
void 0!==f?f:new R;this.material=void 0!==h?h:new za({color:16777215*Math.random()})}function Ca(f,h){Va.call(this,f,h);this.type="LineSegments"}function nf(f,h){Va.call(this,f,h);this.type="LineLoop"}function dc(f){da.call(this);this.type="PointsMaterial";this.color=new S(16777215);this.map=null;this.size=1;this.sizeAttenuation=!0;this.lights=!1;this.setValues(f)}function of(f,h){O.call(this);this.type="Points";this.geometry=void 0!==f?f:new R;this.material=void 0!==h?h:new dc({color:16777215*Math.random()})}
|
||
|
function pf(){O.call(this);this.type="Group"}function hh(f,h,a,b,c,d,e,g,k){ra.call(this,f,h,a,b,c,d,e,g,k);this.generateMipmaps=!1}function fd(f,h,a,b,c,d,e,g,k,l,n,m){ra.call(this,null,d,e,g,k,l,b,c,n,m);this.image={width:h,height:a};this.mipmaps=f;this.generateMipmaps=this.flipY=!1}function gd(f,h,a,b,c,d,e,g,k,l){l=void 0!==l?l:1026;if(1026!==l&&1027!==l)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===a&&1026===l&&(a=1012);void 0===a&&1027===
|
||
|
l&&(a=1020);ra.call(this,null,b,c,d,e,g,l,a,k);this.image={width:f,height:h};this.magFilter=void 0!==e?e:1003;this.minFilter=void 0!==g?g:1003;this.generateMipmaps=this.flipY=!1}function le(f){R.call(this);this.type="WireframeGeometry";var h=[],a,b,c,d=[0,0],e={},g=["a","b","c"];if(f&&f.isGeometry){var k=f.faces;var l=0;for(b=k.length;l<b;l++){var n=k[l];for(a=0;3>a;a++){var m=n[g[a]];var r=n[g[(a+1)%3]];d[0]=Math.min(m,r);d[1]=Math.max(m,r);m=d[0]+","+d[1];void 0===e[m]&&(e[m]={index1:d[0],index2:d[1]})}}for(m in e)l=
|
||
|
e[m],g=f.vertices[l.index1],h.push(g.x,g.y,g.z),g=f.vertices[l.index2],h.push(g.x,g.y,g.z)}else if(f&&f.isBufferGeometry)if(g=new p,null!==f.index){k=f.attributes.position;n=f.index;var w=f.groups;0===w.length&&(w=[{start:0,count:n.count,materialIndex:0}]);f=0;for(c=w.length;f<c;++f)for(l=w[f],a=l.start,b=l.count,l=a,b=a+b;l<b;l+=3)for(a=0;3>a;a++)m=n.getX(l+a),r=n.getX(l+(a+1)%3),d[0]=Math.min(m,r),d[1]=Math.max(m,r),m=d[0]+","+d[1],void 0===e[m]&&(e[m]={index1:d[0],index2:d[1]});for(m in e)l=e[m],
|
||
|
g.fromBufferAttribute(k,l.index1),h.push(g.x,g.y,g.z),g.fromBufferAttribute(k,l.index2),h.push(g.x,g.y,g.z)}else for(k=f.attributes.position,l=0,b=k.count/3;l<b;l++)for(a=0;3>a;a++)e=3*l+a,g.fromBufferAttribute(k,e),h.push(g.x,g.y,g.z),e=3*l+(a+1)%3,g.fromBufferAttribute(k,e),h.push(g.x,g.y,g.z);this.addAttribute("position",new J(h,3))}function hd(f,h,a){ca.call(this);this.type="ParametricGeometry";this.parameters={func:f,slices:h,stacks:a};this.fromBufferGeometry(new yc(f,h,a));this.mergeVertices()}
|
||
|
function yc(f,h,a){R.call(this);this.type="ParametricBufferGeometry";this.parameters={func:f,slices:h,stacks:a};var b=[],c=[],d=[],e=[],g=new p,k=new p,l=new p,n=new p,m=new p,r,w,t=h+1;for(r=0;r<=a;r++){var u=r/a;for(w=0;w<=h;w++){var v=w/h;f(v,u,k);c.push(k.x,k.y,k.z);0<=v-1E-5?(f(v-1E-5,u,l),n.subVectors(k,l)):(f(v+1E-5,u,l),n.subVectors(l,k));0<=u-1E-5?(f(v,u-1E-5,l),m.subVectors(k,l)):(f(v,u+1E-5,l),m.subVectors(l,k));g.crossVectors(n,m).normalize();d.push(g.x,g.y,g.z);e.push(v,u)}}for(r=0;r<
|
||
|
a;r++)for(w=0;w<h;w++)f=r*t+w+1,g=(r+1)*t+w+1,k=(r+1)*t+w,b.push(r*t+w,f,k),b.push(f,g,k);this.setIndex(b);this.addAttribute("position",new J(c,3));this.addAttribute("normal",new J(d,3));this.addAttribute("uv",new J(e,2))}function id(f,h,a,b){ca.call(this);this.type="PolyhedronGeometry";this.parameters={vertices:f,indices:h,radius:a,detail:b};this.fromBufferGeometry(new Wa(f,h,a,b));this.mergeVertices()}function Wa(f,h,a,b){function c(a){g.push(a.x,a.y,a.z)}function d(a,b){a*=3;b.x=f[a+0];b.y=f[a+
|
||
|
1];b.z=f[a+2]}function e(a,b,c,d){0>d&&1===a.x&&(k[b]=a.x-1);0===c.x&&0===c.z&&(k[b]=d/2/Math.PI+.5)}R.call(this);this.type="PolyhedronBufferGeometry";this.parameters={vertices:f,indices:h,radius:a,detail:b};a=a||1;b=b||0;var g=[],k=[];(function(a){for(var b=new p,e=new p,f=new p,g=0;g<h.length;g+=3){d(h[g+0],b);d(h[g+1],e);d(h[g+2],f);var k,l,v=b,q=e,A=f,C=Math.pow(2,a),E=[];for(l=0;l<=C;l++){E[l]=[];var x=v.clone().lerp(A,l/C),Q=q.clone().lerp(A,l/C),I=C-l;for(k=0;k<=I;k++)E[l][k]=0===k&&l===C?
|
||
|
x:x.clone().lerp(Q,k/I)}for(l=0;l<C;l++)for(k=0;k<2*(C-l)-1;k++)v=Math.floor(k/2),0===k%2?(c(E[l][v+1]),c(E[l+1][v]),c(E[l][v])):(c(E[l][v+1]),c(E[l+1][v+1]),c(E[l+1][v]))}})(b);(function(a){for(var b=new p,c=0;c<g.length;c+=3)b.x=g[c+0],b.y=g[c+1],b.z=g[c+2],b.normalize().multiplyScalar(a),g[c+0]=b.x,g[c+1]=b.y,g[c+2]=b.z})(a);(function(){for(var a=new p,b=0;b<g.length;b+=3)a.x=g[b+0],a.y=g[b+1],a.z=g[b+2],k.push(Math.atan2(a.z,-a.x)/2/Math.PI+.5,1-(Math.atan2(-a.y,Math.sqrt(a.x*a.x+a.z*a.z))/Math.PI+
|
||
|
.5));a=new p;b=new p;for(var c=new p,d=new p,f=new x,h=new x,u=new x,v=0,q=0;v<g.length;v+=9,q+=6){a.set(g[v+0],g[v+1],g[v+2]);b.set(g[v+3],g[v+4],g[v+5]);c.set(g[v+6],g[v+7],g[v+8]);f.set(k[q+0],k[q+1]);h.set(k[q+2],k[q+3]);u.set(k[q+4],k[q+5]);d.copy(a).add(b).add(c).divideScalar(3);var A=Math.atan2(d.z,-d.x);e(f,q+0,a,A);e(h,q+2,b,A);e(u,q+4,c,A)}for(a=0;a<k.length;a+=6)b=k[a+0],c=k[a+2],d=k[a+4],f=Math.min(b,c,d),.9<Math.max(b,c,d)&&.1>f&&(.2>b&&(k[a+0]+=1),.2>c&&(k[a+2]+=1),.2>d&&(k[a+4]+=1))})();
|
||
|
this.addAttribute("position",new J(g,3));this.addAttribute("normal",new J(g.slice(),3));this.addAttribute("uv",new J(k,2));0===b?this.computeVertexNormals():this.normalizeNormals()}function jd(f,h){ca.call(this);this.type="TetrahedronGeometry";this.parameters={radius:f,detail:h};this.fromBufferGeometry(new zc(f,h));this.mergeVertices()}function zc(f,h){Wa.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],f,h);this.type="TetrahedronBufferGeometry";this.parameters={radius:f,detail:h}}
|
||
|
function kd(f,h){ca.call(this);this.type="OctahedronGeometry";this.parameters={radius:f,detail:h};this.fromBufferGeometry(new ec(f,h));this.mergeVertices()}function ec(f,h){Wa.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],f,h);this.type="OctahedronBufferGeometry";this.parameters={radius:f,detail:h}}function ld(f,h){ca.call(this);this.type="IcosahedronGeometry";this.parameters={radius:f,detail:h};this.fromBufferGeometry(new Ac(f,h));this.mergeVertices()}
|
||
|
function Ac(f,h){var a=(1+Math.sqrt(5))/2;Wa.call(this,[-1,a,0,1,a,0,-1,-a,0,1,-a,0,0,-1,a,0,1,a,0,-1,-a,0,1,-a,a,0,-1,a,0,1,-a,0,-1,-a,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],f,h);this.type="IcosahedronBufferGeometry";this.parameters={radius:f,detail:h}}function md(f,h){ca.call(this);this.type="DodecahedronGeometry";this.parameters={radius:f,detail:h};this.fromBufferGeometry(new Bc(f,h));this.mergeVertices()}
|
||
|
function Bc(f,h){var a=(1+Math.sqrt(5))/2,b=1/a;Wa.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,-b,-a,0,-b,a,0,b,-a,0,b,a,-b,-a,0,-b,a,0,b,-a,0,b,a,0,-a,0,-b,a,0,-b,-a,0,b,a,0,b],[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],f,h);this.type="DodecahedronBufferGeometry";
|
||
|
this.parameters={radius:f,detail:h}}function nd(f,h,a,b,c,d){ca.call(this);this.type="TubeGeometry";this.parameters={path:f,tubularSegments:h,radius:a,radialSegments:b,closed:c};void 0!==d&&console.warn("THREE.TubeGeometry: taper has been removed.");f=new Cc(f,h,a,b,c);this.tangents=f.tangents;this.normals=f.normals;this.binormals=f.binormals;this.fromBufferGeometry(f);this.mergeVertices()}function Cc(f,h,a,b,c){function d(c){n=f.getPointAt(c/h,n);var d=e.normals[c];c=e.binormals[c];for(r=0;r<=b;r++){var l=
|
||
|
r/b*Math.PI*2,m=Math.sin(l);l=-Math.cos(l);k.x=l*d.x+m*c.x;k.y=l*d.y+m*c.y;k.z=l*d.z+m*c.z;k.normalize();t.push(k.x,k.y,k.z);g.x=n.x+a*k.x;g.y=n.y+a*k.y;g.z=n.z+a*k.z;w.push(g.x,g.y,g.z)}}R.call(this);this.type="TubeBufferGeometry";this.parameters={path:f,tubularSegments:h,radius:a,radialSegments:b,closed:c};h=h||64;a=a||1;b=b||8;c=c||!1;var e=f.computeFrenetFrames(h,c);this.tangents=e.tangents;this.normals=e.normals;this.binormals=e.binormals;var g=new p,k=new p,l=new x,n=new p,m,r,w=[],t=[],u=[],
|
||
|
v=[];for(m=0;m<h;m++)d(m);d(!1===c?h:0);for(m=0;m<=h;m++)for(r=0;r<=b;r++)l.x=m/h,l.y=r/b,u.push(l.x,l.y);(function(){for(r=1;r<=h;r++)for(m=1;m<=b;m++){var a=(b+1)*r+(m-1),c=(b+1)*r+m,d=(b+1)*(r-1)+m;v.push((b+1)*(r-1)+(m-1),a,d);v.push(a,c,d)}})();this.setIndex(v);this.addAttribute("position",new J(w,3));this.addAttribute("normal",new J(t,3));this.addAttribute("uv",new J(u,2))}function od(f,h,a,b,c,d,e){ca.call(this);this.type="TorusKnotGeometry";this.parameters={radius:f,tube:h,tubularSegments:a,
|
||
|
radialSegments:b,p:c,q:d};void 0!==e&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.");this.fromBufferGeometry(new Dc(f,h,a,b,c,d));this.mergeVertices()}function Dc(f,h,a,b,c,d){function e(a,b,c,d,e){var f=Math.sin(a);b=c/b*a;c=Math.cos(b);e.x=d*(2+c)*.5*Math.cos(a);e.y=d*(2+c)*f*.5;e.z=d*Math.sin(b)*.5}R.call(this);this.type="TorusKnotBufferGeometry";this.parameters={radius:f,tube:h,tubularSegments:a,radialSegments:b,p:c,q:d};f=f||1;h=h||.4;
|
||
|
a=Math.floor(a)||64;b=Math.floor(b)||8;c=c||2;d=d||3;var g=[],k=[],l=[],n=[],m,r=new p,w=new p,t=new p,u=new p,v=new p,q=new p,A=new p;for(m=0;m<=a;++m){var C=m/a*c*Math.PI*2;e(C,c,d,f,t);e(C+.01,c,d,f,u);q.subVectors(u,t);A.addVectors(u,t);v.crossVectors(q,A);A.crossVectors(v,q);v.normalize();A.normalize();for(C=0;C<=b;++C){var E=C/b*Math.PI*2,x=-h*Math.cos(E);E=h*Math.sin(E);r.x=t.x+(x*A.x+E*v.x);r.y=t.y+(x*A.y+E*v.y);r.z=t.z+(x*A.z+E*v.z);k.push(r.x,r.y,r.z);w.subVectors(r,t).normalize();l.push(w.x,
|
||
|
w.y,w.z);n.push(m/a);n.push(C/b)}}for(C=1;C<=a;C++)for(m=1;m<=b;m++)f=(b+1)*C+(m-1),h=(b+1)*C+m,c=(b+1)*(C-1)+m,g.push((b+1)*(C-1)+(m-1),f,c),g.push(f,h,c);this.setIndex(g);this.addAttribute("position",new J(k,3));this.addAttribute("normal",new J(l,3));this.addAttribute("uv",new J(n,2))}function pd(f,h,a,b,c){ca.call(this);this.type="TorusGeometry";this.parameters={radius:f,tube:h,radialSegments:a,tubularSegments:b,arc:c};this.fromBufferGeometry(new qd(f,h,a,b,c));this.mergeVertices()}function qd(f,
|
||
|
h,a,b,c){R.call(this);this.type="TorusBufferGeometry";this.parameters={radius:f,tube:h,radialSegments:a,tubularSegments:b,arc:c};f=f||1;h=h||.4;a=Math.floor(a)||8;b=Math.floor(b)||6;c=c||2*Math.PI;var d=[],e=[],g=[],k=[],l=new p,n=new p,m=new p,r,w;for(r=0;r<=a;r++)for(w=0;w<=b;w++){var t=w/b*c,u=r/a*Math.PI*2;n.x=(f+h*Math.cos(u))*Math.cos(t);n.y=(f+h*Math.cos(u))*Math.sin(t);n.z=h*Math.sin(u);e.push(n.x,n.y,n.z);l.x=f*Math.cos(t);l.y=f*Math.sin(t);m.subVectors(n,l).normalize();g.push(m.x,m.y,m.z);
|
||
|
k.push(w/b);k.push(r/a)}for(r=1;r<=a;r++)for(w=1;w<=b;w++)f=(b+1)*(r-1)+w-1,h=(b+1)*(r-1)+w,c=(b+1)*r+w,d.push((b+1)*r+w-1,f,c),d.push(f,h,c);this.setIndex(d);this.addAttribute("position",new J(e,3));this.addAttribute("normal",new J(g,3));this.addAttribute("uv",new J(k,2))}function ih(f,h,a,b,c){for(var d,e=0,g=h,k=a-b;g<a;g+=b)e+=(f[k]-f[g])*(f[g+1]+f[k+1]),k=g;if(c===0<e)for(c=h;c<a;c+=b)d=jh(c,f[c],f[c+1],d);else for(c=a-b;c>=h;c-=b)d=jh(c,f[c],f[c+1],d);d&&fc(d,d.next)&&(rd(d),d=d.next);return d}
|
||
|
function sd(f,h){if(!f)return f;h||(h=f);do{var a=!1;if(f.steiner||!fc(f,f.next)&&0!==Ra(f.prev,f,f.next))f=f.next;else{rd(f);f=h=f.prev;if(f===f.next)break;a=!0}}while(a||f!==h);return h}function td(f,h,a,b,c,d,e){if(f){if(!e&&d){var g=f,k=g;do null===k.z&&(k.z=qf(k.x,k.y,b,c,d)),k.prevZ=k.prev,k=k.nextZ=k.next;while(k!==g);k.prevZ.nextZ=null;k.prevZ=null;g=k;var l,n,m,r,w=1;do{k=g;var t=g=null;for(n=0;k;){n++;var u=k;for(l=m=0;l<w&&(m++,u=u.nextZ,u);l++);for(r=w;0<m||0<r&&u;)0!==m&&(0===r||!u||
|
||
|
k.z<=u.z)?(l=k,k=k.nextZ,m--):(l=u,u=u.nextZ,r--),t?t.nextZ=l:g=l,l.prevZ=t,t=l;k=u}t.nextZ=null;w*=2}while(1<n)}for(g=f;f.prev!==f.next;){k=f.prev;u=f.next;if(d)a:{t=f;r=b;var p=c,q=d;n=t.prev;m=t;w=t.next;if(0<=Ra(n,m,w))t=!1;else{var A=n.x>m.x?n.x>w.x?n.x:w.x:m.x>w.x?m.x:w.x,C=n.y>m.y?n.y>w.y?n.y:w.y:m.y>w.y?m.y:w.y;l=qf(n.x<m.x?n.x<w.x?n.x:w.x:m.x<w.x?m.x:w.x,n.y<m.y?n.y<w.y?n.y:w.y:m.y<w.y?m.y:w.y,r,p,q);r=qf(A,C,r,p,q);for(p=t.nextZ;p&&p.z<=r;){if(p!==t.prev&&p!==t.next&&me(n.x,n.y,m.x,m.y,
|
||
|
w.x,w.y,p.x,p.y)&&0<=Ra(p.prev,p,p.next)){t=!1;break a}p=p.nextZ}for(p=t.prevZ;p&&p.z>=l;){if(p!==t.prev&&p!==t.next&&me(n.x,n.y,m.x,m.y,w.x,w.y,p.x,p.y)&&0<=Ra(p.prev,p,p.next)){t=!1;break a}p=p.prevZ}t=!0}}else a:if(t=f,n=t.prev,m=t,w=t.next,0<=Ra(n,m,w))t=!1;else{for(l=t.next.next;l!==t.prev;){if(me(n.x,n.y,m.x,m.y,w.x,w.y,l.x,l.y)&&0<=Ra(l.prev,l,l.next)){t=!1;break a}l=l.next}t=!0}if(t)h.push(k.i/a),h.push(f.i/a),h.push(u.i/a),rd(f),g=f=u.next;else if(f=u,f===g){if(!e)td(sd(f),h,a,b,c,d,1);else if(1===
|
||
|
e){e=h;g=a;k=f;do u=k.prev,t=k.next.next,!fc(u,t)&&kh(u,k,k.next,t)&&ud(u,t)&&ud(t,u)&&(e.push(u.i/g),e.push(k.i/g),e.push(t.i/g),rd(k),rd(k.next),k=f=t),k=k.next;while(k!==f);f=k;td(f,h,a,b,c,d,2)}else if(2===e)a:{e=f;do{for(g=e.next.next;g!==e.prev;){if(k=e.i!==g.i){k=e;u=g;if(t=k.next.i!==u.i&&k.prev.i!==u.i){b:{t=k;do{if(t.i!==k.i&&t.next.i!==k.i&&t.i!==u.i&&t.next.i!==u.i&&kh(t,t.next,k,u)){t=!0;break b}t=t.next}while(t!==k);t=!1}t=!t}if(t=t&&ud(k,u)&&ud(u,k)){t=k;n=!1;m=(k.x+u.x)/2;u=(k.y+u.y)/
|
||
|
2;do t.y>u!==t.next.y>u&&t.next.y!==t.y&&m<(t.next.x-t.x)*(u-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==k);t=n}k=t}if(k){f=lh(e,g);e=sd(e,e.next);f=sd(f,f.next);td(e,h,a,b,c,d);td(f,h,a,b,c,d);break a}g=g.next}e=e.next}while(e!==f)}break}}}}function pl(f,h){return f.x-h.x}function ql(f,h){var a=h,b=f.x,c=f.y,d=-Infinity;do{if(c<=a.y&&c>=a.next.y&&a.next.y!==a.y){var e=a.x+(c-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(e<=b&&e>d){d=e;if(e===b){if(c===a.y)return a;if(c===a.next.y)return a.next}var g=
|
||
|
a.x<a.next.x?a:a.next}}a=a.next}while(a!==h);if(!g)return null;if(b===d)return g.prev;h=g;e=g.x;var k=g.y,l=Infinity;for(a=g.next;a!==h;){if(b>=a.x&&a.x>=e&&b!==a.x&&me(c<k?b:d,c,e,k,c<k?d:b,c,a.x,a.y)){var n=Math.abs(c-a.y)/(b-a.x);(n<l||n===l&&a.x>g.x)&&ud(a,f)&&(g=a,l=n)}a=a.next}return g}function qf(f,h,a,b,c){f=32767*(f-a)*c;h=32767*(h-b)*c;f=(f|f<<8)&16711935;f=(f|f<<4)&252645135;f=(f|f<<2)&858993459;h=(h|h<<8)&16711935;h=(h|h<<4)&252645135;h=(h|h<<2)&858993459;return(f|f<<1)&1431655765|((h|
|
||
|
h<<1)&1431655765)<<1}function rl(f){var h=f,a=f;do h.x<a.x&&(a=h),h=h.next;while(h!==f);return a}function me(f,h,a,b,c,d,e,g){return 0<=(c-e)*(h-g)-(f-e)*(d-g)&&0<=(f-e)*(b-g)-(a-e)*(h-g)&&0<=(a-e)*(d-g)-(c-e)*(b-g)}function Ra(f,h,a){return(h.y-f.y)*(a.x-h.x)-(h.x-f.x)*(a.y-h.y)}function fc(f,h){return f.x===h.x&&f.y===h.y}function kh(f,h,a,b){return fc(f,h)&&fc(a,b)||fc(f,b)&&fc(a,h)?!0:0<Ra(f,h,a)!==0<Ra(f,h,b)&&0<Ra(a,b,f)!==0<Ra(a,b,h)}function ud(f,h){return 0>Ra(f.prev,f,f.next)?0<=Ra(f,h,
|
||
|
f.next)&&0<=Ra(f,f.prev,h):0>Ra(f,h,f.prev)||0>Ra(f,f.next,h)}function lh(f,h){var a=new rf(f.i,f.x,f.y),b=new rf(h.i,h.x,h.y),c=f.next,d=h.prev;f.next=h;h.prev=f;a.next=c;c.prev=a;b.next=a;a.prev=b;d.next=b;b.prev=d;return b}function jh(f,h,a,b){f=new rf(f,h,a);b?(f.next=b.next,f.prev=b,b.next.prev=f,b.next=f):(f.prev=f,f.next=f);return f}function rd(f){f.next.prev=f.prev;f.prev.next=f.next;f.prevZ&&(f.prevZ.nextZ=f.nextZ);f.nextZ&&(f.nextZ.prevZ=f.prevZ)}function rf(f,h,a){this.i=f;this.x=h;this.y=
|
||
|
a;this.nextZ=this.prevZ=this.z=this.next=this.prev=null;this.steiner=!1}function mh(f){var h=f.length;2<h&&f[h-1].equals(f[0])&&f.pop()}function nh(f,h){for(var a=0;a<h.length;a++)f.push(h[a].x),f.push(h[a].y)}function Ec(f,h){ca.call(this);this.type="ExtrudeGeometry";this.parameters={shapes:f,options:h};this.fromBufferGeometry(new Pb(f,h));this.mergeVertices()}function Pb(f,h){function a(a){function e(a,b,c){b||console.error("THREE.ExtrudeGeometry: vec does not exist");return b.clone().multiplyScalar(c).add(a)}
|
||
|
function f(a,b,c){var d=a.x-b.x;var e=a.y-b.y;var f=c.x-a.x;var g=c.y-a.y,h=d*d+e*e;if(Math.abs(d*g-e*f)>Number.EPSILON){var k=Math.sqrt(h),l=Math.sqrt(f*f+g*g);h=b.x-e/k;b=b.y+d/k;g=((c.x-g/l-h)*g-(c.y+f/l-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 x(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 x(f/e,d/
|
||
|
e)}function g(a,d){for(W=a.length;0<=--W;){var e=W;var f=W-1;0>f&&(f=a.length-1);var g,h=A+2*I;for(g=0;g<h;g++){var k=R*g,l=R*(g+1),m=d+f+k,n=d+f+l;l=d+e+l;t(d+e+k);t(m);t(l);t(m);t(n);t(l);k=c.length/3;k=F.generateSideWallUV(b,c,k-6,k-3,k-2,k-1);u(k[0]);u(k[1]);u(k[3]);u(k[1]);u(k[2]);u(k[3])}}}function k(a,b,c){q.push(a);q.push(b);q.push(c)}function w(a,d,e){t(a);t(d);t(e);a=c.length/3;a=F.generateTopUV(b,c,a-3,a-2,a-1);u(a[0]);u(a[1]);u(a[2])}function t(a){c.push(q[3*a]);c.push(q[3*a+1]);c.push(q[3*
|
||
|
a+2])}function u(a){d.push(a.x);d.push(a.y)}var q=[],y=void 0!==h.curveSegments?h.curveSegments:12,A=void 0!==h.steps?h.steps:1,C=void 0!==h.amount?h.amount:100,E=void 0!==h.bevelEnabled?h.bevelEnabled:!0,B=void 0!==h.bevelThickness?h.bevelThickness:6,Q=void 0!==h.bevelSize?h.bevelSize:B-2,I=void 0!==h.bevelSegments?h.bevelSegments:3,z=h.extrudePath,F=void 0!==h.UVGenerator?h.UVGenerator:sl,D=!1;if(z){var H=z.getSpacedPoints(A);D=!0;E=!1;var N=z.computeFrenetFrames(A,!1);var L=new p;var La=new p;
|
||
|
var va=new p}E||(Q=B=I=0);var ia;y=a.extractPoints(y);a=y.shape;var G=y.holes;if(!Qb.isClockWise(a)){a=a.reverse();var U=0;for(ia=G.length;U<ia;U++){var J=G[U];Qb.isClockWise(J)&&(G[U]=J.reverse())}}var S=Qb.triangulateShape(a,G),O=a;U=0;for(ia=G.length;U<ia;U++)J=G[U],a=a.concat(J);var K,R=a.length,P,V=S.length;y=[];var W=0;var ma=O.length;var Ia=ma-1;for(K=W+1;W<ma;W++,Ia++,K++)Ia===ma&&(Ia=0),K===ma&&(K=0),y[W]=f(O[W],O[Ia],O[K]);z=[];var Y=y.concat();U=0;for(ia=G.length;U<ia;U++){J=G[U];var X=
|
||
|
[];W=0;ma=J.length;Ia=ma-1;for(K=W+1;W<ma;W++,Ia++,K++)Ia===ma&&(Ia=0),K===ma&&(K=0),X[W]=f(J[W],J[Ia],J[K]);z.push(X);Y=Y.concat(X)}for(Ia=0;Ia<I;Ia++){ma=Ia/I;var Z=B*Math.cos(ma*Math.PI/2);K=Q*Math.sin(ma*Math.PI/2);W=0;for(ma=O.length;W<ma;W++){var T=e(O[W],y[W],K);k(T.x,T.y,-Z)}U=0;for(ia=G.length;U<ia;U++)for(J=G[U],X=z[U],W=0,ma=J.length;W<ma;W++)T=e(J[W],X[W],K),k(T.x,T.y,-Z)}K=Q;for(W=0;W<R;W++)T=E?e(a[W],Y[W],K):a[W],D?(La.copy(N.normals[0]).multiplyScalar(T.x),L.copy(N.binormals[0]).multiplyScalar(T.y),
|
||
|
va.copy(H[0]).add(La).add(L),k(va.x,va.y,va.z)):k(T.x,T.y,0);for(ma=1;ma<=A;ma++)for(W=0;W<R;W++)T=E?e(a[W],Y[W],K):a[W],D?(La.copy(N.normals[ma]).multiplyScalar(T.x),L.copy(N.binormals[ma]).multiplyScalar(T.y),va.copy(H[ma]).add(La).add(L),k(va.x,va.y,va.z)):k(T.x,T.y,C/A*ma);for(Ia=I-1;0<=Ia;Ia--){ma=Ia/I;Z=B*Math.cos(ma*Math.PI/2);K=Q*Math.sin(ma*Math.PI/2);W=0;for(ma=O.length;W<ma;W++)T=e(O[W],y[W],K),k(T.x,T.y,C+Z);U=0;for(ia=G.length;U<ia;U++)for(J=G[U],X=z[U],W=0,ma=J.length;W<ma;W++)T=e(J[W],
|
||
|
X[W],K),D?k(T.x,T.y+H[A-1].y,H[A-1].x+Z):k(T.x,T.y,C+Z)}(function(){var a=c.length/3;if(E){var d=0*R;for(W=0;W<V;W++)P=S[W],w(P[2]+d,P[1]+d,P[0]+d);d=R*(A+2*I);for(W=0;W<V;W++)P=S[W],w(P[0]+d,P[1]+d,P[2]+d)}else{for(W=0;W<V;W++)P=S[W],w(P[2],P[1],P[0]);for(W=0;W<V;W++)P=S[W],w(P[0]+R*A,P[1]+R*A,P[2]+R*A)}b.addGroup(a,c.length/3-a,0)})();(function(){var a=c.length/3,d=0;g(O,d);d+=O.length;U=0;for(ia=G.length;U<ia;U++)J=G[U],g(J,d),d+=J.length;b.addGroup(a,c.length/3-a,1)})()}R.call(this);this.type=
|
||
|
"ExtrudeBufferGeometry";this.parameters={shapes:f,options:h};f=Array.isArray(f)?f:[f];for(var b=this,c=[],d=[],e=0,g=f.length;e<g;e++)a(f[e],h);this.addAttribute("position",new J(c,3));this.addAttribute("uv",new J(d,2));this.computeVertexNormals()}function vd(f,h){ca.call(this);this.type="TextGeometry";this.parameters={text:f,parameters:h};this.fromBufferGeometry(new wd(f,h));this.mergeVertices()}function wd(f,h){h=h||{};var a=h.font;if(!a||!a.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
|
||
|
new ca;f=a.generateShapes(f,h.size,h.curveSegments);h.amount=void 0!==h.height?h.height:50;void 0===h.bevelThickness&&(h.bevelThickness=10);void 0===h.bevelSize&&(h.bevelSize=8);void 0===h.bevelEnabled&&(h.bevelEnabled=!1);Pb.call(this,f,h);this.type="TextBufferGeometry"}function xd(f,h,a,b,c,d,e){ca.call(this);this.type="SphereGeometry";this.parameters={radius:f,widthSegments:h,heightSegments:a,phiStart:b,phiLength:c,thetaStart:d,thetaLength:e};this.fromBufferGeometry(new gc(f,h,a,b,c,d,e));this.mergeVertices()}
|
||
|
function gc(f,h,a,b,c,d,e){R.call(this);this.type="SphereBufferGeometry";this.parameters={radius:f,widthSegments:h,heightSegments:a,phiStart:b,phiLength:c,thetaStart:d,thetaLength:e};f=f||1;h=Math.max(3,Math.floor(h)||8);a=Math.max(2,Math.floor(a)||6);b=void 0!==b?b:0;c=void 0!==c?c:2*Math.PI;d=void 0!==d?d:0;e=void 0!==e?e:Math.PI;var g=d+e,k,l,n=0,m=[],r=new p,w=new p,t=[],u=[],q=[],y=[];for(l=0;l<=a;l++){var A=[],C=l/a;for(k=0;k<=h;k++){var E=k/h;r.x=-f*Math.cos(b+E*c)*Math.sin(d+C*e);r.y=f*Math.cos(d+
|
||
|
C*e);r.z=f*Math.sin(b+E*c)*Math.sin(d+C*e);u.push(r.x,r.y,r.z);w.set(r.x,r.y,r.z).normalize();q.push(w.x,w.y,w.z);y.push(E,1-C);A.push(n++)}m.push(A)}for(l=0;l<a;l++)for(k=0;k<h;k++)f=m[l][k+1],b=m[l][k],c=m[l+1][k],e=m[l+1][k+1],(0!==l||0<d)&&t.push(f,b,e),(l!==a-1||g<Math.PI)&&t.push(b,c,e);this.setIndex(t);this.addAttribute("position",new J(u,3));this.addAttribute("normal",new J(q,3));this.addAttribute("uv",new J(y,2))}function yd(f,h,a,b,c,d){ca.call(this);this.type="RingGeometry";this.parameters=
|
||
|
{innerRadius:f,outerRadius:h,thetaSegments:a,phiSegments:b,thetaStart:c,thetaLength:d};this.fromBufferGeometry(new Fc(f,h,a,b,c,d));this.mergeVertices()}function Fc(f,h,a,b,c,d){R.call(this);this.type="RingBufferGeometry";this.parameters={innerRadius:f,outerRadius:h,thetaSegments:a,phiSegments:b,thetaStart:c,thetaLength:d};f=f||.5;h=h||1;c=void 0!==c?c:0;d=void 0!==d?d:2*Math.PI;a=void 0!==a?Math.max(3,a):8;b=void 0!==b?Math.max(1,b):1;var e=[],g=[],k=[],l=[],n=f,m=(h-f)/b,r=new p,w=new x,t,u;for(t=
|
||
|
0;t<=b;t++){for(u=0;u<=a;u++)f=c+u/a*d,r.x=n*Math.cos(f),r.y=n*Math.sin(f),g.push(r.x,r.y,r.z),k.push(0,0,1),w.x=(r.x/h+1)/2,w.y=(r.y/h+1)/2,l.push(w.x,w.y);n+=m}for(t=0;t<b;t++)for(h=t*(a+1),u=0;u<a;u++)f=u+h,c=f+a+1,d=f+a+2,n=f+1,e.push(f,c,n),e.push(c,d,n);this.setIndex(e);this.addAttribute("position",new J(g,3));this.addAttribute("normal",new J(k,3));this.addAttribute("uv",new J(l,2))}function zd(f,h,a,b){ca.call(this);this.type="LatheGeometry";this.parameters={points:f,segments:h,phiStart:a,
|
||
|
phiLength:b};this.fromBufferGeometry(new Gc(f,h,a,b));this.mergeVertices()}function Gc(f,h,a,b){R.call(this);this.type="LatheBufferGeometry";this.parameters={points:f,segments:h,phiStart:a,phiLength:b};h=Math.floor(h)||12;a=a||0;b=b||2*Math.PI;b=ja.clamp(b,0,2*Math.PI);var c=[],d=[],e=[],g=1/h,k=new p,l=new x,n;for(n=0;n<=h;n++){var m=a+n*g*b;var r=Math.sin(m),w=Math.cos(m);for(m=0;m<=f.length-1;m++)k.x=f[m].x*r,k.y=f[m].y,k.z=f[m].x*w,d.push(k.x,k.y,k.z),l.x=n/h,l.y=m/(f.length-1),e.push(l.x,l.y)}for(n=
|
||
|
0;n<h;n++)for(m=0;m<f.length-1;m++)a=m+n*f.length,g=a+f.length,k=a+f.length+1,l=a+1,c.push(a,g,l),c.push(g,k,l);this.setIndex(c);this.addAttribute("position",new J(d,3));this.addAttribute("uv",new J(e,2));this.computeVertexNormals();if(b===2*Math.PI)for(b=this.attributes.normal.array,c=new p,d=new p,e=new p,a=h*f.length*3,m=n=0;n<f.length;n++,m+=3)c.x=b[m+0],c.y=b[m+1],c.z=b[m+2],d.x=b[a+m+0],d.y=b[a+m+1],d.z=b[a+m+2],e.addVectors(c,d).normalize(),b[m+0]=b[a+m+0]=e.x,b[m+1]=b[a+m+1]=e.y,b[m+2]=b[a+
|
||
|
m+2]=e.z}function hc(f,h){ca.call(this);this.type="ShapeGeometry";"object"===typeof h&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),h=h.curveSegments);this.parameters={shapes:f,curveSegments:h};this.fromBufferGeometry(new ic(f,h));this.mergeVertices()}function ic(f,h){function a(a){var f,g=c.length/3;a=a.extractPoints(h);var l=a.shape,n=a.holes;if(!1===Qb.isClockWise(l))for(l=l.reverse(),a=0,f=n.length;a<f;a++){var p=n[a];!0===Qb.isClockWise(p)&&(n[a]=p.reverse())}var q=
|
||
|
Qb.triangulateShape(l,n);a=0;for(f=n.length;a<f;a++)p=n[a],l=l.concat(p);a=0;for(f=l.length;a<f;a++)p=l[a],c.push(p.x,p.y,0),d.push(0,0,1),e.push(p.x,p.y);a=0;for(f=q.length;a<f;a++)l=q[a],b.push(l[0]+g,l[1]+g,l[2]+g),k+=3}R.call(this);this.type="ShapeBufferGeometry";this.parameters={shapes:f,curveSegments:h};h=h||12;var b=[],c=[],d=[],e=[],g=0,k=0;if(!1===Array.isArray(f))a(f);else for(var l=0;l<f.length;l++)a(f[l]),this.addGroup(g,k,l),g+=k,k=0;this.setIndex(b);this.addAttribute("position",new J(c,
|
||
|
3));this.addAttribute("normal",new J(d,3));this.addAttribute("uv",new J(e,2))}function oh(f,h){h.shapes=[];if(Array.isArray(f))for(var a=0,b=f.length;a<b;a++)h.shapes.push(f[a].uuid);else h.shapes.push(f.uuid);return h}function ne(f,h){R.call(this);this.type="EdgesGeometry";this.parameters={thresholdAngle:h};var a=[];h=Math.cos(ja.DEG2RAD*(void 0!==h?h:1));var b=[0,0],c={},d=["a","b","c"];if(f.isBufferGeometry){var e=new ca;e.fromBufferGeometry(f)}else e=f.clone();e.mergeVertices();e.computeFaceNormals();
|
||
|
f=e.vertices;e=e.faces;for(var g=0,k=e.length;g<k;g++)for(var l=e[g],n=0;3>n;n++){var m=l[d[n]];var r=l[d[(n+1)%3]];b[0]=Math.min(m,r);b[1]=Math.max(m,r);m=b[0]+","+b[1];void 0===c[m]?c[m]={index1:b[0],index2:b[1],face1:g,face2:void 0}:c[m].face2=g}for(m in c)if(b=c[m],void 0===b.face2||e[b.face1].normal.dot(e[b.face2].normal)<=h)d=f[b.index1],a.push(d.x,d.y,d.z),d=f[b.index2],a.push(d.x,d.y,d.z);this.addAttribute("position",new J(a,3))}function jc(f,h,a,b,c,d,e,g){ca.call(this);this.type="CylinderGeometry";
|
||
|
this.parameters={radiusTop:f,radiusBottom:h,height:a,radialSegments:b,heightSegments:c,openEnded:d,thetaStart:e,thetaLength:g};this.fromBufferGeometry(new Bb(f,h,a,b,c,d,e,g));this.mergeVertices()}function Bb(f,h,a,b,c,d,e,g){function k(a){var c,d=new x,k=new p,u=0,v=!0===a?f:h,A=!0===a?1:-1;var B=t;for(c=1;c<=b;c++)m.push(0,q*A,0),r.push(0,A,0),w.push(.5,.5),t++;var z=t;for(c=0;c<=b;c++){var F=c/b*g+e,D=Math.cos(F);F=Math.sin(F);k.x=v*F;k.y=q*A;k.z=v*D;m.push(k.x,k.y,k.z);r.push(0,A,0);d.x=.5*D+
|
||
|
.5;d.y=.5*F*A+.5;w.push(d.x,d.y);t++}for(c=0;c<b;c++)d=B+c,k=z+c,!0===a?n.push(k,k+1,d):n.push(k+1,k,d),u+=3;l.addGroup(y,u,!0===a?1:2);y+=u}R.call(this);this.type="CylinderBufferGeometry";this.parameters={radiusTop:f,radiusBottom:h,height:a,radialSegments:b,heightSegments:c,openEnded:d,thetaStart:e,thetaLength:g};var l=this;f=void 0!==f?f:1;h=void 0!==h?h:1;a=a||1;b=Math.floor(b)||8;c=Math.floor(c)||1;d=void 0!==d?d:!1;e=void 0!==e?e:0;g=void 0!==g?g:2*Math.PI;var n=[],m=[],r=[],w=[],t=0,u=[],q=
|
||
|
a/2,y=0;(function(){var d,k,v=new p,x=new p,Q=0,I=(h-f)/a;for(k=0;k<=c;k++){var B=[],z=k/c,F=z*(h-f)+f;for(d=0;d<=b;d++){var D=d/b,G=D*g+e,H=Math.sin(G);G=Math.cos(G);x.x=F*H;x.y=-z*a+q;x.z=F*G;m.push(x.x,x.y,x.z);v.set(H,I,G).normalize();r.push(v.x,v.y,v.z);w.push(D,1-z);B.push(t++)}u.push(B)}for(d=0;d<b;d++)for(k=0;k<c;k++)v=u[k+1][d],x=u[k+1][d+1],I=u[k][d+1],n.push(u[k][d],v,I),n.push(v,x,I),Q+=6;l.addGroup(y,Q,0);y+=Q})();!1===d&&(0<f&&k(!0),0<h&&k(!1));this.setIndex(n);this.addAttribute("position",
|
||
|
new J(m,3));this.addAttribute("normal",new J(r,3));this.addAttribute("uv",new J(w,2))}function Ad(f,h,a,b,c,d,e){jc.call(this,0,f,h,a,b,c,d,e);this.type="ConeGeometry";this.parameters={radius:f,height:h,radialSegments:a,heightSegments:b,openEnded:c,thetaStart:d,thetaLength:e}}function Bd(f,h,a,b,c,d,e){Bb.call(this,0,f,h,a,b,c,d,e);this.type="ConeBufferGeometry";this.parameters={radius:f,height:h,radialSegments:a,heightSegments:b,openEnded:c,thetaStart:d,thetaLength:e}}function Cd(f,h,a,b){ca.call(this);
|
||
|
this.type="CircleGeometry";this.parameters={radius:f,segments:h,thetaStart:a,thetaLength:b};this.fromBufferGeometry(new Hc(f,h,a,b));this.mergeVertices()}function Hc(f,h,a,b){R.call(this);this.type="CircleBufferGeometry";this.parameters={radius:f,segments:h,thetaStart:a,thetaLength:b};f=f||1;h=void 0!==h?Math.max(3,h):8;a=void 0!==a?a:0;b=void 0!==b?b:2*Math.PI;var c=[],d=[],e=[],g=[],k,l=new p,n=new x;d.push(0,0,0);e.push(0,0,1);g.push(.5,.5);var m=0;for(k=3;m<=h;m++,k+=3){var r=a+m/h*b;l.x=f*Math.cos(r);
|
||
|
l.y=f*Math.sin(r);d.push(l.x,l.y,l.z);e.push(0,0,1);n.x=(d[k]/f+1)/2;n.y=(d[k+1]/f+1)/2;g.push(n.x,n.y)}for(k=1;k<=h;k++)c.push(k,k+1,0);this.setIndex(c);this.addAttribute("position",new J(d,3));this.addAttribute("normal",new J(e,3));this.addAttribute("uv",new J(g,2))}function Ic(f){da.call(this);this.type="ShadowMaterial";this.color=new S(0);this.transparent=!0;this.setValues(f)}function Dd(f){la.call(this,f);this.type="RawShaderMaterial"}function Cb(f){da.call(this);this.defines={STANDARD:""};this.type=
|
||
|
"MeshStandardMaterial";this.color=new S(16777215);this.metalness=this.roughness=.5;this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new S(0);this.emissiveIntensity=1;this.bumpMap=this.emissiveMap=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new x(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.envMap=this.alphaMap=this.metalnessMap=this.roughnessMap=null;this.envMapIntensity=1;this.refractionRatio=
|
||
|
.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.morphNormals=this.morphTargets=this.skinning=!1;this.setValues(f)}function Jc(f){Cb.call(this);this.defines={PHYSICAL:""};this.type="MeshPhysicalMaterial";this.reflectivity=.5;this.clearCoatRoughness=this.clearCoat=0;this.setValues(f)}function rb(f){da.call(this);this.type="MeshPhongMaterial";this.color=new S(16777215);this.specular=new S(1118481);this.shininess=30;this.lightMap=this.map=null;
|
||
|
this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new S(0);this.emissiveIntensity=1;this.bumpMap=this.emissiveMap=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new x(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;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.morphNormals=
|
||
|
this.morphTargets=this.skinning=!1;this.setValues(f)}function Kc(f){rb.call(this);this.defines={TOON:""};this.type="MeshToonMaterial";this.gradientMap=null;this.setValues(f)}function Lc(f){da.call(this);this.type="MeshNormalMaterial";this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new x(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.lights=this.fog=
|
||
|
!1;this.setValues(f)}function Mc(f){da.call(this);this.type="MeshLambertMaterial";this.color=new S(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.emissive=new S(0);this.emissiveIntensity=1;this.envMap=this.alphaMap=this.specularMap=this.emissiveMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.morphNormals=this.morphTargets=
|
||
|
this.skinning=!1;this.setValues(f)}function Nc(f){za.call(this);this.type="LineDashedMaterial";this.scale=1;this.dashSize=3;this.gapSize=1;this.setValues(f)}function ph(f,h,a){var b=this,c=!1,d=0,e=0,g=void 0;this.onStart=void 0;this.onLoad=f;this.onProgress=h;this.onError=a;this.itemStart=function(a){e++;if(!1===c&&void 0!==b.onStart)b.onStart(a,d,e);c=!0};this.itemEnd=function(a){d++;if(void 0!==b.onProgress)b.onProgress(a,d,e);if(d===e&&(c=!1,void 0!==b.onLoad))b.onLoad()};this.itemError=function(a){if(void 0!==
|
||
|
b.onError)b.onError(a)};this.resolveURL=function(a){return g?g(a):a};this.setURLModifier=function(a){g=a;return this}}function Db(f){this.manager=void 0!==f?f:db}function oe(f){this.manager=void 0!==f?f:db}function sf(f){this.manager=void 0!==f?f:db}function Z(){this.type="Curve";this.arcLengthDivisions=200}function eb(f,h,a,b,c,d,e,g){Z.call(this);this.type="EllipseCurve";this.aX=f||0;this.aY=h||0;this.xRadius=a||1;this.yRadius=b||1;this.aStartAngle=c||0;this.aEndAngle=d||2*Math.PI;this.aClockwise=
|
||
|
e||!1;this.aRotation=g||0}function Ed(f,h,a,b,c,d){eb.call(this,f,h,a,a,b,c,d);this.type="ArcCurve"}function tf(){var f=0,h=0,a=0,b=0;return{initCatmullRom:function(c,d,e,g,k){c=k*(e-c);g=k*(g-d);f=d;h=c;a=-3*d+3*e-2*c-g;b=2*d-2*e+c+g},initNonuniformCatmullRom:function(c,d,e,g,k,l,n){c=((d-c)/k-(e-c)/(k+l)+(e-d)/l)*l;g=((e-d)/l-(g-d)/(l+n)+(g-e)/n)*l;f=d;h=c;a=-3*d+3*e-2*c-g;b=2*d-2*e+c+g},calc:function(c){var d=c*c;return f+h*c+a*d+b*d*c}}}function jb(f,h,a,b){Z.call(this);this.type="CatmullRomCurve3";
|
||
|
this.points=f||[];this.closed=h||!1;this.curveType=a||"centripetal";this.tension=b||.5}function qh(f,h,a,b,c){h=.5*(b-h);c=.5*(c-a);var d=f*f;return(2*a-2*b+h+c)*f*d+(-3*a+3*b-2*h-c)*d+h*f+a}function Fd(f,h,a,b){var c=1-f;return c*c*h+2*(1-f)*f*a+f*f*b}function Gd(f,h,a,b,c){var d=1-f,e=1-f;return d*d*d*h+3*e*e*f*a+3*(1-f)*f*f*b+f*f*f*c}function sb(f,h,a,b){Z.call(this);this.type="CubicBezierCurve";this.v0=f||new x;this.v1=h||new x;this.v2=a||new x;this.v3=b||new x}function Eb(f,h,a,b){Z.call(this);
|
||
|
this.type="CubicBezierCurve3";this.v0=f||new p;this.v1=h||new p;this.v2=a||new p;this.v3=b||new p}function ab(f,h){Z.call(this);this.type="LineCurve";this.v1=f||new x;this.v2=h||new x}function kb(f,h){Z.call(this);this.type="LineCurve3";this.v1=f||new p;this.v2=h||new p}function tb(f,h,a){Z.call(this);this.type="QuadraticBezierCurve";this.v0=f||new x;this.v1=h||new x;this.v2=a||new x}function Fb(f,h,a){Z.call(this);this.type="QuadraticBezierCurve3";this.v0=f||new p;this.v1=h||new p;this.v2=a||new p}
|
||
|
function ub(f){Z.call(this);this.type="SplineCurve";this.points=f||[]}function Rb(){Z.call(this);this.type="CurvePath";this.curves=[];this.autoClose=!1}function vb(f){Rb.call(this);this.type="Path";this.currentPoint=new x;f&&this.setFromPoints(f)}function kc(f){vb.call(this,f);this.uuid=ja.generateUUID();this.type="Shape";this.holes=[]}function Da(f,h){O.call(this);this.type="Light";this.color=new S(f);this.intensity=void 0!==h?h:1;this.receiveShadow=void 0}function pe(f,h,a){Da.call(this,f,a);this.type=
|
||
|
"HemisphereLight";this.castShadow=void 0;this.position.copy(O.DefaultUp);this.updateMatrix();this.groundColor=new S(h)}function Oc(f){this.camera=f;this.bias=0;this.radius=1;this.mapSize=new x(512,512);this.map=null;this.matrix=new V}function uf(){Oc.call(this,new Ba(50,1,.5,500))}function qe(f,h,a,b,c,d){Da.call(this,f,h);this.type="SpotLight";this.position.copy(O.DefaultUp);this.updateMatrix();this.target=new O;Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(a){this.intensity=
|
||
|
a/Math.PI}});this.distance=void 0!==a?a:0;this.angle=void 0!==b?b:Math.PI/3;this.penumbra=void 0!==c?c:0;this.decay=void 0!==d?d:1;this.shadow=new uf}function re(f,h,a,b){Da.call(this,f,h);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!==a?a:0;this.decay=void 0!==b?b:1;this.shadow=new Oc(new Ba(90,1,.5,500))}function vf(){Oc.call(this,new qb(-5,5,5,-5,.5,500))}function se(f,
|
||
|
h){Da.call(this,f,h);this.type="DirectionalLight";this.position.copy(O.DefaultUp);this.updateMatrix();this.target=new O;this.shadow=new vf}function te(f,h){Da.call(this,f,h);this.type="AmbientLight";this.castShadow=void 0}function ue(f,h,a,b){Da.call(this,f,h);this.type="RectAreaLight";this.width=void 0!==a?a:10;this.height=void 0!==b?b:10}function wf(f,h,a,b){Ea.call(this,f,h,a,b)}function xf(f,h,a){Ea.call(this,f,h,a)}function fb(f,h,a,b){this.parameterPositions=f;this._cachedIndex=0;this.resultBuffer=
|
||
|
void 0!==b?b:new h.constructor(a);this.sampleValues=h;this.valueSize=a}function yf(f,h,a,b){fb.call(this,f,h,a,b)}function ve(f,h,a,b){Ea.call(this,f,h,a,b)}function zf(f,h,a,b){Ea.call(this,f,h,a,b)}function Hd(f,h,a,b){Ea.call(this,f,h,a,b)}function Af(f,h,a,b){fb.call(this,f,h,a,b);this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0}function we(f,h,a,b){fb.call(this,f,h,a,b)}function Bf(f,h,a,b){fb.call(this,f,h,a,b)}function Ea(f,h,a,b){if(void 0===f)throw Error("THREE.KeyframeTrack: track name is undefined");
|
||
|
if(void 0===h||0===h.length)throw Error("THREE.KeyframeTrack: no keyframes in track named "+f);this.name=f;this.times=Sa.convertArray(h,this.TimeBufferType);this.values=Sa.convertArray(a,this.ValueBufferType);this.setInterpolation(b||this.DefaultInterpolation);this.validate();this.optimize()}function Id(f,h,a,b){Ea.call(this,f,h,a,b)}function gb(f,h,a){this.name=f;this.tracks=a;this.duration=void 0!==h?h:-1;this.uuid=ja.generateUUID();0>this.duration&&this.resetDuration();this.optimize()}function Cf(f){this.manager=
|
||
|
void 0!==f?f:db;this.textures={}}function rh(f){this.manager=void 0!==f?f:db}function Jd(){}function Df(f){"boolean"===typeof f&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),f=void 0);this.manager=void 0!==f?f:db;this.withCredentials=!1}function sh(){this.type="ShapePath";this.color=new S;this.subPaths=[];this.currentPath=null}function Ef(f){this.type="Font";this.data=f}function th(f){this.manager=void 0!==f?f:db}function uh(f){this.manager=void 0!==f?
|
||
|
f:db}function Kd(f,h,a){O.call(this);this.type="CubeCamera";var b=new Ba(90,1,f,h);b.up.set(0,-1,0);b.lookAt(new p(1,0,0));this.add(b);var c=new Ba(90,1,f,h);c.up.set(0,-1,0);c.lookAt(new p(-1,0,0));this.add(c);var d=new Ba(90,1,f,h);d.up.set(0,0,1);d.lookAt(new p(0,1,0));this.add(d);var e=new Ba(90,1,f,h);e.up.set(0,0,-1);e.lookAt(new p(0,-1,0));this.add(e);var g=new Ba(90,1,f,h);g.up.set(0,-1,0);g.lookAt(new p(0,0,1));this.add(g);var k=new Ba(90,1,f,h);k.up.set(0,-1,0);k.lookAt(new p(0,0,-1));this.add(k);
|
||
|
this.renderTarget=new Yc(a,a,{format:1022,magFilter:1006,minFilter:1006});this.renderTarget.texture.name="CubeCamera";this.update=function(a,f){null===this.parent&&this.updateMatrixWorld();var h=this.renderTarget,l=h.texture.generateMipmaps;h.texture.generateMipmaps=!1;h.activeCubeFace=0;a.render(f,b,h);h.activeCubeFace=1;a.render(f,c,h);h.activeCubeFace=2;a.render(f,d,h);h.activeCubeFace=3;a.render(f,e,h);h.activeCubeFace=4;a.render(f,g,h);h.texture.generateMipmaps=l;h.activeCubeFace=5;a.render(f,
|
||
|
k,h);a.setRenderTarget(null)};this.clear=function(a,b,c,d){for(var e=this.renderTarget,f=0;6>f;f++)e.activeCubeFace=f,a.setRenderTarget(e),a.clear(b,c,d);a.setRenderTarget(null)}}function vh(){O.call(this);this.type="AudioListener";this.context=wh.getContext();this.gain=this.context.createGain();this.gain.connect(this.context.destination);this.filter=null}function Ld(f){O.call(this);this.type="Audio";this.context=f.context;this.gain=this.context.createGain();this.gain.connect(f.getInput());this.autoplay=
|
||
|
!1;this.buffer=null;this.loop=!1;this.offset=this.startTime=0;this.playbackRate=1;this.isPlaying=!1;this.hasPlaybackControl=!0;this.sourceType="empty";this.filters=[]}function xh(f){Ld.call(this,f);this.panner=this.context.createPanner();this.panner.connect(this.gain)}function yh(f,h){this.analyser=f.context.createAnalyser();this.analyser.fftSize=void 0!==h?h:2048;this.data=new Uint8Array(this.analyser.frequencyBinCount);f.getOutput().connect(this.analyser)}function zh(f,h,a){this.binding=f;this.valueSize=
|
||
|
a;f=Float64Array;switch(h){case "quaternion":h=this._slerp;break;case "string":case "bool":f=Array;h=this._select;break;default:h=this._lerp}this.buffer=new f(4*a);this._mixBufferRegion=h;this.referenceCount=this.useCount=this.cumulativeWeight=0}function Ah(f,h,a){a=a||Ta.parseTrackName(h);this._targetGroup=f;this._bindings=f.subscribe_(h,a)}function Ta(f,h,a){this.path=h;this.parsedPath=a||Ta.parseTrackName(h);this.node=Ta.findNode(f,this.parsedPath.nodeName)||f;this.rootNode=f}function Bh(f,h,a){this._mixer=
|
||
|
f;this._clip=h;this._localRoot=a||null;f=h.tracks;h=f.length;a=Array(h);for(var b={endingStart:2400,endingEnd:2400},c=0;c!==h;++c){var d=f[c].createInterpolant(null);a[c]=d;d.settings=b}this._interpolantSettings=b;this._interpolants=a;this._propertyBindings=Array(h);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 Ff(f){this._root=f;this._initMemoryManager();this.time=this._accuIndex=0;this.timeScale=1}function B(f,h){"string"===typeof f&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),f=h);this.value=f}function Ch(){R.call(this);this.type="InstancedBufferGeometry";this.maxInstancedCount=void 0}function Dh(f,h,a,b){this.data=f;this.itemSize=h;this.offset=
|
||
|
a;this.normalized=!0===b}function Md(f,h){this.array=f;this.stride=h;this.count=void 0!==f?f.length/h:0;this.dynamic=!1;this.updateRange={offset:0,count:-1};this.version=0}function Eh(f,h,a){Md.call(this,f,h);this.meshPerAttribute=a||1}function Fh(f,h,a){fa.call(this,f,h);this.meshPerAttribute=a||1}function Gh(f,h,a,b){this.ray=new sc(f,h);this.near=a||0;this.far=b||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 Hh(f,h){return f.distance-h.distance}function Gf(f,h,a,b){if(!1!==f.visible&&(f.raycast(h,a),!0===b)){f=f.children;b=0;for(var c=f.length;b<c;b++)Gf(f[b],h,a,!0)}}function Hf(f){this.autoStart=void 0!==f?f:!0;this.elapsedTime=this.oldTime=this.startTime=0;this.running=!1}function If(f,h,a){this.radius=void 0!==f?f:1;this.phi=void 0!==h?h:0;this.theta=void 0!==a?a:0;return this}function Ih(f,h){this.min=void 0!==f?f:new x(Infinity,Infinity);this.max=void 0!==h?h:new x(-Infinity,
|
||
|
-Infinity)}function xe(f){O.call(this);this.material=f;this.render=function(){}}function ye(f,h,a,b){this.object=f;this.size=void 0!==h?h:1;f=void 0!==a?a:16711680;b=void 0!==b?b:1;h=0;(a=this.object.geometry)&&a.isGeometry?h=3*a.faces.length:a&&a.isBufferGeometry&&(h=a.attributes.normal.count);a=new R;h=new J(6*h,3);a.addAttribute("position",h);Ca.call(this,a,new za({color:f,linewidth:b}));this.matrixAutoUpdate=!1;this.update()}function Nd(f,h){O.call(this);this.light=f;this.light.updateMatrixWorld();
|
||
|
this.matrix=f.matrixWorld;this.matrixAutoUpdate=!1;this.color=h;f=new R;h=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(var a=0,b=1;32>a;a++,b++){var c=a/32*Math.PI*2,d=b/32*Math.PI*2;h.push(Math.cos(c),Math.sin(c),1,Math.cos(d),Math.sin(d),1)}f.addAttribute("position",new J(h,3));h=new za({fog:!1});this.cone=new Ca(f,h);this.add(this.cone);this.update()}function Jh(f){var h=[];f&&f.isBone&&h.push(f);for(var a=0;a<f.children.length;a++)h.push.apply(h,Jh(f.children[a]));return h}
|
||
|
function Od(f){for(var h=Jh(f),a=new R,b=[],c=[],d=new S(0,0,1),e=new S(0,1,0),g=0;g<h.length;g++){var k=h[g];k.parent&&k.parent.isBone&&(b.push(0,0,0),b.push(0,0,0),c.push(d.r,d.g,d.b),c.push(e.r,e.g,e.b))}a.addAttribute("position",new J(b,3));a.addAttribute("color",new J(c,3));b=new za({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Ca.call(this,a,b);this.root=f;this.bones=h;this.matrix=f.matrixWorld;this.matrixAutoUpdate=!1}function Pd(f,h,a){this.light=f;this.light.updateMatrixWorld();
|
||
|
this.color=a;f=new gc(h,4,2);h=new Ua({wireframe:!0,fog:!1});ha.call(this,f,h);this.matrix=this.light.matrixWorld;this.matrixAutoUpdate=!1;this.update()}function Qd(f,h){O.call(this);this.light=f;this.light.updateMatrixWorld();this.matrix=f.matrixWorld;this.matrixAutoUpdate=!1;this.color=h;f=new za({fog:!1});h=new R;h.addAttribute("position",new fa(new Float32Array(15),3));this.line=new Va(h,f);this.add(this.line);this.update()}function Rd(f,h,a){O.call(this);this.light=f;this.light.updateMatrixWorld();
|
||
|
this.matrix=f.matrixWorld;this.matrixAutoUpdate=!1;this.color=a;f=new ec(h);f.rotateY(.5*Math.PI);this.material=new Ua({wireframe:!0,fog:!1});void 0===this.color&&(this.material.vertexColors=2);h=f.getAttribute("position");h=new Float32Array(3*h.count);f.addAttribute("color",new fa(h,3));this.add(new ha(f,this.material));this.update()}function ze(f,h,a,b){f=f||10;h=h||10;a=new S(void 0!==a?a:4473924);b=new S(void 0!==b?b:8947848);var c=h/2,d=f/h,e=f/2;f=[];for(var g=[],k=0,l=0,n=-e;k<=h;k++,n+=d){f.push(-e,
|
||
|
0,n,e,0,n);f.push(n,0,-e,n,0,e);var m=k===c?a:b;m.toArray(g,l);l+=3;m.toArray(g,l);l+=3;m.toArray(g,l);l+=3;m.toArray(g,l);l+=3}h=new R;h.addAttribute("position",new J(f,3));h.addAttribute("color",new J(g,3));a=new za({vertexColors:2});Ca.call(this,h,a)}function Jf(f,h,a,b,c,d){f=f||10;h=h||16;a=a||8;b=b||64;c=new S(void 0!==c?c:4473924);d=new S(void 0!==d?d:8947848);var e=[],g=[],k;for(k=0;k<=h;k++){var l=k/h*2*Math.PI;var n=Math.sin(l)*f;l=Math.cos(l)*f;e.push(0,0,0);e.push(n,0,l);var m=k&1?c:d;
|
||
|
g.push(m.r,m.g,m.b);g.push(m.r,m.g,m.b)}for(k=0;k<=a;k++){m=k&1?c:d;var r=f-f/a*k;for(h=0;h<b;h++)l=h/b*2*Math.PI,n=Math.sin(l)*r,l=Math.cos(l)*r,e.push(n,0,l),g.push(m.r,m.g,m.b),l=(h+1)/b*2*Math.PI,n=Math.sin(l)*r,l=Math.cos(l)*r,e.push(n,0,l),g.push(m.r,m.g,m.b)}f=new R;f.addAttribute("position",new J(e,3));f.addAttribute("color",new J(g,3));e=new za({vertexColors:2});Ca.call(this,f,e)}function Ae(f,h,a,b){this.object=f;this.size=void 0!==h?h:1;f=void 0!==a?a:16776960;b=void 0!==b?b:1;h=0;(a=this.object.geometry)&&
|
||
|
a.isGeometry?h=a.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");a=new R;h=new J(6*h,3);a.addAttribute("position",h);Ca.call(this,a,new za({color:f,linewidth:b}));this.matrixAutoUpdate=!1;this.update()}function Sd(f,h,a){O.call(this);this.light=f;this.light.updateMatrixWorld();this.matrix=f.matrixWorld;this.matrixAutoUpdate=!1;this.color=a;void 0===h&&(h=1);f=new R;f.addAttribute("position",new J([-h,h,0,h,h,0,h,-h,0,
|
||
|
-h,-h,0,-h,h,0],3));h=new za({fog:!1});this.lightPlane=new Va(f,h);this.add(this.lightPlane);f=new R;f.addAttribute("position",new J([0,0,0,0,0,1],3));this.targetLine=new Va(f,h);this.add(this.targetLine);this.update()}function Be(f){function h(b,c,d){a(b,d);a(c,d)}function a(a,b){d.push(0,0,0);e.push(b.r,b.g,b.b);void 0===g[a]&&(g[a]=[]);g[a].push(d.length/3-1)}var b=new R,c=new za({color:16777215,vertexColors:1}),d=[],e=[],g={},k=new S(16755200),l=new S(16711680),n=new S(43775),m=new S(16777215),
|
||
|
r=new S(3355443);h("n1","n2",k);h("n2","n4",k);h("n4","n3",k);h("n3","n1",k);h("f1","f2",k);h("f2","f4",k);h("f4","f3",k);h("f3","f1",k);h("n1","f1",k);h("n2","f2",k);h("n3","f3",k);h("n4","f4",k);h("p","n1",l);h("p","n2",l);h("p","n3",l);h("p","n4",l);h("u1","u2",n);h("u2","u3",n);h("u3","u1",n);h("c","t",m);h("p","c",r);h("cn1","cn2",r);h("cn3","cn4",r);h("cf1","cf2",r);h("cf3","cf4",r);b.addAttribute("position",new J(d,3));b.addAttribute("color",new J(e,3));Ca.call(this,b,c);this.camera=f;this.camera.updateProjectionMatrix&&
|
||
|
this.camera.updateProjectionMatrix();this.matrix=f.matrixWorld;this.matrixAutoUpdate=!1;this.pointMap=g;this.update()}function Td(f,h){this.object=f;void 0===h&&(h=16776960);f=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);var a=new Float32Array(24),b=new R;b.setIndex(new fa(f,1));b.addAttribute("position",new fa(a,3));Ca.call(this,b,new za({color:h}));this.matrixAutoUpdate=!1;this.update()}function Ce(f,h){this.type="Box3Helper";this.box=f;f=void 0!==h?h:16776960;h=new Uint16Array([0,
|
||
|
1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]);var a=new R;a.setIndex(new fa(h,1));a.addAttribute("position",new J([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3));Ca.call(this,a,new za({color:f}));this.geometry.computeBoundingSphere()}function De(f,h,a){this.type="PlaneHelper";this.plane=f;this.size=void 0===h?1:h;f=void 0!==a?a:16776960;h=new R;h.addAttribute("position",new J([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,0,1,0,0,0],3));h.computeBoundingSphere();Va.call(this,
|
||
|
h,new za({color:f}));h=new R;h.addAttribute("position",new J([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3));h.computeBoundingSphere();this.add(new ha(h,new Ua({color:f,opacity:.2,transparent:!0,depthWrite:!1})))}function Pc(f,h,a,b,c,d){O.call(this);void 0===b&&(b=16776960);void 0===a&&(a=1);void 0===c&&(c=.2*a);void 0===d&&(d=.2*c);void 0===Ee&&(Ee=new R,Ee.addAttribute("position",new J([0,0,0,0,1,0],3)),Kf=new Bb(0,.5,1,5,1),Kf.translate(0,-.5,0));this.position.copy(h);this.line=new Va(Ee,new za({color:b}));
|
||
|
this.line.matrixAutoUpdate=!1;this.add(this.line);this.cone=new ha(Kf,new Ua({color:b}));this.cone.matrixAutoUpdate=!1;this.add(this.cone);this.setDirection(f);this.setLength(a,c,d)}function Lf(f){f=f||1;var h=[0,0,0,f,0,0,0,0,0,0,f,0,0,0,0,0,0,f];f=new R;f.addAttribute("position",new J(h,3));f.addAttribute("color",new J([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));h=new za({vertexColors:2});Ca.call(this,f,h)}function Kh(f){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.");
|
||
|
jb.call(this,f);this.type="catmullrom"}function Mf(f,h,a){function b(){if(m)throw Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return k}function c(a){if("function"!==typeof a)throw Error("Expected the listener to be a function.");if(m)throw Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");
|
||
|
var b=!0;n===l&&(n=l.slice());n.push(a);return function(){if(b){if(m)throw Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");b=!1;n===l&&(n=l.slice());var c=n.indexOf(a);n.splice(c,1)}}}function d(a){if("object"!==("undefined"===typeof a?"undefined":Lh(a))||null===a)var b=!1;else{for(b=a;null!==Object.getPrototypeOf(b);)b=Object.getPrototypeOf(b);b=Object.getPrototypeOf(a)===b}if(!b)throw Error("Actions must be plain objects. Use custom middleware for async actions.");
|
||
|
if("undefined"===typeof a.type)throw Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(m)throw Error("Reducers may not dispatch actions.");try{m=!0,k=g(k,a)}finally{m=!1}b=l=n;for(var c=0;c<b.length;c++)(0,b[c])();return a}var e;"function"===typeof h&&"undefined"===typeof a&&(a=h,h=void 0);if("undefined"!==typeof a){if("function"!==typeof a)throw Error("Expected the enhancer to be a function.");return a(Mf)(f,h)}if("function"!==typeof f)throw Error("Expected the reducer to be a function.");
|
||
|
var g=f,k=h,l=[],n=l,m=!1;d({type:Mh.INIT});return e={dispatch:d,subscribe:c,getState:b,replaceReducer:function(a){if("function"!==typeof a)throw Error("Expected the nextReducer to be a function.");g=a;d({type:Mh.REPLACE})}},e[Nh]=function(){var a;return a={subscribe:function(a){function d(){a.next&&a.next(b())}if("object"!==("undefined"===typeof a?"undefined":Lh(a))||null===a)throw new TypeError("Expected the observer to be an object.");d();return{unsubscribe:c(d)}}},a[Nh]=function(){return this},
|
||
|
a},e}function Oh(f,h){var a=3>arguments.length?f:arguments[2],b;if(Ma(f)===a)return f[h];if(b=Ud.f(f,h))return oa(b,"value")?b.value:void 0!==b.get?b.get.call(a):void 0;if(Ga(b=Nf(f)))return Oh(b,h,a)}function Of(){for(var f=arguments.length,h=Array(f),a=0;a<f;a++)h[a]=arguments[a];return function(a){for(var b=0;b<h.length;b++)for(var d=h[b],e=0;e<d.map.length;e++){var f=d.map[e];Object.defineProperty(a.prototype,f,{get:d.getter(f),set:d.setter(f),configurable:d.configurable,enumerable:d.enumerable})}}}
|
||
|
function Pf(){for(var f=arguments.length,h=Array(f),a=0;a<f;a++)h[a]=arguments[a];return{map:h,getter:function(a){return function(){return this.native[a]}},setter:function(a){return function(b){this.native[a].copy(b)}},configurable:!0,enumerable:!0}}function wb(f,h){return f+Math.random()*(h-f)}var Sb=G(function(f){!function(h){function a(a,b,d,e){b=Object.create((b&&b.prototype instanceof c?b:c).prototype);e=new w(e||[]);b._invoke=l(a,d,e);return b}function b(a,b,c){try{return{type:"normal",arg:a.call(b,
|
||
|
c)}}catch(bd){return{type:"throw",arg:bd}}}function c(){}function d(){}function e(){}function g(a){["next","throw","return"].forEach(function(b){a[b]=function(a){return this._invoke(b,a)}})}function k(a){function c(d,e,f,g){d=b(a[d],a,e);if("throw"===d.type)g(d.arg);else{var h=d.arg;return(d=h.value)&&"object"===typeof d&&y.call(d,"__await")?Promise.resolve(d.__await).then(function(a){c("next",a,f,g)},function(a){c("throw",a,f,g)}):Promise.resolve(d).then(function(a){h.value=a;f(h)},g)}}var d;this._invoke=
|
||
|
function(a,b){function e(){return new Promise(function(d,e){c(a,b,d,e)})}return d=d?d.then(e,e):e()}}function l(a,c,d){var e=z;return function(f,g){if(e===F)throw Error("Generator is already running");if(e===D){if("throw"===f)throw g;return p()}d.method=f;for(d.arg=g;;){if(f=d.delegate)if(f=n(f,d)){if(f===G)continue;return f}if("next"===d.method)d.sent=d._sent=d.arg;else if("throw"===d.method){if(e===z)throw e=D,d.arg;d.dispatchException(d.arg)}else"return"===d.method&&d.abrupt("return",d.arg);e=
|
||
|
F;f=b(a,c,d);if("normal"===f.type){e=d.done?D:B;if(f.arg===G)continue;return{value:f.arg,done:d.done}}"throw"===f.type&&(e=D,d.method="throw",d.arg=f.arg)}}}function n(a,c){var d=a.iterator[c.method];if(d===A){c.delegate=null;if("throw"===c.method){if(a.iterator.return&&(c.method="return",c.arg=A,n(a,c),"throw"===c.method))return G;c.method="throw";c.arg=new TypeError("The iterator does not provide a 'throw' method")}return G}d=b(d,a.iterator,c.arg);if("throw"===d.type)return c.method="throw",c.arg=
|
||
|
d.arg,c.delegate=null,G;d=d.arg;if(!d)return c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,G;if(d.done)c[a.resultName]=d.value,c.next=a.nextLoc,"return"!==c.method&&(c.method="next",c.arg=A);else return d;c.delegate=null;return G}function m(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]);2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]);this.tryEntries.push(b)}function r(a){var b=a.completion||{};b.type="normal";delete b.arg;a.completion=b}function w(a){this.tryEntries=
|
||
|
[{tryLoc:"root"}];a.forEach(m,this);this.reset(!0)}function t(a){if(a){var b=a[E];if(b)return b.call(a);if("function"===typeof a.next)return a;if(!isNaN(a.length)){var c=-1;b=function U(){for(;++c<a.length;)if(y.call(a,c))return U.value=a[c],U.done=!1,U;U.value=A;U.done=!0;return U};return b.next=b}}return{next:p}}function p(){return{value:A,done:!0}}var q=Object.prototype,y=q.hasOwnProperty,A;$jscomp.initSymbol();$jscomp.initSymbol();var C="function"===typeof Symbol?Symbol:{},E=C.iterator||"@@iterator",
|
||
|
x=C.asyncIterator||"@@asyncIterator",Q=C.toStringTag||"@@toStringTag",I=h.regeneratorRuntime;if(I)f.exports=I;else{I=h.regeneratorRuntime=f.exports;I.wrap=a;var z="suspendedStart",B="suspendedYield",F="executing",D="completed",G={};h={};h[E]=function(){return this};(C=(C=Object.getPrototypeOf)&&C(C(t([]))))&&C!==q&&y.call(C,E)&&(h=C);var H=e.prototype=c.prototype=Object.create(h);d.prototype=H.constructor=e;e.constructor=d;e[Q]=d.displayName="GeneratorFunction";I.isGeneratorFunction=function(a){return(a=
|
||
|
"function"===typeof a&&a.constructor)?a===d||"GeneratorFunction"===(a.displayName||a.name):!1};I.mark=function(a){Object.setPrototypeOf?Object.setPrototypeOf(a,e):(a.__proto__=e,Q in a||(a[Q]="GeneratorFunction"));a.prototype=Object.create(H);return a};I.awrap=function(a){return{__await:a}};g(k.prototype);k.prototype[x]=function(){return this};I.AsyncIterator=k;I.async=function(b,c,d,e){var f=new k(a(b,c,d,e));return I.isGeneratorFunction(c)?f:f.next().then(function(a){return a.done?a.value:f.next()})};
|
||
|
g(H);H[Q]="Generator";H[E]=function(){return this};H.toString=function(){return"[object Generator]"};I.keys=function(a){var b=[],c;for(c in a)b.push(c);b.reverse();return function U(){for(;b.length;){var c=b.pop();if(c in a)return U.value=c,U.done=!1,U}U.done=!0;return U}};I.values=t;w.prototype={constructor:w,reset:function(a){this.next=this.prev=0;this.sent=this._sent=A;this.done=!1;this.delegate=null;this.method="next";this.arg=A;this.tryEntries.forEach(r);if(!a)for(var b in this)"t"===b.charAt(0)&&
|
||
|
y.call(this,b)&&!isNaN(+b.slice(1))&&(this[b]=A)},stop:function(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function(a){function b(b,d){f.type="throw";f.arg=a;c.next=b;d&&(c.method="next",c.arg=A);return!!d}if(this.done)throw a;for(var c=this,d=this.tryEntries.length-1;0<=d;--d){var e=this.tryEntries[d],f=e.completion;if("root"===e.tryLoc)return b("end");if(e.tryLoc<=this.prev){var g=y.call(e,"catchLoc"),h=y.call(e,"finallyLoc");
|
||
|
if(g&&h){if(this.prev<e.catchLoc)return b(e.catchLoc,!0);if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else if(g){if(this.prev<e.catchLoc)return b(e.catchLoc,!0)}else if(h){if(this.prev<e.finallyLoc)return b(e.finallyLoc)}else throw Error("try statement without catch or finally");}}},abrupt:function(a,b){for(var c=this.tryEntries.length-1;0<=c;--c){var d=this.tryEntries[c];if(d.tryLoc<=this.prev&&y.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var e=d;break}}e&&("break"===a||"continue"===a)&&e.tryLoc<=
|
||
|
b&&b<=e.finallyLoc&&(e=null);c=e?e.completion:{};c.type=a;c.arg=b;return e?(this.method="next",this.next=e.finallyLoc,G):this.complete(c)},complete:function(a,b){if("throw"===a.type)throw a.arg;"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b);return G},finish:function(a){for(var b=this.tryEntries.length-1;0<=b;--b){var c=this.tryEntries[b];if(c.finallyLoc===a)return this.complete(c.completion,
|
||
|
c.afterLoc),r(c),G}},"catch":function(a){for(var b=this.tryEntries.length-1;0<=b;--b){var c=this.tryEntries[b];if(c.tryLoc===a){a=c.completion;if("throw"===a.type){var d=a.arg;r(c)}return d}}throw Error("illegal catch attempt");},delegateYield:function(a,b,c){this.delegate={iterator:t(a),resultName:b,nextLoc:c};"next"===this.method&&(this.arg=A);return G}}}}(function(){return this}()||Function("return this")())}),lc=function(){return this}()||Function("return this")(),Ph=lc.regeneratorRuntime&&0<=
|
||
|
Object.getOwnPropertyNames(lc).indexOf("regeneratorRuntime"),tl=Ph&&lc.regeneratorRuntime;lc.regeneratorRuntime=void 0;if(Ph)lc.regeneratorRuntime=tl;else try{delete lc.regeneratorRuntime}catch(f){lc.regeneratorRuntime=void 0}var ul=Math.ceil,vl=Math.floor,Qf=function(f){return isNaN(f=+f)?0:(0<f?vl:ul)(f)},Qc=function(f){if(void 0==f)throw TypeError("Can't call method on "+f);return f},ea=G(function(f){f=f.exports="undefined"!=typeof window&&Math==Math?window:"undefined"!=typeof self&&self.Math==
|
||
|
Math?self:Function("return this")();"number"==typeof __g&&(__g=f)}),qa=G(function(f){f=f.exports={version:"2.5.6"};"number"==typeof __e&&(__e=f)}),ob=function(f){if("function"!=typeof f)throw TypeError(f+" is not a function!");return f},Na=function(f,h,a){ob(f);if(void 0===h)return f;switch(a){case 1:return function(a){return f.call(h,a)};case 2:return function(a,c){return f.call(h,a,c)};case 3:return function(a,c,d){return f.call(h,a,c,d)}}return function(){return f.apply(h,arguments)}},Ga=function(f){return"object"===
|
||
|
typeof f?null!==f:"function"===typeof f},Ma=function(f){if(!Ga(f))throw TypeError(f+" is not an object!");return f},Gb=function(f){try{return!!f()}catch(h){return!0}},hb=!Gb(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),Rc=ea.document,Fe=Ga(Rc)&&Ga(Rc.createElement),Qh=!hb&&!Gb(function(){return 7!=Object.defineProperty(Fe?Rc.createElement("div"):{},"a",{get:function(){return 7}}).a}),Vd=function(f,h){if(!Ga(f))return f;var a,b;if(h&&"function"==typeof(a=f.toString)&&
|
||
|
!Ga(b=a.call(f))||"function"==typeof(a=f.valueOf)&&!Ga(b=a.call(f))||!h&&"function"==typeof(a=f.toString)&&!Ga(b=a.call(f)))return b;throw TypeError("Can't convert object to primitive value");},wl=Object.defineProperty,lb={f:hb?Object.defineProperty:function(f,h,a){Ma(f);h=Vd(h,!0);Ma(a);if(Qh)try{return wl(f,h,a)}catch(b){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");"value"in a&&(f[h]=a.value);return f}},Sc=function(f,h){return{enumerable:!(f&1),configurable:!(f&2),writable:!(f&
|
||
|
4),value:h}},Hb=hb?function(f,h,a){return lb.f(f,h,Sc(1,a))}:function(f,h,a){f[h]=a;return f},xl={}.hasOwnProperty,oa=function(f,h){return xl.call(f,h)},Qa=function(f,h,a){var b=f&Qa.F,c=f&Qa.G,d=f&Qa.S,e=f&Qa.P,g=f&Qa.B,k=f&Qa.W,l=c?qa:qa[h]||(qa[h]={}),n=l.prototype;d=c?ea:d?ea[h]:(ea[h]||{}).prototype;var m;c&&(a=h);for(m in a)if(h=!b&&d&&void 0!==d[m],!h||!oa(l,m)){var r=h?d[m]:a[m];l[m]=c&&"function"!=typeof d[m]?a[m]:g&&h?Na(r,ea):k&&d[m]==r?function(a){var b=function(b,c,d){if(this instanceof
|
||
|
a){switch(arguments.length){case 0:return new a;case 1:return new a(b);case 2:return new a(b,c)}return new a(b,c,d)}return a.apply(this,arguments)};b.prototype=a.prototype;return b}(r):e&&"function"==typeof r?Na(Function.call,r):r;e&&((l.virtual||(l.virtual={}))[m]=r,f&Qa.R&&n&&!n[m]&&Hb(n,m,r))}};Qa.F=1;Qa.G=2;Qa.S=4;Qa.P=8;Qa.B=16;Qa.W=32;Qa.U=64;Qa.R=128;var X=Qa,Tb={},yl={}.toString,mc=function(f){return yl.call(f).slice(8,-1)},Rh=Object("z").propertyIsEnumerable(0)?Object:function(f){return"String"==
|
||
|
mc(f)?f.split(""):Object(f)},xb=function(f){return Rh(Qc(f))},zl=Math.min,Rf=function(f){return 0<f?zl(Qf(f),9007199254740991):0},Al=Math.max,Bl=Math.min,Wd=G(function(f){var h=ea["__core-js_shared__"]||(ea["__core-js_shared__"]={});(f.exports=function(a,b){return h[a]||(h[a]=void 0!==b?b:{})})("versions",[]).push({version:qa.version,mode:"pure",copyright:"\u00a9 2018 Denis Pushkarev (zloirock.ru)"})}),Cl=0,Dl=Math.random(),Ge=function(f){return"Symbol(".concat(void 0===f?"":f,")_",(++Cl+Dl).toString(36))},
|
||
|
Sh=Wd("keys"),Sf=function(f){return Sh[f]||(Sh[f]=Ge(f))},El=function(f){return function(h,a,b){h=xb(h);var c=Rf(h.length);b=Qf(b);b=0>b?Al(b+c,0):Bl(b,c);if(f&&a!=a)for(;c>b;){if(a=h[b++],a!=a)return!0}else for(;c>b;b++)if((f||b in h)&&h[b]===a)return f||b||0;return!f&&-1}}(!1),Fl=Sf("IE_PROTO"),Th=function(f,h){f=xb(f);var a=0,b=[],c;for(c in f)c!=Fl&&oa(f,c)&&b.push(c);for(;h.length>a;)oa(f,c=h[a++])&&(~El(b,c)||b.push(c));return b},He="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),
|
||
|
Ie=Object.keys||function(f){return Th(f,He)},Gl=hb?Object.defineProperties:function(f,h){Ma(f);for(var a=Ie(h),b=a.length,c=0,d;b>c;)lb.f(f,d=a[c++],h[d]);return f},Uh=ea.document,Tf=Uh&&Uh.documentElement,Hl=Sf("IE_PROTO"),Uf=function(){},Je=function(){var f=Fe?Rc.createElement("iframe"):{},h=He.length;f.style.display="none";Tf.appendChild(f);f.src="javascript:";f=f.contentWindow.document;f.open();f.write("<script>document.F=Object\x3c/script>");f.close();for(Je=f.F;h--;)delete Je.prototype[He[h]];
|
||
|
return Je()},Ib=Object.create||function(f,h){if(null!==f){Uf.prototype=Ma(f);var a=new Uf;Uf.prototype=null;a[Hl]=f}else a=Je();return void 0===h?a:Gl(a,h)},Ha=G(function(f){var h=Wd("wks"),a=ea.Symbol,b="function"==typeof a;(f.exports=function(c){return h[c]||(h[c]=b&&a[c]||(b?a:Ge)("Symbol."+c))}).store=h}),Il=lb.f,Vh=Ha("toStringTag"),nc=function(f,h,a){f&&!oa(f=a?f:f.prototype,Vh)&&Il(f,Vh,{configurable:!0,value:h})},Wh={};Hb(Wh,Ha("iterator"),function(){return this});var Jl=function(f,h,a){f.prototype=
|
||
|
Ib(Wh,{next:Sc(1,a)});nc(f,h+" Iterator")},Xh=Sf("IE_PROTO"),Kl=Object.prototype,Nf=Object.getPrototypeOf||function(f){f=Object(Qc(f));return oa(f,Xh)?f[Xh]:"function"==typeof f.constructor&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?Kl:null},Vf=Ha("iterator"),Wf=!([].keys&&"next"in[].keys()),Ll=function(){return this},Xf=function(f,h,a,b,c,d,e){Jl(a,h,b);b=function(b){return!Wf&&b in n?n[b]:function(){return new a(this,b)}};var g=h+" Iterator",k="values"==c,l=!1,n=f.prototype,
|
||
|
m=n[Vf]||n["@@iterator"]||c&&n[c],r=m||b(c),w=c?k?b("entries"):r:void 0,t="Array"==h?n.entries||m:m,p;t&&(f=Nf(t.call(new f)),f!==Object.prototype&&f.next&&nc(f,g,!0));k&&m&&"values"!==m.name&&(l=!0,r=function(){return m.call(this)});e&&(Wf||l||!n[Vf])&&Hb(n,Vf,r);Tb[h]=r;Tb[g]=Ll;if(c){var q={values:k?r:b("values"),keys:d?r:b("keys"),entries:w};if(e)for(p in q)p in n||Hb(n,p,q[p]);else X(X.P+X.F*(Wf||l),h,q)}return q},Ml=function(f){return function(h,a){h=String(Qc(h));a=Qf(a);var b=h.length,c;if(0>
|
||
|
a||a>=b)return f?"":void 0;var d=h.charCodeAt(a);return 55296>d||56319<d||a+1===b||56320>(c=h.charCodeAt(a+1))||57343<c?f?h.charAt(a):d:f?h.slice(a,a+2):(d-55296<<10)+(c-56320)+65536}}(!0);Xf(String,"String",function(f){this._t=String(f);this._i=0},function(){var f=this._t,h=this._i;if(h>=f.length)return{value:void 0,done:!0};f=Ml(f,h);this._i+=f.length;return{value:f,done:!1}});var Ub=function(f,h){return{value:h,done:!!f}};Xf(Array,"Array",function(f,h){this._t=xb(f);this._i=0;this._k=h},function(){var f=
|
||
|
this._t,h=this._k,a=this._i++;return!f||a>=f.length?(this._t=void 0,Ub(1)):"keys"==h?Ub(0,a):"values"==h?Ub(0,f[a]):Ub(0,[a,f[a]])},"values");Tb.Arguments=Tb.Array;for(var Yh=Ha("toStringTag"),Zh="CSSRuleList CSSStyleDeclaration CSSValueList ClientRectList DOMRectList DOMStringList DOMTokenList DataTransferItemList FileList HTMLAllCollection HTMLCollection HTMLFormElement HTMLSelectElement MediaList MimeTypeArray NamedNodeMap NodeList PaintRequestList Plugin PluginArray SVGLengthList SVGNumberList SVGPathSegList SVGPointList SVGStringList SVGTransformList SourceBufferList StyleSheetList TextTrackCueList TextTrackList TouchList".split(" "),
|
||
|
Yf=0;Yf<Zh.length;Yf++){var Zf=Zh[Yf],$h=ea[Zf],$f=$h&&$h.prototype;$f&&!$f[Yh]&&Hb($f,Yh,Zf);Tb[Zf]=Tb.Array}var Nl=Ha("toStringTag"),Ol="Arguments"==mc(function(){return arguments}()),ag=function(f){var h;if(void 0===f)var a="Undefined";else{if(null===f)var b="Null";else{a:{var c=f=Object(f);try{b=c[Nl];break a}catch(d){}b=void 0}b="string"==typeof(a=b)?a:Ol?mc(f):"Object"==(h=mc(f))&&"function"==typeof f.callee?"Arguments":h}a=b}return a},Ke=function(f,h,a,b){if(!(f instanceof h)||void 0!==b&&
|
||
|
b in f)throw TypeError(a+": incorrect invocation!");return f},Pl=function(f,h,a,b){try{return b?h(Ma(a)[0],a[1]):h(a)}catch(c){throw h=f["return"],void 0!==h&&Ma(h.call(f)),c;}},Ql=Ha("iterator"),Rl=Array.prototype,Sl=Ha("iterator"),ai=qa.getIteratorMethod=function(f){if(void 0!=f)return f[Sl]||f["@@iterator"]||Tb[ag(f)]},oc=G(function(f){var h={},a={};f=f.exports=function(b,c,d,e,f){f=f?function(){return b}:ai(b);d=Na(d,e,c?2:1);e=0;var g,l;if("function"!=typeof f)throw TypeError(b+" is not iterable!");
|
||
|
if(void 0===f||Tb.Array!==f&&Rl[Ql]!==f)for(e=f.call(b);!(l=e.next()).done;){if(f=Pl(e,d,l.value,c),f===h||f===a)return f}else for(g=Rf(b.length);g>e;e++)if(f=c?d(Ma(l=b[e])[0],l[1]):d(b[e]),f===h||f===a)return f};f.BREAK=h;f.RETURN=a}),Tl=Ha("species"),bi=function(f,h){f=Ma(f).constructor;var a;return void 0===f||void 0==(a=Ma(f)[Tl])?h:ob(a)},ci=function(f,h,a){var b=void 0===a;switch(h.length){case 0:return b?f():f.call(a);case 1:return b?f(h[0]):f.call(a,h[0]);case 2:return b?f(h[0],h[1]):f.call(a,
|
||
|
h[0],h[1]);case 3:return b?f(h[0],h[1],h[2]):f.call(a,h[0],h[1],h[2]);case 4:return b?f(h[0],h[1],h[2],h[3]):f.call(a,h[0],h[1],h[2],h[3])}return f.apply(a,h)},di=ea.process,bg=ea.setImmediate,ei=ea.clearImmediate,fi=ea.MessageChannel,cg=ea.Dispatch,dg=0,Xd={},Yd=function(){var f=+this;if(Xd.hasOwnProperty(f)){var h=Xd[f];delete Xd[f];h()}},gi=function(f){Yd.call(f.data)};if(!bg||!ei)if(bg=function(f){for(var h=[],a=1;arguments.length>a;)h.push(arguments[a++]);Xd[++dg]=function(){ci("function"==typeof f?
|
||
|
f:Function(f),h)};Zd(dg);return dg},ei=function(f){delete Xd[f]},"process"==mc(di))var Zd=function(f){di.nextTick(Na(Yd,f,1))};else if(cg&&cg.now)Zd=function(f){cg.now(Na(Yd,f,1))};else if(fi){var hi=new fi;var ii=hi.port2;hi.port1.onmessage=gi;Zd=Na(ii.postMessage,ii,1)}else ea.addEventListener&&"function"==typeof postMessage&&!ea.importScripts?(Zd=function(f){ea.postMessage(f+"","*")},ea.addEventListener("message",gi,!1)):Zd="onreadystatechange"in(Fe?Rc.createElement("script"):{})?function(f){Tf.appendChild(Fe?
|
||
|
Rc.createElement("script"):{}).onreadystatechange=function(){Tf.removeChild(this);Yd.call(f)}}:function(f){setTimeout(Na(Yd,f,1),0)};var eg=bg,ji=ea.MutationObserver||ea.WebKitMutationObserver,fg=ea.process,gg=ea.Promise,ki="process"==mc(fg),Le={f:function(f){return new ba(f)}},Me=function(f){try{return{e:!1,v:f()}}catch(h){return{e:!0,v:h}}},li=ea.navigator,Ul=li&&li.userAgent||"",hg=function(f,h){Ma(f);if(Ga(h)&&h.constructor===f)return h;f=Le.f(f);var a=f.resolve;a(h);return f.promise},ig=function(f,
|
||
|
h,a){for(var b in h)a&&f[b]?f[b]=h[b]:Hb(f,b,h[b]);return f},mi=Ha("species"),ni=function(f){f="function"==typeof qa[f]?qa[f]:ea[f];hb&&f&&!f[mi]&&lb.f(f,mi,{configurable:!0,get:function(){return this}})},jg=Ha("iterator"),oi=!1;try{[7][jg]()["return"]=function(){oi=!0}}catch(f){}var Vl=function(f,h){if(!h&&!oi)return!1;var a=!1;try{h=[7];var b=h[jg]();b.next=function(){return{done:a=!0}};h[jg]=function(){return b};f(h)}catch(c){}return a},pi=function(){var f,h,a=function(){var a;for(ki&&(a=fg.domain)&&
|
||
|
a.exit();f;){var c=f.fn;f=f.next;try{c()}catch(l){throw f?b():h=void 0,l;}}h=void 0;a&&a.enter()};if(ki)var b=function(){fg.nextTick(a)};else if(!ji||ea.navigator&&ea.navigator.standalone)if(gg&&gg.resolve){var c=gg.resolve(void 0);b=function(){c.then(a)}}else b=function(){eg.call(ea,a)};else{var d=!0,e=document.createTextNode("");(new ji(a)).observe(e,{characterData:!0});b=function(){e.data=d=!d}}return function(a){a={fn:a,next:void 0};h&&(h.next=a);f||(f=a,b());h=a}}(),qi=ea.TypeError,Tc=ea.process,
|
||
|
ri=Tc&&Tc.versions,Wl=ri&&ri.v8||"",yb=ea.Promise,$d="process"==ag(Tc),Ne=function(){},si,ae=si=Le.f,Oe=!!function(){try{var f=yb.resolve(1),h=(f.constructor={})[Ha("species")]=function(a){a(Ne,Ne)};return($d||"function"==typeof PromiseRejectionEvent)&&f.then(Ne)instanceof h&&0!==Wl.indexOf("6.6")&&-1===Ul.indexOf("Chrome/66")}catch(a){}}(),ti=function(f){var h;return Ga(f)&&"function"==typeof(h=f.then)?h:!1},kg=function(f,h){if(!f._n){f._n=!0;var a=f._c;pi(function(){for(var b=f._v,c=1==f._s,d=0;a.length>
|
||
|
d;){var e=void 0,g=void 0,k=void 0,l=a[d++],n=c?l.ok:l.fail,m=l.resolve,r=l.reject,w=l.domain;try{n?(c||(2==f._h&&Xl(f),f._h=1),!0===n?k=b:(w&&w.enter(),k=n(b),w&&(w.exit(),e=!0)),k===l.promise?r(qi("Promise-chain cycle")):(g=ti(k))?g.call(k,m,r):m(k)):r(b)}catch(t){w&&!e&&w.exit(),r(t)}}f._c=[];f._n=!1;h&&!f._h&&Yl(f)})}},Yl=function(f){eg.call(ea,function(){var h=f._v,a=1!==f._h&&0===(f._a||f._c).length,b,c;if(a){var d=Me(function(){$d?Tc.emit("unhandledRejection",h,f):(b=ea.onunhandledrejection)?
|
||
|
b({promise:f,reason:h}):(c=ea.console)&&c.error&&c.error("Unhandled promise rejection",h)});f._h=$d||1!==f._h&&0===(f._a||f._c).length?2:1}f._a=void 0;if(a&&d.e)throw d.v;})},Xl=function(f){eg.call(ea,function(){var h;$d?Tc.emit("rejectionHandled",f):(h=ea.onrejectionhandled)&&h({promise:f,reason:f._v})})},Uc=function(f){var h=this;h._d||(h._d=!0,h=h._w||h,h._v=f,h._s=2,h._a||(h._a=h._c.slice()),kg(h,!0))},lg=function(f){var h=this,a;if(!h._d){h._d=!0;h=h._w||h;try{if(h===f)throw qi("Promise can't be resolved itself");
|
||
|
(a=ti(f))?pi(function(){var b={_w:h,_d:!1};try{a.call(f,Na(lg,b,1),Na(Uc,b,1))}catch(c){Uc.call(b,c)}}):(h._v=f,h._s=1,kg(h,!1))}catch(b){Uc.call({_w:h,_d:!1},b)}}};if(!Oe){yb=function(f){Ke(this,yb,"Promise","_h");ob(f);mg.call(this);try{f(Na(lg,this,1),Na(Uc,this,1))}catch(h){Uc.call(this,h)}};var mg=function(f){this._c=[];this._a=void 0;this._s=0;this._d=!1;this._v=void 0;this._h=0;this._n=!1};mg.prototype=ig(yb.prototype,{then:function(f,h){var a=ae(bi(this,yb));a.ok="function"==typeof f?f:!0;
|
||
|
a.fail="function"==typeof h&&h;a.domain=$d?Tc.domain:void 0;this._c.push(a);this._a&&this._a.push(a);this._s&&kg(this,!1);return a.promise},"catch":function(f){return this.then(void 0,f)}});var Zl=function(){var f=new mg;this.promise=f;this.resolve=Na(lg,f,1);this.reject=Na(Uc,f,1)};Le.f=ae=function(f){return f===yb||f===ui?new Zl(f):si(f)}}X(X.G+X.W+X.F*!Oe,{Promise:yb});nc(yb,"Promise");ni("Promise");var ui=qa.Promise;X(X.S+X.F*!Oe,"Promise",{reject:function(f){var h=ae(this),a=h.reject;a(f);return h.promise}});
|
||
|
X(X.S+1*X.F,"Promise",{resolve:function(f){return hg(this===ui?yb:this,f)}});X(X.S+X.F*!(Oe&&Vl(function(f){yb.all(f)["catch"](Ne)})),"Promise",{all:function(f){var h=this,a=ae(h),b=a.resolve,c=a.reject,d=Me(function(){var a=[],d=0,k=1;oc(f,!1,function(e){var f=d++,g=!1;a.push(void 0);k++;h.resolve(e).then(function(c){g||(g=!0,a[f]=c,--k||b(a))},c)});--k||b(a)});d.e&&c(d.v);return a.promise},race:function(f){var h=this,a=ae(h),b=a.reject,c=Me(function(){oc(f,!1,function(c){h.resolve(c).then(a.resolve,
|
||
|
b)})});c.e&&b(c.v);return a.promise}});X(X.P+X.R,"Promise",{"finally":function(f){var h=bi(this,qa.Promise||ea.Promise),a="function"==typeof f;return this.then(a?function(a){return hg(h,f()).then(function(){return a})}:f,a?function(a){return hg(h,f()).then(function(){throw a;})}:f)}});X(X.S,"Promise",{"try":function(f){var h=Le.f(this);f=Me(f);(f.e?h.reject:h.resolve)(f.v);return h.promise}});var vi=qa.Promise,Pe=function(f){return function(){var h=this,a=arguments;return new vi(function(b,c){function d(a,
|
||
|
d){try{var f=k[a](d),h=f.value}catch(w){c(w);return}f.done?b(h):vi.resolve(h).then(e,g)}function e(a){d("next",a)}function g(a){d("throw",a)}var k=f.apply(h,a);e()})}},ng={}.propertyIsEnumerable,wi=Object.getOwnPropertyDescriptor,Ud={f:hb?wi:function(f,h){f=xb(f);h=Vd(h,!0);if(Qh)try{return wi(f,h)}catch(a){}if(oa(f,h))return Sc(!ng.call(f,h),f[h])}},og=function(f,h){var a=(qa.Object||{})[f]||Object[f],b={};b[f]=h(a);X(X.S+X.F*Gb(function(){a(1)}),"Object",b)},$l=Ud.f;og("getOwnPropertyDescriptor",
|
||
|
function(){return function(f,h){return $l(xb(f),h)}});var xi=qa.Object,pg=G(function(f){var h=Ge("meta"),a=lb.f,b=0,c=Object.isExtensible||function(){return!0},d=!Gb(function(){return c(Object.preventExtensions({}))}),e=function(c){a(c,h,{value:{i:"O"+ ++b,w:{}}})},g=f.exports={KEY:h,NEED:!1,fastKey:function(a,b){if(!Ga(a))return"symbol"==typeof a?a:("string"==typeof a?"S":"P")+a;if(!oa(a,h)){if(!c(a))return"F";if(!b)return"E";e(a)}return a[h].i},getWeak:function(a,b){if(!oa(a,h)){if(!c(a))return!0;
|
||
|
if(!b)return!1;e(a)}return a[h].w},onFreeze:function(a){d&&g.NEED&&c(a)&&!oa(a,h)&&e(a);return a}}}),qg={f:Ha},am=lb.f,rg=function(f){var h=qa.Symbol||(qa.Symbol={});"_"==f.charAt(0)||f in h||am(h,f,{value:qg.f(f)})},yi=Object.getOwnPropertySymbols,sg=Array.isArray||function(f){return"Array"==mc(f)},bm=He.concat("length","prototype"),zi=Object.getOwnPropertyNames||function(f){return Th(f,bm)},Ai=zi,cm={}.toString,Bi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):
|
||
|
[],Ci=function(f){if(Bi&&"[object Window]"==cm.call(f))try{var h=Ai(f)}catch(a){h=Bi.slice()}else h=Ai(xb(f));return h},dm=pg.KEY,Di=Ud.f,pc=lb.f,Ei=Ci,Xa=ea.Symbol,Qe=ea.JSON,Re=Qe&&Qe.stringify,Ya=Ha("_hidden"),Fi=Ha("toPrimitive"),em={}.propertyIsEnumerable,be=Wd("symbol-registry"),Jb=Wd("symbols"),ce=Wd("op-symbols"),mb=Object.prototype,Vc="function"==typeof Xa,tg=ea.QObject,ug=!tg||!tg.prototype||!tg.prototype.findChild,vg=hb&&Gb(function(){return 7!=Ib(pc({},"a",{get:function(){return pc(this,
|
||
|
"a",{value:7}).a}})).a})?function(f,h,a){var b=Di(mb,h);b&&delete mb[h];pc(f,h,a);b&&f!==mb&&pc(mb,h,b)}:pc,Gi=function(f){var h=Jb[f]=Ib(Xa.prototype);h._k=f;return h},wg=Vc&&"symbol"==typeof Xa.iterator?function(f){return"symbol"==typeof f}:function(f){return f instanceof Xa},Se=function(f,h,a){f===mb&&Se(ce,h,a);Ma(f);h=Vd(h,!0);Ma(a);return oa(Jb,h)?(a.enumerable?(oa(f,Ya)&&f[Ya][h]&&(f[Ya][h]=!1),a=Ib(a,{enumerable:Sc(0,!1)})):(oa(f,Ya)||pc(f,Ya,Sc(1,{})),f[Ya][h]=!0),vg(f,h,a)):pc(f,h,a)},Hi=
|
||
|
function(f,h){Ma(f);var a=h=xb(h),b=Ie(a),c=yi;if(c){c=c(a);for(var d=ng,e=0,g;c.length>e;)d.call(a,g=c[e++])&&b.push(g)}a=0;g=b.length;for(var k;g>a;)Se(f,k=b[a++],h[k]);return f},fm=function(f){var h=em.call(this,f=Vd(f,!0));return this===mb&&oa(Jb,f)&&!oa(ce,f)?!1:h||!oa(this,f)||!oa(Jb,f)||oa(this,Ya)&&this[Ya][f]?h:!0},Ii=function(f,h){f=xb(f);h=Vd(h,!0);if(f!==mb||!oa(Jb,h)||oa(ce,h)){var a=Di(f,h);!a||!oa(Jb,h)||oa(f,Ya)&&f[Ya][h]||(a.enumerable=!0);return a}},Ji=function(f){f=Ei(xb(f));for(var h=
|
||
|
[],a=0,b;f.length>a;)oa(Jb,b=f[a++])||b==Ya||b==dm||h.push(b);return h},Ki=function(f){var h=f===mb;f=Ei(h?ce:xb(f));for(var a=[],b=0,c;f.length>b;)oa(Jb,c=f[b++])&&(h?oa(mb,c):1)&&a.push(Jb[c]);return a};Vc||(Xa=function(){if(this instanceof Xa)throw TypeError("Symbol is not a constructor!");var f=Ge(0<arguments.length?arguments[0]:void 0),h=function(a){this===mb&&h.call(ce,a);oa(this,Ya)&&oa(this[Ya],f)&&(this[Ya][f]=!1);vg(this,f,Sc(1,a))};hb&&ug&&vg(mb,f,{configurable:!0,set:h});return Gi(f)},
|
||
|
Hb(Xa.prototype,"toString",function(){return this._k}),Ud.f=Ii,lb.f=Se,zi=Ci=Ji,ng=fm,yi=Ki,qg.f=function(f){return Gi(Ha(f))});X(X.G+X.W+X.F*!Vc,{Symbol:Xa});for(var Li="hasInstance isConcatSpreadable iterator match replace search species split toPrimitive toStringTag unscopables".split(" "),Mi=0;Li.length>Mi;)Ha(Li[Mi++]);for(var Ni=Ie(Ha.store),Oi=0;Ni.length>Oi;)rg(Ni[Oi++]);X(X.S+X.F*!Vc,"Symbol",{"for":function(f){return oa(be,f+="")?be[f]:be[f]=Xa(f)},keyFor:function(f){if(!wg(f))throw TypeError(f+
|
||
|
" is not a symbol!");for(var h in be)if(be[h]===f)return h},useSetter:function(){ug=!0},useSimple:function(){ug=!1}});X(X.S+X.F*!Vc,"Object",{create:function(f,h){return void 0===h?Ib(f):Hi(Ib(f),h)},defineProperty:Se,defineProperties:Hi,getOwnPropertyDescriptor:Ii,getOwnPropertyNames:Ji,getOwnPropertySymbols:Ki});Qe&&X(X.S+X.F*(!Vc||Gb(function(){var f=Xa();return"[null]"!=Re([f])||"{}"!=Re({a:f})||"{}"!=Re(Object(f))})),"JSON",{stringify:function(f){for(var h=[f],a=1,b;arguments.length>a;)h.push(arguments[a++]);
|
||
|
b=a=h[1];if((Ga(a)||void 0!==f)&&!wg(f))return sg(a)||(a=function(a,d){"function"==typeof b&&(d=b.call(this,a,d));if(!wg(d))return d}),h[1]=a,Re.apply(Qe,h)}});Xa.prototype[Fi]||Hb(Xa.prototype,Fi,Xa.prototype.valueOf);nc(Xa,"Symbol");nc(Math,"Math",!0);nc(ea.JSON,"JSON",!0);var Pi=qa.Object.getOwnPropertySymbols;og("keys",function(){return function(f){return Ie(Object(Qc(f)))}});var gm=qa.Object.keys;X(X.S+X.F*!hb,"Object",{defineProperty:lb.f});var Mg=qa.Object,L=function(f,h,a){h in f?Mg.defineProperty(f,
|
||
|
h,{value:a,enumerable:!0,configurable:!0,writable:!0}):f[h]=a;return f},Y=function(f){for(var h=1;h<arguments.length;h++){var a=null!=arguments[h]?arguments[h]:{},b=gm(a);"function"===typeof Pi&&(b=b.concat(Pi(a).filter(function(b){return xi.getOwnPropertyDescriptor(a,b).enumerable})));b.forEach(function(b){L(f,b,a[b])})}return f},F=function(f,h){if(!(f instanceof h))throw new TypeError("Cannot call a class as a function");},hm=Object.setPrototypeOf||("__proto__"in{}?function(f,h,a){try{a=Na(Function.call,
|
||
|
Ud.f(Object.prototype,"__proto__").set,2),a(f,[]),h=!(f instanceof Array)}catch(b){h=!0}return function(b,c){Ma(b);if(!Ga(c)&&null!==c)throw TypeError(c+": can't set as prototype!");h?b.__proto__=c:a(b,c);return b}}({},!1):void 0);X(X.S,"Object",{setPrototypeOf:hm});var im=qa.Object.setPrototypeOf,de=G(function(f){function h(a,b){f.exports=h=im||function(a,b){a.__proto__=b;return a};return h(a,b)}f.exports=h}),H=function(f,h){if("function"!==typeof h&&null!==h)throw new TypeError("Super expression must either be null or a function");
|
||
|
de(f.prototype,h&&h.prototype);h&&de(f,h)},z=function(f,h,a){h&&ka(f.prototype,h);a&&ka(f,a);return f},Qi=qg.f("iterator");rg("asyncIterator");rg("observable");var Vb=qa.Symbol,jm=G(function(f){function h(a){h="function"===typeof Vb&&"symbol"===typeof Qi?function(a){return typeof a}:function(a){return a&&"function"===typeof Vb&&a.constructor===Vb&&a!==Vb.prototype?"symbol":typeof a};return h(a)}function a(b){"function"===typeof Vb&&"symbol"===h(Qi)?f.exports=a=function(a){return h(a)}:f.exports=a=
|
||
|
function(a){return a&&"function"===typeof Vb&&a.constructor===Vb&&a!==Vb.prototype?"symbol":h(a)};return a(b)}f.exports=a}),aa=function(f){if(void 0===f)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f},N=function(f,h){return!h||"object"!==jm(h)&&"function"!==typeof h?aa(f):h};og("getPrototypeOf",function(){return function(f){return Nf(Object(Qc(f)))}});var km=qa.Object.getPrototypeOf,D=G(function(f){function h(a){f.exports=h=km||function(a){return a.__proto__};
|
||
|
return h(a)}f.exports=h}),xg=function a(h){for(var b=arguments.length,c=Array(1<b?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];for(b=0;b<c.length;b++)if(d=c[b]){var e=!0,g=!1,k=void 0;try{$jscomp.initSymbol();$jscomp.initSymbolIterator();for(var l=Object.getOwnPropertyNames(d)[Symbol.iterator](),n;!(e=(n=l.next()).done);e=!0){var m=n.value;void 0!==h[m]&&d[m]&&"[object Object]"===h[m].toString()&&"[object Object]"===d[m].toString()?h[m].constructor===Object&&a(h[m],d[m]):h[m]="undefined"===typeof h[m]?
|
||
|
d[m]:h[m];"undefined"===typeof h[m]&&Array.isArray(d[m])?h[m]=d[m].slice():"undefined"===typeof h[m]&&Array.isArray(d[m])&&(h[m]=d[m])}}catch(r){g=!0,k=r}finally{try{e||null==l.return||l.return()}finally{if(g)throw k;}}}return h},Ri=function(h,a){for(var b={},c=0,d=a.length;c<d;c++)b[a[c]]=h[c];return b},Si=function c(a,b){for(var d in b)Array.isArray(a[d])?a[d]=Ri(a[d],b[d]):a[d]instanceof Object&&!Array.isArray(b[d])&&(a[d]=c(a[d],b[d]));return a};void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,
|
||
|
-52));void 0===Number.isInteger&&(Number.isInteger=function(a){return"number"===typeof a&&isFinite(a)&&Math.floor(a)===a});void 0===Math.sign&&(Math.sign=function(a){return 0>a?-1:0<a?1:+a});!1==="name"in Function.prototype&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}});void 0===Object.assign&&function(){Object.assign=function(a){if(void 0===a||null===a)throw new TypeError("Cannot convert undefined or null to object");
|
||
|
for(var b=Object(a),c=1;c<arguments.length;c++){var d=arguments[c];if(void 0!==d&&null!==d)for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&(b[e]=d[e])}return b}}();Object.assign(K.prototype,{addEventListener:function(a,b){void 0===this._listeners&&(this._listeners={});var c=this._listeners;void 0===c[a]&&(c[a]=[]);-1===c[a].indexOf(b)&&c[a].push(b)},hasEventListener:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)},removeEventListener:function(a,
|
||
|
b){void 0!==this._listeners&&(a=this._listeners[a],void 0!==a&&(b=a.indexOf(b),-1!==b&&a.splice(b,1)))},dispatchEvent:function(a){if(void 0!==this._listeners){var b=this._listeners[a.type];if(void 0!==b){a.target=this;b=b.slice(0);for(var c=0,d=b.length;c<d;c++)b[c].call(this,a)}}}});var ja={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var a=[],b=0;256>b;b++)a[b]=(16>b?"0":"")+b.toString(16);return function(){var b=4294967295*Math.random()|0,d=4294967295*Math.random()|0,e=4294967295*
|
||
|
Math.random()|0,g=4294967295*Math.random()|0;return(a[b&255]+a[b>>8&255]+a[b>>16&255]+a[b>>24&255]+"-"+a[d&255]+a[d>>8&255]+"-"+a[d>>16&15|64]+a[d>>24&255]+"-"+a[e&63|128]+a[e>>8&255]+"-"+a[e>>16&255]+a[e>>24&255]+a[g&255]+a[g>>8&255]+a[g>>16&255]+a[g>>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*ja.DEG2RAD},radToDeg:function(a){return a*ja.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(x.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(x.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(){var a=new x,b=new x;return function(c,d){a.set(c,c);b.set(d,d);return this.clamp(a,b)}}(),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},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(V.prototype,{isMatrix4:!0,set:function(a,b,c,d,e,g,k,l,n,m,r,w,t,p,q,y){var u=this.elements;u[0]=a;u[4]=b;u[8]=c;u[12]=d;u[1]=e;u[5]=g;u[9]=k;u[13]=l;u[2]=n;u[6]=m;u[10]=r;u[14]=w;u[3]=t;u[7]=p;u[11]=q;u[15]=y;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 V).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(){var a=new p;return function(b){var c=this.elements,d=b.elements,e=1/a.setFromMatrixColumn(b,0).length(),g=1/a.setFromMatrixColumn(b,1).length();b=1/a.setFromMatrixColumn(b,2).length();c[0]=d[0]*e;c[1]=d[1]*e;c[2]=d[2]*e;c[4]=d[4]*g;c[5]=d[5]*g;c[6]=d[6]*g;c[8]=d[8]*b;c[9]=d[9]*b;c[10]=d[10]*b;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,g=Math.cos(c);c=Math.sin(c);var k=Math.cos(d);d=Math.sin(d);var l=Math.cos(e);e=Math.sin(e);if("XYZ"===a.order){a=g*l;var n=g*e,m=c*l,r=c*e;b[0]=k*l;b[4]=-k*e;b[8]=d;b[1]=n+m*d;b[5]=a-r*d;b[9]=-c*k;b[2]=r-a*d;b[6]=m+n*d;b[10]=g*k}else"YXZ"===a.order?(a=k*l,n=k*e,m=d*l,r=d*e,b[0]=a+r*c,b[4]=m*c-n,b[8]=g*d,b[1]=g*e,b[5]=g*l,b[9]=-c,b[2]=n*c-m,b[6]=r+a*c,b[10]=g*k):"ZXY"===a.order?(a=k*l,n=k*e,m=d*l,r=d*e,b[0]=a-r*c,b[4]=-g*e,b[8]=m+n*c,b[1]=n+m*c,b[5]=g*l,b[9]=
|
||
|
r-a*c,b[2]=-g*d,b[6]=c,b[10]=g*k):"ZYX"===a.order?(a=g*l,n=g*e,m=c*l,r=c*e,b[0]=k*l,b[4]=m*d-n,b[8]=a*d+r,b[1]=k*e,b[5]=r*d+a,b[9]=n*d-m,b[2]=-d,b[6]=c*k,b[10]=g*k):"YZX"===a.order?(a=g*k,n=g*d,m=c*k,r=c*d,b[0]=k*l,b[4]=r-a*e,b[8]=m*e+n,b[1]=e,b[5]=g*l,b[9]=-c*l,b[2]=-d*l,b[6]=n*e+m,b[10]=a-r*e):"XZY"===a.order&&(a=g*k,n=g*d,m=c*k,r=c*d,b[0]=k*l,b[4]=-e,b[8]=d*l,b[1]=a*e+r,b[5]=g*l,b[9]=n*e-m,b[2]=m*e-n,b[6]=c*l,b[10]=r*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){var b=
|
||
|
this.elements,c=a._x,d=a._y,e=a._z,g=a._w,k=c+c,l=d+d,n=e+e;a=c*k;var m=c*l;c*=n;var r=d*l;d*=n;e*=n;k*=g;l*=g;g*=n;b[0]=1-(r+e);b[4]=m-g;b[8]=c+l;b[1]=m+g;b[5]=1-(a+e);b[9]=d-k;b[2]=c-l;b[6]=d+k;b[10]=1-(a+r);b[3]=0;b[7]=0;b[11]=0;b[12]=0;b[13]=0;b[14]=0;b[15]=1;return this},lookAt:function(){var a=new p,b=new p,c=new p;return function(d,e,g){var k=this.elements;c.subVectors(d,e);0===c.lengthSq()&&(c.z=1);c.normalize();a.crossVectors(g,c);0===a.lengthSq()&&(1===Math.abs(g.z)?c.x+=1E-4:c.z+=1E-4,
|
||
|
c.normalize(),a.crossVectors(g,c));a.normalize();b.crossVectors(c,a);k[0]=a.x;k[4]=b.x;k[8]=c.x;k[1]=a.y;k[5]=b.y;k[9]=c.y;k[2]=a.z;k[6]=b.z;k[10]=c.z;return this}}(),multiply:function(a,b){return void 0!==b?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(a,b)):this.multiplyMatrices(this,a)},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],g=c[8],k=c[12],l=c[1],n=c[5],m=c[9],r=c[13],w=c[2],t=c[6],p=c[10],q=c[14],y=c[3],A=c[7],C=c[11];c=c[15];var E=d[0],x=d[4],Q=d[8],I=d[12],z=d[1],B=d[5],F=d[9],D=d[13],G=d[2],H=d[6],N=d[10],J=d[14],L=d[3],K=d[7],U=d[11];d=d[15];b[0]=a*E+e*z+g*G+k*L;b[4]=a*x+e*B+g*H+k*K;b[8]=a*Q+e*F+g*N+k*U;b[12]=a*I+e*D+g*J+k*d;b[1]=l*E+n*z+m*G+r*L;b[5]=l*x+n*B+m*H+r*K;b[9]=l*Q+n*F+m*N+r*U;b[13]=l*I+n*D+m*J+r*d;b[2]=w*E+t*z+p*G+q*L;b[6]=w*x+t*B+p*H+q*K;b[10]=w*Q+t*F+p*N+q*U;b[14]=w*
|
||
|
I+t*D+p*J+q*d;b[3]=y*E+A*z+C*G+c*L;b[7]=y*x+A*B+C*H+c*K;b[11]=y*Q+A*F+C*N+c*U;b[15]=y*I+A*D+C*J+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(){var a=new p;return function(b){for(var c=0,d=b.count;c<d;c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix4(this),b.setXYZ(c,a.x,a.y,a.z);return b}}(),
|
||
|
determinant:function(){var a=this.elements,b=a[0],c=a[4],d=a[8],e=a[12],g=a[1],k=a[5],l=a[9],n=a[13],m=a[2],r=a[6],w=a[10],t=a[14];return a[3]*(+e*l*r-d*n*r-e*k*w+c*n*w+d*k*t-c*l*t)+a[7]*(+b*l*t-b*n*w+e*g*w-d*g*t+d*n*m-e*l*m)+a[11]*(+b*n*r-b*k*t-e*g*r+c*g*t+e*k*m-c*n*m)+a[15]*(-d*k*m-b*l*r+b*k*w+d*g*r-c*g*w+c*l*m)},transpose:function(){var a=this.elements;var b=a[1];a[1]=a[4];a[4]=b;b=a[2];a[2]=a[8];a[8]=b;b=a[6];a[6]=a[9];a[9]=b;b=a[3];a[3]=a[12];a[12]=b;b=a[7];a[7]=a[13];a[13]=b;b=a[11];a[11]=a[14];
|
||
|
a[14]=b;return this},setPosition:function(a){var b=this.elements;b[12]=a.x;b[13]=a.y;b[14]=a.z;return this},getInverse:function(a,b){var c=this.elements,d=a.elements;a=d[0];var e=d[1],g=d[2],k=d[3],l=d[4],n=d[5],m=d[6],r=d[7],w=d[8],t=d[9],p=d[10],q=d[11],y=d[12],A=d[13],C=d[14];d=d[15];var E=t*C*r-A*p*r+A*m*q-n*C*q-t*m*d+n*p*d,x=y*p*r-w*C*r-y*m*q+l*C*q+w*m*d-l*p*d,Q=w*A*r-y*t*r+y*n*q-l*A*q-w*n*d+l*t*d,I=y*t*m-w*A*m-y*n*p+l*A*p+w*n*C-l*t*C,z=a*E+e*x+g*Q+k*I;if(0===z){if(!0===b)throw Error("THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0");
|
||
|
console.warn("THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0");return this.identity()}b=1/z;c[0]=E*b;c[1]=(A*p*k-t*C*k-A*g*q+e*C*q+t*g*d-e*p*d)*b;c[2]=(n*C*k-A*m*k+A*g*r-e*C*r-n*g*d+e*m*d)*b;c[3]=(t*m*k-n*p*k-t*g*r+e*p*r+n*g*q-e*m*q)*b;c[4]=x*b;c[5]=(w*C*k-y*p*k+y*g*q-a*C*q-w*g*d+a*p*d)*b;c[6]=(y*m*k-l*C*k-y*g*r+a*C*r+l*g*d-a*m*d)*b;c[7]=(l*p*k-w*m*k+w*g*r-a*p*r-l*g*q+a*m*q)*b;c[8]=Q*b;c[9]=(y*t*k-w*A*k-y*e*q+a*A*q+w*e*d-a*t*d)*b;c[10]=(l*A*k-y*n*k+y*e*r-a*A*r-l*e*d+a*n*d)*b;c[11]=
|
||
|
(w*n*k-l*t*k-w*e*r+a*t*r+l*e*q-a*n*q)*b;c[12]=I*b;c[13]=(w*A*g-y*t*g+y*e*p-a*A*p-w*e*C+a*t*C)*b;c[14]=(y*n*g-l*A*g-y*e*m+a*A*m+l*e*C-a*n*C)*b;c[15]=(l*t*g-w*n*g+w*e*m-a*t*m-l*e*p+a*n*p)*b;return this},scale:function(a){var b=this.elements,c=a.x,d=a.y;a=a.z;b[0]*=c;b[4]*=d;b[8]*=a;b[1]*=c;b[5]*=d;b[9]*=a;b[2]*=c;b[6]*=d;b[10]*=a;b[3]*=c;b[7]*=d;b[11]*=a;return this},getMaxScaleOnAxis:function(){var a=this.elements;return Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1]+a[2]*a[2],a[4]*a[4]+a[5]*a[5]+a[6]*a[6],
|
||
|
a[8]*a[8]+a[9]*a[9]+a[10]*a[10]))},makeTranslation:function(a,b,c){this.set(1,0,0,a,0,1,0,b,0,0,1,c,0,0,0,1);return this},makeRotationX:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(1,0,0,0,0,b,-a,0,0,a,b,0,0,0,0,1);return this},makeRotationY:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,0,a,0,0,1,0,0,-a,0,b,0,0,0,0,1);return this},makeRotationZ:function(a){var b=Math.cos(a);a=Math.sin(a);this.set(b,-a,0,0,a,b,0,0,0,0,1,0,0,0,0,1);return this},makeRotationAxis:function(a,b){var c=
|
||
|
Math.cos(b);b=Math.sin(b);var d=1-c,e=a.x,g=a.y;a=a.z;var k=d*e,l=d*g;this.set(k*e+c,k*g-b*a,k*a+b*g,0,k*g+b*a,l*g+c,l*a-b*e,0,k*a-b*g,l*a+b*e,d*a*a+c,0,0,0,0,1);return this},makeScale:function(a,b,c){this.set(a,0,0,0,0,b,0,0,0,0,c,0,0,0,0,1);return this},makeShear:function(a,b,c){this.set(1,b,c,0,a,1,c,0,a,b,1,0,0,0,0,1);return this},compose:function(a,b,c){this.makeRotationFromQuaternion(b);this.scale(c);this.setPosition(a);return this},decompose:function(){var a=new p,b=new V;return function(c,
|
||
|
d,e){var g=this.elements,k=a.set(g[0],g[1],g[2]).length(),l=a.set(g[4],g[5],g[6]).length(),n=a.set(g[8],g[9],g[10]).length();0>this.determinant()&&(k=-k);c.x=g[12];c.y=g[13];c.z=g[14];b.copy(this);c=1/k;g=1/l;var m=1/n;b.elements[0]*=c;b.elements[1]*=c;b.elements[2]*=c;b.elements[4]*=g;b.elements[5]*=g;b.elements[6]*=g;b.elements[8]*=m;b.elements[9]*=m;b.elements[10]*=m;d.setFromRotationMatrix(b);e.x=k;e.y=l;e.z=n;return this}}(),makePerspective:function(a,b,c,d,e,g){void 0===g&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");
|
||
|
var k=this.elements;k[0]=2*e/(b-a);k[4]=0;k[8]=(b+a)/(b-a);k[12]=0;k[1]=0;k[5]=2*e/(c-d);k[9]=(c+d)/(c-d);k[13]=0;k[2]=0;k[6]=0;k[10]=-(g+e)/(g-e);k[14]=-2*g*e/(g-e);k[3]=0;k[7]=0;k[11]=-1;k[15]=0;return this},makeOrthographic:function(a,b,c,d,e,g){var k=this.elements,l=1/(b-a),n=1/(c-d),m=1/(g-e);k[0]=2*l;k[4]=0;k[8]=0;k[12]=-((b+a)*l);k[1]=0;k[5]=2*n;k[9]=0;k[13]=-((c+d)*n);k[2]=0;k[6]=0;k[10]=-2*m;k[14]=-((g+e)*m);k[3]=0;k[7]=0;k[11]=0;k[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}});Object.assign(sa,{slerp:function(a,b,c,d){return c.copy(a).slerp(b,
|
||
|
d)},slerpFlat:function(a,b,c,d,e,g,k){var l=c[d+0],n=c[d+1],m=c[d+2];c=c[d+3];d=e[g+0];var r=e[g+1],w=e[g+2];e=e[g+3];if(c!==e||l!==d||n!==r||m!==w){g=1-k;var t=l*d+n*r+m*w+c*e,p=0<=t?1:-1,q=1-t*t;q>Number.EPSILON&&(q=Math.sqrt(q),t=Math.atan2(q,t*p),g=Math.sin(g*t)/q,k=Math.sin(k*t)/q);p*=k;l=l*g+d*p;n=n*g+r*p;m=m*g+w*p;c=c*g+e*p;g===1-k&&(k=1/Math.sqrt(l*l+n*n+m*m+c*c),l*=k,n*=k,m*=k,c*=k)}a[b]=l;a[b+1]=n;a[b+2]=m;a[b+3]=c}});Object.defineProperties(sa.prototype,{x:{get:function(){return this._x},
|
||
|
set:function(a){this._x=a;this.onChangeCallback()}},y:{get:function(){return this._y},set:function(a){this._y=a;this.onChangeCallback()}},z:{get:function(){return this._z},set:function(a){this._z=a;this.onChangeCallback()}},w:{get:function(){return this._w},set:function(a){this._w=a;this.onChangeCallback()}}});Object.assign(sa.prototype,{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 g=Math.cos,k=Math.sin,l=g(c/2),n=g(d/2);g=g(e/2);c=k(c/2);d=k(d/2);e=k(e/2);"XYZ"===a?(this._x=c*n*g+l*d*e,this._y=l*d*g-c*n*e,this._z=l*n*e+c*d*g,this._w=l*n*g-c*d*e):"YXZ"===a?(this._x=c*n*g+
|
||
|
l*d*e,this._y=l*d*g-c*n*e,this._z=l*n*e-c*d*g,this._w=l*n*g+c*d*e):"ZXY"===a?(this._x=c*n*g-l*d*e,this._y=l*d*g+c*n*e,this._z=l*n*e+c*d*g,this._w=l*n*g-c*d*e):"ZYX"===a?(this._x=c*n*g-l*d*e,this._y=l*d*g+c*n*e,this._z=l*n*e-c*d*g,this._w=l*n*g+c*d*e):"YZX"===a?(this._x=c*n*g+l*d*e,this._y=l*d*g+c*n*e,this._z=l*n*e-c*d*g,this._w=l*n*g-c*d*e):"XZY"===a&&(this._x=c*n*g-l*d*e,this._y=l*d*g-c*n*e,this._z=l*n*e+c*d*g,this._w=l*n*g+c*d*e);if(!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],g=b[5],k=b[9],l=b[2],n=b[6];b=b[10];var m=c+g+b;0<m?(c=.5/Math.sqrt(m+1),this._w=.25/c,this._x=(n-k)*c,this._y=(d-l)*c,this._z=(e-a)*c):c>g&&c>b?(c=2*Math.sqrt(1+c-g-b),this._w=(n-k)/c,this._x=.25*c,this._y=(a+e)/c,this._z=(d+l)/c):g>b?(c=2*Math.sqrt(1+g-c-b),this._w=(d-l)/c,this._x=(a+e)/c,this._y=
|
||
|
.25*c,this._z=(k+n)/c):(c=2*Math.sqrt(1+b-c-g),this._w=(e-a)/c,this._x=(d+l)/c,this._y=(k+n)/c,this._z=.25*c);this.onChangeCallback();return this},setFromUnitVectors:function(){var a=new p,b;return function(c,d){void 0===a&&(a=new p);b=c.dot(d)+1;1E-6>b?(b=0,Math.abs(c.x)>Math.abs(c.z)?a.set(-c.y,c.x,0):a.set(0,-c.z,c.y)):a.crossVectors(c,d);this._x=a.x;this._y=a.y;this._z=a.z;this._w=b;return this.normalize()}}(),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 g=b._x,k=b._y,l=b._z;b=b._w;this._x=c*b+a*g+d*l-e*k;this._y=d*b+a*k+e*g-c*l;this._z=e*b+a*l+c*k-d*g;this._w=a*b-c*g-d*k-e*l;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,g=this._w,k=g*a._w+c*a._x+d*a._y+e*a._z;0>k?(this._w=-a._w,this._x=-a._x,this._y=-a._y,this._z=-a._z,k=-k):this.copy(a);if(1<=k)return this._w=g,this._x=c,this._y=d,this._z=e,this;a=Math.sqrt(1-k*k);if(.001>Math.abs(a))return this._w=.5*(g+this._w),this._x=.5*(c+this._x),this._y=.5*(d+this._y),this._z=.5*(e+this._z),this;var l=Math.atan2(a,k);k=Math.sin((1-b)*l)/a;b=Math.sin(b*l)/a;this._w=g*k+
|
||
|
this._w*b;this._x=c*k+this._x*b;this._y=d*k+this._y*b;this._z=e*k+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(){}});Object.assign(p.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(){var a=new sa;return function(b){b&&b.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.");
|
||
|
return this.applyQuaternion(a.setFromEuler(b))}}(),applyAxisAngle:function(){var a=new sa;return function(b,c){return this.applyQuaternion(a.setFromAxisAngle(b,c))}}(),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,g=a.y,k=a.z;a=a.w;var l=a*b+g*d-k*c,n=a*c+k*b-e*d,m=a*d+e*c-g*b;b=-e*b-g*c-k*d;this.x=l*a+b*-e+n*-k-m*-g;this.y=n*a+b*-g+m*-e-l*-k;this.z=m*a+b*-k+l*-g-n*-e;return this},project:function(){var a=new V;return function(b){a.multiplyMatrices(b.projectionMatrix,a.getInverse(b.matrixWorld));return this.applyMatrix4(a)}}(),unproject:function(){var a=new V;return function(b){a.multiplyMatrices(b.matrixWorld,
|
||
|
a.getInverse(b.projectionMatrix));return this.applyMatrix4(a)}}(),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(){var a=new p,b=new p;return function(c,d){a.set(c,c,c);b.set(d,d,d);return this.clamp(a,b)}}(),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,g=b.y;b=b.z;this.x=d*b-a*g;this.y=a*e-c*b;this.z=c*g-d*e;return this},projectOnVector:function(a){var b=
|
||
|
a.dot(this)/a.lengthSq();return this.copy(a).multiplyScalar(b)},projectOnPlane:function(){var a=new p;return function(b){a.copy(this).projectOnVector(b);return this.sub(a)}}(),reflect:function(){var a=new p;return function(b){return this.sub(a.copy(b).multiplyScalar(2*this.dot(b)))}}(),angleTo:function(a){a=this.dot(a)/Math.sqrt(this.lengthSq()*a.lengthSq());return Math.acos(ja.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){var b=Math.sin(a.phi)*a.radius;this.x=b*Math.sin(a.theta);this.y=Math.cos(a.phi)*a.radius;this.z=b*Math.cos(a.theta);return this},setFromCylindrical:function(a){this.x=a.radius*Math.sin(a.theta);this.y=a.y;this.z=a.radius*Math.cos(a.theta);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}});Object.assign(Ja.prototype,{isMatrix3:!0,set:function(a,b,c,d,e,g,k,l,n){var m=this.elements;m[0]=a;m[1]=d;m[2]=k;m[3]=b;m[4]=e;m[5]=l;m[6]=c;m[7]=g;m[8]=n;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(){var a=new p;return function(b){for(var c=0,d=b.count;c<d;c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.applyMatrix3(this),b.setXYZ(c,
|
||
|
a.x,a.y,a.z);return b}}(),multiply:function(a){return 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[3],g=c[6],k=c[1],l=c[4],n=c[7],m=c[2],r=c[5];c=c[8];var w=d[0],t=d[3],p=d[6],q=d[1],y=d[4],A=d[7],C=d[2],x=d[5];d=d[8];b[0]=a*w+e*q+g*C;b[3]=a*t+e*y+g*x;b[6]=a*p+e*A+g*d;b[1]=k*w+l*q+n*C;b[4]=k*t+l*y+n*x;b[7]=k*p+l*A+n*d;b[2]=m*w+r*q+c*C;b[5]=m*t+r*y+c*x;b[8]=m*
|
||
|
p+r*A+c*d;return this},multiplyScalar:function(a){var b=this.elements;b[0]*=a;b[3]*=a;b[6]*=a;b[1]*=a;b[4]*=a;b[7]*=a;b[2]*=a;b[5]*=a;b[8]*=a;return this},determinant:function(){var a=this.elements,b=a[0],c=a[1],d=a[2],e=a[3],g=a[4],k=a[5],l=a[6],n=a[7];a=a[8];return b*g*a-b*k*n-c*e*a+c*k*l+d*e*n-d*g*l},getInverse:function(a,b){a&&a.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var c=a.elements;a=this.elements;var d=c[0],e=c[1],g=c[2],k=c[3],l=c[4],n=
|
||
|
c[5],m=c[6],r=c[7];c=c[8];var w=c*l-n*r,t=n*m-c*k,p=r*k-l*m,q=d*w+e*t+g*p;if(0===q){if(!0===b)throw Error("THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0");console.warn("THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0");return this.identity()}b=1/q;a[0]=w*b;a[1]=(g*r-c*e)*b;a[2]=(n*e-g*l)*b;a[3]=t*b;a[4]=(c*d-g*m)*b;a[5]=(g*k-n*d)*b;a[6]=p*b;a[7]=(e*m-r*d)*b;a[8]=(l*d-e*k)*b;return this},transpose:function(){var a=this.elements;var b=a[1];a[1]=a[3];a[3]=b;b=
|
||
|
a[2];a[2]=a[6];a[6]=b;b=a[5];a[5]=a[7];a[7]=b;return this},getNormalMatrix:function(a){return this.setFromMatrix4(a).getInverse(this).transpose()},transposeIntoArray:function(a){var b=this.elements;a[0]=b[0];a[1]=b[3];a[2]=b[6];a[3]=b[1];a[4]=b[4];a[5]=b[7];a[6]=b[2];a[7]=b[5];a[8]=b[8];return this},setUvTransform:function(a,b,c,d,e,g,k){var l=Math.cos(e);e=Math.sin(e);this.set(c*l,c*e,-c*(l*g+e*k)+g+a,-d*e,d*l,-d*(-e*g+l*k)+k+b,0,0,1)},scale:function(a,b){var c=this.elements;c[0]*=a;c[3]*=a;c[6]*=
|
||
|
a;c[1]*=b;c[4]*=b;c[7]*=b;return this},rotate:function(a){var b=Math.cos(a);a=Math.sin(a);var c=this.elements,d=c[0],e=c[3],g=c[6],k=c[1],l=c[4],n=c[7];c[0]=b*d+a*k;c[3]=b*e+a*l;c[6]=b*g+a*n;c[1]=-a*d+b*k;c[4]=-a*e+b*l;c[7]=-a*g+b*n;return this},translate:function(a,b){var c=this.elements;c[0]+=a*c[2];c[3]+=a*c[5];c[6]+=a*c[8];c[1]+=b*c[2];c[4]+=b*c[5];c[7]+=b*c[8];return this},equals:function(a){var b=this.elements;a=a.elements;for(var c=0;9>c;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 dk=0;ra.DEFAULT_IMAGE=void 0;ra.DEFAULT_MAPPING=300;ra.prototype=Object.assign(Object.create(K.prototype),{constructor:ra,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,
|
||
|
this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.name=a.name;this.image=a.image;this.mipmaps=a.mipmaps.slice(0);this.mapping=a.mapping;this.wrapS=a.wrapS;this.wrapT=a.wrapT;this.magFilter=a.magFilter;this.minFilter=a.minFilter;this.anisotropy=a.anisotropy;this.format=a.format;this.type=a.type;this.offset.copy(a.offset);this.repeat.copy(a.repeat);this.center.copy(a.center);this.rotation=a.rotation;this.matrixAutoUpdate=
|
||
|
a.matrixAutoUpdate;this.matrix.copy(a.matrix);this.generateMipmaps=a.generateMipmaps;this.premultiplyAlpha=a.premultiplyAlpha;this.flipY=a.flipY;this.unpackAlignment=a.unpackAlignment;this.encoding=a.encoding;return this},toJSON:function(a){var b=void 0===a||"string"===typeof a;if(!b&&void 0!==a.textures[this.uuid])return a.textures[this.uuid];var c={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],
|
||
|
offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var d=this.image;void 0===d.uuid&&(d.uuid=ja.generateUUID());if(!b&&void 0===a.images[d.uuid]){var e=a.images,g=d.uuid,k=d.uuid;if(d instanceof HTMLCanvasElement)var l=d;else{l=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");
|
||
|
l.width=d.width;l.height=d.height;var n=l.getContext("2d");d instanceof ImageData?n.putImageData(d,0,0):n.drawImage(d,0,0,d.width,d.height)}l=2048<l.width||2048<l.height?l.toDataURL("image/jpeg",.6):l.toDataURL("image/png");e[g]={uuid:k,url:l}}c.image=d.uuid}b||(a.textures[this.uuid]=c);return c},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(a){if(300===this.mapping){a.applyMatrix3(this.matrix);if(0>a.x||1<a.x)switch(this.wrapS){case 1E3:a.x-=Math.floor(a.x);break;
|
||
|
case 1001:a.x=0>a.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||1<a.y)switch(this.wrapT){case 1E3:a.y-=Math.floor(a.y);break;case 1001:a.y=0>a.y?0:1;break;case 1002:a.y=1===Math.abs(Math.floor(a.y)%2)?Math.ceil(a.y)-a.y:a.y-Math.floor(a.y)}this.flipY&&(a.y=1-a.y)}}});Object.defineProperty(ra.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(ya.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],g=a[5],k=a[9];var l=a[2];var n=a[6];var m=a[10];if(.01>Math.abs(c-e)&&.01>Math.abs(d-l)&&.01>Math.abs(k-n)){if(.1>Math.abs(c+e)&&.1>Math.abs(d+l)&&.1>Math.abs(k+n)&&.1>Math.abs(b+g+m-3))return this.set(1,0,0,0),this;a=Math.PI;
|
||
|
b=(b+1)/2;g=(g+1)/2;m=(m+1)/2;c=(c+e)/4;d=(d+l)/4;k=(k+n)/4;b>g&&b>m?.01>b?(n=0,c=l=.707106781):(n=Math.sqrt(b),l=c/n,c=d/n):g>m?.01>g?(n=.707106781,l=0,c=.707106781):(l=Math.sqrt(g),n=c/l,c=k/l):.01>m?(l=n=.707106781,c=0):(c=Math.sqrt(m),n=d/c,l=k/c);this.set(n,l,c,a);return this}a=Math.sqrt((n-k)*(n-k)+(d-l)*(d-l)+(e-c)*(e-c));.001>Math.abs(a)&&(a=1);this.x=(n-k)/a;this.y=(d-l)/a;this.z=(e-c)/a;this.w=Math.acos((b+g+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(){var a,b;return function(c,d){void 0===a&&(a=new ya,b=new ya);a.set(c,
|
||
|
c,c,c);b.set(d,d,d,d);return this.clamp(a,b)}}(),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}});Oa.prototype=Object.assign(Object.create(K.prototype),{constructor:Oa,isWebGLRenderTarget:!0,setSize:function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.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"})}});Yc.prototype=Object.create(Oa.prototype);Yc.prototype.constructor=Yc;Yc.prototype.isWebGLRenderTargetCube=!0;Yb.prototype=Object.create(ra.prototype);Yb.prototype.constructor=Yb;Yb.prototype.isDataTexture=!0;Object.assign(nb.prototype,{isBox3:!0,set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromArray:function(a){for(var b=
|
||
|
Infinity,c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,k=-Infinity,l=0,n=a.length;l<n;l+=3){var m=a[l],r=a[l+1],w=a[l+2];m<b&&(b=m);r<c&&(c=r);w<d&&(d=w);m>e&&(e=m);r>g&&(g=r);w>k&&(k=w)}this.min.set(b,c,d);this.max.set(e,g,k);return this},setFromBufferAttribute:function(a){for(var b=Infinity,c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,k=-Infinity,l=0,n=a.count;l<n;l++){var m=a.getX(l),r=a.getY(l),w=a.getZ(l);m<b&&(b=m);r<c&&(c=r);w<d&&(d=w);m>e&&(e=m);r>g&&(g=r);w>k&&(k=w)}this.min.set(b,c,d);
|
||
|
this.max.set(e,g,k);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new p;return function(b,c){c=a.copy(c).multiplyScalar(.5);this.min.copy(b).sub(c);this.max.copy(b).add(c);return this}}(),setFromObject:function(a){this.makeEmpty();return this.expandByObject(a)},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},
|
||
|
makeEmpty:function(){this.min.x=this.min.y=this.min.z=Infinity;this.max.x=this.max.y=this.max.z=-Infinity;return this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(a){void 0===a&&(console.warn("THREE.Box3: .getCenter() target is now required"),a=new p);return this.isEmpty()?a.set(0,0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(a){void 0===a&&(console.warn("THREE.Box3: .getSize() target is now required"),
|
||
|
a=new p);return this.isEmpty()?a.set(0,0,0):a.subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},expandByObject:function(){function a(a){var g=a.geometry;if(void 0!==g)if(g.isGeometry)for(g=g.vertices,c=0,d=g.length;c<d;c++)e.copy(g[c]),e.applyMatrix4(a.matrixWorld),b.expandByPoint(e);else if(g.isBufferGeometry&&
|
||
|
(g=g.attributes.position,void 0!==g))for(c=0,d=g.count;c<d;c++)e.fromBufferAttribute(g,c).applyMatrix4(a.matrixWorld),b.expandByPoint(e)}var b,c,d,e=new p;return function(c){b=this;c.updateMatrixWorld(!0);c.traverse(a);return this}}(),containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.max.y||a.z<this.min.z||a.z>this.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 p);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.y<this.min.y||a.min.y>this.max.y||a.max.z<this.min.z||a.min.z>this.max.z?!1:!0},intersectsSphere:function(){var a=new p;return function(b){this.clampPoint(b.center,
|
||
|
a);return a.distanceToSquared(b.center)<=b.radius*b.radius}}(),intersectsPlane:function(a){if(0<a.normal.x){var b=a.normal.x*this.min.x;var c=a.normal.x*this.max.x}else b=a.normal.x*this.max.x,c=a.normal.x*this.min.x;0<a.normal.y?(b+=a.normal.y*this.min.y,c+=a.normal.y*this.max.y):(b+=a.normal.y*this.max.y,c+=a.normal.y*this.min.y);0<a.normal.z?(b+=a.normal.z*this.min.z,c+=a.normal.z*this.max.z):(b+=a.normal.z*this.max.z,c+=a.normal.z*this.min.z);return b<=a.constant&&c>=a.constant},intersectsTriangle:function(){function a(a){var e;
|
||
|
var g=0;for(e=a.length-3;g<=e;g+=3){l.fromArray(a,g);var k=m.x*Math.abs(l.x)+m.y*Math.abs(l.y)+m.z*Math.abs(l.z),n=b.dot(l),r=c.dot(l),w=d.dot(l);if(Math.max(-Math.max(n,r,w),Math.min(n,r,w))>k)return!1}return!0}var b=new p,c=new p,d=new p,e=new p,g=new p,k=new p,l=new p,n=new p,m=new p,r=new p;return function(l){if(this.isEmpty())return!1;this.getCenter(n);m.subVectors(this.max,n);b.subVectors(l.a,n);c.subVectors(l.b,n);d.subVectors(l.c,n);e.subVectors(c,b);g.subVectors(d,c);k.subVectors(b,d);l=
|
||
|
[0,-e.z,e.y,0,-g.z,g.y,0,-k.z,k.y,e.z,0,-e.x,g.z,0,-g.x,k.z,0,-k.x,-e.y,e.x,0,-g.y,g.x,0,-k.y,k.x,0];if(!a(l))return!1;l=[1,0,0,0,1,0,0,0,1];if(!a(l))return!1;r.crossVectors(e,g);l=[r.x,r.y,r.z];return a(l)}}(),clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box3: .clampPoint() target is now required"),b=new p);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new p;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).length()}}(),getBoundingSphere:function(){var a=
|
||
|
new p;return function(b){void 0===b&&(console.warn("THREE.Box3: .getBoundingSphere() target is now required"),b=new pb);this.getCenter(b.center);b.radius=.5*this.getSize(a).length();return b}}(),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(){var a=[new p,new p,new p,new p,new p,new p,new p,new p];return function(b){if(this.isEmpty())return this;
|
||
|
a[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(b);a[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(b);a[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(b);a[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(b);a[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(b);a[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(b);a[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(b);a[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(b);this.setFromPoints(a);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)}});Object.assign(pb.prototype,{set:function(a,b){this.center.copy(a);this.radius=b;return this},setFromPoints:function(){var a=new nb;return function(b,c){var d=this.center;void 0!==c?d.copy(c):a.setFromPoints(b).getCenter(d);for(var e=c=0,g=b.length;e<g;e++)c=Math.max(c,d.distanceToSquared(b[e]));this.radius=Math.sqrt(c);return this}}(),clone:function(){return(new this.constructor).copy(this)},
|
||
|
copy:function(a){this.center.copy(a.center);this.radius=a.radius;return this},empty:function(){return 0>=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 p);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 nb);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}});Object.assign(ib.prototype,{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(){var a=
|
||
|
new p,b=new p;return function(c,d,e){d=a.subVectors(e,d).cross(b.subVectors(c,d)).normalize();this.setFromNormalAndCoplanarPoint(d,c);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 p);return b.copy(this.normal).multiplyScalar(-this.distanceToPoint(a)).add(a)},intersectLine:function(){var a=new p;return function(b,c){void 0===c&&(console.warn("THREE.Plane: .intersectLine() target is now required"),c=new p);var d=b.delta(a),e=this.normal.dot(d);if(0===e){if(0===this.distanceToPoint(b.start))return c.copy(b.start)}else if(e=
|
||
|
-(b.start.dot(this.normal)+this.constant)/e,!(0>e||1<e))return c.copy(d).multiplyScalar(e).add(b.start)}}(),intersectsLine:function(a){var b=this.distanceToPoint(a.start);a=this.distanceToPoint(a.end);return 0>b&&0<a||0>a&&0<b},intersectsBox:function(a){return a.intersectsPlane(this)},intersectsSphere:function(a){return a.intersectsPlane(this)},coplanarPoint:function(a){void 0===a&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),a=new p);return a.copy(this.normal).multiplyScalar(-this.constant)},
|
||
|
applyMatrix4:function(){var a=new p,b=new Ja;return function(c,d){d=d||b.getNormalMatrix(c);c=this.coplanarPoint(a).applyMatrix4(c);d=this.normal.applyMatrix3(d).normalize();this.constant=-c.dot(d);return this}}(),translate:function(a){this.constant-=a.dot(this.normal);return this},equals:function(a){return a.normal.equals(this.normal)&&a.constant===this.constant}});Object.assign(Ye.prototype,{set:function(a,b,c,d,e,g){var k=this.planes;k[0].copy(a);k[1].copy(b);k[2].copy(c);k[3].copy(d);k[4].copy(e);
|
||
|
k[5].copy(g);return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){for(var b=this.planes,c=0;6>c;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],g=c[3],k=c[4],l=c[5],n=c[6],m=c[7],r=c[8],w=c[9],t=c[10],p=c[11],q=c[12],y=c[13],A=c[14];c=c[15];b[0].setComponents(g-a,m-k,p-r,c-q).normalize();b[1].setComponents(g+a,m+k,p+r,c+q).normalize();b[2].setComponents(g+d,m+l,p+w,c+y).normalize();b[3].setComponents(g-
|
||
|
d,m-l,p-w,c-y).normalize();b[4].setComponents(g-e,m-n,p-t,c-A).normalize();b[5].setComponents(g+e,m+n,p+t,c+A).normalize();return this},intersectsObject:function(){var a=new pb;return function(b){var c=b.geometry;null===c.boundingSphere&&c.computeBoundingSphere();a.copy(c.boundingSphere).applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),intersectsSprite:function(){var a=new pb;return function(b){a.center.set(0,0,0);a.radius=.7071067811865476;a.applyMatrix4(b.matrixWorld);return this.intersectsSphere(a)}}(),
|
||
|
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)<a)return!1;return!0},intersectsBox:function(){var a=new p,b=new p;return function(c){for(var d=this.planes,e=0;6>e;e++){var g=d[e];a.x=0<g.normal.x?c.min.x:c.max.x;b.x=0<g.normal.x?c.max.x:c.min.x;a.y=0<g.normal.y?c.min.y:c.max.y;b.y=0<g.normal.y?c.max.y:c.min.y;a.z=0<g.normal.z?c.min.z:c.max.z;b.z=0<g.normal.z?c.max.z:c.min.z;var k=g.distanceToPoint(a);g=g.distanceToPoint(b);if(0>
|
||
|
k&&0>g)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 pa={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",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\n",
|
||
|
aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\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}\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 GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, 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_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\t
|
||
|
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\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
|
||
|
clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif\n",
|
||
|
clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",
|
||
|
color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\n",
|
||
|
cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(tex
|
||
|
defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
|
||
|
emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",
|
||
|
envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
|
||
|
envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
|
||
|
envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",
|
||
|
fog_vertex:"\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",
|
||
|
gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
|
||
|
lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
|
||
|
lights_pars_begin:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n",
|
||
|
lights_pars_maps:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
|
||
|
lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
|
||
|
lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",
|
||
|
lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry
|
||
|
lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif\n",
|
||
|
lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif\n",
|
||
|
lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",
|
||
|
logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
|
||
|
map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",
|
||
|
metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",
|
||
|
morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",
|
||
|
normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n#endif\n",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
|
||
|
normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\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 );\t\tscale *= float( gl_FrontFacing ) * 2.0 - 1.0;\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 * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
|
||
|
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}\n",
|
||
|
premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",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\n",
|
||
|
roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\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 ) / size;\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\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( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, 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( 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 / 9.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.
|
||
|
shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
|
||
|
shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
|
||
|
shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
|
||
|
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 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\n",
|
||
|
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\n",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#endif\n",
|
||
|
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 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",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}\n",
|
||
|
uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_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_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\n",
|
||
|
uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_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\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",
|
||
|
cube_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\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}\n",
|
||
|
depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",
|
||
|
distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n",
|
||
|
distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}\n",
|
||
|
equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\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}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",
|
||
|
linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
|
||
|
linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}\n",
|
||
|
meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
|
||
|
meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}\n",
|
||
|
meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",
|
||
|
meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",
|
||
|
meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",
|
||
|
meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",
|
||
|
meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars_begin>\n#include <lights_pars_maps>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",
|
||
|
meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",
|
||
|
normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",
|
||
|
normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",
|
||
|
points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
|
||
|
points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",
|
||
|
shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}\n",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n"},
|
||
|
$a={merge:function(a){for(var b={},c=0;c<a.length;c++){var d=this.clone(a[c]),e;for(e in d)b[e]=d[e]}return b},clone:function(a){var b={},c;for(c in a){b[c]={};for(var d in a[c]){var e=a[c][d];e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture)?b[c][d]=e.clone():Array.isArray(e)?b[c][d]=e.slice():b[c][d]=e}}return b}},lm={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};Object.assign(S.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(){function a(a,c,d){0>d&&(d+=1);1<d&&--d;return d<1/6?a+6*(c-a)*d:.5>d?c:d<2/3?a+6*(c-a)*(2/3-d):a}return function(b,
|
||
|
c,d){b=ja.euclideanModulo(b,1);c=ja.clamp(c,0,1);d=ja.clamp(d,0,1);0===c?this.r=this.g=this.b=d:(c=.5>=d?d*(1+c):d+c-d*c,d=2*d-c,this.r=a(d,c,b+1/3),this.g=a(d,c,b),this.b=a(d,c,b-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,g=parseInt(c[3],10)/100;b(c[5]);return this.setHSL(d,e,g)}}}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<a.length&&(c=lm[a],
|
||
|
void 0!==c?this.setHex(c):console.warn("THREE.Color: Unknown color "+a));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(a){this.r=a.r;this.g=a.g;this.b=a.b;return this},copyGammaToLinear:function(a,b){void 0===b&&(b=2);this.r=Math.pow(a.r,b);this.g=Math.pow(a.g,b);this.b=Math.pow(a.b,b);return this},copyLinearToGamma:function(a,b){void 0===b&&(b=2);b=0<b?1/b:1;this.r=Math.pow(a.r,b);this.g=Math.pow(a.g,b);this.b=Math.pow(a.b,b);return this},convertGammaToLinear:function(){var a=
|
||
|
this.r,b=this.g,c=this.b;this.r=a*a;this.g=b*b;this.b=c*c;return this},convertLinearToGamma:function(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(a){void 0===a&&(console.warn("THREE.Color: .getHSL() target is now required"),a={h:0,s:0,l:0});var b=this.r,c=this.g,d=this.b,e=Math.max(b,c,d),g=
|
||
|
Math.min(b,c,d),k,l=(g+e)/2;if(g===e)g=k=0;else{var n=e-g;g=.5>=l?n/(e+g):n/(2-e-g);switch(e){case b:k=(c-d)/n+(c<d?6:0);break;case c:k=(d-b)/n+2;break;case d:k=(b-c)/n+4}k/=6}a.h=k;a.s=g;a.l=l;return a},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(){var a={};return function(b,c,d){this.getHSL(a);a.h+=b;a.s+=c;a.l+=d;this.setHSL(a.h,a.s,a.l);return this}}(),add:function(a){this.r+=a.r;this.g+=a.g;this.b+=a.b;return this},addColors:function(a,
|
||
|
b){this.r=a.r+b.r;this.g=a.g+b.g;this.b=a.b+b.b;return this},addScalar:function(a){this.r+=a;this.g+=a;this.b+=a;return this},sub:function(a){this.r=Math.max(0,this.r-a.r);this.g=Math.max(0,this.g-a.g);this.b=Math.max(0,this.b-a.b);return this},multiply:function(a){this.r*=a.r;this.g*=a.g;this.b*=a.b;return this},multiplyScalar:function(a){this.r*=a;this.g*=a;this.b*=a;return this},lerp:function(a,b){this.r+=(a.r-this.r)*b;this.g+=(a.g-this.g)*b;this.b+=(a.b-this.b)*b;return this},equals:function(a){return a.r===
|
||
|
this.r&&a.g===this.g&&a.b===this.b},fromArray:function(a,b){void 0===b&&(b=0);this.r=a[b];this.g=a[b+1];this.b=a[b+2];return this},toArray:function(a,b){void 0===a&&(a=[]);void 0===b&&(b=0);a[b]=this.r;a[b+1]=this.g;a[b+2]=this.b;return a},toJSON:function(){return this.getHex()}});var T={common:{diffuse:{value:new S(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Ja},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 x(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 S(16777215)}},lights:{ambientLightColor:{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 S(15658734)},
|
||
|
opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new Ja}}},tc={basic:{uniforms:$a.merge([T.common,T.specularmap,T.envmap,T.aomap,T.lightmap,T.fog]),vertexShader:pa.meshbasic_vert,fragmentShader:pa.meshbasic_frag},lambert:{uniforms:$a.merge([T.common,T.specularmap,T.envmap,T.aomap,T.lightmap,T.emissivemap,T.fog,T.lights,{emissive:{value:new S(0)}}]),vertexShader:pa.meshlambert_vert,fragmentShader:pa.meshlambert_frag},phong:{uniforms:$a.merge([T.common,T.specularmap,
|
||
|
T.envmap,T.aomap,T.lightmap,T.emissivemap,T.bumpmap,T.normalmap,T.displacementmap,T.gradientmap,T.fog,T.lights,{emissive:{value:new S(0)},specular:{value:new S(1118481)},shininess:{value:30}}]),vertexShader:pa.meshphong_vert,fragmentShader:pa.meshphong_frag},standard:{uniforms:$a.merge([T.common,T.envmap,T.aomap,T.lightmap,T.emissivemap,T.bumpmap,T.normalmap,T.displacementmap,T.roughnessmap,T.metalnessmap,T.fog,T.lights,{emissive:{value:new S(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),
|
||
|
vertexShader:pa.meshphysical_vert,fragmentShader:pa.meshphysical_frag},points:{uniforms:$a.merge([T.points,T.fog]),vertexShader:pa.points_vert,fragmentShader:pa.points_frag},dashed:{uniforms:$a.merge([T.common,T.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:pa.linedashed_vert,fragmentShader:pa.linedashed_frag},depth:{uniforms:$a.merge([T.common,T.displacementmap]),vertexShader:pa.depth_vert,fragmentShader:pa.depth_frag},normal:{uniforms:$a.merge([T.common,T.bumpmap,T.normalmap,
|
||
|
T.displacementmap,{opacity:{value:1}}]),vertexShader:pa.normal_vert,fragmentShader:pa.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:pa.cube_vert,fragmentShader:pa.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:pa.equirect_vert,fragmentShader:pa.equirect_frag},distanceRGBA:{uniforms:$a.merge([T.common,T.displacementmap,{referencePosition:{value:new p},nearDistance:{value:1},farDistance:{value:1E3}}]),vertexShader:pa.distanceRGBA_vert,
|
||
|
fragmentShader:pa.distanceRGBA_frag},shadow:{uniforms:$a.merge([T.lights,T.fog,{color:{value:new S(0)},opacity:{value:1}}]),vertexShader:pa.shadow_vert,fragmentShader:pa.shadow_frag}};tc.physical={uniforms:$a.merge([tc.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:pa.meshphysical_vert,fragmentShader:pa.meshphysical_frag};rc.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" ");rc.DefaultOrder="XYZ";Object.defineProperties(rc.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(rc.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=ja.clamp,e=a.elements;a=e[0];var g=e[4],k=e[8],l=e[1],n=e[5],m=e[9],r=e[2],w=e[6];e=e[10];b=b||this._order;"XYZ"===b?(this._y=Math.asin(d(k,-1,1)),.99999>Math.abs(k)?(this._x=Math.atan2(-m,e),this._z=Math.atan2(-g,a)):(this._x=Math.atan2(w,n),this._z=0)):"YXZ"===b?(this._x=Math.asin(-d(m,-1,1)),.99999>Math.abs(m)?
|
||
|
(this._y=Math.atan2(k,e),this._z=Math.atan2(l,n)):(this._y=Math.atan2(-r,a),this._z=0)):"ZXY"===b?(this._x=Math.asin(d(w,-1,1)),.99999>Math.abs(w)?(this._y=Math.atan2(-r,e),this._z=Math.atan2(-g,n)):(this._y=0,this._z=Math.atan2(l,a))):"ZYX"===b?(this._y=Math.asin(-d(r,-1,1)),.99999>Math.abs(r)?(this._x=Math.atan2(w,e),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-g,n))):"YZX"===b?(this._z=Math.asin(d(l,-1,1)),.99999>Math.abs(l)?(this._x=Math.atan2(-m,n),this._y=Math.atan2(-r,a)):(this._x=
|
||
|
0,this._y=Math.atan2(k,e))):"XZY"===b?(this._z=Math.asin(-d(g,-1,1)),.99999>Math.abs(g)?(this._x=Math.atan2(w,n),this._y=Math.atan2(k,a)):(this._x=Math.atan2(-m,e),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+b);this._order=b;if(!1!==c)this.onChangeCallback();return this},setFromQuaternion:function(){var a=new V;return function(b,c,d){a.makeRotationFromQuaternion(b);return this.setFromRotationMatrix(a,c,d)}}(),setFromVector3:function(a,b){return this.set(a.x,
|
||
|
a.y,a.z,b||this._order)},reorder:function(){var a=new sa;return function(b){a.setFromEuler(this);return this.setFromQuaternion(a,b)}}(),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 p(this._x,this._y,this._z)},onChange:function(a){this.onChangeCallback=a;return this},onChangeCallback:function(){}});Object.assign(Ng.prototype,{set:function(a){this.mask=1<<a|0},enable:function(a){this.mask=this.mask|1<<a|0},toggle:function(a){this.mask^=1<<a|0},disable:function(a){this.mask&=~(1<<a|0)},test:function(a){return 0!==(this.mask&a.mask)}});var fk=0;O.DefaultUp=new p(0,1,0);O.DefaultMatrixAutoUpdate=!0;O.prototype=Object.assign(Object.create(K.prototype),
|
||
|
{constructor:O,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(a){this.matrix.multiplyMatrices(a,this.matrix);this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(a){this.quaternion.premultiply(a);return this},setRotationFromAxisAngle:function(a,b){this.quaternion.setFromAxisAngle(a,b)},setRotationFromEuler:function(a){this.quaternion.setFromEuler(a,!0)},setRotationFromMatrix:function(a){this.quaternion.setFromRotationMatrix(a)},
|
||
|
setRotationFromQuaternion:function(a){this.quaternion.copy(a)},rotateOnAxis:function(){var a=new sa;return function(b,c){a.setFromAxisAngle(b,c);this.quaternion.multiply(a);return this}}(),rotateOnWorldAxis:function(){var a=new sa;return function(b,c){a.setFromAxisAngle(b,c);this.quaternion.premultiply(a);return this}}(),rotateX:function(){var a=new p(1,0,0);return function(b){return this.rotateOnAxis(a,b)}}(),rotateY:function(){var a=new p(0,1,0);return function(b){return this.rotateOnAxis(a,b)}}(),
|
||
|
rotateZ:function(){var a=new p(0,0,1);return function(b){return this.rotateOnAxis(a,b)}}(),translateOnAxis:function(){var a=new p;return function(b,c){a.copy(b).applyQuaternion(this.quaternion);this.position.add(a.multiplyScalar(c));return this}}(),translateX:function(){var a=new p(1,0,0);return function(b){return this.translateOnAxis(a,b)}}(),translateY:function(){var a=new p(0,1,0);return function(b){return this.translateOnAxis(a,b)}}(),translateZ:function(){var a=new p(0,0,1);return function(b){return this.translateOnAxis(a,
|
||
|
b)}}(),localToWorld:function(a){return a.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var a=new V;return function(b){return b.applyMatrix4(a.getInverse(this.matrixWorld))}}(),lookAt:function(){var a=new V,b=new p;return function(c,d,e){c.isVector3?b.copy(c):b.set(c,d,e);this.isCamera?a.lookAt(this.position,b,this.up):a.lookAt(b,this.position,this.up);this.quaternion.setFromRotationMatrix(a)}}(),add:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.add(arguments[b]);
|
||
|
return this}if(a===this)return console.error("THREE.Object3D.add: object can't be added as a child of itself.",a),this;a&&a.isObject3D?(null!==a.parent&&a.parent.remove(a),a.parent=this,a.dispatchEvent({type:"added"}),this.children.push(a)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",a);return this},remove:function(a){if(1<arguments.length){for(var b=0;b<arguments.length;b++)this.remove(arguments[b]);return this}b=this.children.indexOf(a);-1!==b&&(a.parent=null,a.dispatchEvent({type:"removed"}),
|
||
|
this.children.splice(b,1));return this},getObjectById:function(a){return this.getObjectByProperty("id",a)},getObjectByName:function(a){return this.getObjectByProperty("name",a)},getObjectByProperty:function(a,b){if(this[a]===b)return this;for(var c=0,d=this.children.length;c<d;c++){var e=this.children[c].getObjectByProperty(a,b);if(void 0!==e)return e}},getWorldPosition:function(a){void 0===a&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),a=new p);this.updateMatrixWorld(!0);
|
||
|
return a.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var a=new p,b=new p;return function(c){void 0===c&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),c=new sa);this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,c,b);return c}}(),getWorldScale:function(){var a=new p,b=new sa;return function(c){void 0===c&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),c=new p);this.updateMatrixWorld(!0);this.matrixWorld.decompose(a,
|
||
|
b,c);return c}}(),getWorldDirection:function(){var a=new sa;return function(b){void 0===b&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),b=new p);this.getWorldQuaternion(a);return b.set(0,0,1).applyQuaternion(a)}}(),raycast:function(){},traverse:function(a){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverse(a)},traverseVisible:function(a){if(!1!==this.visible){a(this);for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].traverseVisible(a)}},traverseAncestors:function(a){var b=
|
||
|
this.parent;null!==b&&(a(b),b.traverseAncestors(a))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale);this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(a){this.matrixAutoUpdate&&this.updateMatrix();if(this.matrixWorldNeedsUpdate||a)null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,a=!0;for(var b=this.children,c=0,d=b.length;c<d;c++)b[c].updateMatrixWorld(a)},
|
||
|
toJSON:function(a){function b(b,c){void 0===b[c.uuid]&&(b[c.uuid]=c.toJSON(a));return c.uuid}function c(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var d=void 0===a||"string"===typeof a,e={};d&&(a={geometries:{},materials:{},textures:{},images:{},shapes:{}},e.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var g={};g.uuid=this.uuid;g.type=this.type;""!==this.name&&(g.name=this.name);!0===this.castShadow&&(g.castShadow=!0);!0===this.receiveShadow&&(g.receiveShadow=
|
||
|
!0);!1===this.visible&&(g.visible=!1);!1===this.frustumCulled&&(g.frustumCulled=!1);0!==this.renderOrder&&(g.renderOrder=this.renderOrder);"{}"!==JSON.stringify(this.userData)&&(g.userData=this.userData);g.matrix=this.matrix.toArray();!1===this.matrixAutoUpdate&&(g.matrixAutoUpdate=!1);if(void 0!==this.geometry){g.geometry=b(a.geometries,this.geometry);var k=this.geometry.parameters;if(void 0!==k&&void 0!==k.shapes)if(k=k.shapes,Array.isArray(k))for(var l=0,n=k.length;l<n;l++)b(a.shapes,k[l]);else b(a.shapes,
|
||
|
k)}if(void 0!==this.material)if(Array.isArray(this.material)){k=[];l=0;for(n=this.material.length;l<n;l++)k.push(b(a.materials,this.material[l]));g.material=k}else g.material=b(a.materials,this.material);if(0<this.children.length)for(g.children=[],l=0;l<this.children.length;l++)g.children.push(this.children[l].toJSON(a).object);if(d){d=c(a.geometries);l=c(a.materials);n=c(a.textures);var m=c(a.images);k=c(a.shapes);0<d.length&&(e.geometries=d);0<l.length&&(e.materials=l);0<n.length&&(e.textures=n);
|
||
|
0<m.length&&(e.images=m);0<k.length&&(e.shapes=k)}e.object=g;return e},clone:function(a){return(new this.constructor).copy(this,a)},copy:function(a,b){void 0===b&&(b=!0);this.name=a.name;this.up.copy(a.up);this.position.copy(a.position);this.quaternion.copy(a.quaternion);this.scale.copy(a.scale);this.matrix.copy(a.matrix);this.matrixWorld.copy(a.matrixWorld);this.matrixAutoUpdate=a.matrixAutoUpdate;this.matrixWorldNeedsUpdate=a.matrixWorldNeedsUpdate;this.layers.mask=a.layers.mask;this.visible=a.visible;
|
||
|
this.castShadow=a.castShadow;this.receiveShadow=a.receiveShadow;this.frustumCulled=a.frustumCulled;this.renderOrder=a.renderOrder;this.userData=JSON.parse(JSON.stringify(a.userData));if(!0===b)for(b=0;b<a.children.length;b++)this.add(a.children[b].clone());return this}});Ab.prototype=Object.assign(Object.create(O.prototype),{constructor:Ab,isCamera:!0,copy:function(a,b){O.prototype.copy.call(this,a,b);this.matrixWorldInverse.copy(a.matrixWorldInverse);this.projectionMatrix.copy(a.projectionMatrix);
|
||
|
return this},getWorldDirection:function(){var a=new sa;return function(b){void 0===b&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),b=new p);this.getWorldQuaternion(a);return b.set(0,0,-1).applyQuaternion(a)}}(),updateMatrixWorld:function(a){O.prototype.updateMatrixWorld.call(this,a);this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}});qb.prototype=Object.assign(Object.create(Ab.prototype),{constructor:qb,isOrthographicCamera:!0,
|
||
|
copy:function(a,b){Ab.prototype.copy.call(this,a,b);this.left=a.left;this.right=a.right;this.top=a.top;this.bottom=a.bottom;this.near=a.near;this.far=a.far;this.zoom=a.zoom;this.view=null===a.view?null:Object.assign({},a.view);return this},setViewOffset:function(a,b,c,d,e,g){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1});this.view.enabled=!0;this.view.fullWidth=a;this.view.fullHeight=b;this.view.offsetX=c;this.view.offsetY=d;this.view.width=
|
||
|
e;this.view.height=g;this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1);this.updateProjectionMatrix()},updateProjectionMatrix:function(){var a=(this.right-this.left)/(2*this.zoom),b=(this.top-this.bottom)/(2*this.zoom),c=(this.right+this.left)/2,d=(this.top+this.bottom)/2,e=c-a;c+=a;a=d+b;b=d-b;if(null!==this.view&&this.view.enabled){c=this.zoom/(this.view.width/this.view.fullWidth);b=this.zoom/(this.view.height/this.view.fullHeight);var g=(this.right-
|
||
|
this.left)/this.view.width;d=(this.top-this.bottom)/this.view.height;e+=this.view.offsetX/c*g;c=e+this.view.width/c*g;a-=this.view.offsetY/b*d;b=a-this.view.height/b*d}this.projectionMatrix.makeOrthographic(e,c,a,b,this.near,this.far)},toJSON:function(a){a=O.prototype.toJSON.call(this,a);a.object.zoom=this.zoom;a.object.left=this.left;a.object.right=this.right;a.object.top=this.top;a.object.bottom=this.bottom;a.object.near=this.near;a.object.far=this.far;null!==this.view&&(a.object.view=Object.assign({},
|
||
|
this.view));return a}});Object.assign(Zb.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.a=a.a;this.b=a.b;this.c=a.c;this.normal.copy(a.normal);this.color.copy(a.color);this.materialIndex=a.materialIndex;for(var b=0,c=a.vertexNormals.length;b<c;b++)this.vertexNormals[b]=a.vertexNormals[b].clone();b=0;for(c=a.vertexColors.length;b<c;b++)this.vertexColors[b]=a.vertexColors[b].clone();return this}});var gk=0;ca.prototype=Object.assign(Object.create(K.prototype),
|
||
|
{constructor:ca,isGeometry:!0,applyMatrix:function(a){for(var b=(new Ja).getNormalMatrix(a),c=0,d=this.vertices.length;c<d;c++)this.vertices[c].applyMatrix4(a);c=0;for(d=this.faces.length;c<d;c++){a=this.faces[c];a.normal.applyMatrix3(b).normalize();for(var e=0,g=a.vertexNormals.length;e<g;e++)a.vertexNormals[e].applyMatrix3(b).normalize()}null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();this.normalsNeedUpdate=this.verticesNeedUpdate=!0;return this},
|
||
|
rotateX:function(){var a=new V;return function(b){a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a=new V;return function(b){a.makeRotationY(b);this.applyMatrix(a);return this}}(),rotateZ:function(){var a=new V;return function(b){a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a=new V;return function(b,c,d){a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a=new V;return function(b,c,d){a.makeScale(b,c,d);
|
||
|
this.applyMatrix(a);return this}}(),lookAt:function(){var a=new O;return function(b){a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),fromBufferGeometry:function(a){function b(a,b,d,e){var g=void 0!==k?[r[a].clone(),r[b].clone(),r[d].clone()]:[],p=void 0!==l?[c.colors[a].clone(),c.colors[b].clone(),c.colors[d].clone()]:[];e=new Zb(a,b,d,g,p,e);c.faces.push(e);void 0!==n&&c.faceVertexUvs[0].push([w[a].clone(),w[b].clone(),w[d].clone()]);void 0!==m&&c.faceVertexUvs[1].push([t[a].clone(),
|
||
|
t[b].clone(),t[d].clone()])}var c=this,d=null!==a.index?a.index.array:void 0,e=a.attributes,g=e.position.array,k=void 0!==e.normal?e.normal.array:void 0,l=void 0!==e.color?e.color.array:void 0,n=void 0!==e.uv?e.uv.array:void 0,m=void 0!==e.uv2?e.uv2.array:void 0;void 0!==m&&(this.faceVertexUvs[1]=[]);for(var r=[],w=[],t=[],q=e=0;e<g.length;e+=3,q+=2)c.vertices.push(new p(g[e],g[e+1],g[e+2])),void 0!==k&&r.push(new p(k[e],k[e+1],k[e+2])),void 0!==l&&c.colors.push(new S(l[e],l[e+1],l[e+2])),void 0!==
|
||
|
n&&w.push(new x(n[q],n[q+1])),void 0!==m&&t.push(new x(m[q],m[q+1]));var v=a.groups;if(0<v.length)for(e=0;e<v.length;e++){g=v[e];var y=g.start,A=g.count;q=y;for(y+=A;q<y;q+=3)void 0!==d?b(d[q],d[q+1],d[q+2],g.materialIndex):b(q,q+1,q+2,g.materialIndex)}else if(void 0!==d)for(e=0;e<d.length;e+=3)b(d[e],d[e+1],d[e+2]);else for(e=0;e<g.length/3;e+=3)b(e,e+1,e+2);this.computeFaceNormals();null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());
|
||
|
return this},center:function(){var a=new p;return function(){this.computeBoundingBox();this.boundingBox.getCenter(a).negate();this.translate(a.x,a.y,a.z);return this}}(),normalize:function(){this.computeBoundingSphere();var a=this.boundingSphere.center,b=this.boundingSphere.radius;b=0===b?1:1/b;var c=new V;c.set(b,0,0,-b*a.x,0,b,0,-b*a.y,0,0,b,-b*a.z,0,0,0,1);this.applyMatrix(c);return this},computeFaceNormals:function(){for(var a=new p,b=new p,c=0,d=this.faces.length;c<d;c++){var e=this.faces[c],
|
||
|
g=this.vertices[e.a],k=this.vertices[e.b];a.subVectors(this.vertices[e.c],k);b.subVectors(g,k);a.cross(b);a.normalize();e.normal.copy(a)}},computeVertexNormals:function(a){void 0===a&&(a=!0);var b;var c=Array(this.vertices.length);var d=0;for(b=this.vertices.length;d<b;d++)c[d]=new p;if(a){var e=new p,g=new p;a=0;for(d=this.faces.length;a<d;a++){b=this.faces[a];var k=this.vertices[b.a];var l=this.vertices[b.b];var n=this.vertices[b.c];e.subVectors(n,l);g.subVectors(k,l);e.cross(g);c[b.a].add(e);c[b.b].add(e);
|
||
|
c[b.c].add(e)}}else for(this.computeFaceNormals(),a=0,d=this.faces.length;a<d;a++)b=this.faces[a],c[b.a].add(b.normal),c[b.b].add(b.normal),c[b.c].add(b.normal);d=0;for(b=this.vertices.length;d<b;d++)c[d].normalize();a=0;for(d=this.faces.length;a<d;a++)b=this.faces[a],k=b.vertexNormals,3===k.length?(k[0].copy(c[b.a]),k[1].copy(c[b.b]),k[2].copy(c[b.c])):(k[0]=c[b.a].clone(),k[1]=c[b.b].clone(),k[2]=c[b.c].clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var a;
|
||
|
this.computeFaceNormals();var b=0;for(a=this.faces.length;b<a;b++){var c=this.faces[b];var d=c.vertexNormals;3===d.length?(d[0].copy(c.normal),d[1].copy(c.normal),d[2].copy(c.normal)):(d[0]=c.normal.clone(),d[1]=c.normal.clone(),d[2]=c.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var a,b;var c=0;for(b=this.faces.length;c<b;c++){var d=this.faces[c];d.__originalFaceNormal?d.__originalFaceNormal.copy(d.normal):d.__originalFaceNormal=d.normal.clone();
|
||
|
d.__originalVertexNormals||(d.__originalVertexNormals=[]);var e=0;for(a=d.vertexNormals.length;e<a;e++)d.__originalVertexNormals[e]?d.__originalVertexNormals[e].copy(d.vertexNormals[e]):d.__originalVertexNormals[e]=d.vertexNormals[e].clone()}var g=new ca;g.faces=this.faces;e=0;for(a=this.morphTargets.length;e<a;e++){if(!this.morphNormals[e]){this.morphNormals[e]={};this.morphNormals[e].faceNormals=[];this.morphNormals[e].vertexNormals=[];d=this.morphNormals[e].faceNormals;var k=this.morphNormals[e].vertexNormals;
|
||
|
c=0;for(b=this.faces.length;c<b;c++){var l=new p;var n={a:new p,b:new p,c:new p};d.push(l);k.push(n)}}k=this.morphNormals[e];g.vertices=this.morphTargets[e].vertices;g.computeFaceNormals();g.computeVertexNormals();c=0;for(b=this.faces.length;c<b;c++)d=this.faces[c],l=k.faceNormals[c],n=k.vertexNormals[c],l.copy(d.normal),n.a.copy(d.vertexNormals[0]),n.b.copy(d.vertexNormals[1]),n.c.copy(d.vertexNormals[2])}c=0;for(b=this.faces.length;c<b;c++)d=this.faces[c],d.normal=d.__originalFaceNormal,d.vertexNormals=
|
||
|
d.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new nb);this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new pb);this.boundingSphere.setFromPoints(this.vertices)},merge:function(a,b,c){if(a&&a.isGeometry){var d,e=this.vertices.length,g=this.vertices,k=a.vertices,l=this.faces,n=a.faces,m=this.faceVertexUvs[0],r=a.faceVertexUvs[0],p=this.colors,t=a.colors;void 0===c&&(c=
|
||
|
0);void 0!==b&&(d=(new Ja).getNormalMatrix(b));a=0;for(var q=k.length;a<q;a++){var v=k[a].clone();void 0!==b&&v.applyMatrix4(b);g.push(v)}a=0;for(q=t.length;a<q;a++)p.push(t[a].clone());a=0;for(q=n.length;a<q;a++){k=n[a];var y=k.vertexNormals;t=k.vertexColors;p=new Zb(k.a+e,k.b+e,k.c+e);p.normal.copy(k.normal);void 0!==d&&p.normal.applyMatrix3(d).normalize();b=0;for(g=y.length;b<g;b++)v=y[b].clone(),void 0!==d&&v.applyMatrix3(d).normalize(),p.vertexNormals.push(v);p.color.copy(k.color);b=0;for(g=
|
||
|
t.length;b<g;b++)v=t[b],p.vertexColors.push(v.clone());p.materialIndex=k.materialIndex+c;l.push(p)}a=0;for(q=r.length;a<q;a++)if(c=r[a],d=[],void 0!==c){b=0;for(g=c.length;b<g;b++)d.push(c[b].clone());m.push(d)}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",a)},mergeMesh:function(a){a&&a.isMesh?(a.matrixAutoUpdate&&a.updateMatrix(),this.merge(a.geometry,a.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",a)},mergeVertices:function(){var a=
|
||
|
{},b=[],c=[],d=Math.pow(10,4),e;var g=0;for(e=this.vertices.length;g<e;g++){var k=this.vertices[g];k=Math.round(k.x*d)+"_"+Math.round(k.y*d)+"_"+Math.round(k.z*d);void 0===a[k]?(a[k]=g,b.push(this.vertices[g]),c[g]=b.length-1):c[g]=c[a[k]]}a=[];g=0;for(e=this.faces.length;g<e;g++)for(d=this.faces[g],d.a=c[d.a],d.b=c[d.b],d.c=c[d.c],d=[d.a,d.b,d.c],k=0;3>k;k++)if(d[k]===d[(k+1)%3]){a.push(g);break}for(g=a.length-1;0<=g;g--)for(d=a[g],this.faces.splice(d,1),c=0,e=this.faceVertexUvs.length;c<e;c++)this.faceVertexUvs[c].splice(d,
|
||
|
1);g=this.vertices.length-b.length;this.vertices=b;return g},setFromPoints:function(a){this.vertices=[];for(var b=0,c=a.length;b<c;b++){var d=a[b];this.vertices.push(new p(d.x,d.y,d.z||0))}return this},sortFacesByMaterialIndex:function(){for(var a=this.faces,b=a.length,c=0;c<b;c++)a[c]._id=c;a.sort(function(a,b){return a.materialIndex-b.materialIndex});var d=this.faceVertexUvs[0],e=this.faceVertexUvs[1],g,k;d&&d.length===b&&(g=[]);e&&e.length===b&&(k=[]);for(c=0;c<b;c++){var l=a[c]._id;g&&g.push(d[l]);
|
||
|
k&&k.push(e[l])}g&&(this.faceVertexUvs[0]=g);k&&(this.faceVertexUvs[1]=k)},toJSON:function(){function a(a,b,c){return c?a|1<<b:a&~(1<<b)}function b(a){var b=a.x.toString()+a.y.toString()+a.z.toString();if(void 0!==m[b])return m[b];m[b]=n.length/3;n.push(a.x,a.y,a.z);return m[b]}function c(a){var b=a.r.toString()+a.g.toString()+a.b.toString();if(void 0!==p[b])return p[b];p[b]=r.length;r.push(a.getHex());return p[b]}function d(a){var b=a.x.toString()+a.y.toString();if(void 0!==q[b])return q[b];q[b]=
|
||
|
t.length/2;t.push(a.x,a.y);return q[b]}var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};e.uuid=this.uuid;e.type=this.type;""!==this.name&&(e.name=this.name);if(void 0!==this.parameters){var g=this.parameters,k;for(k in g)void 0!==g[k]&&(e[k]=g[k]);return e}g=[];for(k=0;k<this.vertices.length;k++){var l=this.vertices[k];g.push(l.x,l.y,l.z)}l=[];var n=[],m={},r=[],p={},t=[],q={};for(k=0;k<this.faces.length;k++){var v=this.faces[k],y=void 0!==this.faceVertexUvs[0][k],A=0<v.normal.length(),
|
||
|
x=0<v.vertexNormals.length,E=1!==v.color.r||1!==v.color.g||1!==v.color.b,z=0<v.vertexColors.length,Q=0;Q=a(Q,0,0);Q=a(Q,1,!0);Q=a(Q,2,!1);Q=a(Q,3,y);Q=a(Q,4,A);Q=a(Q,5,x);Q=a(Q,6,E);Q=a(Q,7,z);l.push(Q);l.push(v.a,v.b,v.c);l.push(v.materialIndex);y&&(y=this.faceVertexUvs[0][k],l.push(d(y[0]),d(y[1]),d(y[2])));A&&l.push(b(v.normal));x&&(A=v.vertexNormals,l.push(b(A[0]),b(A[1]),b(A[2])));E&&l.push(c(v.color));z&&(v=v.vertexColors,l.push(c(v[0]),c(v[1]),c(v[2])))}e.data={};e.data.vertices=g;e.data.normals=
|
||
|
n;0<r.length&&(e.data.colors=r);0<t.length&&(e.data.uvs=[t]);e.data.faces=l;return e},clone:function(){return(new ca).copy(this)},copy:function(a){var b,c,d;this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.name=a.name;var e=a.vertices;var g=0;for(b=e.length;g<b;g++)this.vertices.push(e[g].clone());e=a.colors;g=0;for(b=e.length;g<
|
||
|
b;g++)this.colors.push(e[g].clone());e=a.faces;g=0;for(b=e.length;g<b;g++)this.faces.push(e[g].clone());g=0;for(b=a.faceVertexUvs.length;g<b;g++){var k=a.faceVertexUvs[g];void 0===this.faceVertexUvs[g]&&(this.faceVertexUvs[g]=[]);e=0;for(c=k.length;e<c;e++){var l=k[e],n=[];var m=0;for(d=l.length;m<d;m++)n.push(l[m].clone());this.faceVertexUvs[g].push(n)}}m=a.morphTargets;g=0;for(b=m.length;g<b;g++){d={};d.name=m[g].name;if(void 0!==m[g].vertices)for(d.vertices=[],e=0,c=m[g].vertices.length;e<c;e++)d.vertices.push(m[g].vertices[e].clone());
|
||
|
if(void 0!==m[g].normals)for(d.normals=[],e=0,c=m[g].normals.length;e<c;e++)d.normals.push(m[g].normals[e].clone());this.morphTargets.push(d)}m=a.morphNormals;g=0;for(b=m.length;g<b;g++){d={};if(void 0!==m[g].vertexNormals)for(d.vertexNormals=[],e=0,c=m[g].vertexNormals.length;e<c;e++)k=m[g].vertexNormals[e],l={},l.a=k.a.clone(),l.b=k.b.clone(),l.c=k.c.clone(),d.vertexNormals.push(l);if(void 0!==m[g].faceNormals)for(d.faceNormals=[],e=0,c=m[g].faceNormals.length;e<c;e++)d.faceNormals.push(m[g].faceNormals[e].clone());
|
||
|
this.morphNormals.push(d)}e=a.skinWeights;g=0;for(b=e.length;g<b;g++)this.skinWeights.push(e[g].clone());e=a.skinIndices;g=0;for(b=e.length;g<b;g++)this.skinIndices.push(e[g].clone());e=a.lineDistances;g=0;for(b=e.length;g<b;g++)this.lineDistances.push(e[g]);g=a.boundingBox;null!==g&&(this.boundingBox=g.clone());g=a.boundingSphere;null!==g&&(this.boundingSphere=g.clone());this.elementsNeedUpdate=a.elementsNeedUpdate;this.verticesNeedUpdate=a.verticesNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.normalsNeedUpdate=
|
||
|
a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.lineDistancesNeedUpdate=a.lineDistancesNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Object.defineProperty(fa.prototype,"needsUpdate",{set:function(a){!0===a&&this.version++}});Object.assign(fa.prototype,{isBufferAttribute:!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.itemSize:0;this.array=a;return this},setDynamic:function(a){this.dynamic=a;return this},copy:function(a){this.name=a.name;this.array=new a.array.constructor(a.array);this.itemSize=a.itemSize;this.count=a.count;this.normalized=a.normalized;this.dynamic=a.dynamic;return this},copyAt:function(a,b,c){a*=this.itemSize;c*=b.itemSize;for(var d=0,e=this.itemSize;d<e;d++)this.array[a+d]=b.array[c+d];return this},copyArray:function(a){this.array.set(a);return this},copyColorsArray:function(a){for(var b=
|
||
|
this.array,c=0,d=0,e=a.length;d<e;d++){var g=a[d];void 0===g&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",d),g=new S);b[c++]=g.r;b[c++]=g.g;b[c++]=g.b}return this},copyVector2sArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var g=a[d];void 0===g&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",d),g=new x);b[c++]=g.x;b[c++]=g.y}return this},copyVector3sArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var g=
|
||
|
a[d];void 0===g&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",d),g=new p);b[c++]=g.x;b[c++]=g.y;b[c++]=g.z}return this},copyVector4sArray:function(a){for(var b=this.array,c=0,d=0,e=a.length;d<e;d++){var g=a[d];void 0===g&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",d),g=new ya);b[c++]=g.x;b[c++]=g.y;b[c++]=g.z;b[c++]=g.w}return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},getX:function(a){return this.array[a*
|
||
|
this.itemSize]},setX:function(a,b){this.array[a*this.itemSize]=b;return this},getY:function(a){return this.array[a*this.itemSize+1]},setY:function(a,b){this.array[a*this.itemSize+1]=b;return this},getZ:function(a){return this.array[a*this.itemSize+2]},setZ:function(a,b){this.array[a*this.itemSize+2]=b;return this},getW:function(a){return this.array[a*this.itemSize+3]},setW:function(a,b){this.array[a*this.itemSize+3]=b;return this},setXY:function(a,b,c){a*=this.itemSize;this.array[a+0]=b;this.array[a+
|
||
|
1]=c;return this},setXYZ:function(a,b,c,d){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a*=this.itemSize;this.array[a+0]=b;this.array[a+1]=c;this.array[a+2]=d;this.array[a+3]=e;return this},onUpload:function(a){this.onUploadCallback=a;return this},clone:function(){return(new this.constructor(this.array,this.itemSize)).copy(this)}});Ze.prototype=Object.create(fa.prototype);Ze.prototype.constructor=Ze;$e.prototype=Object.create(fa.prototype);
|
||
|
$e.prototype.constructor=$e;af.prototype=Object.create(fa.prototype);af.prototype.constructor=af;bf.prototype=Object.create(fa.prototype);bf.prototype.constructor=bf;Zc.prototype=Object.create(fa.prototype);Zc.prototype.constructor=Zc;cf.prototype=Object.create(fa.prototype);cf.prototype.constructor=cf;$c.prototype=Object.create(fa.prototype);$c.prototype.constructor=$c;J.prototype=Object.create(fa.prototype);J.prototype.constructor=J;df.prototype=Object.create(fa.prototype);df.prototype.constructor=
|
||
|
df;Object.assign(Og.prototype,{computeGroups:function(a){var b=[],c=void 0;a=a.faces;for(var d=0;d<a.length;d++){var e=a[d];if(e.materialIndex!==c){c=e.materialIndex;void 0!==g&&(g.count=3*d-g.start,b.push(g));var g={start:3*d,materialIndex:c}}}void 0!==g&&(g.count=3*d-g.start,b.push(g));this.groups=b},fromGeometry:function(a){var b=a.faces,c=a.vertices,d=a.faceVertexUvs,e=d[0]&&0<d[0].length,g=d[1]&&0<d[1].length,k=a.morphTargets,l=k.length;if(0<l){var n=[];for(var m=0;m<l;m++)n[m]=[];this.morphTargets.position=
|
||
|
n}var r=a.morphNormals,p=r.length;if(0<p){var t=[];for(m=0;m<p;m++)t[m]=[];this.morphTargets.normal=t}var q=a.skinIndices,v=a.skinWeights,y=q.length===c.length,A=v.length===c.length;for(m=0;m<b.length;m++){var C=b[m];this.vertices.push(c[C.a],c[C.b],c[C.c]);var E=C.vertexNormals;3===E.length?this.normals.push(E[0],E[1],E[2]):(E=C.normal,this.normals.push(E,E,E));E=C.vertexColors;3===E.length?this.colors.push(E[0],E[1],E[2]):(E=C.color,this.colors.push(E,E,E));!0===e&&(E=d[0][m],void 0!==E?this.uvs.push(E[0],
|
||
|
E[1],E[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",m),this.uvs.push(new x,new x,new x)));!0===g&&(E=d[1][m],void 0!==E?this.uvs2.push(E[0],E[1],E[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",m),this.uvs2.push(new x,new x,new x)));for(E=0;E<l;E++){var z=k[E].vertices;n[E].push(z[C.a],z[C.b],z[C.c])}for(E=0;E<p;E++)z=r[E].vertexNormals[m],t[E].push(z.a,z.b,z.c);y&&this.skinIndices.push(q[C.a],q[C.b],q[C.c]);A&&this.skinWeights.push(v[C.a],
|
||
|
v[C.b],v[C.c])}this.computeGroups(a);this.verticesNeedUpdate=a.verticesNeedUpdate;this.normalsNeedUpdate=a.normalsNeedUpdate;this.colorsNeedUpdate=a.colorsNeedUpdate;this.uvsNeedUpdate=a.uvsNeedUpdate;this.groupsNeedUpdate=a.groupsNeedUpdate;return this}});var hk=1;R.prototype=Object.assign(Object.create(K.prototype),{constructor:R,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(a){Array.isArray(a)?this.index=new (65535<Pg(a)?$c:Zc)(a,1):this.index=a},addAttribute:function(a,
|
||
|
b,c){if(b&&b.isBufferAttribute||b&&b.isInterleavedBufferAttribute)if("index"===a)console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(b);else return this.attributes[a]=b,this;else console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(a,new fa(b,c))},getAttribute:function(a){return this.attributes[a]},removeAttribute:function(a){delete this.attributes[a];return this},addGroup:function(a,b,c){this.groups.push({start:a,
|
||
|
count:b,materialIndex:void 0!==c?c:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(a,b){this.drawRange.start=a;this.drawRange.count=b},applyMatrix:function(a){var b=this.attributes.position;void 0!==b&&(a.applyToBufferAttribute(b),b.needsUpdate=!0);b=this.attributes.normal;void 0!==b&&((new Ja).getNormalMatrix(a).applyToBufferAttribute(b),b.needsUpdate=!0);null!==this.boundingBox&&this.computeBoundingBox();null!==this.boundingSphere&&this.computeBoundingSphere();return this},rotateX:function(){var a=
|
||
|
new V;return function(b){a.makeRotationX(b);this.applyMatrix(a);return this}}(),rotateY:function(){var a=new V;return function(b){a.makeRotationY(b);this.applyMatrix(a);return this}}(),rotateZ:function(){var a=new V;return function(b){a.makeRotationZ(b);this.applyMatrix(a);return this}}(),translate:function(){var a=new V;return function(b,c,d){a.makeTranslation(b,c,d);this.applyMatrix(a);return this}}(),scale:function(){var a=new V;return function(b,c,d){a.makeScale(b,c,d);this.applyMatrix(a);return this}}(),
|
||
|
lookAt:function(){var a=new O;return function(b){a.lookAt(b);a.updateMatrix();this.applyMatrix(a.matrix)}}(),center:function(){var a=new p;return function(){this.computeBoundingBox();this.boundingBox.getCenter(a).negate();this.translate(a.x,a.y,a.z);return this}}(),setFromObject:function(a){var b=a.geometry;if(a.isPoints||a.isLine){a=new J(3*b.vertices.length,3);var c=new J(3*b.colors.length,3);this.addAttribute("position",a.copyVector3sArray(b.vertices));this.addAttribute("color",c.copyColorsArray(b.colors));
|
||
|
b.lineDistances&&b.lineDistances.length===b.vertices.length&&(a=new J(b.lineDistances.length,1),this.addAttribute("lineDistance",a.copyArray(b.lineDistances)));null!==b.boundingSphere&&(this.boundingSphere=b.boundingSphere.clone());null!==b.boundingBox&&(this.boundingBox=b.boundingBox.clone())}else a.isMesh&&b&&b.isGeometry&&this.fromGeometry(b);return this},setFromPoints:function(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c];b.push(e.x,e.y,e.z||0)}this.addAttribute("position",new J(b,3));return this},
|
||
|
updateFromObject:function(a){var b=a.geometry;if(a.isMesh){var c=b.__directGeometry;!0===b.elementsNeedUpdate&&(c=void 0,b.elementsNeedUpdate=!1);if(void 0===c)return this.fromGeometry(b);c.verticesNeedUpdate=b.verticesNeedUpdate;c.normalsNeedUpdate=b.normalsNeedUpdate;c.colorsNeedUpdate=b.colorsNeedUpdate;c.uvsNeedUpdate=b.uvsNeedUpdate;c.groupsNeedUpdate=b.groupsNeedUpdate;b.verticesNeedUpdate=!1;b.normalsNeedUpdate=!1;b.colorsNeedUpdate=!1;b.uvsNeedUpdate=!1;b.groupsNeedUpdate=!1;b=c}!0===b.verticesNeedUpdate&&
|
||
|
(c=this.attributes.position,void 0!==c&&(c.copyVector3sArray(b.vertices),c.needsUpdate=!0),b.verticesNeedUpdate=!1);!0===b.normalsNeedUpdate&&(c=this.attributes.normal,void 0!==c&&(c.copyVector3sArray(b.normals),c.needsUpdate=!0),b.normalsNeedUpdate=!1);!0===b.colorsNeedUpdate&&(c=this.attributes.color,void 0!==c&&(c.copyColorsArray(b.colors),c.needsUpdate=!0),b.colorsNeedUpdate=!1);b.uvsNeedUpdate&&(c=this.attributes.uv,void 0!==c&&(c.copyVector2sArray(b.uvs),c.needsUpdate=!0),b.uvsNeedUpdate=!1);
|
||
|
b.lineDistancesNeedUpdate&&(c=this.attributes.lineDistance,void 0!==c&&(c.copyArray(b.lineDistances),c.needsUpdate=!0),b.lineDistancesNeedUpdate=!1);b.groupsNeedUpdate&&(b.computeGroups(a.geometry),this.groups=b.groups,b.groupsNeedUpdate=!1);return this},fromGeometry:function(a){a.__directGeometry=(new Og).fromGeometry(a);return this.fromDirectGeometry(a.__directGeometry)},fromDirectGeometry:function(a){var b=new Float32Array(3*a.vertices.length);this.addAttribute("position",(new fa(b,3)).copyVector3sArray(a.vertices));
|
||
|
0<a.normals.length&&(b=new Float32Array(3*a.normals.length),this.addAttribute("normal",(new fa(b,3)).copyVector3sArray(a.normals)));0<a.colors.length&&(b=new Float32Array(3*a.colors.length),this.addAttribute("color",(new fa(b,3)).copyColorsArray(a.colors)));0<a.uvs.length&&(b=new Float32Array(2*a.uvs.length),this.addAttribute("uv",(new fa(b,2)).copyVector2sArray(a.uvs)));0<a.uvs2.length&&(b=new Float32Array(2*a.uvs2.length),this.addAttribute("uv2",(new fa(b,2)).copyVector2sArray(a.uvs2)));this.groups=
|
||
|
a.groups;for(var c in a.morphTargets){b=[];for(var d=a.morphTargets[c],e=0,g=d.length;e<g;e++){var k=d[e],l=new J(3*k.length,3);b.push(l.copyVector3sArray(k))}this.morphAttributes[c]=b}0<a.skinIndices.length&&(c=new J(4*a.skinIndices.length,4),this.addAttribute("skinIndex",c.copyVector4sArray(a.skinIndices)));0<a.skinWeights.length&&(c=new J(4*a.skinWeights.length,4),this.addAttribute("skinWeight",c.copyVector4sArray(a.skinWeights)));null!==a.boundingSphere&&(this.boundingSphere=a.boundingSphere.clone());
|
||
|
null!==a.boundingBox&&(this.boundingBox=a.boundingBox.clone());return this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new nb);var a=this.attributes.position;void 0!==a?this.boundingBox.setFromBufferAttribute(a):this.boundingBox.makeEmpty();(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 a=new nb,b=new p;return function(){null===this.boundingSphere&&(this.boundingSphere=new pb);var c=this.attributes.position;if(c){var d=this.boundingSphere.center;a.setFromBufferAttribute(c);a.getCenter(d);for(var e=0,g=0,k=c.count;g<k;g++)b.x=c.getX(g),b.y=c.getY(g),b.z=c.getZ(g),e=Math.max(e,d.distanceToSquared(b));this.boundingSphere.radius=Math.sqrt(e);isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',
|
||
|
this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var a=this.index,b=this.attributes,c=this.groups;if(b.position){var d=b.position.array;if(void 0===b.normal)this.addAttribute("normal",new fa(new Float32Array(d.length),3));else for(var e=b.normal.array,g=0,k=e.length;g<k;g++)e[g]=0;e=b.normal.array;var l=new p,n=new p,m=new p,r=new p,q=new p;if(a){a=a.array;0===c.length&&this.addGroup(0,a.length);for(var t=0,u=c.length;t<u;++t){g=c[t];k=g.start;var v=g.count;g=k;for(k+=v;g<
|
||
|
k;g+=3){v=3*a[g+0];var y=3*a[g+1];var A=3*a[g+2];l.fromArray(d,v);n.fromArray(d,y);m.fromArray(d,A);r.subVectors(m,n);q.subVectors(l,n);r.cross(q);e[v]+=r.x;e[v+1]+=r.y;e[v+2]+=r.z;e[y]+=r.x;e[y+1]+=r.y;e[y+2]+=r.z;e[A]+=r.x;e[A+1]+=r.y;e[A+2]+=r.z}}}else for(g=0,k=d.length;g<k;g+=9)l.fromArray(d,g),n.fromArray(d,g+3),m.fromArray(d,g+6),r.subVectors(m,n),q.subVectors(l,n),r.cross(q),e[g]=r.x,e[g+1]=r.y,e[g+2]=r.z,e[g+3]=r.x,e[g+4]=r.y,e[g+5]=r.z,e[g+6]=r.x,e[g+7]=r.y,e[g+8]=r.z;this.normalizeNormals();
|
||
|
b.normal.needsUpdate=!0}},merge:function(a,b){if(a&&a.isBufferGeometry){void 0===b&&(b=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var c=this.attributes,d;for(d in c)if(void 0!==a.attributes[d]){var e=c[d].array,g=a.attributes[d],k=g.array,l=0;for(g=g.itemSize*b;l<k.length;l++,g++)e[g]=k[l]}return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",
|
||
|
a)},normalizeNormals:function(){var a=new p;return function(){for(var b=this.attributes.normal,c=0,d=b.count;c<d;c++)a.x=b.getX(c),a.y=b.getY(c),a.z=b.getZ(c),a.normalize(),b.setXYZ(c,a.x,a.y,a.z)}}(),toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var a=new R,b=this.index.array,c=this.attributes,d;for(d in c){var e=c[d],g=e.array,k=e.itemSize,l=new g.constructor(b.length*k),n=0;e=0;for(var m=b.length;e<
|
||
|
m;e++){var r=b[e]*k;for(var p=0;p<k;p++)l[n++]=g[r++]}a.addAttribute(d,new fa(l,k))}b=this.groups;e=0;for(m=b.length;e<m;e++)c=b[e],a.addGroup(c.start,c.count,c.materialIndex);return a},toJSON:function(){var a={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};a.uuid=this.uuid;a.type=this.type;""!==this.name&&(a.name=this.name);if(void 0!==this.parameters){var b=this.parameters;for(e in b)void 0!==b[e]&&(a[e]=b[e]);return a}a.data={attributes:{}};var c=this.index;null!==
|
||
|
c&&(b=Array.prototype.slice.call(c.array),a.data.index={type:c.array.constructor.name,array:b});c=this.attributes;for(e in c){var d=c[e];b=Array.prototype.slice.call(d.array);a.data.attributes[e]={itemSize:d.itemSize,type:d.array.constructor.name,array:b,normalized:d.normalized}}var e=this.groups;0<e.length&&(a.data.groups=JSON.parse(JSON.stringify(e)));e=this.boundingSphere;null!==e&&(a.data.boundingSphere={center:e.center.toArray(),radius:e.radius});return a},clone:function(){return(new R).copy(this)},
|
||
|
copy:function(a){var b;this.index=null;this.attributes={};this.morphAttributes={};this.groups=[];this.boundingSphere=this.boundingBox=null;this.name=a.name;var c=a.index;null!==c&&this.setIndex(c.clone());c=a.attributes;for(k in c)this.addAttribute(k,c[k].clone());var d=a.morphAttributes;for(k in d){var e=[],g=d[k];c=0;for(b=g.length;c<b;c++)e.push(g[c].clone());this.morphAttributes[k]=e}var k=a.groups;c=0;for(b=k.length;c<b;c++)d=k[c],this.addGroup(d.start,d.count,d.materialIndex);k=a.boundingBox;
|
||
|
null!==k&&(this.boundingBox=k.clone());k=a.boundingSphere;null!==k&&(this.boundingSphere=k.clone());this.drawRange.start=a.drawRange.start;this.drawRange.count=a.drawRange.count;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});ad.prototype=Object.create(ca.prototype);ad.prototype.constructor=ad;$b.prototype=Object.create(R.prototype);$b.prototype.constructor=$b;cd.prototype=Object.create(ca.prototype);cd.prototype.constructor=cd;Mb.prototype=Object.create(R.prototype);Mb.prototype.constructor=
|
||
|
Mb;var ik=0;da.prototype=Object.assign(Object.create(K.prototype),{constructor:da,isMaterial:!0,onBeforeCompile:function(){},setValues:function(a){if(void 0!==a)for(var b in a){var c=a[b];if(void 0===c)console.warn("THREE.Material: '"+b+"' parameter is undefined.");else if("shading"===b)console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===c?!0:!1;else{var d=this[b];void 0===d?console.warn("THREE."+this.type+": '"+b+"' is not a property of this material."):
|
||
|
d&&d.isColor?d.set(c):d&&d.isVector3&&c&&c.isVector3?d.copy(c):this[b]="overdraw"===b?Number(c):c}}},toJSON:function(a){function b(a){var b=[],c;for(c in a){var d=a[c];delete d.metadata;b.push(d)}return b}var c=void 0===a||"string"===typeof a;c&&(a={textures:{},images:{}});var d={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};d.uuid=this.uuid;d.type=this.type;""!==this.name&&(d.name=this.name);this.color&&this.color.isColor&&(d.color=this.color.getHex());void 0!==this.roughness&&
|
||
|
(d.roughness=this.roughness);void 0!==this.metalness&&(d.metalness=this.metalness);this.emissive&&this.emissive.isColor&&(d.emissive=this.emissive.getHex());1!==this.emissiveIntensity&&(d.emissiveIntensity=this.emissiveIntensity);this.specular&&this.specular.isColor&&(d.specular=this.specular.getHex());void 0!==this.shininess&&(d.shininess=this.shininess);void 0!==this.clearCoat&&(d.clearCoat=this.clearCoat);void 0!==this.clearCoatRoughness&&(d.clearCoatRoughness=this.clearCoatRoughness);this.map&&
|
||
|
this.map.isTexture&&(d.map=this.map.toJSON(a).uuid);this.alphaMap&&this.alphaMap.isTexture&&(d.alphaMap=this.alphaMap.toJSON(a).uuid);this.lightMap&&this.lightMap.isTexture&&(d.lightMap=this.lightMap.toJSON(a).uuid);this.bumpMap&&this.bumpMap.isTexture&&(d.bumpMap=this.bumpMap.toJSON(a).uuid,d.bumpScale=this.bumpScale);this.normalMap&&this.normalMap.isTexture&&(d.normalMap=this.normalMap.toJSON(a).uuid,d.normalScale=this.normalScale.toArray());this.displacementMap&&this.displacementMap.isTexture&&
|
||
|
(d.displacementMap=this.displacementMap.toJSON(a).uuid,d.displacementScale=this.displacementScale,d.displacementBias=this.displacementBias);this.roughnessMap&&this.roughnessMap.isTexture&&(d.roughnessMap=this.roughnessMap.toJSON(a).uuid);this.metalnessMap&&this.metalnessMap.isTexture&&(d.metalnessMap=this.metalnessMap.toJSON(a).uuid);this.emissiveMap&&this.emissiveMap.isTexture&&(d.emissiveMap=this.emissiveMap.toJSON(a).uuid);this.specularMap&&this.specularMap.isTexture&&(d.specularMap=this.specularMap.toJSON(a).uuid);
|
||
|
this.envMap&&this.envMap.isTexture&&(d.envMap=this.envMap.toJSON(a).uuid,d.reflectivity=this.reflectivity);this.gradientMap&&this.gradientMap.isTexture&&(d.gradientMap=this.gradientMap.toJSON(a).uuid);void 0!==this.size&&(d.size=this.size);void 0!==this.sizeAttenuation&&(d.sizeAttenuation=this.sizeAttenuation);1!==this.blending&&(d.blending=this.blending);!0===this.flatShading&&(d.flatShading=this.flatShading);0!==this.side&&(d.side=this.side);0!==this.vertexColors&&(d.vertexColors=this.vertexColors);
|
||
|
1>this.opacity&&(d.opacity=this.opacity);!0===this.transparent&&(d.transparent=this.transparent);d.depthFunc=this.depthFunc;d.depthTest=this.depthTest;d.depthWrite=this.depthWrite;0!==this.rotation&&(d.rotation=this.rotation);1!==this.linewidth&&(d.linewidth=this.linewidth);void 0!==this.dashSize&&(d.dashSize=this.dashSize);void 0!==this.gapSize&&(d.gapSize=this.gapSize);void 0!==this.scale&&(d.scale=this.scale);!0===this.dithering&&(d.dithering=!0);0<this.alphaTest&&(d.alphaTest=this.alphaTest);
|
||
|
!0===this.premultipliedAlpha&&(d.premultipliedAlpha=this.premultipliedAlpha);!0===this.wireframe&&(d.wireframe=this.wireframe);1<this.wireframeLinewidth&&(d.wireframeLinewidth=this.wireframeLinewidth);"round"!==this.wireframeLinecap&&(d.wireframeLinecap=this.wireframeLinecap);"round"!==this.wireframeLinejoin&&(d.wireframeLinejoin=this.wireframeLinejoin);!0===this.morphTargets&&(d.morphTargets=!0);!0===this.skinning&&(d.skinning=!0);!1===this.visible&&(d.visible=!1);"{}"!==JSON.stringify(this.userData)&&
|
||
|
(d.userData=this.userData);c&&(c=b(a.textures),a=b(a.images),0<c.length&&(d.textures=c),0<a.length&&(d.images=a));return d},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.name=a.name;this.fog=a.fog;this.lights=a.lights;this.blending=a.blending;this.side=a.side;this.flatShading=a.flatShading;this.vertexColors=a.vertexColors;this.opacity=a.opacity;this.transparent=a.transparent;this.blendSrc=a.blendSrc;this.blendDst=a.blendDst;this.blendEquation=a.blendEquation;this.blendSrcAlpha=
|
||
|
a.blendSrcAlpha;this.blendDstAlpha=a.blendDstAlpha;this.blendEquationAlpha=a.blendEquationAlpha;this.depthFunc=a.depthFunc;this.depthTest=a.depthTest;this.depthWrite=a.depthWrite;this.colorWrite=a.colorWrite;this.precision=a.precision;this.polygonOffset=a.polygonOffset;this.polygonOffsetFactor=a.polygonOffsetFactor;this.polygonOffsetUnits=a.polygonOffsetUnits;this.dithering=a.dithering;this.alphaTest=a.alphaTest;this.premultipliedAlpha=a.premultipliedAlpha;this.overdraw=a.overdraw;this.visible=a.visible;
|
||
|
this.userData=JSON.parse(JSON.stringify(a.userData));this.clipShadows=a.clipShadows;this.clipIntersection=a.clipIntersection;var b=a.clippingPlanes,c=null;if(null!==b){var d=b.length;c=Array(d);for(var e=0;e!==d;++e)c[e]=b[e].clone()}this.clippingPlanes=c;this.shadowSide=a.shadowSide;return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});Ua.prototype=Object.create(da.prototype);Ua.prototype.constructor=Ua;Ua.prototype.isMeshBasicMaterial=!0;Ua.prototype.copy=function(a){da.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.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;return this};la.prototype=Object.create(da.prototype);la.prototype.constructor=la;la.prototype.isShaderMaterial=!0;la.prototype.copy=function(a){da.prototype.copy.call(this,a);this.fragmentShader=a.fragmentShader;this.vertexShader=a.vertexShader;this.uniforms=$a.clone(a.uniforms);this.defines=Object.assign({},a.defines);this.wireframe=a.wireframe;this.wireframeLinewidth=a.wireframeLinewidth;this.lights=a.lights;this.clipping=a.clipping;this.skinning=a.skinning;
|
||
|
this.morphTargets=a.morphTargets;this.morphNormals=a.morphNormals;this.extensions=a.extensions;return this};la.prototype.toJSON=function(a){a=da.prototype.toJSON.call(this,a);a.uniforms=this.uniforms;a.vertexShader=this.vertexShader;a.fragmentShader=this.fragmentShader;return a};Object.assign(sc.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 p);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(){var a=new p;return function(b){this.origin.copy(this.at(b,a));return this}}(),closestPointToPoint:function(a,b){void 0===b&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),b=new p);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(){var a=new p;return function(b){var c=a.subVectors(b,this.origin).dot(this.direction);if(0>c)return this.origin.distanceToSquared(b);a.copy(this.direction).multiplyScalar(c).add(this.origin);return a.distanceToSquared(b)}}(),distanceSqToSegment:function(){var a=new p,b=new p,c=new p;return function(d,
|
||
|
e,g,k){a.copy(d).add(e).multiplyScalar(.5);b.copy(e).sub(d).normalize();c.copy(this.origin).sub(a);var l=.5*d.distanceTo(e),n=-this.direction.dot(b),m=c.dot(this.direction),r=-c.dot(b),p=c.lengthSq(),t=Math.abs(1-n*n);if(0<t){d=n*r-m;e=n*m-r;var q=l*t;0<=d?e>=-q?e<=q?(l=1/t,d*=l,e*=l,n=d*(d+n*e+2*m)+e*(n*d+e+2*r)+p):(e=l,d=Math.max(0,-(n*e+m)),n=-d*d+e*(e+2*r)+p):(e=-l,d=Math.max(0,-(n*e+m)),n=-d*d+e*(e+2*r)+p):e<=-q?(d=Math.max(0,-(-n*l+m)),e=0<d?-l:Math.min(Math.max(-l,-r),l),n=-d*d+e*(e+2*r)+p):
|
||
|
e<=q?(d=0,e=Math.min(Math.max(-l,-r),l),n=e*(e+2*r)+p):(d=Math.max(0,-(n*l+m)),e=0<d?l:Math.min(Math.max(-l,-r),l),n=-d*d+e*(e+2*r)+p)}else e=0<n?-l:l,d=Math.max(0,-(n*e+m)),n=-d*d+e*(e+2*r)+p;g&&g.copy(this.direction).multiplyScalar(d).add(this.origin);k&&k.copy(b).multiplyScalar(e).add(a);return n}}(),intersectSphere:function(){var a=new p;return function(b,c){a.subVectors(b.center,this.origin);var d=a.dot(this.direction),e=a.dot(a)-d*d;b=b.radius*b.radius;if(e>b)return null;b=Math.sqrt(b-e);e=
|
||
|
d-b;d+=b;return 0>e&&0>d?null:0>e?this.at(d,c):this.at(e,c)}}(),intersectsSphere:function(a){return this.distanceToPoint(a.center)<=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,g=this.origin;if(0<=c){var k=(a.min.x-g.x)*c;c*=a.max.x-g.x}else k=(a.max.x-g.x)*c,c*=a.min.x-g.x;if(0<=d){var l=(a.min.y-g.y)*d;d*=a.max.y-g.y}else l=(a.max.y-g.y)*d,d*=a.min.y-g.y;if(k>d||l>c)return null;if(l>k||k!==k)k=l;if(d<c||c!==c)c=d;0<=e?(l=(a.min.z-g.z)*e,a=(a.max.z-g.z)*e):(l=(a.max.z-g.z)*e,a=(a.min.z-g.z)*e);if(k>a||l>c)return null;if(l>k||k!==k)k=l;if(a<c||c!==c)c=a;return 0>
|
||
|
c?null:this.at(0<=k?k:c,b)},intersectsBox:function(){var a=new p;return function(b){return null!==this.intersectBox(b,a)}}(),intersectTriangle:function(){var a=new p,b=new p,c=new p,d=new p;return function(e,g,k,l,n){b.subVectors(g,e);c.subVectors(k,e);d.crossVectors(b,c);g=this.direction.dot(d);if(0<g){if(l)return null;l=1}else if(0>g)l=-1,g=-g;else return null;a.subVectors(this.origin,e);e=l*this.direction.dot(c.crossVectors(a,c));if(0>e)return null;k=l*this.direction.dot(b.cross(a));if(0>k||e+
|
||
|
k>g)return null;e=-l*a.dot(d);return 0>e?null:this.at(e/g,n)}}(),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)}});Object.assign(dd.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 p);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 p);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 p);return this.delta(b).multiplyScalar(a).add(this.start)},closestPointToPointParameter:function(){var a=new p,b=new p;return function(c,d){a.subVectors(c,this.start);b.subVectors(this.end,this.start);c=b.dot(b);c=b.dot(a)/c;d&&(c=ja.clamp(c,0,1));return c}}(),closestPointToPoint:function(a,b,c){a=this.closestPointToPointParameter(a,b);void 0===c&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),c=new p);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)}});Object.assign(cb,{getNormal:function(){var a=new p;return function(b,c,d,e){void 0===e&&(console.warn("THREE.Triangle: .getNormal() target is now required"),e=new p);e.subVectors(d,c);a.subVectors(b,c);e.cross(a);b=e.lengthSq();return 0<b?e.multiplyScalar(1/Math.sqrt(b)):e.set(0,0,0)}}(),getBarycoord:function(){var a=new p,b=new p,c=new p;return function(d,e,g,k,l){a.subVectors(k,
|
||
|
e);b.subVectors(g,e);c.subVectors(d,e);d=a.dot(a);e=a.dot(b);g=a.dot(c);var n=b.dot(b);k=b.dot(c);var m=d*n-e*e;void 0===l&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),l=new p);if(0===m)return l.set(-2,-1,-1);m=1/m;n=(n*g-e*k)*m;d=(d*k-e*g)*m;return l.set(1-n-d,d,n)}}(),containsPoint:function(){var a=new p;return function(b,c,d,e){cb.getBarycoord(b,c,d,e,a);return 0<=a.x&&0<=a.y&&1>=a.x+a.y}}()});Object.assign(cb.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(){var a=new p,b=new p;return function(){a.subVectors(this.c,this.b);b.subVectors(this.a,this.b);return.5*a.cross(b).length()}}(),getMidpoint:function(a){void 0===a&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),
|
||
|
a=new p);return a.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(a){return cb.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 p);return a.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(a,b){return cb.getBarycoord(a,this.a,this.b,this.c,b)},containsPoint:function(a){return cb.containsPoint(a,this.a,this.b,this.c)},intersectsBox:function(a){return a.intersectsTriangle(this)},
|
||
|
closestPointToPoint:function(){var a=new ib,b=[new dd,new dd,new dd],c=new p,d=new p;return function(e,g){void 0===g&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),g=new p);var k=Infinity;a.setFromCoplanarPoints(this.a,this.b,this.c);a.projectPoint(e,c);if(!0===this.containsPoint(c))g.copy(c);else for(b[0].set(this.a,this.b),b[1].set(this.b,this.c),b[2].set(this.c,this.a),e=0;e<b.length;e++){b[e].closestPointToPoint(c,!0,d);var l=c.distanceToSquared(d);l<k&&(k=l,g.copy(d))}return g}}(),
|
||
|
equals:function(a){return a.a.equals(this.a)&&a.b.equals(this.b)&&a.c.equals(this.c)}});ha.prototype=Object.assign(Object.create(O.prototype),{constructor:ha,isMesh:!0,setDrawMode:function(a){this.drawMode=a},copy:function(a){O.prototype.copy.call(this,a);this.drawMode=a.drawMode;void 0!==a.morphTargetInfluences&&(this.morphTargetInfluences=a.morphTargetInfluences.slice());void 0!==a.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},a.morphTargetDictionary));return this},updateMorphTargets:function(){var a=
|
||
|
this.geometry;if(a.isBufferGeometry){a=a.morphAttributes;var b=Object.keys(a);if(0<b.length){var c=a[b[0]];if(void 0!==c)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},a=0,b=c.length;a<b;a++){var d=c[a].name||String(a);this.morphTargetInfluences.push(0);this.morphTargetDictionary[d]=a}}}else if(c=a.morphTargets,void 0!==c&&0<c.length)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},a=0,b=c.length;a<b;a++)d=c[a].name||String(a),this.morphTargetInfluences.push(0),this.morphTargetDictionary[d]=
|
||
|
a},raycast:function(){function a(a,b,c,d,e,g,k){cb.getBarycoord(a,b,c,d,y);e.multiplyScalar(y.x);g.multiplyScalar(y.y);k.multiplyScalar(y.z);e.add(g).add(k);return e.clone()}function b(a,b,c,d,e,g,k,l){if(null===(1===b.side?d.intersectTriangle(k,g,e,!0,l):d.intersectTriangle(e,g,k,2!==b.side,l)))return null;C.copy(l);C.applyMatrix4(a.matrixWorld);b=c.ray.origin.distanceTo(C);return b<c.near||b>c.far?null:{distance:b,point:C.clone(),object:a}}function c(c,d,e,g,m,r,p,q){k.fromBufferAttribute(g,r);
|
||
|
l.fromBufferAttribute(g,p);n.fromBufferAttribute(g,q);if(c=b(c,c.material,d,e,k,l,n,A))m&&(t.fromBufferAttribute(m,r),u.fromBufferAttribute(m,p),v.fromBufferAttribute(m,q),c.uv=a(A,k,l,n,t,u,v)),m=new Zb(r,p,q),cb.getNormal(k,l,n,m.normal),c.face=m,c.faceIndex=r;return c}var d=new V,e=new sc,g=new pb,k=new p,l=new p,n=new p,m=new p,r=new p,q=new p,t=new x,u=new x,v=new x,y=new p,A=new p,C=new p;return function(p,w){var y=this.geometry,x=this.material,C=this.matrixWorld;if(void 0!==x&&(null===y.boundingSphere&&
|
||
|
y.computeBoundingSphere(),g.copy(y.boundingSphere),g.applyMatrix4(C),!1!==p.ray.intersectsSphere(g)&&(d.getInverse(C),e.copy(p.ray).applyMatrix4(d),null===y.boundingBox||!1!==e.intersectsBox(y.boundingBox)))){var E;if(y.isBufferGeometry){x=y.index;var z=y.attributes.position;y=y.attributes.uv;var B;if(null!==x)for(C=0,B=x.count;C<B;C+=3){var F=x.getX(C);var D=x.getX(C+1);var G=x.getX(C+2);if(E=c(this,p,e,z,y,F,D,G))E.faceIndex=Math.floor(C/3),w.push(E)}else if(void 0!==z)for(C=0,B=z.count;C<B;C+=
|
||
|
3)F=C,D=C+1,G=C+2,(E=c(this,p,e,z,y,F,D,G))&&w.push(E)}else if(y.isGeometry){C=Array.isArray(x);B=y.vertices;F=y.faces;D=y.faceVertexUvs[0];0<D.length&&(z=D);for(var H=0,N=F.length;H<N;H++){var J=F[H];E=C?x[J.materialIndex]:x;if(void 0!==E){D=B[J.a];G=B[J.b];var L=B[J.c];if(!0===E.morphTargets){var K=y.morphTargets,O=this.morphTargetInfluences;k.set(0,0,0);l.set(0,0,0);n.set(0,0,0);for(var P=0,S=K.length;P<S;P++){var R=O[P];if(0!==R){var T=K[P].vertices;k.addScaledVector(m.subVectors(T[J.a],D),R);
|
||
|
l.addScaledVector(r.subVectors(T[J.b],G),R);n.addScaledVector(q.subVectors(T[J.c],L),R)}}k.add(D);l.add(G);n.add(L);D=k;G=l;L=n}if(E=b(this,E,p,e,D,G,L,A))z&&z[H]&&(K=z[H],t.copy(K[0]),u.copy(K[1]),v.copy(K[2]),E.uv=a(A,D,G,L,t,u,v)),E.face=J,E.faceIndex=H,w.push(E)}}}}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});ac.prototype=Object.create(ra.prototype);ac.prototype.constructor=ac;ac.prototype.isCubeTexture=!0;Object.defineProperty(ac.prototype,"images",
|
||
|
{get:function(){return this.image},set:function(a){this.image=a}});var Vg=new ra,Wg=new ac,Qg=[],Sg=[],Ug=new Float32Array(16),Tg=new Float32Array(9);$g.prototype.setValue=function(a,b){for(var c=this.seq,d=0,e=c.length;d!==e;++d){var g=c[d];g.setValue(a,b[g.id])}};var ff=/([\w\d_]+)(\])?(\[|\.)?/g;Nb.prototype.setValue=function(a,b,c){b=this.map[b];void 0!==b&&b.setValue(a,c,this.renderer)};Nb.prototype.setOptional=function(a,b,c){b=b[c];void 0!==b&&this.setValue(a,c,b)};Nb.upload=function(a,b,c,
|
||
|
d){for(var e=0,g=b.length;e!==g;++e){var k=b[e],l=c[k.id];!1!==l.needsUpdate&&k.setValue(a,l.value,d)}};Nb.seqWithValue=function(a,b){for(var c=[],d=0,e=a.length;d!==e;++d){var g=a[d];g.id in b&&c.push(g)}return c};var Yk=0,gl=0;Ob.prototype=Object.create(da.prototype);Ob.prototype.constructor=Ob;Ob.prototype.isMeshDepthMaterial=!0;Ob.prototype.copy=function(a){da.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};bc.prototype=Object.create(da.prototype);bc.prototype.constructor=bc;bc.prototype.isMeshDistanceMaterial=!0;bc.prototype.copy=function(a){da.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};he.prototype=Object.create(ra.prototype);he.prototype.constructor=he;Ba.prototype=Object.assign(Object.create(Ab.prototype),{constructor:Ba,isPerspectiveCamera:!0,copy:function(a,b){Ab.prototype.copy.call(this,a,b);this.fov=a.fov;this.zoom=a.zoom;this.near=
|
||
|
a.near;this.far=a.far;this.focus=a.focus;this.aspect=a.aspect;this.view=null===a.view?null:Object.assign({},a.view);this.filmGauge=a.filmGauge;this.filmOffset=a.filmOffset;return this},setFocalLength:function(a){a=.5*this.getFilmHeight()/a;this.fov=2*ja.RAD2DEG*Math.atan(a);this.updateProjectionMatrix()},getFocalLength:function(){var a=Math.tan(.5*ja.DEG2RAD*this.fov);return.5*this.getFilmHeight()/a},getEffectiveFOV:function(){return 2*ja.RAD2DEG*Math.atan(Math.tan(.5*ja.DEG2RAD*this.fov)/this.zoom)},
|
||
|
getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(a,b,c,d,e,g){this.aspect=a/b;null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1});this.view.enabled=!0;this.view.fullWidth=a;this.view.fullHeight=b;this.view.offsetX=c;this.view.offsetY=d;this.view.width=e;this.view.height=g;this.updateProjectionMatrix()},clearViewOffset:function(){null!==
|
||
|
this.view&&(this.view.enabled=!1);this.updateProjectionMatrix()},updateProjectionMatrix:function(){var a=this.near,b=a*Math.tan(.5*ja.DEG2RAD*this.fov)/this.zoom,c=2*b,d=this.aspect*c,e=-.5*d,g=this.view;if(null!==this.view&&this.view.enabled){var k=g.fullWidth,l=g.fullHeight;e+=g.offsetX*d/k;b-=g.offsetY*c/l;d*=g.width/k;c*=g.height/l}g=this.filmOffset;0!==g&&(e+=a*g/this.getFilmWidth());this.projectionMatrix.makePerspective(e,e+d,b,b-c,a,this.far)},toJSON:function(a){a=O.prototype.toJSON.call(this,
|
||
|
a);a.object.fov=this.fov;a.object.zoom=this.zoom;a.object.near=this.near;a.object.far=this.far;a.object.focus=this.focus;a.object.aspect=this.aspect;null!==this.view&&(a.object.view=Object.assign({},this.view));a.object.filmGauge=this.filmGauge;a.object.filmOffset=this.filmOffset;return a}});jf.prototype=Object.assign(Object.create(Ba.prototype),{constructor:jf,isArrayCamera:!0});vc.prototype.isFogExp2=!0;vc.prototype.clone=function(){return new vc(this.color.getHex(),this.density)};vc.prototype.toJSON=
|
||
|
function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}};wc.prototype.isFog=!0;wc.prototype.clone=function(){return new wc(this.color.getHex(),this.near,this.far)};wc.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}};xc.prototype=Object.assign(Object.create(O.prototype),{constructor:xc,copy:function(a,b){O.prototype.copy.call(this,a,b);null!==a.background&&(this.background=a.background.clone());null!==a.fog&&(this.fog=a.fog.clone());
|
||
|
null!==a.overrideMaterial&&(this.overrideMaterial=a.overrideMaterial.clone());this.autoUpdate=a.autoUpdate;this.matrixAutoUpdate=a.matrixAutoUpdate;return this},toJSON:function(a){var b=O.prototype.toJSON.call(this,a);null!==this.background&&(b.object.background=this.background.toJSON(a));null!==this.fog&&(b.object.fog=this.fog.toJSON());return b}});cc.prototype=Object.create(da.prototype);cc.prototype.constructor=cc;cc.prototype.isSpriteMaterial=!0;cc.prototype.copy=function(a){da.prototype.copy.call(this,
|
||
|
a);this.color.copy(a.color);this.map=a.map;this.rotation=a.rotation;return this};lf.prototype=Object.assign(Object.create(O.prototype),{constructor:lf,isSprite:!0,raycast:function(){var a=new p,b=new p,c=new p;return function(d,e){b.setFromMatrixPosition(this.matrixWorld);d.ray.closestPointToPoint(b,a);c.setFromMatrixScale(this.matrixWorld);var g=c.x*c.y/4;b.distanceToSquared(a)>g||(g=d.ray.origin.distanceTo(a),g<d.near||g>d.far||e.push({distance:g,point:a.clone(),face:null,object:this}))}}(),clone:function(){return(new this.constructor(this.material)).copy(this)},
|
||
|
copy:function(a){O.prototype.copy.call(this,a);void 0!==a.center&&this.center.copy(a.center);return this}});ie.prototype=Object.assign(Object.create(O.prototype),{constructor:ie,copy:function(a){O.prototype.copy.call(this,a,!1);a=a.levels;for(var b=0,c=a.length;b<c;b++){var d=a[b];this.addLevel(d.object.clone(),d.distance)}return this},addLevel:function(a,b){void 0===b&&(b=0);b=Math.abs(b);for(var c=this.levels,d=0;d<c.length&&!(b<c[d].distance);d++);c.splice(d,0,{distance:b,object:a});this.add(a)},
|
||
|
getObjectForDistance:function(a){for(var b=this.levels,c=1,d=b.length;c<d&&!(a<b[c].distance);c++);return b[c-1].object},raycast:function(){var a=new p;return function(b,c){a.setFromMatrixPosition(this.matrixWorld);var d=b.ray.origin.distanceTo(a);this.getObjectForDistance(d).raycast(b,c)}}(),update:function(){var a=new p,b=new p;return function(c){var d=this.levels;if(1<d.length){a.setFromMatrixPosition(c.matrixWorld);b.setFromMatrixPosition(this.matrixWorld);c=a.distanceTo(b);d[0].object.visible=
|
||
|
!0;for(var e=1,g=d.length;e<g;e++)if(c>=d[e].distance)d[e-1].object.visible=!1,d[e].object.visible=!0;else break;for(;e<g;e++)d[e].object.visible=!1}}}(),toJSON:function(a){a=O.prototype.toJSON.call(this,a);a.object.levels=[];for(var b=this.levels,c=0,d=b.length;c<d;c++){var e=b[c];a.object.levels.push({object:e.object.uuid,distance:e.distance})}return a}});Object.assign(je.prototype,{calculateInverses:function(){this.boneInverses=[];for(var a=0,b=this.bones.length;a<b;a++){var c=new V;this.bones[a]&&
|
||
|
c.getInverse(this.bones[a].matrixWorld);this.boneInverses.push(c)}},pose:function(){var a,b;var c=0;for(b=this.bones.length;c<b;c++)(a=this.bones[c])&&a.matrixWorld.getInverse(this.boneInverses[c]);c=0;for(b=this.bones.length;c<b;c++)if(a=this.bones[c])a.parent&&a.parent.isBone?(a.matrix.getInverse(a.parent.matrixWorld),a.matrix.multiply(a.matrixWorld)):a.matrix.copy(a.matrixWorld),a.matrix.decompose(a.position,a.quaternion,a.scale)},update:function(){var a=new V,b=new V;return function(){for(var c=
|
||
|
this.bones,d=this.boneInverses,e=this.boneMatrices,g=this.boneTexture,k=0,l=c.length;k<l;k++)a.multiplyMatrices(c[k]?c[k].matrixWorld:b,d[k]),a.toArray(e,16*k);void 0!==g&&(g.needsUpdate=!0)}}(),clone:function(){return new je(this.bones,this.boneInverses)},getBoneByName:function(a){for(var b=0,c=this.bones.length;b<c;b++){var d=this.bones[b];if(d.name===a)return d}}});mf.prototype=Object.assign(Object.create(O.prototype),{constructor:mf,isBone:!0});ke.prototype=Object.assign(Object.create(ha.prototype),
|
||
|
{constructor:ke,isSkinnedMesh:!0,initBones:function(){var a=[],b;if(this.geometry&&void 0!==this.geometry.bones){var c=0;for(b=this.geometry.bones.length;c<b;c++){var d=this.geometry.bones[c];var e=new mf;a.push(e);e.name=d.name;e.position.fromArray(d.pos);e.quaternion.fromArray(d.rotq);void 0!==d.scl&&e.scale.fromArray(d.scl)}c=0;for(b=this.geometry.bones.length;c<b;c++)d=this.geometry.bones[c],-1!==d.parent&&null!==d.parent&&void 0!==a[d.parent]?a[d.parent].add(a[c]):this.add(a[c])}this.updateMatrixWorld(!0);
|
||
|
return a},bind:function(a,b){this.skeleton=a;void 0===b&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),b=this.matrixWorld);this.bindMatrix.copy(b);this.bindMatrixInverse.getInverse(b)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){var a;if(this.geometry&&this.geometry.isGeometry)for(a=0;a<this.geometry.skinWeights.length;a++){var b=this.geometry.skinWeights[a];var c=1/b.manhattanLength();Infinity!==c?b.multiplyScalar(c):b.set(1,0,0,0)}else if(this.geometry&&
|
||
|
this.geometry.isBufferGeometry){b=new ya;var d=this.geometry.attributes.skinWeight;for(a=0;a<d.count;a++)b.x=d.getX(a),b.y=d.getY(a),b.z=d.getZ(a),b.w=d.getW(a),c=1/b.manhattanLength(),Infinity!==c?b.multiplyScalar(c):b.set(1,0,0,0),d.setXYZW(a,b.x,b.y,b.z,b.w)}},updateMatrixWorld:function(a){ha.prototype.updateMatrixWorld.call(this,a);"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+
|
||
|
this.bindMode)},clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});za.prototype=Object.create(da.prototype);za.prototype.constructor=za;za.prototype.isLineBasicMaterial=!0;za.prototype.copy=function(a){da.prototype.copy.call(this,a);this.color.copy(a.color);this.linewidth=a.linewidth;this.linecap=a.linecap;this.linejoin=a.linejoin;return this};Va.prototype=Object.assign(Object.create(O.prototype),{constructor:Va,isLine:!0,computeLineDistances:function(){var a=
|
||
|
new p,b=new p;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===c.index){for(var d=c.attributes.position,e=[0],g=1,k=d.count;g<k;g++)a.fromBufferAttribute(d,g-1),b.fromBufferAttribute(d,g),e[g]=e[g-1],e[g]+=a.distanceTo(b);c.addAttribute("lineDistance",new J(e,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(c.isGeometry)for(d=c.vertices,e=c.lineDistances,e[0]=0,g=1,k=d.length;g<k;g++)e[g]=e[g-1],e[g]+=
|
||
|
d[g-1].distanceTo(d[g]);return this}}(),raycast:function(){var a=new V,b=new sc,c=new pb;return function(d,e){var g=d.linePrecision;g*=g;var k=this.geometry,l=this.matrixWorld;null===k.boundingSphere&&k.computeBoundingSphere();c.copy(k.boundingSphere);c.applyMatrix4(l);if(!1!==d.ray.intersectsSphere(c)){a.getInverse(l);b.copy(d.ray).applyMatrix4(a);var n=new p,m=new p;l=new p;var r=new p,q=this&&this.isLineSegments?2:1;if(k.isBufferGeometry){var t=k.index,u=k.attributes.position.array;if(null!==t){t=
|
||
|
t.array;k=0;for(var v=t.length-1;k<v;k+=q){var y=t[k+1];n.fromArray(u,3*t[k]);m.fromArray(u,3*y);y=b.distanceSqToSegment(n,m,r,l);y>g||(r.applyMatrix4(this.matrixWorld),y=d.ray.origin.distanceTo(r),y<d.near||y>d.far||e.push({distance:y,point:l.clone().applyMatrix4(this.matrixWorld),index:k,face:null,faceIndex:null,object:this}))}}else for(k=0,v=u.length/3-1;k<v;k+=q)n.fromArray(u,3*k),m.fromArray(u,3*k+3),y=b.distanceSqToSegment(n,m,r,l),y>g||(r.applyMatrix4(this.matrixWorld),y=d.ray.origin.distanceTo(r),
|
||
|
y<d.near||y>d.far||e.push({distance:y,point:l.clone().applyMatrix4(this.matrixWorld),index:k,face:null,faceIndex:null,object:this}))}else if(k.isGeometry)for(n=k.vertices,m=n.length,k=0;k<m-1;k+=q)y=b.distanceSqToSegment(n[k],n[k+1],r,l),y>g||(r.applyMatrix4(this.matrixWorld),y=d.ray.origin.distanceTo(r),y<d.near||y>d.far||e.push({distance:y,point:l.clone().applyMatrix4(this.matrixWorld),index:k,face:null,faceIndex:null,object:this}))}}}(),clone:function(){return(new this.constructor(this.geometry,
|
||
|
this.material)).copy(this)}});Ca.prototype=Object.assign(Object.create(Va.prototype),{constructor:Ca,isLineSegments:!0,computeLineDistances:function(){var a=new p,b=new p;return function(){var c=this.geometry;if(c.isBufferGeometry)if(null===c.index){for(var d=c.attributes.position,e=[],g=0,k=d.count;g<k;g+=2)a.fromBufferAttribute(d,g),b.fromBufferAttribute(d,g+1),e[g]=0===g?0:e[g-1],e[g+1]=e[g]+a.distanceTo(b);c.addAttribute("lineDistance",new J(e,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");
|
||
|
else if(c.isGeometry)for(d=c.vertices,e=c.lineDistances,g=0,k=d.length;g<k;g+=2)a.copy(d[g]),b.copy(d[g+1]),e[g]=0===g?0:e[g-1],e[g+1]=e[g]+a.distanceTo(b);return this}}()});nf.prototype=Object.assign(Object.create(Va.prototype),{constructor:nf,isLineLoop:!0});dc.prototype=Object.create(da.prototype);dc.prototype.constructor=dc;dc.prototype.isPointsMaterial=!0;dc.prototype.copy=function(a){da.prototype.copy.call(this,a);this.color.copy(a.color);this.map=a.map;this.size=a.size;this.sizeAttenuation=
|
||
|
a.sizeAttenuation;return this};of.prototype=Object.assign(Object.create(O.prototype),{constructor:of,isPoints:!0,raycast:function(){var a=new V,b=new sc,c=new pb;return function(d,e){function g(a,c){var g=b.distanceSqToPoint(a);g<r&&(b.closestPointToPoint(a,q),q.applyMatrix4(n),a=d.ray.origin.distanceTo(q),a<d.near||a>d.far||e.push({distance:a,distanceToRay:Math.sqrt(g),point:q.clone(),index:c,face:null,object:k}))}var k=this,l=this.geometry,n=this.matrixWorld,m=d.params.Points.threshold;null===l.boundingSphere&&
|
||
|
l.computeBoundingSphere();c.copy(l.boundingSphere);c.applyMatrix4(n);c.radius+=m;if(!1!==d.ray.intersectsSphere(c)){a.getInverse(n);b.copy(d.ray).applyMatrix4(a);m/=(this.scale.x+this.scale.y+this.scale.z)/3;var r=m*m;m=new p;var q=new p;if(l.isBufferGeometry){var t=l.index;l=l.attributes.position.array;if(null!==t){var u=t.array;t=0;for(var v=u.length;t<v;t++){var y=u[t];m.fromArray(l,3*y);g(m,y)}}else for(t=0,u=l.length/3;t<u;t++)m.fromArray(l,3*t),g(m,t)}else for(m=l.vertices,t=0,u=m.length;t<
|
||
|
u;t++)g(m[t],t)}}}(),clone:function(){return(new this.constructor(this.geometry,this.material)).copy(this)}});pf.prototype=Object.assign(Object.create(O.prototype),{constructor:pf,isGroup:!0});hh.prototype=Object.assign(Object.create(ra.prototype),{constructor:hh,isVideoTexture:!0,update:function(){var a=this.image;a.readyState>=a.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});fd.prototype=Object.create(ra.prototype);fd.prototype.constructor=fd;fd.prototype.isCompressedTexture=!0;gd.prototype=Object.create(ra.prototype);
|
||
|
gd.prototype.constructor=gd;gd.prototype.isDepthTexture=!0;le.prototype=Object.create(R.prototype);le.prototype.constructor=le;hd.prototype=Object.create(ca.prototype);hd.prototype.constructor=hd;yc.prototype=Object.create(R.prototype);yc.prototype.constructor=yc;id.prototype=Object.create(ca.prototype);id.prototype.constructor=id;Wa.prototype=Object.create(R.prototype);Wa.prototype.constructor=Wa;jd.prototype=Object.create(ca.prototype);jd.prototype.constructor=jd;zc.prototype=Object.create(Wa.prototype);
|
||
|
zc.prototype.constructor=zc;kd.prototype=Object.create(ca.prototype);kd.prototype.constructor=kd;ec.prototype=Object.create(Wa.prototype);ec.prototype.constructor=ec;ld.prototype=Object.create(ca.prototype);ld.prototype.constructor=ld;Ac.prototype=Object.create(Wa.prototype);Ac.prototype.constructor=Ac;md.prototype=Object.create(ca.prototype);md.prototype.constructor=md;Bc.prototype=Object.create(Wa.prototype);Bc.prototype.constructor=Bc;nd.prototype=Object.create(ca.prototype);nd.prototype.constructor=
|
||
|
nd;Cc.prototype=Object.create(R.prototype);Cc.prototype.constructor=Cc;od.prototype=Object.create(ca.prototype);od.prototype.constructor=od;Dc.prototype=Object.create(R.prototype);Dc.prototype.constructor=Dc;pd.prototype=Object.create(ca.prototype);pd.prototype.constructor=pd;qd.prototype=Object.create(R.prototype);qd.prototype.constructor=qd;var mm={triangulate:function(a,b,c){c=c||2;var d=b&&b.length,e=d?b[0]*c:a.length,g=ih(a,0,e,c,!0),k=[];if(!g)return k;var l;if(d){var n=c;d=[];var m;var r=0;
|
||
|
for(m=b.length;r<m;r++){var p=b[r]*n;var q=r<m-1?b[r+1]*n:a.length;p=ih(a,p,q,n,!1);p===p.next&&(p.steiner=!0);d.push(rl(p))}d.sort(pl);for(r=0;r<d.length;r++){b=d[r];n=g;if(n=ql(b,n))b=lh(n,b),sd(b,b.next);g=sd(g,g.next)}}if(a.length>80*c){var u=l=a[0];var v=d=a[1];for(n=c;n<e;n+=c)r=a[n],b=a[n+1],r<u&&(u=r),b<v&&(v=b),r>l&&(l=r),b>d&&(d=b);l=Math.max(l-u,d-v);l=0!==l?1/l:0}td(g,k,c,u,v,l);return k}},Qb={area:function(a){for(var b=a.length,c=0,d=b-1,e=0;e<b;d=e++)c+=a[d].x*a[e].y-a[e].x*a[d].y;return.5*
|
||
|
c},isClockWise:function(a){return 0>Qb.area(a)},triangulateShape:function(a,b){var c=[],d=[],e=[];mh(a);nh(c,a);var g=a.length;b.forEach(mh);for(a=0;a<b.length;a++)d.push(g),g+=b[a].length,nh(c,b[a]);b=mm.triangulate(c,d);for(a=0;a<b.length;a+=3)e.push(b.slice(a,a+3));return e}};Ec.prototype=Object.create(ca.prototype);Ec.prototype.constructor=Ec;Pb.prototype=Object.create(R.prototype);Pb.prototype.constructor=Pb;var sl={generateTopUV:function(a,b,c,d,e){a=b[3*d];d=b[3*d+1];var g=b[3*e];e=b[3*e+1];
|
||
|
return[new x(b[3*c],b[3*c+1]),new x(a,d),new x(g,e)]},generateSideWallUV:function(a,b,c,d,e,g){a=b[3*c];var k=b[3*c+1];c=b[3*c+2];var l=b[3*d],n=b[3*d+1];d=b[3*d+2];var m=b[3*e],r=b[3*e+1];e=b[3*e+2];var p=b[3*g],q=b[3*g+1];b=b[3*g+2];return.01>Math.abs(k-n)?[new x(a,1-c),new x(l,1-d),new x(m,1-e),new x(p,1-b)]:[new x(k,1-c),new x(n,1-d),new x(r,1-e),new x(q,1-b)]}};vd.prototype=Object.create(ca.prototype);vd.prototype.constructor=vd;wd.prototype=Object.create(Pb.prototype);wd.prototype.constructor=
|
||
|
wd;xd.prototype=Object.create(ca.prototype);xd.prototype.constructor=xd;gc.prototype=Object.create(R.prototype);gc.prototype.constructor=gc;yd.prototype=Object.create(ca.prototype);yd.prototype.constructor=yd;Fc.prototype=Object.create(R.prototype);Fc.prototype.constructor=Fc;zd.prototype=Object.create(ca.prototype);zd.prototype.constructor=zd;Gc.prototype=Object.create(R.prototype);Gc.prototype.constructor=Gc;hc.prototype=Object.create(ca.prototype);hc.prototype.constructor=hc;hc.prototype.toJSON=
|
||
|
function(){var a=ca.prototype.toJSON.call(this);return oh(this.parameters.shapes,a)};ic.prototype=Object.create(R.prototype);ic.prototype.constructor=ic;ic.prototype.toJSON=function(){var a=R.prototype.toJSON.call(this);return oh(this.parameters.shapes,a)};ne.prototype=Object.create(R.prototype);ne.prototype.constructor=ne;jc.prototype=Object.create(ca.prototype);jc.prototype.constructor=jc;Bb.prototype=Object.create(R.prototype);Bb.prototype.constructor=Bb;Ad.prototype=Object.create(jc.prototype);
|
||
|
Ad.prototype.constructor=Ad;Bd.prototype=Object.create(Bb.prototype);Bd.prototype.constructor=Bd;Cd.prototype=Object.create(ca.prototype);Cd.prototype.constructor=Cd;Hc.prototype=Object.create(R.prototype);Hc.prototype.constructor=Hc;var bb=Object.freeze({WireframeGeometry:le,ParametricGeometry:hd,ParametricBufferGeometry:yc,TetrahedronGeometry:jd,TetrahedronBufferGeometry:zc,OctahedronGeometry:kd,OctahedronBufferGeometry:ec,IcosahedronGeometry:ld,IcosahedronBufferGeometry:Ac,DodecahedronGeometry:md,
|
||
|
DodecahedronBufferGeometry:Bc,PolyhedronGeometry:id,PolyhedronBufferGeometry:Wa,TubeGeometry:nd,TubeBufferGeometry:Cc,TorusKnotGeometry:od,TorusKnotBufferGeometry:Dc,TorusGeometry:pd,TorusBufferGeometry:qd,TextGeometry:vd,TextBufferGeometry:wd,SphereGeometry:xd,SphereBufferGeometry:gc,RingGeometry:yd,RingBufferGeometry:Fc,PlaneGeometry:cd,PlaneBufferGeometry:Mb,LatheGeometry:zd,LatheBufferGeometry:Gc,ShapeGeometry:hc,ShapeBufferGeometry:ic,ExtrudeGeometry:Ec,ExtrudeBufferGeometry:Pb,EdgesGeometry:ne,
|
||
|
ConeGeometry:Ad,ConeBufferGeometry:Bd,CylinderGeometry:jc,CylinderBufferGeometry:Bb,CircleGeometry:Cd,CircleBufferGeometry:Hc,BoxGeometry:ad,BoxBufferGeometry:$b});Ic.prototype=Object.create(da.prototype);Ic.prototype.constructor=Ic;Ic.prototype.isShadowMaterial=!0;Ic.prototype.copy=function(a){da.prototype.copy.call(this,a);this.color.copy(a.color);return this};Dd.prototype=Object.create(la.prototype);Dd.prototype.constructor=Dd;Dd.prototype.isRawShaderMaterial=!0;Cb.prototype=Object.create(da.prototype);
|
||
|
Cb.prototype.constructor=Cb;Cb.prototype.isMeshStandardMaterial=!0;Cb.prototype.copy=function(a){da.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.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};Jc.prototype=Object.create(Cb.prototype);Jc.prototype.constructor=Jc;Jc.prototype.isMeshPhysicalMaterial=!0;Jc.prototype.copy=function(a){Cb.prototype.copy.call(this,a);this.defines={PHYSICAL:""};this.reflectivity=a.reflectivity;this.clearCoat=a.clearCoat;this.clearCoatRoughness=a.clearCoatRoughness;return this};rb.prototype=Object.create(da.prototype);
|
||
|
rb.prototype.constructor=rb;rb.prototype.isMeshPhongMaterial=!0;rb.prototype.copy=function(a){da.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.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};Kc.prototype=Object.create(rb.prototype);Kc.prototype.constructor=Kc;Kc.prototype.isMeshToonMaterial=!0;Kc.prototype.copy=function(a){rb.prototype.copy.call(this,a);this.gradientMap=a.gradientMap;return this};Lc.prototype=Object.create(da.prototype);Lc.prototype.constructor=Lc;Lc.prototype.isMeshNormalMaterial=!0;Lc.prototype.copy=function(a){da.prototype.copy.call(this,a);this.bumpMap=a.bumpMap;
|
||
|
this.bumpScale=a.bumpScale;this.normalMap=a.normalMap;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};Mc.prototype=Object.create(da.prototype);Mc.prototype.constructor=Mc;Mc.prototype.isMeshLambertMaterial=!0;Mc.prototype.copy=
|
||
|
function(a){da.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};Nc.prototype=Object.create(za.prototype);Nc.prototype.constructor=Nc;Nc.prototype.isLineDashedMaterial=!0;Nc.prototype.copy=function(a){za.prototype.copy.call(this,a);this.scale=a.scale;this.dashSize=a.dashSize;this.gapSize=a.gapSize;return this};var nm=Object.freeze({ShadowMaterial:Ic,
|
||
|
SpriteMaterial:cc,RawShaderMaterial:Dd,ShaderMaterial:la,PointsMaterial:dc,MeshPhysicalMaterial:Jc,MeshStandardMaterial:Cb,MeshPhongMaterial:rb,MeshToonMaterial:Kc,MeshNormalMaterial:Lc,MeshLambertMaterial:Mc,MeshDepthMaterial:Ob,MeshDistanceMaterial:bc,MeshBasicMaterial:Ua,LineDashedMaterial:Nc,LineBasicMaterial:za,Material:da}),Te={enabled:!1,files:{},add:function(a,b){!1!==this.enabled&&(this.files[a]=b)},get:function(a){if(!1!==this.enabled)return this.files[a]},remove:function(a){delete this.files[a]},
|
||
|
clear:function(){this.files={}}},db=new ph,Kb={};Object.assign(Db.prototype,{load:function(a,b,c,d){void 0===a&&(a="");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var e=this,g=Te.get(a);if(void 0!==g)return e.manager.itemStart(a),setTimeout(function(){b&&b(g);e.manager.itemEnd(a)},0),g;if(void 0!==Kb[a])Kb[a].push({onLoad:b,onProgress:c,onError:d});else{var k=a.match(/^data:(.*?)(;base64)?,(.*)$/);if(k){c=k[1];var l=!!k[2];k=k[3];k=window.decodeURIComponent(k);l&&(k=window.atob(k));
|
||
|
try{var n=(this.responseType||"").toLowerCase();switch(n){case "arraybuffer":case "blob":var m=new Uint8Array(k.length);for(l=0;l<k.length;l++)m[l]=k.charCodeAt(l);var r="blob"===n?new Blob([m.buffer],{type:c}):m.buffer;break;case "document":r=(new DOMParser).parseFromString(k,c);break;case "json":r=JSON.parse(k);break;default:r=k}window.setTimeout(function(){b&&b(r);e.manager.itemEnd(a)},0)}catch(t){window.setTimeout(function(){d&&d(t);e.manager.itemEnd(a);e.manager.itemError(a)},0)}}else{Kb[a]=
|
||
|
[];Kb[a].push({onLoad:b,onProgress:c,onError:d});var p=new XMLHttpRequest;p.open("GET",a,!0);p.addEventListener("load",function(b){var c=this.response;Te.add(a,c);var d=Kb[a];delete Kb[a];if(200===this.status){for(var g=0,k=d.length;g<k;g++){var l=d[g];if(l.onLoad)l.onLoad(c)}e.manager.itemEnd(a)}else if(0===this.status){console.warn("THREE.FileLoader: HTTP Status 0 received.");g=0;for(k=d.length;g<k;g++)if(l=d[g],l.onLoad)l.onLoad(c);e.manager.itemEnd(a)}else{g=0;for(k=d.length;g<k;g++)if(l=d[g],
|
||
|
l.onError)l.onError(b);e.manager.itemEnd(a);e.manager.itemError(a)}},!1);p.addEventListener("progress",function(b){for(var c=Kb[a],d=0,e=c.length;d<e;d++){var g=c[d];if(g.onProgress)g.onProgress(b)}},!1);p.addEventListener("error",function(b){var c=Kb[a];delete Kb[a];for(var d=0,g=c.length;d<g;d++){var k=c[d];if(k.onError)k.onError(b)}e.manager.itemEnd(a);e.manager.itemError(a)},!1);void 0!==this.responseType&&(p.responseType=this.responseType);void 0!==this.withCredentials&&(p.withCredentials=this.withCredentials);
|
||
|
p.overrideMimeType&&p.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(l in this.requestHeader)p.setRequestHeader(l,this.requestHeader[l]);p.send(null)}e.manager.itemStart(a);return p}},setPath:function(a){this.path=a;return this},setResponseType:function(a){this.responseType=a;return this},setWithCredentials:function(a){this.withCredentials=a;return this},setMimeType:function(a){this.mimeType=a;return this},setRequestHeader:function(a){this.requestHeader=a;return this}});Object.assign(function(a){this.manager=
|
||
|
void 0!==a?a:db;this._parser=null}.prototype,{load:function(a,b,c,d){function e(e){n.load(a[e],function(a){a=g._parser(a,!0);k[e]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps};m+=1;6===m&&(1===a.mipmapCount&&(l.minFilter=1006),l.format=a.format,l.needsUpdate=!0,b&&b(l))},c,d)}var g=this,k=[],l=new fd;l.image=k;var n=new Db(this.manager);n.setPath(this.path);n.setResponseType("arraybuffer");if(Array.isArray(a))for(var m=0,r=0,p=a.length;r<p;++r)e(r);else n.load(a,function(a){a=
|
||
|
g._parser(a,!0);if(a.isCubemap)for(var c=a.mipmaps.length/a.mipmapCount,d=0;d<c;d++){k[d]={mipmaps:[]};for(var e=0;e<a.mipmapCount;e++)k[d].mipmaps.push(a.mipmaps[d*a.mipmapCount+e]),k[d].format=a.format,k[d].width=a.width,k[d].height=a.height}else l.image.width=a.width,l.image.height=a.height,l.mipmaps=a.mipmaps;1===a.mipmapCount&&(l.minFilter=1006);l.format=a.format;l.needsUpdate=!0;b&&b(l)},c,d);return l},setPath:function(a){this.path=a;return this}});Object.assign(function(a){this.manager=void 0!==
|
||
|
a?a:db;this._parser=null}.prototype,{load:function(a,b,c,d){var e=this,g=new Yb,k=new Db(this.manager);k.setResponseType("arraybuffer");k.load(a,function(a){if(a=e._parser(a))void 0!==a.image?g.image=a.image:void 0!==a.data&&(g.image.width=a.width,g.image.height=a.height,g.image.data=a.data),g.wrapS=void 0!==a.wrapS?a.wrapS:1001,g.wrapT=void 0!==a.wrapT?a.wrapT:1001,g.magFilter=void 0!==a.magFilter?a.magFilter:1006,g.minFilter=void 0!==a.minFilter?a.minFilter:1008,g.anisotropy=void 0!==a.anisotropy?
|
||
|
a.anisotropy:1,void 0!==a.format&&(g.format=a.format),void 0!==a.type&&(g.type=a.type),void 0!==a.mipmaps&&(g.mipmaps=a.mipmaps),1===a.mipmapCount&&(g.minFilter=1006),g.needsUpdate=!0,b&&b(g,a)},c,d);return g}});Object.assign(oe.prototype,{crossOrigin:"Anonymous",load:function(a,b,c,d){void 0===a&&(a="");void 0!==this.path&&(a=this.path+a);a=this.manager.resolveURL(a);var e=this,g=Te.get(a);if(void 0!==g)return e.manager.itemStart(a),setTimeout(function(){b&&b(g);e.manager.itemEnd(a)},0),g;c=document.createElementNS("http://www.w3.org/1999/xhtml",
|
||
|
"img");c.addEventListener("load",function(){Te.add(a,this);b&&b(this);e.manager.itemEnd(a)},!1);c.addEventListener("error",function(b){d&&d(b);e.manager.itemEnd(a);e.manager.itemError(a)},!1);"data:"!==a.substr(0,5)&&void 0!==this.crossOrigin&&(c.crossOrigin=this.crossOrigin);e.manager.itemStart(a);c.src=a;return c},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(function(a){this.manager=void 0!==a?a:db}.prototype,{crossOrigin:"Anonymous",
|
||
|
load:function(a,b,c,d){function e(c){k.load(a[c],function(a){g.images[c]=a;l++;6===l&&(g.needsUpdate=!0,b&&b(g))},void 0,d)}var g=new ac,k=new oe(this.manager);k.setCrossOrigin(this.crossOrigin);k.setPath(this.path);var l=0;for(c=0;c<a.length;++c)e(c);return g},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(sf.prototype,{crossOrigin:"Anonymous",load:function(a,b,c,d){var e=new ra,g=new oe(this.manager);g.setCrossOrigin(this.crossOrigin);
|
||
|
g.setPath(this.path);g.load(a,function(c){e.image=c;c=0<a.search(/\.(jpg|jpeg)$/)||0===a.search(/^data:image\/jpeg/);e.format=c?1022:1023;e.needsUpdate=!0;void 0!==b&&b(e)},c,d);return e},setCrossOrigin:function(a){this.crossOrigin=a;return this},setPath:function(a){this.path=a;return this}});Object.assign(Z.prototype,{getPoint:function(){console.warn("THREE.Curve: .getPoint() not implemented.");return null},getPointAt:function(a,b){a=this.getUtoTmapping(a);return this.getPoint(a,b)},getPoints:function(a){void 0===
|
||
|
a&&(a=5);for(var b=[],c=0;c<=a;c++)b.push(this.getPoint(c/a));return b},getSpacedPoints:function(a){void 0===a&&(a=5);for(var b=[],c=0;c<=a;c++)b.push(this.getPointAt(c/a));return b},getLength:function(){var a=this.getLengths();return a[a.length-1]},getLengths:function(a){void 0===a&&(a=this.arcLengthDivisions);if(this.cacheArcLengths&&this.cacheArcLengths.length===a+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var b=[],c=this.getPoint(0),d,e=0;b.push(0);for(d=1;d<=a;d++){var g=
|
||
|
this.getPoint(d/a);e+=g.distanceTo(c);b.push(e);c=g}return this.cacheArcLengths=b},updateArcLengths:function(){this.needsUpdate=!0;this.getLengths()},getUtoTmapping:function(a,b){var c=this.getLengths(),d=c.length;b=b?b:a*c[d-1];for(var e=0,g=d-1,k;e<=g;)if(a=Math.floor(e+(g-e)/2),k=c[a]-b,0>k)e=a+1;else if(0<k)g=a-1;else{g=a;break}a=g;if(c[a]===b)return a/(d-1);e=c[a];return(a+(b-e)/(c[a+1]-e))/(d-1)},getTangent:function(a){var b=a-1E-4;a+=1E-4;0>b&&(b=0);1<a&&(a=1);b=this.getPoint(b);return this.getPoint(a).clone().sub(b).normalize()},
|
||
|
getTangentAt:function(a){a=this.getUtoTmapping(a);return this.getTangent(a)},computeFrenetFrames:function(a,b){var c=new p,d=[],e=[],g=[],k=new p,l=new V,n;for(n=0;n<=a;n++){var m=n/a;d[n]=this.getTangentAt(m);d[n].normalize()}e[0]=new p;g[0]=new p;n=Number.MAX_VALUE;m=Math.abs(d[0].x);var r=Math.abs(d[0].y),q=Math.abs(d[0].z);m<=n&&(n=m,c.set(1,0,0));r<=n&&(n=r,c.set(0,1,0));q<=n&&c.set(0,0,1);k.crossVectors(d[0],c).normalize();e[0].crossVectors(d[0],k);g[0].crossVectors(d[0],e[0]);for(n=1;n<=a;n++)e[n]=
|
||
|
e[n-1].clone(),g[n]=g[n-1].clone(),k.crossVectors(d[n-1],d[n]),k.length()>Number.EPSILON&&(k.normalize(),c=Math.acos(ja.clamp(d[n-1].dot(d[n]),-1,1)),e[n].applyMatrix4(l.makeRotationAxis(k,c))),g[n].crossVectors(d[n],e[n]);if(!0===b)for(c=Math.acos(ja.clamp(e[0].dot(e[a]),-1,1)),c/=a,0<d[0].dot(k.crossVectors(e[0],e[a]))&&(c=-c),n=1;n<=a;n++)e[n].applyMatrix4(l.makeRotationAxis(d[n],c*n)),g[n].crossVectors(d[n],e[n]);return{tangents:d,normals:e,binormals:g}},clone:function(){return(new this.constructor).copy(this)},
|
||
|
copy:function(a){this.arcLengthDivisions=a.arcLengthDivisions;return this},toJSON:function(){var a={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};a.arcLengthDivisions=this.arcLengthDivisions;a.type=this.type;return a},fromJSON:function(a){this.arcLengthDivisions=a.arcLengthDivisions;return this}});eb.prototype=Object.create(Z.prototype);eb.prototype.constructor=eb;eb.prototype.isEllipseCurve=!0;eb.prototype.getPoint=function(a,b){b=b||new x;for(var c=2*Math.PI,d=this.aEndAngle-this.aStartAngle,
|
||
|
e=Math.abs(d)<Number.EPSILON;0>d;)d+=c;for(;d>c;)d-=c;d<Number.EPSILON&&(d=e?0:c);!0!==this.aClockwise||e||(d=d===c?-c:d-c);c=this.aStartAngle+a*d;a=this.aX+this.xRadius*Math.cos(c);var g=this.aY+this.yRadius*Math.sin(c);0!==this.aRotation&&(c=Math.cos(this.aRotation),d=Math.sin(this.aRotation),e=a-this.aX,g-=this.aY,a=e*c-g*d+this.aX,g=e*d+g*c+this.aY);return b.set(a,g)};eb.prototype.copy=function(a){Z.prototype.copy.call(this,a);this.aX=a.aX;this.aY=a.aY;this.xRadius=a.xRadius;this.yRadius=a.yRadius;
|
||
|
this.aStartAngle=a.aStartAngle;this.aEndAngle=a.aEndAngle;this.aClockwise=a.aClockwise;this.aRotation=a.aRotation;return this};eb.prototype.toJSON=function(){var a=Z.prototype.toJSON.call(this);a.aX=this.aX;a.aY=this.aY;a.xRadius=this.xRadius;a.yRadius=this.yRadius;a.aStartAngle=this.aStartAngle;a.aEndAngle=this.aEndAngle;a.aClockwise=this.aClockwise;a.aRotation=this.aRotation;return a};eb.prototype.fromJSON=function(a){Z.prototype.fromJSON.call(this,a);this.aX=a.aX;this.aY=a.aY;this.xRadius=a.xRadius;
|
||
|
this.yRadius=a.yRadius;this.aStartAngle=a.aStartAngle;this.aEndAngle=a.aEndAngle;this.aClockwise=a.aClockwise;this.aRotation=a.aRotation;return this};Ed.prototype=Object.create(eb.prototype);Ed.prototype.constructor=Ed;Ed.prototype.isArcCurve=!0;var Ue=new p,yg=new tf,zg=new tf,Ag=new tf;jb.prototype=Object.create(Z.prototype);jb.prototype.constructor=jb;jb.prototype.isCatmullRomCurve3=!0;jb.prototype.getPoint=function(a,b){b=b||new p;var c=this.points,d=c.length;a*=d-(this.closed?0:1);var e=Math.floor(a);
|
||
|
a-=e;this.closed?e+=0<e?0:(Math.floor(Math.abs(e)/d)+1)*d:0===a&&e===d-1&&(e=d-2,a=1);if(this.closed||0<e)var g=c[(e-1)%d];else Ue.subVectors(c[0],c[1]).add(c[0]),g=Ue;var k=c[e%d];var l=c[(e+1)%d];this.closed||e+2<d?c=c[(e+2)%d]:(Ue.subVectors(c[d-1],c[d-2]).add(c[d-1]),c=Ue);if("centripetal"===this.curveType||"chordal"===this.curveType){var n="chordal"===this.curveType?.5:.25;d=Math.pow(g.distanceToSquared(k),n);e=Math.pow(k.distanceToSquared(l),n);n=Math.pow(l.distanceToSquared(c),n);1E-4>e&&(e=
|
||
|
1);1E-4>d&&(d=e);1E-4>n&&(n=e);yg.initNonuniformCatmullRom(g.x,k.x,l.x,c.x,d,e,n);zg.initNonuniformCatmullRom(g.y,k.y,l.y,c.y,d,e,n);Ag.initNonuniformCatmullRom(g.z,k.z,l.z,c.z,d,e,n)}else"catmullrom"===this.curveType&&(yg.initCatmullRom(g.x,k.x,l.x,c.x,this.tension),zg.initCatmullRom(g.y,k.y,l.y,c.y,this.tension),Ag.initCatmullRom(g.z,k.z,l.z,c.z,this.tension));b.set(yg.calc(a),zg.calc(a),Ag.calc(a));return b};jb.prototype.copy=function(a){Z.prototype.copy.call(this,a);this.points=[];for(var b=0,
|
||
|
c=a.points.length;b<c;b++)this.points.push(a.points[b].clone());this.closed=a.closed;this.curveType=a.curveType;this.tension=a.tension;return this};jb.prototype.toJSON=function(){var a=Z.prototype.toJSON.call(this);a.points=[];for(var b=0,c=this.points.length;b<c;b++)a.points.push(this.points[b].toArray());a.closed=this.closed;a.curveType=this.curveType;a.tension=this.tension;return a};jb.prototype.fromJSON=function(a){Z.prototype.fromJSON.call(this,a);this.points=[];for(var b=0,c=a.points.length;b<
|
||
|
c;b++){var d=a.points[b];this.points.push((new p).fromArray(d))}this.closed=a.closed;this.curveType=a.curveType;this.tension=a.tension;return this};sb.prototype=Object.create(Z.prototype);sb.prototype.constructor=sb;sb.prototype.isCubicBezierCurve=!0;sb.prototype.getPoint=function(a,b){b=b||new x;var c=this.v0,d=this.v1,e=this.v2,g=this.v3;b.set(Gd(a,c.x,d.x,e.x,g.x),Gd(a,c.y,d.y,e.y,g.y));return b};sb.prototype.copy=function(a){Z.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);
|
||
|
this.v2.copy(a.v2);this.v3.copy(a.v3);return this};sb.prototype.toJSON=function(){var a=Z.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();a.v3=this.v3.toArray();return a};sb.prototype.fromJSON=function(a){Z.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);this.v3.fromArray(a.v3);return this};Eb.prototype=Object.create(Z.prototype);Eb.prototype.constructor=Eb;Eb.prototype.isCubicBezierCurve3=!0;
|
||
|
Eb.prototype.getPoint=function(a,b){b=b||new p;var c=this.v0,d=this.v1,e=this.v2,g=this.v3;b.set(Gd(a,c.x,d.x,e.x,g.x),Gd(a,c.y,d.y,e.y,g.y),Gd(a,c.z,d.z,e.z,g.z));return b};Eb.prototype.copy=function(a){Z.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);this.v3.copy(a.v3);return this};Eb.prototype.toJSON=function(){var a=Z.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();a.v3=this.v3.toArray();return a};Eb.prototype.fromJSON=
|
||
|
function(a){Z.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);this.v3.fromArray(a.v3);return this};ab.prototype=Object.create(Z.prototype);ab.prototype.constructor=ab;ab.prototype.isLineCurve=!0;ab.prototype.getPoint=function(a,b){b=b||new x;1===a?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(a).add(this.v1));return b};ab.prototype.getPointAt=function(a,b){return this.getPoint(a,b)};ab.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()};
|
||
|
ab.prototype.copy=function(a){Z.prototype.copy.call(this,a);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};ab.prototype.toJSON=function(){var a=Z.prototype.toJSON.call(this);a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};ab.prototype.fromJSON=function(a){Z.prototype.fromJSON.call(this,a);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};kb.prototype=Object.create(Z.prototype);kb.prototype.constructor=kb;kb.prototype.isLineCurve3=!0;kb.prototype.getPoint=function(a,b){b=b||
|
||
|
new p;1===a?b.copy(this.v2):(b.copy(this.v2).sub(this.v1),b.multiplyScalar(a).add(this.v1));return b};kb.prototype.getPointAt=function(a,b){return this.getPoint(a,b)};kb.prototype.copy=function(a){Z.prototype.copy.call(this,a);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};kb.prototype.toJSON=function(){var a=Z.prototype.toJSON.call(this);a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};kb.prototype.fromJSON=function(a){Z.prototype.fromJSON.call(this,a);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);
|
||
|
return this};tb.prototype=Object.create(Z.prototype);tb.prototype.constructor=tb;tb.prototype.isQuadraticBezierCurve=!0;tb.prototype.getPoint=function(a,b){b=b||new x;var c=this.v0,d=this.v1,e=this.v2;b.set(Fd(a,c.x,d.x,e.x),Fd(a,c.y,d.y,e.y));return b};tb.prototype.copy=function(a){Z.prototype.copy.call(this,a);this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};tb.prototype.toJSON=function(){var a=Z.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=
|
||
|
this.v2.toArray();return a};tb.prototype.fromJSON=function(a){Z.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};Fb.prototype=Object.create(Z.prototype);Fb.prototype.constructor=Fb;Fb.prototype.isQuadraticBezierCurve3=!0;Fb.prototype.getPoint=function(a,b){b=b||new p;var c=this.v0,d=this.v1,e=this.v2;b.set(Fd(a,c.x,d.x,e.x),Fd(a,c.y,d.y,e.y),Fd(a,c.z,d.z,e.z));return b};Fb.prototype.copy=function(a){Z.prototype.copy.call(this,a);
|
||
|
this.v0.copy(a.v0);this.v1.copy(a.v1);this.v2.copy(a.v2);return this};Fb.prototype.toJSON=function(){var a=Z.prototype.toJSON.call(this);a.v0=this.v0.toArray();a.v1=this.v1.toArray();a.v2=this.v2.toArray();return a};Fb.prototype.fromJSON=function(a){Z.prototype.fromJSON.call(this,a);this.v0.fromArray(a.v0);this.v1.fromArray(a.v1);this.v2.fromArray(a.v2);return this};ub.prototype=Object.create(Z.prototype);ub.prototype.constructor=ub;ub.prototype.isSplineCurve=!0;ub.prototype.getPoint=function(a,b){b=
|
||
|
b||new x;var c=this.points,d=(c.length-1)*a;a=Math.floor(d);d-=a;var e=c[0===a?a:a-1],g=c[a],k=c[a>c.length-2?c.length-1:a+1];c=c[a>c.length-3?c.length-1:a+2];b.set(qh(d,e.x,g.x,k.x,c.x),qh(d,e.y,g.y,k.y,c.y));return b};ub.prototype.copy=function(a){Z.prototype.copy.call(this,a);this.points=[];for(var b=0,c=a.points.length;b<c;b++)this.points.push(a.points[b].clone());return this};ub.prototype.toJSON=function(){var a=Z.prototype.toJSON.call(this);a.points=[];for(var b=0,c=this.points.length;b<c;b++)a.points.push(this.points[b].toArray());
|
||
|
return a};ub.prototype.fromJSON=function(a){Z.prototype.fromJSON.call(this,a);this.points=[];for(var b=0,c=a.points.length;b<c;b++){var d=a.points[b];this.points.push((new x).fromArray(d))}return this};var om=Object.freeze({ArcCurve:Ed,CatmullRomCurve3:jb,CubicBezierCurve:sb,CubicBezierCurve3:Eb,EllipseCurve:eb,LineCurve:ab,LineCurve3:kb,QuadraticBezierCurve:tb,QuadraticBezierCurve3:Fb,SplineCurve:ub});Rb.prototype=Object.assign(Object.create(Z.prototype),{constructor:Rb,add:function(a){this.curves.push(a)},
|
||
|
closePath:function(){var a=this.curves[0].getPoint(0),b=this.curves[this.curves.length-1].getPoint(1);a.equals(b)||this.curves.push(new ab(b,a))},getPoint:function(a){var b=a*this.getLength(),c=this.getCurveLengths();for(a=0;a<c.length;){if(c[a]>=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;c<d;c++)b+=this.curves[c].getLength(),a.push(b);return this.cacheLengths=a},getSpacedPoints:function(a){void 0===a&&(a=40);for(var b=[],c=0;c<=a;c++)b.push(this.getPoint(c/a));this.autoClose&&b.push(b[0]);return b},getPoints:function(a){a=a||12;for(var b=[],c,d=0,e=this.curves;d<e.length;d++){var g=e[d];g=g.getPoints(g&&g.isEllipseCurve?
|
||
|
2*a:g&&g.isLineCurve?1:g&&g.isSplineCurve?a*g.points.length:a);for(var k=0;k<g.length;k++){var l=g[k];c&&c.equals(l)||(b.push(l),c=l)}}this.autoClose&&1<b.length&&!b[b.length-1].equals(b[0])&&b.push(b[0]);return b},copy:function(a){Z.prototype.copy.call(this,a);this.curves=[];for(var b=0,c=a.curves.length;b<c;b++)this.curves.push(a.curves[b].clone());this.autoClose=a.autoClose;return this},toJSON:function(){var a=Z.prototype.toJSON.call(this);a.autoClose=this.autoClose;a.curves=[];for(var b=0,c=this.curves.length;b<
|
||
|
c;b++)a.curves.push(this.curves[b].toJSON());return a},fromJSON:function(a){Z.prototype.fromJSON.call(this,a);this.autoClose=a.autoClose;this.curves=[];for(var b=0,c=a.curves.length;b<c;b++){var d=a.curves[b];this.curves.push((new om[d.type]).fromJSON(d))}return this}});vb.prototype=Object.assign(Object.create(Rb.prototype),{constructor:vb,setFromPoints:function(a){this.moveTo(a[0].x,a[0].y);for(var b=1,c=a.length;b<c;b++)this.lineTo(a[b].x,a[b].y)},moveTo:function(a,b){this.currentPoint.set(a,b)},
|
||
|
lineTo:function(a,b){var c=new ab(this.currentPoint.clone(),new x(a,b));this.curves.push(c);this.currentPoint.set(a,b)},quadraticCurveTo:function(a,b,c,d){a=new tb(this.currentPoint.clone(),new x(a,b),new x(c,d));this.curves.push(a);this.currentPoint.set(c,d)},bezierCurveTo:function(a,b,c,d,e,g){a=new sb(this.currentPoint.clone(),new x(a,b),new x(c,d),new x(e,g));this.curves.push(a);this.currentPoint.set(e,g)},splineThru:function(a){var b=[this.currentPoint.clone()].concat(a);b=new ub(b);this.curves.push(b);
|
||
|
this.currentPoint.copy(a[a.length-1])},arc:function(a,b,c,d,e,g){this.absarc(a+this.currentPoint.x,b+this.currentPoint.y,c,d,e,g)},absarc:function(a,b,c,d,e,g){this.absellipse(a,b,c,c,d,e,g)},ellipse:function(a,b,c,d,e,g,k,l){this.absellipse(a+this.currentPoint.x,b+this.currentPoint.y,c,d,e,g,k,l)},absellipse:function(a,b,c,d,e,g,k,l){a=new eb(a,b,c,d,e,g,k,l);0<this.curves.length&&(b=a.getPoint(0),b.equals(this.currentPoint)||this.lineTo(b.x,b.y));this.curves.push(a);a=a.getPoint(1);this.currentPoint.copy(a)},
|
||
|
copy:function(a){Rb.prototype.copy.call(this,a);this.currentPoint.copy(a.currentPoint);return this},toJSON:function(){var a=Rb.prototype.toJSON.call(this);a.currentPoint=this.currentPoint.toArray();return a},fromJSON:function(a){Rb.prototype.fromJSON.call(this,a);this.currentPoint.fromArray(a.currentPoint);return this}});kc.prototype=Object.assign(Object.create(vb.prototype),{constructor:kc,getPointsHoles:function(a){for(var b=[],c=0,d=this.holes.length;c<d;c++)b[c]=this.holes[c].getPoints(a);return b},
|
||
|
extractPoints:function(a){return{shape:this.getPoints(a),holes:this.getPointsHoles(a)}},copy:function(a){vb.prototype.copy.call(this,a);this.holes=[];for(var b=0,c=a.holes.length;b<c;b++)this.holes.push(a.holes[b].clone());return this},toJSON:function(){var a=vb.prototype.toJSON.call(this);a.uuid=this.uuid;a.holes=[];for(var b=0,c=this.holes.length;b<c;b++)a.holes.push(this.holes[b].toJSON());return a},fromJSON:function(a){vb.prototype.fromJSON.call(this,a);this.uuid=a.uuid;this.holes=[];for(var b=
|
||
|
0,c=a.holes.length;b<c;b++){var d=a.holes[b];this.holes.push((new vb).fromJSON(d))}return this}});Da.prototype=Object.assign(Object.create(O.prototype),{constructor:Da,isLight:!0,copy:function(a){O.prototype.copy.call(this,a);this.color.copy(a.color);this.intensity=a.intensity;return this},toJSON:function(a){a=O.prototype.toJSON.call(this,a);a.object.color=this.color.getHex();a.object.intensity=this.intensity;void 0!==this.groundColor&&(a.object.groundColor=this.groundColor.getHex());void 0!==this.distance&&
|
||
|
(a.object.distance=this.distance);void 0!==this.angle&&(a.object.angle=this.angle);void 0!==this.decay&&(a.object.decay=this.decay);void 0!==this.penumbra&&(a.object.penumbra=this.penumbra);void 0!==this.shadow&&(a.object.shadow=this.shadow.toJSON());return a}});pe.prototype=Object.assign(Object.create(Da.prototype),{constructor:pe,isHemisphereLight:!0,copy:function(a){Da.prototype.copy.call(this,a);this.groundColor.copy(a.groundColor);return this}});Object.assign(Oc.prototype,{copy:function(a){this.camera=
|
||
|
a.camera.clone();this.bias=a.bias;this.radius=a.radius;this.mapSize.copy(a.mapSize);return this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var a={};0!==this.bias&&(a.bias=this.bias);1!==this.radius&&(a.radius=this.radius);if(512!==this.mapSize.x||512!==this.mapSize.y)a.mapSize=this.mapSize.toArray();a.camera=this.camera.toJSON(!1).object;delete a.camera.matrix;return a}});uf.prototype=Object.assign(Object.create(Oc.prototype),{constructor:uf,isSpotLightShadow:!0,
|
||
|
update:function(a){var b=this.camera,c=2*ja.RAD2DEG*a.angle,d=this.mapSize.width/this.mapSize.height;a=a.distance||b.far;if(c!==b.fov||d!==b.aspect||a!==b.far)b.fov=c,b.aspect=d,b.far=a,b.updateProjectionMatrix()}});qe.prototype=Object.assign(Object.create(Da.prototype),{constructor:qe,isSpotLight:!0,copy:function(a){Da.prototype.copy.call(this,a);this.distance=a.distance;this.angle=a.angle;this.penumbra=a.penumbra;this.decay=a.decay;this.target=a.target.clone();this.shadow=a.shadow.clone();return this}});
|
||
|
re.prototype=Object.assign(Object.create(Da.prototype),{constructor:re,isPointLight:!0,copy:function(a){Da.prototype.copy.call(this,a);this.distance=a.distance;this.decay=a.decay;this.shadow=a.shadow.clone();return this}});vf.prototype=Object.assign(Object.create(Oc.prototype),{constructor:vf});se.prototype=Object.assign(Object.create(Da.prototype),{constructor:se,isDirectionalLight:!0,copy:function(a){Da.prototype.copy.call(this,a);this.target=a.target.clone();this.shadow=a.shadow.clone();return this}});
|
||
|
te.prototype=Object.assign(Object.create(Da.prototype),{constructor:te,isAmbientLight:!0});ue.prototype=Object.assign(Object.create(Da.prototype),{constructor:ue,isRectAreaLight:!0,copy:function(a){Da.prototype.copy.call(this,a);this.width=a.width;this.height=a.height;return this},toJSON:function(a){a=Da.prototype.toJSON.call(this,a);a.object.width=this.width;a.object.height=this.height;return a}});wf.prototype=Object.assign(Object.create(Ea.prototype),{constructor:wf,ValueTypeName:"string",ValueBufferType:Array,
|
||
|
DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});xf.prototype=Object.assign(Object.create(Ea.prototype),{constructor:xf,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0});Object.assign(fb.prototype,{evaluate:function(a){var b=this.parameterPositions,c=this._cachedIndex,d=b[c],e=b[c-1];a:{b:{c:{d:if(!(a<d)){for(var g=c+2;;){if(void 0===d){if(a<e)break d;
|
||
|
this._cachedIndex=c=b.length;return this.afterEnd_(c-1,a,e)}if(c===g)break;e=d;d=b[++c];if(a<d)break b}d=b.length;break c}if(a>=e)break a;else{g=b[1];a<g&&(c=2,e=g);for(g=c-2;;){if(void 0===e)return this._cachedIndex=0,this.beforeStart_(0,a,d);if(c===g)break;d=e;e=b[--c-1];if(a>=e)break b}d=c;c=0}}for(;c<d;)e=c+d>>>1,a<b[e]?d=e:c=e+1;d=b[c];e=b[c-1];if(void 0===e)return this._cachedIndex=0,this.beforeStart_(0,a,d);if(void 0===d)return this._cachedIndex=c=b.length,this.afterEnd_(c-1,e,a)}this._cachedIndex=
|
||
|
c;this.intervalChanged_(c,e,d)}return this.interpolate_(c,e,a,d)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(a){var b=this.resultBuffer,c=this.sampleValues,d=this.valueSize;a*=d;for(var e=0;e!==d;++e)b[e]=c[a+e];return b},interpolate_:function(){throw Error("call to abstract method");},intervalChanged_:function(){}});Object.assign(fb.prototype,{beforeStart_:fb.prototype.copySampleValue_,afterEnd_:fb.prototype.copySampleValue_});
|
||
|
yf.prototype=Object.assign(Object.create(fb.prototype),{constructor:yf,interpolate_:function(a,b,c,d){var e=this.resultBuffer,g=this.sampleValues,k=this.valueSize;a*=k;b=(c-b)/(d-b);for(c=a+k;a!==c;a+=4)sa.slerpFlat(e,0,g,a-k,g,a,b);return e}});ve.prototype=Object.assign(Object.create(Ea.prototype),{constructor:ve,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(a){return new yf(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:void 0});
|
||
|
zf.prototype=Object.assign(Object.create(Ea.prototype),{constructor:zf,ValueTypeName:"color"});Hd.prototype=Object.assign(Object.create(Ea.prototype),{constructor:Hd,ValueTypeName:"number"});Af.prototype=Object.assign(Object.create(fb.prototype),{constructor:Af,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(a,b,c){var d=this.parameterPositions,e=a-2,g=a+1,k=d[e],l=d[g];if(void 0===k)switch(this.getSettings_().endingStart){case 2401:e=a;k=2*b-c;break;case 2402:e=d.length-
|
||
|
2;k=b+d[e]-d[e+1];break;default:e=a,k=c}if(void 0===l)switch(this.getSettings_().endingEnd){case 2401:g=a;l=2*c-b;break;case 2402:g=1;l=c+d[1]-d[0];break;default:g=a-1,l=b}a=.5*(c-b);d=this.valueSize;this._weightPrev=a/(b-k);this._weightNext=a/(l-c);this._offsetPrev=e*d;this._offsetNext=g*d},interpolate_:function(a,b,c,d){var e=this.resultBuffer,g=this.sampleValues,k=this.valueSize;a*=k;var l=a-k,n=this._offsetPrev,m=this._offsetNext,r=this._weightPrev,p=this._weightNext,q=(c-b)/(d-b);c=q*q;d=c*q;
|
||
|
b=-r*d+2*r*c-r*q;r=(1+r)*d+(-1.5-2*r)*c+(-.5+r)*q+1;q=(-1-p)*d+(1.5+p)*c+.5*q;p=p*d-p*c;for(c=0;c!==k;++c)e[c]=b*g[n+c]+r*g[l+c]+q*g[a+c]+p*g[m+c];return e}});we.prototype=Object.assign(Object.create(fb.prototype),{constructor:we,interpolate_:function(a,b,c,d){var e=this.resultBuffer,g=this.sampleValues,k=this.valueSize;a*=k;var l=a-k;b=(c-b)/(d-b);c=1-b;for(d=0;d!==k;++d)e[d]=g[l+d]*c+g[a+d]*b;return e}});Bf.prototype=Object.assign(Object.create(fb.prototype),{constructor:Bf,interpolate_:function(a){return this.copySampleValue_(a-
|
||
|
1)}});var Sa={arraySlice:function(a,b,c){return Sa.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),g=0,k=0;k!==d;++g)for(var l=c[g]*b,n=0;n!==b;++n)e[k++]=a[l+n];return e},flattenJSON:function(a,b,c,d){for(var e=1,g=a[0];void 0!==g&&void 0===g[d];)g=a[e++];if(void 0!==g){var k=g[d];if(void 0!==k)if(Array.isArray(k)){do k=g[d],void 0!==k&&(b.push(g.time),c.push.apply(c,k)),g=a[e++];while(void 0!==g)}else if(void 0!==k.toArray){do k=g[d],void 0!==k&&(b.push(g.time),k.toArray(c,c.length)),g=a[e++];while(void 0!==g)}else{do k=g[d],void 0!==k&&(b.push(g.time),
|
||
|
c.push(k)),g=a[e++];while(void 0!==g)}}}};Object.assign(Ea,{parse:function(a){if(void 0===a.type)throw Error("THREE.KeyframeTrack: track type undefined, can not parse");var b=Ea._getTrackTypeForValueTypeName(a.type);if(void 0===a.times){var c=[],d=[];Sa.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)},toJSON:function(a){var b=a.constructor;if(void 0!==b.toJSON)b=b.toJSON(a);else{b={name:a.name,times:Sa.convertArray(a.times,
|
||
|
Array),values:Sa.convertArray(a.values,Array)};var c=a.getInterpolation();c!==a.DefaultInterpolation&&(b.interpolation=c)}b.type=a.ValueTypeName;return b},_getTrackTypeForValueTypeName:function(a){switch(a.toLowerCase()){case "scalar":case "double":case "float":case "number":case "integer":return Hd;case "vector":case "vector2":case "vector3":case "vector4":return Id;case "color":return zf;case "quaternion":return ve;case "bool":case "boolean":return xf;case "string":return wf}throw Error("THREE.KeyframeTrack: Unsupported typeName: "+
|
||
|
a);}});Object.assign(Ea.prototype,{constructor:Ea,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(a){return new Bf(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodLinear:function(a){return new we(this.times,this.values,this.getValueSize(),a)},InterpolantFactoryMethodSmooth:function(a){return new Af(this.times,this.values,this.getValueSize(),a)},setInterpolation:function(a){switch(a){case 2300:var b=
|
||
|
this.InterpolantFactoryMethodDiscrete;break;case 2301:b=this.InterpolantFactoryMethodLinear;break;case 2302:b=this.InterpolantFactoryMethodSmooth}if(void 0===b){b="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant)if(a!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw Error(b);console.warn("THREE.KeyframeTrack:",b)}else this.createInterpolant=b},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;
|
||
|
case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/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,g=d-1;e!==d&&c[e]<a;)++e;for(;-1!==g&&c[g]>b;)--g;++g;if(0!==e||g!==d)e>=g&&(g=Math.max(g,
|
||
|
1),e=g-1),a=this.getValueSize(),this.times=Sa.arraySlice(c,e,g),this.values=Sa.arraySlice(this.values,e*a,g*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,g=0;g!==d;g++){var k=c[g];if("number"===typeof k&&isNaN(k)){console.error("THREE.KeyframeTrack: Time is not a valid number.",
|
||
|
this,g,k);a=!1;break}if(null!==e&&e>k){console.error("THREE.KeyframeTrack: Out of order keys.",this,g,k,e);a=!1;break}e=k}if(void 0!==b&&Sa.isTypedArray(b))for(g=0,c=b.length;g!==c;++g)if(d=b[g],isNaN(d)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,g,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,g=a.length-1,k=1;k<g;++k){var l=!1,n=a[k];if(n!==a[k+1]&&(1!==k||n!==n[0]))if(d)l=!0;
|
||
|
else{var m=k*c,r=m-c,p=m+c;for(n=0;n!==c;++n){var q=b[m+n];if(q!==b[r+n]||q!==b[p+n]){l=!0;break}}}if(l){if(k!==e)for(a[e]=a[k],l=k*c,m=e*c,n=0;n!==c;++n)b[m+n]=b[l+n];++e}}if(0<g){a[e]=a[g];l=g*c;m=e*c;for(n=0;n!==c;++n)b[m+n]=b[l+n];++e}e!==a.length&&(this.times=Sa.arraySlice(a,0,e),this.values=Sa.arraySlice(b,0,e*c));return this}});Id.prototype=Object.assign(Object.create(Ea.prototype),{constructor:Id,ValueTypeName:"vector"});Object.assign(gb,{parse:function(a){for(var b=[],c=a.tracks,d=1/(a.fps||
|
||
|
1),e=0,g=c.length;e!==g;++e)b.push(Ea.parse(c[e]).scale(d));return new gb(a.name,a.duration,b)},toJSON:function(a){var b=[],c=a.tracks;a={name:a.name,duration:a.duration,tracks:b};for(var d=0,e=c.length;d!==e;++d)b.push(Ea.toJSON(c[d]));return a},CreateFromMorphTargetSequence:function(a,b,c,d){for(var e=b.length,g=[],k=0;k<e;k++){var l=[],n=[];l.push((k+e-1)%e,k,(k+1)%e);n.push(0,1,0);var m=Sa.getKeyframeOrder(l);l=Sa.sortedArray(l,1,m);n=Sa.sortedArray(n,1,m);d||0!==l[0]||(l.push(e),n.push(n[0]));
|
||
|
g.push((new Hd(".morphTargetInfluences["+b[k].name+"]",l,n)).scale(1/c))}return new gb(a,-1,g)},findByName:function(a,b){var c=a;Array.isArray(a)||(c=a.geometry&&a.geometry.animations||a.animations);for(a=0;a<c.length;a++)if(c[a].name===b)return c[a];return null},CreateClipsFromMorphTargetSequences:function(a,b,c){for(var d={},e=/^([\w-]*?)([\d]+)$/,g=0,k=a.length;g<k;g++){var l=a[g],n=l.name.match(e);if(n&&1<n.length){var m=n[1];(n=d[m])||(d[m]=n=[]);n.push(l)}}a=[];for(m in d)a.push(gb.CreateFromMorphTargetSequence(m,
|
||
|
d[m],b,c));return a},parseAnimation:function(a,b){if(!a)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;var c=function(a,b,c,d,e){if(0!==c.length){var g=[],k=[];Sa.flattenJSON(c,g,k,d);0!==g.length&&e.push(new a(b,g,k))}},d=[],e=a.name||"default",g=a.length||-1,k=a.fps||30;a=a.hierarchy||[];for(var l=0;l<a.length;l++){var n=a[l].keys;if(n&&0!==n.length)if(n[0].morphTargets){g={};for(var m=0;m<n.length;m++)if(n[m].morphTargets)for(var r=0;r<n[m].morphTargets.length;r++)g[n[m].morphTargets[r]]=
|
||
|
-1;for(var p in g){var q=[],u=[];for(r=0;r!==n[m].morphTargets.length;++r){var v=n[m];q.push(v.time);u.push(v.morphTarget===p?1:0)}d.push(new Hd(".morphTargetInfluence["+p+"]",q,u))}g=g.length*(k||1)}else m=".bones["+b[l].name+"]",c(Id,m+".position",n,"pos",d),c(ve,m+".quaternion",n,"rot",d),c(Id,m+".scale",n,"scl",d)}return 0===d.length?null:new gb(e,g,d)}});Object.assign(gb.prototype,{resetDuration:function(){for(var a=0,b=0,c=this.tracks.length;b!==c;++b){var d=this.tracks[b];a=Math.max(a,d.times[d.times.length-
|
||
|
1])}this.duration=a},trim:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].trim(0,this.duration);return this},optimize:function(){for(var a=0;a<this.tracks.length;a++)this.tracks[a].optimize();return this}});Object.assign(Cf.prototype,{load:function(a,b,c,d){var e=this;(new Db(e.manager)).load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},setTextures:function(a){this.textures=a},parse:function(a){function b(a){void 0===c[a]&&console.warn("THREE.MaterialLoader: Undefined texture",a);
|
||
|
return c[a]}var c=this.textures,d=new nm[a.type];void 0!==a.uuid&&(d.uuid=a.uuid);void 0!==a.name&&(d.name=a.name);void 0!==a.color&&d.color.setHex(a.color);void 0!==a.roughness&&(d.roughness=a.roughness);void 0!==a.metalness&&(d.metalness=a.metalness);void 0!==a.emissive&&d.emissive.setHex(a.emissive);void 0!==a.specular&&d.specular.setHex(a.specular);void 0!==a.shininess&&(d.shininess=a.shininess);void 0!==a.clearCoat&&(d.clearCoat=a.clearCoat);void 0!==a.clearCoatRoughness&&(d.clearCoatRoughness=
|
||
|
a.clearCoatRoughness);void 0!==a.uniforms&&(d.uniforms=a.uniforms);void 0!==a.vertexShader&&(d.vertexShader=a.vertexShader);void 0!==a.fragmentShader&&(d.fragmentShader=a.fragmentShader);void 0!==a.vertexColors&&(d.vertexColors=a.vertexColors);void 0!==a.fog&&(d.fog=a.fog);void 0!==a.flatShading&&(d.flatShading=a.flatShading);void 0!==a.blending&&(d.blending=a.blending);void 0!==a.side&&(d.side=a.side);void 0!==a.opacity&&(d.opacity=a.opacity);void 0!==a.transparent&&(d.transparent=a.transparent);
|
||
|
void 0!==a.alphaTest&&(d.alphaTest=a.alphaTest);void 0!==a.depthTest&&(d.depthTest=a.depthTest);void 0!==a.depthWrite&&(d.depthWrite=a.depthWrite);void 0!==a.colorWrite&&(d.colorWrite=a.colorWrite);void 0!==a.wireframe&&(d.wireframe=a.wireframe);void 0!==a.wireframeLinewidth&&(d.wireframeLinewidth=a.wireframeLinewidth);void 0!==a.wireframeLinecap&&(d.wireframeLinecap=a.wireframeLinecap);void 0!==a.wireframeLinejoin&&(d.wireframeLinejoin=a.wireframeLinejoin);void 0!==a.rotation&&(d.rotation=a.rotation);
|
||
|
1!==a.linewidth&&(d.linewidth=a.linewidth);void 0!==a.dashSize&&(d.dashSize=a.dashSize);void 0!==a.gapSize&&(d.gapSize=a.gapSize);void 0!==a.scale&&(d.scale=a.scale);void 0!==a.polygonOffset&&(d.polygonOffset=a.polygonOffset);void 0!==a.polygonOffsetFactor&&(d.polygonOffsetFactor=a.polygonOffsetFactor);void 0!==a.polygonOffsetUnits&&(d.polygonOffsetUnits=a.polygonOffsetUnits);void 0!==a.skinning&&(d.skinning=a.skinning);void 0!==a.morphTargets&&(d.morphTargets=a.morphTargets);void 0!==a.dithering&&
|
||
|
(d.dithering=a.dithering);void 0!==a.visible&&(d.visible=a.visible);void 0!==a.userData&&(d.userData=a.userData);void 0!==a.shading&&(d.flatShading=1===a.shading);void 0!==a.size&&(d.size=a.size);void 0!==a.sizeAttenuation&&(d.sizeAttenuation=a.sizeAttenuation);void 0!==a.map&&(d.map=b(a.map));void 0!==a.alphaMap&&(d.alphaMap=b(a.alphaMap),d.transparent=!0);void 0!==a.bumpMap&&(d.bumpMap=b(a.bumpMap));void 0!==a.bumpScale&&(d.bumpScale=a.bumpScale);void 0!==a.normalMap&&(d.normalMap=b(a.normalMap));
|
||
|
if(void 0!==a.normalScale){var e=a.normalScale;!1===Array.isArray(e)&&(e=[e,e]);d.normalScale=(new x).fromArray(e)}void 0!==a.displacementMap&&(d.displacementMap=b(a.displacementMap));void 0!==a.displacementScale&&(d.displacementScale=a.displacementScale);void 0!==a.displacementBias&&(d.displacementBias=a.displacementBias);void 0!==a.roughnessMap&&(d.roughnessMap=b(a.roughnessMap));void 0!==a.metalnessMap&&(d.metalnessMap=b(a.metalnessMap));void 0!==a.emissiveMap&&(d.emissiveMap=b(a.emissiveMap));
|
||
|
void 0!==a.emissiveIntensity&&(d.emissiveIntensity=a.emissiveIntensity);void 0!==a.specularMap&&(d.specularMap=b(a.specularMap));void 0!==a.envMap&&(d.envMap=b(a.envMap));void 0!==a.reflectivity&&(d.reflectivity=a.reflectivity);void 0!==a.lightMap&&(d.lightMap=b(a.lightMap));void 0!==a.lightMapIntensity&&(d.lightMapIntensity=a.lightMapIntensity);void 0!==a.aoMap&&(d.aoMap=b(a.aoMap));void 0!==a.aoMapIntensity&&(d.aoMapIntensity=a.aoMapIntensity);void 0!==a.gradientMap&&(d.gradientMap=b(a.gradientMap));
|
||
|
return d}});Object.assign(rh.prototype,{load:function(a,b,c,d){var e=this;(new Db(e.manager)).load(a,function(a){b(e.parse(JSON.parse(a)))},c,d)},parse:function(a){var b=new R,c=a.data.index;void 0!==c&&(c=new Ti[c.type](c.array),b.setIndex(new fa(c,1)));var d=a.data.attributes;for(g in d){var e=d[g];c=new Ti[e.type](e.array);b.addAttribute(g,new fa(c,e.itemSize,e.normalized))}var g=a.data.groups||a.data.drawcalls||a.data.offsets;if(void 0!==g)for(c=0,d=g.length;c!==d;++c)e=g[c],b.addGroup(e.start,
|
||
|
e.count,e.materialIndex);a=a.data.boundingSphere;void 0!==a&&(g=new p,void 0!==a.center&&g.fromArray(a.center),b.boundingSphere=new pb(g,a.radius));return b}});var Ti={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!==typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};Jd.Handlers={handlers:[],add:function(a,b){this.handlers.push(a,
|
||
|
b)},get:function(a){for(var b=this.handlers,c=0,d=b.length;c<d;c+=2){var e=b[c+1];if(b[c].test(a))return e}return null}};Object.assign(Jd.prototype,{crossOrigin:void 0,onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(a,b,c){for(var d=[],e=0;e<a.length;++e)d[e]=this.createMaterial(a[e],b,c);return d},createMaterial:function(){var a={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},b=new S,
|
||
|
c=new sf,d=new Cf;return function(e,g,k){function l(a,b,d,e,l){a=g+a;var m=Jd.Handlers.get(a);null!==m?a=m.load(a):(c.setCrossOrigin(k),a=c.load(a));void 0!==b&&(a.repeat.fromArray(b),1!==b[0]&&(a.wrapS=1E3),1!==b[1]&&(a.wrapT=1E3));void 0!==d&&a.offset.fromArray(d);void 0!==e&&("repeat"===e[0]&&(a.wrapS=1E3),"mirror"===e[0]&&(a.wrapS=1002),"repeat"===e[1]&&(a.wrapT=1E3),"mirror"===e[1]&&(a.wrapT=1002));void 0!==l&&(a.anisotropy=l);b=ja.generateUUID();n[b]=a;return b}var n={},m={uuid:ja.generateUUID(),
|
||
|
type:"MeshLambertMaterial"},r;for(r in e){var p=e[r];switch(r){case "DbgColor":case "DbgIndex":case "opticalDensity":case "illumination":break;case "DbgName":m.name=p;break;case "blending":m.blending=a[p];break;case "colorAmbient":case "mapAmbient":console.warn("THREE.Loader.createMaterial:",r,"is no longer supported.");break;case "colorDiffuse":m.color=b.fromArray(p).getHex();break;case "colorSpecular":m.specular=b.fromArray(p).getHex();break;case "colorEmissive":m.emissive=b.fromArray(p).getHex();
|
||
|
break;case "specularCoef":m.shininess=p;break;case "shading":"basic"===p.toLowerCase()&&(m.type="MeshBasicMaterial");"phong"===p.toLowerCase()&&(m.type="MeshPhongMaterial");"standard"===p.toLowerCase()&&(m.type="MeshStandardMaterial");break;case "mapDiffuse":m.map=l(p,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy);break;case "mapDiffuseRepeat":case "mapDiffuseOffset":case "mapDiffuseWrap":case "mapDiffuseAnisotropy":break;case "mapEmissive":m.emissiveMap=l(p,e.mapEmissiveRepeat,
|
||
|
e.mapEmissiveOffset,e.mapEmissiveWrap,e.mapEmissiveAnisotropy);break;case "mapEmissiveRepeat":case "mapEmissiveOffset":case "mapEmissiveWrap":case "mapEmissiveAnisotropy":break;case "mapLight":m.lightMap=l(p,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy);break;case "mapLightRepeat":case "mapLightOffset":case "mapLightWrap":case "mapLightAnisotropy":break;case "mapAO":m.aoMap=l(p,e.mapAORepeat,e.mapAOOffset,e.mapAOWrap,e.mapAOAnisotropy);break;case "mapAORepeat":case "mapAOOffset":case "mapAOWrap":case "mapAOAnisotropy":break;
|
||
|
case "mapBump":m.bumpMap=l(p,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy);break;case "mapBumpScale":m.bumpScale=p;break;case "mapBumpRepeat":case "mapBumpOffset":case "mapBumpWrap":case "mapBumpAnisotropy":break;case "mapNormal":m.normalMap=l(p,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy);break;case "mapNormalFactor":m.normalScale=p;break;case "mapNormalRepeat":case "mapNormalOffset":case "mapNormalWrap":case "mapNormalAnisotropy":break;case "mapSpecular":m.specularMap=
|
||
|
l(p,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy);break;case "mapSpecularRepeat":case "mapSpecularOffset":case "mapSpecularWrap":case "mapSpecularAnisotropy":break;case "mapMetalness":m.metalnessMap=l(p,e.mapMetalnessRepeat,e.mapMetalnessOffset,e.mapMetalnessWrap,e.mapMetalnessAnisotropy);break;case "mapMetalnessRepeat":case "mapMetalnessOffset":case "mapMetalnessWrap":case "mapMetalnessAnisotropy":break;case "mapRoughness":m.roughnessMap=l(p,e.mapRoughnessRepeat,
|
||
|
e.mapRoughnessOffset,e.mapRoughnessWrap,e.mapRoughnessAnisotropy);break;case "mapRoughnessRepeat":case "mapRoughnessOffset":case "mapRoughnessWrap":case "mapRoughnessAnisotropy":break;case "mapAlpha":m.alphaMap=l(p,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy);break;case "mapAlphaRepeat":case "mapAlphaOffset":case "mapAlphaWrap":case "mapAlphaAnisotropy":break;case "flipSided":m.side=1;break;case "doubleSided":m.side=2;break;case "transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity");
|
||
|
m.opacity=p;break;case "depthTest":case "depthWrite":case "colorWrite":case "opacity":case "reflectivity":case "transparent":case "visible":case "wireframe":m[r]=p;break;case "vertexColors":!0===p&&(m.vertexColors=2);"face"===p&&(m.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",r,p)}}"MeshBasicMaterial"===m.type&&delete m.emissive;"MeshPhongMaterial"!==m.type&&delete m.specular;1>m.opacity&&(m.transparent=!0);d.setTextures(n);return d.parse(m)}}()});var Ui=
|
||
|
{decodeText:function(a){if("undefined"!==typeof TextDecoder)return(new TextDecoder).decode(a);for(var b="",c=0,d=a.length;c<d;c++)b+=String.fromCharCode(a[c]);return decodeURIComponent(escape(b))},extractUrlBase:function(a){var b=a.lastIndexOf("/");return-1===b?"./":a.substr(0,b+1)}};Object.assign(Df.prototype,{load:function(a,b,c,d){var e=this,g=this.texturePath&&"string"===typeof this.texturePath?this.texturePath:Ui.extractUrlBase(a),k=new Db(this.manager);k.setWithCredentials(this.withCredentials);
|
||
|
k.load(a,function(c){c=JSON.parse(c);var d=c.metadata;if(void 0!==d&&(d=d.type,void 0!==d&&"object"===d.toLowerCase())){console.error("THREE.JSONLoader: "+a+" should be loaded with THREE.ObjectLoader instead.");return}c=e.parse(c,g);b(c.geometry,c.materials)},c,d)},setTexturePath:function(a){this.texturePath=a},parse:function(){return function(a,b){void 0!==a.data&&(a=a.data);a.scale=void 0!==a.scale?1/a.scale:1;var c=new ca,d=a,e,g,k,l=d.faces;var n=d.vertices;var m=d.normals,r=d.colors;var q=d.scale;
|
||
|
var t=0;if(void 0!==d.uvs){for(e=0;e<d.uvs.length;e++)d.uvs[e].length&&t++;for(e=0;e<t;e++)c.faceVertexUvs[e]=[]}var u=0;for(k=n.length;u<k;)e=new p,e.x=n[u++]*q,e.y=n[u++]*q,e.z=n[u++]*q,c.vertices.push(e);u=0;for(k=l.length;u<k;){n=l[u++];var v=n&1;var y=n&2;e=n&8;var A=n&16;var C=n&32;q=n&64;n&=128;if(v){v=new Zb;v.a=l[u];v.b=l[u+1];v.c=l[u+3];var E=new Zb;E.a=l[u+1];E.b=l[u+2];E.c=l[u+3];u+=4;y&&(y=l[u++],v.materialIndex=y,E.materialIndex=y);y=c.faces.length;if(e)for(e=0;e<t;e++){var z=d.uvs[e];
|
||
|
c.faceVertexUvs[e][y]=[];c.faceVertexUvs[e][y+1]=[];for(g=0;4>g;g++){var B=l[u++];var D=z[2*B];B=z[2*B+1];D=new x(D,B);2!==g&&c.faceVertexUvs[e][y].push(D);0!==g&&c.faceVertexUvs[e][y+1].push(D)}}A&&(A=3*l[u++],v.normal.set(m[A++],m[A++],m[A]),E.normal.copy(v.normal));if(C)for(e=0;4>e;e++)A=3*l[u++],C=new p(m[A++],m[A++],m[A]),2!==e&&v.vertexNormals.push(C),0!==e&&E.vertexNormals.push(C);q&&(q=l[u++],q=r[q],v.color.setHex(q),E.color.setHex(q));if(n)for(e=0;4>e;e++)q=l[u++],q=r[q],2!==e&&v.vertexColors.push(new S(q)),
|
||
|
0!==e&&E.vertexColors.push(new S(q));c.faces.push(v);c.faces.push(E)}else{v=new Zb;v.a=l[u++];v.b=l[u++];v.c=l[u++];y&&(y=l[u++],v.materialIndex=y);y=c.faces.length;if(e)for(e=0;e<t;e++)for(z=d.uvs[e],c.faceVertexUvs[e][y]=[],g=0;3>g;g++)B=l[u++],D=z[2*B],B=z[2*B+1],D=new x(D,B),c.faceVertexUvs[e][y].push(D);A&&(A=3*l[u++],v.normal.set(m[A++],m[A++],m[A]));if(C)for(e=0;3>e;e++)A=3*l[u++],C=new p(m[A++],m[A++],m[A]),v.vertexNormals.push(C);q&&(q=l[u++],v.color.setHex(r[q]));if(n)for(e=0;3>e;e++)q=
|
||
|
l[u++],v.vertexColors.push(new S(r[q]));c.faces.push(v)}}d=a;u=void 0!==d.influencesPerVertex?d.influencesPerVertex:2;if(d.skinWeights)for(k=0,l=d.skinWeights.length;k<l;k+=u)c.skinWeights.push(new ya(d.skinWeights[k],1<u?d.skinWeights[k+1]:0,2<u?d.skinWeights[k+2]:0,3<u?d.skinWeights[k+3]:0));if(d.skinIndices)for(k=0,l=d.skinIndices.length;k<l;k+=u)c.skinIndices.push(new ya(d.skinIndices[k],1<u?d.skinIndices[k+1]:0,2<u?d.skinIndices[k+2]:0,3<u?d.skinIndices[k+3]:0));c.bones=d.bones;c.bones&&0<c.bones.length&&
|
||
|
(c.skinWeights.length!==c.skinIndices.length||c.skinIndices.length!==c.vertices.length)&&console.warn("When skinning, number of vertices ("+c.vertices.length+"), skinIndices ("+c.skinIndices.length+"), and skinWeights ("+c.skinWeights.length+") should match.");k=a;l=k.scale;if(void 0!==k.morphTargets)for(d=0,u=k.morphTargets.length;d<u;d++)for(c.morphTargets[d]={},c.morphTargets[d].name=k.morphTargets[d].name,c.morphTargets[d].vertices=[],m=c.morphTargets[d].vertices,r=k.morphTargets[d].vertices,
|
||
|
t=0,n=r.length;t<n;t+=3)q=new p,q.x=r[t]*l,q.y=r[t+1]*l,q.z=r[t+2]*l,m.push(q);if(void 0!==k.morphColors&&0<k.morphColors.length)for(console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'),l=c.faces,k=k.morphColors[0].colors,d=0,u=l.length;d<u;d++)l[d].color.fromArray(k,3*d);k=a;d=[];u=[];void 0!==k.animation&&u.push(k.animation);void 0!==k.animations&&(k.animations.length?u=u.concat(k.animations):u.push(k.animations));for(k=0;k<u.length;k++)(l=gb.parseAnimation(u[k],
|
||
|
c.bones))&&d.push(l);c.morphTargets&&(u=gb.CreateClipsFromMorphTargetSequences(c.morphTargets,10),d=d.concat(u));0<d.length&&(c.animations=d);c.computeFaceNormals();c.computeBoundingSphere();if(void 0===a.materials||0===a.materials.length)return{geometry:c};a=Jd.prototype.initMaterials(a.materials,b,this.crossOrigin);return{geometry:c,materials:a}}}()});Object.assign(function(a){this.manager=void 0!==a?a:db;this.texturePath=""}.prototype,{load:function(a,b,c,d){""===this.texturePath&&(this.texturePath=
|
||
|
a.substring(0,a.lastIndexOf("/")+1));var e=this;(new Db(e.manager)).load(a,function(c){var g=null;try{g=JSON.parse(c)}catch(l){void 0!==d&&d(l);console.error("THREE:ObjectLoader: Can't parse "+a+".",l.message);return}c=g.metadata;void 0===c||void 0===c.type||"geometry"===c.type.toLowerCase()?console.error("THREE.ObjectLoader: Can't load "+a+". Use THREE.JSONLoader instead."):e.parse(g,b)},c,d)},setTexturePath:function(a){this.texturePath=a},setCrossOrigin:function(a){this.crossOrigin=a},parse:function(a,
|
||
|
b){var c=this.parseShape(a.shapes);c=this.parseGeometries(a.geometries,c);var d=this.parseImages(a.images,function(){void 0!==b&&b(e)});d=this.parseTextures(a.textures,d);d=this.parseMaterials(a.materials,d);var e=this.parseObject(a.object,c,d);a.animations&&(e.animations=this.parseAnimations(a.animations));void 0!==a.images&&0!==a.images.length||void 0===b||b(e);return e},parseShape:function(a){var b={};if(void 0!==a)for(var c=0,d=a.length;c<d;c++){var e=(new kc).fromJSON(a[c]);b[e.uuid]=e}return b},
|
||
|
parseGeometries:function(a,b){var c={};if(void 0!==a)for(var d=new Df,e=new rh,g=0,k=a.length;g<k;g++){var l=a[g];switch(l.type){case "PlaneGeometry":case "PlaneBufferGeometry":var n=new bb[l.type](l.width,l.height,l.widthSegments,l.heightSegments);break;case "BoxGeometry":case "BoxBufferGeometry":case "CubeGeometry":n=new bb[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);break;case "CircleGeometry":case "CircleBufferGeometry":n=new bb[l.type](l.radius,l.segments,
|
||
|
l.thetaStart,l.thetaLength);break;case "CylinderGeometry":case "CylinderBufferGeometry":n=new bb[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);break;case "ConeGeometry":case "ConeBufferGeometry":n=new bb[l.type](l.radius,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);break;case "SphereGeometry":case "SphereBufferGeometry":n=new bb[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,
|
||
|
l.phiLength,l.thetaStart,l.thetaLength);break;case "DodecahedronGeometry":case "DodecahedronBufferGeometry":case "IcosahedronGeometry":case "IcosahedronBufferGeometry":case "OctahedronGeometry":case "OctahedronBufferGeometry":case "TetrahedronGeometry":case "TetrahedronBufferGeometry":n=new bb[l.type](l.radius,l.detail);break;case "RingGeometry":case "RingBufferGeometry":n=new bb[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);break;case "TorusGeometry":case "TorusBufferGeometry":n=
|
||
|
new bb[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);break;case "TorusKnotGeometry":case "TorusKnotBufferGeometry":n=new bb[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);break;case "LatheGeometry":case "LatheBufferGeometry":n=new bb[l.type](l.points,l.segments,l.phiStart,l.phiLength);break;case "PolyhedronGeometry":case "PolyhedronBufferGeometry":n=new bb[l.type](l.vertices,l.indices,l.radius,l.details);break;case "ShapeGeometry":case "ShapeBufferGeometry":n=
|
||
|
[];for(var m=0,r=l.shapes.length;m<r;m++)n.push(b[l.shapes[m]]);n=new bb[l.type](n,l.curveSegments);break;case "BufferGeometry":n=e.parse(l);break;case "Geometry":n=d.parse(l,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+l.type+'"');continue}n.uuid=l.uuid;void 0!==l.name&&(n.name=l.name);c[l.uuid]=n}return c},parseMaterials:function(a,b){var c={};if(void 0!==a){var d=new Cf;d.setTextures(b);b=0;for(var e=a.length;b<e;b++){var g=a[b];if("MultiMaterial"===
|
||
|
g.type){for(var k=[],l=0;l<g.materials.length;l++)k.push(d.parse(g.materials[l]));c[g.uuid]=k}else c[g.uuid]=d.parse(g)}}return c},parseAnimations:function(a){for(var b=[],c=0;c<a.length;c++){var d=gb.parse(a[c]);b.push(d)}return b},parseImages:function(a,b){function c(a){d.manager.itemStart(a);return g.load(a,function(){d.manager.itemEnd(a)},void 0,function(){d.manager.itemEnd(a);d.manager.itemError(a)})}var d=this,e={};if(void 0!==a&&0<a.length){b=new ph(b);var g=new oe(b);g.setCrossOrigin(this.crossOrigin);
|
||
|
b=0;for(var k=a.length;b<k;b++){var l=a[b],n=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:d.texturePath+l.url;e[l.uuid]=c(n)}}return e},parseTextures:function(a,b){function c(a,b){if("number"===typeof a)return a;console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",a);return b[a]}var d={};if(void 0!==a)for(var e=0,g=a.length;e<g;e++){var k=a[e];void 0===k.image&&console.warn('THREE.ObjectLoader: No "image" specified for',k.uuid);void 0===b[k.image]&&console.warn("THREE.ObjectLoader: Undefined image",
|
||
|
k.image);var l=new ra(b[k.image]);l.needsUpdate=!0;l.uuid=k.uuid;void 0!==k.name&&(l.name=k.name);void 0!==k.mapping&&(l.mapping=c(k.mapping,pm));void 0!==k.offset&&l.offset.fromArray(k.offset);void 0!==k.repeat&&l.repeat.fromArray(k.repeat);void 0!==k.center&&l.center.fromArray(k.center);void 0!==k.rotation&&(l.rotation=k.rotation);void 0!==k.wrap&&(l.wrapS=c(k.wrap[0],Vi),l.wrapT=c(k.wrap[1],Vi));void 0!==k.format&&(l.format=k.format);void 0!==k.minFilter&&(l.minFilter=c(k.minFilter,Wi));void 0!==
|
||
|
k.magFilter&&(l.magFilter=c(k.magFilter,Wi));void 0!==k.anisotropy&&(l.anisotropy=k.anisotropy);void 0!==k.flipY&&(l.flipY=k.flipY);d[k.uuid]=l}return d},parseObject:function(a,b,c){function d(a){void 0===b[a]&&console.warn("THREE.ObjectLoader: Undefined geometry",a);return b[a]}function e(a){if(void 0!==a){if(Array.isArray(a)){for(var b=[],d=0,e=a.length;d<e;d++){var g=a[d];void 0===c[g]&&console.warn("THREE.ObjectLoader: Undefined material",g);b.push(c[g])}return b}void 0===c[a]&&console.warn("THREE.ObjectLoader: Undefined material",
|
||
|
a);return c[a]}}switch(a.type){case "Scene":var g=new xc;void 0!==a.background&&Number.isInteger(a.background)&&(g.background=new S(a.background));void 0!==a.fog&&("Fog"===a.fog.type?g.fog=new wc(a.fog.color,a.fog.near,a.fog.far):"FogExp2"===a.fog.type&&(g.fog=new vc(a.fog.color,a.fog.density)));break;case "PerspectiveCamera":g=new Ba(a.fov,a.aspect,a.near,a.far);void 0!==a.focus&&(g.focus=a.focus);void 0!==a.zoom&&(g.zoom=a.zoom);void 0!==a.filmGauge&&(g.filmGauge=a.filmGauge);void 0!==a.filmOffset&&
|
||
|
(g.filmOffset=a.filmOffset);void 0!==a.view&&(g.view=Object.assign({},a.view));break;case "OrthographicCamera":g=new qb(a.left,a.right,a.top,a.bottom,a.near,a.far);void 0!==a.zoom&&(g.zoom=a.zoom);void 0!==a.view&&(g.view=Object.assign({},a.view));break;case "AmbientLight":g=new te(a.color,a.intensity);break;case "DirectionalLight":g=new se(a.color,a.intensity);break;case "PointLight":g=new re(a.color,a.intensity,a.distance,a.decay);break;case "RectAreaLight":g=new ue(a.color,a.intensity,a.width,
|
||
|
a.height);break;case "SpotLight":g=new qe(a.color,a.intensity,a.distance,a.angle,a.penumbra,a.decay);break;case "HemisphereLight":g=new pe(a.color,a.groundColor,a.intensity);break;case "SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case "Mesh":g=d(a.geometry);var k=e(a.material);g=g.bones&&0<g.bones.length?new ke(g,k):new ha(g,k);break;case "LOD":g=new ie;break;case "Line":g=new Va(d(a.geometry),e(a.material),a.mode);break;case "LineLoop":g=new nf(d(a.geometry),
|
||
|
e(a.material));break;case "LineSegments":g=new Ca(d(a.geometry),e(a.material));break;case "PointCloud":case "Points":g=new of(d(a.geometry),e(a.material));break;case "Sprite":g=new lf(e(a.material));break;case "Group":g=new pf;break;default:g=new O}g.uuid=a.uuid;void 0!==a.name&&(g.name=a.name);void 0!==a.matrix?(g.matrix.fromArray(a.matrix),void 0!==a.matrixAutoUpdate&&(g.matrixAutoUpdate=a.matrixAutoUpdate),g.matrixAutoUpdate&&g.matrix.decompose(g.position,g.quaternion,g.scale)):(void 0!==a.position&&
|
||
|
g.position.fromArray(a.position),void 0!==a.rotation&&g.rotation.fromArray(a.rotation),void 0!==a.quaternion&&g.quaternion.fromArray(a.quaternion),void 0!==a.scale&&g.scale.fromArray(a.scale));void 0!==a.castShadow&&(g.castShadow=a.castShadow);void 0!==a.receiveShadow&&(g.receiveShadow=a.receiveShadow);a.shadow&&(void 0!==a.shadow.bias&&(g.shadow.bias=a.shadow.bias),void 0!==a.shadow.radius&&(g.shadow.radius=a.shadow.radius),void 0!==a.shadow.mapSize&&g.shadow.mapSize.fromArray(a.shadow.mapSize),
|
||
|
void 0!==a.shadow.camera&&(g.shadow.camera=this.parseObject(a.shadow.camera)));void 0!==a.visible&&(g.visible=a.visible);void 0!==a.frustumCulled&&(g.frustumCulled=a.frustumCulled);void 0!==a.renderOrder&&(g.renderOrder=a.renderOrder);void 0!==a.userData&&(g.userData=a.userData);if(void 0!==a.children){k=a.children;for(var l=0;l<k.length;l++)g.add(this.parseObject(k[l],b,c))}if("LOD"===a.type)for(a=a.levels,k=0;k<a.length;k++){l=a[k];var n=g.getObjectByProperty("uuid",l.object);void 0!==n&&g.addLevel(n,
|
||
|
l.distance)}return g}});var pm={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},Vi={RepeatWrapping:1E3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},Wi={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008};
|
||
|
Object.assign(sh.prototype,{moveTo:function(a,b){this.currentPath=new vb;this.subPaths.push(this.currentPath);this.currentPath.moveTo(a,b)},lineTo:function(a,b){this.currentPath.lineTo(a,b)},quadraticCurveTo:function(a,b,c,d){this.currentPath.quadraticCurveTo(a,b,c,d)},bezierCurveTo:function(a,b,c,d,e,g){this.currentPath.bezierCurveTo(a,b,c,d,e,g)},splineThru:function(a){this.currentPath.splineThru(a)},toShapes:function(a,b){function c(a){for(var b=[],c=0,d=a.length;c<d;c++){var e=a[c],g=new kc;g.curves=
|
||
|
e.curves;b.push(g)}return b}function d(a,b){for(var c=b.length,d=!1,e=c-1,g=0;g<c;e=g++){var k=b[e],l=b[g],m=l.x-k.x,n=l.y-k.y;if(Math.abs(n)>Number.EPSILON){if(0>n&&(k=b[g],m=-m,l=b[e],n=-n),!(a.y<k.y||a.y>l.y))if(a.y===k.y){if(a.x===k.x)return!0}else{e=n*(a.x-k.x)-m*(a.y-k.y);if(0===e)return!0;0>e||(d=!d)}}else if(a.y===k.y&&(l.x<=a.x&&a.x<=k.x||k.x<=a.x&&a.x<=l.x))return!0}return d}var e=Qb.isClockWise,g=this.subPaths;if(0===g.length)return[];if(!0===b)return c(g);b=[];if(1===g.length){var k=g[0];
|
||
|
var l=new kc;l.curves=k.curves;b.push(l);return b}var n=!e(g[0].getPoints());n=a?!n:n;l=[];var m=[],r=[],p=0;m[p]=void 0;r[p]=[];for(var q=0,u=g.length;q<u;q++){k=g[q];var v=k.getPoints();var y=e(v);(y=a?!y:y)?(!n&&m[p]&&p++,m[p]={s:new kc,p:v},m[p].s.curves=k.curves,n&&p++,r[p]=[]):r[p].push({h:k,p:v[0]})}if(!m[0])return c(g);if(1<m.length){q=!1;a=[];e=0;for(g=m.length;e<g;e++)l[e]=[];e=0;for(g=m.length;e<g;e++)for(k=r[e],y=0;y<k.length;y++){n=k[y];p=!0;for(v=0;v<m.length;v++)d(n.p,m[v].p)&&(e!==
|
||
|
v&&a.push({froms:e,tos:v,hole:y}),p?(p=!1,l[v].push(n)):q=!0);p&&l[e].push(n)}0<a.length&&(q||(r=l))}q=0;for(e=m.length;q<e;q++)for(l=m[q].s,b.push(l),a=r[q],g=0,k=a.length;g<k;g++)l.holes.push(a[g].h);return b}});Object.assign(Ef.prototype,{isFont:!0,generateShapes:function(a,b,c){void 0===b&&(b=100);c=[];var d=b;b=this.data;var e=String(a).split("");d/=b.resolution;var g=(b.boundingBox.yMax-b.boundingBox.yMin+b.underlineThickness)*d;a=[];for(var k=0,l=0,n=0;n<e.length;n++){var m=e[n];if("\n"===
|
||
|
m)k=0,l-=g;else{var p=d;var q=k,t=l;if(m=b.glyphs[m]||b.glyphs["?"]){var u=new sh;if(m.o)for(var v=m._cachedOutline||(m._cachedOutline=m.o.split(" ")),y=0,x=v.length;y<x;)switch(v[y++]){case "m":var C=v[y++]*p+q;var z=v[y++]*p+t;u.moveTo(C,z);break;case "l":C=v[y++]*p+q;z=v[y++]*p+t;u.lineTo(C,z);break;case "q":var B=v[y++]*p+q;var D=v[y++]*p+t;var F=v[y++]*p+q;var G=v[y++]*p+t;u.quadraticCurveTo(F,G,B,D);break;case "b":B=v[y++]*p+q,D=v[y++]*p+t,F=v[y++]*p+q,G=v[y++]*p+t,C=v[y++]*p+q,z=v[y++]*p+t,
|
||
|
u.bezierCurveTo(F,G,C,z,B,D)}p={offsetX:m.ha*p,path:u}}else p=void 0;k+=p.offsetX;a.push(p.path)}}b=0;for(e=a.length;b<e;b++)Array.prototype.push.apply(c,a[b].toShapes());return c}});Object.assign(th.prototype,{load:function(a,b,c,d){var e=this,g=new Db(this.manager);g.setPath(this.path);g.load(a,function(a){try{var c=JSON.parse(a)}catch(n){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),c=JSON.parse(a.substring(65,a.length-2))}a=e.parse(c);b&&
|
||
|
b(a)},c,d)},parse:function(a){return new Ef(a)},setPath:function(a){this.path=a;return this}});var Ve,wh={getContext:function(){void 0===Ve&&(Ve=new (window.AudioContext||window.webkitAudioContext));return Ve},setContext:function(a){Ve=a}};Object.assign(uh.prototype,{load:function(a,b,c,d){var e=new Db(this.manager);e.setResponseType("arraybuffer");e.load(a,function(a){wh.getContext().decodeAudioData(a,function(a){b(a)})},c,d)}});Object.assign(function(){this.type="StereoCamera";this.aspect=1;this.eyeSep=
|
||
|
.064;this.cameraL=new Ba;this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=!1;this.cameraR=new Ba;this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=!1}.prototype,{update:function(){var a,b,c,d,e,g,k,l,n=new V,m=new V;return function(p){if(a!==this||b!==p.focus||c!==p.fov||d!==p.aspect*this.aspect||e!==p.near||g!==p.far||k!==p.zoom||l!==this.eyeSep){a=this;b=p.focus;c=p.fov;d=p.aspect*this.aspect;e=p.near;g=p.far;k=p.zoom;var r=p.projectionMatrix.clone();l=this.eyeSep/2;var q=l*
|
||
|
e/b,u=e*Math.tan(ja.DEG2RAD*c*.5)/k;m.elements[12]=-l;n.elements[12]=l;var v=-u*d+q;var y=u*d+q;r.elements[0]=2*e/(y-v);r.elements[8]=(y+v)/(y-v);this.cameraL.projectionMatrix.copy(r);v=-u*d-q;y=u*d-q;r.elements[0]=2*e/(y-v);r.elements[8]=(y+v)/(y-v);this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(p.matrixWorld).multiply(m);this.cameraR.matrixWorld.copy(p.matrixWorld).multiply(n)}}()});Kd.prototype=Object.create(O.prototype);Kd.prototype.constructor=Kd;vh.prototype=Object.assign(Object.create(O.prototype),
|
||
|
{constructor:vh,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)},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)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01)},updateMatrixWorld:function(){var a=new p,b=new sa,c=new p,d=new p;return function(e){O.prototype.updateMatrixWorld.call(this,e);e=this.context.listener;var g=this.up;this.matrixWorld.decompose(a,b,c);d.set(0,0,-1).applyQuaternion(b);e.positionX?(e.positionX.setValueAtTime(a.x,this.context.currentTime),e.positionY.setValueAtTime(a.y,
|
||
|
this.context.currentTime),e.positionZ.setValueAtTime(a.z,this.context.currentTime),e.forwardX.setValueAtTime(d.x,this.context.currentTime),e.forwardY.setValueAtTime(d.y,this.context.currentTime),e.forwardZ.setValueAtTime(d.z,this.context.currentTime),e.upX.setValueAtTime(g.x,this.context.currentTime),e.upY.setValueAtTime(g.y,this.context.currentTime),e.upZ.setValueAtTime(g.z,this.context.currentTime)):(e.setPosition(a.x,a.y,a.z),e.setOrientation(d.x,d.y,d.z,g.x,g.y,g.z))}}()});Ld.prototype=Object.assign(Object.create(O.prototype),
|
||
|
{constructor:Ld,getOutput:function(){return this.gain},setNodeSource:function(a){this.hasPlaybackControl=!1;this.sourceType="audioNode";this.source=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);a.playbackRate.setValueAtTime(this.playbackRate,this.startTime);this.startTime=this.context.currentTime;a.start(this.startTime,this.offset);this.isPlaying=!0;this.source=a;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.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.offset=0,this.isPlaying=!1,this},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var a=1,b=this.filters.length;a<b;a++)this.filters[a-1].connect(this.filters[a]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<
|
||
|
this.filters.length){this.source.disconnect(this.filters[0]);for(var a=1,b=this.filters.length;a<b;a++)this.filters[a-1].disconnect(this.filters[a]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(a){a||(a=[]);!0===this.isPlaying?(this.disconnect(),this.filters=a,this.connect()):this.filters=a;return this},getFilter:function(){return this.getFilters()[0]},setFilter:function(a){return this.setFilters(a?
|
||
|
[a]:[])},setPlaybackRate:function(a){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.playbackRate=a,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},
|
||
|
setLoop:function(a){if(!1===this.hasPlaybackControl)console.warn("THREE.Audio: this Audio has no playback control.");else return this.loop=a,!0===this.isPlaying&&(this.source.loop=this.loop),this},getVolume:function(){return this.gain.gain.value},setVolume:function(a){this.gain.gain.setTargetAtTime(a,this.context.currentTime,.01);return this}});xh.prototype=Object.assign(Object.create(Ld.prototype),{constructor:xh,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},
|
||
|
setRefDistance:function(a){this.panner.refDistance=a},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(a){this.panner.rolloffFactor=a},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(a){this.panner.distanceModel=a},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(a){this.panner.maxDistance=a},updateMatrixWorld:function(){var a=new p;return function(b){O.prototype.updateMatrixWorld.call(this,
|
||
|
b);a.setFromMatrixPosition(this.matrixWorld);this.panner.setPosition(a.x,a.y,a.z)}}()});Object.assign(yh.prototype,{getFrequencyData:function(){this.analyser.getByteFrequencyData(this.data);return this.data},getAverageFrequency:function(){for(var a=0,b=this.getFrequencyData(),c=0;c<b.length;c++)a+=b[c];return a/b.length}});Object.assign(zh.prototype,{accumulate:function(a,b){var c=this.buffer,d=this.valueSize;a=a*d+d;var e=this.cumulativeWeight;if(0===e){for(e=0;e!==d;++e)c[a+e]=c[e];e=b}else e+=
|
||
|
b,this._mixBufferRegion(c,a,0,b/e,d);this.cumulativeWeight=e},apply:function(a){var b=this.valueSize,c=this.buffer;a=a*b+b;var d=this.cumulativeWeight,e=this.binding;this.cumulativeWeight=0;1>d&&this._mixBufferRegion(c,a,3*b,1-d,b);d=b;for(var g=b+b;d!==g;++d)if(c[d]!==c[d+b]){e.setValue(c,a);break}},saveOriginalState:function(){var a=this.buffer,b=this.valueSize,c=3*b;this.binding.getValue(a,c);for(var d=b;d!==c;++d)a[d]=a[c+d%b];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,
|
||
|
3*this.valueSize)},_select:function(a,b,c,d,e){if(.5<=d)for(d=0;d!==e;++d)a[b+d]=a[c+d]},_slerp:function(a,b,c,d){sa.slerpFlat(a,b,a,b,a,c,d)},_lerp:function(a,b,c,d,e){for(var g=1-d,k=0;k!==e;++k){var l=b+k;a[l]=a[l]*g+a[c+k]*d}}});Object.assign(Ah.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(Ta,{Composite:Ah,create:function(a,b,c){return a&&a.isAnimationObjectGroup?new Ta.Composite(a,b,c):new Ta(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+"$"),g=["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!==g.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<a.length;c++){var e=a[c];if(e.name===b||e.uuid===b||(e=d(e.children)))return e}return null};if(a=d(a.children))return a}return null}});Object.assign(Ta.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(a,b){a[b]=this.node[this.propertyName]},function(a,b){for(var c=this.resolvedProperty,
|
||
|
d=0,e=c.length;d!==e;++d)a[b++]=c[d]},function(a,b){a[b]=this.resolvedProperty[this.propertyIndex]},function(a,b){this.resolvedProperty.toArray(a,b)}],SetterByBindingTypeAndVersioning:[[function(a,b){this.targetObject[this.propertyName]=a[b]},function(a,b){this.targetObject[this.propertyName]=a[b];this.targetObject.needsUpdate=!0},function(a,b){this.targetObject[this.propertyName]=a[b];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==
|
||
|
e;++d)c[d]=a[b++]},function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.needsUpdate=!0},function(a,b){for(var c=this.resolvedProperty,d=0,e=c.length;d!==e;++d)c[d]=a[b++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(a,b){this.resolvedProperty[this.propertyIndex]=a[b]},function(a,b){this.resolvedProperty[this.propertyIndex]=a[b];this.targetObject.needsUpdate=!0},function(a,b){this.resolvedProperty[this.propertyIndex]=a[b];this.targetObject.matrixWorldNeedsUpdate=
|
||
|
!0}],[function(a,b){this.resolvedProperty.fromArray(a,b)},function(a,b){this.resolvedProperty.fromArray(a,b);this.targetObject.needsUpdate=!0},function(a,b){this.resolvedProperty.fromArray(a,b);this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(a,b){this.bind();this.getValue(a,b)},setValue:function(a,b){this.bind();this.setValue(a,b)},bind:function(){var a=this.node,b=this.parsedPath,c=b.objectName,d=b.propertyName,e=b.propertyIndex;a||(this.node=a=Ta.findNode(this.rootNode,b.nodeName)||
|
||
|
this.rootNode);this.getValue=this._getValue_unavailable;this.setValue=this._setValue_unavailable;if(a){if(c){var g=b.objectIndex;switch(c){case "materials":if(!a.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!a.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}a=a.material.materials;break;case "bones":if(!a.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",
|
||
|
this);return}a=a.skeleton.bones;for(c=0;c<a.length;c++)if(a[c].name===g){g=c;break}break;default:if(void 0===a[c]){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}a=a[c]}if(void 0!==g){if(void 0===a[g]){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,a);return}a=a[g]}}g=a[d];if(void 0===g)console.error("THREE.PropertyBinding: Trying to update property for track: "+b.nodeName+"."+d+" but it wasn't found.",
|
||
|
a);else{b=this.Versioning.None;void 0!==a.needsUpdate?(b=this.Versioning.NeedsUpdate,this.targetObject=a):void 0!==a.matrixWorldNeedsUpdate&&(b=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=a);c=this.BindingType.Direct;if(void 0!==e){if("morphTargetInfluences"===d){if(!a.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(a.geometry.isBufferGeometry){if(!a.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",
|
||
|
this);return}for(c=0;c<this.node.geometry.morphAttributes.position.length;c++)if(a.geometry.morphAttributes.position[c].name===e){e=c;break}}else{if(!a.geometry.morphTargets){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);return}for(c=0;c<this.node.geometry.morphTargets.length;c++)if(a.geometry.morphTargets[c].name===e){e=c;break}}}c=this.BindingType.ArrayElement;this.resolvedProperty=g;this.propertyIndex=e}else void 0!==
|
||
|
g.fromArray&&void 0!==g.toArray?(c=this.BindingType.HasFromToArray,this.resolvedProperty=g):Array.isArray(g)?(c=this.BindingType.EntireArray,this.resolvedProperty=g):this.propertyName=d;this.getValue=this.GetterByBindingType[c];this.setValue=this.SetterByBindingTypeAndVersioning[c][b]}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null;this.getValue=this._getValue_unbound;this.setValue=this._setValue_unbound}});
|
||
|
Object.assign(Ta.prototype,{_getValue_unbound:Ta.prototype.getValue,_setValue_unbound:Ta.prototype.setValue});Object.assign(function(){this.uuid=ja.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}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._paths,g=this._parsedPaths,k=this._bindings,l=k.length,n=void 0,m=0,p=arguments.length;m!==p;++m){var q=arguments[m],t=q.uuid,u=d[t];if(void 0===u){u=b++;d[t]=u;a.push(q);t=0;for(var v=l;t!==v;++t)k[t].push(new Ta(q,e[t],g[t]))}else if(u<c){n=a[u];var y=--c;v=a[y];d[v.uuid]=u;a[u]=v;d[t]=
|
||
|
y;a[y]=q;t=0;for(v=l;t!==v;++t){var x=k[t],z=x[u];x[u]=x[y];void 0===z&&(z=new Ta(q,e[t],g[t]));x[y]=z}}else a[u]!==n&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c},remove:function(){for(var a=this._objects,b=this.nCachedObjects_,c=this._indicesByUUID,d=this._bindings,e=d.length,g=0,k=arguments.length;g!==k;++g){var l=arguments[g],n=l.uuid,m=c[n];if(void 0!==
|
||
|
m&&m>=b){var p=b++,q=a[p];c[q.uuid]=m;a[m]=q;c[n]=p;a[p]=l;l=0;for(n=e;l!==n;++l){q=d[l];var t=q[m];q[m]=q[p];q[p]=t}}}this.nCachedObjects_=b},uncache:function(){for(var a=this._objects,b=a.length,c=this.nCachedObjects_,d=this._indicesByUUID,e=this._bindings,g=e.length,k=0,l=arguments.length;k!==l;++k){var n=arguments[k].uuid,m=d[n];if(void 0!==m)if(delete d[n],m<c){n=--c;var p=a[n],q=--b,t=a[q];d[p.uuid]=m;a[m]=p;d[t.uuid]=n;a[n]=t;a.pop();p=0;for(t=g;p!==t;++p){var u=e[p],v=u[q];u[m]=u[n];u[n]=
|
||
|
v;u.pop()}}else for(q=--b,t=a[q],d[t.uuid]=m,a[m]=t,a.pop(),p=0,t=g;p!==t;++p)u=e[p],u[m]=u[q],u.pop()}this.nCachedObjects_=c},subscribe_:function(a,b){var c=this._bindingsIndicesByPath,d=c[a],e=this._bindings;if(void 0!==d)return e[d];var g=this._paths,k=this._parsedPaths,l=this._objects,n=this.nCachedObjects_,m=Array(l.length);d=e.length;c[a]=d;g.push(a);k.push(b);e.push(m);c=n;for(d=l.length;c!==d;++c)m[c]=new Ta(l[c],a,b);return m},unsubscribe_:function(a){var b=this._bindingsIndicesByPath,c=
|
||
|
b[a];if(void 0!==c){var d=this._paths,e=this._parsedPaths,g=this._bindings,k=g.length-1,l=g[k];b[a[k]]=c;g[c]=l;g.pop();e[c]=e[k];e.pop();d[c]=d[k];d.pop()}}});Object.assign(Bh.prototype,{play:function(){this._mixer._activateAction(this);return this},stop:function(){this._mixer._deactivateAction(this);return this.reset()},reset:function(){this.paused=!1;this.enabled=!0;this.time=0;this._loopCount=-1;this._startTime=null;return this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&
|
||
|
!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(a){this._startTime=a;return this},setLoop:function(a,b){this.loop=a;this.repetitions=b;return this},setEffectiveWeight:function(a){this.weight=a;this._effectiveWeight=this.enabled?a:0;return this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(a){return this._scheduleFading(a,0,1)},fadeOut:function(a){return this._scheduleFading(a,
|
||
|
1,0)},crossFadeFrom:function(a,b,c){a.fadeOut(b);this.fadeIn(b);if(c){c=this._clip.duration;var d=a._clip.duration,e=c/d;a.warp(1,d/c,b);this.warp(e,1,b)}return this},crossFadeTo:function(a,b,c){return a.crossFadeFrom(this,b,c)},stopFading:function(){var a=this._weightInterpolant;null!==a&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(a));return this},setEffectiveTimeScale:function(a){this.timeScale=a;this._effectiveTimeScale=this.paused?0:a;return this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},
|
||
|
setDuration:function(a){this.timeScale=this._clip.duration/a;return this.stopWarping()},syncWith:function(a){this.time=a.time;this.timeScale=a.timeScale;return this.stopWarping()},halt:function(a){return this.warp(this._effectiveTimeScale,0,a)},warp:function(a,b,c){var d=this._mixer,e=d.time,g=this._timeScaleInterpolant,k=this.timeScale;null===g&&(this._timeScaleInterpolant=g=d._lendControlInterpolant());d=g.parameterPositions;g=g.sampleValues;d[0]=e;d[1]=e+c;g[0]=a/k;g[1]=b/k;return this},stopWarping:function(){var a=
|
||
|
this._timeScaleInterpolant;null!==a&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(a));return this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(a,b,c,d){if(this.enabled){var e=this._startTime;if(null!==e){b=(a-e)*c;if(0>b||0===c)return;this._startTime=null;b*=c}b*=this._updateTimeScale(a);c=this._updateTime(b);a=this._updateWeight(a);if(0<a){b=this._interpolants;
|
||
|
e=this._propertyBindings;for(var g=0,k=b.length;g!==k;++g)b[g].evaluate(c),e[g].accumulate(d,a)}}else this._updateWeight(a)},_updateWeight:function(a){var b=0;if(this.enabled){b=this.weight;var c=this._weightInterpolant;if(null!==c){var d=c.evaluate(a)[0];b*=d;a>c.parameterPositions[1]&&(this.stopFading(),0===d&&(this.enabled=!1))}}return this._effectiveWeight=b},_updateTimeScale:function(a){var b=0;if(!this.paused){b=this.timeScale;var c=this._timeScaleInterpolant;if(null!==c){var d=c.evaluate(a)[0];
|
||
|
b*=d;a>c.parameterPositions[1]&&(this.stopWarping(),0===b?this.paused=!0:this.timeScale=b)}}return this._effectiveTimeScale=b},_updateTime:function(a){var b=this.time+a;if(0===a)return b;var c=this._clip.duration,d=this.loop,e=this._loopCount;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 break a;this.clampWhenFinished?this.paused=!0:this.enabled=!1;this._mixer.dispatchEvent({type:"finished",action:this,direction:0>a?-1:1})}else{d=2202===d;-1===
|
||
|
e&&(0<=a?(e=0,this._setEndings(!0,0===this.repetitions,d)):this._setEndings(0===this.repetitions,!0,d));if(b>=c||0>b){var g=Math.floor(b/c);b-=c*g;e+=Math.abs(g);var k=this.repetitions-e;0>=k?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,b=0<a?c:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<a?1:-1})):(1===k?(a=0>a,this._setEndings(a,!a,d)):this._setEndings(!1,!1,d),this._loopCount=e,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:g}))}if(d&&1===(e&1))return this.time=
|
||
|
b,c-b}return this.time=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,g=this._weightInterpolant;null===g&&(this._weightInterpolant=g=d._lendControlInterpolant());d=g.parameterPositions;g=g.sampleValues;d[0]=e;g[0]=b;d[1]=e+a;g[1]=c;return this}});Ff.prototype=Object.assign(Object.create(K.prototype),
|
||
|
{constructor:Ff,_bindAction:function(a,b){var c=a._localRoot||this._root,d=a._clip.tracks,e=d.length,g=a._propertyBindings;a=a._interpolants;var k=c.uuid,l=this._bindingsByRootAndName,n=l[k];void 0===n&&(n={},l[k]=n);for(l=0;l!==e;++l){var m=d[l],p=m.name,q=n[p];if(void 0===q){q=g[l];if(void 0!==q){null===q._cacheIndex&&(++q.referenceCount,this._addInactiveBinding(q,k,p));continue}q=new zh(Ta.create(c,p,b&&b._propertyBindings[l].binding.parsedPath),m.ValueTypeName,m.getValueSize());++q.referenceCount;
|
||
|
this._addInactiveBinding(q,k,p)}g[l]=q;a[l].resultBuffer=q.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&&a<this._nActiveActions},_addInactiveAction:function(a,b,c){var d=this._actions,e=this._actionsByClip,g=e[b];void 0===g?(g={knownActions:[a],actionByRoot:{}},a._byClipCacheIndex=0,e[b]=g):(b=g.knownActions,a._byClipCacheIndex=b.length,b.push(a));a._cacheIndex=d.length;d.push(a);
|
||
|
g.actionByRoot[c]=a},_removeInactiveAction:function(a){var b=this._actions,c=b[b.length-1],d=a._cacheIndex;c._cacheIndex=d;b[d]=c;b.pop();a._cacheIndex=null;b=a._clip.uuid;c=this._actionsByClip;d=c[b];var e=d.knownActions,g=e[e.length-1],k=a._byClipCacheIndex;g._byClipCacheIndex=k;e[k]=g;e.pop();a._byClipCacheIndex=null;delete d.actionByRoot[(a._localRoot||this._root).uuid];0===e.length&&delete c[b];this._removeInactiveBindingsForAction(a)},_removeInactiveBindingsForAction:function(a){a=a._propertyBindings;
|
||
|
for(var b=0,c=a.length;b!==c;++b){var d=a[b];0===--d.referenceCount&&this._removeInactiveBinding(d)}},_lendAction:function(a){var b=this._actions,c=a._cacheIndex,d=this._nActiveActions++,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_takeBackAction:function(a){var b=this._actions,c=a._cacheIndex,d=--this._nActiveActions,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_addInactiveBinding:function(a,b,c){var d=this._bindingsByRootAndName,e=d[b],g=this._bindings;void 0===e&&(e={},d[b]=
|
||
|
e);e[c]=a;a._cacheIndex=g.length;g.push(a)},_removeInactiveBinding:function(a){var b=this._bindings,c=a.binding,d=c.rootNode.uuid;c=c.path;var e=this._bindingsByRootAndName,g=e[d],k=b[b.length-1];a=a._cacheIndex;k._cacheIndex=a;b[a]=k;b.pop();delete g[c];a:{for(var l in g)break a;delete e[d]}},_lendBinding:function(a){var b=this._bindings,c=a._cacheIndex,d=this._nActiveBindings++,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_takeBackBinding:function(a){var b=this._bindings,c=a._cacheIndex,
|
||
|
d=--this._nActiveBindings,e=b[d];a._cacheIndex=d;b[d]=a;e._cacheIndex=c;b[c]=e},_lendControlInterpolant:function(){var a=this._controlInterpolants,b=this._nActiveControlInterpolants++,c=a[b];void 0===c&&(c=new we(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),c.__cacheIndex=b,a[b]=c);return c},_takeBackControlInterpolant:function(a){var b=this._controlInterpolants,c=a.__cacheIndex,d=--this._nActiveControlInterpolants,e=b[d];a.__cacheIndex=d;b[d]=a;e.__cacheIndex=
|
||
|
c;b[c]=e},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(a,b){var c=b||this._root,d=c.uuid;c="string"===typeof a?gb.findByName(c,a):a;a=null!==c?c.uuid:a;var e=this._actionsByClip[a],g=null;if(void 0!==e){g=e.actionByRoot[d];if(void 0!==g)return g;g=e.knownActions[0];null===c&&(c=g._clip)}if(null===c)return null;b=new Bh(this,c,b);this._bindAction(b,g);this._addInactiveAction(b,a,d);return b},existingAction:function(a,b){var c=b||this._root;b=c.uuid;c="string"===typeof a?
|
||
|
gb.findByName(c,a):a;a=this._actionsByClip[c?c.uuid:a];return void 0!==a?a.actionByRoot[b]||null:null},stopAllAction:function(){for(var a=this._actions,b=this._nActiveActions,c=this._bindings,d=this._nActiveBindings,e=this._nActiveBindings=this._nActiveActions=0;e!==b;++e)a[e].reset();for(e=0;e!==d;++e)c[e].useCount=0;return this},update:function(a){a*=this.timeScale;for(var b=this._actions,c=this._nActiveActions,d=this.time+=a,e=Math.sign(a),g=this._accuIndex^=1,k=0;k!==c;++k)b[k]._update(d,a,e,
|
||
|
g);a=this._bindings;b=this._nActiveBindings;for(k=0;k!==b;++k)a[k].apply(g);return this},getRoot:function(){return this._root},uncacheClip:function(a){var b=this._actions;a=a.uuid;var c=this._actionsByClip,d=c[a];if(void 0!==d){d=d.knownActions;for(var e=0,g=d.length;e!==g;++e){var k=d[e];this._deactivateAction(k);var l=k._cacheIndex,n=b[b.length-1];k._cacheIndex=null;k._byClipCacheIndex=null;n._cacheIndex=l;b[l]=n;b.pop();this._removeInactiveBindingsForAction(k)}delete c[a]}},uncacheRoot:function(a){a=
|
||
|
a.uuid;var b=this._actionsByClip;for(d in b){var c=b[d].actionByRoot[a];void 0!==c&&(this._deactivateAction(c),this._removeInactiveAction(c))}var d=this._bindingsByRootAndName[a];if(void 0!==d)for(var e in d)a=d[e],a.restoreOriginalState(),this._removeInactiveBinding(a)},uncacheAction:function(a,b){a=this.existingAction(a,b);null!==a&&(this._deactivateAction(a),this._removeInactiveAction(a))}});B.prototype.clone=function(){return new B(void 0===this.value.clone?this.value:this.value.clone())};Ch.prototype=
|
||
|
Object.assign(Object.create(R.prototype),{constructor:Ch,isInstancedBufferGeometry:!0,copy:function(a){R.prototype.copy.call(this,a);this.maxInstancedCount=a.maxInstancedCount;return this},clone:function(){return(new this.constructor).copy(this)}});Object.defineProperties(Dh.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}});Object.assign(Dh.prototype,{isInterleavedBufferAttribute:!0,setX:function(a,b){this.data.array[a*this.data.stride+this.offset]=
|
||
|
b;return this},setY:function(a,b){this.data.array[a*this.data.stride+this.offset+1]=b;return this},setZ:function(a,b){this.data.array[a*this.data.stride+this.offset+2]=b;return this},setW:function(a,b){this.data.array[a*this.data.stride+this.offset+3]=b;return this},getX:function(a){return this.data.array[a*this.data.stride+this.offset]},getY:function(a){return this.data.array[a*this.data.stride+this.offset+1]},getZ:function(a){return this.data.array[a*this.data.stride+this.offset+2]},getW:function(a){return this.data.array[a*
|
||
|
this.data.stride+this.offset+3]},setXY:function(a,b,c){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+1]=c;return this},setXYZ:function(a,b,c,d){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+1]=c;this.data.array[a+2]=d;return this},setXYZW:function(a,b,c,d,e){a=a*this.data.stride+this.offset;this.data.array[a+0]=b;this.data.array[a+1]=c;this.data.array[a+2]=d;this.data.array[a+3]=e;return this}});Object.defineProperty(Md.prototype,"needsUpdate",
|
||
|
{set:function(a){!0===a&&this.version++}});Object.assign(Md.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;d<e;d++)this.array[a+d]=b.array[c+d];return this},set:function(a,b){void 0===b&&(b=0);this.array.set(a,b);return this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(a){this.onUploadCallback=a;return this}});Eh.prototype=Object.assign(Object.create(Md.prototype),{constructor:Eh,isInstancedInterleavedBuffer:!0,copy:function(a){Md.prototype.copy.call(this,a);this.meshPerAttribute=a.meshPerAttribute;
|
||
|
return this}});Fh.prototype=Object.assign(Object.create(fa.prototype),{constructor:Fh,isInstancedBufferAttribute:!0,copy:function(a){fa.prototype.copy.call(this,a);this.meshPerAttribute=a.meshPerAttribute;return this}});Object.assign(Gh.prototype,{linePrecision:1,set:function(a,b){this.ray.set(a,b)},setFromCamera:function(a,b){b&&b.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(b.matrixWorld),this.ray.direction.set(a.x,a.y,.5).unproject(b).sub(this.ray.origin).normalize()):b&&b.isOrthographicCamera?
|
||
|
(this.ray.origin.set(a.x,a.y,(b.near+b.far)/(b.near-b.far)).unproject(b),this.ray.direction.set(0,0,-1).transformDirection(b.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(a,b,c){c=c||[];Gf(a,this,c,b);c.sort(Hh);return c},intersectObjects:function(a,b,c){c=c||[];if(!1===Array.isArray(a))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),c;for(var d=0,e=a.length;d<e;d++)Gf(a[d],this,c,b);c.sort(Hh);return c}});Object.assign(Hf.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}});
|
||
|
Object.assign(If.prototype,{set:function(a,b,c){this.radius=a;this.phi=b;this.theta=c;return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.radius=a.radius;this.phi=a.phi;this.theta=a.theta;return this},makeSafe:function(){this.phi=Math.max(1E-6,Math.min(Math.PI-1E-6,this.phi));return this},setFromVector3:function(a){this.radius=a.length();0===this.radius?this.phi=this.theta=0:(this.theta=Math.atan2(a.x,a.z),this.phi=Math.acos(ja.clamp(a.y/this.radius,-1,1)));
|
||
|
return this}});Object.assign(function(a,b,c){this.radius=void 0!==a?a:1;this.theta=void 0!==b?b:0;this.y=void 0!==c?c:0;return this}.prototype,{set:function(a,b,c){this.radius=a;this.theta=b;this.y=c;return this},clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.radius=a.radius;this.theta=a.theta;this.y=a.y;return this},setFromVector3:function(a){this.radius=Math.sqrt(a.x*a.x+a.z*a.z);this.theta=Math.atan2(a.x,a.z);this.y=a.y;return this}});Object.assign(Ih.prototype,
|
||
|
{set:function(a,b){this.min.copy(a);this.max.copy(b);return this},setFromPoints:function(a){this.makeEmpty();for(var b=0,c=a.length;b<c;b++)this.expandByPoint(a[b]);return this},setFromCenterAndSize:function(){var a=new x;return function(b,c){c=a.copy(c).multiplyScalar(.5);this.min.copy(b).sub(c);this.max.copy(b).add(c);return this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(a){this.min.copy(a.min);this.max.copy(a.max);return this},makeEmpty:function(){this.min.x=this.min.y=
|
||
|
Infinity;this.max.x=this.max.y=-Infinity;return this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(a){void 0===a&&(console.warn("THREE.Box2: .getCenter() target is now required"),a=new x);return this.isEmpty()?a.set(0,0):a.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(a){void 0===a&&(console.warn("THREE.Box2: .getSize() target is now required"),a=new x);return this.isEmpty()?a.set(0,0):a.subVectors(this.max,this.min)},expandByPoint:function(a){this.min.min(a);
|
||
|
this.max.max(a);return this},expandByVector:function(a){this.min.sub(a);this.max.add(a);return this},expandByScalar:function(a){this.min.addScalar(-a);this.max.addScalar(a);return this},containsPoint:function(a){return a.x<this.min.x||a.x>this.max.x||a.y<this.min.y||a.y>this.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 x);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.x<this.min.x||a.min.x>this.max.x||a.max.y<this.min.y||a.min.y>this.max.y?!1:!0},clampPoint:function(a,b){void 0===b&&(console.warn("THREE.Box2: .clampPoint() target is now required"),b=new x);return b.copy(a).clamp(this.min,this.max)},distanceToPoint:function(){var a=new x;return function(b){return a.copy(b).clamp(this.min,this.max).sub(b).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)}});xe.prototype=Object.create(O.prototype);xe.prototype.constructor=xe;xe.prototype.isImmediateRenderObject=!0;ye.prototype=Object.create(Ca.prototype);ye.prototype.constructor=ye;ye.prototype.update=function(){var a=new p,b=new p,c=new Ja;return function(){var d=
|
||
|
["a","b","c"];this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,g=this.geometry.attributes.position,k=this.object.geometry;if(k&&k.isGeometry)for(var l=k.vertices,n=k.faces,m=k=0,p=n.length;m<p;m++)for(var q=n[m],t=0,u=q.vertexNormals.length;t<u;t++){var v=q.vertexNormals[t];a.copy(l[q[d[t]]]).applyMatrix4(e);b.copy(v).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);g.setXYZ(k,a.x,a.y,a.z);k+=1;g.setXYZ(k,b.x,b.y,b.z);k+=1}else if(k&&
|
||
|
k.isBufferGeometry)for(d=k.attributes.position,l=k.attributes.normal,t=k=0,u=d.count;t<u;t++)a.set(d.getX(t),d.getY(t),d.getZ(t)).applyMatrix4(e),b.set(l.getX(t),l.getY(t),l.getZ(t)),b.applyMatrix3(c).normalize().multiplyScalar(this.size).add(a),g.setXYZ(k,a.x,a.y,a.z),k+=1,g.setXYZ(k,b.x,b.y,b.z),k+=1;g.needsUpdate=!0}}();Nd.prototype=Object.create(O.prototype);Nd.prototype.constructor=Nd;Nd.prototype.dispose=function(){this.cone.geometry.dispose();this.cone.material.dispose()};Nd.prototype.update=
|
||
|
function(){var a=new p,b=new p;return function(){this.light.updateMatrixWorld();var c=this.light.distance?this.light.distance:1E3,d=c*Math.tan(this.light.angle);this.cone.scale.set(d,d,c);a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);this.cone.lookAt(b.sub(a));void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}();Od.prototype=Object.create(Ca.prototype);Od.prototype.constructor=Od;Od.prototype.updateMatrixWorld=
|
||
|
function(){var a=new p,b=new V,c=new V;return function(d){var e=this.bones,g=this.geometry,k=g.getAttribute("position");c.getInverse(this.root.matrixWorld);for(var l=0,n=0;l<e.length;l++){var m=e[l];m.parent&&m.parent.isBone&&(b.multiplyMatrices(c,m.matrixWorld),a.setFromMatrixPosition(b),k.setXYZ(n,a.x,a.y,a.z),b.multiplyMatrices(c,m.parent.matrixWorld),a.setFromMatrixPosition(b),k.setXYZ(n+1,a.x,a.y,a.z),n+=2)}g.getAttribute("position").needsUpdate=!0;O.prototype.updateMatrixWorld.call(this,d)}}();
|
||
|
Pd.prototype=Object.create(ha.prototype);Pd.prototype.constructor=Pd;Pd.prototype.dispose=function(){this.geometry.dispose();this.material.dispose()};Pd.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};Qd.prototype=Object.create(O.prototype);Qd.prototype.constructor=Qd;Qd.prototype.dispose=function(){this.children[0].geometry.dispose();this.children[0].material.dispose()};Qd.prototype.update=function(){var a=.5*this.light.width,
|
||
|
b=.5*this.light.height,c=this.line.geometry.attributes.position,d=c.array;d[0]=a;d[1]=-b;d[2]=0;d[3]=a;d[4]=b;d[5]=0;d[6]=-a;d[7]=b;d[8]=0;d[9]=-a;d[10]=-b;d[11]=0;d[12]=a;d[13]=-b;d[14]=0;c.needsUpdate=!0;void 0!==this.color?this.line.material.color.set(this.color):this.line.material.color.copy(this.light.color)};Rd.prototype=Object.create(O.prototype);Rd.prototype.constructor=Rd;Rd.prototype.dispose=function(){this.children[0].geometry.dispose();this.children[0].material.dispose()};Rd.prototype.update=
|
||
|
function(){var a=new p,b=new S,c=new S;return function(){var d=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=d.geometry.getAttribute("color");b.copy(this.light.color);c.copy(this.light.groundColor);for(var g=0,k=e.count;g<k;g++){var l=g<k/2?b:c;e.setXYZ(g,l.r,l.g,l.b)}e.needsUpdate=!0}d.lookAt(a.setFromMatrixPosition(this.light.matrixWorld).negate())}}();ze.prototype=Object.create(Ca.prototype);ze.prototype.constructor=ze;Jf.prototype=Object.create(Ca.prototype);
|
||
|
Jf.prototype.constructor=Jf;Ae.prototype=Object.create(Ca.prototype);Ae.prototype.constructor=Ae;Ae.prototype.update=function(){var a=new p,b=new p,c=new Ja;return function(){this.object.updateMatrixWorld(!0);c.getNormalMatrix(this.object.matrixWorld);var d=this.object.matrixWorld,e=this.geometry.attributes.position,g=this.object.geometry,k=g.vertices;g=g.faces;for(var l=0,n=0,m=g.length;n<m;n++){var p=g[n],q=p.normal;a.copy(k[p.a]).add(k[p.b]).add(k[p.c]).divideScalar(3).applyMatrix4(d);b.copy(q).applyMatrix3(c).normalize().multiplyScalar(this.size).add(a);
|
||
|
e.setXYZ(l,a.x,a.y,a.z);l+=1;e.setXYZ(l,b.x,b.y,b.z);l+=1}e.needsUpdate=!0}}();Sd.prototype=Object.create(O.prototype);Sd.prototype.constructor=Sd;Sd.prototype.dispose=function(){this.lightPlane.geometry.dispose();this.lightPlane.material.dispose();this.targetLine.geometry.dispose();this.targetLine.material.dispose()};Sd.prototype.update=function(){var a=new p,b=new p,c=new p;return function(){a.setFromMatrixPosition(this.light.matrixWorld);b.setFromMatrixPosition(this.light.target.matrixWorld);c.subVectors(b,
|
||
|
a);this.lightPlane.lookAt(c);void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color));this.targetLine.lookAt(c);this.targetLine.scale.z=c.length()}}();Be.prototype=Object.create(Ca.prototype);Be.prototype.constructor=Be;Be.prototype.update=function(){function a(a,k,l,n){d.set(k,l,n).unproject(e);a=c[a];if(void 0!==a)for(k=b.getAttribute("position"),
|
||
|
l=0,n=a.length;l<n;l++)k.setXYZ(a[l],d.x,d.y,d.z)}var b,c,d=new p,e=new Ab;return function(){b=this.geometry;c=this.pointMap;e.projectionMatrix.copy(this.camera.projectionMatrix);a("c",0,0,-1);a("t",0,0,1);a("n1",-1,-1,-1);a("n2",1,-1,-1);a("n3",-1,1,-1);a("n4",1,1,-1);a("f1",-1,-1,1);a("f2",1,-1,1);a("f3",-1,1,1);a("f4",1,1,1);a("u1",.7,1.1,-1);a("u2",-.7,1.1,-1);a("u3",0,2,-1);a("cf1",-1,0,1);a("cf2",1,0,1);a("cf3",0,-1,1);a("cf4",0,1,1);a("cn1",-1,0,-1);a("cn2",1,0,-1);a("cn3",0,-1,-1);a("cn4",
|
||
|
0,1,-1);b.getAttribute("position").needsUpdate=!0}}();Td.prototype=Object.create(Ca.prototype);Td.prototype.constructor=Td;Td.prototype.update=function(){var a=new nb;return function(b){void 0!==b&&console.warn("THREE.BoxHelper: .update() has no longer arguments.");void 0!==this.object&&a.setFromObject(this.object);if(!a.isEmpty()){b=a.min;var c=a.max,d=this.geometry.attributes.position,e=d.array;e[0]=c.x;e[1]=c.y;e[2]=c.z;e[3]=b.x;e[4]=c.y;e[5]=c.z;e[6]=b.x;e[7]=b.y;e[8]=c.z;e[9]=c.x;e[10]=b.y;e[11]=
|
||
|
c.z;e[12]=c.x;e[13]=c.y;e[14]=b.z;e[15]=b.x;e[16]=c.y;e[17]=b.z;e[18]=b.x;e[19]=b.y;e[20]=b.z;e[21]=c.x;e[22]=b.y;e[23]=b.z;d.needsUpdate=!0;this.geometry.computeBoundingSphere()}}}();Td.prototype.setFromObject=function(a){this.object=a;this.update();return this};Ce.prototype=Object.create(Ca.prototype);Ce.prototype.constructor=Ce;Ce.prototype.updateMatrixWorld=function(a){var b=this.box;b.isEmpty()||(b.getCenter(this.position),b.getSize(this.scale),this.scale.multiplyScalar(.5),O.prototype.updateMatrixWorld.call(this,
|
||
|
a))};De.prototype=Object.create(Va.prototype);De.prototype.constructor=De;De.prototype.updateMatrixWorld=function(a){var b=-this.plane.constant;1E-8>Math.abs(b)&&(b=1E-8);this.scale.set(.5*this.size,.5*this.size,b);this.lookAt(this.plane.normal);O.prototype.updateMatrixWorld.call(this,a)};var Ee,Kf;Pc.prototype=Object.create(O.prototype);Pc.prototype.constructor=Pc;Pc.prototype.setDirection=function(){var a=new p,b;return function(c){.99999<c.y?this.quaternion.set(0,0,0,1):-.99999>c.y?this.quaternion.set(1,
|
||
|
0,0,0):(a.set(c.z,0,-c.x).normalize(),b=Math.acos(c.y),this.quaternion.setFromAxisAngle(a,b))}}();Pc.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()};Pc.prototype.setColor=function(a){this.line.material.color.copy(a);this.cone.material.color.copy(a)};Lf.prototype=Object.create(Ca.prototype);Lf.prototype.constructor=Lf;Z.create=function(a,
|
||
|
b){console.log("THREE.Curve.create() has been deprecated");a.prototype=Object.create(Z.prototype);a.prototype.constructor=a;a.prototype.getPoint=b;return a};Object.assign(Rb.prototype,{createPointsGeometry:function(a){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");a=this.getPoints(a);return this.createGeometry(a)},createSpacedPointsGeometry:function(a){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");
|
||
|
a=this.getSpacedPoints(a);return this.createGeometry(a)},createGeometry:function(a){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var b=new ca,c=0,d=a.length;c<d;c++){var e=a[c];b.vertices.push(new p(e.x,e.y,e.z||0))}return b}});Object.assign(vb.prototype,{fromPoints:function(a){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints().");this.setFromPoints(a)}});Kh.prototype=Object.create(jb.prototype);
|
||
|
Object.assign(Kh.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}});ze.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")};Od.prototype.update=
|
||
|
function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")};Object.assign(Jd.prototype,{extractUrlBase:function(a){console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.");return Ui.extractUrlBase(a)}});Object.assign(Ih.prototype,{center:function(a){console.warn("THREE.Box2: .center() has been renamed to .getCenter().");return this.getCenter(a)},empty:function(){console.warn("THREE.Box2: .empty() has been renamed to .isEmpty().");
|
||
|
return this.isEmpty()},isIntersectionBox:function(a){console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)},size:function(a){console.warn("THREE.Box2: .size() has been renamed to .getSize().");return this.getSize(a)}});Object.assign(nb.prototype,{center:function(a){console.warn("THREE.Box3: .center() has been renamed to .getCenter().");return this.getCenter(a)},empty:function(){console.warn("THREE.Box3: .empty() has been renamed to .isEmpty().");
|
||
|
return this.isEmpty()},isIntersectionBox:function(a){console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)},isIntersectionSphere:function(a){console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().");return this.intersectsSphere(a)},size:function(a){console.warn("THREE.Box3: .size() has been renamed to .getSize().");return this.getSize(a)}});dd.prototype.center=function(a){console.warn("THREE.Line3: .center() has been renamed to .getCenter().");
|
||
|
return this.getCenter(a)};Object.assign(ja,{random16:function(){console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead.");return Math.random()},nearestPowerOfTwo:function(a){console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo().");return ja.floorPowerOfTwo(a)},nextPowerOfTwo:function(a){console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo().");return ja.ceilPowerOfTwo(a)}});Object.assign(Ja.prototype,{flattenToArrayOffset:function(a,
|
||
|
b){console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.");return this.toArray(a,b)},multiplyVector3:function(a){console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.");return a.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(a){console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.");
|
||
|
return this.applyToBufferAttribute(a)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}});Object.assign(V.prototype,{extractPosition:function(a){console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().");return this.copyPosition(a)},flattenToArrayOffset:function(a,b){console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.");return this.toArray(a,b)},getPosition:function(){var a;
|
||
|
return function(){void 0===a&&(a=new p);console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");return a.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(a){console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().");return this.makeRotationFromQuaternion(a)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(a){console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.");
|
||
|
return a.applyMatrix4(this)},multiplyVector4:function(a){console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.");return a.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(a){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.");a.transformDirection(this)},crossVector:function(a){console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.");
|
||
|
return a.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(a){console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead.");
|
||
|
return this.applyToBufferAttribute(a)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(a,b,c,d,e,g){console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.");return this.makePerspective(a,b,d,c,e,g)}});ib.prototype.isIntersectionLine=function(a){console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().");return this.intersectsLine(a)};
|
||
|
sa.prototype.multiplyVector3=function(a){console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.");return a.applyQuaternion(this)};Object.assign(sc.prototype,{isIntersectionBox:function(a){console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().");return this.intersectsBox(a)},isIntersectionPlane:function(a){console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().");return this.intersectsPlane(a)},
|
||
|
isIntersectionSphere:function(a){console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().");return this.intersectsSphere(a)}});Object.assign(cb.prototype,{area:function(){console.warn("THREE.Triangle: .area() has been renamed to .getArea().");return this.getArea()},barycoordFromPoint:function(a,b){console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().");return this.getBarycoord(a,b)},midpoint:function(a){console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint().");
|
||
|
return this.getMidpoint(a)},normal:function(a){console.warn("THREE.Triangle: .normal() has been renamed to .getNormal().");return this.getNormal(a)},plane:function(a){console.warn("THREE.Triangle: .plane() has been renamed to .getPlane().");return this.getPlane(a)}});Object.assign(cb,{barycoordFromPoint:function(a,b,c,d,e){console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().");return cb.getBarycoord(a,b,c,d,e)},normal:function(a,b,c,d){console.warn("THREE.Triangle: .normal() has been renamed to .getNormal().");
|
||
|
return cb.getNormal(a,b,c,d)}});Object.assign(kc.prototype,{extractAllPoints:function(a){console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.");return this.extractPoints(a)},extrude:function(a){console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.");return new Ec(this,a)},makeGeometry:function(a){console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.");return new hc(this,a)}});Object.assign(x.prototype,
|
||
|
{fromAttribute:function(a,b,c){console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().");return this.fromBufferAttribute(a,b,c)},distanceToManhattan:function(a){console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().");return this.manhattanDistanceTo(a)},lengthManhattan:function(){console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().");return this.manhattanLength()}});Object.assign(p.prototype,
|
||
|
{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(a){console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().");return this.setFromMatrixPosition(a)},getScaleFromMatrix:function(a){console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().");
|
||
|
return this.setFromMatrixScale(a)},getColumnFromMatrix:function(a,b){console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().");return this.setFromMatrixColumn(b,a)},applyProjection:function(a){console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.");return this.applyMatrix4(a)},fromAttribute:function(a,b,c){console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().");return this.fromBufferAttribute(a,
|
||
|
b,c)},distanceToManhattan:function(a){console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().");return this.manhattanDistanceTo(a)},lengthManhattan:function(){console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().");return this.manhattanLength()}});Object.assign(ya.prototype,{fromAttribute:function(a,b,c){console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().");return this.fromBufferAttribute(a,
|
||
|
b,c)},lengthManhattan:function(){console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().");return this.manhattanLength()}});Object.assign(ca.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}});Object.assign(O.prototype,{getChildByName:function(a){console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().");
|
||
|
return this.getObjectByName(a)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(a,b){console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.");return this.translateOnAxis(b,a)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}});Object.defineProperties(O.prototype,
|
||
|
{eulerOrder:{get:function(){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");return this.rotation.order},set:function(a){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order.");this.rotation.order=a}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}});
|
||
|
Object.defineProperties(ie.prototype,{objects:{get:function(){console.warn("THREE.LOD: .objects has been renamed to .levels.");return this.levels}}});Object.defineProperty(je.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}});Object.defineProperty(Z.prototype,"__arcLengthDivisions",{get:function(){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.");
|
||
|
return this.arcLengthDivisions},set:function(a){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions.");this.arcLengthDivisions=a}});Ba.prototype.setLens=function(a,b){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup.");void 0!==b&&(this.filmGauge=b);this.setFocalLength(a)};Object.defineProperties(Da.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(a){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov.");
|
||
|
this.shadow.camera.fov=a}},shadowCameraLeft:{set:function(a){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left.");this.shadow.camera.left=a}},shadowCameraRight:{set:function(a){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right.");this.shadow.camera.right=a}},shadowCameraTop:{set:function(a){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top.");this.shadow.camera.top=a}},shadowCameraBottom:{set:function(a){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.");
|
||
|
this.shadow.camera.bottom=a}},shadowCameraNear:{set:function(a){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near.");this.shadow.camera.near=a}},shadowCameraFar:{set:function(a){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far.");this.shadow.camera.far=a}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(a){console.warn("THREE.Light: .shadowBias is now .shadow.bias.");
|
||
|
this.shadow.bias=a}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(a){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.");this.shadow.mapSize.width=a}},shadowMapHeight:{set:function(a){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.");this.shadow.mapSize.height=a}}});Object.defineProperties(fa.prototype,{length:{get:function(){console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead.");
|
||
|
return this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}});Object.assign(R.prototype,{addIndex:function(a){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().");this.setIndex(a)},addDrawCall:function(a,b,c){void 0!==c&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.");console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup().");this.addGroup(a,b)},
|
||
|
clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().");this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}});Object.defineProperties(R.prototype,{drawcalls:{get:function(){console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups.");return this.groups}},offsets:{get:function(){console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups.");
|
||
|
return this.groups}}});Object.assign(Pb.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}});Object.defineProperties(B.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},
|
||
|
onUpdate:{value:function(){console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.");return this}}});Object.defineProperties(da.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},wrapRGB:{get:function(){console.warn("THREE.Material: .wrapRGB has been removed.");return new S}},shading:{get:function(){console.error("THREE."+this.type+
|
||
|
": .shading has been removed. Use the boolean .flatShading instead.")},set:function(a){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.");this.flatShading=1===a}}});Object.defineProperties(rb.prototype,{metal:{get:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.");return!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}});
|
||
|
Object.defineProperties(la.prototype,{derivatives:{get:function(){console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.");return this.extensions.derivatives},set:function(a){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.");this.extensions.derivatives=a}}});Object.assign(kf.prototype,{getCurrentRenderTarget:function(){console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().");return this.getRenderTarget()},
|
||
|
getMaxAnisotropy:function(){console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().");return this.capabilities.getMaxAnisotropy()},getPrecision:function(){console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.");return this.capabilities.precision},resetGLState:function(){console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset().");return this.state.reset()},supportsFloatTextures:function(){console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' ).");
|
||
|
return this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' ).");return this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' ).");return this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' ).");
|
||
|
return this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' ).");return this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' ).");return this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.");
|
||
|
return this.capabilities.vertexTextures},supportsInstancedArrays:function(){console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' ).");return this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(a){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().");this.setScissorTest(a)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},
|
||
|
addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")}});Object.defineProperties(kf.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.");
|
||
|
this.shadowMap.enabled=a}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(a){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.");this.shadowMap.type=a}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}});Object.defineProperties(fh.prototype,
|
||
|
{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},
|
||
|
renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}});Object.defineProperties(Oa.prototype,{wrapS:{get:function(){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");return this.texture.wrapS},set:function(a){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.");
|
||
|
this.texture.wrapS=a}},wrapT:{get:function(){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");return this.texture.wrapT},set:function(a){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.");this.texture.wrapT=a}},magFilter:{get:function(){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");return this.texture.magFilter},set:function(a){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.");this.texture.magFilter=
|
||
|
a}},minFilter:{get:function(){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");return this.texture.minFilter},set:function(a){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.");this.texture.minFilter=a}},anisotropy:{get:function(){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");return this.texture.anisotropy},set:function(a){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.");this.texture.anisotropy=
|
||
|
a}},offset:{get:function(){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");return this.texture.offset},set:function(a){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset.");this.texture.offset=a}},repeat:{get:function(){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");return this.texture.repeat},set:function(a){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat.");this.texture.repeat=a}},format:{get:function(){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");
|
||
|
return this.texture.format},set:function(a){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format.");this.texture.format=a}},type:{get:function(){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");return this.texture.type},set:function(a){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type.");this.texture.type=a}},generateMipmaps:{get:function(){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");return this.texture.generateMipmaps},
|
||
|
set:function(a){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.");this.texture.generateMipmaps=a}}});Object.defineProperties(gh.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}}});Ld.prototype.load=function(a){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var b=this;(new uh).load(a,function(a){b.setBuffer(a)});return this};yh.prototype.getData=function(){console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData().");
|
||
|
return this.getFrequencyData()};Kd.prototype.updateCubeMap=function(a,b){console.warn("THREE.CubeCamera: .updateCubeMap() is now .update().");return this.update(a,b)};var Xi=function(a){var b={},c=[];a=a||this;a.on=function(c,e,g){(b[c]=b[c]||[]).push([e,g]);return a};a.off=function(d,e){d||(b={});d=b[d]||c;for(var g=d.length=e?d.length:0;g--;)e==d[g][0]&&d.splice(g,1);return a};a.emit=function(d){var e=b[d]||c;e=0<e.length?e.slice(0,e.length):e;for(var g=0,k;k=e[g++];)k[0].apply(k[1],c.slice.call(arguments,
|
||
|
1));return a}};X(X.S,"Object",{create:Ib});var qm=qa.Object,rm=function(a,b){return qm.create(a,b)},Wb=function(a,b){if(!Ga(a)||a._t!==b)throw TypeError("Incompatible receiver, "+b+" required!");return a},sm=lb.f,Yi=pg.fastKey,ee=hb?"_s":"size",We=function(a,b){var c=Yi(b);if("F"!==c)return a._i[c];for(a=a._f;a;a=a.n)if(a.k==b)return a},Bg={getConstructor:function(a,b,c,d){var e=a(function(a,k){Ke(a,e,b,"_i");a._t=b;a._i=Ib(null);a._f=void 0;a._l=void 0;a[ee]=0;void 0!=k&&oc(k,c,a[d],a)});ig(e.prototype,
|
||
|
{clear:function(){for(var a=Wb(this,b),c=a._i,d=a._f;d;d=d.n)d.r=!0,d.p&&(d.p=d.p.n=void 0),delete c[d.i];a._f=a._l=void 0;a[ee]=0},"delete":function(a){var c=Wb(this,b);if(a=We(c,a)){var d=a.n,e=a.p;delete c._i[a.i];a.r=!0;e&&(e.n=d);d&&(d.p=e);c._f==a&&(c._f=d);c._l==a&&(c._l=e);c[ee]--}return!!a},forEach:function(a){Wb(this,b);for(var c=Na(a,1<arguments.length?arguments[1]:void 0,3),d;d=d?d.n:this._f;)for(c(d.v,d.k,this);d&&d.r;)d=d.p},has:function(a){return!!We(Wb(this,b),a)}});hb&&sm(e.prototype,
|
||
|
"size",{get:function(){return Wb(this,b)[ee]}});return e},def:function(a,b,c){var d=We(a,b),e;d?d.v=c:(a._l=d={i:e=Yi(b,!0),k:b,v:c,p:b=a._l,n:void 0,r:!1},a._f||(a._f=d),b&&(b.n=d),a[ee]++,"F"!==e&&(a._i[e]=d));return a},getEntry:We,setStrong:function(a,b,c){Xf(a,b,function(a,c){this._t=Wb(a,b);this._k=c;this._l=void 0},function(){for(var a=this._k,b=this._l;b&&b.r;)b=b.p;return this._t&&(this._l=b=b?b.n:this._t._f)?"keys"==a?Ub(0,b.k):"values"==a?Ub(0,b.v):Ub(0,[b.k,b.v]):(this._t=void 0,Ub(1))},
|
||
|
c?"entries":"values",!c,!0);ni(b)}},tm=Ha("species"),um=function(a,b){if(sg(a)){var c=a.constructor;"function"!=typeof c||c!==Array&&!sg(c.prototype)||(c=void 0);Ga(c)&&(c=c[tm],null===c&&(c=void 0))}return new (void 0===c?Array:c)(b)},vm=lb.f,wm=function(a,b){var c=1==a,d=2==a,e=3==a,g=4==a,k=6==a,l=5==a||k,n=b||um;return function(b,p,q){var m=Object(Qc(b)),r=Rh(m);p=Na(p,q,3);q=Rf(r.length);var w=0;b=c?n(b,q):d?n(b,0):void 0;for(var y,x;q>w;w++)if(l||w in r)if(y=r[w],x=p(y,w,m),a)if(c)b[w]=x;else if(x)switch(a){case 3:return!0;
|
||
|
case 5:return y;case 6:return w;case 2:b.push(y)}else if(g)return!1;return k?-1:e||g?g:b}}(0);(function(a,b,c,d,e,g){var k=ea[a],l=k,n=e?"set":"add",m=l&&l.prototype,p={};hb&&"function"==typeof l&&(g||m.forEach&&!Gb(function(){(new l).entries().next()}))?(l=b(function(b,c){Ke(b,l,a,"_c");b._c=new k;void 0!=c&&oc(c,e,b[n],b)}),wm("add clear delete forEach get has set keys values entries toJSON".split(" "),function(a){var b="add"==a||"set"==a;a in m&&(!g||"clear"!=a)&&Hb(l.prototype,a,function(c,d){Ke(this,
|
||
|
l,a);if(!b&&g&&!Ga(c))return"get"==a?void 0:!1;c=this._c[a](0===c?0:c,d);return b?this:c})}),g||vm(l.prototype,"size",{get:function(){return this._c.size}})):(l=d.getConstructor(b,a,e,n),ig(l.prototype,c),pg.NEED=!0);nc(l,a);p[a]=l;X(X.G+X.W+X.F,p);g||d.setStrong(l,a,e);return l})("Map",function(a){return function(){return a(this,0<arguments.length?arguments[0]:void 0)}},{get:function(a){return(a=Bg.getEntry(Wb(this,"Map"),a))&&a.v},set:function(a,b){return Bg.def(Wb(this,"Map"),0===a?0:a,b)}},Bg,
|
||
|
!0);X(X.P+X.R,"Map",{toJSON:function(a){return function(){if(ag(this)!=a)throw TypeError(a+"#toJSON isn't generic");var b=[];oc(this,!1,b.push,b,void 0);return b}}("Map")});(function(a){X(X.S,a,{of:function(){for(var a=arguments.length,c=Array(a);a--;)c[a]=arguments[a];return new this(c)}})})("Map");(function(a){X(X.S,a,{from:function(a,c,d){var b;ob(this);(b=void 0!==c)&&ob(c);if(void 0==a)return new this;var g=[];if(b){var k=0;var l=Na(c,d,2);oc(a,!1,function(a){g.push(l(a,k++))})}else oc(a,!1,
|
||
|
g.push,g);return new this(g)}})})("Map");var Zi=qa.Map,$i=[].slice,Cg={},xm=Function.bind||function(a){var b=ob(this),c=$i.call(arguments,1),d=function(){var e=c.concat($i.call(arguments));if(this instanceof d){var g=e.length;if(!(g in Cg)){for(var k=[],l=0;l<g;l++)k[l]="a["+l+"]";Cg[g]=Function("F,a","return new F("+k.join(",")+")")}e=Cg[g](b,e)}else e=ci(b,e,a);return e};Ga(b.prototype)&&(d.prototype=b.prototype);return d},Dg=(ea.Reflect||{}).construct,aj=Gb(function(){function a(){}return!(Dg(function(){},
|
||
|
[],a)instanceof a)}),bj=!Gb(function(){Dg(function(){})});X(X.S+X.F*(aj||bj),"Reflect",{construct:function(a,b){ob(a);Ma(b);var c=3>arguments.length?a:ob(arguments[2]);if(bj&&!aj)return Dg(a,b,c);if(a==c){switch(b.length){case 0:return new a;case 1:return new a(b[0]);case 2:return new a(b[0],b[1]);case 3:return new a(b[0],b[1],b[2]);case 4:return new a(b[0],b[1],b[2],b[3])}c=[null];c.push.apply(c,b);return new (xm.apply(a,c))}c=c.prototype;c=Ib(Ga(c)?c:Object.prototype);var d=Function.apply.call(a,
|
||
|
c,b);return Ga(d)?d:c}});var cj=qa.Reflect.construct,ym=G(function(a){function b(c,d,e){a.exports="undefined"!==typeof Reflect&&cj?b=cj:b=function(a,b,c){var d=[null];d.push.apply(d,b);a=new (a.bind.apply(a,d));c&&de(a,c.prototype);return a};return b.apply(null,arguments)}a.exports=b}),Eg=G(function(a){function b(c){var d="function"===typeof Zi?new Zi:void 0;a.exports=b=function(a){function b(){}if("function"!==typeof a)throw new TypeError("Super expression must either be null or a function");if("undefined"!==
|
||
|
typeof d){if(d.has(a))return d.get(a);d.set(a,b)}b.prototype=rm(a.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}});return de(b,de(function(){return ym(a,arguments,D(this).constructor)},a))};return b(c)}a.exports=b}),qc=function(a){function b(a,d,e){F(this,b);a=N(this,D(b).call(this,"@".concat(a,": ").concat(d)));d=a.stack.split("\n");d.splice(1,2);a.stack=d.join("\n");console&&console.error("Component:",e);a.name="CompositionError";return a}H(b,a);return b}(Eg(Error)),
|
||
|
zm=function(a){function b(a,d,e){var c=3<arguments.length&&void 0!==arguments[3]?arguments[3]:!1;F(this,b);var k=N(this,D(b).call(this,"@".concat(a,": ").concat(d)));var l=k.stack.split("\n");l.splice(1,2);k.stack=l.join("\n");console&&console.error("Active module:",e);console&&c&&console.error("Dependency published by module:",c);k.name="DependencyError";return k}H(b,a);return b}(Eg(Error)),dj=function(a){function b(a,d,e){var c=3<arguments.length&&void 0!==arguments[3]?arguments[3]:!1;F(this,b);
|
||
|
var k=N(this,D(b).call(this,"@".concat(a,": ").concat(d)));var l=k.stack.split("\n");l.splice(1,2);k.stack=l.join("\n");console&&console.error("Component:",e);console&&c&&console.error("Active module:",c);k.name="ManagerError";return k}H(b,a);return b}(Eg(Error)),ej=function(a){function b(){F(this,b);return N(this,D(b).apply(this,arguments))}z(b,[{key:"integrateModules",value:function(a){if(this.modules||a){a&&a.modules&&(this.modules=a.modules.slice(0));if(this.modules)for(var b=0,c=this.modules.length;b<
|
||
|
c;b++)this.applyModule(this.modules[b],!1);a&&this.applyBridge({onCopy:a})}}},{key:"applyBridge",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},b=this.modules;if(!b)return a;for(var e=0,g=b.length;e<g;e++)for(var k in a)if(a[k]){var l=b[e];l&&l.bridge&&l.bridge[k]&&(a[k]=l.bridge[k].apply(this,[a[k],l]))}return a}},{key:"applyCommand",value:function(a){var b=this,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(a,c){return a.apply(b,[c])},g=this.modules;
|
||
|
if(g)for(var k=0,l=g.length;k<l;k++){var n=g[k];a in n&&c(n[a],n)}}},{key:"applyModule",value:function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;if(a){b&&this.modules?this.modules.push(a):b&&(this.modules=[a]);this.manager&&this.manager.active(a);if(a.manager&&this.manager)a.manager(this.manager);else if(a.manager)throw new dj("Component","Module requires ModuleManager that is turned off for this component",this,a);a.integrate&&a.integrate.bind(this)(a);return a}}},{key:"disposeModules",
|
||
|
value:function(){for(;this.modules.length;)this.disposeModule(this.modules[0])}},{key:"disposeModule",value:function(a){if(a)return this.modules.splice(this.modules.indexOf(a),1),a.dispose&&a.dispose.bind(this)(a),a}},{key:"module",value:function(a){this.applyModule(a);return this}}]);H(b,a);return b}(Xi),Am=qa.getIterator=function(a){var b=ai(a);if("function"!=typeof b)throw TypeError(a+" is not iterable!");return Ma(b.call(a))},fj=function(a,b){var c=Array.isArray(a)?a:void 0;if(!c){c=[];var d=
|
||
|
!0,e=!1,g=void 0;try{for(var k=Am(a),l;!(d=(l=k.next()).done)&&(c.push(l.value),!b||c.length!==b);d=!0);}catch(n){e=!0,g=n}finally{try{if(!d&&null!=k["return"])k["return"]()}finally{if(e)throw g;}}}if(!(a=c))throw new TypeError("Invalid attempt to destructure non-iterable instance");return a},Nh=function(a){var b=a.Symbol;"function"===typeof b?b.observable?a=b.observable:(a=b("observable"),b.observable=a):a="@@observable";return a}("undefined"!==typeof self?self:"undefined"!==typeof window?window:
|
||
|
"undefined"!==typeof global?global:"undefined"!==typeof module?module:Function("return this")()),Mh={INIT:"@@redux/INIT"+Math.random().toString(36).substring(7).split("").join("."),REPLACE:"@@redux/REPLACE"+Math.random().toString(36).substring(7).split("").join(".")};$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbolIterator();var Lh="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){$jscomp.initSymbol();$jscomp.initSymbol();$jscomp.initSymbol();
|
||
|
return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Fg=function(){function a(b){F(this,a);this.handler=b;this.currentModule=null;this.store=Mf(function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[{},""],b=1<arguments.length?arguments[1]:void 0;a[0][b.key]=b.data;a[1]=b.key;return a});this.modules={}}z(a,[{key:"active",value:function(a){this.currentModule=a}},{key:"reset",value:function(){this.currentModule=null}},{key:"define",
|
||
|
value:function(a){this.modules[a]=this.currentModule}},{key:"use",value:function(a){return this.modules[a]}},{key:"set",value:function(a,c){this.store.dispatch({type:"ADD",key:a,data:c})}},{key:"get",value:function(a){if(!this.store.getState()[0][a])throw new zm("ModuleManager","Module requires '".concat(a,"' dependency"),this.currentModule);return this.store.getState()[0][a]}},{key:"has",value:function(a){return!!this.store.getState()[0][a]}},{key:"update",value:function(){var a=this,c=0<arguments.length&&
|
||
|
void 0!==arguments[0]?arguments[0]:{};this.store.subscribe(function(){var b=a.store.getState(),e=fj(b,2);b=e[0];e=e[1];var g=c[e];g&&g(b[e])})}},{key:"add",value:function(){console.warn(".add() method is deprecated. Use .set() instead");return this.set.apply(this,arguments)}},{key:"require",value:function(a,c){void 0===this.use(a)&&this.handler.applyModule(c())}}]);return a}(),Lb=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},d=1<arguments.length&&void 0!==
|
||
|
arguments[1]?arguments[1]:b.defaults,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:b.instructions;F(this,b);var g=N(this,D(b).call(this));L(L(L(aa(aa(g)),"_wait",[]),"modules",[]),"children",[]);g.params=xg(Si(a,e),d);g.params.manager&&(g.manager=new Fg(aa(aa(g))));g.modules=g.params.modules;g.integrateModules();return g}z(b,[{key:"wait",value:function(a){a&&this._wait.push(a);return Promise.all(this._wait)}},{key:"defer",value:function(a){var b=this;this.isDeffered?this.wait().then(function(){return a(b)}):
|
||
|
a(this)}},{key:"updateParams",value:function(){return this.params=xg(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},this.params)}},{key:"clone",value:function(){return(new this.constructor(this.params)).copy(this)}},{key:"copy",value:function(a,b){this.params=Y({},a.params);a.native&&(this.native=a.native.clone(a.params));b&&b();this.integrateModules(a);return this}},{key:"add",value:function(){var a=Pe(Sb.mark(function g(a){return Sb.wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(!a.parent){b.next=
|
||
|
3;break}b.next=3;return a.parent.remove(a);case 3:return b.next=5,this.wait();case 5:return b.next=7,a.wait();case 7:if(a.native){b.next=9;break}throw new qc("Component","there is no object.native",this);case 9:return a.parent=this,b.next=12,this.applyBridge({onAdd:a}).onAdd;case 12:return this.native.add(a.native),this.children.push(a),b.abrupt("return",a);case 15:case "end":return b.stop()}},g,this)}));return function(b){return a.apply(this,arguments)}}()},{key:"remove",value:function(){var a=Pe(Sb.mark(function g(a){return Sb.wrap(function(b){for(;;)switch(b.prev=
|
||
|
b.next){case 0:if(a.parent===this){b.next=2;break}return b.abrupt("return");case 2:return b.next=4,this.wait();case 4:return b.next=6,a.wait();case 6:a.parent=null,this.native.remove(a.native),this.children.splice(this.children.indexOf(a),1);case 9:case "end":return b.stop()}},g,this)}));return function(b){return a.apply(this,arguments)}}()},{key:"addTo",value:function(a){return a.add(this)}},{key:"get",value:function(a){return this.manager.get(a)}},{key:"use",value:function(a){return this.manager.use(a)}},
|
||
|
{key:"isDeffered",get:function(){return 0<this._wait.length}},{key:"manager",get:function(){if(this._manager)return this._manager;throw new dj("Component","ModuleManager is not used in this component. 'manager' parameter should be set as 'true'",this);},set:function(a){this._manager=a}},{key:"native",get:function(){return this._native},set:function(a){this._native=a;this._native.component=this;return this._native}}]);H(b,a);return b}(ej);L(L(Lb,"defaults",{modules:null,manager:!0}),"instructions",
|
||
|
{});X(X.S,"Reflect",{get:Oh});var gj=qa.Reflect.get,ua=G(function(a){function b(c,d,e){a.exports="undefined"!==typeof Reflect&&gj?b=gj:b=function(a,b,c){for(;!Object.prototype.hasOwnProperty.call(a,b)&&(a=D(a),null!==a););if(a)return b=xi.getOwnPropertyDescriptor(a,b),b.get?b.get.call(c):b.value};return b(c,d,e||c)}a.exports=b}),hj,ij,P=(hj=Of(Pf("position","rotation","quaternion","scale"),function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return{map:b,getter:function(a){return function(){return this.native[a]}},
|
||
|
setter:function(a){return function(b){this.native[a]=b}},configurable:!0,enumerable:!0}}("material","geometry")),hj(ij=function(a){function b(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:b.defaults,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:b.instructions;F(this,b);var g=N(this,D(b).call(this,a,c,e));if(g.params.build){var k=g.build(g.params);if(!k)throw new qc("MeshComponent",".build() method should return a THREE.Object3D or a Promise resolved with THREE.Object3D.",
|
||
|
aa(aa(g)));k instanceof Promise?(g.wait(k),g.wait(new Promise(function(a){k.then(function(b){g.native=b;g.wrap().then(a)})}))):(g.native=k,g.wait(g.wrap()))}g.applyCommand("postIntegrate");return g}z(b,null,[{key:"custom",value:function(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:ha;return function(b){function d(){F(this,d);return N(this,D(d).apply(this,arguments))}z(d,[{key:"build",value:function(){var b=this.applyBridge({geometry:a,material:(0<arguments.length&&void 0!==arguments[0]?
|
||
|
arguments[0]:this.params).material});return this.applyBridge({mesh:new c(b.geometry,b.material)}).mesh}}]);H(d,b);return d}(b)}},{key:"create",value:function(a,d,e){return new (b.custom(a,e))(d)}},{key:"from",value:function(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};c.build=!1;c=new b(c);c.native=a;c.wrap();return c}}]);z(b,[{key:"build",value:function(){throw new qc("MeshComponent","Instance should have it's own .build().",this);}},{key:"wrap",value:function(){var a=this;
|
||
|
return new Promise(function(b){var c=a.params,d=c.position,k=c.rotation,l=c.scale;c=c.shadow;a.position.set(d.x,d.y,d.z);a.rotation.set(k.x,k.y,k.z);a.scale.set(l.x,l.y,l.z);a.native.castShadow=c.cast;a.native.receiveShadow=c.receive;a.applyBridge({onWrap:1});b(a)})}},{key:"copy",value:function(a){var c=this;return ua(D(b.prototype),"copy",this).call(this,a,function(){c.position.copy(a.position);c.rotation.copy(a.rotation);c.quaternion.copy(a.quaternion)})}},{key:"clone",value:function(a,b){var c=
|
||
|
(new this.constructor({build:!1})).copy(this);a&&(c.geometry=c.geometry.clone());b&&(c.material=c.material.clone());return c}}]);H(b,a);return b}(Lb))||ij);L(L(P,"defaults",Y({},Lb.defaults,{build:!0,geometry:{},material:!1,shadow:{cast:!0,receive:!0},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}})),"instructions",{position:["x","y","z"],rotation:["x","y","z"],scale:["x","y","z"]});var jj,kj,Za=(jj=Of(Pf("position","rotation","quaternion","target")),jj(kj=function(a){function b(a){var c=
|
||
|
1<arguments.length&&void 0!==arguments[1]?arguments[1]:b.defaults,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:b.instructions;F(this,b);var g=N(this,D(b).call(this,a,c,e));if(g.params.build){c=g.build(g.params);if(!c)throw new qc("LightComponent",".build() method should return a THREE.Object3D or a Promise resolved with THREE.Object3D.",aa(aa(g)));c instanceof Promise?c.then(function(a){g.native=a}):g.native=c;g.wait(g.wrap())}g.applyCommand("postIntegrate");return g}z(b,null,[{key:"from",
|
||
|
value:function(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!0;c.build=!1;c=new b(c);c.native=a;c.wrap();e&&c.wrapShadow();return c}}]);z(b,[{key:"build",value:function(){throw new qc("MeshComponent","Instance should have it's own .build().",this);}},{key:"wrap",value:function(){var a=this;return new Promise(function(b){a.defer(function(){var c=a.params,d=c.position;c=c.rotation;a.position.set(d.x,d.y,d.z);a.rotation.set(c.x,
|
||
|
c.y,c.z);a.applyBridge({onWrap:1});b(a)})})}},{key:"wrapShadow",value:function(){var a=this.native,b=this.params.shadow;a.castShadow=b.cast;a.shadow.mapSize.width=b.mapSize.width;a.shadow.mapSize.height=b.mapSize.height;a.shadow.bias=b.bias;a.shadow.radius=b.radius;a=a.shadow.camera;b=b.camera;a.near=b.near;a.far=b.far;a.fov=b.fov;a.left=b.left;a.right=b.right;a.top=b.top;a.bottom=b.bottom}},{key:"copy",value:function(a){var c=this;return ua(D(b.prototype),"copy",this).call(this,a,function(){c.target&&
|
||
|
c.target.copy(a.target());c.position.copy(a.position);c.rotation.copy(a.rotation);c.quaternion.copy(a.quaternion)})}},{key:"clone",value:function(){return(new this.constructor({build:!1})).copy(this)}}]);H(b,a);return b}(Lb))||kj);L(L(Za,"defaults",Y({},Lb.defaults,{build:!0,shadow:{cast:!0,bias:0,radius:1,mapSize:{width:1024,height:1024},camera:{near:!0,far:400,fov:90,top:200,bottom:-200,left:-200,right:200}},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}})),"instructions",{position:["x","y","z"],
|
||
|
rotation:["x","y","z"]});var lj,mj,Xb=(lj=Of(Pf("position","rotation","quaternion","target")),lj(mj=function(a){function b(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:b.defaults,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:b.instructions;F(this,b);var g=N(this,D(b).call(this,a,c,e));if(g.params.build){c=g.build(g.params);if(!c)throw new qc("CameraComponent",".build() method should return a THREE.Object3D or a Promise resolved with THREE.Object3D.",aa(aa(g)));c instanceof
|
||
|
Promise?c.then(function(a){g.native=a}):g.native=c;g.wait(g.wrap())}g.applyCommand("postIntegrate");return g}z(b,null,[{key:"from",value:function(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};c.build=!1;c=new b(c);c.native=a;c.wrap();return c}}]);z(b,[{key:"build",value:function(){throw new qc("CameraComponent","Instance should have it's own .build().",this);}},{key:"wrap",value:function(){var a=this;return new Promise(function(b){a.defer(function(){a.position.set(a.params.position.x,
|
||
|
a.params.position.y,a.params.position.z);a.rotation.set(a.params.rotation.x,a.params.rotation.y,a.params.rotation.z);a.applyBridge({onWrap:1});b(a)})})}},{key:"copy",value:function(a){var c=this;return ua(D(b.prototype),"copy",this).call(this,a,function(){c.target&&c.target.copy(a.target());c.position.copy(a.position);c.rotation.copy(a.rotation);c.quaternion.copy(a.quaternion)})}},{key:"clone",value:function(){return(new this.constructor({build:!1})).copy(this)}}]);H(b,a);return b}(Lb))||mj);L(L(Xb,
|
||
|
"defaults",Y({},Lb.defaults,{build:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}})),"instructions",{position:["x","y","z"],rotation:["x","y","z"],scale:["x","y","z"]});var zb="undefined"===typeof window?global:window,Bm=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];F(this,b);console.log("WHS.App ".concat("2.2.0-beta.2"));var d=N(this,D(b).call(this));L(L(aa(aa(d)),"enabled",!0),"loops",[]);d.manager=new Fg(aa(aa(d)));d.modules=a;d.integrateModules();return d}
|
||
|
z(b,[{key:"start",value:function(){function a(){b(a);if(g)for(var c=0,d=e.length;c<d;c++){var n=e[c];n.enabled&&n.execute(n.clock)}}var b=function(){return zb.requestAnimationFrame||zb.webkitRequestAnimationFrame||zb.mozRequestAnimationFrame||function(a){zb.setTimeout(a,1E3/60)}}(),e=this.loops,g=this.enabled;this.enabled=!0;a()}},{key:"stop",value:function(){this.enabled=!1}},{key:"addLoop",value:function(a){var b=this;return new Promise(function(c){b.loops.push(a);c(a)})}},{key:"removeLoop",value:function(a){var b=
|
||
|
this;return new Promise(function(c){var d=b.loops.indexOf(a);-1!==d&&b.loops.splice(d,1);c(a)})}},{key:"get",value:function(a){return this.manager.get(a)}},{key:"use",value:function(a){return this.manager.use(a)}}]);H(b,a);return b}(ej),Wc=function(){function a(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;F(this,a);this.func=b;this.clock=c?new Hf:null;this.enabled=!1}z(a,[{key:"start",value:function(a){this.enabled||(a&&a.addLoop(this),this.clock&&this.clock.start(),this.enabled=
|
||
|
!0)}},{key:"stop",value:function(a){this.enabled&&(this.clock&&this.clock.stop(),this.enabled=!1,a&&a.removeLoop(this))}},{key:"execute",value:function(){return this.func(this.clock)}}]);return a}(),nj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults))}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new te(a.color,a.intensity)}).light}}]);
|
||
|
H(b,a);return b}(Za);L(nj,"defaults",Y({},Za.defaults,{color:16777215,intensity:1}));var oj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);a=N(this,D(b).call(this,a,b.defaults));a.wrapShadow();return a}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new se(a.color,a.intensity)}).light}}]);H(b,a);return b}(Za);L(oj,"defaults",Y({},Za.defaults,{color:16777215,intensity:1}));
|
||
|
var pj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults))}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new pe(a.skyColor,a.groundColor,a.intensity)}).light}}]);H(b,a);return b}(Za);L(pj,"defaults",Y({},Za.defaults,{skyColor:16777215,groundColor:16777215,intensity:1}));var qj=function(a){function b(){var a=0<arguments.length&&
|
||
|
void 0!==arguments[0]?arguments[0]:{};F(this,b);a=N(this,D(b).call(this,a,b.defaults));a.wrapShadow();return a}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new re(a.color,a.intensity,a.distance,a.decay)}).light}}]);H(b,a);return b}(Za);L(qj,"defaults",Y({},Za.defaults,{color:16777215,intensity:1,distance:100,decay:1}));var rj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};
|
||
|
F(this,b);a=N(this,D(b).call(this,a,b.defaults));a.wrapShadow();return a}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new qe(a.color,a.intensity,a.distance,a.angle,a.exponent,a.decay)}).light}}]);H(b,a);return b}(Za);L(rj,"defaults",Y({},Za.defaults,{color:16777215,intensity:1,distance:100,angle:Math.PI/3,exponent:0,decay:1}));var sj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:
|
||
|
{};F(this,b);return N(this,D(b).call(this,a,b.defaults))}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new ue(a.color,a.intensity,a.width,a.height)}).light}}]);H(b,a);return b}(Za);L(sj,"defaults",Y({},Za.defaults,{color:16777215,intensity:1,width:10,height:10}));var tj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults))}z(b,
|
||
|
[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({camera:new Kd(a.near,a.far,a.cubeResolution)}).camera}}]);H(b,a);return b}(Xb);L(tj,"defaults",Y({},Xb.defaults,{near:1,far:1E3,cubeResolution:128}));var uj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults))}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?
|
||
|
arguments[0]:{};return this.applyBridge({camera:new qb(a.left,a.right,a.top,a.bottom,a.near,a.far)}).camera}}]);H(b,a);return b}(Xb);L(uj,"defaults",Y({},Xb.defaults,{near:1,far:1E3,left:zb.innerWidth/-2,right:zb.innerWidth/2,top:zb.innerHeight/2,bottom:zb.innerHeight/-2}));var Gg=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults))}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?
|
||
|
arguments[0]:{};return this.applyBridge({camera:new Ba(a.fov,a.aspect,a.near,a.far)}).camera}}]);H(b,a);return b}(Xb);L(Gg,"defaults",Y({},Xb.defaults,{near:1,far:1E3,fov:75,aspect:zb.innerWidth/zb.innerHeight}));var vj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults,b.instructions))}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),
|
||
|
material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?$b:ad)(a.geometry.width,a.geometry.height,a.geometry.depth,a.geometry.widthSegments,a.geometry.heightSegments,a.geometry.depthSegments)}}]);H(b,a);return b}(P);L(L(vj,"defaults",Y({},P.defaults,{geometry:{width:1,height:1,depth:1,widthSegments:1,heightSegments:1,depthSegments:1}})),"instructions",
|
||
|
Y({},P.instructions,{geometry:"width height depth widthSegments heightSegments depthSegements".split(" ")}));var wj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults,b.instructions))}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,
|
||
|
a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Hc:Cd)(a.geometry.radius,a.geometry.segments,a.geometry.thetaStart,a.geometry.thetaLength)}}]);H(b,a);return b}(P);L(L(wj,"defaults",Y({},P.defaults,{geometry:{radius:50,segments:8,thetaStart:0,thetaLength:2*Math.PI}})),"instructions",Y({},P.instructions,{geometry:["radius","segments","thetaStart","thetaLength"]}));var xj=function(a){function b(){var a=0<
|
||
|
arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&
|
||
|
void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Bd:Ad)(a.geometry.radius,a.geometry.height,a.geometry.radiusSegments,a.geometry.heightSegments,a.geometry.openEnded,a.geometry.thetaStart,a.geometry.thetaLength)}}]);H(b,a);return b}(P);L(L(xj,"defaults",Y({},P.defaults,{geometry:{radius:20,height:100,radiusSegments:32,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:2*Math.PI}})),"instructions",Y({},P.instructions,{geometry:"radius height radiusSegments heightSegments openEnded thetaStart thetaLength".split(" ")}));
|
||
|
var yj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",
|
||
|
value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Bb:jc)(a.geometry.radiusTop,a.geometry.radiusBottom,a.geometry.height,a.geometry.radiusSegments,a.geometry.heightSegments,a.geometry.openEnded,a.geometry.thetaStart,a.geometry.thetaLength)}}]);H(b,a);return b}(P);L(L(yj,"defaults",Y({},P.defaults,{geometry:{radiusTop:0,radiusBottom:1,height:1,radiusSegments:32,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:2*Math.PI}})),"instructions",Y({},
|
||
|
P.instructions,{geometry:"radiusTop radiusBottom height radiusSegments heightSegments openEnded thetaStart thetaLength".split(" ")}));var zj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),
|
||
|
material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Bc:md)(a.geometry.radius,a.geometry.detail)}}]);H(b,a);return b}(P);L(L(zj,"defaults",Y({},P.defaults,{geometry:{radius:1,detail:0}})),"instructions",Y({},P.instructions,{geometry:["radius","detail"]}));var Aj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:
|
||
|
{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},b=new Ec(a.geometry.shapes,
|
||
|
a.geometry.options);return a.buffer?(new R).fromGeometry(b):b}}]);H(b,a);return b}(P);L(L(Aj,"defaults",Y({},P.defaults,{geometry:{shapes:[],options:{}}})),"instructions",Y({},P.instructions,{geometry:["shapes","options"]}));var Bj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=
|
||
|
0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Ac:ld)(a.geometry.radius,a.geometry.detail)}}]);H(b,a);return b}(P);L(L(Bj,"defaults",Y({},P.defaults,{geometry:{radius:1,detail:0}})),"instructions",Y({},P.instructions,
|
||
|
{geometry:["radius","detail"]}));var Cj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,
|
||
|
a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Gc:zd)(a.geometry.points)}}]);H(b,a);return b}(P);L(L(Cj,"defaults",Y({},P.defaults,{geometry:{points:[]}})),"instructions",Y({},P.instructions,{geometry:["points"]}));var Dj=function(a){function b(a){F(this,b);return N(this,D(b).call(this,a,b.defaults,b.instructions))}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:
|
||
|
this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new Va(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},b=a.buffer?new R:new ca;if(a.buffer){a=a.curve.getPoints(a.points);for(var e=new Float32Array(3*a.length),g=0,k=a.length;g<k;g++){var l=3*g;e[l]=a[g].x;e[l+1]=a[g].y;e[l+2]=a[g].z}b.addAttribute("position",new fa(e,3))}else b.vertices=a.curve.getPoints(a.points);
|
||
|
return b}}]);H(b,a);return b}(P);L(L(Dj,"defaults",Y({},P.defaults,{curve:null,points:50})),"instructions",Y({},P.instructions,{geometry:["curve","points"]}));var Hg=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults,b.instructions,!1))}z(b,null,[{key:"filter",value:function(a,b){return function k(a){a.children.forEach(function(c,d){c.children&&k(c);b(c)||a.children.splice(d,1)});return a}(a)}}]);z(b,[{key:"build",
|
||
|
value:function(){var a=this,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(c){b.texturePath&&b.loader.setTexturePath(b.texturePath);b.loader.load(b.url,function(){for(var d=arguments.length,e=Array(d),l=0;l<d;l++)e[l]=arguments[l];b.onLoad.apply(b,e);d=b.parser.apply(a,e);b.material&&(d.material=a.applyBridge({material:b.material}).material);c(d)},b.onProgress,b.onError)})}}]);H(b,a);return b}(P);L(L(Hg,"defaults",Y({},P.defaults,{url:"",loader:new Df,onLoad:function(){},
|
||
|
onProgress:function(){},onError:function(){},texturePath:null,useCustomMaterial:!1,parser:function(a,b){b=this.applyBridge({geometry:a,material:b});a=b.geometry;b=b.material;return this.applyBridge({mesh:a.bones?new ke(a,b):new ha(a,b)}).mesh}})),"instructions",Y({},P.instructions));var Ej=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));
|
||
|
return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?ec:kd)(a.geometry.radius,a.geometry.detail)}}]);H(b,a);return b}(P);L(Ej,"defaults",Y({},P.defaults,{geometry:{radius:1,
|
||
|
detail:0}}));var Fj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults,b.instructions))}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==
|
||
|
arguments[0]?arguments[0]:{};return new (a.buffer?yc:hd)(a.geometry.func,a.geometry.slices,a.geometry.stacks)}}]);H(b,a);return b}(P);L(Fj,"defaults",Y({},P.defaults,{geometry:{func:function(a,b){return new p(a,b,0)},slices:10,stacks:10}}));var Gj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=
|
||
|
0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Mb:cd)(a.geometry.width,a.geometry.height,a.geometry.wSegments,a.geometry.hSegments)}}]);H(b,a);return b}(P);L(L(Gj,"defaults",Y({},P.defaults,{geometry:{width:10,height:10,
|
||
|
wSegments:1,hSegments:1}})),"instructions",Y({},P.instructions,{geometry:["width","height","wSegments","hSegments"]}));var Hj=[-1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,1,1],Ij=[2,1,0,0,3,2,0,4,7,7,3,0,0,1,5,5,4,0,1,2,6,6,5,1,2,3,7,7,6,2,4,5,6,6,7,4],Jj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,
|
||
|
[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Wa:id)(a.geometry.verticesOfCube,a.geometry.indicesOfFaces,a.geometry.radius,a.geometry.detail)}}]);H(b,a);return b}(P);L(L(L(L(Jj,"verticesOfCube",
|
||
|
Hj),"indicesOfFaces",Ij),"defaults",Y({},P.defaults,{geometry:{verticesOfCube:Hj,indicesOfFaces:Ij,radius:6,detail:2}})),"instructions",Y({},P.instructions,{geometry:["verticesOfCube","indicesOfFaces","radius","detail"]}));var Kj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=
|
||
|
0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Fc:yd)(a.geometry.innerRadius,a.geometry.outerRadius,a.geometry.thetaSegments,a.geometry.phiSegments,a.geometry.thetaStart,a.geometry.thetaLength)}}]);H(b,a);return b}(P);
|
||
|
L(L(Kj,"defaults",Y({},P.defaults,{geometry:{innerRadius:0,outerRadius:50,thetaSegments:8,phiSegments:8,thetaStart:0,thetaLength:2*Math.PI}})),"instructions",Y({},P.defaults,{geometry:"innerRadius outerRadius thetaSegments phiSegments thetaStart thetaLength".split(" ")}));var Lj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));
|
||
|
return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?ic:hc)(a.geometry.shapes)}}]);H(b,a);return b}(P);L(L(Lj,"defaults",Y({},P.defaults,{geometry:{shapes:[]}})),"instructions",
|
||
|
Y({},P.instructions,{geometry:["shapes"]}));var Mj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults,b.instructions))}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=
|
||
|
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?gc:xd)(a.geometry.radius,a.geometry.widthSegments,a.geometry.heightSegments)}}]);H(b,a);return b}(P);L(L(Mj,"defaults",Y({},P.defaults,{geometry:{radius:1,widthSegments:8,heightSegments:6}})),"instructions",Y({},P.instructions,{geometry:["radius","widthSegments","heightSegments"]}));var Nj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,
|
||
|
b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?zc:jd)(a.geometry.radius,a.geometry.detail)}}]);
|
||
|
H(b,a);return b}(P);L(L(Nj,"defaults",Y({},P.defaults,{geometry:{radius:1,detail:0}})),"instructions",Y({},P.instructions,{geometry:["radius","detail"]}));var Oj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);return N(this,D(b).call(this,a,b.defaults,b.instructions))}z(b,null,[{key:"load",value:function(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:b.loader;return new Promise(function(b){c.load(a,b)})}}]);z(b,[{key:"build",value:function(){var a=
|
||
|
this,d=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,e=new Promise(function(b){(d.font instanceof Promise?d.font:Promise.resolve(d.font)).then(function(c){c=a.applyBridge({geometry:new vd(d.text,Object.assign(d.geometry,{font:c})),material:d.material});b(a.applyBridge({mesh:new ha(c.geometry,c.material)}).mesh)})});ua(D(b.prototype),"wait",this).call(this,e);return e}}]);H(b,a);return b}(P);L(L(L(Oj,"defaults",Y({},P.defaults,{text:"Hello World!",font:null,geometry:{size:12,height:50,
|
||
|
curveSegments:12,font:new Ef,bevelEnabled:!1,bevelThickness:10,bevelSize:8}})),"instructions",Y({},P.instructions)),"loader",new th);var Pj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),
|
||
|
material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new pd(a.geometry.radius,a.geometry.tube,a.geometry.radialSegments,a.geometry.tubularSegments,a.geometry.arc)}}]);H(b,a);return b}(P);L(L(Pj,"defaults",Y({},P.defaults,{geometry:{radius:100,tube:40,radialSegments:8,tubularSegments:6,arc:2*Math.PI}})),"instructions",Y({},P.instructions,{geometry:["radius",
|
||
|
"tube","radialSegments","tubularSegments","arc"]}));var Qj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,
|
||
|
a.material)}).mesh}},{key:"buildGeometry",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Dc:od)(a.geometry.radius,a.geometry.tube,a.geometry.radialSegments,a.geometry.tubularSegments,a.geometry.p,a.geometry.q)}}]);H(b,a);return b}(P);L(L(Qj,"defaults",Y({},P.defaults,{geometry:{radius:100,tube:40,radialSegments:64,tubularSegments:8,p:2,q:3}})),"instructions",Y({},P.instructions,{geometry:"radius tube radialSegments tubularSegments p q".split(" ")}));
|
||
|
var Rj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a,b.defaults,b.instructions));a.build&&(d.build(a),ua(D(b.prototype),"wrap",aa(d)).call(aa(d)));return d}z(b,[{key:"build",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params;a=this.applyBridge({geometry:this.buildGeometry(a),material:a.material});return this.applyBridge({mesh:new ha(a.geometry,a.material)}).mesh}},{key:"buildGeometry",
|
||
|
value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (a.buffer?Cc:nd)(a.geometry.path,a.geometry.segments,a.geometry.radius,a.geometry.radiusSegments,a.geometry.closed)}}]);H(b,a);return b}(P);L(L(Rj,"defaults",Y({},P.defaults,{geometry:{path:new kb(new p(0,0,0),new p(0,0,1)),segments:20,radius:2,radiusSegments:8,closed:!1}})),"instructions",Y({},P.instructions,{geometry:["path","segments","radius","radiusSegments","closed"]}));var Cm=function(a){function b(){F(this,
|
||
|
b);var a=N(this,D(b).call(this,{}));for(var d=0;d<arguments.length;d++){var e=0>d||arguments.length<=d?void 0:arguments[d];e instanceof Lb?e.addTo(aa(aa(a))):e instanceof O&&a.native.add(e)}return a}z(b,[{key:"build",value:function(){return new O}}]);H(b,a);return b}(P),Dm=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.body;F(this,a);b.container?(console.warn("ElementModule now accepts only argument which is a DOM object, not a params object."),this.container=
|
||
|
b.container):this.container=b;this.createElement()}z(a,[{key:"createElement",value:function(){this.element=window.document.createElement("div");this.element.className="whs-app";this.element.style.width="inherit";this.element.style.height="inherit";this.element.style.position="relative"}},{key:"manager",value:function(a){a.set("element",this.element);a.set("container",this.container)}},{key:"integrate",value:function(a){a.container.appendChild(a.element)}}]);return a}(),Sj=function(){function a(){var b=
|
||
|
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=1<arguments.length?arguments[1]:void 0;F(this,a);L(this,"enabled",!0);b=this.params=Object.assign({width:window.innerWidth,height:window.innerHeight,resolution:new x(1,1),pixelRatio:window.devicePixelRatio,bgColor:0,bgOpacity:1,renderer:{},fix:function(){}},b);var d=b.bgColor,e=b.bgOpacity,g=b.pixelRatio,k=b.width,l=b.height,n=b.resolution,m=b.fix;this.renderer=new kf(b.renderer);this.effects=[];this.renderer.setClearColor(d,e);g&&this.renderer.setPixelRatio(g);
|
||
|
this.setSize(Number(k*n.x).toFixed(),Number(l*n.y).toFixed());for(var p in c)c[p]&&this.applyAdditional(p);m(this.renderer)}z(a,[{key:"applyAdditional",value:function(b){a.additional[b].apply(this,[this.renderer])}},{key:"integrateRenderer",value:function(a,c,d){var b=this;this.scene=c;this.camera=d;this.attachToCanvas(a);return new Wc(function(){return b.renderer.render(b.scene,b.camera)})}},{key:"effect",value:function(a){var b=this,d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(){a.render(b.scene,
|
||
|
b.camera)};this.renderLoop.stop();var e=this.renderer.getSize();a.setSize(e.width,e.height);d=new Wc(d);this.effects.push(d);this.enabled&&d.start(this.app);return this}},{key:"setSize",value:function(a,c){this.renderer&&this.renderer.setSize(a,c)}},{key:"attachToCanvas",value:function(a){var b=this.renderer.domElement;a.appendChild(b);b.style.width="100%";b.style.height="100%"}},{key:"stop",value:function(){this.enabled=!1;this.renderLoop.stop();this.effects.forEach(function(a){return a.stop()})}},
|
||
|
{key:"play",value:function(){this.enabled=!0;this.renderLoop.start();this.effects.forEach(function(a){return a.start()})}},{key:"manager",value:function(a){var b=this;a.define("rendering");a.set("renderer",this.renderer);this.app=a.handler;this.renderLoop=this.integrateRenderer(a.get("element"),a.get("scene"),a.get("camera").native);a.update({element:function(a){b.attachToCanvas(a)},scene:function(a){b.scene=a},camera:function(a){b.camera=a.native}})}},{key:"integrate",value:function(a){var b=this;
|
||
|
a.renderLoop.start(this);a.effects.forEach(function(a){return a.start(b)})}},{key:"dispose",value:function(){this.stop();this.renderer.forceContextLoss()}}]);return a}();L(Sj,"additional",{shadow:function(a){a.shadowMap.enabled=!0}});$jscomp.initSymbol();var Tj=Symbol("SYMBOL_CHILDREN_FOR_SCENE"),Em=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1;F(this,a);this.scene=b?null:new xc}z(a,[{key:"manager",value:function(a){a.set("scene",this.scene)}},{key:"integrate",
|
||
|
value:function(a){Object.assign(this,{add:function(){var b=Pe(Sb.mark(function g(b){return Sb.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!b.parent){c.next=3;break}c.next=3;return b.parent.remove(b);case 3:return c.next=5,b.wait();case 5:if(b.native){c.next=7;break}throw new CompositionError("SceneModule","there is no object.native",this);case 7:return b.parent=this,c.next=10,this.applyBridge({onAdd:b}).onAdd;case 10:return a.scene.add(b.native),this.children.push(b),c.abrupt("return",
|
||
|
b);case 13:case "end":return c.stop()}},g,this)}));return function(a){return b.apply(this,arguments)}}(),remove:function(){var b=Pe(Sb.mark(function g(b){return Sb.wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(b.parent===this){c.next=2;break}return c.abrupt("return");case 2:return c.next=4,b.wait();case 4:this.applyBridge({onRemove:b}),b.parent=null,a.scene.remove(b.native),this.children.splice(this.children.indexOf(b),1);case 8:case "end":return c.stop()}},g,this)}));return function(a){return b.apply(this,
|
||
|
arguments)}}(),_setScene:function(b){this.children=b[Tj]=b[Tj]||[];a.scene=b},setScene:function(a){this._setScene(a);this.manager.set("scene",a)},getScene:function(){return a.scene}});a.scene&&this._setScene(a.scene)}}]);return a}(),Fm=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,a);this.params=Object.assign({auto:!0},b);this.callbacks=[this.setSize.bind(this)]}z(a,[{key:"setSize",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:
|
||
|
1,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;this.camera.native.aspect=a/c;this.camera.native.updateProjectionMatrix();this.rendering&&this.rendering.setSize(a,c)}},{key:"trigger",value:function(){var a=this.container,c=a.offsetHeight,d=this.resolution,e=Number(a.offsetWidth*d.x).toFixed(),g=Number(c*d.y).toFixed();this.callbacks.forEach(function(a){a(e,g)})}},{key:"addAutoresize",value:function(){this.container=this.getContainer();this.resolution=this.getResolution();this.params.auto&&
|
||
|
window.addEventListener("resize",this.trigger.bind(this))}},{key:"addCallback",value:function(a){this.callbacks.push(a)}},{key:"manager",value:function(a){var b=this;a.define("resize");this.rendering=a.get("renderer");this.camera=a.get("camera");this.getResolution=function(){return a.use("rendering").params.resolution};this.getContainer=function(){return a.get("container")};a.update({container:function(a){b.container=a}});this.addAutoresize()}}]);return a}(),Gm=function(a){function b(){F(this,b);
|
||
|
return N(this,D(b).call(this,{type:"AdaptiveLuminosityMaterial",defines:{MIP_LEVEL_1X1:"0.0"},uniforms:{tPreviousLum:new B(null),tCurrentLum:new B(null),minLuminance:new B(.01),delta:new B(0),tau:new B(1)},fragmentShader:"uniform sampler2D tPreviousLum;\r\nuniform sampler2D tCurrentLum;\r\nuniform float minLuminance;\r\nuniform float delta;\r\nuniform float tau;\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tfloat previousLum = texture2D(tPreviousLum, vUv, MIP_LEVEL_1X1).r;\r\n\tfloat currentLum = texture2D(tCurrentLum, vUv, MIP_LEVEL_1X1).r;\r\n\r\n\tpreviousLum = max(minLuminance, previousLum);\r\n\tcurrentLum = max(minLuminance, currentLum);\r\n\r\n\t// Adapt the luminance using Pattanaik's technique.\r\n\tfloat adaptedLum = previousLum + (currentLum - previousLum) * (1.0 - exp(-delta * tau));\r\n\r\n\tgl_FragColor.r = adaptedLum;\r\n\r\n}\r\n",
|
||
|
vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}))}H(b,a);return b}(la),Hm=function(a){function b(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};F(this,b);c=Object.assign({focus:1,dof:.02,aperture:.025,maxBlur:1},c);c=N(this,D(b).call(this,{type:"BokehMaterial",uniforms:{cameraNear:new B(.1),cameraFar:new B(2E3),aspect:new B(1),tDiffuse:new B(null),
|
||
|
tDepth:new B(null),focus:new B(c.focus),dof:new B(c.dof),aperture:new B(c.aperture),maxBlur:new B(c.maxBlur)},fragmentShader:"uniform sampler2D tDiffuse;\r\nuniform sampler2D tDepth;\r\n\r\nuniform float focus;\r\nuniform float dof;\r\nuniform float aspect;\r\nuniform float aperture;\r\nuniform float maxBlur;\r\n\r\nvarying vec2 vUv;\r\n\r\n#ifndef USE_LOGDEPTHBUF\r\n\r\n\t#include <packing>\r\n\r\n\tuniform float cameraNear;\r\n\tuniform float cameraFar;\r\n\r\n\tfloat readDepth(sampler2D depthSampler, vec2 coord) {\r\n\r\n\t\tfloat fragCoordZ = texture2D(depthSampler, coord).x;\r\n\t\tfloat viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\r\n\r\n\t\treturn viewZToOrthographicDepth(viewZ, cameraNear, cameraFar);\r\n\r\n\t}\r\n\r\n#endif\r\n\r\nvoid main() {\r\n\r\n\tvec2 aspectCorrection = vec2(1.0, aspect);\r\n\r\n\t#ifdef USE_LOGDEPTHBUF\r\n\r\n\t\tfloat depth = texture2D(tDepth, vUv).x;\r\n\r\n\t#else\r\n\r\n\t\tfloat depth = readDepth(tDepth, vUv);\r\n\r\n\t#endif\r\n\r\n\tfloat focusNear = clamp(focus - dof, 0.0, 1.0);\r\n\tfloat focusFar = clamp(focus + dof, 0.0, 1.0);\r\n\r\n\t// Calculate a DoF mask.\r\n\tfloat low = step(depth, focusNear);\r\n\tfloat high = step(focusFar, depth);\r\n\r\n\tfloat factor = (depth - focusNear) * low + (depth - focusFar) * high;\r\n\r\n\tvec2 dofBlur = vec2(clamp(factor * aperture, -maxBlur, maxBlur));\r\n\r\n\tvec2 dofblur9 = dofBlur * 0.9;\r\n\tvec2 dofblur7 = dofBlur * 0.7;\r\n\tvec2 dofblur4 = dofBlur * 0.4;\r\n\r\n\tvec4 color = vec4(0.0);\r\n\r\n\tcolor += texture2D(tDiffuse, vUv);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.0, 0.4 ) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.15, 0.37) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.29, 0.29) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.37, 0.15) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.40, 0.0 ) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.37, -0.15) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.29, -0.29) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.15, -0.37) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.0, -0.4 ) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.15, 0.37) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.29, 0.29) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.37, 0.15) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.4, 0.0 ) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.37, -0.15) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.29, -0.29) * aspectCorrection) * dofBlur);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.15, -0.37) * aspectCorrection) * dofBlur);\r\n\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.15, 0.37) * aspectCorrection) * dofblur9);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.37, 0.15) * aspectCorrection) * dofblur9);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.37, -0.15) * aspectCorrection) * dofblur9);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.15, -0.37) * aspectCorrection) * dofblur9);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.15, 0.37) * aspectCorrection) * dofblur9);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.37, 0.15) * aspectCorrection) * dofblur9);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2(-0.37, -0.15) * aspectCorrection) * dofblur9);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.15, -0.37) * aspectCorrection) * dofblur9);\r\n\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.29, 0.29) * aspectCorrection) * dofblur7);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.40, 0.0 ) * aspectCorrection) * dofblur7);\r\n\tcolor += texture2D(tDiffuse, vUv + (vec2( 0.29, -0.29) * aspectCorrection) * dofblur7);\r\n\tcolor += texture
|
||
|
vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}));c.adoptCameraSettings(a);return c}z(b,[{key:"adoptCameraSettings",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;null!==a&&(this.uniforms.cameraNear.value=a.near,this.uniforms.cameraFar.value=a.far,this.uniforms.aspect.value=a.aspect)}}]);H(b,a);return b}(la),Im=function(a){function b(){var a=
|
||
|
0<arguments.length&&void 0!==arguments[0]?arguments[0]:new x;F(this,b);return N(this,D(b).call(this,{type:"ColorEdgesMaterial",defines:{EDGE_THRESHOLD:"0.1"},uniforms:{tDiffuse:new B(null),texelSize:new B(a)},fragmentShader:"uniform sampler2D tDiffuse;\r\n\r\nvarying vec2 vUv;\r\nvarying vec4 vOffset[3];\r\n\r\nvoid main() {\r\n\r\n\tconst vec2 threshold = vec2(EDGE_THRESHOLD);\r\n\r\n\t// Calculate color deltas.\r\n\tvec4 delta;\r\n\tvec3 c = texture2D(tDiffuse, vUv).rgb;\r\n\r\n\tvec3 cLeft = texture2D(tDiffuse, vOffset[0].xy).rgb;\r\n\tvec3 t = abs(c - cLeft);\r\n\tdelta.x = max(max(t.r, t.g), t.b);\r\n\r\n\tvec3 cTop = texture2D(tDiffuse, vOffset[0].zw).rgb;\r\n\tt = abs(c - cTop);\r\n\tdelta.y = max(max(t.r, t.g), t.b);\r\n\r\n\t// We do the usual threshold.\r\n\tvec2 edges = step(threshold, delta.xy);\r\n\r\n\t// Then discard if there is no edge.\r\n\tif(dot(edges, vec2(1.0)) == 0.0) {\r\n\r\n\t\tdiscard;\r\n\r\n\t}\r\n\r\n\t// Calculate right and bottom deltas.\r\n\tvec3 cRight = texture2D(tDiffuse, vOffset[1].xy).rgb;\r\n\tt = abs(c - cRight);\r\n\tdelta.z = max(max(t.r, t.g), t.b);\r\n\r\n\tvec3 cBottom = texture2D(tDiffuse, vOffset[1].zw).rgb;\r\n\tt = abs(c - cBottom);\r\n\tdelta.w = max(max(t.r, t.g), t.b);\r\n\r\n\t// Calculate the maximum delta in the direct neighborhood.\r\n\tfloat maxDelta = max(max(max(delta.x, delta.y), delta.z), delta.w);\r\n\r\n\t// Calculate left-left and top-top deltas.\r\n\tvec3 cLeftLeft = texture2D(tDiffuse, vOffset[2].xy).rgb;\r\n\tt = abs(c - cLeftLeft);\r\n\tdelta.z = max(max(t.r, t.g), t.b);\r\n\r\n\tvec3 cTopTop = texture2D(tDiffuse, vOffset[2].zw).rgb;\r\n\tt = abs(c - cTopTop);\r\n\tdelta.w = max(max(t.r, t.g), t.b);\r\n\r\n\t// Calculate the final maximum delta.\r\n\tmaxDelta = max(max(maxDelta, delta.z), delta.w);\r\n\r\n\t// Local contrast adaptation in action.\r\n\tedges.xy *= step(0.5 * maxDelta, delta.xy);\r\n\r\n\tgl_FragColor = vec4(edges, 0.0, 0.0);\r\n\r\n}\r\n",
|
||
|
vertexShader:"uniform vec2 texelSize;\r\n\r\nvarying vec2 vUv;\r\nvarying vec4 vOffset[3];\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\r\n\tvOffset[0] = uv.xyxy + texelSize.xyxy * vec4(-1.0, 0.0, 0.0, 1.0); // Changed sign in W component.\r\n\tvOffset[1] = uv.xyxy + texelSize.xyxy * vec4(1.0, 0.0, 0.0, -1.0); // Changed sign in W component.\r\n\tvOffset[2] = uv.xyxy + texelSize.xyxy * vec4(-2.0, 0.0, 0.0, 2.0); // Changed sign in W component.\r\n\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",
|
||
|
depthWrite:!1,depthTest:!1}))}z(b,[{key:"setEdgeDetectionThreshold",value:function(a){this.defines.EDGE_THRESHOLD=a.toFixed("2");this.needsUpdate=!0}}]);H(b,a);return b}(la),Ig=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1;F(this,b);var d=N(this,D(b).call(this,{type:"CombineMaterial",uniforms:{texture1:new B(null),texture2:new B(null),opacity1:new B(1),opacity2:new B(1)},fragmentShader:"uniform sampler2D texture1;\r\nuniform sampler2D texture2;\r\n\r\nuniform float opacity1;\r\nuniform float opacity2;\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvec4 texel1 = opacity1 * texture2D(texture1, vUv);\r\n\tvec4 texel2 = opacity2 * texture2D(texture2, vUv);\r\n\r\n\t#ifdef SCREEN_MODE\r\n\r\n\t\tvec3 invTexel1 = vec3(1.0) - texel1.rgb;\r\n\t\tvec3 invTexel2 = vec3(1.0) - texel2.rgb;\r\n\r\n\t\tvec4 color = vec4(\r\n\t\t\tvec3(1.0) - invTexel1 * invTexel2,\r\n\t\t\ttexel1.a + texel2.a\r\n\t\t);\r\n\r\n\t#else\r\n\r\n\t\tvec4 color = texel1 + texel2;\r\n\r\n\t#endif\r\n\r\n\tgl_FragColor = color;\r\n\r\n}\r\n",
|
||
|
vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}));d.setScreenModeEnabled(a);return d}z(b,[{key:"setScreenModeEnabled",value:function(a){a?this.defines.SCREEN_MODE="1":delete this.defines.SCREEN_MODE;this.needsUpdate=!0}}]);H(b,a);return b}(la),Uj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new x;F(this,b);var d=N(this,
|
||
|
D(b).call(this,{type:"ConvolutionMaterial",uniforms:{tDiffuse:new B(null),texelSize:new B(new x),halfTexelSize:new B(new x),kernel:new B(0)},fragmentShader:"#include <common>\r\n#include <dithering_pars_fragment>\r\n\r\nuniform sampler2D tDiffuse;\r\n\r\nvarying vec2 vUv0;\r\nvarying vec2 vUv1;\r\nvarying vec2 vUv2;\r\nvarying vec2 vUv3;\r\n\r\nvoid main() {\r\n\r\n\t// Sample top left texel.\r\n\tvec4 sum = texture2D(tDiffuse, vUv0);\r\n\r\n\t// Sample top right texel.\r\n\tsum += texture2D(tDiffuse, vUv1);\r\n\r\n\t// Sample bottom right texel.\r\n\tsum += texture2D(tDiffuse, vUv2);\r\n\r\n\t// Sample bottom left texel.\r\n\tsum += texture2D(tDiffuse, vUv3);\r\n\r\n\t// Compute the average.\r\n\tgl_FragColor = sum * 0.25;\r\n\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",
|
||
|
vertexShader:"uniform vec2 texelSize;\r\nuniform vec2 halfTexelSize;\r\nuniform float kernel;\r\n\r\nvarying vec2 vUv0;\r\nvarying vec2 vUv1;\r\nvarying vec2 vUv2;\r\nvarying vec2 vUv3;\r\n\r\nvoid main() {\r\n\r\n\tvec2 dUv = (texelSize * vec2(kernel)) + halfTexelSize;\r\n\r\n\tvUv0 = vec2(uv.x - dUv.x, uv.y + dUv.y);\r\n\tvUv1 = vec2(uv.x + dUv.x, uv.y + dUv.y);\r\n\tvUv2 = vec2(uv.x + dUv.x, uv.y - dUv.y);\r\n\tvUv3 = vec2(uv.x - dUv.x, uv.y - dUv.y);\r\n\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",
|
||
|
depthWrite:!1,depthTest:!1}));d.setTexelSize(a.x,a.y);d.kernelSize=fe.LARGE;return d}z(b,[{key:"getKernel",value:function(){return Jm[this.kernelSize]}},{key:"setTexelSize",value:function(a,b){this.uniforms.texelSize.value.set(a,b);this.uniforms.halfTexelSize.value.set(a,b).multiplyScalar(.5)}}]);H(b,a);return b}(la),Jm=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,
|
||
|
10])],fe={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},Xc=function(a){function b(){F(this,b);return N(this,D(b).call(this,{type:"CopyMaterial",uniforms:{tDiffuse:new B(null),opacity:new B(1)},fragmentShader:"uniform sampler2D tDiffuse;\r\nuniform float opacity;\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvec4 texel = texture2D(tDiffuse, vUv);\r\n\tgl_FragColor = opacity * texel;\r\n\r\n}\r\n",vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",
|
||
|
depthWrite:!1,depthTest:!1}))}H(b,a);return b}(la),Km=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;var d=1<arguments.length?arguments[1]:void 0;F(this,b);a=N(this,D(b).call(this,{type:"DepthComparisonMaterial",uniforms:{tDepth:new B(a),cameraNear:new B(.1),cameraFar:new B(2E3)},fragmentShader:"#include <packing>\r\n#include <clipping_planes_pars_fragment>\r\n\r\nuniform sampler2D tDepth;\r\nuniform float cameraNear;\r\nuniform float cameraFar;\r\n\r\nvarying float vViewZ;\r\nvarying vec4 vProjTexCoord;\r\n\r\nvoid main() {\r\n\r\n\t#include <clipping_planes_fragment>\r\n\r\n\t// Transform into Cartesian coordinate (not mirrored).\r\n\tvec2 projTexCoord = (vProjTexCoord.xy / vProjTexCoord.w) * 0.5 + 0.5;\r\n\tprojTexCoord = clamp(projTexCoord, 0.002, 0.998);\r\n\r\n\tfloat fragCoordZ = unpackRGBAToDepth(texture2D(tDepth, projTexCoord));\r\n\r\n\t#ifdef PERSPECTIVE_CAMERA\r\n\r\n\t\tfloat viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\r\n\r\n\t#else\r\n\r\n\t\tfloat viewZ = orthographicDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\r\n\r\n\t#endif\r\n\r\n\tfloat depthTest = (-vViewZ > -viewZ) ? 1.0 : 0.0;\r\n\r\n\tgl_FragColor.rgb = vec3(0.0, depthTest, 1.0);\r\n\r\n}\r\n",
|
||
|
vertexShader:"#include <common>\r\n#include <morphtarget_pars_vertex>\r\n#include <skinning_pars_vertex>\r\n#include <clipping_planes_pars_vertex>\r\n\r\nvarying float vViewZ;\r\nvarying vec4 vProjTexCoord;\r\n\r\nvoid main() {\r\n\r\n\t#include <skinbase_vertex>\r\n\r\n\t#include <begin_vertex>\r\n\t#include <morphtarget_vertex>\r\n\t#include <skinning_vertex>\r\n\t#include <project_vertex>\r\n\r\n\tvViewZ = mvPosition.z;\r\n\tvProjTexCoord = gl_Position;\r\n\r\n\t#include <clipping_planes_vertex>\r\n\r\n}\r\n",
|
||
|
depthWrite:!1,depthTest:!1,morphTargets:!0,skinning:!0}));a.adoptCameraSettings(d);return a}z(b,[{key:"adoptCameraSettings",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;null!==a&&(this.uniforms.cameraNear.value=a.near,this.uniforms.cameraFar.value=a.far,a instanceof Ba?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA)}}]);H(b,a);return b}(la),Lm=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};
|
||
|
F(this,b);var d=Object.assign({average:!1,angle:1.57,scale:1,intensity:1},a);a=N(this,D(b).call(this,{type:"DotScreenMaterial",uniforms:{tDiffuse:new B(null),angle:new B(d.angle),scale:new B(d.scale),intensity:new B(d.intensity),offsetRepeat:new B(new ya(.5,.5,1,1))},fragmentShader:"uniform sampler2D tDiffuse;\r\n\r\nuniform float angle;\r\nuniform float scale;\r\nuniform float intensity;\r\n\r\nvarying vec2 vUv;\r\nvarying vec2 vUvPattern;\r\n\r\nfloat pattern() {\r\n\r\n\tfloat s = sin(angle);\r\n\tfloat c = cos(angle);\r\n\r\n\tvec2 point = vec2(c * vUvPattern.x - s * vUvPattern.y, s * vUvPattern.x + c * vUvPattern.y) * scale;\r\n\r\n\treturn (sin(point.x) * sin(point.y)) * 4.0;\r\n\r\n}\r\n\r\nvoid main() {\r\n\r\n\tvec4 texel = texture2D(tDiffuse, vUv);\r\n\tvec3 color = texel.rgb;\r\n\r\n\t#ifdef AVERAGE\r\n\r\n\t\tcolor = vec3((color.r + color.g + color.b) / 3.0);\r\n\r\n\t#endif\r\n\r\n\tcolor = vec3(color * 10.0 - 5.0 + pattern());\r\n\tcolor = texel.rgb + (color - texel.rgb) * intensity;\r\n\r\n\tgl_FragColor = vec4(color, texel.a);\r\n\r\n}\r\n",
|
||
|
vertexShader:"uniform vec4 offsetRepeat;\r\n\r\nvarying vec2 vUv;\r\nvarying vec2 vUvPattern;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tvUvPattern = uv * offsetRepeat.zw + offsetRepeat.xy;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}));a.setAverageEnabled(d.average);return a}z(b,[{key:"setAverageEnabled",value:function(a){a?this.defines.AVERAGE="1":delete this.defines.AVERAGE;this.needsUpdate=!0}}]);H(b,a);return b}(la),
|
||
|
Mm=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=Object.assign({screenMode:!0,noise:!0,scanlines:!0,grid:!1,greyscale:!1,sepia:!1,vignette:!1,eskil:!1,noiseIntensity:.5,scanlineIntensity:.05,gridIntensity:1,greyscaleIntensity:1,sepiaIntensity:1,vignetteOffset:1,vignetteDarkness:1},a);a=N(this,D(b).call(this,{type:"FilmMaterial",uniforms:{tDiffuse:new B(null),time:new B(0),noiseIntensity:new B(d.noiseIntensity),scanlineIntensity:new B(d.scanlineIntensity),
|
||
|
gridIntensity:new B(d.gridIntensity),scanlineCount:new B(0),gridScale:new B(new x),gridLineWidth:new B(0),greyscaleIntensity:new B(d.greyscaleIntensity),sepiaIntensity:new B(d.sepiaIntensity),vignetteOffset:new B(d.vignetteOffset),vignetteDarkness:new B(d.vignetteDarkness)},fragmentShader:"uniform sampler2D tDiffuse;\r\nuniform float time;\r\n\r\nvarying vec2 vUv;\r\n\r\n#ifdef NOISE\r\n\r\n\tuniform float noiseIntensity;\r\n\r\n#endif\r\n\r\n#ifdef SCANLINES\r\n\r\n\tuniform float scanlineIntensity;\r\n\tuniform float scanlineCount;\r\n\r\n#endif\r\n\r\n#ifdef GRID\r\n\r\n\tuniform float gridIntensity;\r\n\tuniform vec2 gridScale;\r\n\tuniform float gridLineWidth;\r\n\r\n#endif\r\n\r\n#ifdef GREYSCALE\r\n\r\n\t#include <common>\r\n\r\n\tuniform float greyscaleIntensity;\r\n\r\n#elif defined(SEPIA)\r\n\r\n\tuniform float sepiaIntensity;\r\n\r\n#endif\r\n\r\n#ifdef VIGNETTE\r\n\r\n\tuniform float vignetteOffset;\r\n\tuniform float vignetteDarkness;\r\n\r\n#endif\r\n\r\nvoid main() {\r\n\r\n\tvec4 texel = texture2D(tDiffuse, vUv);\r\n\tvec3 color = texel.rgb;\r\n\r\n\t#ifdef SCREEN_MODE\r\n\r\n\t\tvec3 invColor;\r\n\r\n\t#endif\r\n\r\n\t#ifdef NOISE\r\n\r\n\t\tfloat x = vUv.x * vUv.y * time * 1000.0;\r\n\t\tx = mod(x, 13.0) * mod(x, 123.0);\r\n\t\tx = mod(x, 0.01);\r\n\r\n\t\tvec3 noise = texel.rgb * clamp(0.1 + x * 100.0, 0.0, 1.0) * noiseIntensity;\r\n\r\n\t\t#ifdef SCREEN_MODE\r\n\r\n\t\t\tinvColor = vec3(1.0) - color;\r\n\t\t\tvec3 invNoise = vec3(1.0) - noise;\r\n\r\n\t\t\tcolor = vec3(1.0) - invColor * invNoise;\r\n\r\n\t\t#else\r\n\r\n\t\t\tcolor += noise;\r\n\r\n\t\t#endif\r\n\r\n\t#endif\r\n\r\n\t#ifdef SCANLINES\r\n\r\n\t\tvec2 sl = vec2(sin(vUv.y * scanlineCount), cos(vUv.y * scanlineCount));\r\n\t\tvec3 scanlines = texel.rgb * vec3(sl.x, sl.y, sl.x) * scanlineIntensity;\r\n\r\n\t\t#ifdef SCREEN_MODE\r\n\r\n\t\t\tinvColor = vec3(1.0) - color;\r\n\t\t\tvec3 invScanlines = vec3(1.0) - scanlines;\r\n\r\n\t\t\tcolor = vec3(1.0) - invColor * invScanlines;\r\n\r\n\t\t#else\r\n\r\n\t\t\tcolor += scanlines;\r\n\r\n\t\t#endif\r\n\r\n\t#endif\r\n\r\n\t#ifdef GRID\r\n\r\n\t\tfloat grid = 0.5 - max(abs(mod(vUv.x * gridScale.x, 1.0) - 0.5), abs(mod(vUv.y * gridScale.y, 1.0) - 0.5));\r\n\t\tcolor *= (1.0 - gridIntensity) + vec3(smoothstep(0.0, gridLineWidth, grid)) * gridIntensity;\r\n\r\n\t#endif\r\n\r\n\t#ifdef GREYSCALE\r\n\r\n\t\tcolor = mix(color, vec3(linearToRelativeLuminance(color)), greyscaleIntensity);\r\n\r\n\t#elif defined(SEPIA)\r\n\r\n\t\tvec3 c = color.rgb;\r\n\r\n\t\tcolor.r = dot(c, vec3(1.0 - 0.607 * sepiaIntensity, 0.769 * sepiaIntensity, 0.189 * sepiaIntensity));\r\n\t\tcolor.g = dot(c, vec3(0.349 * sepiaIntensity, 1.0 - 0.314 * sepiaIntensity, 0.168 * sepiaIntensity));\r\n\t\tcolor.b = dot(c, vec3(0.272 * sepiaIntensity, 0.534 * sepiaIntensity, 1.0 - 0.869 * sepiaIntensity));\r\n\r\n\t#endif\r\n\r\n\t#ifdef VIGNETTE\r\n\r\n\t\tconst vec2 center = vec2(0.5);\r\n\r\n\t\t#ifdef ESKIL\r\n\r\n\t\t\tvec2 uv = (vUv - center) * vec2(vignetteOffset);\r\n\t\t\tcolor = mix(color.rgb, vec3(1.0 - vignetteDarkness), dot(uv, uv));\r\n\r\n\t\t#else\r\n\r\n\t\t\tfloat dist = distance(vUv, center);\r\n\t\t\tcolor *= smoothstep(0.8, vignetteOffset * 0.799, dist * (vignetteDarkness + vignetteOffset));\r\n\r\n\t\t#endif\t\t\r\n\r\n\t#endif\r\n\r\n\tgl_FragColor = vec4(clamp(color, 0.0, 1.0), texel.a);\r\n\r\n}\r\n",
|
||
|
vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}));a.setScreenModeEnabled(d.screenMode);a.setNoiseEnabled(d.noise);a.setScanlinesEnabled(d.scanlines);a.setGridEnabled(d.grid);a.setGreyscaleEnabled(d.greyscale);a.setSepiaEnabled(d.sepia);a.setVignetteEnabled(d.vignette);a.setEskilEnabled(d.eskil);return a}z(b,[{key:"setScreenModeEnabled",value:function(a){a?
|
||
|
this.defines.SCREEN_MODE="1":delete this.defines.SCREEN_MODE;this.needsUpdate=!0}},{key:"setNoiseEnabled",value:function(a){a?this.defines.NOISE="1":delete this.defines.NOISE;this.needsUpdate=!0}},{key:"setScanlinesEnabled",value:function(a){a?this.defines.SCANLINES="1":delete this.defines.SCANLINES;this.needsUpdate=!0}},{key:"setGridEnabled",value:function(a){a?this.defines.GRID="1":delete this.defines.GRID;this.needsUpdate=!0}},{key:"setGreyscaleEnabled",value:function(a){a?this.defines.GREYSCALE=
|
||
|
"1":delete this.defines.GREYSCALE;this.needsUpdate=!0}},{key:"setSepiaEnabled",value:function(a){a?this.defines.SEPIA="1":delete this.defines.SEPIA;this.needsUpdate=!0}},{key:"setVignetteEnabled",value:function(a){a?this.defines.VIGNETTE="1":delete this.defines.VIGNETTE;this.needsUpdate=!0}},{key:"setEskilEnabled",value:function(a){a?this.defines.ESKIL="1":delete this.defines.ESKIL;this.needsUpdate=!0}}]);H(b,a);return b}(la),Nm=function(a){function b(){F(this,b);return N(this,D(b).call(this,{type:"GlitchMaterial",
|
||
|
uniforms:{tDiffuse:new B(null),tPerturb:new B(null),active:new B(1),amount:new B(.8),angle:new B(.02),seed:new B(.02),seedX:new B(.02),seedY:new B(.02),distortionX:new B(.5),distortionY:new B(.6),colS:new B(.05)},fragmentShader:"uniform sampler2D tDiffuse;\r\nuniform sampler2D tPerturb;\r\n\r\nuniform bool active;\r\n\r\nuniform float amount;\r\nuniform float angle;\r\nuniform float seed;\r\nuniform float seedX;\r\nuniform float seedY;\r\nuniform float distortionX;\r\nuniform float distortionY;\r\nuniform float colS;\r\n\r\nvarying vec2 vUv;\r\n\r\nfloat rand(vec2 tc) {\r\n\r\n\tconst float a = 12.9898;\r\n\tconst float b = 78.233;\r\n\tconst float c = 43758.5453;\r\n\r\n\tfloat dt = dot(tc, vec2(a, b));\r\n\tfloat sn = mod(dt, 3.14);\r\n\r\n\treturn fract(sin(sn) * c);\r\n\r\n}\r\n\r\nvoid main() {\r\n\r\n\tvec2 coord = vUv;\r\n\r\n\tfloat xs, ys;\r\n\tvec4 normal;\r\n\r\n\tvec2 offset;\r\n\tvec4 cr, cga, cb;\r\n\tvec4 snow, color;\r\n\r\n\tfloat sx, sy;\r\n\r\n\tif(active) {\r\n\r\n\t\txs = floor(gl_FragCoord.x / 0.5);\r\n\t\tys = floor(gl_FragCoord.y / 0.5);\r\n\r\n\t\tnormal = texture2D(tPerturb, coord * seed * seed);\r\n\r\n\t\tif(coord.y < distortionX + colS && coord.y > distortionX - colS * seed) {\r\n\r\n\t\t\tsx = clamp(ceil(seedX), 0.0, 1.0);\r\n\t\t\tcoord.y = sx * (1.0 - (coord.y + distortionY)) + (1.0 - sx) * distortionY;\r\n\r\n\t\t}\r\n\r\n\t\tif(coord.x < distortionY + colS && coord.x > distortionY - colS * seed) {\r\n\r\n\t\t\tsy = clamp(ceil(seedY), 0.0, 1.0);\r\n\t\t\tcoord.x = sy * distortionX + (1.0 - sy) * (1.0 - (coord.x + distortionX));\r\n\r\n\t\t}\r\n\r\n\t\tcoord.x += normal.x * seedX * (seed / 5.0);\r\n\t\tcoord.y += normal.y * seedY * (seed / 5.0);\r\n\r\n\t\toffset = amount * vec2(cos(angle), sin(angle));\r\n\r\n\t\tcr = texture2D(tDiffuse, coord + offset);\r\n\t\tcga = texture2D(tDiffuse, coord);\r\n\t\tcb = texture2D(tDiffuse, coord - offset);\r\n\r\n\t\tcolor = vec4(cr.r, cga.g, cb.b, cga.a);\r\n\t\tsnow = 200.0 * amount * vec4(rand(vec2(xs * seed, ys * seed * 50.0)) * 0.2);\r\n\t\tcolor += snow;\r\n\r\n\t} else {\r\n\r\n\t\tcolor = texture2D(tDiffuse, vUv);\r\n\r\n\t}\r\n\r\n\tgl_FragColor = color;\r\n\r\n}\r\n",
|
||
|
vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}))}H(b,a);return b}(la),Om=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);a=Object.assign({exposure:.6,density:.93,decay:.96,weight:.4,clampMax:1},a);return N(this,D(b).call(this,{type:"GodRaysMaterial",defines:{NUM_SAMPLES_FLOAT:"60.0",NUM_SAMPLES_INT:"60"},
|
||
|
uniforms:{tDiffuse:new B(null),lightPosition:new B(null),exposure:new B(a.exposure),decay:new B(a.decay),density:new B(a.density),weight:new B(a.weight),clampMax:new B(a.clampMax)},fragmentShader:"#include <common>\r\n#include <dithering_pars_fragment>\r\n\r\nuniform sampler2D tDiffuse;\r\nuniform vec3 lightPosition;\r\n\r\nuniform float exposure;\r\nuniform float decay;\r\nuniform float density;\r\nuniform float weight;\r\nuniform float clampMax;\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvec2 texCoord = vUv;\r\n\r\n\t// Calculate vector from pixel to light source in screen space.\r\n\tvec2 deltaTexCoord = texCoord - lightPosition.st;\r\n\tdeltaTexCoord *= 1.0 / NUM_SAMPLES_FLOAT * density;\r\n\r\n\t// A decreasing illumination factor.\r\n\tfloat illuminationDecay = 1.0;\r\n\r\n\tvec4 sample;\r\n\tvec4 color = vec4(0.0);\r\n\r\n\t// Estimate the probability of occlusion at each pixel by summing samples along a ray to the light source.\r\n\tfor(int i = 0; i < NUM_SAMPLES_INT; ++i) {\r\n\r\n\t\ttexCoord -= deltaTexCoord;\r\n\t\tsample = texture2D(tDiffuse, texCoord);\r\n\r\n\t\t// Apply sample attenuation scale/decay factors.\r\n\t\tsample *= illuminationDecay * weight;\r\n\r\n\t\tcolor += sample;\r\n\r\n\t\t// Update exponential decay factor.\r\n\t\tilluminationDecay *= decay;\r\n\r\n\t}\r\n\r\n\tgl_FragColor = clamp(color * exposure, 0.0, clampMax);\r\n\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",
|
||
|
vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}))}H(b,a);return b}(la),Vj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1;var d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;F(this,b);var e=null!==d;d=N(this,D(b).call(this,{type:"LuminosityMaterial",uniforms:{tDiffuse:new B(null),distinction:new B(1),range:new B(e?
|
||
|
d:new x)},fragmentShader:"#include <common>\r\n\r\nuniform sampler2D tDiffuse;\r\nuniform float distinction;\r\nuniform vec2 range;\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvec4 texel = texture2D(tDiffuse, vUv);\r\n\tfloat l = linearToRelativeLuminance(texel.rgb);\r\n\r\n\t#ifdef RANGE\r\n\r\n\t\tfloat low = step(range.x, l);\r\n\t\tfloat high = step(l, range.y);\r\n\r\n\t\t// Apply the mask.\r\n\t\tl *= low * high;\r\n\r\n\t#endif\r\n\r\n\tl = pow(abs(l), distinction);\r\n\r\n\t#ifdef COLOR\r\n\r\n\t\tgl_FragColor = vec4(texel.rgb * l, texel.a);\r\n\r\n\t#else\r\n\r\n\t\tgl_FragColor = vec4(l, l, l, texel.a);\r\n\r\n\t#endif\r\n\r\n}\r\n",
|
||
|
vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n"}));d.setColorOutputEnabled(a);d.setLuminanceRangeEnabled(e);return d}z(b,[{key:"setColorOutputEnabled",value:function(a){a?this.defines.COLOR="1":delete this.defines.COLOR;this.needsUpdate=!0}},{key:"setLuminanceRangeEnabled",value:function(a){a?this.defines.RANGE="1":delete this.defines.RANGE;this.needsUpdate=!0}}]);H(b,a);return b}(la),
|
||
|
Pm=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=Object.assign({edgeStrength:1,patternScale:1,visibleEdgeColor:16777215,hiddenEdgeColor:2230538,alphaBlending:!1,xRay:!0},a);a=N(this,D(b).call(this,{type:"OutlineBlendMaterial",uniforms:{pulse:new B(1),aspect:new B(1),tDiffuse:new B(null),tMask:new B(null),tEdges:new B(null),tPattern:new B(null),edgeStrength:new B(d.edgeStrength),patternScale:new B(d.patternScale),visibleEdgeColor:new B(new S(d.visibleEdgeColor)),
|
||
|
hiddenEdgeColor:new B(new S(d.hiddenEdgeColor))},fragmentShader:"uniform sampler2D tDiffuse;\r\nuniform sampler2D tMask;\r\nuniform sampler2D tEdges;\r\n\r\nuniform vec3 visibleEdgeColor;\r\nuniform vec3 hiddenEdgeColor;\r\nuniform float pulse;\r\nuniform float edgeStrength;\r\n\r\n#ifdef USE_PATTERN\r\n\r\n\tuniform sampler2D tPattern;\r\n\tvarying vec2 vPatternCoord;\r\n\r\n#endif\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvec4 color = texture2D(tDiffuse, vUv);\r\n\tvec2 edge = texture2D(tEdges, vUv).rg;\r\n\tvec2 mask = texture2D(tMask, vUv).rg;\r\n\r\n\t#ifndef X_RAY\r\n\r\n\t\tedge.y = 0.0;\r\n\r\n\t#endif\r\n\r\n\tedge *= (edgeStrength * mask.x * pulse);\r\n\tvec3 outlineColor = edge.x * visibleEdgeColor + edge.y * hiddenEdgeColor;\r\n\r\n\t#ifdef ALPHA_BLENDING\r\n\r\n\t\tcolor.rgb = mix(color.rgb, outlineColor, max(edge.x, edge.y));\r\n\r\n\t#else\r\n\r\n\t\tcolor.rgb += outlineColor;\r\n\r\n\t#endif\r\n\r\n\t#ifdef USE_PATTERN\r\n\r\n\t\tvec3 patternColor = texture2D(tPattern, vPatternCoord).rgb;\r\n\r\n\t\t#ifdef X_RAY\r\n\r\n\t\t\tfloat hiddenFactor = 0.5;\r\n\r\n\t\t#else\r\n\r\n\t\t\tfloat hiddenFactor = 0.0;\r\n\r\n\t\t#endif\r\n\r\n\t\tfloat visibilityFactor = (1.0 - mask.y > 0.0) ? 1.0 : hiddenFactor;\r\n\r\n\t\tcolor.rgb += visibilityFactor * (1.0 - mask.x) * (1.0 - patternColor);\r\n\r\n\t#endif\r\n\r\n\tgl_FragColor = color;\r\n\r\n}\r\n",
|
||
|
vertexShader:"#ifdef USE_PATTERN\r\n\r\n\tuniform float aspect;\r\n\tuniform float patternScale;\r\n\tvarying vec2 vPatternCoord;\r\n\r\n#endif\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\t#ifdef USE_PATTERN\r\n\r\n\t\tvec2 aspectCorrection = vec2(aspect, 1.0);\r\n\t\tvPatternCoord = uv * aspectCorrection * patternScale;\r\n\r\n\t#endif\r\n\r\n\tvUv = uv;\r\n\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}));a.setAlphaBlendingEnabled(d.alphaBlending);
|
||
|
a.setXRayEnabled(d.xRay);return a}z(b,[{key:"setAlphaBlendingEnabled",value:function(a){a?this.defines.ALPHA_BLENDING="1":delete this.defines.ALPHA_BLENDING;this.needsUpdate=!0}},{key:"setXRayEnabled",value:function(a){a?this.defines.X_RAY="1":delete this.defines.X_RAY;this.needsUpdate=!0}},{key:"setPatternTexture",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;null!==a?this.defines.USE_PATTERN="1":delete this.defines.USE_PATTERN;this.uniforms.tPattern.value=a;
|
||
|
this.needsUpdate=!0}}]);H(b,a);return b}(la),Qm=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new x;F(this,b);var d=N(this,D(b).call(this,{type:"OutlineEdgesMaterial",uniforms:{tMask:new B(null),texelSize:new B(new x)},fragmentShader:"uniform sampler2D tMask;\r\n\r\nvarying vec2 vUv0;\r\nvarying vec2 vUv1;\r\nvarying vec2 vUv2;\r\nvarying vec2 vUv3;\r\n\r\nvoid main() {\r\n\r\n\tvec2 c0 = texture2D(tMask, vUv0).rg;\r\n\tvec2 c1 = texture2D(tMask, vUv1).rg;\r\n\tvec2 c2 = texture2D(tMask, vUv2).rg;\r\n\tvec2 c3 = texture2D(tMask, vUv3).rg;\r\n\r\n\tfloat d0 = (c0.x - c1.x) * 0.5;\r\n\tfloat d1 = (c2.x - c3.x) * 0.5;\r\n\tfloat d = length(vec2(d0, d1));\r\n\r\n\tfloat a0 = min(c0.y, c1.y);\r\n\tfloat a1 = min(c2.y, c3.y);\r\n\tfloat visibilityFactor = min(a0, a1);\r\n\r\n\tgl_FragColor.rg = (1.0 - visibilityFactor > 0.001) ? vec2(d, 0.0) : vec2(0.0, d);\r\n\r\n}\r\n",
|
||
|
vertexShader:"uniform vec2 texelSize;\r\n\r\nvarying vec2 vUv0;\r\nvarying vec2 vUv1;\r\nvarying vec2 vUv2;\r\nvarying vec2 vUv3;\r\n\r\nvoid main() {\r\n\r\n\tvUv0 = vec2(uv.x + texelSize.x, uv.y);\r\n\tvUv1 = vec2(uv.x - texelSize.x, uv.y);\r\n\tvUv2 = vec2(uv.x, uv.y + texelSize.y);\r\n\tvUv3 = vec2(uv.x, uv.y - texelSize.y);\r\n\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}));d.setTexelSize(a.x,a.y);return d}z(b,[{key:"setTexelSize",
|
||
|
value:function(a,b){this.uniforms.texelSize.value.set(a,b)}}]);H(b,a);return b}(la),Rm=function(a){function b(){F(this,b);return N(this,D(b).call(this,{type:"PixelationMaterial",uniforms:{tDiffuse:new B(null),granularity:new B(1),resolution:new B(new x(1,1)),dx:new B(1),dy:new B(1)},fragmentShader:"uniform sampler2D tDiffuse;\r\nuniform float granularity;\r\nuniform float dx;\r\nuniform float dy;\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvec4 texel;\r\n\r\n\tif(granularity > 0.0) {\r\n\r\n\t\tvec2 coord = vec2(\r\n\t\t\tdx * (floor(vUv.x / dx) + 0.5),\r\n\t\t\tdy * (floor(vUv.y / dy) + 0.5)\r\n\t\t);\r\n\r\n\t\ttexel = texture2D(tDiffuse, coord);\r\n\r\n\t} else {\r\n\r\n\t\ttexel = texture2D(tDiffuse, vUv);\r\n\r\n\t}\r\n\r\n\tgl_FragColor = texel;\r\n\r\n}\r\n",
|
||
|
vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}))}z(b,[{key:"setResolution",value:function(a,b){this.uniforms.resolution.value.set(a,b);this.granularity=this.granularity}},{key:"granularity",get:function(){return this.uniforms.granularity.value},set:function(a){var b=this.uniforms,c=b.resolution.value;b.granularity.value=a;b.dx.value=a/c.x;b.dy.value=a/c.y}}]);
|
||
|
H(b,a);return b}(la),Sm=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;var d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};F(this,b);var e=Object.assign({texelSize:null,rings:3,samples:2,showFocus:!1,manualDoF:!1,vignette:!1,pentagon:!1,shaderFocus:!0,noise:!0,maxBlur:1,luminanceThreshold:.5,luminanceGain:2,bias:.5,fringe:.7,ditherStrength:1E-4},d);d=N(this,D(b).call(this,{type:"RealisticBokehMaterial",defines:{RINGS_INT:e.rings.toFixed(0),RINGS_FLOAT:e.rings.toFixed(1),
|
||
|
SAMPLES_INT:e.samples.toFixed(0),SAMPLES_FLOAT:e.samples.toFixed(1)},uniforms:{tDiffuse:new B(null),tDepth:new B(null),texelSize:new B(new x),halfTexelSize:new B(new x),cameraNear:new B(.1),cameraFar:new B(2E3),focalLength:new B(24),focalStop:new B(.9),maxBlur:new B(e.maxBlur),luminanceThreshold:new B(e.luminanceThreshold),luminanceGain:new B(e.luminanceGain),bias:new B(e.bias),fringe:new B(e.fringe),ditherStrength:new B(e.ditherStrength),focusCoords:new B(new x(.5,.5)),focalDepth:new B(1)},fragmentShader:"#include <common>\r\n\r\nuniform sampler2D tDiffuse;\r\nuniform sampler2D tDepth;\r\n\r\nuniform vec2 texelSize;\r\nuniform vec2 halfTexelSize;\r\n\r\nuniform float cameraNear;\r\nuniform float cameraFar;\r\n\r\nuniform float focalLength;\r\nuniform float focalStop;\r\n\r\nuniform float maxBlur;\r\nuniform float luminanceThreshold;\r\nuniform float luminanceGain;\r\nuniform float bias;\r\nuniform float fringe;\r\nuniform float ditherStrength;\r\n\r\n#ifdef SHADER_FOCUS\r\n\r\n\tuniform vec2 focusCoords;\r\n\r\n#else\r\n\r\n\tuniform float focalDepth;\r\n\r\n#endif\r\n\r\nvarying vec2 vUv;\r\n\r\n#ifndef USE_LOGDEPTHBUF\r\n\r\n\t#include <packing>\r\n\r\n\tfloat readDepth(sampler2D depthSampler, vec2 coord) {\r\n\r\n\t\tfloat fragCoordZ = texture2D(depthSampler, coord).x;\r\n\t\tfloat viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\r\n\r\n\t\treturn viewZToOrthographicDepth(viewZ, cameraNear, cameraFar);\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#ifdef PENTAGON\r\n\r\n\tfloat penta(vec2 coords) {\r\n\r\n\t\tconst vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);\r\n\t\tconst vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);\r\n\t\tconst vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);\r\n\t\tconst vec4 HS3 = vec4(-0.809016994, -0.587785252, 0.0, 1.0);\r\n\t\tconst vec4 HS4 = vec4( 0.309016994, -0.951056516, 0.0, 1.0);\r\n\t\tconst vec4 HS5 = vec4( 0.0, 0.0, 1.0, 1.0);\r\n\r\n\t\tconst vec4 ONE = vec4(1.0);\r\n\r\n\t\tconst float P_FEATHER = 0.4;\r\n\t\tconst float N_FEATHER = -P_FEATHER;\r\n\r\n\t\tfloat inOrOut = -4.0;\r\n\r\n\t\tvec4 P = vec4(coords, vec2(RINGS_FLOAT - 1.3));\r\n\r\n\t\tvec4 dist = vec4(\r\n\t\t\tdot(P, HS0),\r\n\t\t\tdot(P, HS1),\r\n\t\t\tdot(P, HS2),\r\n\t\t\tdot(P, HS3)\r\n\t\t);\r\n\r\n\t\tdist = smoothstep(N_FEATHER, P_FEATHER, dist);\r\n\r\n\t\tinOrOut += dot(dist, ONE);\r\n\r\n\t\tdist.x = dot(P, HS4);\r\n\t\tdist.y = HS5.w - abs(P.z);\r\n\r\n\t\tdist = smoothstep(N_FEATHER, P_FEATHER, dist);\r\n\t\tinOrOut += dist.x;\r\n\r\n\t\treturn clamp(inOrOut, 0.0, 1.0);\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#ifdef SHOW_FOCUS\r\n\r\n\tvec3 debugFocus(vec3 c, float blur, float depth) {\r\n\r\n\t\tfloat edge = 0.002 * depth;\r\n\t\tfloat m = clamp(smoothstep(0.0, edge, blur), 0.0, 1.0);\r\n\t\tfloat e = clamp(smoothstep(1.0 - edge, 1.0, blur), 0.0, 1.0);\r\n\r\n\t\tc = mix(c, vec3(1.0, 0.5, 0.0), (1.0 - m) * 0.6);\r\n\t\tc = mix(c, vec3(0.0, 0.5, 1.0), ((1.0 - e) - (1.0 - m)) * 0.2);\r\n\r\n\t\treturn c;\r\n\r\n\t}\r\n\r\n#endif\r\n\r\n#ifdef VIGNETTE\r\n\r\n\tfloat vignette() {\r\n\r\n\t\tconst vec2 CENTER = vec2(0.5);\r\n\r\n\t\tconst float VIGNETTE_OUT = 1.3;\r\n\t\tconst float VIGNETTE_IN = 0.0;\r\n\t\tconst float VIGNETTE_FADE = 22.0; \r\n\r\n\t\tfloat d = distance(vUv, CENTER);\r\n\t\td = smoothstep(VIGNETTE_OUT + (focalStop / VIGNETTE_FADE), VIGNETTE_IN + (focalStop / VIGNETTE_FADE), d);\r\n\r\n\t\treturn clamp(d, 0.0, 1.0);\r\n\r\n\t}\r\n\r\n#endif\r\n\r\nvec2 rand2(vec2 coord) {\r\n\r\n\tvec2 noise;\r\n\r\n\t#ifdef NOISE\r\n\r\n\t\tconst float a = 12.9898;\r\n\t\tconst float b = 78.233;\r\n\t\tconst float c = 43758.5453;\r\n\r\n\t\tnoise.x = clamp(fract(sin(mod(dot(coord, vec2(a, b)), 3.14)) * c), 0.0, 1.0) * 2.0 - 1.0;\r\n\t\tnoise.y = clamp(fract(sin(mod(dot(coord, vec2(a, b) * 2.0), 3.14)) * c), 0.0, 1.0) * 2.0 - 1.0;\r\n\r\n\t#else\r\n\r\n\t\tnoise.x = ((fract(1.0 - coord.s * halfTexelSize.x) * 0.25) + (fract(coord.t * halfTexelSize.y) * 0.75)) * 2.0 - 1.0;\r\n\t\tnoise.y = ((fract(1.0 - coord.s * halfTexelSize.x) * 0.75) + (fract(coord.t * halfTexelSize.y
|
||
|
vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}));d.setShowFocusEnabled(e.showFocus);d.setManualDepthOfFieldEnabled(e.manualDoF);d.setVignetteEnabled(e.vignette);d.setPentagonEnabled(e.pentagon);d.setShaderFocusEnabled(e.shaderFocus);d.setNoiseEnabled(e.noise);null!==e.texelSize&&d.setTexelSize(e.texelSize.x,e.texelSize.y);d.adoptCameraSettings(a);return d}
|
||
|
z(b,[{key:"setShowFocusEnabled",value:function(a){a?this.defines.SHOW_FOCUS="1":delete this.defines.SHOW_FOCUS;this.needsUpdate=!0}},{key:"setManualDepthOfFieldEnabled",value:function(a){a?this.defines.MANUAL_DOF="1":delete this.defines.MANUAL_DOF;this.needsUpdate=!0}},{key:"setVignetteEnabled",value:function(a){a?this.defines.VIGNETTE="1":delete this.defines.VIGNETTE;this.needsUpdate=!0}},{key:"setPentagonEnabled",value:function(a){a?this.defines.PENTAGON="1":delete this.defines.PENTAGON;this.needsUpdate=
|
||
|
!0}},{key:"setShaderFocusEnabled",value:function(a){a?this.defines.SHADER_FOCUS="1":delete this.defines.SHADER_FOCUS;this.needsUpdate=!0}},{key:"setNoiseEnabled",value:function(a){a?this.defines.NOISE="1":delete this.defines.NOISE;this.needsUpdate=!0}},{key:"setTexelSize",value:function(a,b){this.uniforms.texelSize.value.set(a,b);this.uniforms.halfTexelSize.value.set(a,b).multiplyScalar(.5)}},{key:"adoptCameraSettings",value:function(a){null!==a&&(this.uniforms.cameraNear.value=a.near,this.uniforms.cameraFar.value=
|
||
|
a.far,this.uniforms.focalLength.value=a.getFocalLength())}}]);H(b,a);return b}(la),Tm=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);a=Object.assign({maxRadius:1,waveSize:.2,amplitude:.05},a);return N(this,D(b).call(this,{type:"ShockWaveMaterial",uniforms:{tDiffuse:new B(null),center:new B(new x(.5,.5)),aspect:new B(1),cameraDistance:new B(1),size:new B(1),radius:new B(-a.waveSize),maxRadius:new B(a.maxRadius),waveSize:new B(a.waveSize),amplitude:new B(a.amplitude)},
|
||
|
fragmentShader:"#include <common>\r\n\r\nuniform sampler2D tDiffuse;\r\nuniform vec2 center;\r\nuniform float aspect;\r\nuniform float waveSize;\r\nuniform float radius;\r\nuniform float maxRadius;\r\nuniform float amplitude;\r\n\r\nvarying vec2 vUv;\r\nvarying float vSize;\r\n\r\nvoid main() {\r\n\r\n\tvec2 aspectCorrection = vec2(aspect, 1.0);\r\n\r\n\tvec2 difference = vUv * aspectCorrection - center * aspectCorrection;\r\n\tfloat distance = sqrt(dot(difference, difference)) * vSize;\r\n\r\n\tvec2 displacement = vec2(0.0);\r\n\r\n\tif(distance > radius) {\r\n\r\n\t\tif(distance < radius + waveSize) {\r\n\r\n\t\t\tfloat angle = (distance - radius) * PI2 / waveSize;\r\n\t\t\tfloat cosSin = (1.0 - cos(angle)) * 0.5;\r\n\r\n\t\t\tfloat extent = maxRadius + waveSize;\r\n\t\t\tfloat decay = max(extent - distance * distance, 0.0) / extent;\r\n\r\n\t\t\tdisplacement = ((cosSin * amplitude * difference) / distance) * decay;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tgl_FragColor = texture2D(tDiffuse, vUv - displacement);\r\n\r\n}\r\n",
|
||
|
vertexShader:"uniform float size;\r\nuniform float scale;\r\nuniform float cameraDistance;\r\n\r\nvarying vec2 vUv;\r\nvarying float vSize;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tvSize = (0.1 * cameraDistance) / size;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}))}H(b,a);return b}(la),Um=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new x;F(this,b);return N(this,D(b).call(this,{type:"SMAABlendMaterial",
|
||
|
uniforms:{tDiffuse:new B(null),tWeights:new B(null),texelSize:new B(a)},fragmentShader:"uniform sampler2D tDiffuse;\r\nuniform sampler2D tWeights;\r\n\r\nuniform vec2 texelSize;\r\n\r\nvarying vec2 vUv;\r\nvarying vec4 vOffset;\r\n\r\nvoid main() {\r\n\r\n\t// Fetch the blending weights for current pixel.\r\n\tvec4 a;\r\n\ta.xz = texture2D(tWeights, vUv).xz;\r\n\ta.y = texture2D(tWeights, vOffset.zw).g;\r\n\ta.w = texture2D(tWeights, vOffset.xy).a;\r\n\r\n\tvec4 color;\r\n\r\n\t// Check if there is any blending weight with a value greater than 0.0.\r\n\tif(dot(a, vec4(1.0)) < 1e-5) {\r\n\r\n\t\tcolor = texture2D(tDiffuse, vUv, 0.0);\r\n\r\n\t} else {\r\n\r\n\t\t/* Up to four lines can be crossing a pixel (one through each edge).\r\n\t\t * The line with the maximum weight for each direction is favoured.\r\n\t\t */\r\n\r\n\t\tvec2 offset;\r\n\t\toffset.x = a.a > a.b ? a.a : -a.b; // Left vs. right.\r\n\t\toffset.y = a.g > a.r ? -a.g : a.r; // Top vs. bottom (changed signs).\r\n\r\n\t\t// Go in the direction with the maximum weight (horizontal vs. vertical).\r\n\t\tif(abs(offset.x) > abs(offset.y)) {\r\n\r\n\t\t\toffset.y = 0.0;\r\n\r\n\t\t} else {\r\n\r\n\t\t\toffset.x = 0.0;\r\n\r\n\t\t}\r\n\r\n\t\t// Fetch the opposite color and lerp by hand.\r\n\t\tcolor = texture2D(tDiffuse, vUv, 0.0);\r\n\t\tvec2 coord = vUv + sign(offset) * texelSize;\r\n\t\tvec4 oppositeColor = texture2D(tDiffuse, coord, 0.0);\r\n\t\tfloat s = abs(offset.x) > abs(offset.y) ? abs(offset.x) : abs(offset.y);\r\n\r\n\t\t// Gamma correction.\r\n\t\tcolor.rgb = pow(abs(color.rgb), vec3(2.2));\r\n\t\toppositeColor.rgb = pow(abs(oppositeColor.rgb), vec3(2.2));\r\n\t\tcolor = mix(color, oppositeColor, s);\r\n\t\tcolor.rgb = pow(abs(color.rgb), vec3(1.0 / 2.2));\r\n\r\n\t}\r\n\r\n\tgl_FragColor = color;\r\n\r\n}\r\n",
|
||
|
vertexShader:"uniform vec2 texelSize;\r\n\r\nvarying vec2 vUv;\r\nvarying vec4 vOffset;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\r\n\tvOffset = uv.xyxy + texelSize.xyxy * vec4(1.0, 0.0, 0.0, -1.0); // Changed sign in W component.\r\n\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}))}H(b,a);return b}(la),Vm=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:new x;F(this,b);return N(this,D(b).call(this,
|
||
|
{type:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"8",MAX_SEARCH_STEPS_FLOAT:"8.0",AREATEX_MAX_DISTANCE:"16.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{tDiffuse:new B(null),tArea:new B(null),tSearch:new B(null),texelSize:new B(a)},fragmentShader:"#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + float(offset) * texelSize, 0.0)\r\n\r\nuniform sampler2D tDiffuse;\r\nuniform sampler2D tArea;\r\nuniform sampler2D tSearch;\r\n\r\nuniform vec2 texelSize;\r\n\r\nvarying vec2 vUv;\r\nvarying vec4 vOffset[3];\r\nvarying vec2 vPixCoord;\r\n\r\nvec2 round(vec2 x) {\r\n\r\n\treturn sign(x) * floor(abs(x) + 0.5);\r\n\r\n}\r\n\r\nfloat searchLength(vec2 e, float bias, float scale) {\r\n\r\n\t// Not required if tSearch accesses are set to point.\r\n\t// const vec2 SEARCH_TEX_PIXEL_SIZE = 1.0 / vec2(66.0, 33.0);\r\n\t// e = vec2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE + e * vec2(scale, 1.0) * vec2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;\r\n\r\n\te.r = bias + e.r * scale;\r\n\r\n\treturn 255.0 * texture2D(tSearch, e, 0.0).r;\r\n\r\n}\r\n\r\nfloat searchXLeft(vec2 texCoord, float end) {\r\n\r\n\t/* @PSEUDO_GATHER4\r\n\t * This texCoord has been offset by (-0.25, -0.125) in the vertex shader to\r\n\t * sample between edge, thus fetching four edges in a row.\r\n\t * Sampling with different offsets in each direction allows to disambiguate\r\n\t * which edges are active from the four fetched ones.\r\n\t */\r\n\r\n\tvec2 e = vec2(0.0, 1.0);\r\n\r\n\tfor(int i = 0; i < MAX_SEARCH_STEPS_INT; ++i) {\r\n\r\n\t\te = texture2D(tDiffuse, texCoord, 0.0).rg;\r\n\t\ttexCoord -= vec2(2.0, 0.0) * texelSize;\r\n\r\n\t\tif(!(texCoord.x > end && e.g > 0.8281 && e.r == 0.0)) { break; }\r\n\r\n\t}\r\n\r\n\t// Correct the previously applied offset (-0.25, -0.125).\r\n\ttexCoord.x += 0.25 * texelSize.x;\r\n\r\n\t// The searches are biased by 1, so adjust the coords accordingly.\r\n\ttexCoord.x += texelSize.x;\r\n\r\n\t// Disambiguate the length added by the last step.\r\n\ttexCoord.x += 2.0 * texelSize.x; // Undo last step.\r\n\ttexCoord.x -= texelSize.x * searchLength(e, 0.0, 0.5);\r\n\r\n\treturn texCoord.x;\r\n\r\n}\r\n\r\nfloat searchXRight(vec2 texCoord, float end) {\r\n\r\n\tvec2 e = vec2(0.0, 1.0);\r\n\r\n\tfor(int i = 0; i < MAX_SEARCH_STEPS_INT; ++i) {\r\n\r\n\t\te = texture2D(tDiffuse, texCoord, 0.0).rg;\r\n\t\ttexCoord += vec2(2.0, 0.0) * texelSize;\r\n\r\n\t\tif(!(texCoord.x < end && e.g > 0.8281 && e.r == 0.0)) { break; }\r\n\r\n\t}\r\n\r\n\ttexCoord.x -= 0.25 * texelSize.x;\r\n\ttexCoord.x -= texelSize.x;\r\n\ttexCoord.x -= 2.0 * texelSize.x;\r\n\ttexCoord.x += texelSize.x * searchLength(e, 0.5, 0.5);\r\n\r\n\treturn texCoord.x;\r\n\r\n}\r\n\r\nfloat searchYUp(vec2 texCoord, float end) {\r\n\r\n\tvec2 e = vec2(1.0, 0.0);\r\n\r\n\tfor(int i = 0; i < MAX_SEARCH_STEPS_INT; ++i) {\r\n\r\n\t\te = texture2D(tDiffuse, texCoord, 0.0).rg;\r\n\t\ttexCoord += vec2(0.0, 2.0) * texelSize; // Changed sign.\r\n\r\n\t\tif(!(texCoord.y > end && e.r > 0.8281 && e.g == 0.0)) { break; }\r\n\r\n\t}\r\n\r\n\ttexCoord.y -= 0.25 * texelSize.y; // Changed sign.\r\n\ttexCoord.y -= texelSize.y; // Changed sign.\r\n\ttexCoord.y -= 2.0 * texelSize.y; // Changed sign.\r\n\ttexCoord.y += texelSize.y * searchLength(e.gr, 0.0, 0.5); // Changed sign.\r\n\r\n\treturn texCoord.y;\r\n\r\n}\r\n\r\nfloat searchYDown(vec2 texCoord, float end) {\r\n\r\n\tvec2 e = vec2(1.0, 0.0);\r\n\r\n\tfor(int i = 0; i < MAX_SEARCH_STEPS_INT; ++i ) {\r\n\r\n\t\te = texture2D(tDiffuse, texCoord, 0.0).rg;\r\n\t\ttexCoord -= vec2(0.0, 2.0) * texelSize; // Changed sign.\r\n\r\n\t\tif(!(texCoord.y < end && e.r > 0.8281 && e.g == 0.0)) { break; }\r\n\r\n\t}\r\n\r\n\ttexCoord.y += 0.25 * texelSize.y; // Changed sign.\r\n\ttexCoord.y += texelSize.y; // Changed sign.\r\n\ttexCoord.y += 2.0 * texelSize.y; // Changed sign.\r\n\ttexCoord.y -= texelSize.y * searchLength(e.gr, 0.5, 0.5); // Changed sign.\r\n\r\n\treturn texCoord.y;\r\n\r\n}\r\n\r\nvec2 area(vec2 dist
|
||
|
vertexShader:"uniform vec2 texelSize;\r\n\r\nvarying vec2 vUv;\r\nvarying vec4 vOffset[3];\r\nvarying vec2 vPixCoord;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\r\n\tvPixCoord = uv / texelSize;\r\n\r\n\t// Offsets for the searches (see @PSEUDO_GATHER4).\r\n\tvOffset[0] = uv.xyxy + texelSize.xyxy * vec4(-0.25, 0.125, 1.25, 0.125); // Changed sign in Y and W components.\r\n\tvOffset[1] = uv.xyxy + texelSize.xyxy * vec4(-0.125, 0.25, -0.125, -1.25); //Changed sign in Y and W components.\r\n\r\n\t// This indicates the ends of the loops.\r\n\tvOffset[2] = vec4(vOffset[0].xz, vOffset[1].yw) + vec4(-2.0, 2.0, -2.0, 2.0) * texelSize.xxyy * MAX_SEARCH_STEPS_FLOAT;\r\n\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",
|
||
|
depthWrite:!1,depthTest:!1}))}z(b,[{key:"setOrthogonalSearchSteps",value:function(a){this.defines.MAX_SEARCH_STEPS_INT=a.toFixed("0");this.defines.MAX_SEARCH_STEPS_FLOAT=a.toFixed("1");this.needsUpdate=!0}}]);H(b,a);return b}(la),Wm=function(a){function b(){F(this,b);return N(this,D(b).call(this,{type:"ToneMappingMaterial",uniforms:{tDiffuse:new B(null),luminanceMap:new B(null),averageLuminance:new B(1),maxLuminance:new B(16),middleGrey:new B(.6)},fragmentShader:"#include <common>\r\n#include <dithering_pars_fragment>\r\n\r\nuniform sampler2D tDiffuse;\r\nuniform float middleGrey;\r\nuniform float maxLuminance;\r\n\r\n#ifdef ADAPTED_LUMINANCE\r\n\r\n\tuniform sampler2D luminanceMap;\r\n\r\n#else\r\n\r\n\tuniform float averageLuminance;\r\n\r\n#endif\r\n\r\nvarying vec2 vUv;\r\n\r\nvec3 toneMap(vec3 c) {\r\n\r\n\t#ifdef ADAPTED_LUMINANCE\r\n\r\n\t\t// Get the calculated average luminance by sampling the center.\r\n\t\tfloat lumAvg = texture2D(luminanceMap, vec2(0.5)).r;\r\n\r\n\t#else\r\n\r\n\t\tfloat lumAvg = averageLuminance;\r\n\r\n\t#endif\r\n\r\n\t// Calculate the luminance of the current pixel.\r\n\tfloat lumPixel = linearToRelativeLuminance(c);\r\n\r\n\t// Apply the modified operator (Reinhard Eq. 4).\r\n\tfloat lumScaled = (lumPixel * middleGrey) / lumAvg;\r\n\r\n\tfloat lumCompressed = (lumScaled * (1.0 + (lumScaled / (maxLuminance * maxLuminance)))) / (1.0 + lumScaled);\r\n\r\n\treturn lumCompressed * c;\r\n\r\n}\r\n\r\nvoid main() {\r\n\r\n\tvec4 texel = texture2D(tDiffuse, vUv);\r\n\tgl_FragColor = vec4(toneMap(texel.rgb), texel.a);\r\n\r\n\t#include <dithering_fragment>\r\n\r\n}\r\n",
|
||
|
vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",depthWrite:!1,depthTest:!1}))}H(b,a);return b}(la),xa=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"Pass",c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:new xc,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:new qb(-1,1,1,-1,0,1),e=3<arguments.length&&void 0!==arguments[3]?arguments[3]:
|
||
|
new ha(new Mb(2,2),null);F(this,a);this.name=b;this.scene=c;this.camera=d;this.quad=e;null!==this.quad&&(this.quad.frustumCulled=!1,null!==this.scene&&this.scene.add(this.quad));this.renderToScreen=!1;this.needsSwap=this.enabled=!0}z(a,[{key:"render",value:function(a,c,d,e,g){throw Error("Render method not implemented!");}},{key:"setSize",value:function(a,c){}},{key:"initialize",value:function(a,c){}},{key:"dispose",value:function(){for(var a,c=Object.keys(this),d=0;d<c.length;d++)a=c[d],null!==this[a]&&
|
||
|
"function"===typeof this[a].dispose&&(this[a].dispose(),this[a]=null);null!==this.material&&this.material.dispose()}},{key:"material",get:function(){return null!==this.quad?this.quad.material:null},set:function(a){null!==this.quad&&(this.quad.material=a)}}]);return a}(),Jg=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,"BlurPass"));d.renderTargetX=new Oa(1,1,{minFilter:1006,magFilter:1006,stencilBuffer:!1,depthBuffer:!1});
|
||
|
d.renderTargetX.texture.name="Blur.TargetX";d.renderTargetX.texture.generateMipmaps=!1;d.renderTargetY=d.renderTargetX.clone();d.renderTargetY.texture.name="Blur.TargetY";d.resolutionScale=void 0!==a.resolutionScale?a.resolutionScale:.5;d.convolutionMaterial=new Uj;d.ditheredConvolutionMaterial=new Uj;d.ditheredConvolutionMaterial.dithering=!0;d.dithering=!1;d.kernelSize=a.kernelSize;return d}z(b,[{key:"render",value:function(a,b,e,g,k){g=this.scene;k=this.camera;var c=this.renderTargetX,d=this.renderTargetY,
|
||
|
m=this.convolutionMaterial,p=m.uniforms,q=m.getKernel(),t;this.material=m;var u=0;for(t=q.length-1;u<t;++u)m=0===u%2?c:d,p.kernel.value=q[u],p.tDiffuse.value=b.texture,a.render(g,k,m),b=m;this.dithering&&(m=this.ditheredConvolutionMaterial,p=m.uniforms,this.material=m);p.kernel.value=q[u];p.tDiffuse.value=b.texture;a.render(g,k,this.renderToScreen?null:e)}},{key:"setSize",value:function(a,b){a=Math.max(1,Math.floor(a*this.resolutionScale));b=Math.max(1,Math.floor(b*this.resolutionScale));this.renderTargetX.setSize(a,
|
||
|
b);this.renderTargetY.setSize(a,b);this.convolutionMaterial.setTexelSize(1/a,1/b);this.ditheredConvolutionMaterial.setTexelSize(1/a,1/b)}},{key:"initialize",value:function(a,b){b||(this.renderTargetX.texture.format=1022,this.renderTargetY.texture.format=1022)}},{key:"width",get:function(){return this.renderTargetX.width}},{key:"height",get:function(){return this.renderTargetX.height}},{key:"kernelSize",get:function(){return this.convolutionMaterial.kernelSize},set:function(){var a=0<arguments.length&&
|
||
|
void 0!==arguments[0]?arguments[0]:fe.LARGE;this.convolutionMaterial.kernelSize=a;this.ditheredConvolutionMaterial.kernelSize=a}}]);H(b,a);return b}(xa);(function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,"BloomPass"));d.renderTarget=new Oa(1,1,{minFilter:1006,magFilter:1006,stencilBuffer:!1,depthBuffer:!1});d.renderTarget.texture.name="Bloom.Target";d.renderTarget.texture.generateMipmaps=!1;d.blurPass=new Jg(a);d.combineMaterial=
|
||
|
new Ig(void 0!==a.screenMode?a.screenMode:!0);d.intensity=a.intensity;d.luminosityMaterial=new Vj(!0);d.distinction=a.distinction;return d}z(b,[{key:"render",value:function(a,b,e,g,k){g=this.scene;k=this.camera;var c=this.blurPass,d=this.luminosityMaterial,m=this.combineMaterial,p=this.renderTarget;this.material=d;d.uniforms.tDiffuse.value=b.texture;a.render(g,k,p);c.render(a,p,p);this.blend&&(this.material=m,m.uniforms.texture1.value=b.texture,m.uniforms.texture2.value=p.texture,a.render(g,k,this.renderToScreen?
|
||
|
null:e))}},{key:"setSize",value:function(a,b){this.blurPass.setSize(a,b);a=this.blurPass.width;b=this.blurPass.height;this.renderTarget.setSize(a,b)}},{key:"initialize",value:function(a,b){this.blurPass.initialize(a,b);b||(this.renderTarget.texture.format=1022)}},{key:"resolutionScale",get:function(){return this.blurPass.resolutionScale},set:function(){this.blurPass.resolutionScale=0<arguments.length&&void 0!==arguments[0]?arguments[0]:.5}},{key:"kernelSize",get:function(){return this.blurPass.kernelSize},
|
||
|
set:function(){this.blurPass.kernelSize=0<arguments.length&&void 0!==arguments[0]?arguments[0]:fe.LARGE}},{key:"intensity",get:function(){return this.combineMaterial.uniforms.opacity2.value},set:function(){this.combineMaterial.uniforms.opacity2.value=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1}},{key:"distinction",get:function(){return this.luminosityMaterial.uniforms.distinction.value},set:function(){this.luminosityMaterial.uniforms.distinction.value=0<arguments.length&&void 0!==arguments[0]?
|
||
|
arguments[0]:1}},{key:"dithering",get:function(){return this.blurPass.dithering},set:function(a){this.blurPass.dithering=a}},{key:"blend",get:function(){return this.needsSwap},set:function(a){this.needsSwap=a}},{key:"overlay",get:function(){return this.renderTarget.texture}}]);H(b,a);return b})(xa);(function(a){function b(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};F(this,b);var e=N(this,D(b).call(this,"BokehPass"));e.material=new Hm(a,c);return e}z(b,[{key:"render",value:function(a,
|
||
|
b,e,g,k){this.material.uniforms.tDiffuse.value=b.texture;this.material.uniforms.tDepth.value=b.depthTexture;a.render(this.scene,this.camera,this.renderToScreen?null:e)}},{key:"setSize",value:function(a,b){this.material.uniforms.aspect.value=a/b}}]);H(b,a);return b})(xa);var Xm=function(a){function b(){F(this,b);var a=N(this,D(b).call(this,"ClearMaskPass",null,null,null));a.needsSwap=!1;return a}z(b,[{key:"render",value:function(a,b,e,g,k){a.state.buffers.stencil.setTest(!1)}}]);H(b,a);return b}(xa),
|
||
|
Wj=new S,Xj=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,"ClearPass",null,null,null));d.needsSwap=!1;d.clearColor=void 0!==a.clearColor?a.clearColor:null;d.clearAlpha=void 0!==a.clearAlpha?a.clearAlpha:0;return d}z(b,[{key:"render",value:function(a,b,e,g,k){e=this.clearColor;if(null!==e){Wj.copy(a.getClearColor());var c=a.getClearAlpha();a.setClearColor(e,this.clearAlpha)}a.setRenderTarget(this.renderToScreen?null:b);
|
||
|
a.clear();null!==e&&a.setClearColor(Wj,c)}}]);H(b,a);return b}(xa);(function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,"DotScreenPass"));d.material=new Lm(a);return d}z(b,[{key:"render",value:function(a,b,e,g,k){this.material.uniforms.tDiffuse.value=b.texture;a.render(this.scene,this.camera,this.renderToScreen?null:e)}},{key:"setSize",value:function(a,b){a=Math.max(1,a);b=Math.max(1,b);this.material.uniforms.offsetRepeat.value.z=
|
||
|
a;this.material.uniforms.offsetRepeat.value.w=b}}]);H(b,a);return b})(xa);(function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,"FilmPass"));d.material=new Mm(a);d.scanlineDensity=void 0===a.scanlineDensity?1.25:a.scanlineDensity;d.gridScale=void 0===a.gridScale?1:Math.max(a.gridScale,1E-6);d.gridLineWidth=void 0===a.gridLineWidth?0:Math.max(a.gridLineWidth,0);return d}z(b,[{key:"render",value:function(a,b,e,g,k){this.material.uniforms.tDiffuse.value=
|
||
|
b.texture;this.material.uniforms.time.value+=g;a.render(this.scene,this.camera,this.renderToScreen?null:e)}},{key:"setSize",value:function(a,b){var c=.125*this.gridScale*b;this.material.uniforms.scanlineCount.value=Math.round(b*this.scanlineDensity);this.material.uniforms.gridScale.value.set(a/b*c,c);this.material.uniforms.gridLineWidth.value=c/b+this.gridLineWidth}}]);H(b,a);return b})(xa);(function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,
|
||
|
D(b).call(this,"GlitchPass"));d.material=new Nm;d.texture=null;d.perturbMap=void 0!==a.perturbMap?a.perturbMap:d.generatePerturbMap(a.dtSize);d.perturbMap.name="Glitch.Perturbation";d.perturbMap.generateMipmaps=!1;d.mode=Kg.SPORADIC;d.counter=0;d.breakPoint=120+Math.floor(121*Math.random());return d}z(b,[{key:"generatePerturbMap",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:64,b=a*a,e=new Float32Array(3*b),g=this.perturbMap,k;for(k=0;k<b;++k){var l=Math.random();e[3*
|
||
|
k]=l;e[3*k+1]=l;e[3*k+2]=l}null!==g&&g.dispose();g=new Yb(e,a,a,1022,1015);g.needsUpdate=!0;return this.perturbMap=g}},{key:"render",value:function(a,b,e,g,k){g=this.mode;k=this.counter;var c=this.breakPoint,d=this.material.uniforms;d.tDiffuse.value=b.texture;d.seed.value=Math.random();d.active.value=!0;0===k%c||g===Kg.CONSTANT_WILD?(d.amount.value=Math.random()/30,d.angle.value=wb(-Math.PI,Math.PI),d.seedX.value=wb(-1,1),d.seedY.value=wb(-1,1),d.distortionX.value=wb(0,1),d.distortionY.value=wb(0,
|
||
|
1),this.breakPoint=120+Math.floor(121*Math.random()),this.counter=0):k%c<c/5||g===Kg.CONSTANT_MILD?(d.amount.value=Math.random()/90,d.angle.value=wb(-Math.PI,Math.PI),d.distortionX.value=wb(0,1),d.distortionY.value=wb(0,1),d.seedX.value=wb(-.3,.3),d.seedY.value=wb(-.3,.3)):d.active.value=!1;++this.counter;a.render(this.scene,this.camera,this.renderToScreen?null:e)}},{key:"perturbMap",get:function(){return this.texture},set:function(a){this.texture=a;this.material.uniforms.tPerturb.value=a}}]);H(b,
|
||
|
a);return b})(xa);var Kg={SPORADIC:0,CONSTANT_MILD:1,CONSTANT_WILD:2},ge=function(a){function b(a,d){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};F(this,b);var g=N(this,D(b).call(this,"RenderPass",a,d,null));g.needsSwap=!1;g.clearPass=new Xj(c);g.overrideMaterial=void 0!==c.overrideMaterial?c.overrideMaterial:null;g.clearDepth=void 0!==c.clearDepth?c.clearDepth:!1;g.clear=void 0!==c.clear?c.clear:!0;return g}z(b,[{key:"render",value:function(a,b,e,g,k){e=this.scene;g=this.renderToScreen?
|
||
|
null:b;k=e.overrideMaterial;this.clear?(this.clearPass.renderToScreen=this.renderToScreen,this.clearPass.render(a,b)):this.clearDepth&&(a.setRenderTarget(g),a.clearDepth());e.overrideMaterial=this.overrideMaterial;a.render(e,this.camera,g);e.overrideMaterial=k}}]);H(b,a);return b}(xa);(function(a){function b(a,d,e){var c=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};F(this,b);var k=N(this,D(b).call(this,"GodRaysPass"));k.lightScene=new xc;k.mainScene=a;k.mainCamera=d;k.renderTargetX=new Oa(1,
|
||
|
1,{minFilter:1006,magFilter:1006,stencilBuffer:!1,depthBuffer:!1});k.renderTargetX.texture.name="GodRays.TargetX";k.renderTargetX.texture.generateMipmaps=!1;k.renderTargetY=k.renderTargetX.clone();k.renderTargetY.texture.name="GodRays.TargetY";k.renderTargetMask=new Oa(1,1,{minFilter:1006,magFilter:1006});k.renderTargetMask.texture.name="GodRays.Mask";k.renderTargetMask.texture.generateMipmaps=!1;k.renderPassLight=new ge(k.lightScene,k.mainCamera,{clearColor:new S(0)});k.renderPassMask=new ge(k.mainScene,
|
||
|
k.mainCamera,{overrideMaterial:new Ua({color:0})});k.renderPassMask.clear=!1;k.blurPass=new Jg(c);k.lightSource=e;k.screenPosition=new p;k.godRaysMaterial=new Om(c);k.godRaysMaterial.uniforms.lightPosition.value=k.screenPosition;k.samples=c.samples;k.combineMaterial=new Ig(void 0!==c.screenMode?c.screenMode:!0);k.intensity=c.intensity;return k}z(b,[{key:"render",value:function(a,b,e,g,k){g=this.scene;k=this.camera;var c=this.mainScene,d=this.lightSource,m=this.screenPosition,p=this.godRaysMaterial,
|
||
|
q=this.combineMaterial,t=this.renderTargetMask,u=this.renderTargetX,v=this.renderTargetY;m.copy(d.position).project(this.mainCamera);m.x=Math.max(0,Math.min(1,.5*(m.x+1)));m.y=Math.max(0,Math.min(1,.5*(m.y+1)));var x=d.parent;m=c.background;c.background=null;this.lightScene.add(d);this.renderPassLight.render(a,t);this.renderPassMask.render(a,t);null!==x&&x.add(d);c.background=m;this.blurPass.render(a,this.renderTargetMask,u);this.material=p;p.uniforms.tDiffuse.value=u.texture;a.render(g,k,v);this.blend&&
|
||
|
(this.material=q,q.uniforms.texture1.value=b.texture,q.uniforms.texture2.value=v.texture,a.render(g,k,this.renderToScreen?null:e))}},{key:"setSize",value:function(a,b){this.renderPassLight.setSize(a,b);this.renderPassMask.setSize(a,b);this.blurPass.setSize(a,b);a=this.blurPass.width;b=this.blurPass.height;this.renderTargetMask.setSize(a,b);this.renderTargetX.setSize(a,b);this.renderTargetY.setSize(a,b)}},{key:"initialize",value:function(a,b){this.renderPassLight.initialize(a,b);this.renderPassMask.initialize(a,
|
||
|
b);this.blurPass.initialize(a,b);b||(this.renderTargetMask.texture.format=1022,this.renderTargetX.texture.format=1022,this.renderTargetY.texture.format=1022)}},{key:"resolutionScale",get:function(){return this.blurPass.resolutionScale},set:function(){this.blurPass.resolutionScale=0<arguments.length&&void 0!==arguments[0]?arguments[0]:.5}},{key:"kernelSize",get:function(){return this.blurPass.kernelSize},set:function(){this.blurPass.kernelSize=0<arguments.length&&void 0!==arguments[0]?arguments[0]:
|
||
|
fe.LARGE}},{key:"intensity",get:function(){return this.combineMaterial.uniforms.opacity2.value},set:function(){this.combineMaterial.uniforms.opacity2.value=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1}},{key:"samples",get:function(){return Number.parseInt(this.godRaysMaterial.defines.NUM_SAMPLES_INT)},set:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:60;a=Math.floor(a);this.godRaysMaterial.defines.NUM_SAMPLES_FLOAT=a.toFixed(1);this.godRaysMaterial.defines.NUM_SAMPLES_INT=
|
||
|
a.toFixed(0);this.godRaysMaterial.needsUpdate=!0}},{key:"dithering",get:function(){return this.godRaysMaterial.dithering},set:function(a){this.dithering!==a&&(this.godRaysMaterial.dithering=a,this.godRaysMaterial.needsUpdate=!0)}},{key:"blend",get:function(){return this.needsSwap},set:function(a){this.needsSwap=a}},{key:"overlay",get:function(){return this.renderTargetY.texture}}]);H(b,a);return b})(xa);var Ym=function(a){function b(a,d){F(this,b);a=N(this,D(b).call(this,"MaskPass",a,d,null));a.needsSwap=
|
||
|
!1;a.inverse=!1;a.clearStencil=!0;return a}z(b,[{key:"render",value:function(a,b,e,g,k){g=a.context;k=a.state;var c=this.scene,d=this.camera,m=this.inverse?0:1,p=1-m;k.buffers.color.setMask(!1);k.buffers.depth.setMask(!1);k.buffers.color.setLocked(!0);k.buffers.depth.setLocked(!0);k.buffers.stencil.setTest(!0);k.buffers.stencil.setOp(g.REPLACE,g.REPLACE,g.REPLACE);k.buffers.stencil.setFunc(g.ALWAYS,m,4294967295);k.buffers.stencil.setClear(p);this.clearStencil&&(this.renderToScreen?a.setRenderTarget(null):
|
||
|
(a.setRenderTarget(b),a.clearStencil(),a.setRenderTarget(e)),a.clearStencil());this.renderToScreen?a.render(c,d,null):(a.render(c,d,b),a.render(c,d,e));k.buffers.color.setLocked(!1);k.buffers.depth.setLocked(!1);k.buffers.stencil.setFunc(g.EQUAL,1,4294967295);k.buffers.stencil.setOp(g.KEEP,g.KEEP,g.KEEP)}}]);H(b,a);return b}(xa),Xe=function(a){function b(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"tDiffuse";F(this,b);var e=N(this,D(b).call(this,"ShaderPass"));e.material=a;e.textureID=
|
||
|
c;return e}z(b,[{key:"render",value:function(a,b,e,g,k){void 0!==this.material.uniforms[this.textureID]&&(this.material.uniforms[this.textureID].value=b.texture);a.render(this.scene,this.camera,this.renderToScreen?null:e)}}]);H(b,a);return b}(xa);(function(a){function b(a,d){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};F(this,b);var g=N(this,D(b).call(this,"OutlinePass"));g.mainScene=a;g.mainCamera=d;g.renderTargetDepth=new Oa(1,1,{minFilter:1006,magFilter:1006});g.renderTargetDepth.texture.name=
|
||
|
"Outline.Depth";g.renderTargetDepth.texture.generateMipmaps=!1;g.renderTargetMask=g.renderTargetDepth.clone();g.renderTargetMask.texture.format=1022;g.renderTargetMask.texture.name="Outline.Mask";g.renderTargetEdges=new Oa(1,1,{minFilter:1006,magFilter:1006,stencilBuffer:!1,depthBuffer:!1,format:1022});g.renderTargetEdges.texture.name="Outline.Edges";g.renderTargetEdges.texture.generateMipmaps=!1;g.renderTargetBlurredEdges=g.renderTargetEdges.clone();g.renderTargetBlurredEdges.texture.name="Outline.BlurredEdges";
|
||
|
g.renderPassDepth=new ge(g.mainScene,g.mainCamera,{overrideMaterial:new Ob({depthPacking:3201,morphTargets:!0,skinning:!0}),clearColor:new S(16777215),clearAlpha:1});g.renderPassMask=new ge(g.mainScene,g.mainCamera,{overrideMaterial:new Km(g.renderTargetDepth.texture,g.mainCamera),clearColor:new S(16777215),clearAlpha:1});g.blurPass=new Jg(c);g.kernelSize=c.kernelSize;g.copyPass=new Xe(new Xc);g.copyPass.renderToScreen=!0;g.outlineEdgesMaterial=new Qm(c);g.outlineEdgesMaterial.uniforms.tMask.value=
|
||
|
g.renderTargetMask.texture;g.outlineBlendMaterial=new Pm(c);g.outlineBlendMaterial.uniforms.tMask.value=g.renderTargetMask.texture;g.blur=void 0!==c.blur?c.blur:!0;g.selection=[];g.time=0;g.pulseSpeed=void 0!==c.pulseSpeed?c.pulseSpeed:0;g.selectionLayer=10;return g}z(b,[{key:"setPatternTexture",value:function(){this.outlineBlendMaterial.setPatternTexture(0<arguments.length&&void 0!==arguments[0]?arguments[0]:null)}},{key:"setSelection",value:function(a){a=a.slice(0);var b=this.selectionLayer,c;this.clearSelection();
|
||
|
var g=0;for(c=a.length;g<c;++g)a[g].layers.enable(b);this.selection=a;return this}},{key:"clearSelection",value:function(){var a=this.selection,b=this.selectionLayer,e;var g=0;for(e=a.length;g<e;++g)a[g].layers.disable(b);this.selection=[];this.time=0;return this}},{key:"selectObject",value:function(a){a.layers.enable(this.selectionLayer);this.selection.push(a);return this}},{key:"deselectObject",value:function(a){var b=this.selection;a=b.indexOf(a);0<=a&&(b[a].layers.disable(this.selectionLayer),
|
||
|
b.splice(a,1),0===b.length&&(this.time=0));return this}},{key:"setSelectionVisible",value:function(a){var b=this.selection,c;var g=0;for(c=b.length;g<c;++g)a?b[g].layers.enable(0):b[g].layers.disable(0)}},{key:"render",value:function(a,b,e,g,k){e=this.mainScene;k=this.mainCamera;var c=this.outlineBlendMaterial.uniforms.pulse;if(0<this.selection.length){var d=e.background;var m=k.layers.mask;e.background=null;c.value=1;0<this.pulseSpeed&&(c.value=.625+.375*Math.cos(this.time*this.pulseSpeed*10),this.time+=
|
||
|
g);this.setSelectionVisible(!1);this.renderPassDepth.render(a,this.renderTargetDepth);this.setSelectionVisible(!0);k.layers.mask=1<<this.selectionLayer;this.renderPassMask.render(a,this.renderTargetMask);k.layers.mask=m;e.background=d;this.material=this.outlineEdgesMaterial;a.render(this.scene,this.camera,this.renderTargetEdges);this.blurPass.enabled&&this.blurPass.render(a,this.renderTargetEdges,this.renderTargetBlurredEdges);this.blend&&(this.material=this.outlineBlendMaterial,this.outlineBlendMaterial.uniforms.tDiffuse.value=
|
||
|
b.texture,a.render(this.scene,this.camera,this.renderToScreen?null:this.outputBuffer))}else this.renderToScreen&&this.copyPass.render(a,b)}},{key:"setSize",value:function(a,b){this.renderTargetDepth.setSize(a,b);this.renderTargetMask.setSize(a,b);this.renderPassDepth.setSize(a,b);this.renderPassMask.setSize(a,b);this.blurPass.setSize(a,b);a=this.blurPass.width;b=this.blurPass.height;this.renderTargetEdges.setSize(a,b);this.renderTargetBlurredEdges.setSize(a,b);this.outlineBlendMaterial.uniforms.aspect.value=
|
||
|
a/b;this.outlineEdgesMaterial.setTexelSize(1/a,1/b)}},{key:"initialize",value:function(a,b){this.renderPassDepth.initialize(a,b);this.renderPassMask.initialize(a,b);this.blurPass.initialize(a,b)}},{key:"resolutionScale",get:function(){return this.blurPass.resolutionScale},set:function(){this.blurPass.resolutionScale=0<arguments.length&&void 0!==arguments[0]?arguments[0]:.5}},{key:"kernelSize",get:function(){return this.blurPass.kernelSize},set:function(){this.blurPass.kernelSize=0<arguments.length&&
|
||
|
void 0!==arguments[0]?arguments[0]:fe.VERY_SMALL}},{key:"blur",get:function(){return this.blurPass.enabled},set:function(a){this.blurPass.enabled=a;this.outlineBlendMaterial.uniforms.tEdges.value=a?this.renderTargetBlurredEdges.texture:this.renderTargetEdges.texture}},{key:"dithering",get:function(){return this.blurPass.dithering},set:function(a){this.blurPass.dithering=a}},{key:"blend",get:function(){return this.needsSwap},set:function(a){this.needsSwap=a}},{key:"overlay",get:function(){return this.outlineBlendMaterial.uniforms.tEdges.value}}]);
|
||
|
H(b,a);return b})(xa);(function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:30;F(this,b);var d=N(this,D(b).call(this,"PixelationPass"));d.material=new Rm;d.granularity=a;return d}z(b,[{key:"render",value:function(a,b,e,g,k){this.material.uniforms.tDiffuse.value=b.texture;a.render(this.scene,this.camera,this.renderToScreen?null:e)}},{key:"setSize",value:function(a,b){this.material.setResolution(a,b)}},{key:"granularity",get:function(){return this.material.granularity},
|
||
|
set:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:30;a=Math.floor(a);0<a%2&&(a+=1);this.material.granularity=a}}]);H(b,a);return b})(xa);(function(a){function b(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};F(this,b);var e=N(this,D(b).call(this,"RealisticBokehPass"));e.material=new Sm(a,c);return e}z(b,[{key:"render",value:function(a,b,e,g,k){this.material.uniforms.tDiffuse.value=b.texture;this.material.uniforms.tDepth.value=b.depthTexture;a.render(this.scene,
|
||
|
this.camera,this.renderToScreen?null:e)}},{key:"setSize",value:function(a,b){this.material.setTexelSize(1/a,1/b)}}]);H(b,a);return b})(xa);(function(a){function b(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;F(this,b);var e=N(this,D(b).call(this,"SavePass"));e.material=new Xc;e.needsSwap=!1;e.renderTarget=void 0!==a?a:new Oa(1,1,{minFilter:1006,magFilter:1006,stencilBuffer:!1,depthBuffer:!1});e.renderTarget.texture.name="Save.Target";e.renderTarget.texture.generateMipmaps=!1;
|
||
|
e.resize=c;return e}z(b,[{key:"render",value:function(a,b,e,g,k){this.material.uniforms.tDiffuse.value=b.texture;a.render(this.scene,this.camera,this.renderTarget)}},{key:"setSize",value:function(a,b){this.resize&&(a=Math.max(1,a),b=Math.max(1,b),this.renderTarget.setSize(a,b))}},{key:"initialize",value:function(a,b){b||(this.renderTarget.texture.format=1022)}}]);H(b,a);return b})(xa);var Zm=.5*Math.PI,Yj=new p,Zj=new p;(function(a){function b(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:
|
||
|
new p,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};F(this,b);var g=N(this,D(b).call(this,"ShockWavePass"));g.mainCamera=a;g.epicenter=c;g.screenPosition=new p;g.speed=void 0!==e.speed?e.speed:2;g.time=0;g.active=!1;g.shockWaveMaterial=new Tm(e);g.shockWaveMaterial.uniforms.center.value=g.screenPosition;g.copyMaterial=new Xc;return g}z(b,[{key:"explode",value:function(){this.time=0;this.active=!0}},{key:"render",value:function(a,b,e,g,k){k=this.epicenter;var c=this.mainCamera,d=this.screenPosition,
|
||
|
m=this.shockWaveMaterial,p=m.uniforms,q=p.center,t=p.radius,u=p.maxRadius,v=p.waveSize;this.copyMaterial.uniforms.tDiffuse.value=b.texture;this.material=this.copyMaterial;this.active&&(c.getWorldDirection(Yj),Zj.copy(c.position).sub(k),Yj.angleTo(Zj)>Zm&&(p.cameraDistance.value=c.position.distanceTo(k),d.copy(k).project(c),q.value.x=.5*(d.x+1),q.value.y=.5*(d.y+1),p.tDiffuse.value=b.texture,this.material=m),this.time+=g*this.speed,t.value=this.time-v.value,t.value>=2*(u.value+v.value)&&(this.active=
|
||
|
!1));a.render(this.scene,this.camera,this.renderToScreen?null:e)}},{key:"setSize",value:function(a,b){this.shockWaveMaterial.uniforms.aspect.value=a/b}}]);H(b,a);return b})(xa);(function(a){function b(a,d){F(this,b);var c=N(this,D(b).call(this,"SMAAPass"));c.clearPass=new Xj({clearColor:new S(0),clearAlpha:1});c.renderTargetColorEdges=new Oa(1,1,{minFilter:1006,format:1022,stencilBuffer:!1,depthBuffer:!1});c.renderTargetColorEdges.texture.name="SMAA.ColorEdges";c.renderTargetColorEdges.texture.generateMipmaps=
|
||
|
!1;c.renderTargetWeights=c.renderTargetColorEdges.clone();c.renderTargetWeights.texture.name="SMAA.Weights";c.renderTargetWeights.texture.format=1023;c.colorEdgesMaterial=new Im;c.weightsMaterial=new Vm;c.weightsMaterial.uniforms.tDiffuse.value=c.renderTargetColorEdges.texture;c.searchTexture=new ra(a);c.searchTexture.name="SMAA.Search";c.searchTexture.magFilter=1003;c.searchTexture.minFilter=1003;c.searchTexture.format=1023;c.searchTexture.generateMipmaps=!1;c.searchTexture.needsUpdate=!0;c.searchTexture.flipY=
|
||
|
!1;c.weightsMaterial.uniforms.tSearch.value=c.searchTexture;c.areaTexture=new ra(d);c.areaTexture.name="SMAA.Area";c.areaTexture.minFilter=1006;c.areaTexture.format=1023;c.areaTexture.generateMipmaps=!1;c.areaTexture.needsUpdate=!0;c.areaTexture.flipY=!1;c.weightsMaterial.uniforms.tArea.value=c.areaTexture;c.blendMaterial=new Um;c.blendMaterial.uniforms.tWeights.value=c.renderTargetWeights.texture;return c}z(b,[{key:"render",value:function(a,b,e,g,k){this.material=this.colorEdgesMaterial;this.colorEdgesMaterial.uniforms.tDiffuse.value=
|
||
|
b.texture;this.clearPass.render(a,this.renderTargetColorEdges);a.render(this.scene,this.camera,this.renderTargetColorEdges);this.material=this.weightsMaterial;a.render(this.scene,this.camera,this.renderTargetWeights);this.material=this.blendMaterial;this.blendMaterial.uniforms.tDiffuse.value=b.texture;a.render(this.scene,this.camera,this.renderToScreen?null:e)}},{key:"setSize",value:function(a,b){this.renderTargetColorEdges.setSize(a,b);this.renderTargetWeights.setSize(a,b);this.colorEdgesMaterial.uniforms.texelSize.value.copy(this.weightsMaterial.uniforms.texelSize.value.copy(this.blendMaterial.uniforms.texelSize.value.set(1/
|
||
|
a,1/b)))}}],[{key:"searchImageDataURL",get:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII"}},{key:"areaImageDataURL",get:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxgjApQqACYQORjtd/B7Axt/z79sC0+cMPgjjlwPwVwHcA+DfAHzTxcVgWBroqMN8+cYBeM71wH0TwKExYHYUWCIAHYRLTlkCYgcIBcAgU/n3qy8GRu4HRgnAOWBkERhddPAJhGJDBxkvw7cqimr+zFM/ZLnZF64cgL8BYD+AWwB8x/dlWuWagHiYL984AJ/0RWBy1AE4AizyM1yxYAcTigW55xMbAkxEiwEdkJ/ZCQxPAiOHgBECcKEC4TBZcKkSv+mTieNcNPNC26mLNsj45QD8LQDTAO4GcJt/7iw2bfoG4WG+vAGwm9ExiEg69zpg/wgwPQLMjgALzn4E4aIzoJjQ9g4024uygkj+pyuAoX0VAIfngOH5NgCHMhAm8Sv2y3XDZeBhNIp8OzJE8OsBzAKYBHAXgDt8/4O+MVT0j4f58o0D8Pxrgf3DwMwIMEPQEYRkNwfgsuuDZLskip0No0gWMD/9HGDoADAkAC4Aw/wsAgZAgs2Z0ABI0GU6IVmKv+f28KDnHxkA/G0A8y6G73N9kOCjXnh/Ebb6OvgwX75xAF5wLTA1VIHPADgMLDj4yIA5AAm6aCUnv4oz46eeDwxNAUMzwJAz4BABSNDFTwSfg7DDKHE23MG5PqIY8A1u/dINs9dBdy8AgnGPM2NfUBrsnw7z5RsH4IXXAAcJviFgluAbygBINnSLWOAjGxJ4pgOKDV0v/OSLKp8iGXBovhLBBOCQM2ACoTOhnYrAdItYbCij5JFzRyIAqRccAnDAQUjg6UNQ7hsMXP0cRQAexss3DsCLCECCLwCQzMcPwUi2MwAScAKbfnY/YRLFQ8DHX+IAJAMSfDkAF13kLvleIjhjQQHxUVS3jjgGpKeeNzYVQEjgUS8k+PghONdhIwAP4+XXBYCHKIJbwJyDTgaIAdCBJx3Q2M8tYAHP9m4df/ylQOsQ0JqtRLCx30K1wtLBggScQOgsKBGcWHAJeOwRC0BSM1mQIKRbhh+Bj98JQP6t4U0APEyXXxcAEnxkQAFwoVUxID9kvQg+c1C7vidRbIDkc24B//hTQGumDcCWA5DgMxASdNIFBUI5pCML8v8API5zfEQx4BudgqiczviSnJhQwCP4BMCGl+wO8+U7AJi/W4O4YS6+pmK/2ciADsAOBhTIIiAJnPB7AvNjP+0AnANaYkAHX2JBAc+tYaJXOqBZv24Vc386XW5dtkHGW+4HFAJonpOe+YYQZAShgKjv3PNvPQaxVoI8zJdfFwASfPzMUwS3Kt1v0UFIlos6oDFdAGFcliMAP/ryAEAGNwQRnDOgLbdlIEwrIs6AZ/QgkMMHQF6ZAKQcJAsSYPwIeAIk9wJgoPK1gi7+PwF4GC/fOAAvIQPSs0URTPBJ/Pp3GSEGRHfBCIQ0xowBtUbcAj7ys5X4Jfu1HIAGQrIgQRXEsAFQIORDFhiDY/rMHmrU4QUgR08AkgUjCAW6CD6CkwBsAIQC4GG6fPMA3OXiNzCg2I9gNCMksmAAoemDzoimFwL48M85AKkiuQVMAAp8CYRRDAt8GQiJ67N6GJODAXAHlsGguscA2AJg1IPGYmxOpBxFWkRN9LsATgIwXnNs/v/5z/9XCf8BO3YAtxbc/46/KDt+5+ea1Yku2VUxHz/z0v24FwMGK1gWsK2OUUxHHdCBeRUB6OxHABr4ZICIBd0QWSF+XRdMTAjgCdTrG9cBNwE4F8CpDkICyYLGsuhFt6zs+gISwUen8zEAjgMw4cfx2H6O/90yAFo84Cbg4ID3/9TfLTt+5+ebnRABkODjx0SwPi5ec/FrYpmqSAxM8Dn60CsqAFI6GfhqAMiDE/gokmvEr0C4PgDkBQm40wE8zMFEUDKEVoxIMLl/KS73mE7H9d+vcKHQQcjwW0Yu9nP8m8sAmOIBuWY6wP2/4s0ezjjg8TuvaR6ABJ70vxUApGrm7EbGE+i472BAB+WHfqHS/eoAaEwY2E9+wLSXTqhI7CXgnB6LCoOJ4BiST+hTnG0HcCwAglCx3ARoZEVFXnBPp/O/A/hXACc7CPs9/i1lAOyIB+RDX+P9/+pbQjjjAMfv/PL6AFDs1wFAgs/9fgKfgdE/ZEpuiQlbwAde6QAMBgiRmsSwA9BY0JfjovGRDBMH4TlcXGhcBOc6HkF0gjPhZgchxTLZMAci/04W/B6Ab3t09EPXcPyflgFwRTwgJ2MN9/8bf5qFM67x+B/aW4XQz42FeL0YrRyikztUFw0704mf9kXgxhOAqc3AAsPyRxxQCs/PdXOFY0W1KHy3QIUGtx+6vdnx1vsB+dsTncm2AogglFgVEAlUWrOMB2RyEmMCGQ/Y7/HvKns6tfGAnJQ+r/9b76oJZ1zD8WdyQjYBh8aBhVEHjELouQ8ukQ7VRSCJAALwkr+sALhnGzDD3JAJYJHg9uhoi4bx8ytkWUtvHT/7+Zc4dw1uZ3612fH2dkQf7yxIEEockwkJQn4IQoq8unhAhmPRKKFx0uv4K8ueTs94wD7u//VX9ghn7OP4c+4G7h8HpseB+dF2AKlFLwuAIZ8jD6NPrOhAffmfA9/ZBuzZCkyRWSeqBCWyoYGQ5yQrBpDbum/ME1HoPo0XEkSD2zlfbna8q6+EUJcTCxKEtHL5EQjP6BEPyIgYAZBvYt3xHyx7OqvGA65y/7/9wVXCGVc5/sl7qxD66dEqiYgRzAqhN1A4CBNAAlDyAFI+iZ9/N3DLJuC+jcDUBmCWyUnOrmTYCMIOkNclLg0B8/RsNLg9+UvNjnd1APLmmQpFHyEBROuWACQT8nN+H/GAvY7/VNnT6SsesMf13/CpahGnZzhjj+PPmwX2MYdDIfQexWyBAwEUOQDrRDN/98p3A7dvAO6fAA5sqHJDBEAyoUVGkwEd6HR12XU4kwzfl6fCXTZzjy57vvnR513X7Hj7AyDvggAUi9EyFgiZqNxPQF6345nOWbD1HQ/Y5fpvuLa/2+82/vNHgAPDFQDnhoF5j2C2qBWCI8bw1eRw5CL5l94L3DEOTI4DB8Y9OWmsEu/zBJ3rgsaybqBob/7A4C7jtWcooRrczr+u2fH2D0AOQgAUCxKEP7aGgLy64+m6KdjWFA9Yc/03/Osa4glrjr+AupqHz1sEs0cxG0BC9HIePLoit9eNkVf9L+DuUWByDJgaq4ybGYLPAWgiXmLedUE7dwC7saL7CqfPKXi4NYdaykCD410bAHlDEsNiwZ9wAPYbkJcfz6T2gm3N8YDZ9
|
||
|
H(b,a);return b})(xa);(function(a){function b(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1,e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!0;F(this,b);var g=N(this,D(b).call(this,"TexturePass"));g.material=new Ig(e);g.texture=a;g.opacitySource=c;return g}z(b,[{key:"render",value:function(a,b,e,g,k){this.material.uniforms.texture1.value=b.texture;a.render(this.scene,this.camera,this.renderToScreen?null:e)}},{key:"texture",get:function(){return this.material.uniforms.texture2.value},
|
||
|
set:function(a){this.material.uniforms.texture2.value=a}},{key:"opacityDestination",get:function(){return this.material.uniforms.opacity1.value},set:function(){this.material.uniforms.opacity1.value=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1}},{key:"opacitySource",get:function(){return this.material.uniforms.opacity2.value},set:function(){this.material.uniforms.opacity2.value=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1}}]);H(b,a);return b})(xa);(function(a){function b(){var a=
|
||
|
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,"ToneMappingPass"));d.renderTargetLuminosity=new Oa(1,1,{minFilter:1008,magFilter:1006,format:1022,stencilBuffer:!1,depthBuffer:!1});d.renderTargetLuminosity.texture.name="ToneMapping.Luminosity";d.renderTargetAdapted=d.renderTargetLuminosity.clone();d.renderTargetAdapted.texture.name="ToneMapping.AdaptedLuminosity";d.renderTargetAdapted.texture.generateMipmaps=!1;d.renderTargetAdapted.texture.minFilter=
|
||
|
1006;d.renderTargetPrevious=d.renderTargetAdapted.clone();d.renderTargetPrevious.texture.name="ToneMapping.PreviousLuminosity";d.copyMaterial=new Xc;d.luminosityMaterial=new Vj;d.luminosityMaterial.uniforms.distinction.value=void 0!==a.distinction?a.distinction:1;d.adaptiveLuminosityMaterial=new Gm;d.resolution=a.resolution;d.toneMappingMaterial=new Wm;d.adaptive=a.adaptive;return d}z(b,[{key:"render",value:function(a,b,e,g,k){k=this.scene;var c=this.camera,d=this.adaptiveLuminosityMaterial,m=this.luminosityMaterial,
|
||
|
p=this.toneMappingMaterial,q=this.copyMaterial,t=this.renderTargetPrevious,u=this.renderTargetLuminosity,v=this.renderTargetAdapted;this.adaptive&&(this.material=m,m.uniforms.tDiffuse.value=b.texture,a.render(k,c,u),this.material=d,d.uniforms.delta.value=g,d.uniforms.tPreviousLum.value=t.texture,d.uniforms.tCurrentLum.value=u.texture,a.render(k,c,v),this.material=q,q.uniforms.tDiffuse.value=v.texture,a.render(k,c,t));this.material=p;p.uniforms.tDiffuse.value=b.texture;a.render(this.scene,this.camera,
|
||
|
this.renderToScreen?null:e)}},{key:"initialize",value:function(a,b){this.material=new Ua({color:8388607});a.render(this.scene,this.camera,this.renderTargetPrevious);this.material.dispose()}},{key:"resolution",get:function(){return this.renderTargetLuminosity.width},set:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:256,b=Math.max(0,Math.ceil(Math.log2(a)));a=Math.pow(2,b);this.renderTargetLuminosity.setSize(a,a);this.renderTargetPrevious.setSize(a,a);this.renderTargetAdapted.setSize(a,
|
||
|
a);this.adaptiveLuminosityMaterial.defines.MIP_LEVEL_1X1=b.toFixed(1);this.adaptiveLuminosityMaterial.needsUpdate=!0}},{key:"adaptive",get:function(){return void 0!==this.toneMappingMaterial.defines.ADAPTED_LUMINANCE},set:function(){(0<arguments.length&&void 0!==arguments[0]?arguments[0]:1)?(this.toneMappingMaterial.defines.ADAPTED_LUMINANCE="1",this.toneMappingMaterial.uniforms.luminanceMap.value=this.renderTargetAdapted.texture):(delete this.toneMappingMaterial.defines.ADAPTED_LUMINANCE,this.toneMappingMaterial.uniforms.luminanceMap.value=
|
||
|
null);this.toneMappingMaterial.needsUpdate=!0}},{key:"dithering",get:function(){return this.toneMappingMaterial.dithering},set:function(a){this.dithering!==a&&(this.toneMappingMaterial.dithering=a,this.toneMappingMaterial.needsUpdate=!0)}}]);H(b,a);return b})(xa);var $m=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};F(this,a);this.renderer=b;this.outputBuffer=this.inputBuffer=null;null!==this.renderer&&
|
||
|
(this.renderer.autoClear=!1,this.inputBuffer=this.createBuffer(void 0!==c.depthBuffer?c.depthBuffer:!0,void 0!==c.stencilBuffer?c.stencilBuffer:!1,void 0!==c.depthTexture?c.depthTexture:!1),this.outputBuffer=this.inputBuffer.clone());this.copyPass=new Xe(new Xc);this.passes=[]}z(a,[{key:"replaceRenderer",value:function(a){var b=this.renderer;if(null!==b&&b!==a){this.renderer=a;this.renderer.autoClear=!1;var d=b.domElement.parentNode;var e=b.getSize();var g=a.getSize();null!==d&&(d.removeChild(b.domElement),
|
||
|
d.appendChild(a.domElement));e.width===g.width&&e.height===g.height||this.setSize()}return b}},{key:"createBuffer",value:function(a,c,d){var b=this.renderer.getDrawingBufferSize(),g=this.renderer.context.getContextAttributes().alpha;a=new Oa(b.width,b.height,{minFilter:1006,magFilter:1006,format:g?1023:1022,depthBuffer:a,stencilBuffer:c,depthTexture:d?new gd:null});d&&c&&(a.depthTexture.format=1027,a.depthTexture.type=1020);a.texture.name="EffectComposer.Buffer";a.texture.generateMipmaps=!1;return a}},
|
||
|
{key:"addPass",value:function(a,c){var b=this.renderer,e=b.getDrawingBufferSize();a.setSize(e.width,e.height);a.initialize(b,b.context.getContextAttributes().alpha);void 0!==c?this.passes.splice(c,0,a):this.passes.push(a)}},{key:"removePass",value:function(a){this.passes.splice(this.passes.indexOf(a),1)}},{key:"render",value:function(a){var b=this.passes,d=this.copyPass,e=this.renderer,g=this.inputBuffer,k=this.outputBuffer,l=!1,n;var m=0;for(n=b.length;m<n;++m){var p=b[m];if(p.enabled){p.render(e,
|
||
|
g,k,a,l);if(p.needsSwap){if(l){d.renderToScreen=p.renderToScreen;var q=e.context;var t=e.state;t.buffers.stencil.setFunc(q.NOTEQUAL,1,4294967295);d.render(e,g,k,a,l);t.buffers.stencil.setFunc(q.EQUAL,1,4294967295)}q=g;g=k;k=q}p instanceof Ym?l=!0:p instanceof Xm&&(l=!1)}}}},{key:"setSize",value:function(a,c){var b=this.passes,e=this.renderer;if(void 0===a||void 0===c)c=e.getSize(),a=c.width,c=c.height;e.setSize(a,c);a=e.getDrawingBufferSize();this.inputBuffer.setSize(a.width,a.height);this.outputBuffer.setSize(a.width,
|
||
|
a.height);e=0;for(c=b.length;e<c;++e)b[e].setSize(a.width,a.height)}},{key:"reset",value:function(){var a=this.createBuffer(this.inputBuffer.depthBuffer,this.inputBuffer.stencilBuffer,null!==this.inputBuffer.depthTexture);this.dispose();this.inputBuffer=a;this.outputBuffer=a.clone();this.copyPass=new Xe(new Xc)}},{key:"dispose",value:function(){var a=this.passes,c;var d=0;for(c=a.length;d<c;++d)a[d].dispose();this.passes=[];null!==this.inputBuffer&&(this.inputBuffer.dispose(),this.inputBuffer=null);
|
||
|
null!==this.outputBuffer&&(this.outputBuffer.dispose(),this.outputBuffer=null);this.copyPass.dispose()}},{key:"depthTexture",get:function(){return this.inputBuffer.depthTexture},set:function(a){this.inputBuffer.depthTexture=a;this.outputBuffer.depthTexture=a}}]);return a}(),ak=function(a,b){a[b]||((2<arguments.length&&void 0!==arguments[2]?arguments[2]:1)&&console.warn("@PostProcessorModule: pass.".concat(b,"() was not found."),a),a[b]=function(){})},bk=function(){function a(){var b=this,c=0<arguments.length&&
|
||
|
void 0!==arguments[0]?arguments[0]:a.defaults;F(this,a);L(L(this,"currentPass",null),"defer",new Promise(function(a){b.resolve=a}));this.debug=c.debug;this.params=c}z(a,[{key:"manager",value:function(a){var b=this;a.define("postprocessor");this.effects=a.use("rendering").effects;this.renderer=a.get("renderer");this.scene=a.get("scene");this.camera=a.get("camera");this.composer=new $m(this.renderer,this.params);a.use("rendering").stop();var d=this.composer;this.renderLoop=(new Wc(function(a){return d.render(a.getDelta())})).start(a.handler);
|
||
|
a.update({renderer:function(a){b.composer.replaceRenderer(a)},scene:function(a){b.scene=a},camera:function(a){b.camera=a}});this.resolve()}},{key:"render",value:function(){var a=this;this.defer.then(function(){var b=new ge(a.scene,a.camera.native);a.composer.addPass(b);a.currentPass=b});return this}},{key:"pass",value:function(a){var b=this;this.defer.then(function(){ak(a,"setSize",b.debug);ak(a,"initialise",b.debug);b.composer.addPass(a);b.currentPass=a});return this}},{key:"shader",value:function(a){var b=
|
||
|
this,d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"readBuffer";this.defer.then(function(){a.uniforms[d]||(a.uniforms[d]={value:null});var c=new Xe(a,d);b.composer.addPass(c);b.currentPass=c});return this}},{key:"get",value:function(a){return a?this.composer.passes.filter(function(b){return b.name===a})[0]:this.currentPass}},{key:"renderToScreen",value:function(){var a=this,c=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!0;this.defer.then(function(){a.currentPass.renderToScreen=
|
||
|
c});return this}}]);return a}();L(bk,"defaults",{debug:!0});var Lg=function(){function a(){F(this,a)}z(a,[{key:"manager",value:function(a){a.define("events");this.element=a.get("renderer").domElement}},{key:"patchEvents",value:function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this;(2<arguments.length&&void 0!==arguments[2]?arguments[2]:[]).forEach(function(c){return a.addEventListener(c,function(a){return b.emit(c,a)})})}},{key:"integrate",value:function(a){var b=a.patchEvents;
|
||
|
b(a.element,this,"mousemove mouseup contextmenu mousedown click wheel touchstart touchend touchmove keydown keyup keypress".split(" "))}}]);return a}(),an=function(a){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1;F(this,b);var d=N(this,D(b).call(this));L(L(L(L(L(aa(aa(d)),"mouse",new x),"raycaster",new Gh),"world",null),"canvas",null),"projectionPlane",new ib(new p(0,0,1),0));d.globalMovement=a;return d}z(b,[{key:"update",value:function(a,b,e){var c=this.canvas.getBoundingClientRect();
|
||
|
e=e||a.clientY;this.mouse.x=((b||a.clientX)-c.left)/(c.right-c.left)*2-1;this.mouse.y=2*-((e-c.top)/(c.bottom-c.top))+1;this.projectionPlane.normal.copy(this.camera.getWorldDirection());this.raycaster.setFromCamera(this.mouse,this.camera);this.emit("move")}},{key:"manager",value:function(a){a.define("mouse");a.require("events",function(){return new Lg});this.canvas=a.get("renderer").domElement;this.camera=a.get("camera").native}},{key:"integrate",value:function(a){var b=this;["click","mousedown",
|
||
|
"mouseup","mousemove"].forEach(function(c){return b.on(c,function(b){return a.emit(c,b)})});a.globalX=0;a.globalY=0;this.on("mousemove",function(b){null!==document.pointerLockElement?(a.globalX+=b.movementX,a.globalY+=b.movementY,a.update(b,a.globalX,a.globalY)):a.update(b)})}},{key:"track",value:function(a){var b=this,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0,g=!1;this.on("move",function(){b.hovers(a,c)?g?a.emit("mousemove"):(a.emit("mouseover"),g=!0):g&&(a.emit("mouseout"),g=!1)});
|
||
|
this.on("click",function(){g?a.emit("click"):a.emit("offClick")});this.on("mousedown",function(){g&&a.emit("mousedown")});this.on("mouseup",function(){g&&a.emit("mouseup")})}},{key:"intersection",value:function(a){var b=a.native,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;if(0<b.children.length&&c){var g=[];b.traverse(function(a){return g.push(a)});return this.raycaster.intersectObjects(g)}return this.raycaster.intersectObject(b)}},{key:"project",value:function(){return this.raycaster.ray.intersectPlane(0<
|
||
|
arguments.length&&void 0!==arguments[0]?arguments[0]:this.projectionPlane,1<arguments.length?arguments[1]:void 0)}},{key:"hovers",value:function(a){return 0<this.intersection(a,1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0).length}},{key:"ray",get:function(){return this.raycaster.ray}},{key:"x",get:function(){return this.mouse.x}},{key:"y",get:function(){return this.mouse.y}}]);H(b,a);return b}(Xi),ck=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:
|
||
|
{};F(this,a);this.params=Object.assign({controls:!1,fix:function(a){return a},update:function(a){this.controls.update(a.getDelta())}},b);this.controls=this.params.controls;this.update=this.params.update}z(a,null,[{key:"from",value:function(b){return new a({controls:b})}}]);z(a,[{key:"manager",value:function(a){a.define("controls");a.require("events",function(){return new Lg})}},{key:"setControls",value:function(a){this.controls=a;return this}},{key:"setUpdate",value:function(a){this.update=a;return this}},
|
||
|
{key:"integrate",value:function(a){a.updateLoop=new Wc(a.update.bind(a));a.updateLoop.start(this)}}]);return a}(),bn=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=1<arguments.length?arguments[1]:void 0;F(this,a);this.params=Object.assign({color:15716789,density:.02,near:10,far:1E3},b);c&&"exp2"!==c?"linear"===c&&(this.fog=new wc(this.params.color,this.params.near,this.params.far)):this.fog=new vc(this.params.color,this.params.density)}z(a,[{key:"manager",
|
||
|
value:function(a){a.set("fog",this.fog);a.get("scene").fog=this.fog}}]);return a}(),cn=function(a,b){return a===b||a&&a.equals&&a.equals(b)?!0:!1},dn=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:cn;F(this,a);this.store=Mf(a.actionGenerate(b));this.configuration={};this.prevConfig=this.currentConfig="default"}z(a,null,[{key:"actionGenerate",value:function(a){return function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[{},""],d=1<arguments.length?
|
||
|
arguments[1]:void 0,e=d.key;d=d.data;if(a(b[0][e],d))return b;b[0][e]=d;b[1]=e;return b}}}]);z(a,[{key:"default",value:function(a){this.config({default:a});return this}},{key:"setEqualCheck",value:function(b){this.store.replaceReducer(a.actionGenerate(b))}},{key:"manager",value:function(a){a.define("state")}},{key:"config",value:function(a){for(var b in a)b&&(this.configuration[b]="default"===b?a[b]:Object.assign({},this.configuration.default,a[b]))}},{key:"update",value:function(){var a=this,c=0<
|
||
|
arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.store.subscribe(function(){var b=a.store.getState(),e=fj(b,2);b=e[0];e=e[1];var g=c[e];g&&g(b[e])})}},{key:"to",value:function(a){this.prevConfig=this.currentConfig;this.currentConfig=a;this.set(this.configuration[a]?this.configuration[a]:this.configuration.default)}},{key:"set",value:function(a){for(var b in a)b&&this.store.dispatch({type:"ADD",key:b,data:a[b]})}},{key:"get",value:function(a){return this.store.getState()[0][a]}},{key:"prev",
|
||
|
value:function(a,c,d){return this.prevConfig===a?c:d}},{key:"current",value:function(a,c,d){return this.currentConfig===a?c:d}}]);return a}(),en=function(a){function b(a,d,e){F(this,b);var c=N(this,D(b).call(this));c.object=a;c.domElement=void 0===d?document:d;c.eventHandler=e;c.enabled=!0;c.target=new p;c.minDistance=0;c.maxDistance=Infinity;c.minZoom=0;c.maxZoom=Infinity;c.minPolarAngle=0;c.maxPolarAngle=Math.PI;c.minAzimuthAngle=-Infinity;c.maxAzimuthAngle=Infinity;c.enableDamping=!1;c.dampingFactor=
|
||
|
.25;c.enableZoom=!0;c.zoomSpeed=1;c.enableRotate=!0;c.rotateSpeed=1;c.enablePan=!0;c.keyPanSpeed=7;c.autoRotate=!1;c.autoRotateSpeed=2;c.enableKeys=!0;c.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40};c.mouseButtons={ORBIT:0,ZOOM:1,PAN:2};c.target0=c.target.clone();c.position0=c.object.position.clone();c.zoom0=c.object.zoom;c.getPolarAngle=function(){return t.phi};c.getAzimuthalAngle=function(){return t.theta};c.reset=function(){c.target.copy(c.target0);c.object.position.copy(c.position0);c.object.zoom=c.zoom0;
|
||
|
c.object.updateProjectionMatrix();c.dispatchEvent(k);c.update();q=m.NONE};c.update=function(){var b=new p,d=(new sa).setFromUnitVectors(a.up,new p(0,1,0)),e=d.clone().inverse(),g=new p,l=new sa;var n=c.object.position;b.copy(n).sub(c.target);b.applyQuaternion(d);t.setFromVector3(b);c.autoRotate&&q===m.NONE&&(u.theta-=2*Math.PI/60/60*c.autoRotateSpeed);t.theta+=u.theta;t.phi+=u.phi;t.theta=Math.max(c.minAzimuthAngle,Math.min(c.maxAzimuthAngle,t.theta));t.phi=Math.max(c.minPolarAngle,Math.min(c.maxPolarAngle,
|
||
|
t.phi));t.makeSafe();t.radius*=v;t.radius=Math.max(c.minDistance,Math.min(c.maxDistance,t.radius));c.target.add(y);b.setFromSpherical(t);b.applyQuaternion(e);n.copy(c.target).add(b);c.object.lookAt(c.target);!0===c.enableDamping?(u.theta*=1-c.dampingFactor,u.phi*=1-c.dampingFactor):u.set(0,0,0);v=1;y.set(0,0,0);z||g.distanceToSquared(c.object.position)>w||8*(1-l.dot(c.object.quaternion))>w?(c.dispatchEvent(k),g.copy(c.object.position),l.copy(c.object.quaternion),z=!1,b=!0):b=!1;return b};c.dispose=
|
||
|
function(){c.domElement.removeEventListener("contextmenu",W,!1);c.domElement.removeEventListener("mousedown",U,!1);c.domElement.removeEventListener("wheel",aa,!1);c.domElement.removeEventListener("touchstart",ca,!1);c.domElement.removeEventListener("touchend",ea,!1);c.domElement.removeEventListener("touchmove",da,!1);document.removeEventListener("mousemove",Y,!1);document.removeEventListener("mouseup",Z,!1);window.removeEventListener("keydown",ba,!1)};var k={type:"change"},l={type:"start"},n={type:"end"},
|
||
|
m={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},q=m.NONE,w=1E-6,t=new If,u=new If,v=1,y=new p,z=!1,C=new x,B=new x,G=new x,H=new x,I=new x,J=new x,K=new x,L=new x,O=new x,P=function(){return Math.pow(.95,c.zoomSpeed)},R=function(){var a=new p;return function(b,c){a.setFromMatrixColumn(c,0);a.multiplyScalar(-b);y.add(a)}}(),S=function(){var a=new p;return function(b,c){a.setFromMatrixColumn(c,1);a.multiplyScalar(b);y.add(a)}}(),T=function(){var a=new p;return function(b,
|
||
|
d){var e=c.domElement===document?c.domElement.body:c.domElement;if(c.object instanceof Ba){a.copy(c.object.position).sub(c.target);var g=a.length();g*=Math.tan(c.object.fov/2*Math.PI/180);R(2*b*g/e.clientHeight,c.object.matrix);S(2*d*g/e.clientHeight,c.object.matrix)}else c.object instanceof qb?(R(b*(c.object.right-c.object.left)/c.object.zoom/e.clientWidth,c.object.matrix),S(d*(c.object.top-c.object.bottom)/c.object.zoom/e.clientHeight,c.object.matrix)):(console.warn("WARNING: OrbitControlsModule.js encountered an unknown camera type - pan disabled."),
|
||
|
c.enablePan=!1)}}(),V=function(a){c.object instanceof Ba?v/=a:c.object instanceof qb?(c.object.zoom=Math.max(c.minZoom,Math.min(c.maxZoom,c.object.zoom*a)),c.object.updateProjectionMatrix(),z=!0):(console.warn("WARNING: OrbitControlsModule.js encountered an unknown camera type - dolly/zoom disabled."),c.enableZoom=!1)},X=function(a){c.object instanceof Ba?v*=a:c.object instanceof qb?(c.object.zoom=Math.max(c.minZoom,Math.min(c.maxZoom,c.object.zoom/a)),c.object.updateProjectionMatrix(),z=!0):(console.warn("WARNING: OrbitControlsModule.js encountered an unknown camera type - dolly/zoom disabled."),
|
||
|
c.enableZoom=!1)},U=function(a){if(!1!==c.enabled){a.preventDefault();if(a.button===c.mouseButtons.ORBIT){if(!1===c.enableRotate)return;C.set(a.clientX,a.clientY);q=m.ROTATE}else if(a.button===c.mouseButtons.ZOOM){if(!1===c.enableZoom)return;K.set(a.clientX,a.clientY);q=m.DOLLY}else if(a.button===c.mouseButtons.PAN){if(!1===c.enablePan)return;H.set(a.clientX,a.clientY);q=m.PAN}q!==m.NONE&&(c.eventHandler.on("mousemove",Y,!1),c.eventHandler.on("mouseup",Z,!1),c.dispatchEvent(l))}},Y=function(a){!1!==
|
||
|
c.enabled&&(a.preventDefault(),q===m.ROTATE?!1!==c.enableRotate&&(B.set(a.clientX,a.clientY),G.subVectors(B,C),a=c.domElement===document?c.domElement.body:c.domElement,u.theta-=2*Math.PI*G.x/a.clientWidth*c.rotateSpeed,u.phi-=2*Math.PI*G.y/a.clientHeight*c.rotateSpeed,C.copy(B),c.update()):q===m.DOLLY?!1!==c.enableZoom&&(L.set(a.clientX,a.clientY),O.subVectors(L,K),0<O.y?V(P()):0>O.y&&X(P()),K.copy(L),c.update()):q===m.PAN&&!1!==c.enablePan&&(I.set(a.clientX,a.clientY),J.subVectors(I,H),T(J.x,J.y),
|
||
|
H.copy(I),c.update()))},Z=function ll(a){!1!==c.enabled&&(document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",ll,!1),c.dispatchEvent(n),q=m.NONE)},aa=function(a){!1===c.enabled||!1===c.enableZoom||q!==m.NONE&&q!==m.ROTATE||(a.preventDefault(),a.stopPropagation(),0>a.deltaY?X(P()):0<a.deltaY&&V(P()),c.update(),c.dispatchEvent(l),c.dispatchEvent(n))},ba=function(a){if(!1!==c.enabled&&!1!==c.enableKeys&&!1!==c.enablePan)switch(a.keyCode){case c.keys.UP:T(0,c.keyPanSpeed);
|
||
|
c.update();break;case c.keys.BOTTOM:T(0,-c.keyPanSpeed);c.update();break;case c.keys.LEFT:T(c.keyPanSpeed,0);c.update();break;case c.keys.RIGHT:T(-c.keyPanSpeed,0),c.update()}},ca=function(a){if(!1!==c.enabled){switch(a.touches.length){case 1:if(!1===c.enableRotate)return;C.set(a.touches[0].pageX,a.touches[0].pageY);q=m.TOUCH_ROTATE;break;case 2:if(!1===c.enableZoom)return;var b=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;K.set(0,Math.sqrt(b*b+a*a));q=m.TOUCH_DOLLY;
|
||
|
break;case 3:if(!1===c.enablePan)return;H.set(a.touches[0].pageX,a.touches[0].pageY);q=m.TOUCH_PAN;break;default:q=m.NONE}q!==m.NONE&&c.dispatchEvent(l)}},da=function(a){if(!1!==c.enabled)switch(a.preventDefault(),a.stopPropagation(),a.touches.length){case 1:if(!1===c.enableRotate)break;if(q!==m.TOUCH_ROTATE)break;B.set(a.touches[0].pageX,a.touches[0].pageY);G.subVectors(B,C);var b=c.domElement===document?c.domElement.body:c.domElement;u.theta-=2*Math.PI*G.x/b.clientWidth*c.rotateSpeed;u.phi-=2*Math.PI*
|
||
|
G.y/b.clientHeight*c.rotateSpeed;C.copy(B);c.update();break;case 2:if(!1===c.enableZoom)break;if(q!==m.TOUCH_DOLLY)break;b=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;L.set(0,Math.sqrt(b*b+a*a));O.subVectors(L,K);0<O.y?X(P()):0>O.y&&V(P());K.copy(L);c.update();break;case 3:if(!1===c.enablePan)break;if(q!==m.TOUCH_PAN)break;I.set(a.touches[0].pageX,a.touches[0].pageY);J.subVectors(I,H);T(J.x,J.y);H.copy(I);c.update();break;default:q=m.NONE}},ea=function(a){!1!==c.enabled&&
|
||
|
(c.dispatchEvent(n),q=m.NONE)},W=function(a){a.preventDefault()};c.eventHandler.on("contextmenu",W,!1);c.eventHandler.on("mousedown",U,!1);c.eventHandler.on("wheel",aa,!1);c.eventHandler.on("touchstart",ca,!1);c.eventHandler.on("touchend",ea,!1);c.eventHandler.on("touchmove",da,!1);c.eventHandler.on("keydown",ba,!1);c.update();return c}z(b,[{key:"center",get:function(){console.warn("OrbitControls: .center has been renamed to .target");return this.target}},{key:"noZoom",get:function(){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.");
|
||
|
return!this.enableZoom},set:function(a){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.");this.enableZoom=!a}},{key:"noRotate",get:function(){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.");return!this.enableRotate},set:function(a){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.");this.enableRotate=!a}},{key:"noPan",get:function(){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead.");
|
||
|
return!this.enablePan},set:function(a){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead.");this.enablePan=!a}},{key:"noKeys",get:function(){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.");return!this.enableKeys},set:function(a){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.");this.enableKeys=!a}},{key:"staticMoving",get:function(){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.");
|
||
|
return!this.enableDamping},set:function(a){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.");this.enableDamping=!a}},{key:"dynamicDampingFactor",get:function(){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.");return this.dampingFactor},set:function(a){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.");this.dampingFactor=a}}]);H(b,a);return b}(K),fn=function(a){function b(){var a=
|
||
|
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,b);var d=N(this,D(b).call(this,a));d.params=Object.assign({follow:!1,object:null,target:new p},a);return d}z(b,[{key:"manager",value:function(a){ua(D(b.prototype),"manager",this).call(this,a);var c=this.params,e=c.object,g=c.follow,k=c.target;c=e?e.native:a.get("camera").native;var l=new en(c,a.get("element"),a.handler);g=g?function(a){l.update(a.getDelta());l.target.copy(k)}:function(a){l.update(a.getDelta())};this.setControls(l);this.setUpdate(g);
|
||
|
a.update({camera:function(a){e||(l.object=a.native)},element:function(a){l.domElement=a}});l.target.copy(k)}}]);H(b,a);return b}(ck),gn=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,a);this.params=Object.assign({attributes:!1},b)}z(a,[{key:"integrate",value:function(a){var b=this;a=a.params;this.g_=function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.buildGeometry&&(this.native.geometry=this.buildGeometry(this.updateParams({geometry:a})))};
|
||
|
if(a.attributes){a=function(a){a&&Object.defineProperty(b,"g_".concat(a),{get:function(){return this.native.geometry.parameters[a]},set:function(b){this.native.geometry=this.buildGeometry(this.updateParams({geometry:L({},a,b)}))},configurable:!0,enumerable:!0})};for(var d in this.params.geometry)a(d)}}}]);return a}(),hn=new sf,jn=function(){function a(){var b=this;F(this,a);L(L(this,"textures",[]),"bridge",{material:function(a,b){b.textures.forEach(function(b){a[b[0]]=b[1]});a.needsUpdate=!0;return a}});
|
||
|
for(var c=arguments.length,d=Array(c),e=0;e<c;e++)d[e]=arguments[e];d.forEach(function(a){var c=a.url,d=a.type;d=void 0===d?"map":d;var e=a.offset;e=void 0===e?new x(0,0):e;var g=a.repeat;g=void 0===g?new x(1,1):g;var p=a.wrap;p=void 0===p?1E3:p;var q=a.mapping;q=void 0===q?300:q;a=a.fix;a=void 0===a?function(a){return a}:a;c=hn.load(c);0<p.length?(c.wrapS=p[0],c.wrapT=p[1]):c.wrapS=c.wrapT=p;c.mapping=q;c.offset.copy(e);c.repeat.copy(g);c.magFilter=1003;c.minFilter=1008;b.textures.push([d,a(c)])})}
|
||
|
z(a,null,[{key:"load",value:function(b){return(new a({url:b})).textures[0][1]}}]);return a}(),kn=function(){function a(b,c){var d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};F(this,a);L(this,"bridge",{mesh:function(a,b){a.geometry.skeleton=a.skeleton;b.mixer=new Ff(a.geometry);b.clips=a.geometry.animations;return a}});this.params=Object.assign({speed:1},d);this.clock=new Hf;this.app=b;this.isDeferred=c}z(a,[{key:"play",value:function(a){a=gb.findByName(this.clips,a);return this.mixer.clipAction(a).play()}},
|
||
|
{key:"update",value:function(){this.mixer&&this.mixer.update(this.clock.getDelta()*this.params.speed)}},{key:"integrate",value:function(a){a.loop=new Wc(function(){a.update()});a.isDeferred||a.loop.start(a.app)}},{key:"manager",value:function(a){a.define("animation")}}]);return a}(),ln=function(){function a(b,c){F(this,a);this.name=b;this.data=c}z(a,[{key:"manager",value:function(a){a.set(this.name,this.data)}}]);return a}(),mn=function(a){function b(a){var c;F(this,b);console.warn("Model is deprecated. Use Importer instead.");
|
||
|
a.geometry&&(a.url=a.geometry.path,a.loader=a.geometry.loader);for(var e=arguments.length,g=Array(1<e?e-1:0),k=1;k<e;k++)g[k-1]=arguments[k];return N(this,(c=D(b)).call.apply(c,[this,a].concat(g)))}H(b,a);return b}(Hg),nn=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};F(this,a);console.warn("CameraModule is deprecated. Use DefineModule instead.");this.camera=new Gg(b)}z(a,[{key:"integrate",value:function(a){this.add(a.camera)}},{key:"manager",value:function(a){a.set("camera",
|
||
|
this.camera)}}]);return a}();q.Component=Lb;q.MeshComponent=P;q.LightComponent=Za;q.CameraComponent=Xb;q.App=Bm;q.Loop=Wc;q.ModuleManager=Fg;q.AmbientLight=nj;q.DirectionalLight=oj;q.HemisphereLight=pj;q.PointLight=qj;q.SpotLight=rj;q.AreaLight=sj;q.CubeCamera=tj;q.OrthographicCamera=uj;q.PerspectiveCamera=Gg;q.Box=vj;q.Circle=wj;q.Cone=xj;q.Cylinder=yj;q.Dodecahedron=zj;q.Extrude=Aj;q.Icosahedron=Bj;q.Lathe=Cj;q.Line=Dj;q.Importer=Hg;q.Octahedron=Ej;q.Parametric=Fj;q.Plane=Gj;q.Polyhedron=Jj;q.Ring=
|
||
|
Kj;q.Shape=Lj;q.Sphere=Mj;q.Tetrahedron=Nj;q.Text=Oj;q.Torus=Pj;q.Torusknot=Qj;q.Tube=Rj;q.Group=Cm;q.extend=xg;q.instruct=Ri;q.transformData=Si;q.toArray=function(a,b){for(var c=[],d=0,e=b.length;d<e;d++)c[d]=a[b[d]];return c};q.ElementModule=Dm;q.RenderingModule=Sj;q.SceneModule=Em;q.ResizeModule=Fm;q.PostProcessorModule=bk;q.VirtualMouseModule=an;q.EventsPatchModule=Lg;q.ControlsModule=ck;q.FogModule=bn;q.StateModule=dn;q.OrbitControlsModule=fn;q.DynamicGeometryModule=gn;q.TextureModule=jn;q.AnimationModule=
|
||
|
kn;q.DefineModule=ln;q.Model=mn;q.CameraModule=nn;Object.defineProperty(q,"__esModule",{value:!0})});
|