commit af6d73cca1d43e535662b618459f8449ba8e23a7 Author: Paul Graffam Date: Mon Sep 12 15:54:07 2016 -0400 Initial commit diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..d991474 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,22 @@ +{ + "rules": { + "quotes": [ + 2, + "single" + ], + "semi": [ + 2, + "always" + ], + "no-unused-vars" : 2, + "no-undef" : 2 + }, + "env": { + "es6": true, + "browser": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "sourceType": "module" + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d630b80 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules +*.log +.DS_Store +.idea +Iconr diff --git a/README.md b/README.md new file mode 100644 index 0000000..fa2a11d --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# Three.js Webpack ES6 Boilerplate +A basic boilerplate for a Three.js project including the use of Webpack and ES6 syntax via Babel. + +## Getting started +``` +npm install +``` + +Then + +``` +npm run dev +``` + +Spins up a webpack dev server at localhost:8080 and keeps track of all js and sass changes to files and reloads upon save. + +## Build +``` +npm run build +``` + +Cleans existing build folder while linting js and copies over the public folder from src. Then sets environment to production and compiles js and css into build. diff --git a/build/public/assets/css/app.css b/build/public/assets/css/app.css new file mode 100644 index 0000000..3930aaf --- /dev/null +++ b/build/public/assets/css/app.css @@ -0,0 +1 @@ +html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.main{width:100%;height:100vh} diff --git a/build/public/assets/css/rStats.css b/build/public/assets/css/rStats.css new file mode 100644 index 0000000..ccda851 --- /dev/null +++ b/build/public/assets/css/rStats.css @@ -0,0 +1,73 @@ +.rs-base{ + position: absolute; + z-index: 10000; + padding: 10px; + background-color: #222; + font-size: 10px; + line-height: 1.2em; + width: 350px; + font-family: 'Roboto Condensed', tahoma, sans-serif; + left: 0; + top: 0; + overflow: hidden; +} + +.rs-base h1{ + margin: 0; + padding: 0; + font-size: 1.4em; + color: #fff; + margin-bottom: 5px; + cursor: pointer; +} + +.rs-base div.rs-group{ + margin-bottom: 10px; +} + +.rs-base div.rs-group.hidden{ + display: none; +} + +.rs-base div.rs-fraction{ + position: relative; + margin-bottom: 5px; +} + +.rs-base div.rs-fraction p{ + width: 120px; + text-align: right; + margin: 0; + padding: 0; +} + +.rs-base div.rs-legend{ + position: absolute; + line-height: 1em; +} + +.rs-base div.rs-counter-base{ + position: relative; + margin: 2px 0; + height: 1em; +} + +.rs-base span.rs-counter-id{ + position: absolute; + left: 0; + top: 0; +} + +.rs-base div.rs-counter-value{ + position: absolute; + left: 90px; + width: 30px; + height: 1em; + top: 0; + text-align: right; +} + +.rs-base canvas.rs-canvas{ + position: absolute; + right: 0; +} diff --git a/build/public/assets/js/app.js b/build/public/assets/js/app.js new file mode 100644 index 0000000..63dd29e --- /dev/null +++ b/build/public/assets/js/app.js @@ -0,0 +1,17 @@ +!function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="assets/js",e(0)}([function(t,e,i){t.exports=i(1)},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(){if(c["default"].webgl){var t=document.getElementById("appContainer");new l["default"](t)}else c["default"].addGetWebGLMessage()}var a=i(2),o=n(a),s=i(4),c=n(s),h=i(5),l=n(h);o["default"].isDev=!0,window.onload=r},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var r=i(3),a=n(r);e["default"]={isDev:!1,isLoaded:!1,isTweening:!1,isRotating:!0,isMouseMoving:!1,isMouseOver:!1,maxAnisotropy:1,dpr:1,easing:a["default"].Easing.Quadratic.InOut,duration:500,model:{path:"/assets/models/teapot-claraio.json",scale:20},texture:{path:"/assets/textures/",imageFiles:[{name:"UV",image:"UV_Grid_Sm.jpg"}]},mesh:{enableHelper:!1,wireframe:!1,translucent:!1,material:{color:16777215,emissive:16777215}},fog:{color:16777215,near:8e-4},camera:{fov:40,near:2,far:1e3,aspect:1,posX:0,posY:30,posZ:40},controls:{autoRotate:!0,autoRotateSpeed:-.5,rotateSpeed:.5,zoomSpeed:.8,minDistance:200,maxDistance:600,minPolarAngle:Math.PI/5,maxPolarAngle:Math.PI/2,minAzimuthAngle:-(1/0),maxAzimuthAngle:1/0,enableDamping:!0,dampingFactor:.5,enableZoom:!0,target:{x:0,y:0,z:0}},ambientLight:{enabled:!1,color:1315860},directionalLight:{enabled:!0,color:15790320,intensity:.4,x:-75,y:280,z:150},shadow:{enabled:!0,helperEnabled:!0,bias:-25e-5,mapWidth:1024,mapHeight:1024,near:200,far:400,top:150,right:150,bottom:-150,left:-150},pointLight:{enabled:!0,color:16777215,intensity:.34,distance:115,x:0,y:0,z:0},hemiLight:{enabled:!0,color:13158600,groundColor:16777215,intensity:.3,x:-275,y:145,z:0}}},function(t,e,i){var n,r;"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(){if("performance"in window==!1&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==!1){var t=window.performance.timing&&window.performance.timing.navigationStart?window.performance.timing.navigationStart:Date.now();window.performance.now=function(){return Date.now()-t}}}();var a=a||function(){var t=[];return{getAll:function(){return t},removeAll:function(){t=[]},add:function(e){t.push(e)},remove:function(e){var i=t.indexOf(e);i!==-1&&t.splice(i,1)},update:function(e){if(0===t.length)return!1;var i=0;for(e=void 0!==e?e:window.performance.now();i1?1:h;var b=p(h);for(a in n){var _=i[a]||0,M=n[a];M instanceof Array?e[a]=f(M,b):("string"==typeof M&&(M=_+parseFloat(M,10)),"number"==typeof M&&(e[a]=_+(M-_)*b))}if(null!==y&&y.call(e,b),1===h){if(s>0){isFinite(s)&&s--;for(a in r){if("string"==typeof n[a]&&(r[a]=r[a]+parseFloat(n[a],10)),c){var w=r[a];r[a]=n[a],n[a]=w}i[a]=r[a]}return c&&(l=!l),d=t+u,!0}null!==x&&x.call(e);for(var S=0,T=m.length;S1?o(t[i],t[i-1],i-n):o(t[r],t[r+1>i?i:r+1],n-r)},Bezier:function(t,e){var i,n=0,r=t.length-1,o=Math.pow,s=a.Interpolation.Utils.Bernstein;for(i=0;i<=r;i++)n+=o(1-e,r-i)*o(e,i)*t[i]*s(r,i);return n},CatmullRom:function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n),o=a.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),o(t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i],n-r)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-n)-t[0]):e>1?t[i]-(o(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):o(t[r?r-1:0],t[r],t[i1;i--)n*=i;return t[e]=n,n}}(),CatmullRom:function(t,e,i,n,r){var a=.5*(i-t),o=.5*(n-e),s=r*r,c=r*s;return(2*e-2*i+a+o)*c+(-3*e+3*i-2*a-o)*s+a*r+e}}},function(i){n=[],r=function(){return a}.apply(e,n),!(void 0!==r&&(t.exports=r))}(void 0)},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(e){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var t=document.createElement("div");return t.id="webgl-error-message",t.style.fontFamily="monospace",t.style.fontSize="13px",t.style.fontWeight="normal",t.style.textAlign="center",t.style.background="#fff",t.style.color="#000",t.style.padding="1.5em",t.style.width="400px",t.style.margin="5em auto 0",this.webgl||(t.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support WebGL.
','Find out how to get it here.'].join("\n"):['Your browser does not seem to support WebGL.
','Find out how to get it here.'].join("\n")),t},addGetWebGLMessage:function(t){var e,i,n;t=t||{},e=void 0!==t.parent?t.parent:document.body,i=void 0!==t.id?t.id:"oldie",n=this.getWebGLErrorMessage(),n.id=i,e.appendChild(n)}}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;i0?1:+t}),void 0===Function.prototype.name&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]}}),void 0===Object.assign&&!function(){Object.assign=function(t){"use strict";if(void 0===t||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(){function t(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}return function(e,i,n){if(e=a.Math.euclideanModulo(e,1),i=a.Math.clamp(i,0,1),n=a.Math.clamp(n,0,1),0===i)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+i):n+i-n*i,o=2*n-r;this.r=t(o,r,e+1/3),this.g=t(o,r,e),this.b=t(o,r,e-1/3)}return this}}(),setStyle:function(t){function e(t){void 0!==t&&parseFloat(t)<1}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var s=parseFloat(n[1])/360,c=parseInt(n[2],10)/100,h=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(s,c,h)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(t)){var l=i[1],u=l.length;if(3===u)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}if(t&&t.length>0){var l=a.ColorKeywords[t];void 0!==l&&this.setHex(l)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(){var t=this.r,e=this.g,i=this.b;return this.r=t*t,this.g=e*e,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),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(t){var e,i,n=t||{h:0,s:0,l:0},r=this.r,a=this.g,o=this.b,s=Math.max(r,a,o),c=Math.min(r,a,o),h=(c+s)/2;if(c===s)e=0,i=0;else{var l=s-c;switch(i=h<=.5?l/(s+c):l/(2-s-c),s){case r:e=(a-o)/l+(a0?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(l-c)*e,this._y=(a-h)*e,this._z=(o-r)*e):n>s&&n>u?(e=2*Math.sqrt(1+n-s-u),this._w=(l-c)/e,this._x=.25*e,this._y=(r+o)/e,this._z=(a+h)/e):s>u?(e=2*Math.sqrt(1+s-n-u),this._w=(a-h)/e,this._x=(r+o)/e,this._y=.25*e,this._z=(c+l)/e):(e=2*Math.sqrt(1+u-n-s),this._w=(o-r)/e,this._x=(a+h)/e,this._y=(c+l)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e,i=1e-6;return function(n,r){return void 0===t&&(t=new a.Vector3),e=n.dot(r)+1,eMath.abs(n.z)?t.set(-n.y,n.x,0):t.set(0,-n.z,n.y)):t.crossVectors(n,r),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?this.multiplyQuaternions(t,e):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var i=t._x,n=t._y,r=t._z,a=t._w,o=e._x,s=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+n*c-r*s,this._y=n*h+a*s+r*o-i*c,this._z=r*h+a*c+i*s-n*o,this._w=a*h-i*o-n*s-r*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,r=this._z,a=this._w,o=a*t._w+i*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=i,this._y=n,this._z=r,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(i+this._x),this._y=.5*(n+this._y),this._z=.5*(r+this._z),this;var c=Math.atan2(s,o),h=Math.sin((1-e)*c)/s,l=Math.sin(e*c)/s;return this._w=a*h+this._w*l,this._x=i*h+this._x*l,this._y=n*h+this._y*l,this._z=r*h+this._z*l,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},Object.assign(a.Quaternion,{slerp:function(t,e,i,n){return i.copy(t).slerp(e,n)},slerpFlat:function(t,e,i,n,r,a,o){var s=i[n+0],c=i[n+1],h=i[n+2],l=i[n+3],u=r[a+0],d=r[a+1],p=r[a+2],f=r[a+3];if(l!==f||s!==u||c!==d||h!==p){var m=1-o,g=s*u+c*d+h*p+l*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var x=Math.sqrt(y),b=Math.atan2(x,g*v);m=Math.sin(m*b)/x,o=Math.sin(o*b)/x}var _=o*v;if(s=s*m+u*_,c=c*m+d*_,h=h*m+p*_,l=l*m+f*_,m===1-o){var M=1/Math.sqrt(s*s+c*c+h*h+l*l);s*=M,c*=M,h*=M,l*=M}}t[e]=s,t[e+1]=c,t[e+2]=h,t[e+3]=l}}),a.Vector2=function(t,e){this.x=t||0,this.y=e||0},a.Vector2.prototype={constructor:a.Vector2,get width(){return this.x},set width(t){this.x=t},get height(){return this.y},set height(t){this.y=t},set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?this.addVectors(t,e):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?this.subVectors(t,e):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var t,e;return function(i,n){return void 0===t&&(t=new a.Vector2,e=new a.Vector2),t.set(i,i),e.set(n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,i))/i)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function o(){var o=Math.atan2(this.y,this.x);return o<0&&(o+=2*Math.PI),o},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromAttribute:function(t,e,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this},rotateAround:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*n+t.x,this.y=r*n+a*i+t.y,this}},a.Vector3=function(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0},a.Vector3.prototype={constructor:a.Vector3,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){ +case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?this.addVectors(t,e):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?this.subVectors(t,e):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?this.multiplyVectors(t,e):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t;return function(e){return e instanceof a.Euler==!1,void 0===t&&(t=new a.Quaternion),this.applyQuaternion(t.setFromEuler(e))}}(),applyAxisAngle:function(){var t;return function(e,i){return void 0===t&&(t=new a.Quaternion),this.applyQuaternion(t.setFromAxisAngle(e,i))}}(),applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12],this.y=r[1]*e+r[5]*i+r[9]*n+r[13],this.z=r[2]*e+r[6]*i+r[10]*n+r[14],this},applyProjection:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements,a=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*a,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*a,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*a,this},applyQuaternion:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,a=t.y,o=t.z,s=t.w,c=s*e+a*n-o*i,h=s*i+o*e-r*n,l=s*n+r*i-a*e,u=-r*e-a*i-o*n;return this.x=c*s+u*-r+h*-o-l*-a,this.y=h*s+u*-a+l*-r-c*-o,this.z=l*s+u*-o+c*-a-h*-r,this},project:function(){var t;return function(e){return void 0===t&&(t=new a.Matrix4),t.multiplyMatrices(e.projectionMatrix,t.getInverse(e.matrixWorld)),this.applyProjection(t)}}(),unproject:function(){var t;return function(e){return void 0===t&&(t=new a.Matrix4),t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyProjection(t)}}(),transformDirection:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t,e;return function(i,n){return void 0===t&&(t=new a.Vector3,e=new a.Vector3),t.set(i,i,i),e.set(n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,i))/i)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},cross:function(t,e){if(void 0!==e)return this.crossVectors(t,e);var i=this.x,n=this.y,r=this.z;return this.x=n*t.z-r*t.y,this.y=r*t.x-i*t.z,this.z=i*t.y-n*t.x,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,a=e.x,o=e.y,s=e.z;return this.x=n*s-r*o,this.y=r*a-i*s,this.z=i*o-n*a,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t;return function(e){return void 0===t&&(t=new a.Vector3),t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t;return function(e){return void 0===t&&(t=new a.Vector3),this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(a.Math.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){var e=Math.sin(t.phi)*t.radius;return this.x=e*Math.sin(t.theta),this.y=Math.cos(t.phi)*t.radius,this.z=e*Math.cos(t.theta),this},setFromMatrixPosition:function(t){return this.setFromMatrixColumn(t,3)},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this},setFromMatrixColumn:function(t,e){if("number"==typeof t){var i=t;t=e,e=i}return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromAttribute:function(t,e,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this}},a.Vector4=function(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==n?n:1},a.Vector4.prototype={constructor:a.Vector4,set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?this.addVectors(t,e):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?this.subVectors(t,e):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,a=t.elements;return this.x=a[0]*e+a[4]*i+a[8]*n+a[12]*r,this.y=a[1]*e+a[5]*i+a[9]*n+a[13]*r,this.z=a[2]*e+a[6]*i+a[10]*n+a[14]*r,this.w=a[3]*e+a[7]*i+a[11]*n+a[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,i,n,r,a=.01,o=.1,s=t.elements,c=s[0],h=s[4],l=s[8],u=s[1],d=s[5],p=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(h-u)y&&v>x?vx?ythis.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){var i=e||new a.Vector2;return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){var i=e||new a.Vector2;return i.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new a.Vector2;return function(e){var i=t.copy(e).clamp(this.min,this.max);return i.sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},a.Box3=function(t,e){this.min=void 0!==t?t:new a.Vector3((+(1/0)),(+(1/0)),(+(1/0))),this.max=void 0!==e?e:new a.Vector3((-(1/0)),(-(1/0)),(-(1/0)))},a.Box3.prototype={constructor:a.Box3,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=+(1/0),i=+(1/0),n=+(1/0),r=-(1/0),a=-(1/0),o=-(1/0),s=0,c=t.length;sr&&(r=h),l>a&&(a=l),u>o&&(o=u)}this.min.set(e,i,n),this.max.set(r,a,o)},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){var i=e||new a.Vector3;return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},intersectsSphere:function(){var t;return function(e){return void 0===t&&(t=new a.Vector3),this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=t.constant&&i>=t.constant},clampPoint:function(t,e){var i=e||new a.Vector3;return i.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new a.Vector3;return function(e){var i=t.copy(e).clamp(this.min,this.max);return i.sub(e).length()}}(),getBoundingSphere:function(){var t=new a.Vector3;return function(e){var i=e||new a.Sphere;return i.center=this.center(),i.radius=.5*this.size(t).length(),i}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3];return function(e){return this.isEmpty()?this:(t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(t),this)}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},a.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0},a.Matrix3.prototype={constructor:a.Matrix3,set:function(t,e,i,n,r,a,o,s,c){var h=this.elements;return h[0]=t,h[1]=n,h[2]=o,h[3]=e,h[4]=r,h[5]=s,h[6]=i,h[7]=a,h[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=t.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToVector3Array:function(){var t;return function(e,i,n){void 0===t&&(t=new a.Vector3),void 0===i&&(i=0),void 0===n&&(n=e.length);for(var r=0,o=i;r0},a.Matrix4.prototype={constructor:a.Matrix4,set:function(t,e,i,n,r,a,o,s,c,h,l,u,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=h,g[10]=l,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new a.Matrix4).fromArray(this.elements)},copy:function(t){return this.elements.set(t.elements),this},copyPosition:function(t){var e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this},extractBasis:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:function(){var t;return function(e){void 0===t&&(t=new a.Vector3);var i=this.elements,n=e.elements,r=1/t.setFromMatrixColumn(e,0).length(),o=1/t.setFromMatrixColumn(e,1).length(),s=1/t.setFromMatrixColumn(e,2).length();return i[0]=n[0]*r,i[1]=n[1]*r,i[2]=n[2]*r,i[4]=n[4]*o,i[5]=n[5]*o,i[6]=n[6]*o,i[8]=n[8]*s,i[9]=n[9]*s,i[10]=n[10]*s,this}}(),makeRotationFromEuler:function(t){t instanceof a.Euler==!1;var e=this.elements,i=t.x,n=t.y,r=t.z,o=Math.cos(i),s=Math.sin(i),c=Math.cos(n),h=Math.sin(n),l=Math.cos(r),u=Math.sin(r);if("XYZ"===t.order){var d=o*l,p=o*u,f=s*l,m=s*u;e[0]=c*l,e[4]=-c*u,e[8]=h,e[1]=p+f*h,e[5]=d-m*h,e[9]=-s*c,e[2]=m-d*h,e[6]=f+p*h,e[10]=o*c}else if("YXZ"===t.order){var g=c*l,v=c*u,y=h*l,x=h*u;e[0]=g+x*s,e[4]=y*s-v,e[8]=o*h,e[1]=o*u,e[5]=o*l,e[9]=-s,e[2]=v*s-y,e[6]=x+g*s,e[10]=o*c}else if("ZXY"===t.order){var g=c*l,v=c*u,y=h*l,x=h*u;e[0]=g-x*s,e[4]=-o*u,e[8]=y+v*s,e[1]=v+y*s,e[5]=o*l,e[9]=x-g*s,e[2]=-o*h,e[6]=s,e[10]=o*c}else if("ZYX"===t.order){var d=o*l,p=o*u,f=s*l,m=s*u;e[0]=c*l,e[4]=f*h-p,e[8]=d*h+m,e[1]=c*u,e[5]=m*h+d,e[9]=p*h-f,e[2]=-h,e[6]=s*c,e[10]=o*c}else if("YZX"===t.order){var b=o*c,_=o*h,M=s*c,w=s*h;e[0]=c*l,e[4]=w-b*u,e[8]=M*u+_,e[1]=u,e[5]=o*l,e[9]=-s*l,e[2]=-h*l,e[6]=_*u+M,e[10]=b-w*u}else if("XZY"===t.order){var b=o*c,_=o*h,M=s*c,w=s*h;e[0]=c*l,e[4]=-u,e[8]=h*l,e[1]=b*u+w,e[5]=o*l,e[9]=_*u-M,e[2]=M*u-_,e[6]=s*l,e[10]=w*u+b}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,i=t.x,n=t.y,r=t.z,a=t.w,o=i+i,s=n+n,c=r+r,h=i*o,l=i*s,u=i*c,d=n*s,p=n*c,f=r*c,m=a*o,g=a*s,v=a*c;return e[0]=1-(d+f),e[4]=l-v,e[8]=u+g,e[1]=l+v,e[5]=1-(h+f),e[9]=p-m,e[2]=u-g,e[6]=p+m,e[10]=1-(h+d),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var t,e,i;return function(n,r,o){void 0===t&&(t=new a.Vector3,e=new a.Vector3,i=new a.Vector3);var s=this.elements;return i.subVectors(n,r).normalize(),0===i.lengthSq()&&(i.z=1),t.crossVectors(o,i).normalize(),0===t.lengthSq()&&(i.z+=1e-4,t.crossVectors(o,i).normalize()),e.crossVectors(i,t),s[0]=t.x,s[4]=e.x,s[8]=i.x,s[1]=t.y,s[5]=e.y,s[9]=i.y,s[2]=t.z,s[6]=e.z,s[10]=i.z,this}}(),multiply:function(t,e){return void 0!==e?this.multiplyMatrices(t,e):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,n=e.elements,r=this.elements,a=i[0],o=i[4],s=i[8],c=i[12],h=i[1],l=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],x=i[11],b=i[15],_=n[0],M=n[4],w=n[8],S=n[12],T=n[1],L=n[5],A=n[9],C=n[13],E=n[2],P=n[6],R=n[10],D=n[14],I=n[3],O=n[7],B=n[11],U=n[15];return r[0]=a*_+o*T+s*E+c*I,r[4]=a*M+o*L+s*P+c*O,r[8]=a*w+o*A+s*R+c*B,r[12]=a*S+o*C+s*D+c*U,r[1]=h*_+l*T+u*E+d*I,r[5]=h*M+l*L+u*P+d*O,r[9]=h*w+l*A+u*R+d*B,r[13]=h*S+l*C+u*D+d*U,r[2]=p*_+f*T+m*E+g*I,r[6]=p*M+f*L+m*P+g*O,r[10]=p*w+f*A+m*R+g*B,r[14]=p*S+f*C+m*D+g*U,r[3]=v*_+y*T+x*E+b*I,r[7]=v*M+y*L+x*P+b*O,r[11]=v*w+y*A+x*R+b*B,r[15]=v*S+y*C+x*D+b*U,this},multiplyToArray:function(t,e,i){var n=this.elements;return this.multiplyMatrices(t,e),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i[4]=n[4],i[5]=n[5],i[6]=n[6],i[7]=n[7],i[8]=n[8],i[9]=n[9],i[10]=n[10],i[11]=n[11],i[12]=n[12],i[13]=n[13],i[14]=n[14],i[15]=n[15],this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToVector3Array:function(){var t;return function(e,i,n){void 0===t&&(t=new a.Vector3),void 0===i&&(i=0),void 0===n&&(n=e.length);for(var r=0,o=i;r0)if(s=d*f-p,c=d*p-f,l=u*g,s>=0)if(c>=-l)if(c<=l){var v=1/g;s*=v,c*=v,h=s*(s+d*c+2*p)+c*(d*s+c+2*f)+m}else c=u,s=Math.max(0,-(d*c+p)),h=-s*s+c*(c+2*f)+m;else c=-u,s=Math.max(0,-(d*c+p)),h=-s*s+c*(c+2*f)+m;else c<=-l?(s=Math.max(0,-(-d*u+p)),c=s>0?-u:Math.min(Math.max(-u,-f),u),h=-s*s+c*(c+2*f)+m):c<=l?(s=0,c=Math.min(Math.max(-u,-f),u),h=c*(c+2*f)+m):(s=Math.max(0,-(d*u+p)),c=s>0?u:Math.min(Math.max(-u,-f),u),h=-s*s+c*(c+2*f)+m);else c=d>0?-u:u,s=Math.max(0,-(d*c+p)),h=-s*s+c*(c+2*f)+m;return a&&a.copy(this.direction).multiplyScalar(s).add(this.origin),o&&o.copy(e).multiplyScalar(c).add(t),h}}(),intersectSphere:function(){var t=new a.Vector3;return function(e,i){t.subVectors(e.center,this.origin);var n=t.dot(this.direction),r=t.dot(t)-n*n,a=e.radius*e.radius;if(r>a)return null;var o=Math.sqrt(a-r),s=n-o,c=n+o;return s<0&&c<0?null:s<0?this.at(c,i):this.at(s,i)}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null},intersectPlane:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);if(0===e)return!0;var i=t.normal.dot(this.direction);return i*e<0},intersectBox:function(t,e){var i,n,r,a,o,s,c=1/this.direction.x,h=1/this.direction.y,l=1/this.direction.z,u=this.origin;return c>=0?(i=(t.min.x-u.x)*c,n=(t.max.x-u.x)*c):(i=(t.max.x-u.x)*c,n=(t.min.x-u.x)*c),h>=0?(r=(t.min.y-u.y)*h,a=(t.max.y-u.y)*h):(r=(t.max.y-u.y)*h,a=(t.min.y-u.y)*h),i>a||r>n?null:((r>i||i!==i)&&(i=r),(a=0?(o=(t.min.z-u.z)*l,s=(t.max.z-u.z)*l):(o=(t.max.z-u.z)*l,s=(t.min.z-u.z)*l),i>s||o>n?null:((o>i||i!==i)&&(i=o),(s=0?i:n,e)))},intersectsBox:function(){var t=new a.Vector3;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new a.Vector3,e=new a.Vector3,i=new a.Vector3,n=new a.Vector3;return function(r,a,o,s,c){e.subVectors(a,r),i.subVectors(o,r),n.crossVectors(e,i);var h,l=this.direction.dot(n);if(l>0){if(s)return null;h=1}else{if(!(l<0))return null;h=-1,l=-l}t.subVectors(this.origin,r);var u=h*this.direction.dot(i.crossVectors(t,i));if(u<0)return null;var d=h*this.direction.dot(e.cross(t));if(d<0)return null;if(u+d>l)return null;var p=-h*t.dot(n);return p<0?null:this.at(p/l,c)}}(),applyMatrix4:function(t){return this.direction.add(this.origin).applyMatrix4(t),this.origin.applyMatrix4(t),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},a.Sphere=function(t,e){this.center=void 0!==t?t:new a.Vector3,this.radius=void 0!==e?e:0},a.Sphere.prototype={constructor:a.Sphere,set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new a.Box3;return function(e,i){var n=this.center;void 0!==i?n.copy(i):t.setFromPoints(e).center(n);for(var r=0,a=0,o=e.length;athis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(t){var e=t||new a.Box3;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},a.Frustum=function(t,e,i,n,r,o){this.planes=[void 0!==t?t:new a.Plane,void 0!==e?e:new a.Plane,void 0!==i?i:new a.Plane,void 0!==n?n:new a.Plane,void 0!==r?r:new a.Plane,void 0!==o?o:new a.Plane]},a.Frustum.prototype={constructor:a.Frustum,set:function(t,e,i,n,r,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes,i=t.elements,n=i[0],r=i[1],a=i[2],o=i[3],s=i[4],c=i[5],h=i[6],l=i[7],u=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(o-n,l-s,f-u,y-m).normalize(),e[1].setComponents(o+n,l+s,f+u,y+m).normalize(),e[2].setComponents(o+r,l+c,f+d,y+g).normalize(),e[3].setComponents(o-r,l-c,f-d,y-g).normalize(),e[4].setComponents(o-a,l-h,f-p,y-v).normalize(),e[5].setComponents(o+a,l+h,f+p,y+v).normalize(),this},intersectsObject:function(){var t=new a.Sphere;return function(e){var i=e.geometry;return null===i.boundingSphere&&i.computeBoundingSphere(),t.copy(i.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSprite:function(){var t=new a.Sphere;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,i=t.center,n=-t.radius,r=0;r<6;r++){var a=e[r].distanceToPoint(i);if(a0?i.min.x:i.max.x,e.x=a.normal.x>0?i.max.x:i.min.x,t.y=a.normal.y>0?i.min.y:i.max.y,e.y=a.normal.y>0?i.max.y:i.min.y,t.z=a.normal.z>0?i.min.z:i.max.z,e.z=a.normal.z>0?i.max.z:i.min.z;var o=a.distanceToPoint(t),s=a.distanceToPoint(e);if(o<0&&s<0)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}},a.Plane=function(t,e){this.normal=void 0!==t?t:new a.Vector3(1,0,0),this.constant=void 0!==e?e:0},a.Plane.prototype={constructor:a.Plane,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new a.Vector3,e=new a.Vector3;return function(i,n,r){var a=t.subVectors(r,n).cross(e.subVectors(i,n)).normalize();return this.setFromNormalAndCoplanarPoint(a,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return this.orthoPoint(t,e).sub(t).negate()},orthoPoint:function(t,e){var i=this.distanceToPoint(t),n=e||new a.Vector3;return n.copy(this.normal).multiplyScalar(i)},intersectLine:function(){var t=new a.Vector3;return function(e,i){var n=i||new a.Vector3,r=e.delta(t),o=this.normal.dot(r);if(0!==o){var s=-(e.start.dot(this.normal)+this.constant)/o;if(!(s<0||s>1))return n.copy(r).multiplyScalar(s).add(e.start)}else if(0===this.distanceToPoint(e.start))return n.copy(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){var e=t||new a.Vector3;return e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new a.Vector3,e=new a.Matrix3;return function(i,n){var r=this.coplanarPoint(t).applyMatrix4(i),a=n||e.getNormalMatrix(i),o=this.normal.applyMatrix3(a).normalize();return this.constant=-r.dot(o),this}}(),translate:function(t){return this.constant=this.constant-t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},a.Spherical=function(t,e,i){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==i?i:0,this},a.Spherical.prototype={constructor:a.Spherical,set:function(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius.copy(t.radius),this.phi.copy(t.phi),this.theta.copy(t.theta),this},makeSafe:function(){var t=1e-6;return this.phi=Math.max(t,Math.min(Math.PI-t,this.phi)),this},setFromVector3:function(t){return this.radius=t.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t.x,t.z),this.phi=Math.acos(a.Math.clamp(t.y/this.radius,-1,1))),this}},a.Math={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=new Array(36),n=0;return function(){for(var r=0;r<36;r++)8===r||13===r||18===r||23===r?i[r]="-":14===r?i[r]="4":(n<=2&&(n=33554432+16777216*Math.random()|0),t=15&n,n>>=4,i[r]=e[19===r?3&t|8:t]);return i.join("")}}(),clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e),t*t*(3-2*t))},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e),t*t*t*(t*(6*t-15)+10))},random16:function(){return Math.random()},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*a.Math.DEG2RAD},radToDeg:function(t){return t*a.Math.RAD2DEG},isPowerOfTwo:function(t){return 0===(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t++,t}},a.Spline=function(t){function e(t,e,i,n,r,a,o){var s=.5*(i-t),c=.5*(n-e);return(2*(e-i)+s+c)*o+(-3*(e-i)-2*s-c)*a+s*r+e}this.points=t;var i,n,r,o,s,c,h,l,u,d=[],p={x:0,y:0,z:0};this.initFromArray=function(t){this.points=[];for(var e=0;ethis.points.length-2?this.points.length-1:n+1,d[3]=n>this.points.length-3?this.points.length-1:n+2,c=this.points[d[0]],h=this.points[d[1]],l=this.points[d[2]],u=this.points[d[3]],o=r*r,s=r*o,p.x=e(c.x,h.x,l.x,u.x,r,o,s),p.y=e(c.y,h.y,l.y,u.y,r,o,s),p.z=e(c.z,h.z,l.z,u.z,r,o,s),p},this.getControlPointsArray=function(){var t,e,i=this.points.length,n=[];for(t=0;t0?o.multiplyScalar(1/Math.sqrt(s)):o.set(0,0,0)}}(),a.Triangle.barycoordFromPoint=function(){var t=new a.Vector3,e=new a.Vector3,i=new a.Vector3;return function(n,r,o,s,c){t.subVectors(s,r),e.subVectors(o,r),i.subVectors(n,r);var h=t.dot(t),l=t.dot(e),u=t.dot(i),d=e.dot(e),p=e.dot(i),f=h*d-l*l,m=c||new a.Vector3;if(0===f)return m.set(-2,-1,-1);var g=1/f,v=(d*u-l*p)*g,y=(h*p-l*u)*g;return m.set(1-v-y,y,v)}}(),a.Triangle.containsPoint=function(){var t=new a.Vector3;return function(e,i,n,r){var o=a.Triangle.barycoordFromPoint(e,i,n,r,t);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}(),a.Triangle.prototype={constructor:a.Triangle,set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:function(){var t=new a.Vector3,e=new a.Vector3;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){var e=t||new a.Vector3;return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return a.Triangle.normal(this.a,this.b,this.c,t)},plane:function(t){var e=t||new a.Plane;return e.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return a.Triangle.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return a.Triangle.containsPoint(t,this.a,this.b,this.c)},closestPointToPoint:function(){var t,e,i,n;return function(r,o){void 0===t&&(t=new a.Plane,e=[new a.Line3,new a.Line3,new a.Line3],i=new a.Vector3,n=new a.Vector3);var s=o||new a.Vector3,c=1/0;if(t.setFromCoplanarPoints(this.a,this.b,this.c),t.projectPoint(r,i),this.containsPoint(i)===!0)s.copy(i);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var h=0;h=r)break t;var s=e[1];t=r)break e}a=i,i=0}}for(;i>>1;t1){for(var e=0;e1)for(var e=0;e0){r.children=[];for(var a=0;a0&&(n.geometries=o),s.length>0&&(n.materials=s),c.length>0&&(n.textures=c),h.length>0&&(n.images=h)}return n.object=r,n},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(var i=0;i0)for(var f=0;f0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,i,n,r;for(i=0,n=this.faces.length;i0&&(t+=e[i].distanceTo(e[i-1])),this.lineDistances[i]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new a.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new a.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i){if(t instanceof a.Geometry!=!1){var n,r=this.vertices.length,o=this.vertices,s=t.vertices,c=this.faces,h=t.faces,l=this.faceVertexUvs[0],u=t.faceVertexUvs[0];void 0===i&&(i=0),void 0!==e&&(n=(new a.Matrix3).getNormalMatrix(e));for(var d=0,p=s.length;d=0;i--){var g=p[i];for(this.faces.splice(g,1),o=0,s=this.faceVertexUvs.length;o0,M=v.vertexNormals.length>0,w=1!==v.color.r||1!==v.color.g||1!==v.color.b,S=v.vertexColors.length>0,T=0;if(T=t(T,0,0),T=t(T,1,y),T=t(T,2,x),T=t(T,3,b),T=t(T,4,_),T=t(T,5,M),T=t(T,6,w),T=t(T,7,S),l.push(T),l.push(v.a,v.b,v.c),l.push(v.materialIndex),b){var L=this.faceVertexUvs[0][c];l.push(n(L[0]),n(L[1]),n(L[2]))}if(_&&l.push(e(v.normal)),M){var A=v.vertexNormals;l.push(e(A[0]),e(A[1]),e(A[2]))}if(w&&l.push(i(v.color)),S){var C=v.vertexColors;l.push(i(C[0]),i(C[1]),i(C[2]))}}return r.data={},r.data.vertices=s,r.data.normals=u,p.length>0&&(r.data.colors=p),m.length>0&&(r.data.uvs=[m]),r.data.faces=l,r},clone:function(){return(new a.Geometry).copy(this)},copy:function(t){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]];for(var e=t.vertices,i=0,n=e.length;i0,s=r[1]&&r[1].length>0,c=t.morphTargets,h=c.length;if(h>0){e=[];for(var l=0;l0){u=[];for(var l=0;l0){var i=new Float32Array(3*t.normals.length);this.addAttribute("normal",new a.BufferAttribute(i,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.addAttribute("color",new a.BufferAttribute(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new a.BufferAttribute(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new a.BufferAttribute(o,2).copyVector2sArray(t.uvs2))}if(t.indices.length>0){var s=t.vertices.length>65535?Uint32Array:Uint16Array,c=new s(3*t.indices.length);this.setIndex(new a.BufferAttribute(c,1).copyIndicesArray(t.indices))}this.groups=t.groups;for(var h in t.morphTargets){for(var l=[],u=t.morphTargets[h],d=0,p=u.length;d0){var g=new a.Float32Attribute(4*t.skinIndices.length,4);this.addAttribute("skinIndex",g.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var v=new a.Float32Attribute(4*t.skinWeights.length,4);this.addAttribute("skinWeight",v.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new a.Box3);var t=this.attributes.position.array;void 0!==t?this.boundingBox.setFromArray(t):this.boundingBox.makeEmpty(),isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)},computeBoundingSphere:function(){var t=new a.Box3,e=new a.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new a.Sphere);var i=this.attributes.position;if(i){var n=i.array,r=this.boundingSphere.center;t.setFromArray(n),t.center(r);for(var o=0,s=0,c=n.length;s0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(t.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),t},clone:function(){return(new a.BufferGeometry).copy(this)},copy:function(t){var e=t.index;null!==e&&this.setIndex(e.clone());var i=t.attributes;for(var n in i){var r=i[n];this.addAttribute(n,r.clone())}for(var a=t.groups,o=0,s=a.length;o0)for(var c=this._interpolants,h=this._propertyBindings,l=0,u=c.length;l!==u;++l)c[l].evaluate(o),h[l].accumulate(n,s)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var i=this._weightInterpolant;if(null!==i){var n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i){var n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t;if(0===t)return e;var i=this._clip.duration,n=this.loop,r=this._loopCount;if(n===a.LoopOnce){r===-1&&(this.loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=i)e=i;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{var o=n===a.LoopPingPong;if(r===-1&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=i||e<0){var s=Math.floor(e/i);e-=i*s,r+=Math.abs(s);var c=this.repetitions-r;if(c<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(0===c){var h=t<0;this._setEndings(h,!h,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:s})}}if(o&&1===(1&r))return this.time=e,i-e}return this.time=e,e},_setEndings:function(t,e,i){var n=this._interpolantSettings;i?(n.endingStart=a.ZeroSlopeEnding,n.endingEnd=a.ZeroSlopeEnding):(t?n.endingStart=this.zeroSlopeAtStart?a.ZeroSlopeEnding:a.ZeroCurvatureEnding:n.endingStart=a.WrapAroundEnding,e?n.endingEnd=this.zeroSlopeAtEnd?a.ZeroSlopeEnding:a.ZeroCurvatureEnding:n.endingEnd=a.WrapAroundEnding)},_scheduleFading:function(t,e,i){var n=this._mixer,r=n.time,a=this._weightInterpolant;null===a&&(a=n._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=e,o[1]=r+t,s[1]=i,this}},a.AnimationClip=function(t,e,i){this.name=t,this.tracks=i,this.duration=void 0!==e?e:-1,this.uuid=a.Math.generateUUID(),this.duration<0&&this.resetDuration(),this.trim(),this.optimize()},a.AnimationClip.prototype={constructor:a.AnimationClip,resetDuration:function(){for(var t=this.tracks,e=0,i=0,n=t.length;i!==n;++i){var r=this.tracks[i];e=Math.max(e,r.times[r.times.length-1])}this.duration=e},trim:function(){for(var t=0;t1){var l=h[1],u=n[l];u||(n[l]=u=[]),u.push(c)}}var d=[];for(var l in n)d.push(a.AnimationClip.CreateFromMorphTargetSequence(l,n[l],e,i));return d},parseAnimation:function(t,e,i){if(!t)return null;for(var n=function(t,e,i,n,r){if(0!==i.length){var o=[],s=[];a.AnimationUtils.flattenJSON(i,o,s,n),0!==o.length&&r.push(new t(e,o,s))}},r=[],o=t.name||"default",s=t.length||-1,c=t.fps||30,h=t.hierarchy||[],l=0;l=i){var u=i++,d=e[u];n[d.uuid]=l,e[l]=d,n[h]=u,e[u]=c;for(var p=0,f=a;p!==f;++p){var m=r[p],g=m[u],v=m[l];m[l]=g,m[u]=v}}}this.nCachedObjects_=i},uncache:function(t){for(var e=this._objects,i=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,a=this._bindings,o=a.length,s=0,c=arguments.length;s!==c;++s){var h=arguments[s],l=h.uuid,u=r[l];if(void 0!==u)if(delete r[l],ue;)--o;if(++o,0!==r||o!==n){r>=o&&(o=Math.max(o,1),r=o-1);var s=this.getValueSize();this.times=a.AnimationUtils.arraySlice(i,r,o),this.values=a.AnimationUtils.arraySlice(this.values,r*s,o*s)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(t=!1);var i=this.times,n=this.values,r=i.length;0===r&&(t=!1);for(var o=null,s=0;s!==r;s++){var c=i[s];if("number"==typeof c&&isNaN(c)){t=!1;break}if(null!==o&&o>c){t=!1;break}o=c}if(void 0!==n&&a.AnimationUtils.isTypedArray(n))for(var s=0,h=n.length;s!==h;++s){var l=n[s];if(isNaN(l)){t=!1;break}}return t},optimize:function(){for(var t=this.times,e=this.values,i=this.getValueSize(),n=1,r=1,o=t.length-1;r<=o;++r){var s=!1,c=t[r],h=t[r+1];if(c!==h&&(1!==r||c!==c[0]))for(var l=r*i,u=l-i,d=l+i,p=0;p!==i;++p){var f=e[l+p];if(f!==e[u+p]||f!==e[d+p]){s=!0;break}}if(s){if(r!==n){t[n]=t[r];for(var m=r*i,g=n*i,p=0;p!==i;++p)e[g+p]=e[m+p]}++n}}return n!==t.length&&(this.times=a.AnimationUtils.arraySlice(t,0,n),this.values=a.AnimationUtils.arraySlice(e,0,n*i)),this}},Object.assign(a.KeyframeTrack,{parse:function(t){if(void 0===t.type)throw new Error("track type undefined, can not parse");var e=a.KeyframeTrack._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){var i=[],n=[];a.AnimationUtils.flattenJSON(t.keys,i,n,"value"),t.times=i,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){var e,i=t.constructor;if(void 0!==i.toJSON)e=i.toJSON(t);else{e={name:t.name,times:a.AnimationUtils.convertArray(t.times,Array),values:a.AnimationUtils.convertArray(t.values,Array)};var n=t.getInterpolation();n!==t.DefaultInterpolation&&(e.interpolation=n)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return a.NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return a.VectorKeyframeTrack;case"color":return a.ColorKeyframeTrack;case"quaternion":return a.QuaternionKeyframeTrack;case"bool":case"boolean":return a.BooleanKeyframeTrack;case"string":return a.StringKeyframeTrack}throw new Error("Unsupported typeName: "+t)}}),a.PropertyBinding=function(t,e,i){this.path=e,this.parsedPath=i||a.PropertyBinding.parseTrackName(e),this.node=a.PropertyBinding.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t},a.PropertyBinding.prototype={constructor:a.PropertyBinding,getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,i=e.objectName,n=e.propertyName,r=e.propertyIndex;if(t||(t=a.PropertyBinding.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(i){var o=e.objectIndex;switch(i){case"materials":if(!t.material)return;if(!t.material.materials)return;t=t.material.materials;break;case"bones":if(!t.skeleton)return;t=t.skeleton.bones;for(var s=0;s=.5)for(var a=0;a!==r;++a)t[e+a]=t[i+a]},_slerp:function(t,e,i,n,r){a.Quaternion.slerpFlat(t,e,t,e,t,i,n)},_lerp:function(t,e,i,n,r){for(var a=1-n,o=0;o!==r;++o){var s=e+o;t[s]=t[s]*a+t[i+o]*n}}},a.BooleanKeyframeTrack=function(t,e,i){a.KeyframeTrack.call(this,t,e,i)},a.BooleanKeyframeTrack.prototype=Object.assign(Object.create(a.KeyframeTrack.prototype),{constructor:a.BooleanKeyframeTrack,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:a.InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),a.ColorKeyframeTrack=function(t,e,i,n){a.KeyframeTrack.call(this,t,e,i,n)},a.ColorKeyframeTrack.prototype=Object.assign(Object.create(a.KeyframeTrack.prototype),{constructor:a.ColorKeyframeTrack,ValueTypeName:"color"}),a.NumberKeyframeTrack=function(t,e,i,n){a.KeyframeTrack.call(this,t,e,i,n)},a.NumberKeyframeTrack.prototype=Object.assign(Object.create(a.KeyframeTrack.prototype),{constructor:a.NumberKeyframeTrack,ValueTypeName:"number"}),a.QuaternionKeyframeTrack=function(t,e,i,n){a.KeyframeTrack.call(this,t,e,i,n)},a.QuaternionKeyframeTrack.prototype=Object.assign(Object.create(a.KeyframeTrack.prototype),{constructor:a.QuaternionKeyframeTrack,ValueTypeName:"quaternion",DefaultInterpolation:a.InterpolateLinear,InterpolantFactoryMethodLinear:function(t){return new a.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),a.StringKeyframeTrack=function(t,e,i,n){a.KeyframeTrack.call(this,t,e,i,n)},a.StringKeyframeTrack.prototype=Object.assign(Object.create(a.KeyframeTrack.prototype),{constructor:a.StringKeyframeTrack,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:a.InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),a.VectorKeyframeTrack=function(t,e,i,n){a.KeyframeTrack.call(this,t,e,i,n)},a.VectorKeyframeTrack.prototype=Object.assign(Object.create(a.KeyframeTrack.prototype),{constructor:a.VectorKeyframeTrack,ValueTypeName:"vector"}),a.Audio=function(t){a.Object3D.call(this),this.type="Audio",this.context=t.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]; +},a.Audio.prototype=Object.assign(Object.create(a.Object3D.prototype),{constructor:a.Audio,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setBuffer:function(t){return this.source.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(this.isPlaying!==!0&&this.hasPlaybackControl!==!1){var t=this.context.createBufferSource();return t.buffer=this.source.buffer,t.loop=this.source.loop,t.onended=this.source.onended,t.start(0,this.startTime),t.playbackRate.value=this.playbackRate,this.isPlaying=!0,this.source=t,this.connect()}},pause:function(){if(this.hasPlaybackControl!==!1)return this.source.stop(),this.startTime=this.context.currentTime,this.isPlaying=!1,this},stop:function(){if(this.hasPlaybackControl!==!1)return this.source.stop(),this.startTime=0,this.isPlaying=!1,this},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t1?t.skinWeights[i+1]:0,c=e>2?t.skinWeights[i+2]:0,h=e>3?t.skinWeights[i+3]:0;s.skinWeights.push(new a.Vector4(r,o,c,h))}if(t.skinIndices)for(var i=0,n=t.skinIndices.length;i1?t.skinIndices[i+1]:0,d=e>2?t.skinIndices[i+2]:0,p=e>3?t.skinIndices[i+3]:0;s.skinIndices.push(new a.Vector4(l,u,d,p))}s.bones=t.bones,s.bones&&s.bones.length>0&&(s.skinWeights.length!==s.skinIndices.length||s.skinIndices.length!==s.vertices.length)}function r(e){if(void 0!==t.morphTargets)for(var i=0,n=t.morphTargets.length;i0)for(var u=s.faces,d=t.morphColors[0].colors,i=0,n=u.length;i0&&(s.animations=e)}var s=new a.Geometry,c=void 0!==t.scale?1/t.scale:1;if(i(c),n(),r(c),o(),s.computeFaceNormals(),s.computeBoundingSphere(),void 0===t.materials||0===t.materials.length)return{geometry:s};var h=a.Loader.prototype.initMaterials(t.materials,e,this.crossOrigin);return{geometry:s,materials:h}}}),a.LoadingManager=function(t,e,i){var n=this,r=!1,a=0,o=0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){o++,r===!1&&void 0!==n.onStart&&n.onStart(t,a,o),r=!0},this.itemEnd=function(t){a++,void 0!==n.onProgress&&n.onProgress(t,a,o),a===o&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)}},a.DefaultLoadingManager=new a.LoadingManager,a.BufferGeometryLoader=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager},Object.assign(a.BufferGeometryLoader.prototype,{load:function(t,e,i,n){var r=this,o=new a.XHRLoader(r.manager);o.load(t,function(t){e(r.parse(JSON.parse(t)))},i,n)},parse:function(t){var e=new a.BufferGeometry,i=t.data.index,n={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};if(void 0!==i){var r=new n[i.type](i.array);e.setIndex(new a.BufferAttribute(r,1))}var o=t.data.attributes;for(var s in o){var c=o[s],r=new n[c.type](c.array);e.addAttribute(s,new a.BufferAttribute(r,c.itemSize,c.normalized))}var h=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==h)for(var l=0,u=h.length;l!==u;++l){var d=h[l];e.addGroup(d.start,d.count,d.materialIndex)}var p=t.data.boundingSphere;if(void 0!==p){var f=new a.Vector3;void 0!==p.center&&f.fromArray(p.center),e.boundingSphere=new a.Sphere(f,p.radius)}return e}}),a.MaterialLoader=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.textures={}},Object.assign(a.MaterialLoader.prototype,{load:function(t,e,i,n){var r=this,o=new a.XHRLoader(r.manager);o.load(t,function(t){e(r.parse(JSON.parse(t)))},i,n)},setTextures:function(t){this.textures=t},getTexture:function(t){var e=this.textures;return void 0===e[t],e[t]},parse:function(t){var e=new a[t.type];if(void 0!==t.uuid&&(e.uuid=t.uuid),void 0!==t.name&&(e.name=t.name),void 0!==t.color&&e.color.setHex(t.color),void 0!==t.roughness&&(e.roughness=t.roughness),void 0!==t.metalness&&(e.metalness=t.metalness),void 0!==t.emissive&&e.emissive.setHex(t.emissive),void 0!==t.specular&&e.specular.setHex(t.specular),void 0!==t.shininess&&(e.shininess=t.shininess),void 0!==t.uniforms&&(e.uniforms=t.uniforms),void 0!==t.vertexShader&&(e.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(e.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(e.vertexColors=t.vertexColors),void 0!==t.shading&&(e.shading=t.shading),void 0!==t.blending&&(e.blending=t.blending),void 0!==t.side&&(e.side=t.side),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.transparent&&(e.transparent=t.transparent),void 0!==t.alphaTest&&(e.alphaTest=t.alphaTest),void 0!==t.depthTest&&(e.depthTest=t.depthTest),void 0!==t.depthWrite&&(e.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(e.colorWrite=t.colorWrite),void 0!==t.wireframe&&(e.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(e.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.size&&(e.size=t.size),void 0!==t.sizeAttenuation&&(e.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(e.map=this.getTexture(t.map)),void 0!==t.alphaMap&&(e.alphaMap=this.getTexture(t.alphaMap),e.transparent=!0),void 0!==t.bumpMap&&(e.bumpMap=this.getTexture(t.bumpMap)),void 0!==t.bumpScale&&(e.bumpScale=t.bumpScale),void 0!==t.normalMap&&(e.normalMap=this.getTexture(t.normalMap)),void 0!==t.normalScale){var i=t.normalScale;Array.isArray(i)===!1&&(i=[i,i]),e.normalScale=(new a.Vector2).fromArray(i)}if(void 0!==t.displacementMap&&(e.displacementMap=this.getTexture(t.displacementMap)),void 0!==t.displacementScale&&(e.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(e.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(e.roughnessMap=this.getTexture(t.roughnessMap)),void 0!==t.metalnessMap&&(e.metalnessMap=this.getTexture(t.metalnessMap)),void 0!==t.emissiveMap&&(e.emissiveMap=this.getTexture(t.emissiveMap)),void 0!==t.emissiveIntensity&&(e.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(e.specularMap=this.getTexture(t.specularMap)), +void 0!==t.envMap&&(e.envMap=this.getTexture(t.envMap),e.combine=a.MultiplyOperation),void 0!==t.reflectivity&&(e.reflectivity=t.reflectivity),void 0!==t.lightMap&&(e.lightMap=this.getTexture(t.lightMap)),void 0!==t.lightMapIntensity&&(e.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(e.aoMap=this.getTexture(t.aoMap)),void 0!==t.aoMapIntensity&&(e.aoMapIntensity=t.aoMapIntensity),void 0!==t.materials)for(var n=0,r=t.materials.length;n0){var o=new a.LoadingManager(e),s=new a.ImageLoader(o);s.setCrossOrigin(this.crossOrigin);for(var c=0,h=t.length;c0?new a.SkinnedMesh(c,h):new a.Mesh(c,h);break;case"LOD":s=new a.LOD;break;case"Line":s=new a.Line(r(e.geometry),o(e.material),e.mode);break;case"PointCloud":case"Points":s=new a.Points(r(e.geometry),o(e.material));break;case"Sprite":s=new a.Sprite(o(e.material));break;case"Group":s=new a.Group;break;default:s=new a.Object3D}if(s.uuid=e.uuid,void 0!==e.name&&(s.name=e.name),void 0!==e.matrix?(t.fromArray(e.matrix),t.decompose(s.position,s.quaternion,s.scale)):(void 0!==e.position&&s.position.fromArray(e.position),void 0!==e.rotation&&s.rotation.fromArray(e.rotation),void 0!==e.scale&&s.scale.fromArray(e.scale)),void 0!==e.castShadow&&(s.castShadow=e.castShadow),void 0!==e.receiveShadow&&(s.receiveShadow=e.receiveShadow),void 0!==e.visible&&(s.visible=e.visible),void 0!==e.userData&&(s.userData=e.userData),void 0!==e.children)for(var l in e.children)s.add(this.parseObject(e.children[l],i,n));if("LOD"===e.type)for(var u=e.levels,d=0;d0||0===t.search(/^data\:image\/jpeg/);r.format=n?a.RGBFormat:a.RGBAFormat,r.image=i,r.needsUpdate=!0,void 0!==e&&e(r)},i,n),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),a.CubeTextureLoader=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager},Object.assign(a.CubeTextureLoader.prototype,{load:function(t,e,i,n){function r(i){s.load(t[i],function(t){o.images[i]=t,c++,6===c&&(o.needsUpdate=!0,e&&e(o))},void 0,n)}var o=new a.CubeTexture,s=new a.ImageLoader(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);for(var c=0,h=0;h0&&(n.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),i){var r=e(t.textures),o=e(t.images);r.length>0&&(n.textures=r),o.length>0&&(n.images=o)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.shading=t.shading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.overdraw=t.overdraw,this.visible=t.visible,this.clipShadows=t.clipShadows;var e=t.clippingPlanes,i=null;if(null!==e){var n=e.length;i=new Array(n);for(var r=0;r!==n;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},Object.assign(a.Material.prototype,a.EventDispatcher.prototype),a.MaterialIdCount=0,a.LineBasicMaterial=function(t){a.Material.call(this),this.type="LineBasicMaterial",this.color=new a.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)},a.LineBasicMaterial.prototype=Object.create(a.Material.prototype),a.LineBasicMaterial.prototype.constructor=a.LineBasicMaterial,a.LineBasicMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},a.LineDashedMaterial=function(t){a.Material.call(this),this.type="LineDashedMaterial",this.color=new a.Color(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.lights=!1,this.setValues(t)},a.LineDashedMaterial.prototype=Object.create(a.Material.prototype),a.LineDashedMaterial.prototype.constructor=a.LineDashedMaterial,a.LineDashedMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this},a.MeshBasicMaterial=function(t){a.Material.call(this),this.type="MeshBasicMaterial",this.color=new a.Color(16777215),this.map=null,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=a.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)},a.MeshBasicMaterial.prototype=Object.create(a.Material.prototype),a.MeshBasicMaterial.prototype.constructor=a.MeshBasicMaterial,a.MeshBasicMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},a.MeshDepthMaterial=function(t){a.Material.call(this),this.type="MeshDepthMaterial",this.depthPacking=a.BasicDepthPacking,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)},a.MeshDepthMaterial.prototype=Object.create(a.Material.prototype),a.MeshDepthMaterial.prototype.constructor=a.MeshDepthMaterial,a.MeshDepthMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},a.MeshLambertMaterial=function(t){a.Material.call(this),this.type="MeshLambertMaterial",this.color=new a.Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new a.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=a.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)},a.MeshLambertMaterial.prototype=Object.create(a.Material.prototype),a.MeshLambertMaterial.prototype.constructor=a.MeshLambertMaterial,a.MeshLambertMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},a.MeshNormalMaterial=function(t){a.Material.call(this,t),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.morphTargets=!1,this.setValues(t)},a.MeshNormalMaterial.prototype=Object.create(a.Material.prototype),a.MeshNormalMaterial.prototype.constructor=a.MeshNormalMaterial,a.MeshNormalMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},a.MeshPhongMaterial=function(t){a.Material.call(this),this.type="MeshPhongMaterial",this.color=new a.Color(16777215),this.specular=new a.Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new a.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new a.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=a.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)},a.MeshPhongMaterial.prototype=Object.create(a.Material.prototype),a.MeshPhongMaterial.prototype.constructor=a.MeshPhongMaterial,a.MeshPhongMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},a.MeshStandardMaterial=function(t){a.Material.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new a.Color(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new a.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new a.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)},a.MeshStandardMaterial.prototype=Object.create(a.Material.prototype),a.MeshStandardMaterial.prototype.constructor=a.MeshStandardMaterial,a.MeshStandardMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},a.MeshPhysicalMaterial=function(t){a.MeshStandardMaterial.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)},a.MeshPhysicalMaterial.prototype=Object.create(a.MeshStandardMaterial.prototype),a.MeshPhysicalMaterial.prototype.constructor=a.MeshPhysicalMaterial,a.MeshPhysicalMaterial.prototype.copy=function(t){return a.MeshStandardMaterial.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},a.MultiMaterial=function(t){this.uuid=a.Math.generateUUID(),this.type="MultiMaterial",this.materials=t instanceof Array?t:[],this.visible=!0},a.MultiMaterial.prototype={constructor:a.MultiMaterial,toJSON:function(t){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},i=this.materials,n=0,r=i.length;n2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}if(void 0!==t.textures[this.uuid])return t.textures[this.uuid];var i={metadata:{version:4.4,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],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var n=this.image;void 0===n.uuid&&(n.uuid=a.Math.generateUUID()),void 0===t.images[n.uuid]&&(t.images[n.uuid]={uuid:n.uuid,url:e(n)}),i.image=n.uuid}return t.textures[this.uuid]=i,i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===a.UVMapping){if(t.multiply(this.repeat),t.add(this.offset),t.x<0||t.x>1)switch(this.wrapS){case a.RepeatWrapping:t.x=t.x-Math.floor(t.x);break;case a.ClampToEdgeWrapping:t.x=t.x<0?0:1;break;case a.MirroredRepeatWrapping:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case a.RepeatWrapping:t.y=t.y-Math.floor(t.y);break;case a.ClampToEdgeWrapping:t.y=t.y<0?0:1;break;case a.MirroredRepeatWrapping:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}},Object.assign(a.Texture.prototype,a.EventDispatcher.prototype),a.TextureIdCount=0,a.DepthTexture=function(t,e,i,n,r,o,s,c,h){a.Texture.call(this,null,n,r,o,s,c,a.DepthFormat,i,h),this.image={width:t,height:e},this.type=void 0!==i?i:a.UnsignedShortType, +this.magFilter=void 0!==s?s:a.NearestFilter,this.minFilter=void 0!==c?c:a.NearestFilter,this.flipY=!1,this.generateMipmaps=!1},a.DepthTexture.prototype=Object.create(a.Texture.prototype),a.DepthTexture.prototype.constructor=a.DepthTexture,a.CanvasTexture=function(t,e,i,n,r,o,s,c,h){a.Texture.call(this,t,e,i,n,r,o,s,c,h),this.needsUpdate=!0},a.CanvasTexture.prototype=Object.create(a.Texture.prototype),a.CanvasTexture.prototype.constructor=a.CanvasTexture,a.CubeTexture=function(t,e,i,n,r,o,s,c,h,l){t=void 0!==t?t:[],e=void 0!==e?e:a.CubeReflectionMapping,a.Texture.call(this,t,e,i,n,r,o,s,c,h,l),this.flipY=!1},a.CubeTexture.prototype=Object.create(a.Texture.prototype),a.CubeTexture.prototype.constructor=a.CubeTexture,Object.defineProperty(a.CubeTexture.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),a.CompressedTexture=function(t,e,i,n,r,o,s,c,h,l,u,d){a.Texture.call(this,null,o,s,c,h,l,n,r,u,d),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1},a.CompressedTexture.prototype=Object.create(a.Texture.prototype),a.CompressedTexture.prototype.constructor=a.CompressedTexture,a.DataTexture=function(t,e,i,n,r,o,s,c,h,l,u,d){a.Texture.call(this,null,o,s,c,h,l,n,r,u,d),this.image={data:t,width:e,height:i},this.magFilter=void 0!==h?h:a.NearestFilter,this.minFilter=void 0!==l?l:a.NearestFilter,this.flipY=!1,this.generateMipmaps=!1},a.DataTexture.prototype=Object.create(a.Texture.prototype),a.DataTexture.prototype.constructor=a.DataTexture,a.VideoTexture=function(t,e,i,n,r,o,s,c,h){function l(){requestAnimationFrame(l),t.readyState>=t.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}a.Texture.call(this,t,e,i,n,r,o,s,c,h),this.generateMipmaps=!1;var u=this;l()},a.VideoTexture.prototype=Object.create(a.Texture.prototype),a.VideoTexture.prototype.constructor=a.VideoTexture,a.Group=function(){a.Object3D.call(this),this.type="Group"},a.Group.prototype=Object.assign(Object.create(a.Object3D.prototype),{constructor:a.Group}),a.Points=function(t,e){a.Object3D.call(this),this.type="Points",this.geometry=void 0!==t?t:new a.BufferGeometry,this.material=void 0!==e?e:new a.PointsMaterial({color:16777215*Math.random()})},a.Points.prototype=Object.assign(Object.create(a.Object3D.prototype),{constructor:a.Points,raycast:function(){var t=new a.Matrix4,e=new a.Ray,i=new a.Sphere;return function(n,r){function o(t,i){var a=e.distanceSqToPoint(t);if(an.far)return;r.push({distance:c,distanceToRay:Math.sqrt(a),point:o.clone(),index:i,face:null,object:s})}}var s=this,c=this.geometry,h=this.matrixWorld,l=n.params.Points.threshold;if(null===c.boundingSphere&&c.computeBoundingSphere(),i.copy(c.boundingSphere),i.applyMatrix4(h),n.ray.intersectsSphere(i)!==!1){t.getInverse(h),e.copy(n.ray).applyMatrix4(t);var u=l/((this.scale.x+this.scale.y+this.scale.z)/3),d=u*u,p=new a.Vector3;if(c instanceof a.BufferGeometry){var f=c.index,m=c.attributes,g=m.position.array;if(null!==f)for(var v=f.array,y=0,x=v.length;ys)){p.applyMatrix4(this.matrixWorld);var S=n.ray.origin.distanceTo(p);Sn.far||r.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}else for(var x=0,b=v.length/3-1;xs)){p.applyMatrix4(this.matrixWorld);var S=n.ray.origin.distanceTo(p);Sn.far||r.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}else if(c instanceof a.Geometry)for(var T=c.vertices,L=T.length,x=0;xs)){p.applyMatrix4(this.matrixWorld);var S=n.ray.origin.distanceTo(p);Sn.far||r.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:x,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),a.LineSegments=function(t,e){a.Line.call(this,t,e),this.type="LineSegments"},a.LineSegments.prototype=Object.assign(Object.create(a.Line.prototype),{constructor:a.LineSegments}),a.Mesh=function(t,e){a.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new a.BufferGeometry,this.material=void 0!==e?e:new a.MeshBasicMaterial({color:16777215*Math.random()}),this.drawMode=a.TrianglesDrawMode,this.updateMorphTargets()},a.Mesh.prototype=Object.assign(Object.create(a.Object3D.prototype),{constructor:a.Mesh,setDrawMode:function(t){this.drawMode=t},copy:function(t){return a.Object3D.prototype.copy.call(this,t),this.drawMode=t.drawMode,this},updateMorphTargets:function(){if(void 0!==this.geometry.morphTargets&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var t=0,e=this.geometry.morphTargets.length;te.far?null:{distance:l,point:y.clone(),object:t}}function i(i,n,r,o,l,u,d,g){s.fromArray(o,3*u),c.fromArray(o,3*d),h.fromArray(o,3*g);var y=e(i,n,r,s,c,h,v);return y&&(l&&(p.fromArray(l,2*u),f.fromArray(l,2*d),m.fromArray(l,2*g),y.uv=t(v,s,c,h,p,f,m)),y.face=new a.Face3(u,d,g,a.Triangle.normal(s,c,h)),y.faceIndex=u),y}var n=new a.Matrix4,r=new a.Ray,o=new a.Sphere,s=new a.Vector3,c=new a.Vector3,h=new a.Vector3,l=new a.Vector3,u=new a.Vector3,d=new a.Vector3,p=new a.Vector2,f=new a.Vector2,m=new a.Vector2,g=new a.Vector3,v=new a.Vector3,y=new a.Vector3;return function(g,y){var x=this.geometry,b=this.material,_=this.matrixWorld;if(void 0!==b&&(null===x.boundingSphere&&x.computeBoundingSphere(),o.copy(x.boundingSphere),o.applyMatrix4(_),g.ray.intersectsSphere(o)!==!1&&(n.getInverse(_),r.copy(g.ray).applyMatrix4(n),null===x.boundingBox||r.intersectsBox(x.boundingBox)!==!1))){var M,w;if(x instanceof a.BufferGeometry){var S,T,L,A=x.index,C=x.attributes,E=C.position.array;if(void 0!==C.uv&&(M=C.uv.array),null!==A)for(var P=A.array,R=0,D=P.length;R0&&(M=G);for(var z=0,k=V.length;z1){t.setFromMatrixPosition(i.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var r=t.distanceTo(e);n[0].object.visible=!0;for(var a=1,o=n.length;a=n[a].distance;a++)n[a-1].object.visible=!1,n[a].object.visible=!0;for(;ar||i.push({distance:Math.sqrt(n),point:this.position,face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),a.LensFlare=function(t,e,i,n,r){a.Object3D.call(this),this.lensFlares=[],this.positionScreen=new a.Vector3,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,i,n,r)},a.LensFlare.prototype=Object.assign(Object.create(a.Object3D.prototype),{constructor:a.LensFlare,copy:function(t){a.Object3D.prototype.copy.call(this,t),this.positionScreen.copy(t.positionScreen),this.customUpdateCallback=t.customUpdateCallback;for(var e=0,i=t.lensFlares.length;e=0){var u=o[h];if(void 0!==u){var d=At.FLOAT,p=u.array,f=u.normalized;p instanceof Float32Array?d=At.FLOAT:p instanceof Float64Array||(p instanceof Uint16Array?d=At.UNSIGNED_SHORT:p instanceof Int16Array?d=At.SHORT:p instanceof Uint32Array?d=At.UNSIGNED_INT:p instanceof Int32Array?d=At.INT:p instanceof Int8Array?d=At.BYTE:p instanceof Uint8Array&&(d=At.UNSIGNED_BYTE));var m=u.itemSize,g=Bt.getAttributeBuffer(u);if(u instanceof a.InterleavedBufferAttribute){var v=u.data,y=v.stride,x=u.offset;v instanceof a.InstancedInterleavedBuffer?(Dt.enableAttributeAndDivisor(l,v.meshPerAttribute,r),void 0===i.maxInstancedCount&&(i.maxInstancedCount=v.meshPerAttribute*v.count)):Dt.enableAttribute(l),At.bindBuffer(At.ARRAY_BUFFER,g),At.vertexAttribPointer(l,m,d,f,y*v.array.BYTES_PER_ELEMENT,(n*y+x)*v.array.BYTES_PER_ELEMENT)}else u instanceof a.InstancedBufferAttribute?(Dt.enableAttributeAndDivisor(l,u.meshPerAttribute,r),void 0===i.maxInstancedCount&&(i.maxInstancedCount=u.meshPerAttribute*u.count)):Dt.enableAttribute(l),At.bindBuffer(At.ARRAY_BUFFER,g),At.vertexAttribPointer(l,m,d,f,0,n*m*u.array.BYTES_PER_ELEMENT)}else if(void 0!==c){var b=c[h];if(void 0!==b)switch(b.length){case 2:At.vertexAttrib2fv(l,b);break;case 3:At.vertexAttrib3fv(l,b);break;case 4:At.vertexAttrib4fv(l,b);break;default:At.vertexAttrib1fv(l,b)}}}}Dt.disableUnusedAttributes()}}function u(t,e){return Math.abs(e[0])-Math.abs(t[0])}function d(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.material.program&&e.material.program&&t.material.program!==e.material.program?t.material.program.id-e.material.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function p(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function f(t,e,i,n,r){var a,o;i.transparent?(a=q,o=++Z):(a=X,o=++Y);var s=a[o];void 0!==s?(s.id=t.id,s.object=t,s.geometry=e,s.material=i,s.z=St.z,s.group=r):(s={id:t.id,object:t,geometry:e,material:i,z:St.z,group:r},a.push(s))}function m(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Mt.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),v(Mt)}function g(t){return Mt.center.set(0,0,0),Mt.radius=.7071067811865476,Mt.applyMatrix4(t.matrixWorld),v(Mt)}function v(t){if(!yt.intersectsSphere(t))return!1;var e=xt.numPlanes;if(0===e)return!0;var i=$.clippingPlanes,n=t.center,r=-t.radius,a=0;do if(i[a].distanceToPoint(n)=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(var p=0;p<$.maxMorphNormals;p++)d["morphNormal"+p]>=0&&t.numSupportedMorphNormals++}var f=n.__webglShader.uniforms;(t instanceof a.ShaderMaterial||t instanceof a.RawShaderMaterial)&&t.clipping!==!0||(n.numClippingPlanes=xt.numPlanes,f.clippingPlanes=xt.uniform),t.lights&&(n.lightsHash=Tt.hash,f.ambientLightColor.value=Tt.ambient,f.directionalLights.value=Tt.directional,f.spotLights.value=Tt.spot,f.pointLights.value=Tt.point,f.hemisphereLights.value=Tt.hemi,f.directionalShadowMap.value=Tt.directionalShadowMap,f.directionalShadowMatrix.value=Tt.directionalShadowMatrix,f.spotShadowMap.value=Tt.spotShadowMap,f.spotShadowMatrix.value=Tt.spotShadowMatrix,f.pointShadowMap.value=Tt.pointShadowMap,f.pointShadowMatrix.value=Tt.pointShadowMatrix);var m=n.program.getUniforms(),g=a.WebGLUniforms.seqWithValue(m.seq,f);n.uniformsList=g,n.dynamicUniforms=a.WebGLUniforms.splitDynamic(g,f)}function _(t){t.side!==a.DoubleSide?Dt.enable(At.CULL_FACE):Dt.disable(At.CULL_FACE),Dt.setFlipSided(t.side===a.BackSide),t.transparent===!0?Dt.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):Dt.setBlending(a.NoBlending),Dt.setDepthFunc(t.depthFunc),Dt.setDepthTest(t.depthTest),Dt.setDepthWrite(t.depthWrite),Dt.setColorWrite(t.colorWrite),Dt.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function M(t,e,i,n){ht=0;var r=It.get(i);if(bt){if(_t||t!==at){var o=t===at&&i.id===nt;xt.setState(i.clippingPlanes,i.clipShadows,t,r,o)}void 0!==r.numClippingPlanes&&r.numClippingPlanes!==xt.numPlanes&&(i.needsUpdate=!0)}void 0===r.program&&(i.needsUpdate=!0),void 0!==r.lightsHash&&r.lightsHash!==Tt.hash&&(i.needsUpdate=!0),i.needsUpdate&&(b(i,e,n),i.needsUpdate=!1);var s=!1,c=!1,h=!1,l=r.program,u=l.getUniforms(),d=r.__webglShader.uniforms;if(l.id!==tt&&(At.useProgram(l.program),tt=l.id,s=!0,c=!0,h=!0),i.id!==nt&&(nt=i.id,c=!0),s||t!==at){if(u.set(At,t,"projectionMatrix"),Rt.logarithmicDepthBuffer&&u.setValue(At,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),t!==at&&(at=t,c=!0,h=!0),i instanceof a.ShaderMaterial||i instanceof a.MeshPhongMaterial||i instanceof a.MeshStandardMaterial||i.envMap){var p=u.map.cameraPosition;void 0!==p&&p.setValue(At,St.setFromMatrixPosition(t.matrixWorld))}(i instanceof a.MeshPhongMaterial||i instanceof a.MeshLambertMaterial||i instanceof a.MeshBasicMaterial||i instanceof a.MeshStandardMaterial||i instanceof a.ShaderMaterial||i.skinning)&&u.setValue(At,"viewMatrix",t.matrixWorldInverse),u.set(At,$,"toneMappingExposure"),u.set(At,$,"toneMappingWhitePoint")}if(i.skinning){u.setOptional(At,n,"bindMatrix"),u.setOptional(At,n,"bindMatrixInverse");var f=n.skeleton;f&&(Rt.floatVertexTextures&&f.useVertexTexture?(u.set(At,f,"boneTexture"),u.set(At,f,"boneTextureWidth"),u.set(At,f,"boneTextureHeight")):u.setOptional(At,f,"boneMatrices"))}c&&(i.lights&&D(d,h),e&&i.fog&&A(d,e),(i instanceof a.MeshBasicMaterial||i instanceof a.MeshLambertMaterial||i instanceof a.MeshPhongMaterial||i instanceof a.MeshStandardMaterial||i instanceof a.MeshDepthMaterial)&&w(d,i),i instanceof a.LineBasicMaterial?S(d,i):i instanceof a.LineDashedMaterial?(S(d,i),T(d,i)):i instanceof a.PointsMaterial?L(d,i):i instanceof a.MeshLambertMaterial?C(d,i):i instanceof a.MeshPhongMaterial?E(d,i):i instanceof a.MeshPhysicalMaterial?R(d,i):i instanceof a.MeshStandardMaterial?P(d,i):i instanceof a.MeshDepthMaterial?i.displacementMap&&(d.displacementMap.value=i.displacementMap,d.displacementScale.value=i.displacementScale,d.displacementBias.value=i.displacementBias):i instanceof a.MeshNormalMaterial&&(d.opacity.value=i.opacity),a.WebGLUniforms.upload(At,r.uniformsList,d,$)),u.set(At,n,"modelViewMatrix"),u.set(At,n,"normalMatrix"),u.setValue(At,"modelMatrix",n.matrixWorld);var m=r.dynamicUniforms;return null!==m&&(a.WebGLUniforms.evalDynamic(m,d,n,t),a.WebGLUniforms.upload(At,m,d,$)),l}function w(t,e){t.opacity.value=e.opacity,t.diffuse.value=e.color,e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),t.map.value=e.map,t.specularMap.value=e.specularMap,t.alphaMap.value=e.alphaMap,e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity);var i;if(e.map?i=e.map:e.specularMap?i=e.specularMap:e.displacementMap?i=e.displacementMap:e.normalMap?i=e.normalMap:e.bumpMap?i=e.bumpMap:e.roughnessMap?i=e.roughnessMap:e.metalnessMap?i=e.metalnessMap:e.alphaMap?i=e.alphaMap:e.emissiveMap&&(i=e.emissiveMap),void 0!==i){i instanceof a.WebGLRenderTarget&&(i=i.texture);var n=i.offset,r=i.repeat;t.offsetRepeat.value.set(n.x,n.y,r.x,r.y)}t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap instanceof a.CubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio}function S(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}function T(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function L(t,e){if(t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*ft,t.scale.value=.5*F.clientHeight,t.map.value=e.map,null!==e.map){var i=e.map.offset,n=e.map.repeat;t.offsetRepeat.value.set(i.x,i.y,n.x,n.y)}}function A(t,e){t.fogColor.value=e.color,e instanceof a.Fog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e instanceof a.FogExp2&&(t.fogDensity.value=e.density)}function C(t,e){e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function E(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function P(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function R(t,e){t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness,P(t,e)}function D(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLights.needsUpdate=e,t.pointLights.needsUpdate=e,t.spotLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function I(t){for(var e=0,i=0,n=t.length;i=Rt.maxTextures,ht+=1,t}function U(t){var e;if(t===a.RepeatWrapping)return At.REPEAT;if(t===a.ClampToEdgeWrapping)return At.CLAMP_TO_EDGE;if(t===a.MirroredRepeatWrapping)return At.MIRRORED_REPEAT;if(t===a.NearestFilter)return At.NEAREST;if(t===a.NearestMipMapNearestFilter)return At.NEAREST_MIPMAP_NEAREST;if(t===a.NearestMipMapLinearFilter)return At.NEAREST_MIPMAP_LINEAR;if(t===a.LinearFilter)return At.LINEAR;if(t===a.LinearMipMapNearestFilter)return At.LINEAR_MIPMAP_NEAREST;if(t===a.LinearMipMapLinearFilter)return At.LINEAR_MIPMAP_LINEAR;if(t===a.UnsignedByteType)return At.UNSIGNED_BYTE;if(t===a.UnsignedShort4444Type)return At.UNSIGNED_SHORT_4_4_4_4;if(t===a.UnsignedShort5551Type)return At.UNSIGNED_SHORT_5_5_5_1;if(t===a.UnsignedShort565Type)return At.UNSIGNED_SHORT_5_6_5;if(t===a.ByteType)return At.BYTE;if(t===a.ShortType)return At.SHORT;if(t===a.UnsignedShortType)return At.UNSIGNED_SHORT;if(t===a.IntType)return At.INT;if(t===a.UnsignedIntType)return At.UNSIGNED_INT;if(t===a.FloatType)return At.FLOAT;if(e=Pt.get("OES_texture_half_float"),null!==e&&t===a.HalfFloatType)return e.HALF_FLOAT_OES;if(t===a.AlphaFormat)return At.ALPHA;if(t===a.RGBFormat)return At.RGB;if(t===a.RGBAFormat)return At.RGBA;if(t===a.LuminanceFormat)return At.LUMINANCE;if(t===a.LuminanceAlphaFormat)return At.LUMINANCE_ALPHA;if(t===a.DepthFormat)return At.DEPTH_COMPONENT;if(t===a.AddEquation)return At.FUNC_ADD;if(t===a.SubtractEquation)return At.FUNC_SUBTRACT;if(t===a.ReverseSubtractEquation)return At.FUNC_REVERSE_SUBTRACT;if(t===a.ZeroFactor)return At.ZERO;if(t===a.OneFactor)return At.ONE;if(t===a.SrcColorFactor)return At.SRC_COLOR;if(t===a.OneMinusSrcColorFactor)return At.ONE_MINUS_SRC_COLOR;if(t===a.SrcAlphaFactor)return At.SRC_ALPHA;if(t===a.OneMinusSrcAlphaFactor)return At.ONE_MINUS_SRC_ALPHA;if(t===a.DstAlphaFactor)return At.DST_ALPHA;if(t===a.OneMinusDstAlphaFactor)return At.ONE_MINUS_DST_ALPHA;if(t===a.DstColorFactor)return At.DST_COLOR;if(t===a.OneMinusDstColorFactor)return At.ONE_MINUS_DST_COLOR;if(t===a.SrcAlphaSaturateFactor)return At.SRC_ALPHA_SATURATE;if(e=Pt.get("WEBGL_compressed_texture_s3tc"),null!==e){if(t===a.RGB_S3TC_DXT1_Format)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===a.RGBA_S3TC_DXT1_Format)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===a.RGBA_S3TC_DXT3_Format)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===a.RGBA_S3TC_DXT5_Format)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e=Pt.get("WEBGL_compressed_texture_pvrtc"),null!==e){if(t===a.RGB_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===a.RGB_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===a.RGBA_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===a.RGBA_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e=Pt.get("WEBGL_compressed_texture_etc1"),null!==e&&t===a.RGB_ETC1_Format)return e.COMPRESSED_RGB_ETC1_WEBGL;if(e=Pt.get("EXT_blend_minmax"),null!==e){if(t===a.MinEquation)return e.MIN_EXT;if(t===a.MaxEquation)return e.MAX_EXT}return 0}t=t||{};var F=void 0!==t.canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),N=void 0!==t.context?t.context:null,V=void 0!==t.alpha&&t.alpha,G=void 0===t.depth||t.depth,z=void 0===t.stencil||t.stencil,k=void 0!==t.antialias&&t.antialias,j=void 0===t.premultipliedAlpha||t.premultipliedAlpha,W=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,H=[],X=[],Y=-1,q=[],Z=-1,K=new Float32Array(8),Q=[],J=[];this.domElement=F,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=a.LinearToneMapping,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var $=this,tt=null,et=null,it=null,nt=-1,rt="",at=null,ot=new a.Vector4,st=null,ct=new a.Vector4,ht=0,lt=new a.Color(0),ut=0,dt=F.width,pt=F.height,ft=1,mt=new a.Vector4(0,0,dt,pt),gt=!1,vt=new a.Vector4(0,0,dt,pt),yt=new a.Frustum,xt=new a.WebGLClipping,bt=!1,_t=!1,Mt=new a.Sphere,wt=new a.Matrix4,St=new a.Vector3,Tt={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},Lt={calls:0,vertices:0,faces:0,points:0};this.info={render:Lt,memory:{geometries:0,textures:0},programs:null};var At;try{var Ct={alpha:V,depth:G,stencil:z,antialias:k,premultipliedAlpha:j,preserveDrawingBuffer:W};if(At=N||F.getContext("webgl",Ct)||F.getContext("experimental-webgl",Ct),null===At)throw null!==F.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";void 0===At.getShaderPrecisionFormat&&(At.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),F.addEventListener("webglcontextlost",o,!1)}catch(Et){}var Pt=new a.WebGLExtensions(At);Pt.get("WEBGL_depth_texture"),Pt.get("OES_texture_float"),Pt.get("OES_texture_float_linear"),Pt.get("OES_texture_half_float"),Pt.get("OES_texture_half_float_linear"),Pt.get("OES_standard_derivatives"),Pt.get("ANGLE_instanced_arrays"),Pt.get("OES_element_index_uint")&&(a.BufferGeometry.MaxIndex=4294967296);var Rt=new a.WebGLCapabilities(At,Pt,t),Dt=new a.WebGLState(At,Pt,U),It=new a.WebGLProperties,Ot=new a.WebGLTextures(At,Pt,Dt,It,Rt,U,this.info),Bt=new a.WebGLObjects(At,It,this.info),Ut=new a.WebGLPrograms(this,Rt),Ft=new a.WebGLLights;this.info.programs=Ut.programs;var Nt=new a.WebGLBufferRenderer(At,Pt,Lt),Vt=new a.WebGLIndexedBufferRenderer(At,Pt,Lt),Gt=new a.OrthographicCamera((-1),1,1,(-1),0,1),zt=new a.PerspectiveCamera,kt=new a.Mesh(new a.PlaneBufferGeometry(2,2),new a.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1})),jt=a.ShaderLib.cube,Wt=new a.Mesh(new a.BoxBufferGeometry(5,5,5),new a.ShaderMaterial({uniforms:jt.uniforms,vertexShader:jt.vertexShader,fragmentShader:jt.fragmentShader,side:a.BackSide,depthTest:!1,depthWrite:!1,fog:!1}));n(),this.context=At,this.capabilities=Rt,this.extensions=Pt,this.properties=It,this.state=Dt;var Ht=new a.WebGLShadowMap(this,Tt,Bt,Rt);this.shadowMap=Ht;var Xt=new a.SpritePlugin(this,Q),Yt=new a.LensFlarePlugin(this,J);this.getContext=function(){return At},this.getContextAttributes=function(){return At.getContextAttributes()},this.forceContextLoss=function(){Pt.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){return Rt.getMaxAnisotropy()},this.getPrecision=function(){return Rt.precision},this.getPixelRatio=function(){return ft},this.setPixelRatio=function(t){void 0!==t&&(ft=t,this.setSize(vt.z,vt.w,!1))},this.getSize=function(){return{width:dt,height:pt}},this.setSize=function(t,e,i){dt=t,pt=e,F.width=t*ft,F.height=e*ft,i!==!1&&(F.style.width=t+"px",F.style.height=e+"px"),this.setViewport(0,0,t,e)},this.setViewport=function(t,e,i,n){Dt.viewport(vt.set(t,e,i,n))},this.setScissor=function(t,e,i,n){Dt.scissor(mt.set(t,e,i,n))},this.setScissorTest=function(t){Dt.setScissorTest(gt=t)},this.getClearColor=function(){return lt},this.setClearColor=function(t,e){lt.set(t),ut=void 0!==e?e:1,i(lt.r,lt.g,lt.b,ut)},this.getClearAlpha=function(){return ut},this.setClearAlpha=function(t){ut=t,i(lt.r,lt.g,lt.b,ut)},this.clear=function(t,e,i){var n=0;(void 0===t||t)&&(n|=At.COLOR_BUFFER_BIT),(void 0===e||e)&&(n|=At.DEPTH_BUFFER_BIT),(void 0===i||i)&&(n|=At.STENCIL_BUFFER_BIT),At.clear(n)},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(t,e,i,n){this.setRenderTarget(t),this.clear(e,i,n)},this.resetGLState=r,this.dispose=function(){q=[],Z=-1,X=[],Y=-1,F.removeEventListener("webglcontextlost",o,!1)},this.renderBufferImmediate=function(t,e,i){Dt.initAttributes();var n=It.get(t);t.hasPositions&&!n.position&&(n.position=At.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=At.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=At.createBuffer()),t.hasColors&&!n.color&&(n.color=At.createBuffer());var r=e.getAttributes();if(t.hasPositions&&(At.bindBuffer(At.ARRAY_BUFFER,n.position),At.bufferData(At.ARRAY_BUFFER,t.positionArray,At.DYNAMIC_DRAW),Dt.enableAttribute(r.position),At.vertexAttribPointer(r.position,3,At.FLOAT,!1,0,0)),t.hasNormals){if(At.bindBuffer(At.ARRAY_BUFFER,n.normal),"MeshPhongMaterial"!==i.type&&"MeshStandardMaterial"!==i.type&&"MeshPhysicalMaterial"!==i.type&&i.shading===a.FlatShading)for(var o=0,s=3*t.count;o8&&(f.length=8);for(var y=n.morphAttributes,m=0,g=f.length;m0&&w.renderInstances(n,P,D):w.render(P,D)},this.render=function(t,e,n,r){if(e instanceof a.Camera!=!1){var o=t.fog;rt="",nt=-1,at=null,t.autoUpdate===!0&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),e.matrixWorldInverse.getInverse(e.matrixWorld),wt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),yt.setFromMatrix(wt),H.length=0,Y=-1,Z=-1,Q.length=0,J.length=0,_t=this.localClippingEnabled,bt=xt.init(this.clippingPlanes,_t,e),y(t,e),X.length=Y+1,q.length=Z+1,$.sortObjects===!0&&(X.sort(d),q.sort(p)),bt&&xt.beginShadows(),I(H),Ht.render(t,e),O(H,e),bt&&xt.endShadows(),Lt.calls=0,Lt.vertices=0,Lt.faces=0,Lt.points=0,void 0===n&&(n=null),this.setRenderTarget(n);var s=t.background;if(null===s?i(lt.r,lt.g,lt.b,ut):s instanceof a.Color&&i(s.r,s.g,s.b,1),(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),s instanceof a.CubeTexture?(zt.projectionMatrix.copy(e.projectionMatrix),zt.matrixWorld.extractRotation(e.matrixWorld),zt.matrixWorldInverse.getInverse(zt.matrixWorld),Wt.material.uniforms.tCube.value=s,Wt.modelViewMatrix.multiplyMatrices(zt.matrixWorldInverse,Wt.matrixWorld),Bt.update(Wt),$.renderBufferDirect(zt,null,Wt.geometry,Wt.material,Wt,null)):s instanceof a.Texture&&(kt.material.map=s,Bt.update(kt),$.renderBufferDirect(Gt,null,kt.geometry,kt.material,kt,null)),t.overrideMaterial){var c=t.overrideMaterial;x(X,e,o,c),x(q,e,o,c)}else Dt.setBlending(a.NoBlending),x(X,e,o),x(q,e,o);Xt.render(t,e),Yt.render(t,e,ct),n&&Ot.updateRenderTargetMipmap(n),Dt.setDepthTest(!0),Dt.setDepthWrite(!0),Dt.setColorWrite(!0)}},this.setFaceCulling=function(t,e){Dt.setCullFace(t),Dt.setFlipSided(e===a.FrontFaceDirectionCW)},this.allocTextureUnit=B,this.setTexture2D=function(){var t=!1;return function(e,i){e instanceof a.WebGLRenderTarget&&(t||(t=!0),e=e.texture),Ot.setTexture2D(e,i)}}(),this.setTexture=function(){var t=!1;return function(e,i){t||(t=!0),Ot.setTexture2D(e,i)}}(),this.setTextureCube=function(){var t=!1;return function(e,i){e instanceof a.WebGLRenderTargetCube&&(t||(t=!0),e=e.texture),e instanceof a.CubeTexture||Array.isArray(e.image)&&6===e.image.length?Ot.setTextureCube(e,i):Ot.setTextureCubeDynamic(e,i)}}(),this.getCurrentRenderTarget=function(){return et},this.setRenderTarget=function(t){et=t,t&&void 0===It.get(t).__webglFramebuffer&&Ot.setupRenderTarget(t);var e,i=t instanceof a.WebGLRenderTargetCube;if(t){var n=It.get(t);e=i?n.__webglFramebuffer[t.activeCubeFace]:n.__webglFramebuffer,ot.copy(t.scissor),st=t.scissorTest,ct.copy(t.viewport)}else e=null,ot.copy(mt).multiplyScalar(ft),st=gt,ct.copy(vt).multiplyScalar(ft);if(it!==e&&(At.bindFramebuffer(At.FRAMEBUFFER,e),it=e),Dt.scissor(ot),Dt.setScissorTest(st),Dt.viewport(ct),i){var r=It.get(t.texture);At.framebufferTexture2D(At.FRAMEBUFFER,At.COLOR_ATTACHMENT0,At.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,r.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,i,n,r,o){if(t instanceof a.WebGLRenderTarget!=!1){var s=It.get(t).__webglFramebuffer;if(s){var c=!1;s!==it&&(At.bindFramebuffer(At.FRAMEBUFFER,s),c=!0);try{var h=t.texture;if(h.format!==a.RGBAFormat&&U(h.format)!==At.getParameter(At.IMPLEMENTATION_COLOR_READ_FORMAT))return;if(!(h.type===a.UnsignedByteType||U(h.type)===At.getParameter(At.IMPLEMENTATION_COLOR_READ_TYPE)||h.type===a.FloatType&&Pt.get("WEBGL_color_buffer_float")||h.type===a.HalfFloatType&&Pt.get("EXT_color_buffer_half_float")))return;At.checkFramebufferStatus(At.FRAMEBUFFER)===At.FRAMEBUFFER_COMPLETE&&e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&At.readPixels(e,i,n,r,U(h.format),U(h.type),o)}finally{c&&At.bindFramebuffer(At.FRAMEBUFFER,it)}}}}},a.WebGLRenderTarget=function(t,e,i){this.uuid=a.Math.generateUUID(),this.width=t,this.height=e,this.scissor=new a.Vector4(0,0,t,e),this.scissorTest=!1,this.viewport=new a.Vector4(0,0,t,e),i=i||{},void 0===i.minFilter&&(i.minFilter=a.LinearFilter),this.texture=new a.Texture((void 0),(void 0),i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=null},Object.assign(a.WebGLRenderTarget.prototype,a.EventDispatcher.prototype,{setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),a.WebGLRenderTargetCube=function(t,e,i){a.WebGLRenderTarget.call(this,t,e,i),this.activeCubeFace=0,this.activeMipMapLevel=0},a.WebGLRenderTargetCube.prototype=Object.create(a.WebGLRenderTarget.prototype),a.WebGLRenderTargetCube.prototype.constructor=a.WebGLRenderTargetCube,a.WebGLBufferRenderer=function(t,e,i){function n(t){s=t}function r(e,n){t.drawArrays(s,e,n),i.calls++,i.vertices+=n,s===t.TRIANGLES&&(i.faces+=n/3)}function o(n){var r=e.get("ANGLE_instanced_arrays");if(null!==r){var o=n.attributes.position,c=0;o instanceof a.InterleavedBufferAttribute?(c=o.data.count,r.drawArraysInstancedANGLE(s,0,c,n.maxInstancedCount)):(c=o.count,r.drawArraysInstancedANGLE(s,0,c,n.maxInstancedCount)),i.calls++,i.vertices+=c*n.maxInstancedCount,s===t.TRIANGLES&&(i.faces+=n.maxInstancedCount*c/3)}}var s;this.setMode=n,this.render=r,this.renderInstances=o},a.WebGLClipping=function(){function t(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),i.numPlanes=r}function e(t,e,n,r){var a=null!==t?t.length:0,o=null;if(0!==a){if(o=l.value,r!==!0||null===o){var s=n+4*a,u=e.matrixWorldInverse;h.getNormalMatrix(u),(null===o||o.length0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a;this.getMaxAnisotropy=n,this.getMaxPrecision=r,this.precision=void 0!==i.precision?i.precision:"highp",this.logarithmicDepthBuffer=void 0!==i.logarithmicDepthBuffer&&i.logarithmicDepthBuffer,this.maxTextures=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.maxVertexTextures=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxCubemapSize=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),this.maxAttributes=t.getParameter(t.MAX_VERTEX_ATTRIBS),this.maxVertexUniforms=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),this.maxVaryings=t.getParameter(t.MAX_VARYING_VECTORS),this.maxFragmentUniforms=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),this.vertexTextures=this.maxVertexTextures>0,this.floatFragmentTextures=!!e.get("OES_texture_float"),this.floatVertexTextures=this.vertexTextures&&this.floatFragmentTextures;var o=r(this.precision);o!==this.precision&&(this.precision=o),this.logarithmicDepthBuffer&&(this.logarithmicDepthBuffer=!!e.get("EXT_frag_depth"))},a.WebGLGeometries=function(t,e,i){function n(t){var e=t.geometry;if(void 0!==l[e.id])return l[e.id];e.addEventListener("dispose",r);var n;return e instanceof a.BufferGeometry?n=e:e instanceof a.Geometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new a.BufferGeometry).setFromObject(t)),n=e._bufferGeometry),l[e.id]=n,i.memory.geometries++,n}function r(t){var n=t.target,a=l[n.id];null!==a.index&&s(a.index),c(a.attributes),n.removeEventListener("dispose",r),delete l[n.id];var o=e.get(n);o.wireframe&&s(o.wireframe),e["delete"](n);var h=e.get(a);h.wireframe&&s(h.wireframe),e["delete"](a),i.memory.geometries--}function o(t){return t instanceof a.InterleavedBufferAttribute?e.get(t.data).__webglBuffer:e.get(t).__webglBuffer}function s(e){var i=o(e);void 0!==i&&(t.deleteBuffer(i),h(e))}function c(t){for(var e in t)s(t[e])}function h(t){t instanceof a.InterleavedBufferAttribute?e["delete"](t.data):e["delete"](t)}var l={};this.get=n},a.WebGLLights=function(){var t={};this.get=function(e){if(void 0!==t[e.id])return t[e.id];var i;switch(e.type){case"DirectionalLight":i={direction:new a.Vector3,color:new a.Color,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new a.Vector2};break;case"SpotLight":i={position:new a.Vector3,direction:new a.Vector3,color:new a.Color,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new a.Vector2};break;case"PointLight":i={position:new a.Vector3,color:new a.Color,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new a.Vector2};break;case"HemisphereLight":i={direction:new a.Vector3,skyColor:new a.Color,groundColor:new a.Color}}return t[e.id]=i,i}},a.WebGLObjects=function(t,e,i){function n(e){var i=u.get(e);e.geometry instanceof a.Geometry&&i.updateFromObject(e);var n=i.index,o=i.attributes;null!==n&&r(n,t.ELEMENT_ARRAY_BUFFER);for(var s in o)r(o[s],t.ARRAY_BUFFER);var c=i.morphAttributes;for(var s in c)for(var h=c[s],l=0,d=h.length;l65535?Uint32Array:Uint16Array,x=new a.BufferAttribute(new y(o),1);return r(x,t.ELEMENT_ARRAY_BUFFER),n.wireframe=x,x}function l(t,e,i){if(e>i){var n=e;e=i,i=n}var r=t[e];return void 0===r?(t[e]=[i],!0):r.indexOf(i)===-1&&(r.push(i),!0)}var u=new a.WebGLGeometries(t,e,i);this.getAttributeBuffer=c,this.getWireframeAttribute=h,this.update=n},a.WebGLProgram=function(){function t(t){switch(t){case a.LinearEncoding:return["Linear","( value )"];case a.sRGBEncoding:return["sRGB","( value )"];case a.RGBEEncoding:return["RGBE","( value )"];case a.RGBM7Encoding:return["RGBM","( value, 7.0 )"];case a.RGBM16Encoding:return["RGBM","( value, 16.0 )"];case a.RGBDEncoding:return["RGBD","( value, 256.0 )"];case a.GammaEncoding:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function e(e,i){var n=t(i);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function i(e,i){var n=t(i);return"vec4 "+e+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function n(t,e){var i;switch(e){case a.LinearToneMapping:i="Linear";break;case a.ReinhardToneMapping:i="Reinhard";break;case a.Uncharted2ToneMapping:i="Uncharted2";break;case a.CineonToneMapping:i="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function r(t,e,i){t=t||{};var n=[t.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return n.filter(c).join("\n")}function o(t){var e=[];for(var i in t){var n=t[i];n!==!1&&e.push("#define "+i+" "+n)}return e.join("\n")}function s(t,e,i){for(var n={},r=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),a=0;a");return l(i)}var i=/#include +<([\w\d.]+)>/g;return t.replace(i,e)}function u(t){function e(t,e,i,n){for(var r="",a=parseInt(e);a0?t.gammaFactor:1,C=r(v,m,t.extensions),E=o(y),P=g.createProgram();f instanceof a.RawShaderMaterial?(T=[E].filter(c).join("\n"),L=[E].filter(c).join("\n")):(T=["precision "+m.precision+" float;","precision "+m.precision+" int;","#define SHADER_NAME "+f.__webglShader.name,E,m.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+A,"#define MAX_BONES "+m.maxBones,m.map?"#define USE_MAP":"",m.envMap?"#define USE_ENVMAP":"",m.envMap?"#define "+w:"",m.lightMap?"#define USE_LIGHTMAP":"",m.aoMap?"#define USE_AOMAP":"",m.emissiveMap?"#define USE_EMISSIVEMAP":"",m.bumpMap?"#define USE_BUMPMAP":"",m.normalMap?"#define USE_NORMALMAP":"",m.displacementMap&&m.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",m.specularMap?"#define USE_SPECULARMAP":"",m.roughnessMap?"#define USE_ROUGHNESSMAP":"",m.metalnessMap?"#define USE_METALNESSMAP":"",m.alphaMap?"#define USE_ALPHAMAP":"",m.vertexColors?"#define USE_COLOR":"",m.flatShading?"#define FLAT_SHADED":"",m.skinning?"#define USE_SKINNING":"",m.useVertexTexture?"#define BONE_TEXTURE":"",m.morphTargets?"#define USE_MORPHTARGETS":"",m.morphNormals&&m.flatShading===!1?"#define USE_MORPHNORMALS":"",m.doubleSided?"#define DOUBLE_SIDED":"",m.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+m.numClippingPlanes,m.shadowMapEnabled?"#define USE_SHADOWMAP":"",m.shadowMapEnabled?"#define "+_:"",m.sizeAttenuation?"#define USE_SIZEATTENUATION":"",m.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",m.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","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(c).join("\n"),L=[C,"precision "+m.precision+" float;","precision "+m.precision+" int;","#define SHADER_NAME "+f.__webglShader.name,E,m.alphaTest?"#define ALPHATEST "+m.alphaTest:"","#define GAMMA_FACTOR "+A,m.useFog&&m.fog?"#define USE_FOG":"",m.useFog&&m.fogExp?"#define FOG_EXP2":"",m.map?"#define USE_MAP":"",m.envMap?"#define USE_ENVMAP":"",m.envMap?"#define "+M:"",m.envMap?"#define "+w:"",m.envMap?"#define "+S:"",m.lightMap?"#define USE_LIGHTMAP":"",m.aoMap?"#define USE_AOMAP":"",m.emissiveMap?"#define USE_EMISSIVEMAP":"",m.bumpMap?"#define USE_BUMPMAP":"",m.normalMap?"#define USE_NORMALMAP":"",m.specularMap?"#define USE_SPECULARMAP":"",m.roughnessMap?"#define USE_ROUGHNESSMAP":"",m.metalnessMap?"#define USE_METALNESSMAP":"",m.alphaMap?"#define USE_ALPHAMAP":"",m.vertexColors?"#define USE_COLOR":"",m.flatShading?"#define FLAT_SHADED":"",m.doubleSided?"#define DOUBLE_SIDED":"",m.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+m.numClippingPlanes,m.shadowMapEnabled?"#define USE_SHADOWMAP":"",m.shadowMapEnabled?"#define "+_:"",m.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",m.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",m.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",m.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",m.envMap&&t.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",m.toneMapping!==a.NoToneMapping?"#define TONE_MAPPING":"",m.toneMapping!==a.NoToneMapping?a.ShaderChunk.tonemapping_pars_fragment:"",m.toneMapping!==a.NoToneMapping?n("toneMapping",m.toneMapping):"",m.outputEncoding||m.mapEncoding||m.envMapEncoding||m.emissiveMapEncoding?a.ShaderChunk.encodings_pars_fragment:"",m.mapEncoding?e("mapTexelToLinear",m.mapEncoding):"",m.envMapEncoding?e("envMapTexelToLinear",m.envMapEncoding):"",m.emissiveMapEncoding?e("emissiveMapTexelToLinear",m.emissiveMapEncoding):"",m.outputEncoding?i("linearToOutputTexel",m.outputEncoding):"",m.depthPacking?"#define DEPTH_PACKING "+f.depthPacking:"","\n"].filter(c).join("\n")),x=l(x,m),x=h(x,m),b=l(b,m),b=h(b,m),f instanceof a.ShaderMaterial==!1&&(x=u(x),b=u(b));var R=T+x,D=L+b,I=a.WebGLShader(g,g.VERTEX_SHADER,R),O=a.WebGLShader(g,g.FRAGMENT_SHADER,D);g.attachShader(P,I),g.attachShader(P,O),void 0!==f.index0AttributeName?g.bindAttribLocation(P,0,f.index0AttributeName):m.morphTargets===!0&&g.bindAttribLocation(P,0,"position"),g.linkProgram(P);var B=g.getProgramInfoLog(P),U=g.getShaderInfoLog(I),F=g.getShaderInfoLog(O),N=!0,V=!0;g.getProgramParameter(P,g.LINK_STATUS)===!1?N=!1:""!==B||""!==U&&""!==F||(V=!1),V&&(this.diagnostics={runnable:N,material:f,programLog:B,vertexShader:{log:U,prefix:T},fragmentShader:{log:F,prefix:L}}),g.deleteShader(I),g.deleteShader(O);var G;this.getUniforms=function(){return void 0===G&&(G=new a.WebGLUniforms(g,P,t)),G};var z;return this.getAttributes=function(){return void 0===z&&(z=s(g,P)),z},this.destroy=function(){g.deleteProgram(P),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return this.getUniforms()}},attributes:{get:function(){return this.getAttributes()}}}),this.id=d++,this.code=p,this.usedTimes=1,this.program=P,this.vertexShader=I,this.fragmentShader=O,this}}(),a.WebGLPrograms=function(t,e){function i(t){if(e.floatVertexTextures&&t&&t.skeleton&&t.skeleton.useVertexTexture)return 1024;var i=e.maxVertexUniforms,n=Math.floor((i-20)/4),r=n;return void 0!==t&&t instanceof a.SkinnedMesh&&(r=Math.min(t.skeleton.bones.length,r),r0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===a.DoubleSide,flipSided:r.side===a.BackSide,depthPacking:void 0!==r.depthPacking&&r.depthPacking};return m},this.getProgramCode=function(t,e){var i=[];if(e.shaderID?i.push(e.shaderID):(i.push(t.fragmentShader),i.push(t.vertexShader)),void 0!==t.defines)for(var n in t.defines)i.push(n),i.push(t.defines[n]);for(var r=0;r0:o instanceof a.Geometry&&(l=o.morphTargets&&o.morphTargets.length>0));var u=e instanceof a.SkinnedMesh&&i.skinning,d=0;l&&(d|=v),u&&(d|=y),s=c[d]}if(t.localClippingEnabled&&i.clipShadows===!0&&0!==i.clippingPlanes.length){var p=s.uuid,f=i.uuid,m=M[p];void 0===m&&(m={},M[p]=m);var g=m[f];void 0===g&&(g=s.clone(),m[f]=g),s=g}s.visible=i.visible,s.wireframe=i.wireframe;var x=i.side;return O.renderSingleSided&&x==a.DoubleSide&&(x=a.FrontSide),O.renderReverseSided&&(x===a.FrontSide?x=a.BackSide:x===a.BackSide&&(x=a.FrontSide)),s.side=x,s.clipShadows=i.clipShadows,s.clippingPlanes=i.clippingPlanes,s.wireframeLinewidth=i.wireframeLinewidth,s.linewidth=i.linewidth,n&&void 0!==s.uniforms.lightPos&&s.uniforms.lightPos.value.copy(r),s}function o(t,e,i){if(t.visible!==!1){if(t.layers.test(e.layers)&&(t instanceof a.Mesh||t instanceof a.Line||t instanceof a.Points)&&t.castShadow&&(t.frustumCulled===!1||h.intersectsObject(t)===!0)){var n=t.material;n.visible===!0&&(t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),g.push(t))}for(var r=t.children,s=0,c=r.length;se||t.height>e){var i=e/Math.max(t.width,t.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"); +n.width=Math.floor(t.width*i),n.height=Math.floor(t.height*i);var r=n.getContext("2d");return r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height),n}return t}function h(t){return a.Math.isPowerOfTwo(t.width)&&a.Math.isPowerOfTwo(t.height)}function l(t){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement){var e=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");e.width=a.Math.nearestPowerOfTwo(t.width),e.height=a.Math.nearestPowerOfTwo(t.height);var i=e.getContext("2d");return i.drawImage(t,0,0,e.width,e.height),e}return t}function u(t){return t.wrapS!==a.ClampToEdgeWrapping||t.wrapT!==a.ClampToEdgeWrapping||t.minFilter!==a.NearestFilter&&t.minFilter!==a.LinearFilter}function d(e){return e===a.NearestFilter||e===a.NearestMipMapNearestFilter||e===a.NearestMipMapLinearFilter?t.NEAREST:t.LINEAR}function p(t){var e=t.target;e.removeEventListener("dispose",p),m(e),C.textures--}function f(t){var e=t.target;e.removeEventListener("dispose",f),g(e),C.textures--}function m(e){var i=n.get(e);if(e.image&&i.__image__webglTextureCube)t.deleteTexture(i.__image__webglTextureCube);else{if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture)}n["delete"](e)}function g(e){var i=n.get(e),r=n.get(e.texture);if(e){if(void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture),e.depthTexture&&e.depthTexture.dispose(),e instanceof a.WebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(i.__webglFramebuffer[o]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[o]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer);n["delete"](e.texture),n["delete"](e)}}function v(e,r){var a=n.get(e);if(e.version>0&&a.__version!==e.version){var o=e.image;if(void 0===o);else if(o.complete!==!1)return void _(a,e,r)}i.activeTexture(t.TEXTURE0+r),i.bindTexture(t.TEXTURE_2D,a.__webglTexture)}function y(e,s){var l=n.get(e);if(6===e.image.length)if(e.version>0&&l.__version!==e.version){l.__image__webglTextureCube||(e.addEventListener("dispose",p),l.__image__webglTextureCube=t.createTexture(),C.textures++),i.activeTexture(t.TEXTURE0+s),i.bindTexture(t.TEXTURE_CUBE_MAP,l.__image__webglTextureCube),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var u=e instanceof a.CompressedTexture,d=e.image[0]instanceof a.DataTexture,f=[],m=0;m<6;m++)u||d?f[m]=d?e.image[m].image:e.image[m]:f[m]=c(e.image[m],r.maxCubemapSize);var g=f[0],v=h(g),y=o(e.format),x=o(e.type);b(t.TEXTURE_CUBE_MAP,e,v);for(var m=0;m<6;m++)if(u)for(var _,M=f[m].mipmaps,w=0,S=M.length;w-1&&i.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+m,w,y,_.width,_.height,0,_.data):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+m,w,y,_.width,_.height,0,y,x,_.data);else d?i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,y,f[m].width,f[m].height,0,y,x,f[m].data):i.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,y,y,x,f[m]);e.generateMipmaps&&v&&t.generateMipmap(t.TEXTURE_CUBE_MAP),l.__version=e.version,e.onUpdate&&e.onUpdate(e)}else i.activeTexture(t.TEXTURE0+s),i.bindTexture(t.TEXTURE_CUBE_MAP,l.__image__webglTextureCube)}function x(e,r){i.activeTexture(t.TEXTURE0+r),i.bindTexture(t.TEXTURE_CUBE_MAP,n.get(e).__webglTexture)}function b(i,s,c){var h;if(c?(t.texParameteri(i,t.TEXTURE_WRAP_S,o(s.wrapS)),t.texParameteri(i,t.TEXTURE_WRAP_T,o(s.wrapT)),t.texParameteri(i,t.TEXTURE_MAG_FILTER,o(s.magFilter)),t.texParameteri(i,t.TEXTURE_MIN_FILTER,o(s.minFilter))):(t.texParameteri(i,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(i,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),s.wrapS!==a.ClampToEdgeWrapping||s.wrapT!==a.ClampToEdgeWrapping,t.texParameteri(i,t.TEXTURE_MAG_FILTER,d(s.magFilter)),t.texParameteri(i,t.TEXTURE_MIN_FILTER,d(s.minFilter)),s.minFilter!==a.NearestFilter&&s.minFilter!==a.LinearFilter),h=e.get("EXT_texture_filter_anisotropic")){if(s.type===a.FloatType&&null===e.get("OES_texture_float_linear"))return;if(s.type===a.HalfFloatType&&null===e.get("OES_texture_half_float_linear"))return;(s.anisotropy>1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,h.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function _(e,n,s){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",p),e.__webglTexture=t.createTexture(),C.textures++),i.activeTexture(t.TEXTURE0+s),i.bindTexture(t.TEXTURE_2D,e.__webglTexture),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,n.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,n.unpackAlignment);var d=c(n.image,r.maxTextureSize);u(n)&&h(d)===!1&&(d=l(d));var f=h(d),m=o(n.format),g=o(n.type);b(t.TEXTURE_2D,n,f);var v,y=n.mipmaps;if(n instanceof a.DepthTexture){var x=t.DEPTH_COMPONENT;if(n.type===a.FloatType){if(!E)throw new Error("Float Depth Texture only supported in WebGL2.0");x=t.DEPTH_COMPONENT32F}else E&&(x=t.DEPTH_COMPONENT16);i.texImage2D(t.TEXTURE_2D,0,x,d.width,d.height,0,m,g,null)}else if(n instanceof a.DataTexture)if(y.length>0&&f){for(var _=0,M=y.length;_-1&&i.compressedTexImage2D(t.TEXTURE_2D,_,m,v.width,v.height,0,v.data):i.texImage2D(t.TEXTURE_2D,_,m,v.width,v.height,0,m,g,v.data);else if(y.length>0&&f){for(var _=0,M=y.length;_0)return t;var a=e*i,o=n[a];if(void 0===o&&(o=new Float32Array(a),n[a]=o),0!==e){r.toArray(o,0);for(var s=1,c=0;s!==e;++s)c+=i,t[s].toArray(o,c)}return o},s=function(t,e){var i=r[e];void 0===i&&(i=new Int32Array(e),r[e]=i);for(var n=0;n!==e;++n)i[n]=t.allocTextureUnit();return i},c=function(t,e){t.uniform1f(this.addr,e)},h=function(t,e){t.uniform1i(this.addr,e)},l=function(t,e){void 0===e.x?t.uniform2fv(this.addr,e):t.uniform2f(this.addr,e.x,e.y)},u=function(t,e){void 0!==e.x?t.uniform3f(this.addr,e.x,e.y,e.z):void 0!==e.r?t.uniform3f(this.addr,e.r,e.g,e.b):t.uniform3fv(this.addr,e)},d=function(t,e){void 0===e.x?t.uniform4fv(this.addr,e):t.uniform4f(this.addr,e.x,e.y,e.z,e.w)},p=function(t,e){t.uniformMatrix2fv(this.addr,!1,e.elements||e)},f=function(t,e){t.uniformMatrix3fv(this.addr,!1,e.elements||e)},m=function(t,e){t.uniformMatrix4fv(this.addr,!1,e.elements||e)},g=function(e,i,n){var r=n.allocTextureUnit();e.uniform1i(this.addr,r),n.setTexture2D(i||t,r)},v=function(t,i,n){var r=n.allocTextureUnit();t.uniform1i(this.addr,r),n.setTextureCube(i||e,r)},y=function(t,e){t.uniform2iv(this.addr,e)},x=function(t,e){t.uniform3iv(this.addr,e)},b=function(t,e){t.uniform4iv(this.addr,e)},_=function(t){switch(t){case 5126:return c;case 35664:return l;case 35665:return u;case 35666:return d;case 35674:return p;case 35675:return f;case 35676:return m;case 35678:return g;case 35680:return v;case 5124:case 35670:return h;case 35667:case 35671:return y;case 35668:case 35672:return x;case 35669:case 35673:return b}},M=function(t,e){t.uniform1fv(this.addr,e)},w=function(t,e){t.uniform1iv(this.addr,e)},S=function(t,e){t.uniform2fv(this.addr,o(e,this.size,2))},T=function(t,e){t.uniform3fv(this.addr,o(e,this.size,3))},L=function(t,e){t.uniform4fv(this.addr,o(e,this.size,4))},A=function(t,e){t.uniformMatrix2fv(this.addr,!1,o(e,this.size,4))},C=function(t,e){t.uniformMatrix3fv(this.addr,!1,o(e,this.size,9))},E=function(t,e){t.uniformMatrix4fv(this.addr,!1,o(e,this.size,16))},P=function(e,i,n){var r=i.length,a=s(n,r);e.uniform1iv(this.addr,a);for(var o=0;o!==r;++o)n.setTexture2D(i[o]||t,a[o])},R=function(t,i,n){var r=i.length,a=s(n,r);t.uniform1iv(this.addr,a);for(var o=0;o!==r;++o)n.setTextureCube(i[o]||e,a[o])},D=function(t){switch(t){case 5126:return M;case 35664:return S;case 35665:return T;case 35666:return L;case 35674:return A;case 35675:return C;case 35676:return E;case 35678:return P;case 35680:return R;case 5124:case 35670:return w;case 35667:case 35671:return y;case 35668:case 35672:return x;case 35669:case 35673:return b}},I=function(t,e,i){this.id=t,this.addr=i,this.setValue=_(e.type)},O=function(t,e,i){this.id=t,this.addr=i,this.size=e.size,this.setValue=D(e.type)},B=function(t){this.id=t,i.call(this)};B.prototype.setValue=function(t,e){for(var i=this.seq,n=0,r=i.length;n!==r;++n){var a=i[n];a.setValue(t,e[a.id])}};var U=/([\w\d_]+)(\])?(\[|\.)?/g,F=function(t,e){t.seq.push(e),t.map[e.id]=e},N=function(t,e,i){var n=t.name,r=n.length;for(U.lastIndex=0;;){var a=U.exec(n),o=U.lastIndex,s=a[1],c="]"===a[2],h=a[3];if(c&&(s=0|s),void 0===h||"["===h&&o+2===r){F(i,void 0===h?new I(s,t,e):new O(s,t,e));break}var l=i.map,u=l[s];void 0===u&&(u=new B(s),F(i,u)),i=u}},V=function(t,e,n){i.call(this),this.renderer=n;for(var r=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),a=0;a!==r;++a){var o=t.getActiveUniform(e,a),s=o.name,c=t.getUniformLocation(e,s);N(o,c,this)}};return V.prototype.setValue=function(t,e,i){var n=this.map[e];void 0!==n&&n.setValue(t,i,this.renderer)},V.prototype.set=function(t,e,i){var n=this.map[i];void 0!==n&&n.setValue(t,e[i],this.renderer)},V.prototype.setOptional=function(t,e,i){var n=e[i];void 0!==n&&this.setValue(t,i,n)},V.upload=function(t,e,i,n){for(var r=0,a=e.length;r!==a;++r){var o=e[r],s=i[o.id];s.needsUpdate!==!1&&o.setValue(t,s.value,n)}},V.seqWithValue=function(t,e){for(var i=[],n=0,r=t.length;n!==r;++n){var a=t[n];a.id in e&&i.push(a)}return i},V.splitDynamic=function(t,e){for(var i=null,n=t.length,r=0,a=0;a!==n;++a){var o=t[a],s=e[o.id];s&&s.dynamic===!0?(null===i&&(i=[]),i.push(o)):(r.001&&P.scale>.001&&(M.x=P.x,M.y=P.y,M.z=P.z,b=P.size*P.scale/m.w,_.x=b*v,_.y=b,p.uniform3f(l.screenPosition,M.x,M.y,M.z),p.uniform2f(l.scale,_.x,_.y),p.uniform1f(l.rotation,P.rotation),p.uniform1f(l.opacity,P.opacity),p.uniform3f(l.color,P.color.r,P.color.g,P.color.b),f.setBlending(P.blending,P.blendEquation,P.blendSrc,P.blendDst),t.setTexture2D(P.texture,1),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0))}}}f.enable(p.CULL_FACE),f.enable(p.DEPTH_TEST),f.setDepthWrite(!0),t.resetGLState()}}},a.SpritePlugin=function(t,e){function i(){var t=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),e=new Uint16Array([0,1,2,0,2,3]);o=d.createBuffer(),s=d.createBuffer(),d.bindBuffer(d.ARRAY_BUFFER,o),d.bufferData(d.ARRAY_BUFFER,t,d.STATIC_DRAW),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,s),d.bufferData(d.ELEMENT_ARRAY_BUFFER,e,d.STATIC_DRAW),c=n(),h={position:d.getAttribLocation(c,"position"),uv:d.getAttribLocation(c,"uv")},l={uvOffset:d.getUniformLocation(c,"uvOffset"),uvScale:d.getUniformLocation(c,"uvScale"),rotation:d.getUniformLocation(c,"rotation"),scale:d.getUniformLocation(c,"scale"),color:d.getUniformLocation(c,"color"),map:d.getUniformLocation(c,"map"),opacity:d.getUniformLocation(c,"opacity"),modelViewMatrix:d.getUniformLocation(c,"modelViewMatrix"),projectionMatrix:d.getUniformLocation(c,"projectionMatrix"),fogType:d.getUniformLocation(c,"fogType"),fogDensity:d.getUniformLocation(c,"fogDensity"),fogNear:d.getUniformLocation(c,"fogNear"),fogFar:d.getUniformLocation(c,"fogFar"),fogColor:d.getUniformLocation(c,"fogColor"),alphaTest:d.getUniformLocation(c,"alphaTest")};var i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");i.width=8,i.height=8;var r=i.getContext("2d");r.fillStyle="white",r.fillRect(0,0,8,8),u=new a.Texture(i),u.needsUpdate=!0}function n(){var e=d.createProgram(),i=d.createShader(d.VERTEX_SHADER),n=d.createShader(d.FRAGMENT_SHADER);return d.shaderSource(i,["precision "+t.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),d.shaderSource(n,["precision "+t.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),d.compileShader(i),d.compileShader(n),d.attachShader(e,i),d.attachShader(e,n),d.linkProgram(e),e}function r(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}var o,s,c,h,l,u,d=t.context,p=t.state,f=new a.Vector3,m=new a.Quaternion,g=new a.Vector3;this.render=function(n,v){if(0!==e.length){void 0===c&&i(),d.useProgram(c),p.initAttributes(),p.enableAttribute(h.position),p.enableAttribute(h.uv),p.disableUnusedAttributes(),p.disable(d.CULL_FACE),p.enable(d.BLEND),d.bindBuffer(d.ARRAY_BUFFER,o),d.vertexAttribPointer(h.position,2,d.FLOAT,!1,16,0),d.vertexAttribPointer(h.uv,2,d.FLOAT,!1,16,8),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,s),d.uniformMatrix4fv(l.projectionMatrix,!1,v.projectionMatrix.elements),p.activeTexture(d.TEXTURE0),d.uniform1i(l.map,0);var y=0,x=0,b=n.fog;b?(d.uniform3f(l.fogColor,b.color.r,b.color.g,b.color.b),b instanceof a.Fog?(d.uniform1f(l.fogNear,b.near),d.uniform1f(l.fogFar,b.far),d.uniform1i(l.fogType,1),y=1,x=1):b instanceof a.FogExp2&&(d.uniform1f(l.fogDensity,b.density),d.uniform1i(l.fogType,2),y=2,x=2)):(d.uniform1i(l.fogType,0),y=0,x=0);for(var _=0,M=e.length;_(h-s)*(d-c)-(l-c)*(u-s))return!1;var m,g,v,y,x,b,_,M,w,S,T,L,A,C,E;for(m=u-h,g=d-l,v=s-u,y=c-d,x=h-s,b=l-c,o=0;o=-Number.EPSILON&&C>=-Number.EPSILON&&A>=-Number.EPSILON))return!1;return!0}return function(e,i){var n=e.length;if(n<3)return null;var r,o,s,c=[],h=[],l=[];if(a.ShapeUtils.area(e)>0)for(o=0;o2;){if(d--<=0)return i?l:c;if(r=o,u<=r&&(r=0),o=r+1,u<=o&&(o=0),s=o+1,u<=s&&(s=0),t(e,r,o,s,u,h)){var p,f,m,g,v;for(p=h[r],f=h[o],m=h[s],c.push([e[p],e[f],e[m]]),l.push([h[r],h[o],h[s]]),g=o,v=o+1;v2&&t[e-1].equals(t[0])&&t.pop()}function n(t,e,i){return t.x!==e.x?t.xNumber.EPSILON){var f;if(d>0){if(p<0||p>d)return[];if(f=h*l-c*u,f<0||f>d)return[]}else{if(p>0||p0||fT?[]:b===T?a?[]:[y]:_<=T?[y,x]:[y,w]}function o(t,e,i,n){var r=e.x-t.x,a=e.y-t.y,o=i.x-t.x,s=i.y-t.y,c=n.x-t.x,h=n.y-t.y,l=r*s-a*o,u=r*h-a*c;if(Math.abs(l)>Number.EPSILON){var d=c*s-h*o;return l>0?u>=0&&d>=0:u>=0||d>=0}return u>0}function s(t,e){function i(t,e){var i=y.length-1,n=t-1;n<0&&(n=i);var r=t+1;r>i&&(r=0);var a=o(y[t],y[n],y[r],s[e]);if(!a)return!1;var c=s.length-1,h=e-1;h<0&&(h=c);var l=e+1;return l>c&&(l=0),a=o(s[e],s[h],s[l],y[t]),!!a}function n(t,e){var i,n,a;for(i=0;i0)return!0;return!1}function a(t,i){var n,a,o,s,c;for(n=0;n0)return!0;return!1}for(var s,c,h,l,u,d,p,f,m,g,v,y=t.concat(),x=[],b=[],_=0,M=e.length;_0&&(S--,!(S<0));)for(h=w;h=0)break;b[p]=!0}if(c>=0)break}return y}i(t),e.forEach(i);for(var c,h,l,u,d,p,f={},m=t.concat(),g=0,v=e.length;g0)){c=r;break}c=r-1}if(r=c,n[r]===i){var h=r/(a-1);return h}var l=n[r],u=n[r+1],d=u-l,p=(i-l)/d,h=(r+p)/(a-1);return h},getTangent:function(t){var e=1e-4,i=t-e,n=t+e;i<0&&(i=0),n>1&&(n=1);var r=this.getPoint(i),a=this.getPoint(n),o=a.clone().sub(r);return o.normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)}},a.Curve.create=function(t,e){return t.prototype=Object.create(a.Curve.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},a.CurvePath=function(){this.curves=[],this.autoClose=!1},a.CurvePath.prototype=Object.assign(Object.create(a.Curve.prototype),{constructor:a.CurvePath,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new a.LineCurve(e,t))},getPoint:function(t){for(var e=t*this.getLength(),i=this.getCurveLengths(),n=0;n=e){var r=i[n]-e,a=this.curves[n],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}n++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0,n=this.curves.length;i1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},createPointsGeometry:function(t){var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){for(var e=new a.Geometry,i=0,n=t.length;i0){var l=h.getPoint(0);l.equals(this.currentPoint)||this.lineTo(l.x,l.y)}this.curves.push(h);var u=h.getPoint(1);this.currentPoint.copy(u)}}),a.ShapePath=function(){this.subPaths=[],this.currentPath=null},a.ShapePath.prototype={moveTo:function(t,e){this.currentPath=new a.Path,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,i,n){this.currentPath.quadraticCurveTo(t,e,i,n)},bezierCurveTo:function(t,e,i,n,r,a){this.currentPath.bezierCurveTo(t,e,i,n,r,a)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function i(t){for(var e=[],i=0,n=t.length;iNumber.EPSILON){if(h<0&&(o=e[a],c=-c,s=e[r],h=-h),t.ys.y)continue;if(t.y===o.y){if(t.x===o.x)return!0}else{var l=h*(t.x-o.x)-c*(t.y-o.y);if(0===l)return!0;if(l<0)continue;n=!n}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return!0}}return n}var r=a.ShapeUtils.isClockWise,o=this.subPaths;if(0===o.length)return[];if(e===!0)return i(o);var s,c,h,l=[];if(1===o.length)return c=o[0],h=new a.Shape,h.curves=c.curves,l.push(h),l;var u=!r(o[0].getPoints());u=t?!u:u;var d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=o.length;v1){for(var x=!1,b=[],_=0,M=f.length;_0&&(x||(m=p))}for(var C,v=0,E=f.length;ve.length-2?e.length-1:n+1],h=e[n>e.length-3?e.length-1:n+2],l=a.CurveUtils.interpolate;return new a.Vector2(l(o.x,s.x,c.x,h.x,r),l(o.y,s.y,c.y,h.y,r))},a.EllipseCurve=function(t,e,i,n,r,a,o,s){this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s||0},a.EllipseCurve.prototype=Object.create(a.Curve.prototype),a.EllipseCurve.prototype.constructor=a.EllipseCurve,a.EllipseCurve.prototype.getPoint=function(t){for(var e=2*Math.PI,i=this.aEndAngle-this.aStartAngle,n=Math.abs(i)e;)i-=e;ie.length-2?e.length-1:n+1],h=e[n>e.length-3?e.length-1:n+2],l=a.CurveUtils.interpolate;return new a.Vector3(l(o.x,s.x,c.x,h.x,r),l(o.y,s.y,c.y,h.y,r),l(o.z,s.z,c.z,h.z,r))}),a.CatmullRomCurve3=function(){function t(){}var e=new a.Vector3,i=new t,n=new t,r=new t;return t.prototype.init=function(t,e,i,n){this.c0=t,this.c1=i,this.c2=-3*t+3*e-2*i-n,this.c3=2*t-2*e+i+n},t.prototype.initNonuniformCatmullRom=function(t,e,i,n,r,a,o){var s=(e-t)/r-(i-t)/(r+a)+(i-e)/a,c=(i-e)/a-(n-e)/(a+o)+(n-i)/o;s*=a,c*=a,this.init(e,i,s,c)},t.prototype.initCatmullRom=function(t,e,i,n,r){this.init(e,i,r*(i-t),r*(n-e))},t.prototype.calc=function(t){var e=t*t,i=e*t;return this.c0+this.c1*t+this.c2*e+this.c3*i},a.Curve.create(function(t){this.points=t||[],this.closed=!1},function(t){var o,s,c,h,l=this.points;h=l.length,o=(h-(this.closed?0:1))*t,s=Math.floor(o),c=o-s,this.closed?s+=s>0?0:(Math.floor(Math.abs(s)/l.length)+1)*l.length:0===c&&s===h-1&&(s=h-2,c=1);var u,d,p,f;if(this.closed||s>0?u=l[(s-1)%h]:(e.subVectors(l[0],l[1]).add(l[0]),u=e),d=l[s%h],p=l[(s+1)%h],this.closed||s+20?1:-1,m[v]=R.x,m[v+1]=R.y,m[v+2]=R.z,g[y]=O/h,g[y+1]=1-D/u,v+=3,y+=2,E+=1}for(D=0;D65535?Uint32Array:Uint16Array)(d),f=new Float32Array(3*u),m=new Float32Array(3*u),g=new Float32Array(2*u),v=0,y=0,x=0,b=0,_=0;h("z","y","x",-1,-1,i,e,t,o,r,0),h("z","y","x",1,-1,i,e,-t,o,r,1),h("x","z","y",1,1,t,i,e,n,o,2),h("x","z","y",1,-1,t,i,-e,n,o,3),h("x","y","z",1,-1,t,e,i,n,r,4),h("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(new a.BufferAttribute(p,1)),this.addAttribute("position",new a.BufferAttribute(f,3)),this.addAttribute("normal",new a.BufferAttribute(m,3)),this.addAttribute("uv",new a.BufferAttribute(g,2))},a.BoxBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.BoxBufferGeometry.prototype.constructor=a.BoxBufferGeometry,a.CircleGeometry=function(t,e,i,n){a.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},this.fromBufferGeometry(new a.CircleBufferGeometry(t,e,i,n))},a.CircleGeometry.prototype=Object.create(a.Geometry.prototype),a.CircleGeometry.prototype.constructor=a.CircleGeometry,a.CircleBufferGeometry=function(t,e,i,n){a.BufferGeometry.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},t=t||50,e=void 0!==e?Math.max(3,e):8,i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;var r=e+2,o=new Float32Array(3*r),s=new Float32Array(3*r),c=new Float32Array(2*r);s[2]=1,c[0]=.5,c[1]=.5;for(var h=0,l=3,u=2;h<=e;h++,l+=3,u+=2){var d=i+h/e*n;o[l]=t*Math.cos(d),o[l+1]=t*Math.sin(d),s[l+2]=1,c[u]=(o[l]/t+1)/2,c[u+1]=(o[l+1]/t+1)/2}for(var p=[],l=1;l<=e;l++)p.push(l,l+1,0);this.setIndex(new a.BufferAttribute(new Uint16Array(p),1)),this.addAttribute("position",new a.BufferAttribute(o,3)),this.addAttribute("normal",new a.BufferAttribute(s,3)),this.addAttribute("uv",new a.BufferAttribute(c,2)),this.boundingSphere=new a.Sphere(new a.Vector3,t)},a.CircleBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.CircleBufferGeometry.prototype.constructor=a.CircleBufferGeometry,a.CylinderBufferGeometry=function(t,e,i,n,r,o,s,c){function h(){var t=(n+1)*(r+1);return o===!1&&(t+=(n+1)*f+n*f),t}function l(){var t=n*r*2*3;return o===!1&&(t+=n*f*3),t}function u(){var o,h,l=new a.Vector3,u=new a.Vector3,d=0,f=(e-t)/i;for(h=0;h<=r;h++){var m=[],g=h/r,L=g*(e-t)+t;for(o=0;o<=n;o++){var A=o/n;u.x=L*Math.sin(A*c+s),u.y=-g*i+S,u.z=L*Math.cos(A*c+s),y.setXYZ(_,u.x,u.y,u.z),l.copy(u),(0===t&&0===h||0===e&&h===r)&&(l.x=Math.sin(A*c+s),l.z=Math.cos(A*c+s)),l.setY(Math.sqrt(l.x*l.x+l.z*l.z)*f).normalize(),x.setXYZ(_,l.x,l.y,l.z),b.setXY(_,A,1-g),m.push(_),_++}w.push(m)}for(o=0;o0&&f++,e>0&&f++);var m=h(),g=l(),v=new a.BufferAttribute(new(g>65535?Uint32Array:Uint16Array)(g),1),y=new a.BufferAttribute(new Float32Array(3*m),3),x=new a.BufferAttribute(new Float32Array(3*m),3),b=new a.BufferAttribute(new Float32Array(2*m),2),_=0,M=0,w=[],S=i/2,T=0;u(),o===!1&&(t>0&&d(!0),e>0&&d(!1)),this.setIndex(v),this.addAttribute("position",y),this.addAttribute("normal",x),this.addAttribute("uv",b)},a.CylinderBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.CylinderBufferGeometry.prototype.constructor=a.CylinderBufferGeometry,a.CylinderGeometry=function(t,e,i,n,r,o,s,c){a.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:c},this.fromBufferGeometry(new a.CylinderBufferGeometry(t,e,i,n,r,o,s,c)),this.mergeVertices()},a.CylinderGeometry.prototype=Object.create(a.Geometry.prototype),a.CylinderGeometry.prototype.constructor=a.CylinderGeometry,a.ConeBufferGeometry=function(t,e,i,n,r,o,s){a.CylinderBufferGeometry.call(this,0,t,e,i,n,r,o,s),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,thetaStart:o,thetaLength:s}},a.ConeBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.ConeBufferGeometry.prototype.constructor=a.ConeBufferGeometry,a.ConeGeometry=function(t,e,i,n,r,o,s){a.CylinderGeometry.call(this,0,t,e,i,n,r,o,s),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:s}},a.ConeGeometry.prototype=Object.create(a.CylinderGeometry.prototype),a.ConeGeometry.prototype.constructor=a.ConeGeometry,a.EdgesGeometry=function(t,e){function i(t,e){return t-e}a.BufferGeometry.call(this),e=void 0!==e?e:1;var n,r=Math.cos(a.Math.DEG2RAD*e),o=[0,0],s={},c=["a","b","c"];t instanceof a.BufferGeometry?(n=new a.Geometry,n.fromBufferGeometry(t)):n=t.clone(),n.mergeVertices(),n.computeFaceNormals();for(var h=n.vertices,l=n.faces,u=0,d=l.length;uNumber.EPSILON){var p=Math.sqrt(u),f=Math.sqrt(h*h+l*l),m=e.x-c/p,g=e.y+s/p,v=i.x-l/f,y=i.y+h/f,x=((v-m)*l-(y-g)*h)/(s*l-c*h);n=m+s*x-t.x,r=g+c*x-t.y;var b=n*n+r*r;if(b<=2)return new a.Vector2(n,r);o=Math.sqrt(b/2)}else{var _=!1;s>Number.EPSILON?h>Number.EPSILON&&(_=!0):s<-Number.EPSILON?h<-Number.EPSILON&&(_=!0):Math.sign(c)===Math.sign(l)&&(_=!0),_?(n=-c,r=s,o=Math.sqrt(u)):(n=s,r=c,o=Math.sqrt(u/2))}return new a.Vector2(n/o,r/o)}function r(){if(b){var t=0,e=j*t;for(X=0;X=0;){i=X,n=X-1,n<0&&(n=t.length-1);var r=0,a=M+2*x;for(r=0;r=0;F--){for(V=F/x,G=v*(1-V),N=y*Math.sin(V*Math.PI/2),X=0,Y=U.length;X65535?Uint32Array:Uint16Array)(h),1),u=new a.BufferAttribute(new Float32Array(3*c),3),d=new a.BufferAttribute(new Float32Array(2*c),2),p=0,f=0,m=(1/(t.length-1),1/e),g=new a.Vector3,v=new a.Vector2;for(o=0;o<=e;o++){var y=i+o*m*n,x=Math.sin(y),b=Math.cos(y);for(s=0;s<=t.length-1;s++)g.x=t[s].x*x,g.y=t[s].y,g.z=t[s].x*b,u.setXYZ(p,g.x,g.y,g.z),v.x=o/e,v.y=s/(t.length-1),d.setXY(p,v.x,v.y),p++}for(o=0;o65535?Uint32Array:Uint16Array)(s*c*6),y=0;y65535?Uint32Array:Uint16Array)(u),1),p=new a.BufferAttribute(new Float32Array(3*l),3),f=new a.BufferAttribute(new Float32Array(3*l),3),m=new a.BufferAttribute(new Float32Array(2*l),2),g=0,v=0,y=t,x=(e-t)/n,b=new a.Vector3,_=new a.Vector2;for(c=0;c<=n;c++){for(h=0;h<=i;h++)s=r+h/i*o,b.x=y*Math.cos(s),b.y=y*Math.sin(s),p.setXYZ(g,b.x,b.y,b.z),f.setXYZ(g,0,0,1),_.x=(b.x/e+1)/2,_.y=(b.y/e+1)/2,m.setXY(g,_.x,_.y),g++;y+=x}for(c=0;c0)&&S.push(T,L,C),(g!==i-1||c65535?a.Uint32Attribute:a.Uint16Attribute)(S,1)),this.addAttribute("position",l),this.addAttribute("normal",u),this.addAttribute("uv",d),this.boundingSphere=new a.Sphere(new a.Vector3,t)},a.SphereBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.SphereBufferGeometry.prototype.constructor=a.SphereBufferGeometry,a.TextGeometry=function(t,e){e=e||{};var i=e.font;if(i instanceof a.Font==!1)return new a.Geometry;var n=i.generateShapes(t,e.size,e.curveSegments);e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),a.ExtrudeGeometry.call(this,n,e),this.type="TextGeometry"},a.TextGeometry.prototype=Object.create(a.ExtrudeGeometry.prototype),a.TextGeometry.prototype.constructor=a.TextGeometry,a.TorusBufferGeometry=function(t,e,i,n,r){a.BufferGeometry.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},t=t||100,e=e||40,i=Math.floor(i)||8,n=Math.floor(n)||6,r=r||2*Math.PI;var o,s,c=(i+1)*(n+1),h=i*n*2*3,l=new(h>65535?Uint32Array:Uint16Array)(h),u=new Float32Array(3*c),d=new Float32Array(3*c),p=new Float32Array(2*c),f=0,m=0,g=0,v=new a.Vector3,y=new a.Vector3,x=new a.Vector3;for(o=0;o<=i;o++)for(s=0;s<=n;s++){var b=s/n*r,_=o/i*Math.PI*2;y.x=(t+e*Math.cos(_))*Math.cos(b),y.y=(t+e*Math.cos(_))*Math.sin(b),y.z=e*Math.sin(_),u[f]=y.x,u[f+1]=y.y,u[f+2]=y.z,v.x=t*Math.cos(b),v.y=t*Math.sin(b),x.subVectors(y,v).normalize(),d[f]=x.x,d[f+1]=x.y,d[f+2]=x.z,p[m]=s/n,p[m+1]=o/i,f+=3,m+=2}for(o=1;o<=i;o++)for(s=1;s<=n;s++){var M=(n+1)*o+s-1,w=(n+1)*(o-1)+s-1,S=(n+1)*(o-1)+s,T=(n+1)*o+s;l[g]=M,l[g+1]=w,l[g+2]=T,l[g+3]=w,l[g+4]=S,l[g+5]=T,g+=6}this.setIndex(new a.BufferAttribute(l,1)),this.addAttribute("position",new a.BufferAttribute(u,3)),this.addAttribute("normal",new a.BufferAttribute(d,3)),this.addAttribute("uv",new a.BufferAttribute(p,2))},a.TorusBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.TorusBufferGeometry.prototype.constructor=a.TorusBufferGeometry,a.TorusGeometry=function(t,e,i,n,r){a.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},this.fromBufferGeometry(new a.TorusBufferGeometry(t,e,i,n,r))},a.TorusGeometry.prototype=Object.create(a.Geometry.prototype),a.TorusGeometry.prototype.constructor=a.TorusGeometry,a.TorusKnotBufferGeometry=function(t,e,i,n,r,o){function s(t,e,i,n,r){var a=Math.cos(t),o=Math.sin(t),s=i/e*t,c=Math.cos(s);r.x=n*(2+c)*.5*a,r.y=n*(2+c)*o*.5,r.z=n*Math.sin(s)*.5}a.BufferGeometry.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:o},t=t||100,e=e||40,i=Math.floor(i)||64,n=Math.floor(n)||8,r=r||2,o=o||3;var c,h,l=(n+1)*(i+1),u=n*i*2*3,d=new a.BufferAttribute(new(u>65535?Uint32Array:Uint16Array)(u),1),p=new a.BufferAttribute(new Float32Array(3*l),3),f=new a.BufferAttribute(new Float32Array(3*l),3),m=new a.BufferAttribute(new Float32Array(2*l),2),g=0,v=0,y=new a.Vector3,x=new a.Vector3,b=new a.Vector2,_=new a.Vector3,M=new a.Vector3,w=new a.Vector3,S=new a.Vector3,T=new a.Vector3;for(c=0;c<=i;++c){var L=c/i*r*Math.PI*2;for(s(L,r,o,t,_),s(L+.01,r,o,t,M),S.subVectors(M,_),T.addVectors(M,_),w.crossVectors(S,T),T.crossVectors(w,S),w.normalize(),T.normalize(),h=0;h<=n;++h){var A=h/n*Math.PI*2,C=-e*Math.cos(A),E=e*Math.sin(A);y.x=_.x+(C*T.x+E*w.x),y.y=_.y+(C*T.y+E*w.y),y.z=_.z+(C*T.z+E*w.z),p.setXYZ(g,y.x,y.y,y.z),x.subVectors(y,_).normalize(),f.setXYZ(g,x.x,x.y,x.z),b.x=c/i,b.y=h/n,m.setXY(g,b.x,b.y),g++}}for(h=1;h<=i;h++)for(c=1;c<=n;c++){var P=(n+1)*(h-1)+(c-1),R=(n+1)*h+(c-1),D=(n+1)*h+c,I=(n+1)*(h-1)+c;d.setX(v,P),v++,d.setX(v,R),v++,d.setX(v,I),v++,d.setX(v,R),v++,d.setX(v,D),v++,d.setX(v,I),v++}this.setIndex(d),this.addAttribute("position",p),this.addAttribute("normal",f),this.addAttribute("uv",m)},a.TorusKnotBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.TorusKnotBufferGeometry.prototype.constructor=a.TorusKnotBufferGeometry,a.TorusKnotGeometry=function(t,e,i,n,r,o,s){a.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:o},this.fromBufferGeometry(new a.TorusKnotBufferGeometry(t,e,i,n,r,o)),this.mergeVertices()},a.TorusKnotGeometry.prototype=Object.create(a.Geometry.prototype),a.TorusKnotGeometry.prototype.constructor=a.TorusKnotGeometry,a.TubeGeometry=function(t,e,i,n,r,o){function s(t,e,i){return P.vertices.push(new a.Vector3(t,e,i))-1}a.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:t,segments:e,radius:i,radialSegments:n,closed:r,taper:o},e=e||64,i=i||1,n=n||8,r=r||!1,o=o||a.TubeGeometry.NoTaper;var c,h,l,u,d,p,f,m,g,v,y,x,b,_,M,w,S,T,L,A,C,E=[],P=this,R=e+1,D=new a.Vector3,I=new a.TubeGeometry.FrenetFrames(t,e,r),O=I.tangents,B=I.normals,U=I.binormals;for(this.tangents=O,this.normals=B,this.binormals=U,v=0;vNumber.EPSILON&&(g.normalize(),r=Math.acos(a.Math.clamp(p[l-1].dot(p[l]),-1,1)),f[l].applyMatrix4(v.makeRotationAxis(g,r))),m[l].crossVectors(p[l],f[l]);if(i)for(r=Math.acos(a.Math.clamp(f[0].dot(f[y-1]),-1,1)),r/=y-1,p[0].dot(g.crossVectors(f[0],f[y-1]))>0&&(r=-r),l=1;l.9&&L<.1&&(M<.2&&(_[0].x+=1),w<.2&&(_[1].x+=1),S<.2&&(_[2].x+=1))}for(var d=0,p=this.vertices.length;d.99999?this.quaternion.set(0,0,0,1):i.y<-.99999?this.quaternion.set(1,0,0,0):(e.set(i.z,0,-i.x).normalize(),t=Math.acos(i.y),this.quaternion.setFromAxisAngle(e,t))}}(),a.ArrowHelper.prototype.setLength=function(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()},a.ArrowHelper.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},a.BoxHelper=function(t,e){void 0===e&&(e=16776960);var i=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]),n=new Float32Array(24),r=new a.BufferGeometry;r.setIndex(new a.BufferAttribute(i,1)),r.addAttribute("position",new a.BufferAttribute(n,3)),a.LineSegments.call(this,r,new a.LineBasicMaterial({color:e})),void 0!==t&&this.update(t)},a.BoxHelper.prototype=Object.create(a.LineSegments.prototype),a.BoxHelper.prototype.constructor=a.BoxHelper,a.BoxHelper.prototype.update=function(){var t=new a.Box3;return function(e){if(e instanceof a.Box3?t.copy(e):t.setFromObject(e),!t.isEmpty()){var i=t.min,n=t.max,r=this.geometry.attributes.position,o=r.array;o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=i.x,o[4]=n.y,o[5]=n.z,o[6]=i.x,o[7]=i.y,o[8]=n.z,o[9]=n.x,o[10]=i.y,o[11]=n.z,o[12]=n.x,o[13]=n.y,o[14]=i.z,o[15]=i.x,o[16]=n.y,o[17]=i.z,o[18]=i.x,o[19]=i.y,o[20]=i.z,o[21]=n.x,o[22]=i.y,o[23]=i.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),a.BoundingBoxHelper=function(t,e){var i=void 0!==e?e:8947848;this.object=t,this.box=new a.Box3,a.Mesh.call(this,new a.BoxGeometry(1,1,1),new a.MeshBasicMaterial({color:i,wireframe:!0}))},a.BoundingBoxHelper.prototype=Object.create(a.Mesh.prototype),a.BoundingBoxHelper.prototype.constructor=a.BoundingBoxHelper,a.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},a.CameraHelper=function(t){function e(t,e,n){i(t,n),i(e,n)}function i(t,e){n.vertices.push(new a.Vector3),n.colors.push(new a.Color(e)),void 0===o[t]&&(o[t]=[]),o[t].push(n.vertices.length-1)}var n=new a.Geometry,r=new a.LineBasicMaterial({color:16777215,vertexColors:a.FaceColors}),o={},s=16755200,c=16711680,h=43775,l=16777215,u=3355443;e("n1","n2",s),e("n2","n4",s),e("n4","n3",s),e("n3","n1",s),e("f1","f2",s),e("f2","f4",s),e("f4","f3",s),e("f3","f1",s),e("n1","f1",s),e("n2","f2",s),e("n3","f3",s),e("n4","f4",s),e("p","n1",c),e("p","n2",c),e("p","n3",c),e("p","n4",c),e("u1","u2",h),e("u2","u3",h),e("u3","u1",h),e("c","t",l),e("p","c",u),e("cn1","cn2",u),e("cn3","cn4",u),e("cf1","cf2",u),e("cf3","cf4",u),a.LineSegments.call(this,n,r),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()},a.CameraHelper.prototype=Object.create(a.LineSegments.prototype),a.CameraHelper.prototype.constructor=a.CameraHelper,a.CameraHelper.prototype.update=function(){function t(t,a,o,s){n.set(a,o,s).unproject(r);var c=i[t];if(void 0!==c)for(var h=0,l=c.length;h1){var h=c[1];n[h]||(n[h]={start:1/0,end:-(1/0)});var l=n[h];al.end&&(l.end=a),e||(e=h)}}for(var h in n){var l=n[h];this.createAnimation(h,l.start,l.end,t)}this.firstAnimation=e},a.MorphBlendMesh.prototype.setAnimationDirectionForward=function(t){var e=this.animationsMap[t];e&&(e.direction=1,e.directionBackwards=!1)},a.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(t){var e=this.animationsMap[t];e&&(e.direction=-1,e.directionBackwards=!0)},a.MorphBlendMesh.prototype.setAnimationFPS=function(t,e){var i=this.animationsMap[t];i&&(i.fps=e,i.duration=(i.end-i.start)/i.fps)},a.MorphBlendMesh.prototype.setAnimationDuration=function(t,e){var i=this.animationsMap[t];i&&(i.duration=e,i.fps=(i.end-i.start)/i.duration)},a.MorphBlendMesh.prototype.setAnimationWeight=function(t,e){var i=this.animationsMap[t];i&&(i.weight=e)},a.MorphBlendMesh.prototype.setAnimationTime=function(t,e){var i=this.animationsMap[t];i&&(i.time=e)},a.MorphBlendMesh.prototype.getAnimationTime=function(t){var e=0,i=this.animationsMap[t];return i&&(e=i.time),e},a.MorphBlendMesh.prototype.getAnimationDuration=function(t){var e=-1,i=this.animationsMap[t];return i&&(e=i.duration),e},a.MorphBlendMesh.prototype.playAnimation=function(t){var e=this.animationsMap[t];e&&(e.time=0,e.active=!0)},a.MorphBlendMesh.prototype.stopAnimation=function(t){var e=this.animationsMap[t];e&&(e.active=!1)},a.MorphBlendMesh.prototype.update=function(t){for(var e=0,i=this.animationsList.length;en.duration||n.time<0)&&(n.direction*=-1,n.time>n.duration&&(n.time=n.duration,n.directionBackwards=!0),n.time<0&&(n.time=0,n.directionBackwards=!1)):(n.time=n.time%n.duration,n.time<0&&(n.time+=n.duration));var o=n.start+a.Math.clamp(Math.floor(n.time/r),0,n.length-1),s=n.weight;o!==n.currentFrame&&(this.morphTargetInfluences[n.lastFrame]=0,this.morphTargetInfluences[n.currentFrame]=1*s,this.morphTargetInfluences[o]=0,n.lastFrame=n.currentFrame,n.currentFrame=o);var c=n.time%r/r;n.directionBackwards&&(c=1-c),n.currentFrame!==n.lastFrame?(this.morphTargetInfluences[n.currentFrame]=c*s,this.morphTargetInfluences[n.lastFrame]=(1-c)*s):this.morphTargetInfluences[n.currentFrame]=s}}}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var i=0;ia||8*(1-f.dot(this.object.quaternion))>a)&&(p.copy(this.object.position),f.copy(this.object.quaternion),l=!1,!0)}}()}function i(i,n){function r(t,e){var i=v.domElement===document?v.domElement.body:v.domElement;g.pan(t,e,i.clientWidth,i.clientHeight)}function a(){return 2*Math.PI/60/60*v.autoRotateSpeed}function o(){return Math.pow(.95,v.zoomSpeed)}function s(t){if(v.enabled!==!1){if(t.preventDefault(),t.button===v.mouseButtons.ORBIT){if(v.enableRotate===!1)return;C=A.ROTATE,y.set(t.clientX,t.clientY)}else if(t.button===v.mouseButtons.ZOOM){if(v.enableZoom===!1)return;C=A.DOLLY,S.set(t.clientX,t.clientY)}else if(t.button===v.mouseButtons.PAN){if(v.enablePan===!1)return;C=A.PAN,_.set(t.clientX,t.clientY)}C!==A.NONE&&(document.addEventListener("mousemove",c,!1),document.addEventListener("mouseup",h,!1),v.dispatchEvent(P))}}function c(t){if(v.enabled!==!1){t.preventDefault();var e=v.domElement===document?v.domElement.body:v.domElement;if(C===A.ROTATE){if(v.enableRotate===!1)return;x.set(t.clientX,t.clientY),b.subVectors(x,y),g.rotateLeft(2*Math.PI*b.x/e.clientWidth*v.rotateSpeed),g.rotateUp(2*Math.PI*b.y/e.clientHeight*v.rotateSpeed),y.copy(x)}else if(C===A.DOLLY){if(v.enableZoom===!1)return;T.set(t.clientX,t.clientY),L.subVectors(T,S),L.y>0?g.dollyIn(o()):L.y<0&&g.dollyOut(o()),S.copy(T)}else if(C===A.PAN){if(v.enablePan===!1)return;M.set(t.clientX,t.clientY),w.subVectors(M,_),r(w.x,w.y),_.copy(M)}C!==A.NONE&&v.update()}}function h(){v.enabled!==!1&&(document.removeEventListener("mousemove",c,!1),document.removeEventListener("mouseup",h,!1),v.dispatchEvent(R),C=A.NONE)}function l(t){if(v.enabled!==!1&&v.enableZoom!==!1&&C===A.NONE){t.preventDefault(),t.stopPropagation();var e=0;void 0!==t.wheelDelta?e=t.wheelDelta:void 0!==t.detail&&(e=-t.detail),e>0?g.dollyOut(o()):e<0&&g.dollyIn(o()),v.update(),v.dispatchEvent(P),v.dispatchEvent(R)}}function u(t){if(v.enabled!==!1&&v.enableKeys!==!1&&v.enablePan!==!1)switch(t.keyCode){case v.keys.UP:r(0,v.keyPanSpeed),v.update();break;case v.keys.BOTTOM:r(0,-v.keyPanSpeed),v.update();break;case v.keys.LEFT:r(v.keyPanSpeed,0),v.update();break;case v.keys.RIGHT:r(-v.keyPanSpeed,0),v.update()}}function d(t){if(v.enabled!==!1){switch(t.touches.length){case 1:if(v.enableRotate===!1)return;C=A.TOUCH_ROTATE,y.set(t.touches[0].pageX,t.touches[0].pageY);break;case 2:if(v.enableZoom===!1)return;C=A.TOUCH_DOLLY;var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);S.set(0,n);break;case 3:if(v.enablePan===!1)return;C=A.TOUCH_PAN,_.set(t.touches[0].pageX,t.touches[0].pageY);break;default:C=A.NONE}C!==A.NONE&&v.dispatchEvent(P)}}function p(t){if(v.enabled!==!1){t.preventDefault(),t.stopPropagation();var e=v.domElement===document?v.domElement.body:v.domElement;switch(t.touches.length){case 1:if(v.enableRotate===!1)return;if(C!==A.TOUCH_ROTATE)return;x.set(t.touches[0].pageX,t.touches[0].pageY),b.subVectors(x,y),g.rotateLeft(2*Math.PI*b.x/e.clientWidth*v.rotateSpeed),g.rotateUp(2*Math.PI*b.y/e.clientHeight*v.rotateSpeed),y.copy(x),v.update();break;case 2:if(v.enableZoom===!1)return;if(C!==A.TOUCH_DOLLY)return;var i=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,a=Math.sqrt(i*i+n*n);T.set(0,a),L.subVectors(T,S),L.y>0?g.dollyOut(o()):L.y<0&&g.dollyIn(o()),S.copy(T),v.update();break;case 3:if(v.enablePan===!1)return;if(C!==A.TOUCH_PAN)return;M.set(t.touches[0].pageX,t.touches[0].pageY),w.subVectors(M,_),r(w.x,w.y),_.copy(M),v.update();break;default:C=A.NONE}}}function f(){v.enabled!==!1&&(v.dispatchEvent(R),C=A.NONE)}function m(t){t.preventDefault()}var g=new e(i);this.domElement=void 0!==n?n:document,Object.defineProperty(this,"constraint",{get:function(){return g}}),this.getPolarAngle=function(){return g.getPolarAngle()},this.getAzimuthalAngle=function(){return g.getAzimuthalAngle()},this.enabled=!0,this.center=this.target,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:t.MOUSE.LEFT,ZOOM:t.MOUSE.MIDDLE,PAN:t.MOUSE.RIGHT};var v=this,y=new t.Vector2,x=new t.Vector2,b=new t.Vector2,_=new t.Vector2,M=new t.Vector2,w=new t.Vector2,S=new t.Vector2,T=new t.Vector2,L=new t.Vector2,A={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},C=A.NONE;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom;var E={type:"change"},P={type:"start"},R={type:"end"};this.update=function(){this.autoRotate&&C===A.NONE&&g.rotateLeft(a()),g.update()===!0&&this.dispatchEvent(E)},this.reset=function(){C=A.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(E),this.update()},this.dispose=function(){this.domElement.removeEventListener("contextmenu",m,!1),this.domElement.removeEventListener("mousedown",s,!1),this.domElement.removeEventListener("mousewheel",l,!1),this.domElement.removeEventListener("MozMousePixelScroll",l,!1),this.domElement.removeEventListener("touchstart",d,!1),this.domElement.removeEventListener("touchend",f,!1),this.domElement.removeEventListener("touchmove",p,!1),document.removeEventListener("mousemove",c,!1),document.removeEventListener("mouseup",h,!1),window.removeEventListener("keydown",u,!1)},this.domElement.addEventListener("contextmenu",m,!1),this.domElement.addEventListener("mousedown",s,!1),this.domElement.addEventListener("mousewheel",l,!1),this.domElement.addEventListener("MozMousePixelScroll",l,!1),this.domElement.addEventListener("touchstart",d,!1),this.domElement.addEventListener("touchend",f,!1),this.domElement.addEventListener("touchmove",p,!1),window.addEventListener("keydown",u,!1),this.update()}var n=t.MOUSE;return n||(n={LEFT:0,MIDDLE:1,RIGHT:2}),i.prototype=Object.create(t.EventDispatcher.prototype),i.prototype.constructor=i,Object.defineProperties(i.prototype,{object:{get:function(){return this.constraint.object}},target:{get:function(){return this.constraint.target},set:function(t){this.constraint.target.copy(t)}},minDistance:{get:function(){return this.constraint.minDistance},set:function(t){this.constraint.minDistance=t}},maxDistance:{get:function(){return this.constraint.maxDistance},set:function(t){this.constraint.maxDistance=t}},minZoom:{get:function(){return this.constraint.minZoom},set:function(t){this.constraint.minZoom=t}},maxZoom:{get:function(){return this.constraint.maxZoom},set:function(t){this.constraint.maxZoom=t}},minPolarAngle:{get:function(){return this.constraint.minPolarAngle},set:function(t){this.constraint.minPolarAngle=t}},maxPolarAngle:{get:function(){return this.constraint.maxPolarAngle},set:function(t){this.constraint.maxPolarAngle=t}},minAzimuthAngle:{get:function(){return this.constraint.minAzimuthAngle},set:function(t){this.constraint.minAzimuthAngle=t}},maxAzimuthAngle:{get:function(){return this.constraint.maxAzimuthAngle},set:function(t){this.constraint.maxAzimuthAngle=t}},enableDamping:{get:function(){return this.constraint.enableDamping},set:function(t){this.constraint.enableDamping=t}},dampingFactor:{get:function(){return this.constraint.dampingFactor},set:function(t){this.constraint.dampingFactor=t}},noZoom:{get:function(){return!this.enableZoom},set:function(t){this.enableZoom=!t}},noRotate:{get:function(){return!this.enableRotate},set:function(t){this.enableRotate=!t}},noPan:{get:function(){return!this.enablePan},set:function(t){this.enablePan=!t}},noKeys:{get:function(){return!this.enableKeys},set:function(t){this.enableKeys=!t}},staticMoving:{get:function(){return!this.constraint.enableDamping},set:function(t){this.constraint.enableDamping=!t}},dynamicDampingFactor:{get:function(){return this.constraint.dampingFactor},set:function(t){this.constraint.dampingFactor=t}}}),i}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function r(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e1)for(var i=1;ithis.__max&&(a=this.__max);void 0!==this.__step&&0!=a%this.__step&&(a=Math.round(a/this.__step)*this.__step);return e.superclass.prototype.setValue.call(this,a)},min:function(a){this.__min=a;return this},max:function(a){this.__max=a;return this},step:function(a){this.__impliedStep=this.__step=a;this.__precision=d(a);return this}});return e}(dat.controllers.Controller,dat.utils.common); +dat.controllers.NumberControllerBox=function(f,a,d){var e=function(c,b,f){function q(){var a=parseFloat(n.__input.value);d.isNaN(a)||n.setValue(a)}function l(a){var b=u-a.clientY;n.setValue(n.getValue()+b*n.__impliedStep);u=a.clientY}function r(){a.unbind(window,"mousemove",l);a.unbind(window,"mouseup",r)}this.__truncationSuspended=!1;e.superclass.call(this,c,b,f);var n=this,u;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"change",q);a.bind(this.__input, + "blur",function(){q();n.__onFinishChange&&n.__onFinishChange.call(n,n.getValue())});a.bind(this.__input,"mousedown",function(b){a.bind(window,"mousemove",l);a.bind(window,"mouseup",r);u=b.clientY});a.bind(this.__input,"keydown",function(a){13===a.keyCode&&(n.__truncationSuspended=!0,this.blur(),n.__truncationSuspended=!1)});this.updateDisplay();this.domElement.appendChild(this.__input)};e.superclass=f;d.extend(e.prototype,f.prototype,{updateDisplay:function(){var a=this.__input,b;if(this.__truncationSuspended)b= + this.getValue();else{b=this.getValue();var d=Math.pow(10,this.__precision);b=Math.round(b*d)/d}a.value=b;return e.superclass.prototype.updateDisplay.call(this)}});return e}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common); +dat.controllers.NumberControllerSlider=function(f,a,d,e,c){function b(a,b,c,e,d){return e+(a-b)/(c-b)*(d-e)}var p=function(c,e,d,f,u){function A(c){c.preventDefault();var e=a.getOffset(k.__background),d=a.getWidth(k.__background);k.setValue(b(c.clientX,e.left,e.left+d,k.__min,k.__max));return!1}function g(){a.unbind(window,"mousemove",A);a.unbind(window,"mouseup",g);k.__onFinishChange&&k.__onFinishChange.call(k,k.getValue())}p.superclass.call(this,c,e,{min:d,max:f,step:u});var k=this;this.__background= + document.createElement("div");this.__foreground=document.createElement("div");a.bind(this.__background,"mousedown",function(b){a.bind(window,"mousemove",A);a.bind(window,"mouseup",g);A(b)});a.addClass(this.__background,"slider");a.addClass(this.__foreground,"slider-fg");this.updateDisplay();this.__background.appendChild(this.__foreground);this.domElement.appendChild(this.__background)};p.superclass=f;p.useDefaultStyles=function(){d.inject(c)};e.extend(p.prototype,f.prototype,{updateDisplay:function(){var a= + (this.getValue()-this.__min)/(this.__max-this.__min);this.__foreground.style.width=100*a+"%";return p.superclass.prototype.updateDisplay.call(this)}});return p}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,"/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"); +dat.controllers.FunctionController=function(f,a,d){var e=function(c,b,d){e.superclass.call(this,c,b);var f=this;this.__button=document.createElement("div");this.__button.innerHTML=void 0===d?"Fire":d;a.bind(this.__button,"click",function(a){a.preventDefault();f.fire();return!1});a.addClass(this.__button,"button");this.domElement.appendChild(this.__button)};e.superclass=f;d.extend(e.prototype,f.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this);this.getValue().call(this.object); + this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}});return e}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); +dat.controllers.BooleanController=function(f,a,d){var e=function(c,b){e.superclass.call(this,c,b);var d=this;this.__prev=this.getValue();this.__checkbox=document.createElement("input");this.__checkbox.setAttribute("type","checkbox");a.bind(this.__checkbox,"change",function(){d.setValue(!d.__prev)},!1);this.domElement.appendChild(this.__checkbox);this.updateDisplay()};e.superclass=f;d.extend(e.prototype,f.prototype,{setValue:function(a){a=e.superclass.prototype.setValue.call(this,a);this.__onFinishChange&& +this.__onFinishChange.call(this,this.getValue());this.__prev=this.getValue();return a},updateDisplay:function(){!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0):this.__checkbox.checked=!1;return e.superclass.prototype.updateDisplay.call(this)}});return e}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); +dat.color.toString=function(f){return function(a){if(1==a.a||f.isUndefined(a.a)){for(a=a.hex.toString(16);6>a.length;)a="0"+a;return"#"+a}return"rgba("+Math.round(a.r)+","+Math.round(a.g)+","+Math.round(a.b)+","+a.a+")"}}(dat.utils.common); +dat.color.interpret=function(f,a){var d,e,c=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null===a?!1:{space:"HEX",hex:parseInt("0x"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:f},SIX_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9]{6})$/i);return null===a?!1:{space:"HEX",hex:parseInt("0x"+a[1].toString())}},write:f},CSS_RGB:{read:function(a){a=a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); + return null===a?!1:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:f},CSS_RGBA:{read:function(a){a=a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return null===a?!1:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:f}}},{litmus:a.isNumber,conversions:{HEX:{read:function(a){return{space:"HEX",hex:a,conversionName:"HEX"}},write:function(a){return a.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(a){return 3!= +a.length?!1:{space:"RGB",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return 4!=a.length?!1:{space:"RGB",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(b){return a.isNumber(b.r)&&a.isNumber(b.g)&&a.isNumber(b.b)&&a.isNumber(b.a)?{space:"RGB",r:b.r,g:b.g,b:b.b,a:b.a}:!1},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(b){return a.isNumber(b.r)&& +a.isNumber(b.g)&&a.isNumber(b.b)?{space:"RGB",r:b.r,g:b.g,b:b.b}:!1},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)&&a.isNumber(b.a)?{space:"HSV",h:b.h,s:b.s,v:b.v,a:b.a}:!1},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)?{space:"HSV",h:b.h,s:b.s,v:b.v}:!1},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){e=!1; + var b=1\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
\n \n
\n\n', + ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row,
  • */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n", + dat.controllers.factory=function(f,a,d,e,c,b,p){return function(q,l,r,n){var u=q[l];if(p.isArray(r)||p.isObject(r))return new f(q,l,r);if(p.isNumber(u))return p.isNumber(r)&&p.isNumber(n)?new d(q,l,r,n):new a(q,l,{min:r,max:n});if(p.isString(u))return new e(q,l);if(p.isFunction(u))return new c(q,l,"");if(p.isBoolean(u))return new b(q,l)}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(f,a,d){var e= + function(c,b){function d(){f.setValue(f.__input.value)}e.superclass.call(this,c,b);var f=this;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"keyup",d);a.bind(this.__input,"change",d);a.bind(this.__input,"blur",function(){f.__onFinishChange&&f.__onFinishChange.call(f,f.getValue())});a.bind(this.__input,"keydown",function(a){13===a.keyCode&&this.blur()});this.updateDisplay();this.domElement.appendChild(this.__input)};e.superclass=f;d.extend(e.prototype, + f.prototype,{updateDisplay:function(){a.isActive(this.__input)||(this.__input.value=this.getValue());return e.superclass.prototype.updateDisplay.call(this)}});return e}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController, + dat.controllers.ColorController=function(f,a,d,e,c){function b(a,b,d,e){a.style.background="";c.each(l,function(c){a.style.cssText+="background: "+c+"linear-gradient("+b+", "+d+" 0%, "+e+" 100%); "})}function p(a){a.style.background="";a.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);";a.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"; + a.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var q=function(f,n){function u(b){v(b);a.bind(window,"mousemove",v);a.bind(window, + "mouseup",l)}function l(){a.unbind(window,"mousemove",v);a.unbind(window,"mouseup",l)}function g(){var a=e(this.value);!1!==a?(t.__color.__state=a,t.setValue(t.__color.toOriginal())):this.value=t.__color.toString()}function k(){a.unbind(window,"mousemove",w);a.unbind(window,"mouseup",k)}function v(b){b.preventDefault();var c=a.getWidth(t.__saturation_field),d=a.getOffset(t.__saturation_field),e=(b.clientX-d.left+document.body.scrollLeft)/c;b=1-(b.clientY-d.top+document.body.scrollTop)/c;1 + b&&(b=0);1e&&(e=0);t.__color.v=b;t.__color.s=e;t.setValue(t.__color.toOriginal());return!1}function w(b){b.preventDefault();var c=a.getHeight(t.__hue_field),d=a.getOffset(t.__hue_field);b=1-(b.clientY-d.top+document.body.scrollTop)/c;1b&&(b=0);t.__color.h=360*b;t.setValue(t.__color.toOriginal());return!1}q.superclass.call(this,f,n);this.__color=new d(this.getValue());this.__temp=new d(0);var t=this;this.domElement=document.createElement("div");a.makeSelectable(this.domElement,!1); + this.__selector=document.createElement("div");this.__selector.className="selector";this.__saturation_field=document.createElement("div");this.__saturation_field.className="saturation-field";this.__field_knob=document.createElement("div");this.__field_knob.className="field-knob";this.__field_knob_border="2px solid ";this.__hue_knob=document.createElement("div");this.__hue_knob.className="hue-knob";this.__hue_field=document.createElement("div");this.__hue_field.className="hue-field";this.__input=document.createElement("input"); + this.__input.type="text";this.__input_textShadow="0 1px 1px ";a.bind(this.__input,"keydown",function(a){13===a.keyCode&&g.call(this)});a.bind(this.__input,"blur",g);a.bind(this.__selector,"mousedown",function(b){a.addClass(this,"drag").bind(window,"mouseup",function(b){a.removeClass(t.__selector,"drag")})});var y=document.createElement("div");c.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"});c.extend(this.__field_knob.style, + {position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(.5>this.__color.v?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1});c.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1});c.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"});c.extend(y.style,{width:"100%",height:"100%", + background:"none"});b(y,"top","rgba(0,0,0,0)","#000");c.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"});p(this.__hue_field);c.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"});a.bind(this.__saturation_field,"mousedown",u);a.bind(this.__field_knob,"mousedown",u);a.bind(this.__hue_field,"mousedown",function(b){w(b);a.bind(window, + "mousemove",w);a.bind(window,"mouseup",k)});this.__saturation_field.appendChild(y);this.__selector.appendChild(this.__field_knob);this.__selector.appendChild(this.__saturation_field);this.__selector.appendChild(this.__hue_field);this.__hue_field.appendChild(this.__hue_knob);this.domElement.appendChild(this.__input);this.domElement.appendChild(this.__selector);this.updateDisplay()};q.superclass=f;c.extend(q.prototype,f.prototype,{updateDisplay:function(){var a=e(this.getValue());if(!1!==a){var f=!1; + c.each(d.COMPONENTS,function(b){if(!c.isUndefined(a[b])&&!c.isUndefined(this.__color.__state[b])&&a[b]!==this.__color.__state[b])return f=!0,{}},this);f&&c.extend(this.__color.__state,a)}c.extend(this.__temp.__state,this.__color.__state);this.__temp.a=1;var l=.5>this.__color.v||.5a&&(a+=1);return{h:360*a,s:c/b,v:b/255}},rgb_to_hex:function(a,d,e){a=this.hex_with_component(0,2,a);a=this.hex_with_component(a,1,d);return a=this.hex_with_component(a,0,e)},component_from_hex:function(a,d){return a>>8*d&255},hex_with_component:function(a,d,e){return e<<(f=8*d)|a&~(255< _max ) _max = _current; + _ctx.drawImage( _canvas, 1, 0, _canvas.width - 1, _canvas.height, 0, 0, _canvas.width - 1, _canvas.height ); + if ( alarm ) { + _ctx.drawImage( _alarmCanvas, _canvas.width - 1, _canvas.height - _current * _canvas.height / _max - _elHeight ); + } else { + _ctx.drawImage( _dotCanvas, _canvas.width - 1, _canvas.height - _current * _canvas.height / _max - _elHeight ); + } + } + + _init(); + + return { + draw: _draw + }; + + } + + function StackGraph ( _dom, _num ) { + + var _canvas = document.createElement( 'canvas' ), + _ctx = _canvas.getContext( '2d' ); + + function _init () { + + _canvas.width = _elWidth; + _canvas.height = _elHeight * _num; + _canvas.style.width = _canvas.width + 'px'; + _canvas.style.height = _canvas.height + 'px'; + _canvas.className = 'rs-canvas'; + _dom.appendChild( _canvas ); + + _ctx.fillStyle = '#444444'; + _ctx.fillRect( 0, 0, _canvas.width, _canvas.height ); + + } + + function _draw ( v ) { + _ctx.drawImage( _canvas, 1, 0, _canvas.width - 1, _canvas.height, 0, 0, _canvas.width - 1, _canvas.height ); + var th = 0; + iterateKeys( v, function ( j ) { + var h = v[ j ] * _canvas.height; + _ctx.fillStyle = _colours[ j ]; + _ctx.fillRect( _canvas.width - 1, th, 1, h ); + th += h; + } ); + } + + _init(); + + return { + draw: _draw + }; + + } + + function PerfCounter ( id, group ) { + + var _id = id, + _time, + _value = 0, + _total = 0, + _averageValue = 0, + _accumValue = 0, + _accumStart = performance.now(), + _accumSamples = 0, + _dom = document.createElement( 'div' ), + _spanId = document.createElement( 'span' ), + _spanValue = document.createElement( 'div' ), + _spanValueText = document.createTextNode( '' ), + _def = _settings ? _settings.values[ _id.toLowerCase() ] : null, + _graph = new Graph( _dom, _id, _def ), + _started = false; + + _dom.className = 'rs-counter-base'; + + _spanId.className = 'rs-counter-id'; + _spanId.textContent = ( _def && _def.caption ) ? _def.caption : _id; + + _spanValue.className = 'rs-counter-value'; + _spanValue.appendChild( _spanValueText ); + + _dom.appendChild( _spanId ); + _dom.appendChild( _spanValue ); + if ( group ) group.div.appendChild( _dom ); + else _div.appendChild( _dom ); + + _time = performance.now(); + + function _average ( v ) { + if ( _def && _def.average ) { + _accumValue += v; + _accumSamples++; + var t = performance.now(); + if ( t - _accumStart >= ( _def.avgMs || 1000 ) ) { + _averageValue = _accumValue / _accumSamples; + _accumValue = 0; + _accumStart = t; + _accumSamples = 0; + } + } + } + + function _start () { + _time = performance.now(); + if( _settings.userTimingAPI ) performance.mark( _id + '-start' ); + _started = true; + } + + function _end () { + _value = performance.now() - _time; + if( _settings.userTimingAPI ) { + performance.mark( _id + '-end' ); + if( _started ) { + performance.measure( _id, _id + '-start', _id + '-end' ); + } + } + _average( _value ); + } + + function _tick () { + _end(); + _start(); + } + + function _draw () { + var v = ( _def && _def.average ) ? _averageValue : _value; + _spanValueText.nodeValue = Math.round( v * 100 ) / 100; + var a = ( _def && ( ( _def.below && _value < _def.below ) || ( _def.over && _value > _def.over ) ) ); + _graph.draw( _value, a ); + _dom.style.color = a ? '#b70000' : '#ffffff'; + } + + function _frame () { + var t = performance.now(); + var e = t - _time; + _total++; + if ( e > 1000 ) { + if ( _def && _def.interpolate === false ) { + _value = _total; + } else { + _value = _total * 1000 / e; + } + _total = 0; + _time = t; + _average( _value ); + } + } + + function _set ( v ) { + _value = v; + _average( _value ); + } + + return { + set: _set, + start: _start, + tick: _tick, + end: _end, + frame: _frame, + value: function () { + return _value; + }, + draw: _draw + }; + + } + + function sample () { + + var _value = 0; + + function _set ( v ) { + _value = v; + } + + return { + set: _set, + value: function () { + return _value; + } + }; + + } + + function _perf ( idArg ) { + + var id = idArg.toLowerCase(); + if ( id === undefined ) id = 'default'; + if ( _perfCounters[ id ] ) return _perfCounters[ id ]; + + var group = null; + if ( _settings && _settings.groups ) { + iterateKeys( _settings.groups, function ( j ) { + var g = _settings.groups[ parseInt( j, 10 ) ]; + if ( !group && g.values.indexOf( id.toLowerCase() ) !== -1 ) { + group = g; + } + } ); + } + + var p = new PerfCounter( id, group ); + _perfCounters[ id ] = p; + return p; + + } + + function _init () { + + if ( _settings.plugins ) { + if ( !_settings.values ) _settings.values = {}; + if ( !_settings.groups ) _settings.groups = []; + if ( !_settings.fractions ) _settings.fractions = []; + for ( var j = 0; j < _settings.plugins.length; j++ ) { + _settings.plugins[ j ].attach( _perf ); + iterateKeys( _settings.plugins[ j ].values, function ( k ) { + _settings.values[ k ] = _settings.plugins[ j ].values[ k ]; + } ); + _settings.groups = _settings.groups.concat( _settings.plugins[ j ].groups ); + _settings.fractions = _settings.fractions.concat( _settings.plugins[ j ].fractions ); + } + } else { + _settings.plugins = {}; + } + + _base = document.createElement( 'div' ); + _base.className = 'rs-base'; + _div = document.createElement( 'div' ); + _div.className = 'rs-container'; + _div.style.height = 'auto'; + _base.appendChild( _div ); + document.body.appendChild( _base ); + + if ( !_settings ) return; + + if ( _settings.groups ) { + iterateKeys( _settings.groups, function ( j ) { + var g = _settings.groups[ parseInt( j, 10 ) ]; + var div = document.createElement( 'div' ); + div.className = 'rs-group'; + g.div = div; + var h1 = document.createElement( 'h1' ); + h1.textContent = g.caption; + h1.addEventListener( 'click', function ( e ) { + this.classList.toggle( 'hidden' ); + e.preventDefault(); + }.bind( div ) ); + _div.appendChild( h1 ); + _div.appendChild( div ); + } ); + } + + if ( _settings.fractions ) { + iterateKeys( _settings.fractions, function ( j ) { + var f = _settings.fractions[ parseInt( j, 10 ) ]; + var div = document.createElement( 'div' ); + div.className = 'rs-fraction'; + var legend = document.createElement( 'div' ); + legend.className = 'rs-legend'; + + var h = 0; + iterateKeys( _settings.fractions[ j ].steps, function ( k ) { + var p = document.createElement( 'p' ); + p.textContent = _settings.fractions[ j ].steps[ k ]; + p.style.color = _colours[ h ]; + legend.appendChild( p ); + h++; + } ); + div.appendChild( legend ); + div.style.height = h * _elHeight + 'px'; + f.div = div; + var graph = new StackGraph( div, h ); + f.graph = graph; + _div.appendChild( div ); + } ); + } + + } + + function _update () { + + iterateKeys( _settings.plugins, function ( j ) { + _settings.plugins[ j ].update(); + } ); + + iterateKeys( _perfCounters, function ( j ) { + _perfCounters[ j ].draw(); + } ); + + if ( _settings && _settings.fractions ) { + iterateKeys( _settings.fractions, function ( j ) { + var f = _settings.fractions[ parseInt( j, 10 ) ]; + var v = []; + var base = _perfCounters[ f.base.toLowerCase() ]; + if ( base ) { + base = base.value(); + iterateKeys( _settings.fractions[ j ].steps, function ( k ) { + var s = _settings.fractions[ j ].steps[ parseInt( k, 10 ) ].toLowerCase(); + var val = _perfCounters[ s ]; + if ( val ) { + v.push( val.value() / base ); + } + } ); + } + f.graph.draw( v ); + } ); + } + + /*if( _height != _div.clientHeight ) { + _height = _div.clientHeight; + _base.style.height = _height + 2 * _elHeight + 'px'; + console.log( _base.clientHeight ); + }*/ + + } + + _init(); + + return function ( id ) { + if ( id ) return _perf( id ); + return { + element: _base, + update: _update + }; + }; + +} + +if (typeof module === 'object') { + module.exports = window.rStats; +} + +window.glStats = function () { + + var _rS = null; + + var _totalDrawArraysCalls = 0, + _totalDrawElementsCalls = 0, + _totalUseProgramCalls = 0, + _totalFaces = 0, + _totalVertices = 0, + _totalPoints = 0, + _totalBindTexures = 0; + + function _h ( f, c ) { + return function () { + c.apply( this, arguments ); + f.apply( this, arguments ); + }; + } + + WebGLRenderingContext.prototype.drawArrays = _h( WebGLRenderingContext.prototype.drawArrays, function () { + _totalDrawArraysCalls++; + if ( arguments[ 0 ] == this.POINTS ) _totalPoints += arguments[ 2 ]; + else _totalVertices += arguments[ 2 ]; + } ); + + WebGLRenderingContext.prototype.drawElements = _h( WebGLRenderingContext.prototype.drawElements, function () { + _totalDrawElementsCalls++; + _totalFaces += arguments[ 1 ] / 3; + _totalVertices += arguments[ 1 ]; + } ); + + WebGLRenderingContext.prototype.useProgram = _h( WebGLRenderingContext.prototype.useProgram, function () { + _totalUseProgramCalls++; + } ); + + WebGLRenderingContext.prototype.bindTexture = _h( WebGLRenderingContext.prototype.bindTexture, function () { + _totalBindTexures++; + } ); + + var _values = { + allcalls: { + over: 3000, + caption: 'Calls (hook)' + }, + drawelements: { + caption: 'drawElements (hook)' + }, + drawarrays: { + caption: 'drawArrays (hook)' + } + }; + + var _groups = [ { + caption: 'WebGL', + values: [ 'allcalls', 'drawelements', 'drawarrays', 'useprogram', 'bindtexture', 'glfaces', 'glvertices', 'glpoints' ] + } ]; + + var _fractions = [ { + base: 'allcalls', + steps: [ 'drawelements', 'drawarrays' ] + } ]; + + function _update () { + _rS( 'allcalls' ).set( _totalDrawArraysCalls + _totalDrawElementsCalls ); + _rS( 'drawElements' ).set( _totalDrawElementsCalls ); + _rS( 'drawArrays' ).set( _totalDrawArraysCalls ); + _rS( 'bindTexture' ).set( _totalBindTexures ); + _rS( 'useProgram' ).set( _totalUseProgramCalls ); + _rS( 'glfaces' ).set( _totalFaces ); + _rS( 'glvertices' ).set( _totalVertices ); + _rS( 'glpoints' ).set( _totalPoints ); + } + + function _start () { + _totalDrawArraysCalls = 0; + _totalDrawElementsCalls = 0; + _totalUseProgramCalls = 0; + _totalFaces = 0; + _totalVertices = 0; + _totalPoints = 0; + _totalBindTexures = 0; + } + + function _end () {} + + function _attach ( r ) { + _rS = r; + } + + return { + update: _update, + start: _start, + end: _end, + attach: _attach, + values: _values, + groups: _groups, + fractions: _fractions + }; + +}; + +window.threeStats = function ( renderer ) { + + var _rS = null; + + var _values = { + 'renderer.info.memory.geometries': { + caption: 'Geometries' + }, + 'renderer.info.memory.textures': { + caption: 'Textures' + }, + 'renderer.info.programs': { + caption: 'Programs' + }, + 'renderer.info.render.calls': { + caption: 'Calls' + }, + 'renderer.info.render.faces': { + caption: 'Faces', + over: 1000 + }, + 'renderer.info.render.points': { + caption: 'Points' + }, + 'renderer.info.render.vertices': { + caption: 'Vertices' + } + }; + + var _groups = [ { + caption: 'Three.js - Memory', + values: [ 'renderer.info.memory.geometries', 'renderer.info.programs', 'renderer.info.memory.textures' ] + }, { + caption: 'Three.js - Render', + values: [ 'renderer.info.render.calls', 'renderer.info.render.faces', 'renderer.info.render.points', 'renderer.info.render.vertices' ] + } ]; + + var _fractions = []; + + function _update () { + + _rS( 'renderer.info.memory.geometries' ).set( renderer.info.memory.geometries ); + //_rS( 'renderer.info.programs' ).set( renderer.info.programs.length ); + _rS( 'renderer.info.memory.textures' ).set( renderer.info.memory.textures ); + _rS( 'renderer.info.render.calls' ).set( renderer.info.render.calls ); + _rS( 'renderer.info.render.faces' ).set( renderer.info.render.faces ); + _rS( 'renderer.info.render.points' ).set( renderer.info.render.points ); + _rS( 'renderer.info.render.vertices' ).set( renderer.info.render.vertices ); + + } + + function _start () {} + + function _end () {} + + function _attach ( r ) { + _rS = r; + } + + return { + update: _update, + start: _start, + end: _end, + attach: _attach, + values: _values, + groups: _groups, + fractions: _fractions + }; + +}; + +/* + * From https://github.com/paulirish/memory-stats.js + */ + +window.BrowserStats = function () { + + var _rS = null; + + var _usedJSHeapSize = 0, + _totalJSHeapSize = 0; + + var memory = { + usedJSHeapSize: 0, + totalJSHeapSize: 0 + }; + + if ( window.performance && performance.memory ) + memory = performance.memory; + + if ( memory.totalJSHeapSize === 0 ) { + console.warn( 'totalJSHeapSize === 0... performance.memory is only available in Chrome .' ); + } + + var _values = { + memory: { + caption: 'Used Memory', + average: true, + avgMs: 1000, + over: 22 + }, + total: { + caption: 'Total Memory' + } + }; + + var _groups = [ { + caption: 'Browser', + values: [ 'memory', 'total' ] + } ]; + + var _fractions = [ { + base: 'total', + steps: [ 'memory' ] + } ]; + + var log1024 = Math.log( 1024 ); + + function _size ( v ) { + + var precision = 100; //Math.pow(10, 2); + var i = Math.floor( Math.log( v ) / log1024 ); + if( v === 0 ) i = 1; + return Math.round( v * precision / Math.pow( 1024, i ) ) / precision; // + ' ' + sizes[i]; + + } + + function _update () { + _usedJSHeapSize = _size( memory.usedJSHeapSize ); + _totalJSHeapSize = _size( memory.totalJSHeapSize ); + + _rS( 'memory' ).set( _usedJSHeapSize ); + _rS( 'total' ).set( _totalJSHeapSize ); + } + + function _start () { + _usedJSHeapSize = 0; + } + + function _end () {} + + function _attach ( r ) { + _rS = r; + } + + return { + update: _update, + start: _start, + end: _end, + attach: _attach, + values: _values, + groups: _groups, + fractions: _fractions + }; + +}; + +if (typeof module === 'object') { + module.exports = { + glStats: window.glStats, + threeStats: window.threeStats, + BrowserStats: window.BrowserStats + }; +} diff --git a/build/public/assets/models/teapot-claraio.json b/build/public/assets/models/teapot-claraio.json new file mode 100644 index 0000000..f75eb17 --- /dev/null +++ b/build/public/assets/models/teapot-claraio.json @@ -0,0 +1,2 @@ + +{"metadata":{"version":4.3,"type":"Object","generator":"ObjectExporter"},"geometries":[{"uuid":"15930b1c-1b50-4926-a0ac-df433b9c4f96","type":"Geometry","data":{"vertices":[0.699999988079071,1.2000000476837158,0,0.6456999778747559,1.2000000476837158,0.27469998598098755,0.6366999745368958,1.236899971961975,0.27090001106262207,0.6901999711990356,1.236899971961975,0,0.6471999883651733,1.2491999864578247,0.2754000127315521,0.7016000151634216,1.2491999864578247,0,0.6685000061988831,1.236899971961975,0.28439998626708984,0.7246000170707703,1.236899971961975,0,0.6919000148773193,1.2000000476837158,0.29440000653266907,0.75,1.2000000476837158,0,0.4970000088214874,1.2000000476837158,0.4970000088214874,0.4900999963283539,1.236899971961975,0.4900999963283539,0.49810001254081726,1.2491999864578247,0.49810001254081726,0.5145000219345093,1.236899971961975,0.5145000219345093,0.5325000286102295,1.2000000476837158,0.5325000286102295,0.27469998598098755,1.2000000476837158,0.6456999778747559,0.27090001106262207,1.236899971961975,0.6366999745368958,0.2754000127315521,1.2491999864578247,0.6471999883651733,0.28439998626708984,1.236899971961975,0.6685000061988831,0.29440000653266907,1.2000000476837158,0.6919000148773193,0,1.2000000476837158,0.699999988079071,0,1.236899971961975,0.6901999711990356,0,1.2491999864578247,0.7016000151634216,0,1.236899971961975,0.7246000170707703,0,1.2000000476837158,0.75,-0.2937000095844269,1.2000000476837158,0.6456999778747559,-0.27889999747276306,1.236899971961975,0.6366999745368958,-0.2777000069618225,1.2491999864578247,0.6471999883651733,-0.2847000062465668,1.236899971961975,0.6685000061988831,-0.29440000653266907,1.2000000476837158,0.6919000148773193,-0.5138999819755554,1.2000000476837158,0.4970000088214874,-0.49720001220703125,1.236899971961975,0.4900999963283539,-0.5001999735832214,1.2491999864578247,0.49810001254081726,-0.5146999955177307,1.236899971961975,0.5145000219345093,-0.5325000286102295,1.2000000476837158,0.5325000286102295,-0.6521000266075134,1.2000000476837158,0.27469998598098755,-0.6394000053405762,1.236899971961975,0.27090001106262207,-0.6480000019073486,1.2491999864578247,0.2754000127315521,-0.6686000227928162,1.236899971961975,0.28439998626708984,-0.6919000148773193,1.2000000476837158,0.29440000653266907,-0.699999988079071,1.2000000476837158,0,-0.6901999711990356,1.236899971961975,0,-0.7016000151634216,1.2491999864578247,0,-0.7246000170707703,1.236899971961975,0,-0.75,1.2000000476837158,0,-0.6456999778747559,1.2000000476837158,-0.27469998598098755,-0.6366999745368958,1.236899971961975,-0.27090001106262207,-0.6471999883651733,1.2491999864578247,-0.2754000127315521,-0.6685000061988831,1.236899971961975,-0.28439998626708984,-0.6919000148773193,1.2000000476837158,-0.29440000653266907,-0.4970000088214874,1.2000000476837158,-0.4970000088214874,-0.4900999963283539,1.236899971961975,-0.4900999963283539,-0.49810001254081726,1.2491999864578247,-0.49810001254081726,-0.5145000219345093,1.236899971961975,-0.5145000219345093,-0.5325000286102295,1.2000000476837158,-0.5325000286102295,-0.27469998598098755,1.2000000476837158,-0.6456999778747559,-0.27090001106262207,1.236899971961975,-0.6366999745368958,-0.2754000127315521,1.2491999864578247,-0.6471999883651733,-0.28439998626708984,1.236899971961975,-0.6685000061988831,-0.29440000653266907,1.2000000476837158,-0.6919000148773193,0,1.2000000476837158,-0.699999988079071,0,1.236899971961975,-0.6901999711990356,0,1.2491999864578247,-0.7016000151634216,0,1.236899971961975,-0.7246000170707703,0,1.2000000476837158,-0.75,0.27469998598098755,1.2000000476837158,-0.6456999778747559,0.27090001106262207,1.236899971961975,-0.6366999745368958,0.2754000127315521,1.2491999864578247,-0.6471999883651733,0.28439998626708984,1.236899971961975,-0.6685000061988831,0.29440000653266907,1.2000000476837158,-0.6919000148773193,0.4970000088214874,1.2000000476837158,-0.4970000088214874,0.4900999963283539,1.236899971961975,-0.4900999963283539,0.49810001254081726,1.2491999864578247,-0.49810001254081726,0.5145000219345093,1.236899971961975,-0.5145000219345093,0.5325000286102295,1.2000000476837158,-0.5325000286102295,0.6456999778747559,1.2000000476837158,-0.27469998598098755,0.6366999745368958,1.236899971961975,-0.27090001106262207,0.6471999883651733,1.2491999864578247,-0.2754000127315521,0.6685000061988831,1.236899971961975,-0.28439998626708984,0.6919000148773193,1.2000000476837158,-0.29440000653266907,0.7766000032424927,1.0037000179290771,0.3303999900817871,0.8417999744415283,1.0037000179290771,0,0.8503999710083008,0.8108999729156494,0.3617999851703644,0.9218999743461609,0.8108999729156494,0,0.9027000069618225,0.6251999735832214,0.3840999901294708,0.9785000085830688,0.6251999735832214,0,0.9225000143051147,0.44999998807907104,0.39250001311302185,1,0.44999998807907104,0,0.5976999998092651,1.0037000179290771,0.5976999998092651,0.6545000076293945,0.8108999729156494,0.6545000076293945,0.6947000026702881,0.6251999735832214,0.6947000026702881,0.7099999785423279,0.44999998807907104,0.7099999785423279,0.3303999900817871,1.0037000179290771,0.7766000032424927,0.3617999851703644,0.8108999729156494,0.8503999710083008,0.3840999901294708,0.6251999735832214,0.9027000069618225,0.39250001311302185,0.44999998807907104,0.9225000143051147,0,1.0037000179290771,0.8417999744415283,0,0.8108999729156494,0.9218999743461609,0,0.6251999735832214,0.9785000085830688,0,0.44999998807907104,1,-0.3303999900817871,1.0037000179290771,0.7766000032424927,-0.3617999851703644,0.8108999729156494,0.8503999710083008,-0.3840999901294708,0.6251999735832214,0.9027000069618225,-0.39250001311302185,0.44999998807907104,0.9225000143051147,-0.5976999998092651,1.0037000179290771,0.5976999998092651,-0.6545000076293945,0.8108999729156494,0.6545000076293945,-0.6947000026702881,0.6251999735832214,0.6947000026702881,-0.7099999785423279,0.44999998807907104,0.7099999785423279,-0.7766000032424927,1.0037000179290771,0.3303999900817871,-0.8503999710083008,0.8108999729156494,0.3617999851703644,-0.9027000069618225,0.6251999735832214,0.3840999901294708,-0.9225000143051147,0.44999998807907104,0.39250001311302185,-0.8417999744415283,1.0037000179290771,0,-0.9218999743461609,0.8108999729156494,0,-0.9785000085830688,0.6251999735832214,0,-1,0.44999998807907104,0,-0.7766000032424927,1.0037000179290771,-0.3303999900817871,-0.8503999710083008,0.8108999729156494,-0.3617999851703644,-0.9027000069618225,0.6251999735832214,-0.3840999901294708,-0.9225000143051147,0.44999998807907104,-0.39250001311302185,-0.5976999998092651,1.0037000179290771,-0.5976999998092651,-0.6545000076293945,0.8108999729156494,-0.6545000076293945,-0.6947000026702881,0.6251999735832214,-0.6947000026702881,-0.7099999785423279,0.44999998807907104,-0.7099999785423279,-0.3303999900817871,1.0037000179290771,-0.7766000032424927,-0.3617999851703644,0.8108999729156494,-0.8503999710083008,-0.3840999901294708,0.6251999735832214,-0.9027000069618225,-0.39250001311302185,0.44999998807907104,-0.9225000143051147,0,1.0037000179290771,-0.8417999744415283,0,0.8108999729156494,-0.9218999743461609,0,0.6251999735832214,-0.9785000085830688,0,0.44999998807907104,-1,0.3303999900817871,1.0037000179290771,-0.7766000032424927,0.3617999851703644,0.8108999729156494,-0.8503999710083008,0.3840999901294708,0.6251999735832214,-0.9027000069618225,0.39250001311302185,0.44999998807907104,-0.9225000143051147,0.5976999998092651,1.0037000179290771,-0.5976999998092651,0.6545000076293945,0.8108999729156494,-0.6545000076293945,0.6947000026702881,0.6251999735832214,-0.6947000026702881,0.7099999785423279,0.44999998807907104,-0.7099999785423279,0.7766000032424927,1.0037000179290771,-0.3303999900817871,0.8503999710083008,0.8108999729156494,-0.3617999851703644,0.9027000069618225,0.6251999735832214,-0.3840999901294708,0.9225000143051147,0.44999998807907104,-0.39250001311302185,0.8865000009536743,0.301800012588501,0.37720000743865967,0.9609000086784363,0.301800012588501,0,0.807200014591217,0.19220000505447388,0.3434000015258789,0.875,0.19220000505447388,0,0.7279000282287598,0.11779999732971191,0.30970001220703125,0.7890999913215637,0.11779999732971191,0,0.6919000148773193,0.07500000298023224,0.29440000653266907,0.75,0.07500000298023224,0,0.6822999715805054,0.301800012588501,0.6822999715805054,0.6212999820709229,0.19220000505447388,0.6212999820709229,0.5601999759674072,0.11779999732971191,0.5601999759674072,0.5325000286102295,0.07500000298023224,0.5325000286102295,0.37720000743865967,0.301800012588501,0.8865000009536743,0.3434000015258789,0.19220000505447388,0.807200014591217,0.30970001220703125,0.11779999732971191,0.7279000282287598,0.29440000653266907,0.07500000298023224,0.6919000148773193,0,0.301800012588501,0.9609000086784363,0,0.19220000505447388,0.875,0,0.11779999732971191,0.7890999913215637,0,0.07500000298023224,0.75,-0.37720000743865967,0.301800012588501,0.8865000009536743,-0.3434000015258789,0.19220000505447388,0.807200014591217,-0.30970001220703125,0.11779999732971191,0.7279000282287598,-0.29440000653266907,0.07500000298023224,0.6919000148773193,-0.6822999715805054,0.301800012588501,0.6822999715805054,-0.6212999820709229,0.19220000505447388,0.6212999820709229,-0.5601999759674072,0.11779999732971191,0.5601999759674072,-0.5325000286102295,0.07500000298023224,0.5325000286102295,-0.8865000009536743,0.301800012588501,0.37720000743865967,-0.807200014591217,0.19220000505447388,0.3434000015258789,-0.7279000282287598,0.11779999732971191,0.30970001220703125,-0.6919000148773193,0.07500000298023224,0.29440000653266907,-0.9609000086784363,0.301800012588501,0,-0.875,0.19220000505447388,0,-0.7890999913215637,0.11779999732971191,0,-0.75,0.07500000298023224,0,-0.8865000009536743,0.301800012588501,-0.37720000743865967,-0.807200014591217,0.19220000505447388,-0.3434000015258789,-0.7279000282287598,0.11779999732971191,-0.30970001220703125,-0.6919000148773193,0.07500000298023224,-0.29440000653266907,-0.6822999715805054,0.301800012588501,-0.6822999715805054,-0.6212999820709229,0.19220000505447388,-0.6212999820709229,-0.5601999759674072,0.11779999732971191,-0.5601999759674072,-0.5325000286102295,0.07500000298023224,-0.5325000286102295,-0.37720000743865967,0.301800012588501,-0.8865000009536743,-0.3434000015258789,0.19220000505447388,-0.807200014591217,-0.30970001220703125,0.11779999732971191,-0.7279000282287598,-0.29440000653266907,0.07500000298023224,-0.6919000148773193,0,0.301800012588501,-0.9609000086784363,0,0.19220000505447388,-0.875,0,0.11779999732971191,-0.7890999913215637,0,0.07500000298023224,-0.75,0.37720000743865967,0.301800012588501,-0.8865000009536743,0.3434000015258789,0.19220000505447388,-0.807200014591217,0.30970001220703125,0.11779999732971191,-0.7279000282287598,0.29440000653266907,0.07500000298023224,-0.6919000148773193,0.6822999715805054,0.301800012588501,-0.6822999715805054,0.6212999820709229,0.19220000505447388,-0.6212999820709229,0.5601999759674072,0.11779999732971191,-0.5601999759674072,0.5325000286102295,0.07500000298023224,-0.5325000286102295,0.8865000009536743,0.301800012588501,-0.37720000743865967,0.807200014591217,0.19220000505447388,-0.3434000015258789,0.7279000282287598,0.11779999732971191,-0.30970001220703125,0.6919000148773193,0.07500000298023224,-0.29440000653266907,0.6761999726295471,0.04749999940395355,0.28769999742507935,0.7329999804496765,0.04749999940395355,0,0.5924000144004822,0.023399999365210533,0.25209999084472656,0.6421999931335449,0.023399999365210533,0,0.3853999972343445,0.006399999838322401,0.164000004529953,0.41780000925064087,0.006399999838322401,0,0,0,0,0.5203999876976013,0.04749999940395355,0.5203999876976013,0.4560000002384186,0.023399999365210533,0.4560000002384186,0.29660001397132874,0.006399999838322401,0.29660001397132874,0.28769999742507935,0.04749999940395355,0.6761999726295471,0.25209999084472656,0.023399999365210533,0.5924000144004822,0.164000004529953,0.006399999838322401,0.3853999972343445,0,0.04749999940395355,0.7329999804496765,0,0.023399999365210533,0.6421999931335449,0,0.006399999838322401,0.41780000925064087,-0.28769999742507935,0.04749999940395355,0.6761999726295471,-0.25209999084472656,0.023399999365210533,0.5924000144004822,-0.164000004529953,0.006399999838322401,0.3853999972343445,-0.5203999876976013,0.04749999940395355,0.5203999876976013,-0.4560000002384186,0.023399999365210533,0.4560000002384186,-0.29660001397132874,0.006399999838322401,0.29660001397132874,-0.6761999726295471,0.04749999940395355,0.28769999742507935,-0.5924000144004822,0.023399999365210533,0.25209999084472656,-0.3853999972343445,0.006399999838322401,0.164000004529953,-0.7329999804496765,0.04749999940395355,0,-0.6421999931335449,0.023399999365210533,0,-0.41780000925064087,0.006399999838322401,0,-0.6761999726295471,0.04749999940395355,-0.28769999742507935,-0.5924000144004822,0.023399999365210533,-0.25209999084472656,-0.3853999972343445,0.006399999838322401,-0.164000004529953,-0.5203999876976013,0.04749999940395355,-0.5203999876976013,-0.4560000002384186,0.023399999365210533,-0.4560000002384186,-0.29660001397132874,0.006399999838322401,-0.29660001397132874,-0.28769999742507935,0.04749999940395355,-0.6761999726295471,-0.25209999084472656,0.023399999365210533,-0.5924000144004822,-0.164000004529953,0.006399999838322401,-0.3853999972343445,0,0.04749999940395355,-0.7329999804496765,0,0.023399999365210533,-0.6421999931335449,0,0.006399999838322401,-0.41780000925064087,0.28769999742507935,0.04749999940395355,-0.6761999726295471,0.25209999084472656,0.023399999365210533,-0.5924000144004822,0.164000004529953,0.006399999838322401,-0.3853999972343445,0.5203999876976013,0.04749999940395355,-0.5203999876976013,0.4560000002384186,0.023399999365210533,-0.4560000002384186,0.29660001397132874,0.006399999838322401,-0.29660001397132874,0.6761999726295471,0.04749999940395355,-0.28769999742507935,0.5924000144004822,0.023399999365210533,-0.25209999084472656,0.3853999972343445,0.006399999838322401,-0.164000004529953,-0.800000011920929,1.0125000476837158,0,-0.7922000288963318,1.0300999879837036,0.0843999981880188,-1.0405999422073364,1.027999997138977,0.0843999981880188,-1.0335999727249146,1.010699987411499,0,-1.2229000329971313,1.013800024986267,0.0843999981880188,-1.2063000202178955,0.9983999729156494,0,-1.3351000547409058,0.9751999974250793,0.0843999981880188,-1.3133000135421753,0.9649999737739563,0,-1.3733999729156494,0.8999999761581421,0.0843999981880188,-1.350000023841858,0.8999999761581421,0,-0.7749999761581421,1.0687999725341797,0.11249999701976776,-1.055899977684021,1.066100001335144,0.11249999701976776,-1.2594000101089478,1.047700047492981,0.11249999701976776,-1.3832000494003296,0.9976000189781189,0.11249999701976776,-1.4249999523162842,0.8999999761581421,0.11249999701976776,-0.7577999830245972,1.1073999404907227,0.0843999981880188,-1.0712000131607056,1.104200005531311,0.0843999981880188,-1.2958999872207642,1.0815000534057617,0.0843999981880188,-1.4313000440597534,1.0198999643325806,0.0843999981880188,-1.4766000509262085,0.8999999761581421,0.0843999981880188,-0.75,1.125,0,-1.0780999660491943,1.121500015258789,0,-1.3125,1.0968999862670898,0,-1.4530999660491943,1.0300999879837036,0,-1.5,0.8999999761581421,0,-0.7577999830245972,1.1073999404907227,-0.0843999981880188,-1.0712000131607056,1.104200005531311,-0.0843999981880188,-1.2958999872207642,1.0815000534057617,-0.0843999981880188,-1.4313000440597534,1.0198999643325806,-0.0843999981880188,-1.4766000509262085,0.8999999761581421,-0.0843999981880188,-0.7749999761581421,1.0687999725341797,-0.11249999701976776,-1.055899977684021,1.066100001335144,-0.11249999701976776,-1.2594000101089478,1.047700047492981,-0.11249999701976776,-1.3832000494003296,0.9976000189781189,-0.11249999701976776,-1.4249999523162842,0.8999999761581421,-0.11249999701976776,-0.7922000288963318,1.0300999879837036,-0.0843999981880188,-1.0405999422073364,1.027999997138977,-0.0843999981880188,-1.2229000329971313,1.013800024986267,-0.0843999981880188,-1.3351000547409058,0.9751999974250793,-0.0843999981880188,-1.3733999729156494,0.8999999761581421,-0.0843999981880188,-1.3517999649047852,0.7882000207901001,0.0843999981880188,-1.3305000066757202,0.7979999780654907,0,-1.2839000225067139,0.6600000262260437,0.0843999981880188,-1.2687000036239624,0.675000011920929,0,-1.1655000448226929,0.5333999991416931,0.0843999981880188,-1.1601999998092651,0.5519999861717224,0,-0.9922000169754028,0.42660000920295715,0.0843999981880188,-1.3985999822616577,0.7666000127792358,0.11249999701976776,-1.317199945449829,0.6269999742507935,0.11249999701976776,-1.1770999431610107,0.4925999939441681,0.11249999701976776,-0.9750000238418579,0.375,0.11249999701976776,-1.4455000162124634,0.7448999881744385,0.0843999981880188,-1.3504999876022339,0.5939000248908997,0.0843999981880188,-1.1887999773025513,0.45179998874664307,0.0843999981880188,-0.9577999711036682,0.32339999079704285,0.0843999981880188,-1.4667999744415283,0.7350999712944031,0,-1.3655999898910522,0.5788999795913696,0,-1.194100022315979,0.4332999885082245,0,-0.949999988079071,0.30000001192092896,0,-1.4455000162124634,0.7448999881744385,-0.0843999981880188,-1.3504999876022339,0.5939000248908997,-0.0843999981880188,-1.1887999773025513,0.45179998874664307,-0.0843999981880188,-0.9577999711036682,0.32339999079704285,-0.0843999981880188,-1.3985999822616577,0.7666000127792358,-0.11249999701976776,-1.317199945449829,0.6269999742507935,-0.11249999701976776,-1.1770999431610107,0.4925999939441681,-0.11249999701976776,-0.9750000238418579,0.375,-0.11249999701976776,-1.3517999649047852,0.7882000207901001,-0.0843999981880188,-1.2839000225067139,0.6600000262260437,-0.0843999981880188,-1.1655000448226929,0.5333999991416931,-0.0843999981880188,-0.9922000169754028,0.42660000920295715,-0.0843999981880188,0.8500000238418579,0.7124999761581421,0,0.8500000238418579,0.6480000019073486,0.18559999763965607,1.108199954032898,0.7197999954223633,0.16760000586509705,1.0898000001907349,0.7675999999046326,0,1.2172000408172607,0.8722000122070312,0.12800000607967377,1.1937999725341797,0.8999999761581421,0,1.2792999744415283,1.0505000352859497,0.08829999715089798,1.2508000135421753,1.0605000257492065,0,1.3969000577926636,1.2000000476837158,0.07029999792575836,1.350000023841858,1.2000000476837158,0,0.8500000238418579,0.5062999725341797,0.2475000023841858,1.1483999490737915,0.6146000027656555,0.22349999845027924,1.2687000036239624,0.8108999729156494,0.17059999704360962,1.3422000408172607,1.0283000469207764,0.11779999732971191,1.5,1.2000000476837158,0.09380000084638596,0.8500000238418579,0.3644999861717224,0.18559999763965607,1.1886999607086182,0.5095000267028809,0.16760000586509705,1.3202999830245972,0.7497000098228455,0.12800000607967377,1.4049999713897705,1.0061999559402466,0.08829999715089798,1.6030999422073364,1.2000000476837158,0.07029999792575836,0.8500000238418579,0.30000001192092896,0,1.2070000171661377,0.4616999924182892,0,1.3437000513076782,0.7218999862670898,0,1.4335999488830566,0.9961000084877014,0,1.649999976158142,1.2000000476837158,0,0.8500000238418579,0.3644999861717224,-0.18559999763965607,1.1886999607086182,0.5095000267028809,-0.16760000586509705,1.3202999830245972,0.7497000098228455,-0.12800000607967377,1.4049999713897705,1.0061999559402466,-0.08829999715089798,1.6030999422073364,1.2000000476837158,-0.07029999792575836,0.8500000238418579,0.5062000155448914,-0.2475000023841858,1.1483999490737915,0.6146000027656555,-0.22349999845027924,1.2687000036239624,0.8108999729156494,-0.17059999704360962,1.3422000408172607,1.0283000469207764,-0.11779999732971191,1.5,1.2000000476837158,-0.09380000084638596,0.8500000238418579,0.6480000019073486,-0.18559999763965607,1.108199954032898,0.7197999954223633,-0.16760000586509705,1.2172000408172607,0.8722000122070312,-0.12800000607967377,1.2792999744415283,1.0505000352859497,-0.08829999715089798,1.3969000577926636,1.2000000476837158,-0.07029999792575836,1.4361000061035156,1.222100019454956,0.06589999794960022,1.3859000205993652,1.2210999727249146,0,1.4595999717712402,1.2297999858856201,0.056299999356269836,1.412500023841858,1.2280999422073364,0,1.4602999687194824,1.222499966621399,0.04659999907016754,1.420300006866455,1.2210999727249146,0,1.4312000274658203,1.2000000476837158,0.0421999990940094,1.399999976158142,1.2000000476837158,0,1.5465999841690063,1.2244000434875488,0.08789999783039093,1.5633000135421753,1.2333999872207642,0.07500000298023224,1.54830002784729,1.2257000207901,0.06210000067949295,1.5,1.2000000476837158,0.056299999356269836,1.656999945640564,1.226699948310852,0.06589999794960022,1.6669000387191772,1.2369999885559082,0.056299999356269836,1.6363999843597412,1.2288999557495117,0.04659999907016754,1.5687999725341797,1.2000000476837158,0.0421999990940094,1.707200050354004,1.2276999950408936,0,1.7141000032424927,1.238700032234192,0,1.6763999462127686,1.230299949645996,0,1.600000023841858,1.2000000476837158,0,1.656999945640564,1.226699948310852,-0.06589999794960022,1.6669000387191772,1.2369999885559082,-0.056299999356269836,1.6363999843597412,1.2288999557495117,-0.04659999907016754,1.5687999725341797,1.2000000476837158,-0.0421999990940094,1.5465999841690063,1.2244000434875488,-0.08789999783039093,1.5633000135421753,1.2333999872207642,-0.07500000298023224,1.54830002784729,1.2257000207901,-0.06210000067949295,1.5,1.2000000476837158,-0.056299999356269836,1.4361000061035156,1.222100019454956,-0.06589999794960022,1.4595999717712402,1.2297999858856201,-0.056299999356269836,1.4602999687194824,1.222499966621399,-0.04659999907016754,1.4312000274658203,1.2000000476837158,-0.0421999990940094,0.15719999372959137,1.5504000186920166,0.06700000166893005,0.17030000686645508,1.5504000186920166,0,0,1.5750000476837158,0,0.15000000596046448,1.4905999898910522,0.06390000134706497,0.16249999403953552,1.4905999898910522,0,0.09080000221729279,1.4168000221252441,0.03869999945163727,0.09839999675750732,1.4168000221252441,0,0.09229999780654907,1.350000023841858,0.03929999843239784,0.10000000149011612,1.350000023841858,0,0.12110000103712082,1.5504000186920166,0.12110000103712082,0.11550000309944153,1.4905999898910522,0.11550000309944153,0.06989999860525131,1.4168000221252441,0.06989999860525131,0.07100000232458115,1.350000023841858,0.07100000232458115,0.06700000166893005,1.5504000186920166,0.15719999372959137,0.06390000134706497,1.4905999898910522,0.15000000596046448,0.03869999945163727,1.4168000221252441,0.09080000221729279,0.03929999843239784,1.350000023841858,0.09229999780654907,0,1.5504000186920166,0.17030000686645508,0,1.4905999898910522,0.16249999403953552,0,1.4168000221252441,0.09839999675750732,0,1.350000023841858,0.10000000149011612,-0.06700000166893005,1.5504000186920166,0.15719999372959137,-0.06390000134706497,1.4905999898910522,0.15000000596046448,-0.03869999945163727,1.4168000221252441,0.09080000221729279,-0.03929999843239784,1.350000023841858,0.09229999780654907,-0.12110000103712082,1.5504000186920166,0.12110000103712082,-0.11550000309944153,1.4905999898910522,0.11550000309944153,-0.06989999860525131,1.4168000221252441,0.06989999860525131,-0.07100000232458115,1.350000023841858,0.07100000232458115,-0.15719999372959137,1.5504000186920166,0.06700000166893005,-0.15000000596046448,1.4905999898910522,0.06390000134706497,-0.09080000221729279,1.4168000221252441,0.03869999945163727,-0.09229999780654907,1.350000023841858,0.03929999843239784,-0.17030000686645508,1.5504000186920166,0,-0.16249999403953552,1.4905999898910522,0,-0.09839999675750732,1.4168000221252441,0,-0.10000000149011612,1.350000023841858,0,-0.15719999372959137,1.5504000186920166,-0.06700000166893005,-0.15000000596046448,1.4905999898910522,-0.06390000134706497,-0.09080000221729279,1.4168000221252441,-0.03869999945163727,-0.09229999780654907,1.350000023841858,-0.03929999843239784,-0.12110000103712082,1.5504000186920166,-0.12110000103712082,-0.11550000309944153,1.4905999898910522,-0.11550000309944153,-0.06989999860525131,1.4168000221252441,-0.06989999860525131,-0.07100000232458115,1.350000023841858,-0.07100000232458115,-0.06700000166893005,1.5504000186920166,-0.15719999372959137,-0.06390000134706497,1.4905999898910522,-0.15000000596046448,-0.03869999945163727,1.4168000221252441,-0.09080000221729279,-0.03929999843239784,1.350000023841858,-0.09229999780654907,0,1.5504000186920166,-0.17030000686645508,0,1.4905999898910522,-0.16249999403953552,0,1.4168000221252441,-0.09839999675750732,0,1.350000023841858,-0.10000000149011612,0.06700000166893005,1.5504000186920166,-0.15719999372959137,0.06390000134706497,1.4905999898910522,-0.15000000596046448,0.03869999945163727,1.4168000221252441,-0.09080000221729279,0.03929999843239784,1.350000023841858,-0.09229999780654907,0.12110000103712082,1.5504000186920166,-0.12110000103712082,0.11550000309944153,1.4905999898910522,-0.11550000309944153,0.06989999860525131,1.4168000221252441,-0.06989999860525131,0.07100000232458115,1.350000023841858,-0.07100000232458115,0.15719999372959137,1.5504000186920166,-0.06700000166893005,0.15000000596046448,1.4905999898910522,-0.06390000134706497,0.09080000221729279,1.4168000221252441,-0.03869999945163727,0.09229999780654907,1.350000023841858,-0.03929999843239784,0.21040000021457672,1.3055000305175781,0.08950000256299973,0.2281000018119812,1.3055000305175781,0,0.3804999887943268,1.274999976158142,0.16189999878406525,0.4124999940395355,1.274999976158142,0,0.53329998254776,1.2445000410079956,0.22689999639987946,0.5781000256538391,1.2445000410079956,0,0.5996000170707703,1.2000000476837158,0.2551000118255615,0.6499999761581421,1.2000000476837158,0,0.16200000047683716,1.3055000305175781,0.16200000047683716,0.2928999960422516,1.274999976158142,0.2928999960422516,0.4104999899864197,1.2445000410079956,0.4104999899864197,0.46149998903274536,1.2000000476837158,0.46149998903274536,0.08950000256299973,1.3055000305175781,0.21040000021457672,0.16189999878406525,1.274999976158142,0.3804999887943268,0.22689999639987946,1.2445000410079956,0.53329998254776,0.2551000118255615,1.2000000476837158,0.5996000170707703,0,1.3055000305175781,0.2281000018119812,0,1.274999976158142,0.4124999940395355,0,1.2445000410079956,0.5781000256538391,0,1.2000000476837158,0.6499999761581421,-0.08950000256299973,1.3055000305175781,0.21040000021457672,-0.16189999878406525,1.274999976158142,0.3804999887943268,-0.22689999639987946,1.2445000410079956,0.53329998254776,-0.2551000118255615,1.2000000476837158,0.5996000170707703,-0.16200000047683716,1.3055000305175781,0.16200000047683716,-0.2928999960422516,1.274999976158142,0.2928999960422516,-0.4104999899864197,1.2445000410079956,0.4104999899864197,-0.46149998903274536,1.2000000476837158,0.46149998903274536,-0.21040000021457672,1.3055000305175781,0.08950000256299973,-0.3804999887943268,1.274999976158142,0.16189999878406525,-0.53329998254776,1.2445000410079956,0.22689999639987946,-0.5996000170707703,1.2000000476837158,0.2551000118255615,-0.2281000018119812,1.3055000305175781,0,-0.4124999940395355,1.274999976158142,0,-0.5781000256538391,1.2445000410079956,0,-0.6499999761581421,1.2000000476837158,0,-0.21040000021457672,1.3055000305175781,-0.08950000256299973,-0.3804999887943268,1.274999976158142,-0.16189999878406525,-0.53329998254776,1.2445000410079956,-0.22689999639987946,-0.5996000170707703,1.2000000476837158,-0.2551000118255615,-0.16200000047683716,1.3055000305175781,-0.16200000047683716,-0.2928999960422516,1.274999976158142,-0.2928999960422516,-0.4104999899864197,1.2445000410079956,-0.4104999899864197,-0.46149998903274536,1.2000000476837158,-0.46149998903274536,-0.08950000256299973,1.3055000305175781,-0.21040000021457672,-0.16189999878406525,1.274999976158142,-0.3804999887943268,-0.22689999639987946,1.2445000410079956,-0.53329998254776,-0.2551000118255615,1.2000000476837158,-0.5996000170707703,0,1.3055000305175781,-0.2281000018119812,0,1.274999976158142,-0.4124999940395355,0,1.2445000410079956,-0.5781000256538391,0,1.2000000476837158,-0.6499999761581421,0.08950000256299973,1.3055000305175781,-0.21040000021457672,0.16189999878406525,1.274999976158142,-0.3804999887943268,0.22689999639987946,1.2445000410079956,-0.53329998254776,0.2551000118255615,1.2000000476837158,-0.5996000170707703,0.16200000047683716,1.3055000305175781,-0.16200000047683716,0.2928999960422516,1.274999976158142,-0.2928999960422516,0.4104999899864197,1.2445000410079956,-0.4104999899864197,0.46149998903274536,1.2000000476837158,-0.46149998903274536,0.21040000021457672,1.3055000305175781,-0.08950000256299973,0.3804999887943268,1.274999976158142,-0.16189999878406525,0.53329998254776,1.2445000410079956,-0.22689999639987946,0.5996000170707703,1.2000000476837158,-0.2551000118255615],"normals":[-0.9494920694323845,-0.2515364269786189,-0.1876012686200115,-0.96670001745224,-0.2558000087738037,0,-0.8930000066757202,-0.2563000023365021,-0.3698999881744385,-0.8934000134468079,0.25600001215934753,-0.36910000443458557,-0.9667999744415283,0.25540000200271606,0,-0.7260149722024023,0.6725622315424132,-0.14339562350586094,-0.08389999717473984,0.9958000183105469,-0.03550000116229057,-0.09210000187158585,0.9958000183105469,0,0.46895168053340897,0.8783596159888912,0.09256730699733487,0.6297000050544739,0.7318999767303467,0.2603999972343445,0.6819999814033508,0.7312999963760376,0,0.8131828855771891,0.5594560236122703,0.16044485734451933,0.8036999702453613,0.4934000074863434,0.3325999975204468,0.8702999949455261,0.4925000071525574,0,-0.8045241032084407,-0.25135180073328567,-0.5381108060843871,-0.6833999752998352,-0.2567000091075897,-0.6833999752998352,-0.6834999918937683,0.25609999895095825,-0.6834999918937683,-0.6154172153756186,0.6720670779897282,-0.41181002137110273,-0.0649000033736229,0.9958000183105469,-0.0649000033736229,0.39550647488952684,0.8794788320983019,0.2647482053035805,0.4814000129699707,0.7325000166893005,0.4814000129699707,0.6880720658725188,0.5607374353912905,0.4605761182657241,0.614799976348877,0.49399998784065247,0.614799976348877,-0.5381108060843871,-0.25135180073328567,-0.8045241032084407,-0.3698999881744385,-0.2563000023365021,-0.8930000066757202,-0.36910000443458557,0.25600001215934753,-0.8934000134468079,-0.41181002137110273,0.6720670779897282,-0.6154172153756186,-0.03550000116229057,0.9958000183105469,-0.08389999717473984,0.2647482053035805,0.8794788320983019,0.39550647488952684,0.2603999972343445,0.7318999767303467,0.6297000050544739,0.4605761182657241,0.5607374353912905,0.6880720658725188,0.3325999975204468,0.4934000074863434,0.8036999702453613,-0.1876012686200115,-0.2515364269786189,-0.9494920694323845,-0.00279999990016222,-0.2578999996185303,-0.9661999940872192,-0.0019000000320374966,0.2547000050544739,-0.9670000076293945,-0.14339562350586094,0.6725622315424132,-0.7260149722024023,-0.0003000000142492354,0.9957000017166138,-0.09229999780654907,0.09256730699733487,0.8783596159888912,0.46895168053340897,0,0.7312999963760376,0.6820999979972839,0.16044485734451933,0.5594560236122703,0.8131828855771891,0,0.4925000071525574,0.8702999949455261,0.17781356971082418,-0.2762617871652753,-0.94449021137275,0.3790999948978424,-0.35929998755455017,-0.8528000116348267,0.37709999084472656,0.14910000562667847,-0.9140999913215637,0.14395780863022883,0.6540767852077758,-0.7426033317906966,0.027499999850988388,0.9921000003814697,-0.1225999966263771,-0.09276555608813127,0.8766296536816158,0.47213875279382633,-0.26100000739097595,0.7268000245094299,0.6353999972343445,-0.16042337038321952,0.5590076148671953,0.8134954386813597,-0.33250001072883606,0.4925000071525574,0.8043000102043152,0.5155281298975289,-0.3849732031227696,-0.7655235986968341,0.6635000109672546,-0.4108000099658966,-0.6252999901771545,0.7127000093460083,0.07370000332593918,-0.6976000070571899,0.4638206739517661,0.5539062400248373,-0.691417572582934,0.09969999641180038,0.987500011920929,-0.12200000137090683,-0.2749668019071642,0.8694154310328366,0.4104997760424887,-0.48730000853538513,0.723800003528595,0.4885999858379364,-0.46145001001631164,0.5585924142572216,0.6892302974987636,-0.6151999831199646,0.4925999939441681,0.6154999732971191,0.7799397173089967,-0.38252671106395425,-0.495345690085779,0.8799999952316284,-0.3328999876976013,-0.33869999647140503,0.9172999858856201,0.1670999974012375,-0.36149999499320984,0.6935905336506715,0.5583449082267957,-0.4551737416497001,0.1136000007390976,0.9923999905586243,-0.04809999838471413,-0.41112556129251077,0.8694462651166909,0.2739324094125316,-0.6341000199317932,0.7275000214576721,0.26190000772476196,-0.6892193216130235,0.5588149346665281,0.46119691619624625,-0.804099977016449,0.4925999939441681,0.3327000141143799,0.940120720168391,-0.2953801644080805,-0.1700693681540597,0.96670001745224,-0.2556999921798706,0.010499999858438969,0.9674000144004822,0.2529999911785126,0.008100000210106373,0.7547291638439781,0.639985268644528,-0.1442315678392254,0.0934000015258789,0.9955999851226807,0.0013000000035390258,-0.4746532582851164,0.8752533177838288,0.09292961910888725,-0.682200014591217,0.7311999797821045,-0.0003000000142492354,-0.8137112475669765,0.5586976998809986,0.1604084964416667,-0.8702999949455261,0.4925000071525574,-0.00009999999747378752,0.9494920694323845,-0.2515364269786189,0.1876012686200115,0.8930000066757202,-0.2563000023365021,0.3698999881744385,0.8934000134468079,0.25600001215934753,0.36910000443458557,0.7260149722024023,0.6725622315424132,0.14339562350586094,0.08389999717473984,0.9958000183105469,0.03550000116229057,-0.46895168053340897,0.8783596159888912,-0.09256730699733487,-0.6297000050544739,0.7318999767303467,-0.2603999972343445,-0.8131828855771891,0.5594560236122703,-0.16044485734451933,-0.8036999702453613,0.4934000074863434,-0.3325999975204468,0.8045241032084407,-0.25135180073328567,0.5381108060843871,0.6833999752998352,-0.2567000091075897,0.6833999752998352,0.6834999918937683,0.25609999895095825,0.6834999918937683,0.6154172153756186,0.6720670779897282,0.41181002137110273,0.0649000033736229,0.9958000183105469,0.0649000033736229,-0.39550647488952684,0.8794788320983019,-0.2647482053035805,-0.4814000129699707,0.7325000166893005,-0.4814000129699707,-0.6880720658725188,0.5607374353912905,-0.4605761182657241,-0.614799976348877,0.49399998784065247,-0.614799976348877,0.5381108060843871,-0.25135180073328567,0.8045241032084407,0.3698999881744385,-0.2563000023365021,0.8930000066757202,0.36910000443458557,0.25600001215934753,0.8934000134468079,0.41181002137110273,0.6720670779897282,0.6154172153756186,0.03550000116229057,0.9958000183105469,0.08389999717473984,-0.2647482053035805,0.8794788320983019,-0.39550647488952684,-0.2603999972343445,0.7318999767303467,-0.6297000050544739,-0.4605761182657241,0.5607374353912905,-0.6880720658725188,-0.3325999975204468,0.4934000074863434,-0.8036999702453613,0.1876012686200115,-0.2515364269786189,0.9494920694323845,0,-0.2558000087738037,0.96670001745224,0,0.25540000200271606,0.9667999744415283,0.14339562350586094,0.6725622315424132,0.7260149722024023,0,0.9958000183105469,0.09210000187158585,-0.09256730699733487,0.8783596159888912,-0.46895168053340897,0,0.7312999963760376,-0.6819999814033508,-0.16044485734451933,0.5594560236122703,-0.8131828855771891,0,0.4925000071525574,-0.8702999949455261,-0.1876012686200115,-0.2515364269786189,0.9494920694323845,-0.3698999881744385,-0.2563000023365021,0.8930000066757202,-0.36910000443458557,0.25600001215934753,0.8934000134468079,-0.14339562350586094,0.6725622315424132,0.7260149722024023,-0.03550000116229057,0.9958000183105469,0.08389999717473984,0.09256730699733487,0.8783596159888912,-0.46895168053340897,0.2603999972343445,0.7318999767303467,-0.6297000050544739,0.16044485734451933,0.5594560236122703,-0.8131828855771891,0.3325999975204468,0.4934000074863434,-0.8036999702453613,-0.5381108060843871,-0.25135180073328567,0.8045241032084407,-0.6833999752998352,-0.2567000091075897,0.6833999752998352,-0.6834999918937683,0.25609999895095825,0.6834999918937683,-0.41181002137110273,0.6720670779897282,0.6154172153756186,-0.0649000033736229,0.9958000183105469,0.0649000033736229,0.2647482053035805,0.8794788320983019,-0.39550647488952684,0.4814000129699707,0.7325000166893005,-0.4814000129699707,0.4605761182657241,0.5607374353912905,-0.6880720658725188,0.614799976348877,0.49399998784065247,-0.614799976348877,-0.8045241032084407,-0.25135180073328567,0.5381108060843871,-0.8930000066757202,-0.2563000023365021,0.3698999881744385,-0.8934000134468079,0.25600001215934753,0.36910000443458557,-0.6154172153756186,0.6720670779897282,0.41181002137110273,-0.08389999717473984,0.9958000183105469,0.03550000116229057,0.39550647488952684,0.8794788320983019,-0.2647482053035805,0.6297000050544739,0.7318999767303467,-0.2603999972343445,0.6880720658725188,0.5607374353912905,-0.4605761182657241,0.8036999702453613,0.4934000074863434,-0.3325999975204468,-0.9494920694323845,-0.2515364269786189,0.1876012686200115,-0.7260149722024023,0.6725622315424132,0.14339562350586094,0.46895168053340897,0.8783596159888912,-0.09256730699733487,0.8131828855771891,0.5594560236122703,-0.16044485734451933,0.89170186696973,0.4170154906217081,0.175971193734185,0.8453999757766724,0.4034999907016754,0.3497999906539917,0.9153000116348267,0.4027000069618225,0,0.9085685972138349,0.37723739278916374,0.17942980142250198,0.8700000047683716,0.336899995803833,0.36000001430511475,0.9417999982833862,0.3361999988555908,0,0.9398615330526648,0.28672575430335634,0.18560344960982264,0.90420001745224,0.20579999685287476,0.3743000030517578,0.9786999821662903,0.2053000032901764,0,0.974048141581515,0.11941584930670929,0.19227603286929457,0.9218999743461609,-0.06639999896287918,0.38179999589920044,0.9977999925613403,-0.06620000302791595,0,0.7547722509117953,0.41841261984957023,0.5052224547703327,0.6467999815940857,0.4041000008583069,0.6467999815940857,0.7692780597174184,0.3783166747117983,0.5148667404993367,0.6657000184059143,0.33739998936653137,0.6657000184059143,0.7957963785535204,0.28785546405722773,0.5327732685613087,0.6919000148773193,0.2061000019311905,0.6919000148773193,0.8249659082595298,0.1199935753008835,0.5522977386302068,0.7055000066757202,-0.06650000065565109,0.7055000066757202,0.5052224547703327,0.41841261984957023,0.7547722509117953,0.3497999906539917,0.4034999907016754,0.8453999757766724,0.5148667404993367,0.3783166747117983,0.7692780597174184,0.36000001430511475,0.336899995803833,0.8700000047683716,0.5327732685613087,0.28785546405722773,0.7957963785535204,0.3743000030517578,0.20579999685287476,0.90420001745224,0.5522977386302068,0.1199935753008835,0.8249659082595298,0.38179999589920044,-0.06639999896287918,0.9218999743461609,0.175971193734185,0.4170154906217081,0.89170186696973,0,0.4027000069618225,0.9153000116348267,0.17942980142250198,0.37723739278916374,0.9085685972138349,0,0.3361999988555908,0.9417999982833862,0.18560344960982264,0.28672575430335634,0.9398615330526648,0,0.2053000032901764,0.9786999821662903,0.19227603286929457,0.11941584930670929,0.974048141581515,0,-0.06620000302791595,0.9977999925613403,-0.175971193734185,0.4170154906217081,0.89170186696973,-0.3497999906539917,0.4034999907016754,0.8453999757766724,-0.17942980142250198,0.37723739278916374,0.9085685972138349,-0.36000001430511475,0.336899995803833,0.8700000047683716,-0.18560344960982264,0.28672575430335634,0.9398615330526648,-0.3743000030517578,0.20579999685287476,0.90420001745224,-0.19227603286929457,0.11941584930670929,0.974048141581515,-0.38179999589920044,-0.06639999896287918,0.9218999743461609,-0.5052224547703327,0.41841261984957023,0.7547722509117953,-0.6467999815940857,0.4041000008583069,0.6467999815940857,-0.5148667404993367,0.3783166747117983,0.7692780597174184,-0.6657000184059143,0.33739998936653137,0.6657000184059143,-0.5327732685613087,0.28785546405722773,0.7957963785535204,-0.6919000148773193,0.2061000019311905,0.6919000148773193,-0.5522977386302068,0.1199935753008835,0.8249659082595298,-0.7055000066757202,-0.06650000065565109,0.7055000066757202,-0.7547722509117953,0.41841261984957023,0.5052224547703327,-0.8453999757766724,0.4034999907016754,0.3497999906539917,-0.7692780597174184,0.3783166747117983,0.5148667404993367,-0.8700000047683716,0.336899995803833,0.36000001430511475,-0.7957963785535204,0.28785546405722773,0.5327732685613087,-0.90420001745224,0.20579999685287476,0.3743000030517578,-0.8249659082595298,0.1199935753008835,0.5522977386302068,-0.9218999743461609,-0.06639999896287918,0.38179999589920044,-0.89170186696973,0.4170154906217081,0.175971193734185,-0.9153000116348267,0.4027000069618225,0,-0.9085685972138349,0.37723739278916374,0.17942980142250198,-0.9417999982833862,0.3361999988555908,0,-0.9398615330526648,0.28672575430335634,0.18560344960982264,-0.9786999821662903,0.2053000032901764,0,-0.974048141581515,0.11941584930670929,0.19227603286929457,-0.9977999925613403,-0.06620000302791595,0,-0.89170186696973,0.4170154906217081,-0.175971193734185,-0.8453999757766724,0.4034999907016754,-0.3497999906539917,-0.9085685972138349,0.37723739278916374,-0.17942980142250198,-0.8700000047683716,0.336899995803833,-0.36000001430511475,-0.9398615330526648,0.28672575430335634,-0.18560344960982264,-0.90420001745224,0.20579999685287476,-0.3743000030517578,-0.974048141581515,0.11941584930670929,-0.19227603286929457,-0.9218999743461609,-0.06639999896287918,-0.38179999589920044,-0.7547722509117953,0.41841261984957023,-0.5052224547703327,-0.6467999815940857,0.4041000008583069,-0.6467999815940857,-0.7692780597174184,0.3783166747117983,-0.5148667404993367,-0.6657000184059143,0.33739998936653137,-0.6657000184059143,-0.7957963785535204,0.28785546405722773,-0.5327732685613087,-0.6919000148773193,0.2061000019311905,-0.6919000148773193,-0.8249659082595298,0.1199935753008835,-0.5522977386302068,-0.7055000066757202,-0.06650000065565109,-0.7055000066757202,-0.5052224547703327,0.41841261984957023,-0.7547722509117953,-0.3497999906539917,0.4034999907016754,-0.8453999757766724,-0.5148667404993367,0.3783166747117983,-0.7692780597174184,-0.36000001430511475,0.336899995803833,-0.8700000047683716,-0.5327732685613087,0.28785546405722773,-0.7957963785535204,-0.3743000030517578,0.20579999685287476,-0.90420001745224,-0.5522977386302068,0.1199935753008835,-0.8249659082595298,-0.38179999589920044,-0.06639999896287918,-0.9218999743461609,-0.175971193734185,0.4170154906217081,-0.89170186696973,0,0.4027000069618225,-0.9153000116348267,-0.17942980142250198,0.37723739278916374,-0.9085685972138349,0,0.3361999988555908,-0.9417999982833862,-0.18560344960982264,0.28672575430335634,-0.9398615330526648,0,0.2053000032901764,-0.9786999821662903,-0.19227603286929457,0.11941584930670929,-0.974048141581515,0,-0.06620000302791595,-0.9977999925613403,0.175971193734185,0.4170154906217081,-0.89170186696973,0.3497999906539917,0.4034999907016754,-0.8453999757766724,0.17942980142250198,0.37723739278916374,-0.9085685972138349,0.36000001430511475,0.336899995803833,-0.8700000047683716,0.18560344960982264,0.28672575430335634,-0.9398615330526648,0.3743000030517578,0.20579999685287476,-0.90420001745224,0.19227603286929457,0.11941584930670929,-0.974048141581515,0.38179999589920044,-0.06639999896287918,-0.9218999743461609,0.5052224547703327,0.41841261984957023,-0.7547722509117953,0.6467999815940857,0.4041000008583069,-0.6467999815940857,0.5148667404993367,0.3783166747117983,-0.7692780597174184,0.6657000184059143,0.33739998936653137,-0.6657000184059143,0.5327732685613087,0.28785546405722773,-0.7957963785535204,0.6919000148773193,0.2061000019311905,-0.6919000148773193,0.5522977386302068,0.1199935753008835,-0.8249659082595298,0.7055000066757202,-0.06650000065565109,-0.7055000066757202,0.7547722509117953,0.41841261984957023,-0.5052224547703327,0.8453999757766724,0.4034999907016754,-0.3497999906539917,0.7692780597174184,0.3783166747117983,-0.5148667404993367,0.8700000047683716,0.336899995803833,-0.36000001430511475,0.7957963785535204,0.28785546405722773,-0.5327732685613087,0.90420001745224,0.20579999685287476,-0.3743000030517578,0.8249659082595298,0.1199935753008835,-0.5522977386302068,0.9218999743461609,-0.06639999896287918,-0.38179999589920044,0.89170186696973,0.4170154906217081,-0.175971193734185,0.9085685972138349,0.37723739278916374,-0.17942980142250198,0.9398615330526648,0.28672575430335634,-0.18560344960982264,0.974048141581515,0.11941584930670929,-0.19227603286929457,0.949837996375371,-0.25034021126228206,0.18745015141838892,0.8313999772071838,-0.43619999289512634,0.3441999852657318,0.9002000093460083,-0.43549999594688416,0,0.7776228852967049,-0.6097170963557023,0.15345263332507184,0.6735000014305115,-0.6847000122070312,0.2786000072956085,0.7296000123023987,-0.683899998664856,0,0.649169927361788,-0.7497580231546305,0.12822368004526918,0.6403999924659729,-0.7208999991416931,0.26489999890327454,0.6940000057220459,-0.7200000286102295,0,0.7309008795580111,-0.6670453977388504,0.14434106005134031,0.7329000234603882,-0.609000027179718,0.30320000648498535,0.7939000129699707,-0.6079999804496765,0,0.8044401026352556,-0.2509927077580416,0.5384039207922486,0.6360999941825867,-0.4368000030517578,0.6360999941825867,0.6577259751592633,-0.611316221873683,0.4401011457322989,0.5149999856948853,-0.6852999925613403,0.5149999856948853,0.5484574657551682,-0.7513248159850185,0.3670223823454051,0.48969998955726624,-0.7214000225067139,0.48969998955726624,0.6183258124965243,-0.6680727822223783,0.41394679278158897,0.5605999827384949,-0.6096000075340271,0.5605999827384949,0.5384039207922486,-0.2509927077580416,0.8044401026352556,0.3441999852657318,-0.43619999289512634,0.8313999772071838,0.44010114573229886,-0.6113162218736828,0.6577259751592632,0.2786000072956085,-0.6847000122070312,0.6735000014305115,0.3670223823454051,-0.7513248159850185,0.5484574657551682,0.26489999890327454,-0.7208999991416931,0.6403999924659729,0.41394679278158897,-0.6680727822223783,0.6183258124965243,0.30320000648498535,-0.609000027179718,0.7329000234603882,0.18745015141838892,-0.25034021126228206,0.949837996375371,0,-0.43549999594688416,0.9002000093460083,0.15345263332507184,-0.6097170963557023,0.7776228852967049,0,-0.683899998664856,0.7296000123023987,0.12822368004526918,-0.7497580231546305,0.649169927361788,0,-0.7200000286102295,0.6940000057220459,0.14434106005134031,-0.6670453977388504,0.7309008795580111,0,-0.6079999804496765,0.7939000129699707,-0.18745015141838892,-0.25034021126228206,0.949837996375371,-0.3441999852657318,-0.43619999289512634,0.8313999772071838,-0.15345263332507184,-0.6097170963557023,0.7776228852967049,-0.2786000072956085,-0.6847000122070312,0.6735000014305115,-0.12822368004526918,-0.7497580231546305,0.649169927361788,-0.26489999890327454,-0.7208999991416931,0.6403999924659729,-0.14434106005134031,-0.6670453977388504,0.7309008795580111,-0.30320000648498535,-0.609000027179718,0.7329000234603882,-0.5384039207922486,-0.2509927077580416,0.8044401026352556,-0.6360999941825867,-0.4368000030517578,0.6360999941825867,-0.44010114573229886,-0.6113162218736828,0.6577259751592632,-0.5149999856948853,-0.6852999925613403,0.5149999856948853,-0.3670223823454051,-0.7513248159850185,0.5484574657551682,-0.48969998955726624,-0.7214000225067139,0.48969998955726624,-0.41394679278158897,-0.6680727822223783,0.6183258124965243,-0.5605999827384949,-0.6096000075340271,0.5605999827384949,-0.8044401026352556,-0.2509927077580416,0.5384039207922486,-0.8313999772071838,-0.43619999289512634,0.3441999852657318,-0.6577259751592633,-0.611316221873683,0.4401011457322989,-0.6735000014305115,-0.6847000122070312,0.2786000072956085,-0.5484574657551682,-0.7513248159850185,0.3670223823454051,-0.6403999924659729,-0.7208999991416931,0.26489999890327454,-0.6183258124965243,-0.6680727822223783,0.41394679278158897,-0.7329000234603882,-0.609000027179718,0.30320000648498535,-0.949837996375371,-0.25034021126228206,0.18745015141838892,-0.9002000093460083,-0.43549999594688416,0,-0.7776228852967049,-0.6097170963557023,0.15345263332507184,-0.7296000123023987,-0.683899998664856,0,-0.649169927361788,-0.7497580231546305,0.12822368004526918,-0.6940000057220459,-0.7200000286102295,0,-0.7309008795580111,-0.6670453977388504,0.14434106005134031,-0.7939000129699707,-0.6079999804496765,0,-0.949837996375371,-0.25034021126228206,-0.18745015141838892,-0.8313999772071838,-0.43619999289512634,-0.3441999852657318,-0.7776228852967049,-0.6097170963557023,-0.15345263332507184,-0.6735000014305115,-0.6847000122070312,-0.2786000072956085,-0.649169927361788,-0.7497580231546305,-0.12822368004526918,-0.6403999924659729,-0.7208999991416931,-0.26489999890327454,-0.7309008795580111,-0.6670453977388504,-0.14434106005134031,-0.7329000234603882,-0.609000027179718,-0.30320000648498535,-0.8044401026352556,-0.2509927077580416,-0.5384039207922486,-0.6360999941825867,-0.4368000030517578,-0.6360999941825867,-0.6577259751592633,-0.611316221873683,-0.4401011457322989,-0.5149999856948853,-0.6852999925613403,-0.5149999856948853,-0.5484574657551682,-0.7513248159850185,-0.3670223823454051,-0.48969998955726624,-0.7214000225067139,-0.48969998955726624,-0.6183258124965243,-0.6680727822223783,-0.41394679278158897,-0.5605999827384949,-0.6096000075340271,-0.5605999827384949,-0.5384039207922486,-0.2509927077580416,-0.8044401026352556,-0.3441999852657318,-0.43619999289512634,-0.8313999772071838,-0.44010114573229886,-0.6113162218736828,-0.6577259751592632,-0.2786000072956085,-0.6847000122070312,-0.6735000014305115,-0.3670223823454051,-0.7513248159850185,-0.5484574657551682,-0.26489999890327454,-0.7208999991416931,-0.6403999924659729,-0.41394679278158897,-0.6680727822223783,-0.6183258124965243,-0.30320000648498535,-0.609000027179718,-0.7329000234603882,-0.18745015141838892,-0.25034021126228206,-0.949837996375371,0,-0.43549999594688416,-0.9002000093460083,-0.15345263332507184,-0.6097170963557023,-0.7776228852967049,0,-0.683899998664856,-0.7296000123023987,-0.12822368004526918,-0.7497580231546305,-0.649169927361788,0,-0.7200000286102295,-0.6940000057220459,-0.14434106005134031,-0.6670453977388504,-0.7309008795580111,0,-0.6079999804496765,-0.7939000129699707,0.18745015141838892,-0.25034021126228206,-0.949837996375371,0.3441999852657318,-0.43619999289512634,-0.8313999772071838,0.15345263332507184,-0.6097170963557023,-0.7776228852967049,0.2786000072956085,-0.6847000122070312,-0.6735000014305115,0.12822368004526918,-0.7497580231546305,-0.649169927361788,0.26489999890327454,-0.7208999991416931,-0.6403999924659729,0.14434106005134031,-0.6670453977388504,-0.7309008795580111,0.30320000648498535,-0.609000027179718,-0.7329000234603882,0.5384039207922486,-0.2509927077580416,-0.8044401026352556,0.6360999941825867,-0.4368000030517578,-0.6360999941825867,0.44010114573229886,-0.6113162218736828,-0.6577259751592632,0.5149999856948853,-0.6852999925613403,-0.5149999856948853,0.3670223823454051,-0.7513248159850185,-0.5484574657551682,0.48969998955726624,-0.7214000225067139,-0.48969998955726624,0.41394679278158897,-0.6680727822223783,-0.6183258124965243,0.5605999827384949,-0.6096000075340271,-0.5605999827384949,0.8044401026352556,-0.2509927077580416,-0.5384039207922486,0.8313999772071838,-0.43619999289512634,-0.3441999852657318,0.6577259751592633,-0.611316221873683,-0.4401011457322989,0.6735000014305115,-0.6847000122070312,-0.2786000072956085,0.5484574657551682,-0.7513248159850185,-0.3670223823454051,0.6403999924659729,-0.7208999991416931,-0.26489999890327454,0.6183258124965243,-0.6680727822223783,-0.41394679278158897,0.7329000234603882,-0.609000027179718,-0.30320000648498535,0.949837996375371,-0.25034021126228206,-0.18745015141838892,0.7776228852967049,-0.6097170963557023,-0.15345263332507184,0.649169927361788,-0.7497580231546305,-0.12822368004526918,0.7309008795580111,-0.6670453977388504,-0.14434106005134031,0.8387035316725441,-0.518815353093059,0.16555064287077373,0.576200008392334,-0.7817999720573425,0.23819999396800995,0.6238999962806702,-0.781499981880188,0,0.25616783727492487,-0.9653076593733025,0.050588159692990436,0.16359999775886536,-0.9842000007629395,0.06750000268220901,0.17730000615119934,-0.9842000007629395,0,0.07553202574448914,-0.9970317293860195,0.014921249426803469,0.04540000110864639,-0.9987999796867371,0.018699999898672104,0.04919999837875366,-0.9987999796867371,0,0.015316466366009897,-0.9998781173537434,0.003025937076820533,0,-1,0,0.7093394127545394,-0.5208703290912265,0.47490177698703395,0.44040000438690186,-0.7822999954223633,0.44040000438690186,0.21633036433079836,-0.9655254553343809,0.14478179640355507,0.12489999830722809,-0.9843000173568726,0.12489999830722809,0.06371717584979004,-0.9970565493361698,0.04264222001229404,0.034699998795986176,-0.9987999796867371,0.034699998795986176,0.01292177647076656,-0.9998790650449104,0.008653495117885388,0.47490177698703395,-0.5208703290912265,0.7093394127545394,0.23819999396800995,-0.7817999720573425,0.576200008392334,0.14478179640355507,-0.9655254553343809,0.21633036433079836,0.06750000268220901,-0.9842000007629395,0.16359999775886536,0.04264222001229404,-0.9970565493361698,0.06371717584979004,0.018699999898672104,-0.9987999796867371,0.04540000110864639,0.008653495117885388,-0.9998790650449104,0.01292177647076656,0.16555064287077373,-0.5188153530930589,0.838703531672544,0,-0.781499981880188,0.6238999962806702,0.050588159692990436,-0.9653076593733025,0.25616783727492487,0,-0.9842000007629395,0.17730000615119934,0.014921249426803469,-0.9970317293860195,0.07553202574448914,0,-0.9987999796867371,0.04919999837875366,0.003025937076820533,-0.9998781173537434,0.015316466366009897,-0.16555064287077373,-0.5188153530930589,0.838703531672544,-0.23819999396800995,-0.7817999720573425,0.576200008392334,-0.050588159692990436,-0.9653076593733025,0.25616783727492487,-0.06750000268220901,-0.9842000007629395,0.16359999775886536,-0.014921249426803469,-0.9970317293860195,0.07553202574448914,-0.018699999898672104,-0.9987999796867371,0.04540000110864639,-0.003025937076820533,-0.9998781173537434,0.015316466366009897,-0.47490177698703395,-0.5208703290912265,0.7093394127545394,-0.44040000438690186,-0.7822999954223633,0.44040000438690186,-0.14478179640355507,-0.9655254553343809,0.21633036433079836,-0.12489999830722809,-0.9843000173568726,0.12489999830722809,-0.04264222001229404,-0.9970565493361698,0.06371717584979004,-0.034699998795986176,-0.9987999796867371,0.034699998795986176,-0.008653495117885388,-0.9998790650449104,0.01292177647076656,-0.7093394127545394,-0.5208703290912265,0.47490177698703395,-0.576200008392334,-0.7817999720573425,0.23819999396800995,-0.21633036433079836,-0.9655254553343809,0.14478179640355507,-0.16359999775886536,-0.9842000007629395,0.06750000268220901,-0.06371717584979004,-0.9970565493361698,0.04264222001229404,-0.04540000110864639,-0.9987999796867371,0.018699999898672104,-0.01292177647076656,-0.9998790650449104,0.008653495117885388,-0.8387035316725441,-0.518815353093059,0.16555064287077373,-0.6238999962806702,-0.781499981880188,0,-0.25616783727492487,-0.9653076593733025,0.050588159692990436,-0.17730000615119934,-0.9842000007629395,0,-0.07553202574448914,-0.9970317293860195,0.014921249426803469,-0.04919999837875366,-0.9987999796867371,0,-0.015316466366009897,-0.9998781173537434,0.003025937076820533,-0.8387035316725441,-0.518815353093059,-0.16555064287077373,-0.576200008392334,-0.7817999720573425,-0.23819999396800995,-0.25616783727492487,-0.9653076593733025,-0.050588159692990436,-0.16359999775886536,-0.9842000007629395,-0.06750000268220901,-0.07553202574448914,-0.9970317293860195,-0.014921249426803469,-0.04540000110864639,-0.9987999796867371,-0.018699999898672104,-0.015316466366009897,-0.9998781173537434,-0.003025937076820533,-0.7093394127545394,-0.5208703290912265,-0.47490177698703395,-0.44040000438690186,-0.7822999954223633,-0.44040000438690186,-0.21633036433079836,-0.9655254553343809,-0.14478179640355507,-0.12489999830722809,-0.9843000173568726,-0.12489999830722809,-0.06371717584979004,-0.9970565493361698,-0.04264222001229404,-0.034699998795986176,-0.9987999796867371,-0.034699998795986176,-0.01292177647076656,-0.9998790650449104,-0.008653495117885388,-0.47490177698703395,-0.5208703290912265,-0.7093394127545394,-0.23819999396800995,-0.7817999720573425,-0.576200008392334,-0.14478179640355507,-0.9655254553343809,-0.21633036433079836,-0.06750000268220901,-0.9842000007629395,-0.16359999775886536,-0.04264222001229404,-0.9970565493361698,-0.06371717584979004,-0.018699999898672104,-0.9987999796867371,-0.04540000110864639,-0.008653495117885388,-0.9998790650449104,-0.01292177647076656,-0.16555064287077373,-0.5188153530930589,-0.838703531672544,0,-0.781499981880188,-0.6238999962806702,-0.050588159692990436,-0.9653076593733025,-0.25616783727492487,0,-0.9842000007629395,-0.17730000615119934,-0.014921249426803469,-0.9970317293860195,-0.07553202574448914,0,-0.9987999796867371,-0.04919999837875366,-0.003025937076820533,-0.9998781173537434,-0.015316466366009897,0.16555064287077373,-0.5188153530930589,-0.838703531672544,0.23819999396800995,-0.7817999720573425,-0.576200008392334,0.050588159692990436,-0.9653076593733025,-0.25616783727492487,0.06750000268220901,-0.9842000007629395,-0.16359999775886536,0.014921249426803469,-0.9970317293860195,-0.07553202574448914,0.018699999898672104,-0.9987999796867371,-0.04540000110864639,0.003025937076820533,-0.9998781173537434,-0.015316466366009897,0.47490177698703395,-0.5208703290912265,-0.7093394127545394,0.44040000438690186,-0.7822999954223633,-0.44040000438690186,0.14478179640355507,-0.9655254553343809,-0.21633036433079836,0.12489999830722809,-0.9843000173568726,-0.12489999830722809,0.04264222001229404,-0.9970565493361698,-0.06371717584979004,0.034699998795986176,-0.9987999796867371,-0.034699998795986176,0.008653495117885388,-0.9998790650449104,-0.01292177647076656,0.7093394127545394,-0.5208703290912265,-0.47490177698703395,0.576200008392334,-0.7817999720573425,-0.23819999396800995,0.21633036433079836,-0.9655254553343809,-0.14478179640355507,0.16359999775886536,-0.9842000007629395,-0.06750000268220901,0.06371717584979004,-0.9970565493361698,-0.04264222001229404,0.04540000110864639,-0.9987999796867371,-0.018699999898672104,0.01292177647076656,-0.9998790650449104,-0.008653495117885388,0.8387035316725441,-0.518815353093059,-0.16555064287077373,0.25616783727492487,-0.9653076593733025,-0.050588159692990436,0.07553202574448914,-0.9970317293860195,-0.014921249426803469,0.015316466366009897,-0.9998781173537434,-0.003025937076820533,0.007923619032407068,-0.9792649536215844,0.20242867106698378,0.007799999788403511,-1,-0.00019999999494757503,0.007000000216066837,-0.8125,0.5828999876976013,0.03610000014305115,-0.8373000025749207,0.5455999970436096,0.03909999877214432,-0.9991999864578247,-0.0010000000474974513,0.07294431178951416,-0.9771793893951642,0.19949829151861947,0.16179999709129333,-0.8104000091552734,0.5630000233650208,0.17949999868869781,-0.9836999773979187,-0.004399999976158142,0.30508737694808447,-0.9288212891929031,0.2102681744082329,0.48240000009536743,-0.5950999855995178,0.6427000164985657,0.6122999787330627,-0.7906000018119812,-0.010499999858438969,0.85242181732101,-0.45600261568139905,0.2558098118659036,0.7386999726295471,-0.11460000276565552,0.6642000079154968,0.9861999750137329,-0.1657000035047531,-0.0066999997943639755,0.005356055160839852,-0.5906212413030134,0.8069311383227207,-0.0019000000320374966,0.16210000216960907,0.9868000149726868,0.00279999990016222,0.017100000753998756,0.9998000264167786,0.050017369857379264,-0.5919248852555064,0.8044396763759266,0.010499999858438969,0.07339999824762344,0.9972000122070312,0.19813039646486702,-0.5271562130528779,0.8263477918143327,-0.06599999964237213,0.13009999692440033,0.989300012588501,0.4449202026559152,-0.20623851513417835,0.8714996776498938,-0.09440000355243683,0.016599999740719795,0.9954000115394592,-0.005868425724113912,0.5911289942558654,0.8065556854486675,-0.009200000204145908,0.8715000152587891,0.4902999997138977,-0.04859999939799309,0.8406000137329102,0.5394999980926514,-0.0565568733345604,0.5892386602454603,0.8059771221013369,-0.2232999950647354,0.8029000163078308,0.5526999831199646,-0.21826903582935248,0.5064932454046728,0.8341601886673605,-0.5964000225067139,0.5600000023841858,0.5751000046730042,-0.4519125123063575,0.18097256755074448,0.8735124561304479,-0.8033000230789185,0.0681999996304512,0.5916000008583069,-0.010227406140092809,0.9792477063934721,0.20240881820407414,-0.010599999688565731,0.9998999834060669,0.00009999999747378752,-0.058800000697374344,0.9983000159263611,0.000699999975040555,-0.1003582147149349,0.9740903926657386,0.2026724837158167,-0.2806999981403351,0.9598000049591064,0.0032999999821186066,-0.4107606469303811,0.8829429191860411,0.22734883415704424,-0.7497000098228455,0.6617000102996826,0.00430000014603138,-0.905303034236947,0.33387590683454604,0.26258959430409023,-0.9973999857902527,0.07270000129938126,0.002099999925121665,-0.010227406140092809,0.9792477063934721,-0.20240881820407414,-0.008799999952316284,0.8715000152587891,-0.4902999997138977,-0.04650000110268593,0.8411999940872192,-0.5388000011444092,-0.1003582147149349,0.9740903926657386,-0.2026724837158167,-0.21789999306201935,0.8068000078201294,-0.5491999983787537,-0.4107606469303811,0.8829429191860411,-0.22734883415704424,-0.5972999930381775,0.5600000023841858,-0.5741000175476074,-0.905303034236947,0.33387590683454604,-0.26258959430409023,-0.8040000200271606,0.06289999932050705,-0.5913000106811523,-0.005868425724113912,0.5911289942558654,-0.8065556854486675,-0.0017999999690800905,0.16169999539852142,-0.9868000149726868,0.0020000000949949026,0.014600000344216824,-0.9998999834060669,-0.0565568733345604,0.5892386602454603,-0.8059771221013369,0.009200000204145908,0.060100000351667404,-0.998199999332428,-0.21826903582935248,0.5064932454046728,-0.8341601886673605,-0.059300001710653305,0.11389999836683273,-0.9916999936103821,-0.4519125123063575,0.18097256755074448,-0.8735124561304479,-0.0869000032544136,0.012299999594688416,-0.9961000084877014,0.005356055160839852,-0.5906212413030134,-0.8069311383227207,0.006399999838322401,-0.8123999834060669,-0.5831000208854675,0.033799998462200165,-0.8374999761581421,-0.5454000234603882,0.050017369857379264,-0.5919248852555064,-0.8044396763759266,0.15710000693798065,-0.8119000196456909,-0.5622000098228455,0.19813039646486702,-0.5271562130528779,-0.8263477918143327,0.4844000041484833,-0.5893999934196472,-0.6464999914169312,0.4449202026559152,-0.20623851513417835,-0.8714996776498938,0.7389000058174133,-0.10130000114440918,-0.6661999821662903,0.007923619032407068,-0.9792649536215844,-0.20242867106698378,0.07294431178951416,-0.9771793893951642,-0.19949829151861947,0.30508737694808447,-0.9288212891929031,-0.2102681744082329,0.85242181732101,-0.45600261568139905,-0.2558098118659036,0.9478292644663923,0.18220680595344424,0.2615728680221666,0.725600004196167,0.25940001010894775,0.6373999714851379,0.9465000033378601,0.32269999384880066,-0.0034000000450760126,0.8600566042901111,0.44406573291460566,0.25121357898803404,0.6459000110626221,0.4620000123977661,0.607699990272522,0.8258000016212463,0.5638999938964844,-0.007499999832361937,0.722097468072962,0.6564257510605728,0.21835860401454446,0.5315999984741211,0.6366999745368958,0.5586000084877014,0.6499999761581421,0.7598999738693237,-0.006899999920278788,0.5200506551893511,0.8306365796457171,0.1989728338029867,0.42500001192092896,0.6816999912261963,0.5954999923706055,0.5324000120162964,0.8464999794960022,-0.005200000014156103,0.4781972352408055,0.09361119253153362,0.8732493050904043,-0.04960000142455101,-0.01979999989271164,0.9986000061035156,0.4393956565632051,0.2449654752923344,0.8642472868966327,-0.03779999911785126,-0.035599999129772186,0.9986000061035156,0.39562746673558924,0.3918378901601171,0.830627458852191,-0.03790000081062317,-0.0364999994635582,0.9986000061035156,0.3039318735441624,0.5084492756925236,0.8056703732244866,-0.1688999980688095,-0.29789999127388,0.9394999742507935,-0.47742285385863215,-0.09515362565485244,0.8735062713788696,-0.7422999739646912,-0.29919999837875366,0.5995000004768372,-0.42856464276720363,-0.26014738661504994,0.8652489145946263,-0.6195999979972839,-0.5293999910354614,0.5795000195503235,-0.3729119034765285,-0.40703367257705336,0.8338227039568712,-0.4837000072002411,-0.6858000159263611,0.5437999963760376,-0.2896259899317443,-0.5099064991908379,0.8100074987547963,-0.44530001282691956,-0.7943999767303467,0.4131999909877777,-0.9462576942087682,-0.19013883790828634,0.26161727479199826,-0.9265000224113464,-0.37630000710487366,0.0020000000949949026,-0.8154980530103969,-0.5208357818286896,0.25237474894123124,-0.7538999915122986,-0.6570000052452087,0.00430000014603138,-0.6370197706643513,-0.7377648710591707,0.22340279052371467,-0.5662000179290771,-0.8241999745368958,0.0035000001080334187,-0.4721523712289914,-0.8571632880733152,0.2057747212905012,-0.48179998993873596,-0.8762999773025513,0.0019000000320374966,-0.9462576942087682,-0.19013883790828634,-0.26161727479199826,-0.744700014591217,-0.29440000653266907,-0.5989999771118164,-0.8154980530103969,-0.5208357818286896,-0.25237474894123124,-0.6219000220298767,-0.5281000137329102,-0.5781999826431274,-0.6370197706643513,-0.7377648710591707,-0.22340279052371467,-0.4812000095844269,-0.6883000135421753,-0.5428000092506409,-0.4721523712289914,-0.8571632880733152,-0.2057747212905012,-0.43810001015663147,-0.796999990940094,-0.4156999886035919,-0.47742285385863215,-0.09515362565485244,-0.8735062713788696,-0.04430000111460686,-0.017100000753998756,-0.9988999962806702,-0.42856464276720363,-0.26014738661504994,-0.8652489145946263,-0.026200000196695328,-0.028200000524520874,-0.9993000030517578,-0.3729119034765285,-0.40703367257705336,-0.8338227039568712,-0.025299999862909317,-0.028300000354647636,-0.9993000030517578,-0.2896259899317443,-0.5099064991908379,-0.8100074987547963,-0.1574999988079071,-0.28940001130104065,-0.9441999793052673,0.4781972352408055,0.09361119253153362,-0.8732493050904043,0.7282000184059143,0.2524000108242035,-0.6370999813079834,0.4393956565632051,0.2449654752923344,-0.8642472868966327,0.6470999717712402,0.45969998836517334,-0.608299970626831,0.39562746673558924,0.3918378901601171,-0.830627458852191,0.5230000019073486,0.6406999826431274,-0.5622000098228455,0.3039318735441624,0.5084492756925236,-0.8056703732244866,0.4099999964237213,0.6829000115394592,-0.6047000288963318,0.9478292644663923,0.18220680595344424,-0.2615728680221666,0.8600566042901111,0.44406573291460566,-0.25121357898803404,0.722097468072962,0.6564257510605728,-0.21835860401454446,0.5200506551893511,0.8306365796457171,-0.1989728338029867,-0.22469814643301808,0.9251791464063235,0.30586645786099653,-0.23080000281333923,0.9729999899864197,-0.006500000134110451,-0.15289999544620514,0.6872000098228455,0.7102000117301941,-0.3167000114917755,0.6377999782562256,0.7020999789237976,-0.5489000082015991,0.8359000086784363,-0.001500000013038516,-0.7554159687089509,0.6012029555014725,0.260579585761839,-0.6011000275611877,0.4715000092983246,0.6452999711036682,-0.8756999969482422,0.4828000068664551,0.00989999994635582,-0.8962608931532676,0.34737987822914146,0.2757600979213887,-0.6359000205993652,0.44609999656677246,0.629800021648407,-0.8776000142097473,0.47909998893737793,0.019099999219179153,-0.7277298905609964,0.5697090903460769,0.38189102995635527,-0.435699999332428,0.6010000109672546,0.6700000166893005,-0.6962000131607056,0.7174000144004822,0.02449999935925007,-0.06782871702682407,0.42060539852275436,0.9047045727086881,0.11110000312328339,-0.08510000258684158,0.9901999831199646,0.2232999950647354,0.006500000134110451,0.9746999740600586,-0.2397267208313023,0.393118607711727,0.8876873659066373,0.19009999930858612,0.1550000011920929,0.9695000052452087,-0.3269428225776823,0.3199115704344181,0.8892496712774892,0.0052999998442828655,0.18950000405311584,0.9818999767303467,-0.24664197962623152,0.33059209207256196,0.9109756322455285,-0.011800000444054604,0.2467000037431717,0.968999981880188,0.21474893554810956,-0.3917948594999005,0.8946394149322995,0.34389999508857727,-0.7228000164031982,0.599399983882904,0.5724999904632568,-0.5677000284194946,0.5916000008583069,0.5724729014296546,-0.15995477083527343,0.8041699126526359,0.7874000072479248,-0.2565000057220459,0.5605000257492065,0.5277329114283671,-0.01038778030367959,0.8493468480048075,0.6470999717712402,-0.30640000104904175,0.6980999708175659,0.2802675583364272,-0.16422675916009252,0.9457693520726449,0.42750000953674316,-0.4993000030517578,0.753600001335144,0.39159473040680615,-0.8708293307411027,0.2971697222777314,0.4108999967575073,-0.9117000102996826,0.0013000000035390258,0.671500027179718,-0.7409999966621399,-0.0008999999845400453,0.8641399116222908,-0.44467986513529173,0.23563113267282512,0.921999990940094,-0.3871000111103058,-0.007300000172108412,0.9202642753550175,-0.2825130464997946,0.2707398050946873,0.8468999862670898,-0.5315999984741211,-0.013899999670684338,0.6553517759350307,-0.6669930474005048,0.35444932571270243,0.5358999967575073,-0.8442000150680542,-0.010499999858438969,0.39159473040680615,-0.8708293307411027,-0.2971697222777314,0.34119999408721924,-0.7228000164031982,-0.6008999943733215,0.5787000060081482,-0.5611000061035156,-0.5917999744415283,0.8641399116222908,-0.44467986513529173,-0.23563113267282512,0.7849000096321106,-0.25099998712539673,-0.5665000081062317,0.9202642753550175,-0.2825130464997946,-0.2707398050946873,0.6427000164985657,-0.30230000615119934,-0.7039999961853027,0.6553517759350307,-0.6669930474005048,-0.35444932571270243,0.4185999929904938,-0.5,-0.7580999732017517,0.21484877208785355,-0.39190315580348,-0.894568008372541,0.11580000072717667,-0.07909999787807465,-0.9901000261306763,0.23280000686645508,0.012600000016391277,-0.9724000096321106,0.5724729014296546,-0.15995477083527343,-0.8041699126526359,0.20669999718666077,0.15360000729560852,-0.9663000106811523,0.5277329114283671,-0.01038778030367959,-0.8493468480048075,0.02449999935925007,0.16140000522136688,-0.9865999817848206,0.2802675583364272,-0.16422675916009252,-0.9457693520726449,0.0034000000450760126,0.2110999971628189,-0.9775000214576721,-0.06785298017190203,0.4204621294822817,-0.9047693467138552,-0.13490000367164612,0.6875,-0.7135999798774719,-0.31949999928474426,0.6330999732017517,-0.7050999999046326,-0.2397267208313023,0.393118607711727,-0.8876873659066373,-0.6039000153541565,0.46140000224113464,-0.6499000191688538,-0.3269428225776823,0.3199115704344181,-0.8892496712774892,-0.6317999958992004,0.43720000982284546,-0.6401000022888184,-0.24664197962623152,0.33059209207256196,-0.9109756322455285,-0.4242999851703644,0.6126999855041504,-0.666700005531311,-0.22469814643301808,0.9251791464063235,-0.30586645786099653,-0.7554159687089509,0.6012029555014725,-0.260579585761839,-0.8962608931532676,0.34737987822914146,-0.2757600979213887,-0.7277298905609964,0.5697090903460769,-0.38189102995635527,-0.4581346849192706,0.8290808733288989,0.32052693483404915,-0.2599000036716461,0.7918999791145325,0.5525000095367432,-0.42579999566078186,0.9047999978065491,0.01080000028014183,-0.246185208210748,0.9533009586111941,0.17495749646473896,0.009499999694526196,0.9997000098228455,-0.021700000390410423,0.02199999988079071,0.9998000264167786,0.0015999999595806003,0.5588645441304007,0.6666977641221954,-0.49313741759106583,0.41019999980926514,0.3328999876976013,-0.8490999937057495,0.9995999932289124,0.02590000070631504,0.011599999852478504,0.6055606832628622,-0.6381346851214208,-0.47547910840666874,0.5414999723434448,-0.5486000180244446,-0.6370000243186951,0.7095999717712402,-0.7045999765396118,0.009700000286102295,-0.18304741452057446,0.5222477728722519,0.8329171073806239,0.046300001442432404,0.4551999866962433,0.88919997215271,-0.11108392464029737,0.8826749299553293,0.45666763593981924,-0.010700000450015068,0.9887999892234802,0.14890000224113464,0.07555097805976921,0.8081131026014043,-0.5841620178667426,-0.04439999908208847,0.6829000115394592,-0.7290999889373779,0.1865265036320752,-0.09254615883689393,-0.9780813217352277,0.12280000001192093,0.009200000204145908,-0.9923999905586243,0.20586843545090303,-0.21233995694823685,0.9552643246600484,0.48179998993873596,-0.18039999902248383,0.8575000166893005,0.11889342221748984,0.6798112027299875,0.723685762466156,0.4553000032901764,0.7366999983787537,0.4999000132083893,-0.10639578264983571,0.9027074902947484,-0.4168922215634223,-0.22050000727176666,0.9071999788284302,-0.35830000042915344,-0.16898371149150437,0.5156251093433941,-0.8399852688381916,-0.23589999973773956,0.6572999954223633,-0.7157999873161316,0.4290978121327757,-0.8521036390277623,0.29965723081299106,0.7281000018119812,-0.6852999925613403,-0.015599999576807022,0.7436424021085918,-0.3226049926539566,0.5855954204917456,0.888700008392334,0.45809999108314514,-0.016699999570846558,-0.2121657419347905,0.9655431048711052,-0.15070570853529733,-0.26010000705718994,0.9656000137329102,0.0007999999797903001,-0.3585820114624871,0.8925522270977658,-0.2734400536833164,-0.3716000020503998,0.9283999800682068,-0.004399999976158142,0.4290978121327757,-0.8521036390277623,-0.29965723081299106,0.48019999265670776,-0.17839999496936798,-0.8589000105857849,0.7436424021085918,-0.3226049926539566,-0.5855954204917456,0.48809999227523804,0.7167999744415283,-0.49790000915527344,-0.2121657419347905,0.9655431048711052,0.15070570853529733,-0.22200000286102295,0.9053999781608582,0.3619000017642975,-0.3585820114624871,0.8925522270977658,0.2734400536833164,-0.2354000061750412,0.6632000207901001,0.7105000019073486,0.20586843545090303,-0.21233995694823685,-0.9552643246600484,0.05869999900460243,0.4377000033855438,-0.8971999883651733,0.11889342221748984,0.6798112027299875,-0.723685762466156,0.0013000000035390258,0.9865000247955322,-0.164000004529953,-0.10639578264983571,0.9027074902947484,0.4168922215634223,-0.044199999421834946,0.6816999912261963,0.7303000092506409,-0.16898371149150437,0.5156251093433941,0.8399852688381916,0.1387999951839447,-0.03420000150799751,0.9897000193595886,-0.18304741452057446,0.5222477728722519,-0.8329171073806239,-0.258899986743927,0.7972000241279602,-0.5454000234603882,-0.11108392464029737,0.8826749299553293,-0.45666763593981924,0.012299999594688416,0.9997000098228455,0.019300000742077827,0.07555097805976921,0.8081131026014043,0.5841620178667426,0.3986000120639801,0.3549000024795532,0.8457000255584717,0.1865265036320752,-0.09254615883689393,0.9780813217352277,0.5375999808311462,-0.5813999772071838,0.6107000112533569,-0.4581346849192706,0.8290808733288989,-0.32052693483404915,-0.246185208210748,0.9533009586111941,-0.17495749646473896,0.5588645441304007,0.6666977641221954,0.49313741759106583,0.6055606832628622,-0.6381346851214208,0.47547910840666874,0.14291142372842203,0.9893409658361559,0.02794241017337756,0.7626000046730042,0.5649999976158142,0.3147999942302704,0.8245000243186951,0.5658000111579895,0,0,1,0,0.973458284214919,-0.12702375109433608,0.1903784009578562,0.8479999899864197,-0.39800000190734863,0.3499999940395355,0.9176999926567078,-0.39730000495910645,0,0.746764468277477,-0.6487991657292128,0.14629583544084326,0.8640999794006348,-0.35530000925064087,0.3564000129699707,0.9352999925613403,-0.3538999855518341,0.00009999999747378752,0.981025828088616,0.023627540802087,0.19243197223614078,0.7210000157356262,0.6255999803543091,0.29789999127388,0.7807000279426575,0.6248999834060669,0.00009999999747378752,0.12055154584358733,0.9894424773820601,0.08044195886956569,0.5834000110626221,0.5651999711990356,0.583299994468689,0.8246900772851533,-0.12832997885984362,0.5508336345515219,0.6485000252723694,-0.3986999988555908,0.6484000086784363,0.6311228589976491,-0.650668419605885,0.422273068734218,0.6608999967575073,-0.35589998960494995,0.6607000231742859,0.8301974890908831,0.023243924461984086,0.5569846039908094,0.5519000291824341,0.6252999901771545,0.551800012588501,0.08044195886956569,0.9894424773820601,0.12055154584358733,0.3147999942302704,0.5651000142097473,0.7626000046730042,0.5508336345515219,-0.12832997885984362,0.8246900772851533,0.3499999940395355,-0.39800000190734863,0.8479999899864197,0.422273068734218,-0.650668419605885,0.6311228589976491,0.3564999997615814,-0.35519999265670776,0.8641999959945679,0.5569846039908094,0.023243924461984086,0.8301974890908831,0.2980000078678131,0.6255000233650208,0.7210999727249146,0.02794241017337756,0.9893409658361559,0.14291142372842203,0,0.5658000111579895,0.8245000243186951,0.1903784009578562,-0.12702375109433608,0.973458284214919,0,-0.39730000495910645,0.9176999926567078,0.14629583544084326,-0.6487991657292128,0.746764468277477,-0.00009999999747378752,-0.3538999855518341,0.9352999925613403,0.19243197223614078,0.023627540802087,0.981025828088616,-0.00009999999747378752,0.6248999834060669,0.7807000279426575,-0.02794241017337756,0.9893409658361559,0.14291142372842203,-0.3147999942302704,0.5649999976158142,0.7626000046730042,-0.1903784009578562,-0.12702375109433608,0.973458284214919,-0.3499999940395355,-0.39800000190734863,0.8479999899864197,-0.14629583544084326,-0.6487991657292128,0.746764468277477,-0.3564000129699707,-0.35530000925064087,0.8640999794006348,-0.19243197223614078,0.023627540802087,0.981025828088616,-0.29789999127388,0.6255999803543091,0.7210000157356262,-0.08044195886956569,0.9894424773820601,0.12055154584358733,-0.583299994468689,0.5651999711990356,0.5834000110626221,-0.5508336345515219,-0.12832997885984362,0.8246900772851533,-0.6484000086784363,-0.3986999988555908,0.6485000252723694,-0.422273068734218,-0.650668419605885,0.6311228589976491,-0.6607000231742859,-0.35589998960494995,0.6608999967575073,-0.5569846039908094,0.023243924461984086,0.8301974890908831,-0.551800012588501,0.6252999901771545,0.5519000291824341,-0.12055154584358733,0.9894424773820601,0.08044195886956569,-0.7626000046730042,0.5651000142097473,0.3147999942302704,-0.8246900772851533,-0.12832997885984362,0.5508336345515219,-0.8479999899864197,-0.39800000190734863,0.3499999940395355,-0.6311228589976491,-0.650668419605885,0.422273068734218,-0.8641999959945679,-0.35519999265670776,0.3564999997615814,-0.8301974890908831,0.023243924461984086,0.5569846039908094,-0.7210999727249146,0.6255000233650208,0.2980000078678131,-0.14291142372842203,0.9893409658361559,0.02794241017337756,-0.8245000243186951,0.5658000111579895,0,-0.973458284214919,-0.12702375109433608,0.1903784009578562,-0.9176999926567078,-0.39730000495910645,0,-0.746764468277477,-0.6487991657292128,0.14629583544084326,-0.9352999925613403,-0.3538999855518341,-0.00009999999747378752,-0.981025828088616,0.023627540802087,0.19243197223614078,-0.7807000279426575,0.6248999834060669,-0.00009999999747378752,-0.14291142372842203,0.9893409658361559,-0.02794241017337756,-0.7626000046730042,0.5649999976158142,-0.3147999942302704,-0.973458284214919,-0.12702375109433608,-0.1903784009578562,-0.8479999899864197,-0.39800000190734863,-0.3499999940395355,-0.746764468277477,-0.6487991657292128,-0.14629583544084326,-0.8640999794006348,-0.35530000925064087,-0.3564000129699707,-0.981025828088616,0.023627540802087,-0.19243197223614078,-0.7210000157356262,0.6255999803543091,-0.29789999127388,-0.12055154584358733,0.9894424773820601,-0.08044195886956569,-0.5834000110626221,0.5651999711990356,-0.583299994468689,-0.8246900772851533,-0.12832997885984362,-0.5508336345515219,-0.6485000252723694,-0.3986999988555908,-0.6484000086784363,-0.6311228589976491,-0.650668419605885,-0.422273068734218,-0.6608999967575073,-0.35589998960494995,-0.6607000231742859,-0.8301974890908831,0.023243924461984086,-0.5569846039908094,-0.5519000291824341,0.6252999901771545,-0.551800012588501,-0.08044195886956569,0.9894424773820601,-0.12055154584358733,-0.3147999942302704,0.5651000142097473,-0.7626000046730042,-0.5508336345515219,-0.12832997885984362,-0.8246900772851533,-0.3499999940395355,-0.39800000190734863,-0.8479999899864197,-0.422273068734218,-0.650668419605885,-0.6311228589976491,-0.3564999997615814,-0.35519999265670776,-0.8641999959945679,-0.5569846039908094,0.023243924461984086,-0.8301974890908831,-0.2980000078678131,0.6255000233650208,-0.7210999727249146,-0.02794241017337756,0.9893409658361559,-0.14291142372842203,0,0.5658000111579895,-0.8245000243186951,-0.1903784009578562,-0.12702375109433608,-0.973458284214919,0,-0.39730000495910645,-0.9176999926567078,-0.14629583544084326,-0.6487991657292128,-0.746764468277477,0.00009999999747378752,-0.3538999855518341,-0.9352999925613403,-0.19243197223614078,0.023627540802087,-0.981025828088616,0.00009999999747378752,0.6248999834060669,-0.7807000279426575,0.02794241017337756,0.9893409658361559,-0.14291142372842203,0.3147999942302704,0.5649999976158142,-0.7626000046730042,0.1903784009578562,-0.12702375109433608,-0.973458284214919,0.3499999940395355,-0.39800000190734863,-0.8479999899864197,0.14629583544084326,-0.6487991657292128,-0.746764468277477,0.3564000129699707,-0.35530000925064087,-0.8640999794006348,0.19243197223614078,0.023627540802087,-0.981025828088616,0.29789999127388,0.6255999803543091,-0.7210000157356262,0.08044195886956569,0.9894424773820601,-0.12055154584358733,0.583299994468689,0.5651999711990356,-0.5834000110626221,0.5508336345515219,-0.12832997885984362,-0.8246900772851533,0.6484000086784363,-0.3986999988555908,-0.6485000252723694,0.422273068734218,-0.650668419605885,-0.6311228589976491,0.6607000231742859,-0.35589998960494995,-0.6608999967575073,0.5569846039908094,0.023243924461984086,-0.8301974890908831,0.551800012588501,0.6252999901771545,-0.5519000291824341,0.12055154584358733,0.9894424773820601,-0.08044195886956569,0.7626000046730042,0.5651000142097473,-0.3147999942302704,0.8246900772851533,-0.12832997885984362,-0.5508336345515219,0.8479999899864197,-0.39800000190734863,-0.3499999940395355,0.6311228589976491,-0.650668419605885,-0.422273068734218,0.8641999959945679,-0.35519999265670776,-0.3564999997615814,0.8301974890908831,0.023243924461984086,-0.5569846039908094,0.7210999727249146,0.6255000233650208,-0.2980000078678131,0.14291142372842203,0.9893409658361559,-0.02794241017337756,0.973458284214919,-0.12702375109433608,-0.1903784009578562,0.746764468277477,-0.6487991657292128,-0.14629583544084326,0.981025828088616,0.023627540802087,-0.19243197223614078,0.3275777539387444,0.9426132072697088,0.06459997372414784,0.21799999475479126,0.9718000292778015,0.09019999951124191,0.23659999668598175,0.9715999960899353,0,0.16309406473662258,0.9860835381794821,0.03224254610169826,0.15960000455379486,0.9850000143051147,0.06599999964237213,0.17309999465942383,0.9848999977111816,0,0.18099512760445208,0.982833937027952,0.035752146922720544,0.3504999876022339,0.9253000020980835,0.14470000565052032,0.3797000050544739,0.9251000285148621,0,0.5235316128339348,0.8457082744477594,0.10340292497841669,0.48559999465942383,0.8507000207901001,0.20149999856948853,0.5267000198364258,0.8500999808311462,0,0.27649957959472143,0.9430486026192276,0.18495219809957497,0.16660000383853912,0.9718000292778015,0.16660000383853912,0.13770263578303485,0.9861891086646662,0.09202731143305214,0.12189999967813492,0.9850000143051147,0.12189999967813492,0.15275889985296257,0.9829686899991592,0.1021629727300915,0.2676999866962433,0.925599992275238,0.2676999866962433,0.44245158541572593,0.8465383737127242,0.29598881126645027,0.37130001187324524,0.8510000109672546,0.37130001187324524,0.18495219809957497,0.9430486026192276,0.27649957959472143,0.09019999951124191,0.9718000292778015,0.21799999475479126,0.09202731143305214,0.9861891086646662,0.13770263578303485,0.06599999964237213,0.9850000143051147,0.15960000455379486,0.1021629727300915,0.9829686899991592,0.15275889985296257,0.14470000565052032,0.9253000020980835,0.3504999876022339,0.29598881126645027,0.8465383737127242,0.44245158541572593,0.20149999856948853,0.8507000207901001,0.48559999465942383,0.06459997372414784,0.9426132072697088,0.3275777539387444,0,0.9715999960899353,0.23659999668598175,0.03224254610169826,0.9860835381794821,0.16309406473662258,0,0.9848999977111816,0.17309999465942383,0.035752146922720544,0.982833937027952,0.18099512760445208,0,0.9251000285148621,0.3797000050544739,0.1034029249784167,0.8457082744477595,0.5235316128339349,0,0.8500999808311462,0.5267000198364258,-0.06459997372414784,0.9426132072697088,0.3275777539387444,-0.09019999951124191,0.9718000292778015,0.21799999475479126,-0.03224254610169826,0.9860835381794821,0.16309406473662258,-0.06599999964237213,0.9850000143051147,0.15960000455379486,-0.035752146922720544,0.982833937027952,0.18099512760445208,-0.14470000565052032,0.9253000020980835,0.3504999876022339,-0.1034029249784167,0.8457082744477595,0.5235316128339349,-0.20149999856948853,0.8507000207901001,0.48559999465942383,-0.18495219809957497,0.9430486026192276,0.27649957959472143,-0.16660000383853912,0.9718000292778015,0.16660000383853912,-0.09202731143305214,0.9861891086646662,0.13770263578303485,-0.12189999967813492,0.9850000143051147,0.12189999967813492,-0.1021629727300915,0.9829686899991592,0.15275889985296257,-0.2676999866962433,0.925599992275238,0.2676999866962433,-0.29598881126645027,0.8465383737127242,0.44245158541572593,-0.37130001187324524,0.8510000109672546,0.37130001187324524,-0.27649957959472143,0.9430486026192276,0.18495219809957497,-0.21799999475479126,0.9718000292778015,0.09019999951124191,-0.13770263578303485,0.9861891086646662,0.09202731143305214,-0.15960000455379486,0.9850000143051147,0.06599999964237213,-0.15275889985296257,0.9829686899991592,0.1021629727300915,-0.3504999876022339,0.9253000020980835,0.14470000565052032,-0.44245158541572593,0.8465383737127242,0.29598881126645027,-0.48559999465942383,0.8507000207901001,0.20149999856948853,-0.3275777539387444,0.9426132072697088,0.06459997372414784,-0.23659999668598175,0.9715999960899353,0,-0.16309406473662258,0.9860835381794821,0.03224254610169826,-0.17309999465942383,0.9848999977111816,0,-0.18099512760445208,0.982833937027952,0.035752146922720544,-0.3797000050544739,0.9251000285148621,0,-0.5235316128339348,0.8457082744477594,0.10340292497841669,-0.5267000198364258,0.8500999808311462,0,-0.3275777539387444,0.9426132072697088,-0.06459997372414784,-0.21799999475479126,0.9718000292778015,-0.09019999951124191,-0.16309406473662258,0.9860835381794821,-0.03224254610169826,-0.15960000455379486,0.9850000143051147,-0.06599999964237213,-0.18099512760445208,0.982833937027952,-0.035752146922720544,-0.3504999876022339,0.9253000020980835,-0.14470000565052032,-0.5235316128339348,0.8457082744477594,-0.10340292497841669,-0.48559999465942383,0.8507000207901001,-0.20149999856948853,-0.27649957959472143,0.9430486026192276,-0.18495219809957497,-0.16660000383853912,0.9718000292778015,-0.16660000383853912,-0.13770263578303485,0.9861891086646662,-0.09202731143305214,-0.12189999967813492,0.9850000143051147,-0.12189999967813492,-0.15275889985296257,0.9829686899991592,-0.1021629727300915,-0.2676999866962433,0.925599992275238,-0.2676999866962433,-0.44245158541572593,0.8465383737127242,-0.29598881126645027,-0.37130001187324524,0.8510000109672546,-0.37130001187324524,-0.18495219809957497,0.9430486026192276,-0.27649957959472143,-0.09019999951124191,0.9718000292778015,-0.21799999475479126,-0.09202731143305214,0.9861891086646662,-0.13770263578303485,-0.06599999964237213,0.9850000143051147,-0.15960000455379486,-0.1021629727300915,0.9829686899991592,-0.15275889985296257,-0.14470000565052032,0.9253000020980835,-0.3504999876022339,-0.29598881126645027,0.8465383737127242,-0.44245158541572593,-0.20149999856948853,0.8507000207901001,-0.48559999465942383,-0.06459997372414784,0.9426132072697088,-0.3275777539387444,0,0.9715999960899353,-0.23659999668598175,-0.03224254610169826,0.9860835381794821,-0.16309406473662258,0,0.9848999977111816,-0.17309999465942383,-0.035752146922720544,0.982833937027952,-0.18099512760445208,0,0.9251000285148621,-0.3797000050544739,-0.1034029249784167,0.8457082744477595,-0.5235316128339349,0,0.8500999808311462,-0.5267000198364258,0.06459997372414784,0.9426132072697088,-0.3275777539387444,0.09019999951124191,0.9718000292778015,-0.21799999475479126,0.03224254610169826,0.9860835381794821,-0.16309406473662258,0.06599999964237213,0.9850000143051147,-0.15960000455379486,0.035752146922720544,0.982833937027952,-0.18099512760445208,0.14470000565052032,0.9253000020980835,-0.3504999876022339,0.1034029249784167,0.8457082744477595,-0.5235316128339349,0.20149999856948853,0.8507000207901001,-0.48559999465942383,0.18495219809957497,0.9430486026192276,-0.27649957959472143,0.16660000383853912,0.9718000292778015,-0.16660000383853912,0.09202731143305214,0.9861891086646662,-0.13770263578303485,0.12189999967813492,0.9850000143051147,-0.12189999967813492,0.1021629727300915,0.9829686899991592,-0.15275889985296257,0.2676999866962433,0.925599992275238,-0.2676999866962433,0.29598881126645027,0.8465383737127242,-0.44245158541572593,0.37130001187324524,0.8510000109672546,-0.37130001187324524,0.27649957959472143,0.9430486026192276,-0.18495219809957497,0.21799999475479126,0.9718000292778015,-0.09019999951124191,0.13770263578303485,0.9861891086646662,-0.09202731143305214,0.15960000455379486,0.9850000143051147,-0.06599999964237213,0.15275889985296257,0.9829686899991592,-0.1021629727300915,0.3504999876022339,0.9253000020980835,-0.14470000565052032,0.44245158541572593,0.8465383737127242,-0.29598881126645027,0.48559999465942383,0.8507000207901001,-0.20149999856948853,0.3275777539387444,0.9426132072697088,-0.06459997372414784,0.16309406473662258,0.9860835381794821,-0.03224254610169826,0.18099512760445208,0.982833937027952,-0.035752146922720544,0.5235316128339348,0.8457082744477594,-0.10340292497841669],"uvs":[[2,2,1.75,2,1.75,1.975000023841858,2,1.975000023841858,1.75,1.9500000476837158,2,1.9500000476837158,1.75,1.9249999523162842,2,1.9249999523162842,1.75,1.899999976158142,2,1.899999976158142,1.5,2,1.5,1.975000023841858,1.5,1.9500000476837158,1.5,1.9249999523162842,1.5,1.899999976158142,1.25,2,1.25,1.975000023841858,1.25,1.9500000476837158,1.25,1.9249999523162842,1.25,1.899999976158142,1,2,1,1.975000023841858,1,1.9500000476837158,1,1.9249999523162842,1,1.899999976158142,0.75,2,0.75,1.975000023841858,0.75,1.9500000476837158,0.75,1.9249999523162842,0.75,1.899999976158142,0.5,2,0.5,1.975000023841858,0.5,1.9500000476837158,0.5,1.9249999523162842,0.5,1.899999976158142,0.25,2,0.25,1.975000023841858,0.25,1.9500000476837158,0.25,1.9249999523162842,0.25,1.899999976158142,0,2,0,1.975000023841858,0,1.9500000476837158,0,1.9249999523162842,0,1.899999976158142,1.75,1.6749999523162842,2,1.6749999523162842,1.75,1.4500000476837158,2,1.4500000476837158,1.75,1.225000023841858,2,1.225000023841858,1.75,1,2,1,1.5,1.6749999523162842,1.5,1.4500000476837158,1.5,1.225000023841858,1.5,1,1.25,1.6749999523162842,1.25,1.4500000476837158,1.25,1.225000023841858,1.25,1,1,1.6749999523162842,1,1.4500000476837158,1,1.225000023841858,1,1,0.75,1.6749999523162842,0.75,1.4500000476837158,0.75,1.225000023841858,0.75,1,0.5,1.6749999523162842,0.5,1.4500000476837158,0.5,1.225000023841858,0.5,1,0.25,1.6749999523162842,0.25,1.4500000476837158,0.25,1.225000023841858,0.25,1,0,1.6749999523162842,0,1.4500000476837158,0,1.225000023841858,0,1,1.75,0.8500000238418579,2,0.8500000238418579,1.75,0.699999988079071,2,0.699999988079071,1.75,0.550000011920929,2,0.550000011920929,1.75,0.4000000059604645,2,0.4000000059604645,1.5,0.8500000238418579,1.5,0.699999988079071,1.5,0.550000011920929,1.5,0.4000000059604645,1.25,0.8500000238418579,1.25,0.699999988079071,1.25,0.550000011920929,1.25,0.4000000059604645,1,0.8500000238418579,1,0.699999988079071,1,0.550000011920929,1,0.4000000059604645,0.75,0.8500000238418579,0.75,0.699999988079071,0.75,0.550000011920929,0.75,0.4000000059604645,0.5,0.8500000238418579,0.5,0.699999988079071,0.5,0.550000011920929,0.5,0.4000000059604645,0.25,0.8500000238418579,0.25,0.699999988079071,0.25,0.550000011920929,0.25,0.4000000059604645,0,0.8500000238418579,0,0.699999988079071,0,0.550000011920929,0,0.4000000059604645,1.75,0.30000001192092896,2,0.30000001192092896,1.75,0.20000000298023224,2,0.20000000298023224,1.75,0.10000000149011612,2,0.10000000149011612,1.75,0,1.5,0.30000001192092896,1.5,0.20000000298023224,1.5,0.10000000149011612,1.5,0,1.25,0.30000001192092896,1.25,0.20000000298023224,1.25,0.10000000149011612,1.25,0,1,0.30000001192092896,1,0.20000000298023224,1,0.10000000149011612,1,0,0.75,0.30000001192092896,0.75,0.20000000298023224,0.75,0.10000000149011612,0.75,0,0.5,0.30000001192092896,0.5,0.20000000298023224,0.5,0.10000000149011612,0.5,0,0.25,0.30000001192092896,0.25,0.20000000298023224,0.25,0.10000000149011612,0.25,0,0,0.30000001192092896,0,0.20000000298023224,0,0.10000000149011612,0,0,0.875,1,0.875,0.875,1,0.875,0.875,0.75,1,0.75,0.875,0.625,1,0.625,0.875,0.5,1,0.5,0.75,0.875,0.75,0.75,0.75,0.625,0.75,0.5,0.625,1,0.625,0.875,0.625,0.75,0.625,0.625,0.625,0.5,0.5,0.875,0.5,0.75,0.5,0.625,0.5,0.5,0.375,1,0.375,0.875,0.375,0.75,0.375,0.625,0.375,0.5,0.25,0.875,0.25,0.75,0.25,0.625,0.25,0.5,0.125,1,0.125,0.875,0.125,0.75,0.125,0.625,0.125,0.5,0,0.875,0,0.75,0,0.625,0,0.5,0.875,0.375,1,0.375,0.875,0.25,1,0.25,0.875,0.125,1,0.125,0.875,0,0.75,0.375,0.75,0.25,0.75,0.125,0.625,0.375,0.625,0.25,0.625,0.125,0.625,0,0.5,0.375,0.5,0.25,0.5,0.125,0.375,0.375,0.375,0.25,0.375,0.125,0.375,0,0.25,0.375,0.25,0.25,0.25,0.125,0.125,0.375,0.125,0.25,0.125,0.125,0.125,0,0,0.375,0,0.25,0,0.125,0.625,0.22499999403953552,0.5,0.22499999403953552,0.625,0.44999998807907104,0.5,0.44999998807907104,0.625,0.675000011920929,0.5,0.675000011920929,0.625,0.8999999761581421,0.5,0.8999999761581421,0.75,0.22499999403953552,0.75,0.44999998807907104,0.75,0.675000011920929,0.75,0.8999999761581421,0.875,0.22499999403953552,0.875,0.44999998807907104,0.875,0.675000011920929,0.875,0.8999999761581421,1,0.22499999403953552,1,0.44999998807907104,1,0.675000011920929,1,0.8999999761581421,0.125,0.22499999403953552,0,0.22499999403953552,0.125,0.44999998807907104,0,0.44999998807907104,0.125,0.675000011920929,0,0.675000011920929,0.125,0.8999999761581421,0,0.8999999761581421,0.25,0.22499999403953552,0.25,0.44999998807907104,0.25,0.675000011920929,0.25,0.8999999761581421,0.375,0.22499999403953552,0.375,0.44999998807907104,0.375,0.675000011920929,0.375,0.8999999761581421,0.625,0.925000011920929,0.5,0.925000011920929,0.625,0.949999988079071,0.5,0.949999988079071,0.625,0.9750000238418579,0.5,0.9750000238418579,0.75,0.925000011920929,0.75,0.949999988079071,0.75,0.9750000238418579,0.875,0.925000011920929,0.875,0.949999988079071,0.875,0.9750000238418579,1,0.925000011920929,1,0.949999988079071,1,0.9750000238418579,0.125,0.925000011920929,0,0.925000011920929,0.125,0.949999988079071,0,0.949999988079071,0.125,0.9750000238418579,0,0.9750000238418579,0.25,0.925000011920929,0.25,0.949999988079071,0.25,0.9750000238418579,0.375,0.925000011920929,0.375,0.949999988079071,0.375,0.9750000238418579]],"faces":[56,0,1,2,0,1,2,0,1,2,3,56,0,2,3,0,2,3,0,1,3,4,56,3,2,4,3,2,4,5,4,3,6,56,3,4,5,3,4,5,5,4,6,7,56,5,4,6,5,4,6,8,7,6,9,56,5,6,7,5,6,7,8,7,9,10,56,7,6,8,7,6,8,11,10,9,12,56,7,8,9,7,8,9,11,10,12,13,56,1,10,11,1,10,11,14,2,15,16,56,1,11,2,1,11,2,14,2,16,3,56,2,11,12,2,11,12,17,3,16,18,56,2,12,4,2,12,4,17,3,18,6,56,4,12,13,4,12,13,19,6,18,20,56,4,13,6,4,13,6,19,6,20,9,56,6,13,14,6,13,14,21,9,20,22,56,6,14,8,6,14,8,21,9,22,12,56,10,15,16,10,15,16,23,15,24,25,56,10,16,11,10,16,11,23,15,25,16,56,11,16,17,11,16,17,26,16,25,27,56,11,17,12,11,17,12,26,16,27,18,56,12,17,18,12,17,18,28,18,27,29,56,12,18,13,12,18,13,28,18,29,20,56,13,18,19,13,18,19,30,20,29,31,56,13,19,14,13,19,14,30,20,31,22,56,15,20,21,15,20,21,32,24,33,34,56,15,21,16,15,21,16,32,24,34,25,56,16,21,22,16,21,22,35,25,34,36,56,16,22,17,16,22,17,35,25,36,27,56,17,22,23,17,22,23,37,27,36,38,56,17,23,18,17,23,18,37,27,38,29,56,18,23,24,18,23,24,39,29,38,40,56,18,24,19,18,24,19,39,29,40,31,56,20,25,26,20,25,26,41,33,42,43,56,20,26,21,20,26,21,41,33,43,34,56,21,26,27,21,26,27,44,34,43,45,56,21,27,22,21,27,22,44,34,45,36,56,22,27,28,22,27,28,46,36,45,47,56,22,28,23,22,28,23,46,36,47,38,56,23,28,29,23,28,29,48,38,47,49,56,23,29,24,23,29,24,48,38,49,40,56,25,30,31,25,30,31,50,42,51,52,56,25,31,26,25,31,26,50,42,52,43,56,26,31,32,26,31,32,53,43,52,54,56,26,32,27,26,32,27,53,43,54,45,56,27,32,33,27,32,33,55,45,54,56,56,27,33,28,27,33,28,55,45,56,47,56,28,33,34,28,33,34,57,47,56,58,56,28,34,29,28,34,29,57,47,58,49,56,30,35,36,30,35,36,59,51,60,61,56,30,36,31,30,36,31,59,51,61,52,56,31,36,37,31,36,37,62,52,61,63,56,31,37,32,31,37,32,62,52,63,54,56,32,37,38,32,37,38,64,54,63,65,56,32,38,33,32,38,33,64,54,65,56,56,33,38,39,33,38,39,66,56,65,67,56,33,39,34,33,39,34,66,56,67,58,56,35,40,41,35,40,41,68,60,69,70,56,35,41,36,35,41,36,68,60,70,61,56,36,41,42,36,41,42,71,61,70,72,56,36,42,37,36,42,37,71,61,72,63,56,37,42,43,37,42,43,73,63,72,74,56,37,43,38,37,43,38,73,63,74,65,56,38,43,44,38,43,44,75,65,74,76,56,38,44,39,38,44,39,75,65,76,67,56,40,45,46,0,1,2,77,69,78,79,56,40,46,41,0,2,3,77,69,79,70,56,41,46,47,3,2,4,80,70,79,81,56,41,47,42,3,4,5,80,70,81,72,56,42,47,48,5,4,6,82,72,81,83,56,42,48,43,5,6,7,82,72,83,74,56,43,48,49,7,6,8,84,74,83,85,56,43,49,44,7,8,9,84,74,85,76,56,45,50,51,1,10,11,86,78,87,88,56,45,51,46,1,11,2,86,78,88,79,56,46,51,52,2,11,12,89,79,88,90,56,46,52,47,2,12,4,89,79,90,81,56,47,52,53,4,12,13,91,81,90,92,56,47,53,48,4,13,6,91,81,92,83,56,48,53,54,6,13,14,93,83,92,94,56,48,54,49,6,14,8,93,83,94,85,56,50,55,56,10,15,16,95,87,96,97,56,50,56,51,10,16,11,95,87,97,88,56,51,56,57,11,16,17,98,88,97,99,56,51,57,52,11,17,12,98,88,99,90,56,52,57,58,12,17,18,100,90,99,101,56,52,58,53,12,18,13,100,90,101,92,56,53,58,59,13,18,19,102,92,101,103,56,53,59,54,13,19,14,102,92,103,94,56,55,60,61,15,20,21,104,96,105,106,56,55,61,56,15,21,16,104,96,106,97,56,56,61,62,16,21,22,107,97,106,108,56,56,62,57,16,22,17,107,97,108,99,56,57,62,63,17,22,23,109,99,108,110,56,57,63,58,17,23,18,109,99,110,101,56,58,63,64,18,23,24,111,101,110,112,56,58,64,59,18,24,19,111,101,112,103,56,60,65,66,20,25,26,113,105,114,115,56,60,66,61,20,26,21,113,105,115,106,56,61,66,67,21,26,27,116,106,115,117,56,61,67,62,21,27,22,116,106,117,108,56,62,67,68,22,27,28,118,108,117,119,56,62,68,63,22,28,23,118,108,119,110,56,63,68,69,23,28,29,120,110,119,121,56,63,69,64,23,29,24,120,110,121,112,56,65,70,71,25,30,31,122,114,123,124,56,65,71,66,25,31,26,122,114,124,115,56,66,71,72,26,31,32,125,115,124,126,56,66,72,67,26,32,27,125,115,126,117,56,67,72,73,27,32,33,127,117,126,128,56,67,73,68,27,33,28,127,117,128,119,56,68,73,74,28,33,34,129,119,128,130,56,68,74,69,28,34,29,129,119,130,121,56,70,75,76,30,35,36,131,123,132,133,56,70,76,71,30,36,31,131,123,133,124,56,71,76,77,31,36,37,134,124,133,135,56,71,77,72,31,37,32,134,124,135,126,56,72,77,78,32,37,38,136,126,135,137,56,72,78,73,32,38,33,136,126,137,128,56,73,78,79,33,38,39,138,128,137,139,56,73,79,74,33,39,34,138,128,139,130,56,75,0,3,35,40,41,140,132,1,4,56,75,3,76,35,41,36,140,132,4,133,56,76,3,5,36,41,42,141,133,4,7,56,76,5,77,36,42,37,141,133,7,135,56,77,5,7,37,42,43,142,135,7,10,56,77,7,78,37,43,38,142,135,10,137,56,78,7,9,38,43,44,143,137,10,13,56,78,9,79,38,44,39,143,137,13,139,56,9,8,80,9,8,45,144,13,12,145,56,9,80,81,9,45,46,144,13,145,146,56,81,80,82,46,45,47,147,146,145,148,56,81,82,83,46,47,48,147,146,148,149,56,83,82,84,48,47,49,150,149,148,151,56,83,84,85,48,49,50,150,149,151,152,56,85,84,86,50,49,51,153,152,151,154,56,85,86,87,50,51,52,153,152,154,155,56,8,14,88,8,14,53,156,12,22,157,56,8,88,80,8,53,45,156,12,157,145,56,80,88,89,45,53,54,158,145,157,159,56,80,89,82,45,54,47,158,145,159,148,56,82,89,90,47,54,55,160,148,159,161,56,82,90,84,47,55,49,160,148,161,151,56,84,90,91,49,55,56,162,151,161,163,56,84,91,86,49,56,51,162,151,163,154,56,14,19,92,14,19,57,164,22,31,165,56,14,92,88,14,57,53,164,22,165,157,56,88,92,93,53,57,58,166,157,165,167,56,88,93,89,53,58,54,166,157,167,159,56,89,93,94,54,58,59,168,159,167,169,56,89,94,90,54,59,55,168,159,169,161,56,90,94,95,55,59,60,170,161,169,171,56,90,95,91,55,60,56,170,161,171,163,56,19,24,96,19,24,61,172,31,40,173,56,19,96,92,19,61,57,172,31,173,165,56,92,96,97,57,61,62,174,165,173,175,56,92,97,93,57,62,58,174,165,175,167,56,93,97,98,58,62,63,176,167,175,177,56,93,98,94,58,63,59,176,167,177,169,56,94,98,99,59,63,64,178,169,177,179,56,94,99,95,59,64,60,178,169,179,171,56,24,29,100,24,29,65,180,40,49,181,56,24,100,96,24,65,61,180,40,181,173,56,96,100,101,61,65,66,182,173,181,183,56,96,101,97,61,66,62,182,173,183,175,56,97,101,102,62,66,67,184,175,183,185,56,97,102,98,62,67,63,184,175,185,177,56,98,102,103,63,67,68,186,177,185,187,56,98,103,99,63,68,64,186,177,187,179,56,29,34,104,29,34,69,188,49,58,189,56,29,104,100,29,69,65,188,49,189,181,56,100,104,105,65,69,70,190,181,189,191,56,100,105,101,65,70,66,190,181,191,183,56,101,105,106,66,70,71,192,183,191,193,56,101,106,102,66,71,67,192,183,193,185,56,102,106,107,67,71,72,194,185,193,195,56,102,107,103,67,72,68,194,185,195,187,56,34,39,108,34,39,73,196,58,67,197,56,34,108,104,34,73,69,196,58,197,189,56,104,108,109,69,73,74,198,189,197,199,56,104,109,105,69,74,70,198,189,199,191,56,105,109,110,70,74,75,200,191,199,201,56,105,110,106,70,75,71,200,191,201,193,56,106,110,111,71,75,76,202,193,201,203,56,106,111,107,71,76,72,202,193,203,195,56,39,44,112,39,44,77,204,67,76,205,56,39,112,108,39,77,73,204,67,205,197,56,108,112,113,73,77,78,206,197,205,207,56,108,113,109,73,78,74,206,197,207,199,56,109,113,114,74,78,79,208,199,207,209,56,109,114,110,74,79,75,208,199,209,201,56,110,114,115,75,79,80,210,201,209,211,56,110,115,111,75,80,76,210,201,211,203,56,44,49,116,9,8,45,212,76,85,213,56,44,116,112,9,45,46,212,76,213,205,56,112,116,117,46,45,47,214,205,213,215,56,112,117,113,46,47,48,214,205,215,207,56,113,117,118,48,47,49,216,207,215,217,56,113,118,114,48,49,50,216,207,217,209,56,114,118,119,50,49,51,218,209,217,219,56,114,119,115,50,51,52,218,209,219,211,56,49,54,120,8,14,53,220,85,94,221,56,49,120,116,8,53,45,220,85,221,213,56,116,120,121,45,53,54,222,213,221,223,56,116,121,117,45,54,47,222,213,223,215,56,117,121,122,47,54,55,224,215,223,225,56,117,122,118,47,55,49,224,215,225,217,56,118,122,123,49,55,56,226,217,225,227,56,118,123,119,49,56,51,226,217,227,219,56,54,59,124,14,19,57,228,94,103,229,56,54,124,120,14,57,53,228,94,229,221,56,120,124,125,53,57,58,230,221,229,231,56,120,125,121,53,58,54,230,221,231,223,56,121,125,126,54,58,59,232,223,231,233,56,121,126,122,54,59,55,232,223,233,225,56,122,126,127,55,59,60,234,225,233,235,56,122,127,123,55,60,56,234,225,235,227,56,59,64,128,19,24,61,236,103,112,237,56,59,128,124,19,61,57,236,103,237,229,56,124,128,129,57,61,62,238,229,237,239,56,124,129,125,57,62,58,238,229,239,231,56,125,129,130,58,62,63,240,231,239,241,56,125,130,126,58,63,59,240,231,241,233,56,126,130,131,59,63,64,242,233,241,243,56,126,131,127,59,64,60,242,233,243,235,56,64,69,132,24,29,65,244,112,121,245,56,64,132,128,24,65,61,244,112,245,237,56,128,132,133,61,65,66,246,237,245,247,56,128,133,129,61,66,62,246,237,247,239,56,129,133,134,62,66,67,248,239,247,249,56,129,134,130,62,67,63,248,239,249,241,56,130,134,135,63,67,68,250,241,249,251,56,130,135,131,63,68,64,250,241,251,243,56,69,74,136,29,34,69,252,121,130,253,56,69,136,132,29,69,65,252,121,253,245,56,132,136,137,65,69,70,254,245,253,255,56,132,137,133,65,70,66,254,245,255,247,56,133,137,138,66,70,71,256,247,255,257,56,133,138,134,66,71,67,256,247,257,249,56,134,138,139,67,71,72,258,249,257,259,56,134,139,135,67,72,68,258,249,259,251,56,74,79,140,34,39,73,260,130,139,261,56,74,140,136,34,73,69,260,130,261,253,56,136,140,141,69,73,74,262,253,261,263,56,136,141,137,69,74,70,262,253,263,255,56,137,141,142,70,74,75,264,255,263,265,56,137,142,138,70,75,71,264,255,265,257,56,138,142,143,71,75,76,266,257,265,267,56,138,143,139,71,76,72,266,257,267,259,56,79,9,81,39,44,77,268,139,13,146,56,79,81,140,39,77,73,268,139,146,261,56,140,81,83,73,77,78,269,261,146,149,56,140,83,141,73,78,74,269,261,149,263,56,141,83,85,74,78,79,270,263,149,152,56,141,85,142,74,79,75,270,263,152,265,56,142,85,87,75,79,80,271,265,152,155,56,142,87,143,75,80,76,271,265,155,267,56,87,86,144,52,51,81,272,155,154,273,56,87,144,145,52,81,82,272,155,273,274,56,145,144,146,82,81,83,275,274,273,276,56,145,146,147,82,83,84,275,274,276,277,56,147,146,148,84,83,85,278,277,276,279,56,147,148,149,84,85,86,278,277,279,280,56,149,148,150,86,85,87,281,280,279,282,56,149,150,151,86,87,88,281,280,282,283,56,86,91,152,51,56,89,284,154,163,285,56,86,152,144,51,89,81,284,154,285,273,56,144,152,153,81,89,90,286,273,285,287,56,144,153,146,81,90,83,286,273,287,276,56,146,153,154,83,90,91,288,276,287,289,56,146,154,148,83,91,85,288,276,289,279,56,148,154,155,85,91,92,290,279,289,291,56,148,155,150,85,92,87,290,279,291,282,56,91,95,156,56,60,93,292,163,171,293,56,91,156,152,56,93,89,292,163,293,285,56,152,156,157,89,93,94,294,285,293,295,56,152,157,153,89,94,90,294,285,295,287,56,153,157,158,90,94,95,296,287,295,297,56,153,158,154,90,95,91,296,287,297,289,56,154,158,159,91,95,96,298,289,297,299,56,154,159,155,91,96,92,298,289,299,291,56,95,99,160,60,64,97,300,171,179,301,56,95,160,156,60,97,93,300,171,301,293,56,156,160,161,93,97,98,302,293,301,303,56,156,161,157,93,98,94,302,293,303,295,56,157,161,162,94,98,99,304,295,303,305,56,157,162,158,94,99,95,304,295,305,297,56,158,162,163,95,99,100,306,297,305,307,56,158,163,159,95,100,96,306,297,307,299,56,99,103,164,64,68,101,308,179,187,309,56,99,164,160,64,101,97,308,179,309,301,56,160,164,165,97,101,102,310,301,309,311,56,160,165,161,97,102,98,310,301,311,303,56,161,165,166,98,102,103,312,303,311,313,56,161,166,162,98,103,99,312,303,313,305,56,162,166,167,99,103,104,314,305,313,315,56,162,167,163,99,104,100,314,305,315,307,56,103,107,168,68,72,105,316,187,195,317,56,103,168,164,68,105,101,316,187,317,309,56,164,168,169,101,105,106,318,309,317,319,56,164,169,165,101,106,102,318,309,319,311,56,165,169,170,102,106,107,320,311,319,321,56,165,170,166,102,107,103,320,311,321,313,56,166,170,171,103,107,108,322,313,321,323,56,166,171,167,103,108,104,322,313,323,315,56,107,111,172,72,76,109,324,195,203,325,56,107,172,168,72,109,105,324,195,325,317,56,168,172,173,105,109,110,326,317,325,327,56,168,173,169,105,110,106,326,317,327,319,56,169,173,174,106,110,111,328,319,327,329,56,169,174,170,106,111,107,328,319,329,321,56,170,174,175,107,111,112,330,321,329,331,56,170,175,171,107,112,108,330,321,331,323,56,111,115,176,76,80,113,332,203,211,333,56,111,176,172,76,113,109,332,203,333,325,56,172,176,177,109,113,114,334,325,333,335,56,172,177,173,109,114,110,334,325,335,327,56,173,177,178,110,114,115,336,327,335,337,56,173,178,174,110,115,111,336,327,337,329,56,174,178,179,111,115,116,338,329,337,339,56,174,179,175,111,116,112,338,329,339,331,56,115,119,180,52,51,81,340,211,219,341,56,115,180,176,52,81,82,340,211,341,333,56,176,180,181,82,81,83,342,333,341,343,56,176,181,177,82,83,84,342,333,343,335,56,177,181,182,84,83,85,344,335,343,345,56,177,182,178,84,85,86,344,335,345,337,56,178,182,183,86,85,87,346,337,345,347,56,178,183,179,86,87,88,346,337,347,339,56,119,123,184,51,56,89,348,219,227,349,56,119,184,180,51,89,81,348,219,349,341,56,180,184,185,81,89,90,350,341,349,351,56,180,185,181,81,90,83,350,341,351,343,56,181,185,186,83,90,91,352,343,351,353,56,181,186,182,83,91,85,352,343,353,345,56,182,186,187,85,91,92,354,345,353,355,56,182,187,183,85,92,87,354,345,355,347,56,123,127,188,56,60,93,356,227,235,357,56,123,188,184,56,93,89,356,227,357,349,56,184,188,189,89,93,94,358,349,357,359,56,184,189,185,89,94,90,358,349,359,351,56,185,189,190,90,94,95,360,351,359,361,56,185,190,186,90,95,91,360,351,361,353,56,186,190,191,91,95,96,362,353,361,363,56,186,191,187,91,96,92,362,353,363,355,56,127,131,192,60,64,97,364,235,243,365,56,127,192,188,60,97,93,364,235,365,357,56,188,192,193,93,97,98,366,357,365,367,56,188,193,189,93,98,94,366,357,367,359,56,189,193,194,94,98,99,368,359,367,369,56,189,194,190,94,99,95,368,359,369,361,56,190,194,195,95,99,100,370,361,369,371,56,190,195,191,95,100,96,370,361,371,363,56,131,135,196,64,68,101,372,243,251,373,56,131,196,192,64,101,97,372,243,373,365,56,192,196,197,97,101,102,374,365,373,375,56,192,197,193,97,102,98,374,365,375,367,56,193,197,198,98,102,103,376,367,375,377,56,193,198,194,98,103,99,376,367,377,369,56,194,198,199,99,103,104,378,369,377,379,56,194,199,195,99,104,100,378,369,379,371,56,135,139,200,68,72,105,380,251,259,381,56,135,200,196,68,105,101,380,251,381,373,56,196,200,201,101,105,106,382,373,381,383,56,196,201,197,101,106,102,382,373,383,375,56,197,201,202,102,106,107,384,375,383,385,56,197,202,198,102,107,103,384,375,385,377,56,198,202,203,103,107,108,386,377,385,387,56,198,203,199,103,108,104,386,377,387,379,56,139,143,204,72,76,109,388,259,267,389,56,139,204,200,72,109,105,388,259,389,381,56,200,204,205,105,109,110,390,381,389,391,56,200,205,201,105,110,106,390,381,391,383,56,201,205,206,106,110,111,392,383,391,393,56,201,206,202,106,111,107,392,383,393,385,56,202,206,207,107,111,112,394,385,393,395,56,202,207,203,107,112,108,394,385,395,387,56,143,87,145,76,80,113,396,267,155,274,56,143,145,204,76,113,109,396,267,274,389,56,204,145,147,109,113,114,397,389,274,277,56,204,147,205,109,114,110,397,389,277,391,56,205,147,149,110,114,115,398,391,277,280,56,205,149,206,110,115,111,398,391,280,393,56,206,149,151,111,115,116,399,393,280,283,56,206,151,207,111,116,112,399,393,283,395,56,151,150,208,88,87,117,400,283,282,401,56,151,208,209,88,117,118,400,283,401,402,56,209,208,210,118,117,119,403,402,401,404,56,209,210,211,118,119,120,403,402,404,405,56,211,210,212,120,119,121,406,405,404,407,56,211,212,213,120,121,122,406,405,407,408,56,213,212,214,122,121,123,409,408,407,410,56,150,155,215,87,92,124,411,282,291,412,56,150,215,208,87,124,117,411,282,412,401,56,208,215,216,117,124,125,413,401,412,414,56,208,216,210,117,125,119,413,401,414,404,56,210,216,217,119,125,126,415,404,414,416,56,210,217,212,119,126,121,415,404,416,407,56,212,217,214,121,126,127,417,407,416,410,56,155,159,218,92,96,128,418,291,299,419,56,155,218,215,92,128,124,418,291,419,412,56,215,218,219,124,128,129,420,412,419,421,56,215,219,216,124,129,125,420,412,421,414,56,216,219,220,125,129,130,422,414,421,423,56,216,220,217,125,130,126,422,414,423,416,56,217,220,214,126,130,131,424,416,423,410,56,159,163,221,96,100,132,425,299,307,426,56,159,221,218,96,132,128,425,299,426,419,56,218,221,222,128,132,133,427,419,426,428,56,218,222,219,128,133,129,427,419,428,421,56,219,222,223,129,133,134,429,421,428,430,56,219,223,220,129,134,130,429,421,430,423,56,220,223,214,130,134,135,431,423,430,410,56,163,167,224,100,104,136,432,307,315,433,56,163,224,221,100,136,132,432,307,433,426,56,221,224,225,132,136,137,434,426,433,435,56,221,225,222,132,137,133,434,426,435,428,56,222,225,226,133,137,138,436,428,435,437,56,222,226,223,133,138,134,436,428,437,430,56,223,226,214,134,138,139,438,430,437,410,56,167,171,227,104,108,140,439,315,323,440,56,167,227,224,104,140,136,439,315,440,433,56,224,227,228,136,140,141,441,433,440,442,56,224,228,225,136,141,137,441,433,442,435,56,225,228,229,137,141,142,443,435,442,444,56,225,229,226,137,142,138,443,435,444,437,56,226,229,214,138,142,143,445,437,444,410,56,171,175,230,108,112,144,446,323,331,447,56,171,230,227,108,144,140,446,323,447,440,56,227,230,231,140,144,145,448,440,447,449,56,227,231,228,140,145,141,448,440,449,442,56,228,231,232,141,145,146,450,442,449,451,56,228,232,229,141,146,142,450,442,451,444,56,229,232,214,142,146,147,452,444,451,410,56,175,179,233,112,116,148,453,331,339,454,56,175,233,230,112,148,144,453,331,454,447,56,230,233,234,144,148,149,455,447,454,456,56,230,234,231,144,149,145,455,447,456,449,56,231,234,235,145,149,150,457,449,456,458,56,231,235,232,145,150,146,457,449,458,451,56,232,235,214,146,150,151,459,451,458,410,56,179,183,236,88,87,117,460,339,347,461,56,179,236,233,88,117,118,460,339,461,454,56,233,236,237,118,117,119,462,454,461,463,56,233,237,234,118,119,120,462,454,463,456,56,234,237,238,120,119,121,464,456,463,465,56,234,238,235,120,121,122,464,456,465,458,56,235,238,214,122,121,123,466,458,465,410,56,183,187,239,87,92,124,467,347,355,468,56,183,239,236,87,124,117,467,347,468,461,56,236,239,240,117,124,125,469,461,468,470,56,236,240,237,117,125,119,469,461,470,463,56,237,240,241,119,125,126,471,463,470,472,56,237,241,238,119,126,121,471,463,472,465,56,238,241,214,121,126,127,473,465,472,410,56,187,191,242,92,96,128,474,355,363,475,56,187,242,239,92,128,124,474,355,475,468,56,239,242,243,124,128,129,476,468,475,477,56,239,243,240,124,129,125,476,468,477,470,56,240,243,244,125,129,130,478,470,477,479,56,240,244,241,125,130,126,478,470,479,472,56,241,244,214,126,130,131,480,472,479,410,56,191,195,245,96,100,132,481,363,371,482,56,191,245,242,96,132,128,481,363,482,475,56,242,245,246,128,132,133,483,475,482,484,56,242,246,243,128,133,129,483,475,484,477,56,243,246,247,129,133,134,485,477,484,486,56,243,247,244,129,134,130,485,477,486,479,56,244,247,214,130,134,135,487,479,486,410,56,195,199,248,100,104,136,488,371,379,489,56,195,248,245,100,136,132,488,371,489,482,56,245,248,249,132,136,137,490,482,489,491,56,245,249,246,132,137,133,490,482,491,484,56,246,249,250,133,137,138,492,484,491,493,56,246,250,247,133,138,134,492,484,493,486,56,247,250,214,134,138,139,494,486,493,410,56,199,203,251,104,108,140,495,379,387,496,56,199,251,248,104,140,136,495,379,496,489,56,248,251,252,136,140,141,497,489,496,498,56,248,252,249,136,141,137,497,489,498,491,56,249,252,253,137,141,142,499,491,498,500,56,249,253,250,137,142,138,499,491,500,493,56,250,253,214,138,142,143,501,493,500,410,56,203,207,254,108,112,144,502,387,395,503,56,203,254,251,108,144,140,502,387,503,496,56,251,254,255,140,144,145,504,496,503,505,56,251,255,252,140,145,141,504,496,505,498,56,252,255,256,141,145,146,506,498,505,507,56,252,256,253,141,146,142,506,498,507,500,56,253,256,214,142,146,147,508,500,507,410,56,207,151,209,112,116,148,509,395,283,402,56,207,209,254,112,148,144,509,395,402,503,56,254,209,211,144,148,149,510,503,402,405,56,254,211,255,144,149,145,510,503,405,505,56,255,211,213,145,149,150,511,505,405,408,56,255,213,256,145,150,146,511,505,408,507,56,256,213,214,146,150,151,512,507,408,410,56,257,258,259,64,152,153,513,514,515,516,56,257,259,260,64,153,154,513,514,516,517,56,260,259,261,154,153,155,518,517,516,519,56,260,261,262,154,155,156,518,517,519,520,56,262,261,263,156,155,157,521,520,519,522,56,262,263,264,156,157,158,521,520,522,523,56,264,263,265,158,157,159,524,523,522,525,56,264,265,266,158,159,160,524,523,525,526,56,258,267,268,152,68,161,527,515,528,529,56,258,268,259,152,161,153,527,515,529,516,56,259,268,269,153,161,162,530,516,529,531,56,259,269,261,153,162,155,530,516,531,519,56,261,269,270,155,162,163,532,519,531,533,56,261,270,263,155,163,157,532,519,533,522,56,263,270,271,157,163,164,534,522,533,535,56,263,271,265,157,164,159,534,522,535,525,56,267,272,273,68,165,166,536,528,537,538,56,267,273,268,68,166,161,536,528,538,529,56,268,273,274,161,166,167,539,529,538,540,56,268,274,269,161,167,162,539,529,540,531,56,269,274,275,162,167,168,541,531,540,542,56,269,275,270,162,168,163,541,531,542,533,56,270,275,276,163,168,169,543,533,542,544,56,270,276,271,163,169,164,543,533,544,535,56,272,277,278,165,72,170,545,537,546,547,56,272,278,273,165,170,166,545,537,547,538,56,273,278,279,166,170,171,548,538,547,549,56,273,279,274,166,171,167,548,538,549,540,56,274,279,280,167,171,172,550,540,549,551,56,274,280,275,167,172,168,550,540,551,542,56,275,280,281,168,172,173,552,542,551,553,56,275,281,276,168,173,169,552,542,553,544,56,277,282,283,72,174,175,554,546,555,556,56,277,283,278,72,175,170,554,546,556,547,56,278,283,284,170,175,176,557,547,556,558,56,278,284,279,170,176,171,557,547,558,549,56,279,284,285,171,176,177,559,549,558,560,56,279,285,280,171,177,172,559,549,560,551,56,280,285,286,172,177,178,561,551,560,562,56,280,286,281,172,178,173,561,551,562,553,56,282,287,288,174,76,179,563,555,564,565,56,282,288,283,174,179,175,563,555,565,556,56,283,288,289,175,179,180,566,556,565,567,56,283,289,284,175,180,176,566,556,567,558,56,284,289,290,176,180,181,568,558,567,569,56,284,290,285,176,181,177,568,558,569,560,56,285,290,291,177,181,182,570,560,569,571,56,285,291,286,177,182,178,570,560,571,562,56,287,292,293,76,183,184,572,564,573,574,56,287,293,288,76,184,179,572,564,574,565,56,288,293,294,179,184,185,575,565,574,576,56,288,294,289,179,185,180,575,565,576,567,56,289,294,295,180,185,186,577,567,576,578,56,289,295,290,180,186,181,577,567,578,569,56,290,295,296,181,186,187,579,569,578,580,56,290,296,291,181,187,182,579,569,580,571,56,292,257,260,183,80,188,581,573,514,517,56,292,260,293,183,188,184,581,573,517,574,56,293,260,262,184,188,189,582,574,517,520,56,293,262,294,184,189,185,582,574,520,576,56,294,262,264,185,189,190,583,576,520,523,56,294,264,295,185,190,186,583,576,523,578,56,295,264,266,186,190,191,584,578,523,526,56,295,266,296,186,191,187,584,578,526,580,56,266,265,297,160,159,192,585,526,525,586,56,266,297,298,160,192,193,585,526,586,587,56,298,297,299,193,192,194,588,587,586,589,56,298,299,300,193,194,195,588,587,589,590,56,300,299,301,195,194,196,591,590,589,592,56,300,301,302,195,196,197,591,590,592,593,56,302,301,303,197,196,198,594,593,592,595,56,302,303,115,197,198,135,594,593,595,596,56,265,271,304,159,164,199,597,525,535,598,56,265,304,297,159,199,192,597,525,598,586,56,297,304,305,192,199,200,599,586,598,600,56,297,305,299,192,200,194,599,586,600,589,56,299,305,306,194,200,201,601,589,600,602,56,299,306,301,194,201,196,601,589,602,592,56,301,306,307,196,201,139,603,592,602,604,56,301,307,303,196,139,198,603,592,604,595,56,271,276,308,164,169,202,605,535,544,606,56,271,308,304,164,202,199,605,535,606,598,56,304,308,309,199,202,203,607,598,606,608,56,304,309,305,199,203,200,607,598,608,600,56,305,309,310,200,203,204,609,600,608,610,56,305,310,306,200,204,201,609,600,610,602,56,306,310,311,201,204,205,611,602,610,612,56,306,311,307,201,205,139,611,602,612,604,56,276,281,312,169,173,206,613,544,553,614,56,276,312,308,169,206,202,613,544,614,606,56,308,312,313,202,206,207,615,606,614,616,56,308,313,309,202,207,203,615,606,616,608,56,309,313,314,203,207,208,617,608,616,618,56,309,314,310,203,208,204,617,608,618,610,56,310,314,315,204,208,143,619,610,618,620,56,310,315,311,204,143,205,619,610,620,612,56,281,286,316,173,178,209,621,553,562,622,56,281,316,312,173,209,206,621,553,622,614,56,312,316,317,206,209,210,623,614,622,624,56,312,317,313,206,210,207,623,614,624,616,56,313,317,318,207,210,211,625,616,624,626,56,313,318,314,207,211,208,625,616,626,618,56,314,318,319,208,211,212,627,618,626,628,56,314,319,315,208,212,143,627,618,628,620,56,286,291,320,178,182,213,629,562,571,630,56,286,320,316,178,213,209,629,562,630,622,56,316,320,321,209,213,214,631,622,630,632,56,316,321,317,209,214,210,631,622,632,624,56,317,321,322,210,214,215,633,624,632,634,56,317,322,318,210,215,211,633,624,634,626,56,318,322,323,211,215,147,635,626,634,636,56,318,323,319,211,147,212,635,626,636,628,56,291,296,324,182,187,216,637,571,580,638,56,291,324,320,182,216,213,637,571,638,630,56,320,324,325,213,216,217,639,630,638,640,56,320,325,321,213,217,214,639,630,640,632,56,321,325,326,214,217,218,641,632,640,642,56,321,326,322,214,218,215,641,632,642,634,56,322,326,327,215,218,219,643,634,642,644,56,322,327,323,215,219,147,643,634,644,636,56,296,266,298,187,191,220,645,580,526,587,56,296,298,324,187,220,216,645,580,587,638,56,324,298,300,216,220,221,646,638,587,590,56,324,300,325,216,221,217,646,638,590,640,56,325,300,302,217,221,222,647,640,590,593,56,325,302,326,217,222,218,647,640,593,642,56,326,302,115,218,222,151,648,642,593,596,56,326,115,327,218,151,219,648,642,596,644,56,328,329,330,143,205,223,649,650,651,652,56,328,330,331,143,223,224,649,650,652,653,56,331,330,332,224,223,225,654,653,652,655,56,331,332,333,224,225,226,654,653,655,656,56,333,332,334,226,225,227,657,656,655,658,56,333,334,335,226,227,228,657,656,658,659,56,335,334,336,228,227,229,660,659,658,661,56,335,336,337,228,229,230,660,659,661,662,56,329,338,339,205,139,231,663,651,664,665,56,329,339,330,205,231,223,663,651,665,652,56,330,339,340,223,231,232,666,652,665,667,56,330,340,332,223,232,225,666,652,667,655,56,332,340,341,225,232,233,668,655,667,669,56,332,341,334,225,233,227,668,655,669,658,56,334,341,342,227,233,234,670,658,669,671,56,334,342,336,227,234,229,670,658,671,661,56,338,343,344,139,198,235,672,664,673,674,56,338,344,339,139,235,231,672,664,674,665,56,339,344,345,231,235,236,675,665,674,676,56,339,345,340,231,236,232,675,665,676,667,56,340,345,346,232,236,237,677,667,676,678,56,340,346,341,232,237,233,677,667,678,669,56,341,346,347,233,237,238,679,669,678,680,56,341,347,342,233,238,234,679,669,680,671,56,343,348,349,198,135,239,681,673,682,683,56,343,349,344,198,239,235,681,673,683,674,56,344,349,350,235,239,240,684,674,683,685,56,344,350,345,235,240,236,684,674,685,676,56,345,350,351,236,240,241,686,676,685,687,56,345,351,346,236,241,237,686,676,687,678,56,346,351,352,237,241,242,688,678,687,689,56,346,352,347,237,242,238,688,678,689,680,56,348,353,354,151,219,243,690,682,691,692,56,348,354,349,151,243,244,690,682,692,683,56,349,354,355,244,243,245,693,683,692,694,56,349,355,350,244,245,246,693,683,694,685,56,350,355,356,246,245,247,695,685,694,696,56,350,356,351,246,247,248,695,685,696,687,56,351,356,357,248,247,249,697,687,696,698,56,351,357,352,248,249,250,697,687,698,689,56,353,358,359,219,147,251,699,691,700,701,56,353,359,354,219,251,243,699,691,701,692,56,354,359,360,243,251,252,702,692,701,703,56,354,360,355,243,252,245,702,692,703,694,56,355,360,361,245,252,253,704,694,703,705,56,355,361,356,245,253,247,704,694,705,696,56,356,361,362,247,253,254,706,696,705,707,56,356,362,357,247,254,249,706,696,707,698,56,358,363,364,147,212,255,708,700,709,710,56,358,364,359,147,255,251,708,700,710,701,56,359,364,365,251,255,256,711,701,710,712,56,359,365,360,251,256,252,711,701,712,703,56,360,365,366,252,256,257,713,703,712,714,56,360,366,361,252,257,253,713,703,714,705,56,361,366,367,253,257,258,715,705,714,716,56,361,367,362,253,258,254,715,705,716,707,56,363,328,331,212,143,224,717,709,650,653,56,363,331,364,212,224,255,717,709,653,710,56,364,331,333,255,224,226,718,710,653,656,56,364,333,365,255,226,256,718,710,656,712,56,365,333,335,256,226,228,719,712,656,659,56,365,335,366,256,228,257,719,712,659,714,56,366,335,337,257,228,230,720,714,659,662,56,366,337,367,257,230,258,720,714,662,716,56,337,336,368,230,229,259,721,662,661,722,56,337,368,369,230,259,260,721,662,722,723,56,369,368,370,260,259,261,724,723,722,725,56,369,370,371,260,261,262,724,723,725,726,56,371,370,372,262,261,263,727,726,725,728,56,371,372,373,262,263,264,727,726,728,729,56,373,372,374,264,263,165,730,729,728,731,56,373,374,375,264,165,72,730,729,731,732,56,336,342,376,229,234,265,733,661,671,734,56,336,376,368,229,265,259,733,661,734,722,56,368,376,377,259,265,266,735,722,734,736,56,368,377,370,259,266,261,735,722,736,725,56,370,377,378,261,266,267,737,725,736,738,56,370,378,372,261,267,263,737,725,738,728,56,372,378,379,263,267,68,739,728,738,740,56,372,379,374,263,68,165,739,728,740,731,56,342,347,380,234,238,268,741,671,680,742,56,342,380,376,234,268,265,741,671,742,734,56,376,380,381,265,268,269,743,734,742,744,56,376,381,377,265,269,266,743,734,744,736,56,377,381,382,266,269,270,745,736,744,746,56,377,382,378,266,270,267,745,736,746,738,56,378,382,383,267,270,152,747,738,746,748,56,378,383,379,267,152,68,747,738,748,740,56,347,352,384,238,242,271,749,680,689,750,56,347,384,380,238,271,268,749,680,750,742,56,380,384,385,268,271,272,751,742,750,752,56,380,385,381,268,272,269,751,742,752,744,56,381,385,386,269,272,273,753,744,752,754,56,381,386,382,269,273,270,753,744,754,746,56,382,386,387,270,273,64,755,746,754,756,56,382,387,383,270,64,152,755,746,756,748,56,352,357,388,250,249,274,757,689,698,758,56,352,388,384,250,274,275,757,689,758,750,56,384,388,389,275,274,276,759,750,758,760,56,384,389,385,275,276,277,759,750,760,752,56,385,389,390,277,276,278,761,752,760,762,56,385,390,386,277,278,279,761,752,762,754,56,386,390,391,279,278,183,763,754,762,764,56,386,391,387,279,183,80,763,754,764,756,56,357,362,392,249,254,280,765,698,707,766,56,357,392,388,249,280,274,765,698,766,758,56,388,392,393,274,280,281,767,758,766,768,56,388,393,389,274,281,276,767,758,768,760,56,389,393,394,276,281,282,769,760,768,770,56,389,394,390,276,282,278,769,760,770,762,56,390,394,395,278,282,76,771,762,770,772,56,390,395,391,278,76,183,771,762,772,764,56,362,367,396,254,258,283,773,707,716,774,56,362,396,392,254,283,280,773,707,774,766,56,392,396,397,280,283,284,775,766,774,776,56,392,397,393,280,284,281,775,766,776,768,56,393,397,398,281,284,285,777,768,776,778,56,393,398,394,281,285,282,777,768,778,770,56,394,398,399,282,285,174,779,770,778,780,56,394,399,395,282,174,76,779,770,780,772,56,367,337,369,258,230,260,781,716,662,723,56,367,369,396,258,260,283,781,716,723,774,56,396,369,371,283,260,262,782,774,723,726,56,396,371,397,283,262,284,782,774,726,776,56,397,371,373,284,262,264,783,776,726,729,56,397,373,398,284,264,285,783,776,729,778,56,398,373,375,285,264,72,784,778,729,732,56,398,375,399,285,72,174,784,778,732,780,56,400,401,402,155,156,64,785,786,787,788,56,401,400,403,156,155,159,789,787,786,790,56,401,403,404,156,159,160,789,787,790,791,56,404,403,405,160,159,194,792,791,790,793,56,404,405,406,160,194,195,792,791,793,794,56,406,405,407,195,194,198,795,794,793,796,56,406,407,408,195,198,135,795,794,796,797,56,409,400,402,162,155,152,798,799,786,788,56,400,409,410,155,162,164,800,786,799,801,56,400,410,403,155,164,159,800,786,801,790,56,403,410,411,159,164,200,802,790,801,803,56,403,411,405,159,200,194,802,790,803,793,56,405,411,412,194,200,139,804,793,803,805,56,405,412,407,194,139,198,804,793,805,796,56,413,409,402,167,162,68,806,807,799,788,56,409,413,414,162,167,169,808,799,807,809,56,409,414,410,162,169,164,808,799,809,801,56,410,414,415,164,169,203,810,801,809,811,56,410,415,411,164,203,200,810,801,811,803,56,411,415,416,200,203,205,812,803,811,813,56,411,416,412,200,205,139,812,803,813,805,56,417,413,402,171,167,165,814,815,807,788,56,413,417,418,167,171,173,816,807,815,817,56,413,418,414,167,173,169,816,807,817,809,56,414,418,419,169,173,207,818,809,817,819,56,414,419,415,169,207,203,818,809,819,811,56,415,419,420,203,207,143,820,811,819,821,56,415,420,416,203,143,205,820,811,821,813,56,421,417,402,176,171,72,822,823,815,788,56,417,421,422,171,176,178,824,815,823,825,56,417,422,418,171,178,173,824,815,825,817,56,418,422,423,173,178,210,826,817,825,827,56,418,423,419,173,210,207,826,817,827,819,56,419,423,424,207,210,212,828,819,827,829,56,419,424,420,207,212,143,828,819,829,821,56,425,421,402,180,176,174,830,831,823,788,56,421,425,426,176,180,182,832,823,831,833,56,421,426,422,176,182,178,832,823,833,825,56,422,426,427,178,182,214,834,825,833,835,56,422,427,423,178,214,210,834,825,835,827,56,423,427,428,210,214,147,836,827,835,837,56,423,428,424,210,147,212,836,827,837,829,56,429,425,402,185,180,76,838,839,831,788,56,425,429,430,180,185,187,840,831,839,841,56,425,430,426,180,187,182,840,831,841,833,56,426,430,431,182,187,217,842,833,841,843,56,426,431,427,182,217,214,842,833,843,835,56,427,431,432,214,217,219,844,835,843,845,56,427,432,428,214,219,147,844,835,845,837,56,433,429,402,189,185,183,846,847,839,788,56,429,433,434,185,189,191,848,839,847,849,56,429,434,430,185,191,187,848,839,849,841,56,430,434,435,187,191,221,850,841,849,851,56,430,435,431,187,221,217,850,841,851,843,56,431,435,436,217,221,151,852,843,851,853,56,431,436,432,217,151,219,852,843,853,845,56,437,433,402,155,156,64,854,855,847,788,56,433,437,438,156,155,159,856,847,855,857,56,433,438,434,156,159,160,856,847,857,849,56,434,438,439,160,159,194,858,849,857,859,56,434,439,435,160,194,195,858,849,859,851,56,435,439,440,195,194,198,860,851,859,861,56,435,440,436,195,198,135,860,851,861,853,56,441,437,402,162,155,152,862,863,855,788,56,437,441,442,155,162,164,864,855,863,865,56,437,442,438,155,164,159,864,855,865,857,56,438,442,443,159,164,200,866,857,865,867,56,438,443,439,159,200,194,866,857,867,859,56,439,443,444,194,200,139,868,859,867,869,56,439,444,440,194,139,198,868,859,869,861,56,445,441,402,167,162,68,870,871,863,788,56,441,445,446,162,167,169,872,863,871,873,56,441,446,442,162,169,164,872,863,873,865,56,442,446,447,164,169,203,874,865,873,875,56,442,447,443,164,203,200,874,865,875,867,56,443,447,448,200,203,205,876,867,875,877,56,443,448,444,200,205,139,876,867,877,869,56,449,445,402,171,167,165,878,879,871,788,56,445,449,450,167,171,173,880,871,879,881,56,445,450,446,167,173,169,880,871,881,873,56,446,450,451,169,173,207,882,873,881,883,56,446,451,447,169,207,203,882,873,883,875,56,447,451,452,203,207,143,884,875,883,885,56,447,452,448,203,143,205,884,875,885,877,56,453,449,402,176,171,72,886,887,879,788,56,449,453,454,171,176,178,888,879,887,889,56,449,454,450,171,178,173,888,879,889,881,56,450,454,455,173,178,210,890,881,889,891,56,450,455,451,173,210,207,890,881,891,883,56,451,455,456,207,210,212,892,883,891,893,56,451,456,452,207,212,143,892,883,893,885,56,457,453,402,180,176,174,894,895,887,788,56,453,457,458,176,180,182,896,887,895,897,56,453,458,454,176,182,178,896,887,897,889,56,454,458,459,178,182,214,898,889,897,899,56,454,459,455,178,214,210,898,889,899,891,56,455,459,460,210,214,147,900,891,899,901,56,455,460,456,210,147,212,900,891,901,893,56,461,457,402,185,180,76,902,903,895,788,56,457,461,462,180,185,187,904,895,903,905,56,457,462,458,180,187,182,904,895,905,897,56,458,462,463,182,187,217,906,897,905,907,56,458,463,459,182,217,214,906,897,907,899,56,459,463,464,214,217,219,908,899,907,909,56,459,464,460,214,219,147,908,899,909,901,56,401,461,402,189,185,183,910,787,903,788,56,461,401,404,185,189,191,911,903,787,791,56,461,404,462,185,191,187,911,903,791,905,56,462,404,406,187,191,221,912,905,791,794,56,462,406,463,187,221,217,912,905,794,907,56,463,406,408,217,221,151,913,907,794,797,56,463,408,464,217,151,219,913,907,797,909,56,408,407,465,64,152,155,914,797,796,915,56,408,465,466,64,155,156,914,797,915,916,56,466,465,467,156,155,159,917,916,915,918,56,466,467,468,156,159,160,917,916,918,919,56,468,467,469,160,159,194,920,919,918,921,56,468,469,470,160,194,195,920,919,921,922,56,470,469,471,195,194,198,923,922,921,924,56,470,471,472,195,198,135,923,922,924,925,56,407,412,473,152,68,162,926,796,805,927,56,407,473,465,152,162,155,926,796,927,915,56,465,473,474,155,162,164,928,915,927,929,56,465,474,467,155,164,159,928,915,929,918,56,467,474,475,159,164,200,930,918,929,931,56,467,475,469,159,200,194,930,918,931,921,56,469,475,476,194,200,139,932,921,931,933,56,469,476,471,194,139,198,932,921,933,924,56,412,416,477,68,165,167,934,805,813,935,56,412,477,473,68,167,162,934,805,935,927,56,473,477,478,162,167,169,936,927,935,937,56,473,478,474,162,169,164,936,927,937,929,56,474,478,479,164,169,203,938,929,937,939,56,474,479,475,164,203,200,938,929,939,931,56,475,479,480,200,203,205,940,931,939,941,56,475,480,476,200,205,139,940,931,941,933,56,416,420,481,165,72,171,942,813,821,943,56,416,481,477,165,171,167,942,813,943,935,56,477,481,482,167,171,173,944,935,943,945,56,477,482,478,167,173,169,944,935,945,937,56,478,482,483,169,173,207,946,937,945,947,56,478,483,479,169,207,203,946,937,947,939,56,479,483,484,203,207,143,948,939,947,949,56,479,484,480,203,143,205,948,939,949,941,56,420,424,485,72,174,176,950,821,829,951,56,420,485,481,72,176,171,950,821,951,943,56,481,485,486,171,176,178,952,943,951,953,56,481,486,482,171,178,173,952,943,953,945,56,482,486,487,173,178,210,954,945,953,955,56,482,487,483,173,210,207,954,945,955,947,56,483,487,488,207,210,212,956,947,955,957,56,483,488,484,207,212,143,956,947,957,949,56,424,428,489,174,76,180,958,829,837,959,56,424,489,485,174,180,176,958,829,959,951,56,485,489,490,176,180,182,960,951,959,961,56,485,490,486,176,182,178,960,951,961,953,56,486,490,491,178,182,214,962,953,961,963,56,486,491,487,178,214,210,962,953,963,955,56,487,491,492,210,214,147,964,955,963,965,56,487,492,488,210,147,212,964,955,965,957,56,428,432,493,76,183,185,966,837,845,967,56,428,493,489,76,185,180,966,837,967,959,56,489,493,494,180,185,187,968,959,967,969,56,489,494,490,180,187,182,968,959,969,961,56,490,494,495,182,187,217,970,961,969,971,56,490,495,491,182,217,214,970,961,971,963,56,491,495,496,214,217,219,972,963,971,973,56,491,496,492,214,219,147,972,963,973,965,56,432,436,497,183,80,189,974,845,853,975,56,432,497,493,183,189,185,974,845,975,967,56,493,497,498,185,189,191,976,967,975,977,56,493,498,494,185,191,187,976,967,977,969,56,494,498,499,187,191,221,978,969,977,979,56,494,499,495,187,221,217,978,969,979,971,56,495,499,500,217,221,151,980,971,979,981,56,495,500,496,217,151,219,980,971,981,973,56,436,440,501,64,152,155,982,853,861,983,56,436,501,497,64,155,156,982,853,983,975,56,497,501,502,156,155,159,984,975,983,985,56,497,502,498,156,159,160,984,975,985,977,56,498,502,503,160,159,194,986,977,985,987,56,498,503,499,160,194,195,986,977,987,979,56,499,503,504,195,194,198,988,979,987,989,56,499,504,500,195,198,135,988,979,989,981,56,440,444,505,152,68,162,990,861,869,991,56,440,505,501,152,162,155,990,861,991,983,56,501,505,506,155,162,164,992,983,991,993,56,501,506,502,155,164,159,992,983,993,985,56,502,506,507,159,164,200,994,985,993,995,56,502,507,503,159,200,194,994,985,995,987,56,503,507,508,194,200,139,996,987,995,997,56,503,508,504,194,139,198,996,987,997,989,56,444,448,509,68,165,167,998,869,877,999,56,444,509,505,68,167,162,998,869,999,991,56,505,509,510,162,167,169,1000,991,999,1001,56,505,510,506,162,169,164,1000,991,1001,993,56,506,510,511,164,169,203,1002,993,1001,1003,56,506,511,507,164,203,200,1002,993,1003,995,56,507,511,512,200,203,205,1004,995,1003,1005,56,507,512,508,200,205,139,1004,995,1005,997,56,448,452,513,165,72,171,1006,877,885,1007,56,448,513,509,165,171,167,1006,877,1007,999,56,509,513,514,167,171,173,1008,999,1007,1009,56,509,514,510,167,173,169,1008,999,1009,1001,56,510,514,515,169,173,207,1010,1001,1009,1011,56,510,515,511,169,207,203,1010,1001,1011,1003,56,511,515,516,203,207,143,1012,1003,1011,1013,56,511,516,512,203,143,205,1012,1003,1013,1005,56,452,456,517,72,174,176,1014,885,893,1015,56,452,517,513,72,176,171,1014,885,1015,1007,56,513,517,518,171,176,178,1016,1007,1015,1017,56,513,518,514,171,178,173,1016,1007,1017,1009,56,514,518,519,173,178,210,1018,1009,1017,1019,56,514,519,515,173,210,207,1018,1009,1019,1011,56,515,519,520,207,210,212,1020,1011,1019,1021,56,515,520,516,207,212,143,1020,1011,1021,1013,56,456,460,521,174,76,180,1022,893,901,1023,56,456,521,517,174,180,176,1022,893,1023,1015,56,517,521,522,176,180,182,1024,1015,1023,1025,56,517,522,518,176,182,178,1024,1015,1025,1017,56,518,522,523,178,182,214,1026,1017,1025,1027,56,518,523,519,178,214,210,1026,1017,1027,1019,56,519,523,524,210,214,147,1028,1019,1027,1029,56,519,524,520,210,147,212,1028,1019,1029,1021,56,460,464,525,76,183,185,1030,901,909,1031,56,460,525,521,76,185,180,1030,901,1031,1023,56,521,525,526,180,185,187,1032,1023,1031,1033,56,521,526,522,180,187,182,1032,1023,1033,1025,56,522,526,527,182,187,217,1034,1025,1033,1035,56,522,527,523,182,217,214,1034,1025,1035,1027,56,523,527,528,214,217,219,1036,1027,1035,1037,56,523,528,524,214,219,147,1036,1027,1037,1029,56,464,408,466,183,80,189,1038,909,797,916,56,464,466,525,183,189,185,1038,909,916,1031,56,525,466,468,185,189,191,1039,1031,916,919,56,525,468,526,185,191,187,1039,1031,919,1033,56,526,468,470,187,191,221,1040,1033,919,922,56,526,470,527,187,221,217,1040,1033,922,1035,56,527,470,472,217,221,151,1041,1035,922,925,56,527,472,528,217,151,219,1041,1035,925,1037]}}],"materials":[{"uuid":"7AAB18E5-FF88-4A82-8018-4DF34EDB7539","type":"MeshPhongMaterial","color":16714940,"ambient":16714940,"emissive":0,"specular":0,"shininess":50,"opacity":1,"transparent":false,"wireframe":false}],"object":{"uuid":"0D4F494E-35AD-4D5B-9696-7DF60B73E7F0","name":"Teapot001","type":"Mesh","geometry":"15930b1c-1b50-4926-a0ac-df433b9c4f96","material":"7AAB18E5-FF88-4A82-8018-4DF34EDB7539","castShadow":true,"receiveShadow":true,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}} diff --git a/build/public/assets/textures/UV_Grid_Sm.jpg b/build/public/assets/textures/UV_Grid_Sm.jpg new file mode 100644 index 0000000..bcc6ee1 Binary files /dev/null and b/build/public/assets/textures/UV_Grid_Sm.jpg differ diff --git a/build/public/index.html b/build/public/index.html new file mode 100644 index 0000000..9cb97f5 --- /dev/null +++ b/build/public/index.html @@ -0,0 +1,19 @@ + + + + + Three.js Webpack ES6 Boilerplate + + + + +
    +
    +
    +
    + + + + + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..5c940ce --- /dev/null +++ b/package.json @@ -0,0 +1,44 @@ +{ + "name": "threejs-es6-webpack-boilerplate", + "version": "1.0.0", + "description": "Boilerplate for Three.js projects set up with Babel for ES6 and compiled with webpack", + "author": "Paul Graffam", + "main": "app.js", + "scripts": { + "dev": "run-p dev:sass webpack-server webpack-watch", + "build": "run-s prebuild build:dir build:js build:sass", + "prebuild": "run-p clean lint", + "clean": "rimraf build", + "lint": "eslint src/js/; exit 0", + "webpack-server": "set NODE_ENV=0&& webpack-dev-server --hot --inline --open", + "webpack-watch": "set NODE_ENV=0&& webpack --progress --colors --watch --cache", + "dev:sass": "node-sass -w src/css/app.scss -o src/public/assets/css/", + "dev:js": "set NODE_ENV=0&& webpack", + "build:dir": "copyfiles -u 1 src/public/**/* build/", + "build:sass": "node-sass --output-style compressed src/css/ -o build/public/assets/css/", + "build:js": "set NODE_ENV=1&& webpack" + }, + "dependencies": { + "es6-promise": "^3.2.1", + "normalize.css": "^4.2.0", + "three": "^0.79.0", + "tween.js": "16.2.0" + }, + "devDependencies": { + "babel-core": "^6.13.2", + "babel-loader": "^6.2.5", + "babel-preset-es2015": "^6.13.2", + "copyfiles": "^1.0.0", + "eslint": "^3.4.0", + "file-loader": "^0.9.0", + "node-sass": "^3.8.0", + "npm-run-all": "^3.0.0", + "rimraf": "^2.5.4", + "webpack": "^1.13.2", + "webpack-dev-middleware": "^1.6.1", + "webpack-dev-server": "^1.15.0" + }, + "engines": { + "node": "5.0.0" + } +} diff --git a/src/css/app.scss b/src/css/app.scss new file mode 100644 index 0000000..f3ddef7 --- /dev/null +++ b/src/css/app.scss @@ -0,0 +1,585 @@ +/* ========================================================================== + Normalize.scss settings + ========================================================================== */ +/** + * Includes legacy browser support IE6/7 + * + * Set to false if you want to drop support for IE6 and IE7 + */ + +$legacy_browser_support: false !default; + +/* Base + ========================================================================== */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS and IE text size adjust after device orientation change, + * without disabling user zoom. + * 3. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using + * `em` units. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ + @if $legacy_browser_support { + *font-size: 100%; /* 3 */ + } +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 6/7/8/9 and Firefox 3. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ + @if $legacy_browser_support { + *display: inline; + *zoom: 1; + } +} + +/** + * Prevents modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * Improve readability of focused elements when they are also in an + * active/hover state. + */ + +a { + &:active, &:hover { + outline: 0; + }; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +@if $legacy_browser_support { + blockquote { + margin: 1em 40px; + } +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +@if $legacy_browser_support { + h2 { + font-size: 1.5em; + margin: 0.83em 0; + } + + h3 { + font-size: 1.17em; + margin: 1em 0; + } + + h4 { + font-size: 1em; + margin: 1.33em 0; + } + + h5 { + font-size: 0.83em; + margin: 1.67em 0; + } + + h6 { + font-size: 0.67em; + margin: 2.33em 0; + } +} + +/** + * Addresses styling not present in IE 8/9. + */ + +mark { + background: #ff0; + color: #000; +} + +@if $legacy_browser_support { + + /** + * Addresses margins set differently in IE 6/7. + */ + + p, + pre { + *margin: 1em 0; + } + + /* + * Addresses CSS quotes not supported in IE 6/7. + */ + + q { + *quotes: none; + } + + /* + * Addresses `quotes` property not supported in Safari 4. + */ + + q:before, + q:after { + content: ''; + content: none; + } +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +@if $legacy_browser_support { + + /* ========================================================================== + Lists + ========================================================================== */ + + /* + * Addresses margins set differently in IE 6/7. + */ + + dl, + menu, + ol, + ul { + *margin: 1em 0; + } + + dd { + *margin: 0 0 0 40px; + } + + /* + * Addresses paddings set differently in IE 6/7. + */ + + menu, + ol, + ul { + *padding: 0 0 0 40px; + } + + /* + * Corrects list images handled incorrectly in IE 7. + */ + + nav ul, + nav ol { + *list-style: none; + *list-style-image: none; + } + +} + +/* Embedded content + ========================================================================== */ + +/** + * 1. Remove border when inside `a` element in IE 8/9/10. + * 2. Improves image quality when scaled in IE 7. + */ + +img { + border: 0; + @if $legacy_browser_support { + *-ms-interpolation-mode: bicubic; /* 2 */ + } +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + box-sizing: content-box; + height: 0; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + * Correct font family set oddly in IE 6, Safari 4/5, and Chrome. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + @if $legacy_browser_support { + _font-family: 'courier new', monospace; + } + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + * 4. Improves appearance and consistency in all browsers. + */ + +button, +input, +optgroup, +select, +textarea { + color: inherit; /* 1 */ + font: inherit; /* 2 */ + margin: 0; /* 3 */ + @if $legacy_browser_support { + vertical-align: baseline; /* 3 */ + *vertical-align: middle; /* 3 */ + } +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + * 4. Removes inner spacing in IE 7 without affecting normal text inputs. + * Known issue: inner spacing remains in IE 6. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ + @if $legacy_browser_support { + *overflow: visible; /* 4 */ + } +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + * Known issue: excess padding remains in IE 6. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ + @if $legacy_browser_support { + *height: 13px; /* 3 */ + *width: 13px; /* 3 */ + } +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome. + */ + +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ + box-sizing: content-box; /* 2 */ +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + * 3. Corrects text not wrapping in Firefox 3. + * 4. Corrects alignment displayed oddly in IE 6/7. + */ + +legend { + border: 0; /* 1 */ + padding: 0; /* 2 */ + @if $legacy_browser_support { + white-space: normal; /* 3 */ + *margin-left: -7px; /* 4 */ + } +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, +th { + padding: 0; +} + + +.main { + width: 100%; + height: 100vh; + +} diff --git a/src/js/app.js b/src/js/app.js new file mode 100644 index 0000000..92cdc4c --- /dev/null +++ b/src/js/app.js @@ -0,0 +1,21 @@ +import Config from './data/config'; +import Detector from './utils/detector'; +import Main from './app/main'; + +// verify environment. +if(__ENV__ == 'dev') { + console.log('----- RUNNING IN DEV ENVIRONMENT! -----'); + + Config.isDev = true; +} + +function init() { + if(!Detector.webgl) { + Detector.addGetWebGLMessage(); + } else { + const container = document.getElementById('appContainer'); + new Main(container); + } +} + +window.onload = init; diff --git a/src/js/app/animation.js b/src/js/app/animation.js new file mode 100644 index 0000000..8e53373 --- /dev/null +++ b/src/js/app/animation.js @@ -0,0 +1,23 @@ +import THREE from 'three'; + +export default class Animation { + constructor(obj, clip) { + this.obj = obj; + + this.mixer = new THREE.AnimationMixer(this.obj); + + this.playClip(clip); + } + + playClip(clip) { + this.action = this.mixer.clipAction(clip); + + this.action.play(); + } + + update(delta) { + if(this.mixer) { + this.mixer.update(delta); + } + } +} diff --git a/src/js/app/camera.js b/src/js/app/camera.js new file mode 100644 index 0000000..22c92b1 --- /dev/null +++ b/src/js/app/camera.js @@ -0,0 +1,23 @@ +import THREE from 'three'; + +import Config from './../data/config'; + +export default class Camera { + constructor(renderer) { + const width = renderer.domElement.width; + const height = renderer.domElement.height; + + this.threeCamera = new THREE.PerspectiveCamera(Config.camera.fov, width / height, Config.camera.near, Config.camera.far); + this.threeCamera.position.set(Config.camera.posX, Config.camera.posY, Config.camera.posZ); + + this.updateSize(renderer); + + // listeners + window.addEventListener('resize', () => this.updateSize(renderer), false); + } + + updateSize(renderer) { + this.threeCamera.aspect = (renderer.domElement.width * Config.dpr) / (renderer.domElement.height * Config.dpr); + this.threeCamera.updateProjectionMatrix(); + } +} diff --git a/src/js/app/controls.js b/src/js/app/controls.js new file mode 100644 index 0000000..7eae8a6 --- /dev/null +++ b/src/js/app/controls.js @@ -0,0 +1,28 @@ +import THREE from 'three'; + +import OrbitControls from '../utils/orbitControls'; +import Config from './../data/config'; + +export default class Controls { + constructor(camera, container) { + const orbitControls = new OrbitControls(THREE); + this.threeControls = new orbitControls(camera, container); + + this.init(); + } + + init() { + this.threeControls.target.set(Config.controls.target.x, Config.controls.target.y, Config.controls.target.z); + this.threeControls.autoRotate = Config.controls.autoRotate; + this.threeControls.autoRotateSpeed = Config.controls.autoRotateSpeed; + this.threeControls.rotateSpeed = Config.controls.rotateSpeed; + this.threeControls.zoomSpeed = Config.controls.zoomSpeed; + this.threeControls.minDistance = Config.controls.minDistance; + this.threeControls.maxDistance = Config.controls.maxDistance; + this.threeControls.minPolarAngle = Config.controls.minPolarAngle; + this.threeControls.maxPolarAngle = Config.controls.maxPolarAngle; + this.threeControls.enableDamping = Config.controls.enableDamping; + this.threeControls.enableZoom = Config.controls.enableZoom; + this.threeControls.dampingFactor = Config.controls.dampingFactor; + } +} diff --git a/src/js/app/geometry.js b/src/js/app/geometry.js new file mode 100644 index 0000000..b6a8a14 --- /dev/null +++ b/src/js/app/geometry.js @@ -0,0 +1,33 @@ +import THREE from 'three'; + +import Config from '../data/config'; + +export default class Geometry { + constructor(scene) { + this.scene = scene; + this.geo = null; + } + + make(type) { + if(type == 'plane') { + return (width, height, widthSegments = 1, heightSegments = 1) => { + this.geo = new THREE.PlaneGeometry(width, height, widthSegments, heightSegments); + } + } + } + + place(position, rotation) { + const material = new THREE.MeshStandardMaterial({ color: 0xCCCCCC, side: THREE.DoubleSide }); + const mesh = new THREE.Mesh(this.geo, material); + + mesh.position.set(...position); + mesh.rotation.set(...rotation); + + if(Config.shadow.enabled) { + mesh.receiveShadow = true; + mesh.castShadow = true; + } + + this.scene.add(mesh); + } +} diff --git a/src/js/app/gui.js b/src/js/app/gui.js new file mode 100644 index 0000000..8b665c5 --- /dev/null +++ b/src/js/app/gui.js @@ -0,0 +1,369 @@ +import Config from './../data/config'; + +export default class GUI { + constructor(main, mesh) { + let gui = new dat.GUI(); + + this.camera = main.camera.threeCamera; + this.controls = main.controls.threeControls; + this.light = main.light; + + /* Global */ + //gui.close(); + + /* Camera */ + let cameraFolder = gui.addFolder('Camera'); + let cameraFOVGui = cameraFolder.add(Config.camera, 'fov', 0, 180).name('Camera FOV'); + cameraFOVGui.onChange((value) => { + this.controls.enableRotate = false; + + this.camera.fov = value; + }); + cameraFOVGui.onFinishChange((value) => { + this.camera.updateProjectionMatrix(); + + this.controls.enableRotate = true; + }); + let cameraAspectGui = cameraFolder.add(Config.camera, 'aspect', 0, 4).name('Camera Aspect'); + cameraAspectGui.onChange((value) => { + this.controls.enableRotate = false; + + this.camera.aspect = value; + }); + cameraAspectGui.onFinishChange((value) => { + this.camera.updateProjectionMatrix(); + + this.controls.enableRotate = true; + }); + let cameraFogColorGui = cameraFolder.addColor(Config.fog, 'color').name('Fog Color'); + cameraFogColorGui.onChange((value) => { + main.scene.fog.color.setHex(value); + }); + let cameraFogNearGui = cameraFolder.add(Config.fog, 'near', 0.000, 0.010).name('Fog Near'); + cameraFogNearGui.onChange((value) => { + this.controls.enableRotate = false; + + main.scene.fog.density = value; + }); + cameraFogNearGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + + + /* Controls */ + let controlsFolder = gui.addFolder('Controls'); + controlsFolder.add(Config.controls, 'autoRotate').name('Auto Rotate').onChange((value) => { + this.controls.autoRotate = value; + }); + let controlsAutoRotateSpeedGui = controlsFolder.add(Config.controls, 'autoRotateSpeed', -1, 1).name('Rotation Speed'); + controlsAutoRotateSpeedGui.onChange((value) => { + this.controls.enableRotate = false; + this.controls.autoRotateSpeed = value; + }); + controlsAutoRotateSpeedGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + + + /* Mesh */ + let meshFolder = gui.addFolder('Mesh'); + meshFolder.add(Config.mesh, 'translucent', true).name('Translucent').onChange((value) => { + if(value) { + mesh.material.transparent = true; + mesh.material.opacity = 0.5; + } else { + mesh.material.opacity = 1.0; + } + }); + meshFolder.add(Config.mesh, 'wireframe', true).name('Wireframe').onChange((value) => { + mesh.material.wireframe = value; + }); + + + /* Lights */ + // Ambient Light + let ambientLightFolder = gui.addFolder('Ambient Light'); + ambientLightFolder.add(Config.ambientLight, 'enabled').name('Enabled').onChange((value) => { + this.light.ambientLight.visible = value; + }); + ambientLightFolder.addColor(Config.ambientLight, 'color').name('Color').onChange((value) => { + this.light.ambientLight.color.setHex(value); + }); + + + // Directional Light + let directionalLightFolder = gui.addFolder('Directional Light'); + directionalLightFolder.add(Config.directionalLight, 'enabled').name('Enabled').onChange((value) => { + this.light.directionalLight.visible = value; + }); + directionalLightFolder.addColor(Config.directionalLight, 'color').name('Color').onChange((value) => { + this.light.directionalLight.color.setHex(value); + }); + let directionalLightIntensityGui = directionalLightFolder.add(Config.directionalLight, 'intensity', 0, 2).name('Intensity'); + directionalLightIntensityGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.intensity = value; + }); + directionalLightIntensityGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + let directionalLightPositionXGui = directionalLightFolder.add(Config.directionalLight, 'x', -1000, 1000).name('Position X'); + directionalLightPositionXGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.position.x = value; + }); + directionalLightPositionXGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + let directionalLightPositionYGui = directionalLightFolder.add(Config.directionalLight, 'y', -1000, 1000).name('Position Y'); + directionalLightPositionYGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.position.y = value; + }); + directionalLightPositionYGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + let directionalLightPositionZGui = directionalLightFolder.add(Config.directionalLight, 'z', -1000, 1000).name('Position Z'); + directionalLightPositionZGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.position.z = value; + }); + directionalLightPositionZGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + + // Shadow Map + let shadowFolder = gui.addFolder('Shadow Map'); + shadowFolder.add(Config.shadow, 'enabled').name('Enabled').onChange((value) => { + this.light.directionalLight.castShadow = value; + }); + shadowFolder.add(Config.shadow, 'helperEnabled').name('Helper Enabled').onChange((value) => { + this.light.directionalLightHelper.visible = value; + }); + let shadowNearGui = shadowFolder.add(Config.shadow, 'near', 0, 100).name('Near'); + shadowNearGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.shadow.camera.near = value; + }); + shadowNearGui.onFinishChange((value) => { + this.controls.enableRotate = true; + this.light.directionalLight.shadow.map.dispose(); + this.light.directionalLight.shadow.map = null; + this.light.directionalLightHelper.update(); + }); + let shadowFarGui = shadowFolder.add(Config.shadow, 'far', 0, 1200).name('Far'); + shadowFarGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.shadow.camera.far = value; + }); + shadowFarGui.onFinishChange((value) => { + this.controls.enableRotate = true; + this.light.directionalLight.shadow.map.dispose(); + this.light.directionalLight.shadow.map = null; + this.light.directionalLightHelper.update(); + }); + let shadowTopGui = shadowFolder.add(Config.shadow, 'top', -400, 400).name('Top'); + shadowTopGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.shadow.camera.top = value; + }); + shadowTopGui.onFinishChange((value) => { + this.controls.enableRotate = true; + this.light.directionalLight.shadow.map.dispose(); + this.light.directionalLight.shadow.map = null; + this.light.directionalLightHelper.update(); + }); + let shadowRightGui = shadowFolder.add(Config.shadow, 'right', -400, 400).name('Right'); + shadowRightGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.shadow.camera.right = value; + }); + shadowRightGui.onFinishChange((value) => { + this.controls.enableRotate = true; + this.light.directionalLight.shadow.map.dispose(); + this.light.directionalLight.shadow.map = null; + this.light.directionalLightHelper.update(); + }); + let shadowBottomGui = shadowFolder.add(Config.shadow, 'bottom', -400, 400).name('Bottom'); + shadowBottomGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.shadow.camera.bottom = value; + }); + shadowBottomGui.onFinishChange((value) => { + this.controls.enableRotate = true; + this.light.directionalLight.shadow.map.dispose(); + this.light.directionalLight.shadow.map = null; + this.light.directionalLightHelper.update(); + }); + let shadowLeftGui = shadowFolder.add(Config.shadow, 'left', -400, 400).name('Left'); + shadowLeftGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.shadow.camera.left = value; + }); + shadowLeftGui.onFinishChange((value) => { + this.controls.enableRotate = true; + this.light.directionalLight.shadow.map.dispose(); + this.light.directionalLight.shadow.map = null; + this.light.directionalLightHelper.update(); + }); + let shadowBiasGui = shadowFolder.add(Config.shadow, 'bias', -0.000010, 1).name('Bias'); + shadowBiasGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.directionalLight.shadow.bias = value; + }); + shadowBiasGui.onFinishChange((value) => { + this.controls.enableRotate = true; + this.light.directionalLight.shadow.map.dispose(); + this.light.directionalLight.shadow.map = null; + this.light.directionalLightHelper.update(); + }); + + + // Point Light + let pointLightFolder = gui.addFolder('Point Light'); + pointLightFolder.add(Config.pointLight, 'enabled').name('Enabled').onChange((value) => { + this.light.pointLight.visible = value; + }); + pointLightFolder.addColor(Config.pointLight, 'color').name('Color').onChange((value) => { + this.light.pointLight.color.setHex(value); + }); + let pointLightIntensityGui = pointLightFolder.add(Config.pointLight, 'intensity', 0, 2).name('Intensity'); + pointLightIntensityGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.pointLight.intensity = value; + }); + pointLightIntensityGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + let pointLightDistanceGui = pointLightFolder.add(Config.pointLight, 'distance', 0, 1000).name('Distance'); + pointLightDistanceGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.pointLight.distance = value; + }); + pointLightDistanceGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + let pointLightPositionXGui = pointLightFolder.add(Config.pointLight, 'x', -1000, 1000).name('Position X'); + pointLightPositionXGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.pointLight.position.x = value; + }); + pointLightPositionXGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + let pointLightPositionYGui = pointLightFolder.add(Config.pointLight, 'y', -1000, 1000).name('Position Y'); + pointLightPositionYGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.pointLight.position.y = value; + }); + pointLightPositionYGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + let pointLightPositionZGui = pointLightFolder.add(Config.pointLight, 'z', -1000, 1000).name('Position Z'); + pointLightPositionZGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.pointLight.position.z = value; + }); + pointLightPositionZGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + + + // Hemi Light + let hemiLightFolder = gui.addFolder('Hemi Light'); + hemiLightFolder.add(Config.hemiLight, 'enabled').name('Enabled').onChange((value) => { + this.light.hemiLight.visible = value; + }); + hemiLightFolder.addColor(Config.hemiLight, 'color').name('Color').onChange((value) => { + this.light.hemiLight.color.setHex(value); + }); + hemiLightFolder.addColor(Config.hemiLight, 'groundColor').name('ground Color').onChange((value) => { + this.light.hemiLight.groundColor.setHex(value); + }); + let hemiLightIntensityGui = hemiLightFolder.add(Config.hemiLight, 'intensity', 0, 2).name('Intensity'); + hemiLightIntensityGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.hemiLight.intensity = value; + }); + hemiLightIntensityGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + let hemiLightPositionXGui = hemiLightFolder.add(Config.hemiLight, 'x', -1000, 1000).name('Position X'); + hemiLightPositionXGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.hemiLight.position.x = value; + }); + hemiLightPositionXGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + let hemiLightPositionYGui = hemiLightFolder.add(Config.hemiLight, 'y', -500, 1000).name('Position Y'); + hemiLightPositionYGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.hemiLight.position.y = value; + }); + hemiLightPositionYGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + let hemiLightPositionZGui = hemiLightFolder.add(Config.hemiLight, 'z', -1000, 1000).name('Position Z'); + hemiLightPositionZGui.onChange((value) => { + this.controls.enableRotate = false; + + this.light.hemiLight.position.z = value; + }); + hemiLightPositionZGui.onFinishChange((value) => { + this.controls.enableRotate = true; + }); + } + + handleColorChange(color) { + return (value) => { + if(typeof value === 'string') { + value = value.replace('#', '0x'); + } + + color.setHex(value); + }; + } + + needsUpdate(material, geometry) { + return function() { + material.shading = +material.shading; //Ensure number + material.vertexColors = +material.vertexColors; //Ensure number + material.side = +material.side; //Ensure number + material.needsUpdate = true; + geometry.verticesNeedUpdate = true; + geometry.normalsNeedUpdate = true; + geometry.colorsNeedUpdate = true; + }; + } + + updateTexture(material, materialKey, textures) { + return function(key) { + material[materialKey] = textures[key]; + material.needsUpdate = true; + }; + } + + update() { + this.needsUpdate(mesh.material, mesh.geometry); + } +} diff --git a/src/js/app/helper.js b/src/js/app/helper.js new file mode 100644 index 0000000..eea6f1b --- /dev/null +++ b/src/js/app/helper.js @@ -0,0 +1,23 @@ +import THREE from 'three'; + +export default class Helper { + constructor(scene, mesh) { + let wireframe = new THREE.WireframeGeometry(mesh.geometry); + let wireLine = new THREE.LineSegments(wireframe); + wireLine.material.depthTest = false; + wireLine.material.opacity = 0.25; + wireLine.material.transparent = true; + mesh.add(wireLine); + + let edges = new THREE.EdgesGeometry(mesh.geometry); + let edgesLine = new THREE.LineSegments(edges); + edgesLine.material.depthTest = false; + edgesLine.material.opacity = 0.25; + edgesLine.material.transparent = true; + mesh.add(edgesLine); + + scene.add(new THREE.BoxHelper(mesh)); + scene.add(new THREE.FaceNormalsHelper(mesh, 2)); + scene.add(new THREE.VertexNormalsHelper(mesh, 2)); + } +} diff --git a/src/js/app/interaction.js b/src/js/app/interaction.js new file mode 100644 index 0000000..7e2463b --- /dev/null +++ b/src/js/app/interaction.js @@ -0,0 +1,54 @@ +import THREE from 'three'; + +import Keyboard from './../utils/keyboard'; +import Helpers from './../utils/helpers'; +import Config from './../data/config'; + +export default class Interaction { + constructor(renderer, scene, camera, controls) { + this.renderer = renderer; + this.scene = scene; + this.camera = camera; + this.controls = controls; + + this.keyboard = new Keyboard(); + + // listeners + // mouse events + this.renderer.domElement.addEventListener('mouseup', (event) => this.onMouseUp(event), false); + this.renderer.domElement.addEventListener('mousemove', (event) => Helpers.throttle(this.onMouseMove(event), 250), false); + this.renderer.domElement.addEventListener('mouseenter', (event) => this.onMouseEnter(event), false); + this.renderer.domElement.addEventListener('mouseleave', (event) => this.onMouseLeave(event), false); + this.renderer.domElement.addEventListener('mouseover', (event) => this.onMouseOver(event), false); + + // keyboard events + this.keyboard.domElement.addEventListener('keydown', (event) => { + if(event.repeat) { + return; + } + if(this.keyboard.eventMatches(event, 'escape')) { + console.log('Escape pressed'); + } + }); + } + + onMouseEnter(event) { + event.preventDefault(); + } + + onMouseOver(event) { + event.preventDefault(); + } + + onMouseLeave(event) { + event.preventDefault(); + } + + onMouseMove(event) { + event.preventDefault(); + } + + onMouseUp(event) { + event.preventDefault(); + } +} diff --git a/src/js/app/light.js b/src/js/app/light.js new file mode 100644 index 0000000..0a30458 --- /dev/null +++ b/src/js/app/light.js @@ -0,0 +1,69 @@ +import THREE from 'three'; + +import Config from './../data/config'; + +export default class Light { + constructor(scene) { + this.scene = scene; + + this.init(); + } + + init() { + // ambient + this.ambientLight = new THREE.AmbientLight(Config.ambientLight.color); + this.ambientLight.visible = Config.ambientLight.enabled; + + // point light + this.pointLight = new THREE.PointLight(Config.pointLight.color, Config.pointLight.intensity, Config.pointLight.distance); + this.pointLight.position.set(Config.pointLight.x, Config.pointLight.y, Config.pointLight.z); + this.pointLight.visible = Config.pointLight.enabled; + + // directional light + this.directionalLight = new THREE.DirectionalLight(Config.directionalLight.color, Config.directionalLight.intensity); + this.directionalLight.position.set(Config.directionalLight.x, Config.directionalLight.y, Config.directionalLight.z); + this.directionalLight.visible = Config.directionalLight.enabled; + + // shadow map + this.directionalLight.castShadow = Config.shadow.enabled; + this.directionalLight.shadow.bias = Config.shadow.bias; + this.directionalLight.shadow.camera.near = Config.shadow.near; + this.directionalLight.shadow.camera.far = Config.shadow.far; + this.directionalLight.shadow.camera.left = Config.shadow.left; + this.directionalLight.shadow.camera.right = Config.shadow.right; + this.directionalLight.shadow.camera.top = Config.shadow.top; + this.directionalLight.shadow.camera.bottom = Config.shadow.bottom; + this.directionalLight.shadow.mapSize.width = Config.shadow.mapWidth; + this.directionalLight.shadow.mapSize.height = Config.shadow.mapHeight; + + // shadow camera helper + this.directionalLightHelper = new THREE.CameraHelper(this.directionalLight.shadow.camera); + this.directionalLightHelper.visible = Config.shadow.helperEnabled; + + // hemisphere light + this.hemiLight = new THREE.HemisphereLight(Config.hemiLight.color, Config.hemiLight.groundColor, Config.hemiLight.intensity); + this.hemiLight.position.set(Config.hemiLight.x, Config.hemiLight.y, Config.hemiLight.z); + this.hemiLight.visible = Config.hemiLight.enabled; + } + + place(lightName) { + switch(lightName) { + case 'ambient': + this.scene.add(this.ambientLight); + break; + + case 'directional': + this.scene.add(this.directionalLight); + this.scene.add(this.directionalLightHelper); + break; + + case 'point': + this.scene.add(this.pointLight); + break; + + case 'hemi': + this.scene.add(this.hemiLight); + break; + } + } +} diff --git a/src/js/app/main.js b/src/js/app/main.js new file mode 100644 index 0000000..e02cd92 --- /dev/null +++ b/src/js/app/main.js @@ -0,0 +1,147 @@ +// global imports +import THREE from 'three'; +import TWEEN from 'tween.js'; + +// local imports +import Renderer from './renderer'; +import Camera from './camera'; +import Light from './light'; +import Controls from './controls'; +import Geometry from './geometry'; +import Texture from './texture'; +import Model from './model'; +import Interaction from './interaction'; +import GUI from './gui'; + +// data +import Config from './../data/config'; + +// stats +let rS, bS, glS, tS; + +export default class Main { + constructor(container) { + this.container = container; + + // Start Three clock + this.clock = new THREE.Clock(); + + // Main scene + this.scene = new THREE.Scene(); + this.scene.fog = new THREE.FogExp2(Config.fog.color, Config.fog.near); + + // Get Device Pixel Ratio first + if(window.devicePixelRatio) { + Config.dpr = window.devicePixelRatio; + } + + // Main renderer + this.renderer = new Renderer(container, this.scene); + + // Components + this.camera = new Camera(this.renderer.threeRenderer); + this.controls = new Controls(this.camera.threeCamera, this.container); + this.light = new Light(this.scene); + + // Place lights + const lights = ['ambient', 'directional', 'point', 'hemi']; + for(let i = 0; i < lights.length; i++) { + this.light.place(lights[i]); + } + + // Place geo + this.geometry = new Geometry(this.scene); + this.geometry.make('plane')(100, 100, 10, 10); + this.geometry.place([0, -20, 0], [Math.PI/2, 0, 0]); + + // Set up stats if dev + if(Config.isDev) { + bS = new BrowserStats(); + glS = new glStats(); + tS = new threeStats(this.renderer.threeRenderer); + + rS = new rStats({ + CSSPath: '/assets/css/', + userTimingAPI: true, + values: { + frame: { caption: 'Total frame time (ms)', over: 16, average: true, avgMs: 100 }, + fps: { caption: 'Framerate (FPS)', below: 30 }, + calls: { caption: 'Calls (three.js)', over: 3000 }, + raf: { caption: 'Time since last rAF (ms)', average: true, avgMs: 100 }, + rstats: { caption: 'rStats update (ms)', average: true, avgMs: 100 }, + texture: { caption: 'GenTex', average: true, avgMs: 100 } + }, + groups: [ + { caption: 'Framerate', values: [ 'fps', 'raf' ] }, + { caption: 'Frame Budget', values: [ 'frame', 'texture', 'setup', 'render' ] } + ], + fractions: [ + { base: 'frame', steps: [ 'texture', 'setup', 'render' ] } + ], + plugins: [bS, tS, glS] + }); + } + + this.texture = new Texture(); + // Start loading the textures + this.texture.load().then(() => { + this.manager = new THREE.LoadingManager(); + // Textures loaded, load main model + this.model = new Model(this.scene, this.manager, this.texture.textures); + this.model.load(); + + // onProgress + this.manager.onProgress = (item, loaded, total) => { + console.log(`${item}: ${loaded} ${total}`); + }; + + // All loaders done + this.manager.onLoad = () => { + // Set up interaction with app + new Interaction(this.renderer.threeRenderer, this.scene, this.camera.threeCamera, this.controls.threeControls); + + if(Config.isDev) { + new GUI(this, this.model.obj); + } + + Config.isLoaded = true; + }; + }); + + this.render(); + } + + render() { + const delta = this.clock.getDelta(); + + if(Config.isDev) { + rS('frame').start(); + glS.start(); + + rS('rAF').tick(); + rS('FPS').frame(); + + rS('render').start(); + } + + // Clear renderer + this.renderer.threeRenderer.clear(); + this.renderer.render(this.scene, this.camera.threeCamera); + + if(Config.isDev) { + rS('render').end(); + rS('frame').end(); + + rS('rStats').start(); + rS().update(); + rS('rStats').end(); + } + + // Updates + TWEEN.update(); + this.controls.threeControls.update(); + + // raf + requestAnimationFrame(this.render.bind(this)); + } +} diff --git a/src/js/app/material.js b/src/js/app/material.js new file mode 100644 index 0000000..f78e6af --- /dev/null +++ b/src/js/app/material.js @@ -0,0 +1,24 @@ +import THREE from 'three'; + +import Config from './../data/config'; + +export default class Material { + constructor() { + this.emissive = new THREE.MeshBasicMaterial({ + color: 0xeeeeee, + side: THREE.DoubleSide, + fog: false + }); + + this.standard = new THREE.MeshStandardMaterial({ + shading: THREE.FlatShading, + roughness: 1, + metalness: 0, + side: THREE.DoubleSide, + fog: false + }); + + this.wire = new THREE.MeshBasicMaterial({wireframe: true}); + } +} + diff --git a/src/js/app/model.js b/src/js/app/model.js new file mode 100644 index 0000000..16b2e6d --- /dev/null +++ b/src/js/app/model.js @@ -0,0 +1,57 @@ +import THREE from 'three'; + +import Material from './material'; +import Helper from './helper'; +import Config from './../data/config'; + +export default class Model { + constructor(scene, manager, textures) { + this.scene = scene; + this.textures = textures; + + this.loader = new THREE.ObjectLoader(manager); + this.obj = null; + } + + load() { + // load a resource + this.loader.load(Config.model.path, (obj) => { + obj.traverse((child) => { + if(child instanceof THREE.Mesh) { + let material = new Material().standard; + material.map = this.textures.UV; + child.material = material; + + if(Config.shadow.enabled) { + child.receiveShadow = true; + child.castShadow = true; + } + } + }); + + if(Config.isDev && Config.mesh.enableHelper) { + new Helper(this.scene, obj); + } + + // set prop to obj + this.obj = obj; + + obj.scale.multiplyScalar(Config.model.scale); + + // add object to scene + this.scene.add(obj); + }, Model.onProgress, Model.onError); + } + + static onProgress(xhr) { + if(xhr.lengthComputable) { + let percentComplete = xhr.loaded / xhr.total * 100; + + console.log(Math.round(percentComplete, 2) + '% downloaded'); + } + }; + + static onError(xhr) { + console.error(xhr); + }; +} diff --git a/src/js/app/renderer.js b/src/js/app/renderer.js new file mode 100644 index 0000000..04668ac --- /dev/null +++ b/src/js/app/renderer.js @@ -0,0 +1,44 @@ +import THREE from 'three'; + +import Config from './../data/config'; + +export default class Renderer { + constructor(container, scene) { + this.container = container; + this.scene = scene; + + this.threeRenderer = new THREE.WebGLRenderer({antialias: true}); + + //this.renderer.setClearColor(0x000000, 0); + this.threeRenderer.setClearColor(scene.fog.color); + this.threeRenderer.setPixelRatio(window.devicePixelRatio); + + container.appendChild(this.threeRenderer.domElement); + + this.threeRenderer.gammaInput = true; + this.threeRenderer.gammaOutput = true; + + // shadow + this.threeRenderer.shadowMap.enabled = true; + this.threeRenderer.shadowMap.type = THREE.PCFSoftShadowMap; + this.threeRenderer.shadowMapSoft = true; + + this.threeRenderer.autoClear = false; + + Config.maxAnisotropy = this.threeRenderer.getMaxAnisotropy(); + + this.updateSize(); + + // Listeners + document.addEventListener('DOMContentLoaded', () => this.updateSize(), false); + window.addEventListener('resize', () => this.updateSize(), false); + } + + updateSize() { + this.threeRenderer.setSize(this.container.offsetWidth, this.container.offsetHeight); + } + + render(scene, camera) { + this.threeRenderer.render(scene, camera); + } +} diff --git a/src/js/app/texture.js b/src/js/app/texture.js new file mode 100644 index 0000000..2eb31fa --- /dev/null +++ b/src/js/app/texture.js @@ -0,0 +1,48 @@ +import THREE from 'three'; +import { Promise } from 'es6-promise'; + +import Config from './../data/config'; + +export default class Texture { + constructor() { + this.textures = {}; + } + + load() { + const loader = new THREE.TextureLoader(); + const maxAnisotropy = Config.maxAnisotropy; + const imageFiles = Config.texture.imageFiles; + + let promiseArray = []; + + loader.setPath(Config.texture.path); + + imageFiles.forEach((imageFile) => { + promiseArray.push(new Promise((resolve, reject) => { + loader.load(imageFile.image, + + function(texture) { + texture.anisotropy = maxAnisotropy; + + var modelOBJ = {}; + modelOBJ[imageFile.name] = texture; + if(modelOBJ[imageFile.name] instanceof THREE.Texture) + resolve(modelOBJ); + }, + function(xhr) { + console.log(( xhr.loaded / xhr.total * 100 ) + '% loaded'); + }, + function(xhr) { + reject(new Error(xhr + 'An error occurred loading while loading ' + imageFile.image)); + } + ) + })); + }); + + return Promise.all(promiseArray).then((textures) => { + for(var i = 0; i < textures.length; i++) { + this.textures[Object.keys(textures[i])[0]] = textures[i][Object.keys(textures[i])[0]]; + } + }); + } +} diff --git a/src/js/data/config.js b/src/js/data/config.js new file mode 100644 index 0000000..91f49af --- /dev/null +++ b/src/js/data/config.js @@ -0,0 +1,109 @@ +import TWEEN from 'tween.js'; + +export default { + isDev: false, + isLoaded: false, + isTweening: false, + isRotating: true, + isMouseMoving: false, + isMouseOver: false, + maxAnisotropy: 1, + dpr: 1, + easing: TWEEN.Easing.Quadratic.InOut, + duration: 500, + model: { + path: '/assets/models/teapot-claraio.json', + scale: 20 + }, + texture: { + path: '/assets/textures/', + imageFiles: [ + {name: 'UV', image: 'UV_Grid_Sm.jpg'} + ] + }, + mesh: { + enableHelper: false, + wireframe: false, + translucent: false, + material: { + color: 0xffffff, + emissive: 0xffffff + } + }, + fog: { + color: 0xffffff, + near: 0.0008 + }, + camera: { + fov: 40, + near: 2, + far: 1000, + aspect: 1, + posX: 0, + posY: 30, + posZ: 40 + }, + controls: { + autoRotate: true, + autoRotateSpeed: -0.5, + rotateSpeed: 0.5, + zoomSpeed: 0.8, + minDistance: 200, + maxDistance: 600, + minPolarAngle: Math.PI / 5, + maxPolarAngle: Math.PI / 2, + minAzimuthAngle: -Infinity, + maxAzimuthAngle: Infinity, + enableDamping: true, + dampingFactor: 0.5, + enableZoom: true, + target: { + x: 0, + y: 0, + z: 0 + } + }, + ambientLight: { + enabled: false, + color: 0x141414 + }, + directionalLight: { + enabled: true, + color: 0xf0f0f0, + intensity: 0.4, + x: -75, + y: 280, + z: 150 + }, + shadow: { + enabled: true, + helperEnabled: true, + bias: -0.00025, + mapWidth: 1024, + mapHeight: 1024, + near: 200, + far: 400, + top: 150, + right: 150, + bottom: -150, + left: -150 + }, + pointLight: { + enabled: true, + color: 0xffffff, + intensity: 0.34, + distance: 115, + x: 0, + y: 0, + z: 0 + }, + hemiLight: { + enabled: true, + color: 0xc8c8c8, + groundColor: 0xffffff, + intensity: 0.3, + x: -275, + y: 145, + z: 0 + } +}; diff --git a/src/js/utils/detector.js b/src/js/utils/detector.js new file mode 100644 index 0000000..5dd1afd --- /dev/null +++ b/src/js/utils/detector.js @@ -0,0 +1,71 @@ +/** + * @author alteredq / http://alteredqualia.com/ + * @author mr.doob / http://mrdoob.com/ + */ + +export default { + + canvas: !!window.CanvasRenderingContext2D, + webgl: (function() { + + try { + + var canvas = document.createElement('canvas'); + return !!( window.WebGLRenderingContext && ( canvas.getContext('webgl') || canvas.getContext('experimental-webgl') ) ); + + } catch(e) { + + return false; + + } + })(), + workers: !!window.Worker, + fileapi: window.File && window.FileReader && window.FileList && window.Blob, + + getWebGLErrorMessage: function() { + + var element = document.createElement('div'); + element.id = 'webgl-error-message'; + element.style.fontFamily = 'monospace'; + element.style.fontSize = '13px'; + element.style.fontWeight = 'normal'; + element.style.textAlign = 'center'; + element.style.background = '#fff'; + element.style.color = '#000'; + element.style.padding = '1.5em'; + element.style.width = '400px'; + element.style.margin = '5em auto 0'; + + if(!this.webgl) { + + element.innerHTML = window.WebGLRenderingContext ? [ + 'Your graphics card does not seem to support WebGL.
    ', + 'Find out how to get it here.' + ].join('\n') : [ + 'Your browser does not seem to support WebGL.
    ', + 'Find out how to get it here.' + ].join('\n'); + + } + + return element; + + }, + + addGetWebGLMessage: function(parameters) { + + var parent, id, element; + + parameters = parameters || {}; + + parent = parameters.parent !== undefined ? parameters.parent : document.body; + id = parameters.id !== undefined ? parameters.id : 'oldie'; + + element = this.getWebGLErrorMessage(); + element.id = id; + + parent.appendChild(element); + + } + +}; diff --git a/src/js/utils/helpers.js b/src/js/utils/helpers.js new file mode 100644 index 0000000..8716719 --- /dev/null +++ b/src/js/utils/helpers.js @@ -0,0 +1,26 @@ +export default class Helpers { + static throttle(fn, threshhold, scope) { + threshhold || (threshhold = 250); + var last, deferTimer; + + return function() { + var context = scope || this; + + var now = +new Date, + args = arguments; + + if(last && now < last + threshhold) { + // hold on to it + clearTimeout(deferTimer); + deferTimer = setTimeout(function() { + last = now; + fn.apply(context, args); + }, threshhold); + } + else { + last = now; + fn.apply(context, args); + } + }; + } +} diff --git a/src/js/utils/keyboard.js b/src/js/utils/keyboard.js new file mode 100644 index 0000000..f786447 --- /dev/null +++ b/src/js/utils/keyboard.js @@ -0,0 +1,93 @@ +const ALIAS = { + 'left' : 37, + 'up' : 38, + 'right' : 39, + 'down' : 40, + 'space' : 32, + 'pageup' : 33, + 'pagedown': 34, + 'tab' : 9, + 'escape' : 27 +}; + +export default class Keyboard { + constructor(domElement) { + this.domElement = domElement || document; + this.keyCodes = {}; + + // bind keyEvents + this.domElement.addEventListener('keydown', () => this.onKeyChange(event), false); + this.domElement.addEventListener('keyup', () => this.onKeyChange(event), false); + + // bind window blur + window.addEventListener('blur', () => this.onBlur, false); + } + + destroy() { + this.domElement.removeEventListener('keydown', () => this.onKeyChange(event), false); + this.domElement.removeEventListener('keyup', () => this.onKeyChange(event), false); + + // unbind window blur event + window.removeEventListener('blur', () => this.onBlur, false); + } + + onBlur() { + for(let prop in this.keyCodes) + this.keyCodes[prop] = false; + } + + onKeyChange(event) { + // log to debug + //console.log('onKeyChange', event, event.keyCode, event.shiftKey, event.ctrlKey, event.altKey, event.metaKey) + + // update this.keyCodes + let keyCode = event.keyCode; + this.keyCodes[keyCode] = event.type === 'keydown'; + } + + pressed(keyDesc) { + let keys = keyDesc.split('+'); + for(let i = 0; i < keys.length; i++) { + let key = keys[i]; + let pressed = false; + if(Object.keys(ALIAS).indexOf(key) != -1) { + pressed = this.keyCodes[ALIAS[key]]; + } else { + pressed = this.keyCodes[key.toUpperCase().charCodeAt(0)]; + } + if(!pressed) + return false; + } + + return true; + } + + eventMatches(event, keyDesc) { + let aliases = ALIAS; + let aliasKeys = Object.keys(aliases); + let keys = keyDesc.split('+'); + // log to debug + // console.log('eventMatches', event, event.keyCode, event.shiftKey, event.ctrlKey, event.altKey, event.metaKey) + for(let i = 0; i < keys.length; i++) { + let key = keys[i]; + let pressed = false; + if(key === 'shift') { + pressed = (event.shiftKey ? true : false); + } else if(key === 'ctrl') { + pressed = (event.ctrlKey ? true : false); + } else if(key === 'alt') { + pressed = (event.altKey ? true : false); + } else if(key === 'meta') { + pressed = (event.metaKey ? true : false); + } else if(aliasKeys.indexOf(key) !== -1) { + pressed = (event.keyCode === aliases[key]); + } else if(event.keyCode === key.toUpperCase().charCodeAt(0)) { + pressed = true; + } + if(!pressed) + return false; + } + + return true; + } +} diff --git a/src/js/utils/orbitControls.js b/src/js/utils/orbitControls.js new file mode 100644 index 0000000..34612a2 --- /dev/null +++ b/src/js/utils/orbitControls.js @@ -0,0 +1,1119 @@ +module.exports = function(THREE) { + var MOUSE = THREE.MOUSE + if (!MOUSE) + MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 }; + + /** + * @author qiao / https://github.com/qiao + * @author mrdoob / http://mrdoob.com + * @author alteredq / http://alteredqualia.com/ + * @author WestLangley / http://github.com/WestLangley + * @author erich666 / http://erichaines.com + */ + /*global THREE, console */ + + function OrbitConstraint ( object ) { + + this.object = object; + + // "target" sets the location of focus, where the object orbits around + // and where it pans with respect to. + this.target = new THREE.Vector3(); + + // Limits to how far you can dolly in and out ( PerspectiveCamera only ) + this.minDistance = 0; + this.maxDistance = Infinity; + + // Limits to how far you can zoom in and out ( OrthographicCamera only ) + this.minZoom = 0; + this.maxZoom = Infinity; + + // How far you can orbit vertically, upper and lower limits. + // Range is 0 to Math.PI radians. + this.minPolarAngle = 0; // radians + this.maxPolarAngle = Math.PI; // radians + + // How far you can orbit horizontally, upper and lower limits. + // If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ]. + this.minAzimuthAngle = - Infinity; // radians + this.maxAzimuthAngle = Infinity; // radians + + // Set to true to enable damping (inertia) + // If damping is enabled, you must call controls.update() in your animation loop + this.enableDamping = false; + this.dampingFactor = 0.25; + + //////////// + // internals + + var scope = this; + + var EPS = 0.000001; + + // Current position in spherical coordinate system. + var theta; + var phi; + + // Pending changes + var phiDelta = 0; + var thetaDelta = 0; + var scale = 1; + var panOffset = new THREE.Vector3(); + var zoomChanged = false; + + // API + + this.getPolarAngle = function () { + + return phi; + + }; + + this.getAzimuthalAngle = function () { + + return theta; + + }; + + this.rotateLeft = function ( angle ) { + + thetaDelta -= angle; + + }; + + this.rotateUp = function ( angle ) { + + phiDelta -= angle; + + }; + + // pass in distance in world space to move left + this.panLeft = function() { + + var v = new THREE.Vector3(); + + return function panLeft ( distance ) { + + var te = this.object.matrix.elements; + + // get X column of matrix + v.set( te[ 0 ], te[ 1 ], te[ 2 ] ); + v.multiplyScalar( - distance ); + + panOffset.add( v ); + + }; + + }(); + + // pass in distance in world space to move up + this.panUp = function() { + + var v = new THREE.Vector3(); + + return function panUp ( distance ) { + + var te = this.object.matrix.elements; + + // get Y column of matrix + v.set( te[ 4 ], te[ 5 ], te[ 6 ] ); + v.multiplyScalar( distance ); + + panOffset.add( v ); + + }; + + }(); + + // pass in x,y of change desired in pixel space, + // right and down are positive + this.pan = function ( deltaX, deltaY, screenWidth, screenHeight ) { + + if ( scope.object instanceof THREE.PerspectiveCamera ) { + + // perspective + var position = scope.object.position; + var offset = position.clone().sub( scope.target ); + var targetDistance = offset.length(); + + // half of the fov is center to top of screen + targetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 ); + + // we actually don't use screenWidth, since perspective camera is fixed to screen height + scope.panLeft( 2 * deltaX * targetDistance / screenHeight ); + scope.panUp( 2 * deltaY * targetDistance / screenHeight ); + + } else if ( scope.object instanceof THREE.OrthographicCamera ) { + + // orthographic + scope.panLeft( deltaX * ( scope.object.right - scope.object.left ) / screenWidth ); + scope.panUp( deltaY * ( scope.object.top - scope.object.bottom ) / screenHeight ); + + } else { + + // camera neither orthographic or perspective + console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' ); + + } + + }; + + this.dollyIn = function ( dollyScale ) { + + if ( scope.object instanceof THREE.PerspectiveCamera ) { + + scale /= dollyScale; + + } else if ( scope.object instanceof THREE.OrthographicCamera ) { + + scope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom * dollyScale ) ); + scope.object.updateProjectionMatrix(); + zoomChanged = true; + + } else { + + console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' ); + + } + + }; + + this.dollyOut = function ( dollyScale ) { + + if ( scope.object instanceof THREE.PerspectiveCamera ) { + + scale *= dollyScale; + + } else if ( scope.object instanceof THREE.OrthographicCamera ) { + + scope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / dollyScale ) ); + scope.object.updateProjectionMatrix(); + zoomChanged = true; + + } else { + + console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' ); + + } + + }; + + this.update = function() { + + var offset = new THREE.Vector3(); + + // so camera.up is the orbit axis + var quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) ); + var quatInverse = quat.clone().inverse(); + + var lastPosition = new THREE.Vector3(); + var lastQuaternion = new THREE.Quaternion(); + + return function () { + + var position = this.object.position; + + offset.copy( position ).sub( this.target ); + + // rotate offset to "y-axis-is-up" space + offset.applyQuaternion( quat ); + + // angle from z-axis around y-axis + + theta = Math.atan2( offset.x, offset.z ); + + // angle from y-axis + + phi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y ); + + theta += thetaDelta; + phi += phiDelta; + + // restrict theta to be between desired limits + theta = Math.max( this.minAzimuthAngle, Math.min( this.maxAzimuthAngle, theta ) ); + + // restrict phi to be between desired limits + phi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) ); + + // restrict phi to be betwee EPS and PI-EPS + phi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) ); + + var radius = offset.length() * scale; + + // restrict radius to be between desired limits + radius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) ); + + // move target to panned location + this.target.add( panOffset ); + + offset.x = radius * Math.sin( phi ) * Math.sin( theta ); + offset.y = radius * Math.cos( phi ); + offset.z = radius * Math.sin( phi ) * Math.cos( theta ); + + // rotate offset back to "camera-up-vector-is-up" space + offset.applyQuaternion( quatInverse ); + + position.copy( this.target ).add( offset ); + + this.object.lookAt( this.target ); + + if ( this.enableDamping === true ) { + + thetaDelta *= ( 1 - this.dampingFactor ); + phiDelta *= ( 1 - this.dampingFactor ); + + } else { + + thetaDelta = 0; + phiDelta = 0; + + } + + scale = 1; + panOffset.set( 0, 0, 0 ); + + // update condition is: + // min(camera displacement, camera rotation in radians)^2 > EPS + // using small-angle approximation cos(x/2) = 1 - x^2 / 8 + + if ( zoomChanged || + lastPosition.distanceToSquared( this.object.position ) > EPS || + 8 * ( 1 - lastQuaternion.dot( this.object.quaternion ) ) > EPS ) { + + lastPosition.copy( this.object.position ); + lastQuaternion.copy( this.object.quaternion ); + zoomChanged = false; + + return true; + + } + + return false; + + }; + + }(); + + }; + + + // This set of controls performs orbiting, dollying (zooming), and panning. It maintains + // the "up" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is + // supported. + // + // Orbit - left mouse / touch: one finger move + // Zoom - middle mouse, or mousewheel / touch: two finger spread or squish + // Pan - right mouse, or arrow keys / touch: three finter swipe + + function OrbitControls ( object, domElement ) { + + var constraint = new OrbitConstraint( object ); + + this.domElement = ( domElement !== undefined ) ? domElement : document; + + // API + + Object.defineProperty( this, 'constraint', { + + get: function() { + + return constraint; + + } + + } ); + + this.getPolarAngle = function () { + + return constraint.getPolarAngle(); + + }; + + this.getAzimuthalAngle = function () { + + return constraint.getAzimuthalAngle(); + + }; + + // Set to false to disable this control + this.enabled = true; + + // center is old, deprecated; use "target" instead + this.center = this.target; + + // This option actually enables dollying in and out; left as "zoom" for + // backwards compatibility. + // Set to false to disable zooming + this.enableZoom = true; + this.zoomSpeed = 1.0; + + // Set to false to disable rotating + this.enableRotate = true; + this.rotateSpeed = 1.0; + + // Set to false to disable panning + this.enablePan = true; + this.keyPanSpeed = 7.0; // pixels moved per arrow key push + + // Set to true to automatically rotate around the target + // If auto-rotate is enabled, you must call controls.update() in your animation loop + this.autoRotate = false; + this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60 + + // Set to false to disable use of the keys + this.enableKeys = true; + + // The four arrow keys + this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 }; + + // Mouse buttons + this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT }; + + //////////// + // internals + + var scope = this; + + var rotateStart = new THREE.Vector2(); + var rotateEnd = new THREE.Vector2(); + var rotateDelta = new THREE.Vector2(); + + var panStart = new THREE.Vector2(); + var panEnd = new THREE.Vector2(); + var panDelta = new THREE.Vector2(); + + var dollyStart = new THREE.Vector2(); + var dollyEnd = new THREE.Vector2(); + var dollyDelta = new THREE.Vector2(); + + var STATE = { NONE : - 1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 }; + + var state = STATE.NONE; + + // for reset + + this.target0 = this.target.clone(); + this.position0 = this.object.position.clone(); + this.zoom0 = this.object.zoom; + + // events + + var changeEvent = { type: 'change' }; + var startEvent = { type: 'start' }; + var endEvent = { type: 'end' }; + + // pass in x,y of change desired in pixel space, + // right and down are positive + function pan( deltaX, deltaY ) { + + var element = scope.domElement === document ? scope.domElement.body : scope.domElement; + + constraint.pan( deltaX, deltaY, element.clientWidth, element.clientHeight ); + + } + + this.update = function () { + + if ( this.autoRotate && state === STATE.NONE ) { + + constraint.rotateLeft( getAutoRotationAngle() ); + + } + + if ( constraint.update() === true ) { + + this.dispatchEvent( changeEvent ); + + } + + }; + + this.reset = function () { + + state = STATE.NONE; + + this.target.copy( this.target0 ); + this.object.position.copy( this.position0 ); + this.object.zoom = this.zoom0; + + this.object.updateProjectionMatrix(); + this.dispatchEvent( changeEvent ); + + this.update(); + + }; + + function getAutoRotationAngle() { + + return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed; + + } + + function getZoomScale() { + + return Math.pow( 0.95, scope.zoomSpeed ); + + } + + function onMouseDown( event ) { + + if ( scope.enabled === false ) return; + + event.preventDefault(); + + if ( event.button === scope.mouseButtons.ORBIT ) { + + if ( scope.enableRotate === false ) return; + + state = STATE.ROTATE; + + rotateStart.set( event.clientX, event.clientY ); + + } else if ( event.button === scope.mouseButtons.ZOOM ) { + + if ( scope.enableZoom === false ) return; + + state = STATE.DOLLY; + + dollyStart.set( event.clientX, event.clientY ); + + } else if ( event.button === scope.mouseButtons.PAN ) { + + if ( scope.enablePan === false ) return; + + state = STATE.PAN; + + panStart.set( event.clientX, event.clientY ); + + } + + if ( state !== STATE.NONE ) { + + document.addEventListener( 'mousemove', onMouseMove, false ); + document.addEventListener( 'mouseup', onMouseUp, false ); + scope.dispatchEvent( startEvent ); + + } + + } + + function onMouseMove( event ) { + + if ( scope.enabled === false ) return; + + event.preventDefault(); + + var element = scope.domElement === document ? scope.domElement.body : scope.domElement; + + if ( state === STATE.ROTATE ) { + + if ( scope.enableRotate === false ) return; + + rotateEnd.set( event.clientX, event.clientY ); + rotateDelta.subVectors( rotateEnd, rotateStart ); + + // rotating across whole screen goes 360 degrees around + constraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed ); + + // rotating up and down along whole screen attempts to go 360, but limited to 180 + constraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed ); + + rotateStart.copy( rotateEnd ); + + } else if ( state === STATE.DOLLY ) { + + if ( scope.enableZoom === false ) return; + + dollyEnd.set( event.clientX, event.clientY ); + dollyDelta.subVectors( dollyEnd, dollyStart ); + + if ( dollyDelta.y > 0 ) { + + constraint.dollyIn( getZoomScale() ); + + } else if ( dollyDelta.y < 0 ) { + + constraint.dollyOut( getZoomScale() ); + + } + + dollyStart.copy( dollyEnd ); + + } else if ( state === STATE.PAN ) { + + if ( scope.enablePan === false ) return; + + panEnd.set( event.clientX, event.clientY ); + panDelta.subVectors( panEnd, panStart ); + + pan( panDelta.x, panDelta.y ); + + panStart.copy( panEnd ); + + } + + if ( state !== STATE.NONE ) scope.update(); + + } + + function onMouseUp( /* event */ ) { + + if ( scope.enabled === false ) return; + + document.removeEventListener( 'mousemove', onMouseMove, false ); + document.removeEventListener( 'mouseup', onMouseUp, false ); + scope.dispatchEvent( endEvent ); + state = STATE.NONE; + + } + + function onMouseWheel( event ) { + + if ( scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE ) return; + + event.preventDefault(); + event.stopPropagation(); + + var delta = 0; + + if ( event.wheelDelta !== undefined ) { + + // WebKit / Opera / Explorer 9 + + delta = event.wheelDelta; + + } else if ( event.detail !== undefined ) { + + // Firefox + + delta = - event.detail; + + } + + if ( delta > 0 ) { + + constraint.dollyOut( getZoomScale() ); + + } else if ( delta < 0 ) { + + constraint.dollyIn( getZoomScale() ); + + } + + scope.update(); + scope.dispatchEvent( startEvent ); + scope.dispatchEvent( endEvent ); + + } + + function onKeyDown( event ) { + + if ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return; + + switch ( event.keyCode ) { + + case scope.keys.UP: + pan( 0, scope.keyPanSpeed ); + scope.update(); + break; + + case scope.keys.BOTTOM: + pan( 0, - scope.keyPanSpeed ); + scope.update(); + break; + + case scope.keys.LEFT: + pan( scope.keyPanSpeed, 0 ); + scope.update(); + break; + + case scope.keys.RIGHT: + pan( - scope.keyPanSpeed, 0 ); + scope.update(); + break; + + } + + } + + function touchstart( event ) { + + if ( scope.enabled === false ) return; + + switch ( event.touches.length ) { + + case 1: // one-fingered touch: rotate + + if ( scope.enableRotate === false ) return; + + state = STATE.TOUCH_ROTATE; + + rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + break; + + case 2: // two-fingered touch: dolly + + if ( scope.enableZoom === false ) return; + + state = STATE.TOUCH_DOLLY; + + var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; + var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; + var distance = Math.sqrt( dx * dx + dy * dy ); + dollyStart.set( 0, distance ); + break; + + case 3: // three-fingered touch: pan + + if ( scope.enablePan === false ) return; + + state = STATE.TOUCH_PAN; + + panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + break; + + default: + + state = STATE.NONE; + + } + + if ( state !== STATE.NONE ) scope.dispatchEvent( startEvent ); + + } + + function touchmove( event ) { + + if ( scope.enabled === false ) return; + + event.preventDefault(); + event.stopPropagation(); + + var element = scope.domElement === document ? scope.domElement.body : scope.domElement; + + switch ( event.touches.length ) { + + case 1: // one-fingered touch: rotate + + if ( scope.enableRotate === false ) return; + if ( state !== STATE.TOUCH_ROTATE ) return; + + rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + rotateDelta.subVectors( rotateEnd, rotateStart ); + + // rotating across whole screen goes 360 degrees around + constraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed ); + // rotating up and down along whole screen attempts to go 360, but limited to 180 + constraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed ); + + rotateStart.copy( rotateEnd ); + + scope.update(); + break; + + case 2: // two-fingered touch: dolly + + if ( scope.enableZoom === false ) return; + if ( state !== STATE.TOUCH_DOLLY ) return; + + var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; + var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; + var distance = Math.sqrt( dx * dx + dy * dy ); + + dollyEnd.set( 0, distance ); + dollyDelta.subVectors( dollyEnd, dollyStart ); + + if ( dollyDelta.y > 0 ) { + + constraint.dollyOut( getZoomScale() ); + + } else if ( dollyDelta.y < 0 ) { + + constraint.dollyIn( getZoomScale() ); + + } + + dollyStart.copy( dollyEnd ); + + scope.update(); + break; + + case 3: // three-fingered touch: pan + + if ( scope.enablePan === false ) return; + if ( state !== STATE.TOUCH_PAN ) return; + + panEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); + panDelta.subVectors( panEnd, panStart ); + + pan( panDelta.x, panDelta.y ); + + panStart.copy( panEnd ); + + scope.update(); + break; + + default: + + state = STATE.NONE; + + } + + } + + function touchend( /* event */ ) { + + if ( scope.enabled === false ) return; + + scope.dispatchEvent( endEvent ); + state = STATE.NONE; + + } + + function contextmenu( event ) { + + event.preventDefault(); + + } + + this.dispose = function() { + + this.domElement.removeEventListener( 'contextmenu', contextmenu, false ); + this.domElement.removeEventListener( 'mousedown', onMouseDown, false ); + this.domElement.removeEventListener( 'mousewheel', onMouseWheel, false ); + this.domElement.removeEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox + + this.domElement.removeEventListener( 'touchstart', touchstart, false ); + this.domElement.removeEventListener( 'touchend', touchend, false ); + this.domElement.removeEventListener( 'touchmove', touchmove, false ); + + document.removeEventListener( 'mousemove', onMouseMove, false ); + document.removeEventListener( 'mouseup', onMouseUp, false ); + + window.removeEventListener( 'keydown', onKeyDown, false ); + + } + + this.domElement.addEventListener( 'contextmenu', contextmenu, false ); + + this.domElement.addEventListener( 'mousedown', onMouseDown, false ); + this.domElement.addEventListener( 'mousewheel', onMouseWheel, false ); + this.domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox + + this.domElement.addEventListener( 'touchstart', touchstart, false ); + this.domElement.addEventListener( 'touchend', touchend, false ); + this.domElement.addEventListener( 'touchmove', touchmove, false ); + + window.addEventListener( 'keydown', onKeyDown, false ); + + // force an update at start + this.update(); + + }; + + OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype ); + OrbitControls.prototype.constructor = OrbitControls; + + Object.defineProperties( OrbitControls.prototype, { + + object: { + + get: function () { + + return this.constraint.object; + + } + + }, + + target: { + + get: function () { + + return this.constraint.target; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: target is now immutable. Use target.set() instead.' ); + this.constraint.target.copy( value ); + + } + + }, + + minDistance : { + + get: function () { + + return this.constraint.minDistance; + + }, + + set: function ( value ) { + + this.constraint.minDistance = value; + + } + + }, + + maxDistance : { + + get: function () { + + return this.constraint.maxDistance; + + }, + + set: function ( value ) { + + this.constraint.maxDistance = value; + + } + + }, + + minZoom : { + + get: function () { + + return this.constraint.minZoom; + + }, + + set: function ( value ) { + + this.constraint.minZoom = value; + + } + + }, + + maxZoom : { + + get: function () { + + return this.constraint.maxZoom; + + }, + + set: function ( value ) { + + this.constraint.maxZoom = value; + + } + + }, + + minPolarAngle : { + + get: function () { + + return this.constraint.minPolarAngle; + + }, + + set: function ( value ) { + + this.constraint.minPolarAngle = value; + + } + + }, + + maxPolarAngle : { + + get: function () { + + return this.constraint.maxPolarAngle; + + }, + + set: function ( value ) { + + this.constraint.maxPolarAngle = value; + + } + + }, + + minAzimuthAngle : { + + get: function () { + + return this.constraint.minAzimuthAngle; + + }, + + set: function ( value ) { + + this.constraint.minAzimuthAngle = value; + + } + + }, + + maxAzimuthAngle : { + + get: function () { + + return this.constraint.maxAzimuthAngle; + + }, + + set: function ( value ) { + + this.constraint.maxAzimuthAngle = value; + + } + + }, + + enableDamping : { + + get: function () { + + return this.constraint.enableDamping; + + }, + + set: function ( value ) { + + this.constraint.enableDamping = value; + + } + + }, + + dampingFactor : { + + get: function () { + + return this.constraint.dampingFactor; + + }, + + set: function ( value ) { + + this.constraint.dampingFactor = value; + + } + + }, + + // backward compatibility + + noZoom: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' ); + return ! this.enableZoom; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' ); + this.enableZoom = ! value; + + } + + }, + + noRotate: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' ); + return ! this.enableRotate; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' ); + this.enableRotate = ! value; + + } + + }, + + noPan: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' ); + return ! this.enablePan; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' ); + this.enablePan = ! value; + + } + + }, + + noKeys: { + + get: function () { + + console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' ); + return ! this.enableKeys; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' ); + this.enableKeys = ! value; + + } + + }, + + staticMoving : { + + get: function () { + + console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' ); + return ! this.constraint.enableDamping; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' ); + this.constraint.enableDamping = ! value; + + } + + }, + + dynamicDampingFactor : { + + get: function () { + + console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' ); + return this.constraint.dampingFactor; + + }, + + set: function ( value ) { + + console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' ); + this.constraint.dampingFactor = value; + + } + + } + + } ); + + return OrbitControls; +} diff --git a/src/public/assets/css/app.css b/src/public/assets/css/app.css new file mode 100644 index 0000000..e2d0dab --- /dev/null +++ b/src/public/assets/css/app.css @@ -0,0 +1,4 @@ +.main { + width: 100%; + height: 100vh; +} diff --git a/src/public/assets/css/rStats.css b/src/public/assets/css/rStats.css new file mode 100644 index 0000000..ccda851 --- /dev/null +++ b/src/public/assets/css/rStats.css @@ -0,0 +1,73 @@ +.rs-base{ + position: absolute; + z-index: 10000; + padding: 10px; + background-color: #222; + font-size: 10px; + line-height: 1.2em; + width: 350px; + font-family: 'Roboto Condensed', tahoma, sans-serif; + left: 0; + top: 0; + overflow: hidden; +} + +.rs-base h1{ + margin: 0; + padding: 0; + font-size: 1.4em; + color: #fff; + margin-bottom: 5px; + cursor: pointer; +} + +.rs-base div.rs-group{ + margin-bottom: 10px; +} + +.rs-base div.rs-group.hidden{ + display: none; +} + +.rs-base div.rs-fraction{ + position: relative; + margin-bottom: 5px; +} + +.rs-base div.rs-fraction p{ + width: 120px; + text-align: right; + margin: 0; + padding: 0; +} + +.rs-base div.rs-legend{ + position: absolute; + line-height: 1em; +} + +.rs-base div.rs-counter-base{ + position: relative; + margin: 2px 0; + height: 1em; +} + +.rs-base span.rs-counter-id{ + position: absolute; + left: 0; + top: 0; +} + +.rs-base div.rs-counter-value{ + position: absolute; + left: 90px; + width: 30px; + height: 1em; + top: 0; + text-align: right; +} + +.rs-base canvas.rs-canvas{ + position: absolute; + right: 0; +} diff --git a/src/public/assets/js/app.js b/src/public/assets/js/app.js new file mode 100644 index 0000000..0914eb0 --- /dev/null +++ b/src/public/assets/js/app.js @@ -0,0 +1,200 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "assets/js"; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + eval("module.exports = __webpack_require__(1);\n\n\n/*****************\n ** WEBPACK FOOTER\n ** multi main\n ** module id = 0\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///multi_main?"); + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nvar _detector = __webpack_require__(4);\n\nvar _detector2 = _interopRequireDefault(_detector);\n\nvar _main = __webpack_require__(5);\n\nvar _main2 = _interopRequireDefault(_main);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// verify environment.\nif (true) {\n console.log('----- RUNNING IN DEV ENVIRONMENT! -----');\n\n _config2.default.isDev = true;\n}\n\nfunction init() {\n if (!_detector2.default.webgl) {\n _detector2.default.addGetWebGLMessage();\n } else {\n var container = document.getElementById('appContainer');\n new _main2.default(container);\n }\n}\n\nwindow.onload = init;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app.js\n ** module id = 1\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app.js?"); + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _tween = __webpack_require__(3);\n\nvar _tween2 = _interopRequireDefault(_tween);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = {\n isDev: false,\n isLoaded: false,\n isTweening: false,\n isRotating: true,\n isMouseMoving: false,\n isMouseOver: false,\n maxAnisotropy: 1,\n dpr: 1,\n easing: _tween2.default.Easing.Quadratic.InOut,\n duration: 500,\n model: {\n path: '/assets/models/teapot-claraio.json',\n scale: 20\n },\n texture: {\n path: '/assets/textures/',\n imageFiles: [{ name: 'UV', image: 'UV_Grid_Sm.jpg' }]\n },\n mesh: {\n enableHelper: false,\n wireframe: false,\n translucent: false,\n material: {\n color: 0xffffff,\n emissive: 0xffffff\n }\n },\n fog: {\n color: 0xffffff,\n near: 0.0008\n },\n camera: {\n fov: 40,\n near: 2,\n far: 1000,\n aspect: 1,\n posX: 0,\n posY: 30,\n posZ: 40\n },\n controls: {\n autoRotate: true,\n autoRotateSpeed: -0.5,\n rotateSpeed: 0.5,\n zoomSpeed: 0.8,\n minDistance: 200,\n maxDistance: 600,\n minPolarAngle: Math.PI / 5,\n maxPolarAngle: Math.PI / 2,\n minAzimuthAngle: -Infinity,\n maxAzimuthAngle: Infinity,\n enableDamping: true,\n dampingFactor: 0.5,\n enableZoom: true,\n target: {\n x: 0,\n y: 0,\n z: 0\n }\n },\n ambientLight: {\n enabled: false,\n color: 0x141414\n },\n directionalLight: {\n enabled: true,\n color: 0xf0f0f0,\n intensity: 0.4,\n x: -75,\n y: 280,\n z: 150\n },\n shadow: {\n enabled: true,\n helperEnabled: true,\n bias: -0.00025,\n mapWidth: 1024,\n mapHeight: 1024,\n near: 200,\n far: 400,\n top: 150,\n right: 150,\n bottom: -150,\n left: -150\n },\n pointLight: {\n enabled: true,\n color: 0xffffff,\n intensity: 0.34,\n distance: 115,\n x: 0,\n y: 0,\n z: 0\n },\n hemiLight: {\n enabled: true,\n color: 0xc8c8c8,\n groundColor: 0xffffff,\n intensity: 0.3,\n x: -275,\n y: 145,\n z: 0\n }\n};\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/data/config.js\n ** module id = 2\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/data/config.js?"); + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n/**\n * Tween.js - Licensed under the MIT license\n * https://github.com/sole/tween.js\n * ----------------------------------------------\n *\n * See https://github.com/sole/tween.js/graphs/contributors for the full list of contributors.\n * Thank you all, you're awesome!\n */\n\n// performance.now polyfill\n(function () {\n\n\tif ('performance' in window === false) {\n\t\twindow.performance = {};\n\t}\n\n\t// IE 8\n\tDate.now = Date.now || function () {\n\t\treturn new Date().getTime();\n\t};\n\n\tif ('now' in window.performance === false) {\n\t\tvar offset = window.performance.timing && window.performance.timing.navigationStart ? window.performance.timing.navigationStart : Date.now();\n\n\t\twindow.performance.now = function () {\n\t\t\treturn Date.now() - offset;\n\t\t};\n\t}\n})();\n\nvar TWEEN = TWEEN || function () {\n\n\tvar _tweens = [];\n\n\treturn {\n\n\t\tgetAll: function getAll() {\n\n\t\t\treturn _tweens;\n\t\t},\n\n\t\tremoveAll: function removeAll() {\n\n\t\t\t_tweens = [];\n\t\t},\n\n\t\tadd: function add(tween) {\n\n\t\t\t_tweens.push(tween);\n\t\t},\n\n\t\tremove: function remove(tween) {\n\n\t\t\tvar i = _tweens.indexOf(tween);\n\n\t\t\tif (i !== -1) {\n\n\t\t\t\t_tweens.splice(i, 1);\n\t\t\t}\n\t\t},\n\n\t\tupdate: function update(time) {\n\n\t\t\tif (_tweens.length === 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar i = 0;\n\n\t\t\ttime = time !== undefined ? time : window.performance.now();\n\n\t\t\twhile (i < _tweens.length) {\n\n\t\t\t\tif (_tweens[i].update(time)) {\n\n\t\t\t\t\ti++;\n\t\t\t\t} else {\n\n\t\t\t\t\t_tweens.splice(i, 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t};\n}();\n\nTWEEN.Tween = function (object) {\n\n\tvar _object = object;\n\tvar _valuesStart = {};\n\tvar _valuesEnd = {};\n\tvar _valuesStartRepeat = {};\n\tvar _duration = 1000;\n\tvar _repeat = 0;\n\tvar _yoyo = false;\n\tvar _isPlaying = false;\n\tvar _reversed = false;\n\tvar _delayTime = 0;\n\tvar _startTime = null;\n\tvar _easingFunction = TWEEN.Easing.Linear.None;\n\tvar _interpolationFunction = TWEEN.Interpolation.Linear;\n\tvar _chainedTweens = [];\n\tvar _onStartCallback = null;\n\tvar _onStartCallbackFired = false;\n\tvar _onUpdateCallback = null;\n\tvar _onCompleteCallback = null;\n\tvar _onStopCallback = null;\n\n\t// Set all starting values present on the target object\n\tfor (var field in object) {\n\n\t\t_valuesStart[field] = parseFloat(object[field], 10);\n\t}\n\n\tthis.to = function (properties, duration) {\n\n\t\tif (duration !== undefined) {\n\n\t\t\t_duration = duration;\n\t\t}\n\n\t\t_valuesEnd = properties;\n\n\t\treturn this;\n\t};\n\n\tthis.start = function (time) {\n\n\t\tTWEEN.add(this);\n\n\t\t_isPlaying = true;\n\n\t\t_onStartCallbackFired = false;\n\n\t\t_startTime = time !== undefined ? time : window.performance.now();\n\t\t_startTime += _delayTime;\n\n\t\tfor (var property in _valuesEnd) {\n\n\t\t\t// check if an Array was provided as property value\n\t\t\tif (_valuesEnd[property] instanceof Array) {\n\n\t\t\t\tif (_valuesEnd[property].length === 0) {\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// create a local copy of the Array with the start value at the front\n\t\t\t\t_valuesEnd[property] = [_object[property]].concat(_valuesEnd[property]);\n\t\t\t}\n\n\t\t\t_valuesStart[property] = _object[property];\n\n\t\t\tif (_valuesStart[property] instanceof Array === false) {\n\t\t\t\t_valuesStart[property] *= 1.0; // Ensures we're using numbers, not strings\n\t\t\t}\n\n\t\t\t_valuesStartRepeat[property] = _valuesStart[property] || 0;\n\t\t}\n\n\t\treturn this;\n\t};\n\n\tthis.stop = function () {\n\n\t\tif (!_isPlaying) {\n\t\t\treturn this;\n\t\t}\n\n\t\tTWEEN.remove(this);\n\t\t_isPlaying = false;\n\n\t\tif (_onStopCallback !== null) {\n\n\t\t\t_onStopCallback.call(_object);\n\t\t}\n\n\t\tthis.stopChainedTweens();\n\t\treturn this;\n\t};\n\n\tthis.stopChainedTweens = function () {\n\n\t\tfor (var i = 0, numChainedTweens = _chainedTweens.length; i < numChainedTweens; i++) {\n\n\t\t\t_chainedTweens[i].stop();\n\t\t}\n\t};\n\n\tthis.delay = function (amount) {\n\n\t\t_delayTime = amount;\n\t\treturn this;\n\t};\n\n\tthis.repeat = function (times) {\n\n\t\t_repeat = times;\n\t\treturn this;\n\t};\n\n\tthis.yoyo = function (yoyo) {\n\n\t\t_yoyo = yoyo;\n\t\treturn this;\n\t};\n\n\tthis.easing = function (easing) {\n\n\t\t_easingFunction = easing;\n\t\treturn this;\n\t};\n\n\tthis.interpolation = function (interpolation) {\n\n\t\t_interpolationFunction = interpolation;\n\t\treturn this;\n\t};\n\n\tthis.chain = function () {\n\n\t\t_chainedTweens = arguments;\n\t\treturn this;\n\t};\n\n\tthis.onStart = function (callback) {\n\n\t\t_onStartCallback = callback;\n\t\treturn this;\n\t};\n\n\tthis.onUpdate = function (callback) {\n\n\t\t_onUpdateCallback = callback;\n\t\treturn this;\n\t};\n\n\tthis.onComplete = function (callback) {\n\n\t\t_onCompleteCallback = callback;\n\t\treturn this;\n\t};\n\n\tthis.onStop = function (callback) {\n\n\t\t_onStopCallback = callback;\n\t\treturn this;\n\t};\n\n\tthis.update = function (time) {\n\n\t\tvar property;\n\n\t\tif (time < _startTime) {\n\n\t\t\treturn true;\n\t\t}\n\n\t\tif (_onStartCallbackFired === false) {\n\n\t\t\tif (_onStartCallback !== null) {\n\n\t\t\t\t_onStartCallback.call(_object);\n\t\t\t}\n\n\t\t\t_onStartCallbackFired = true;\n\t\t}\n\n\t\tvar elapsed = (time - _startTime) / _duration;\n\t\telapsed = elapsed > 1 ? 1 : elapsed;\n\n\t\tvar value = _easingFunction(elapsed);\n\n\t\tfor (property in _valuesEnd) {\n\n\t\t\tvar start = _valuesStart[property] || 0;\n\t\t\tvar end = _valuesEnd[property];\n\n\t\t\tif (end instanceof Array) {\n\n\t\t\t\t_object[property] = _interpolationFunction(end, value);\n\t\t\t} else {\n\n\t\t\t\t// Parses relative end values with start as base (e.g.: +10, -3)\n\t\t\t\tif (typeof end === \"string\") {\n\t\t\t\t\tend = start + parseFloat(end, 10);\n\t\t\t\t}\n\n\t\t\t\t// protect against non numeric properties.\n\t\t\t\tif (typeof end === \"number\") {\n\t\t\t\t\t_object[property] = start + (end - start) * value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (_onUpdateCallback !== null) {\n\n\t\t\t_onUpdateCallback.call(_object, value);\n\t\t}\n\n\t\tif (elapsed === 1) {\n\n\t\t\tif (_repeat > 0) {\n\n\t\t\t\tif (isFinite(_repeat)) {\n\t\t\t\t\t_repeat--;\n\t\t\t\t}\n\n\t\t\t\t// reassign starting values, restart by making startTime = now\n\t\t\t\tfor (property in _valuesStartRepeat) {\n\n\t\t\t\t\tif (typeof _valuesEnd[property] === \"string\") {\n\t\t\t\t\t\t_valuesStartRepeat[property] = _valuesStartRepeat[property] + parseFloat(_valuesEnd[property], 10);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (_yoyo) {\n\t\t\t\t\t\tvar tmp = _valuesStartRepeat[property];\n\t\t\t\t\t\t_valuesStartRepeat[property] = _valuesEnd[property];\n\t\t\t\t\t\t_valuesEnd[property] = tmp;\n\t\t\t\t\t}\n\n\t\t\t\t\t_valuesStart[property] = _valuesStartRepeat[property];\n\t\t\t\t}\n\n\t\t\t\tif (_yoyo) {\n\t\t\t\t\t_reversed = !_reversed;\n\t\t\t\t}\n\n\t\t\t\t_startTime = time + _delayTime;\n\n\t\t\t\treturn true;\n\t\t\t} else {\n\n\t\t\t\tif (_onCompleteCallback !== null) {\n\n\t\t\t\t\t_onCompleteCallback.call(_object);\n\t\t\t\t}\n\n\t\t\t\tfor (var i = 0, numChainedTweens = _chainedTweens.length; i < numChainedTweens; i++) {\n\n\t\t\t\t\t_chainedTweens[i].start(time);\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t};\n};\n\nTWEEN.Easing = {\n\n\tLinear: {\n\n\t\tNone: function None(k) {\n\n\t\t\treturn k;\n\t\t}\n\n\t},\n\n\tQuadratic: {\n\n\t\tIn: function In(k) {\n\n\t\t\treturn k * k;\n\t\t},\n\n\t\tOut: function Out(k) {\n\n\t\t\treturn k * (2 - k);\n\t\t},\n\n\t\tInOut: function InOut(k) {\n\n\t\t\tif ((k *= 2) < 1) {\n\t\t\t\treturn 0.5 * k * k;\n\t\t\t}\n\t\t\treturn -0.5 * (--k * (k - 2) - 1);\n\t\t}\n\n\t},\n\n\tCubic: {\n\n\t\tIn: function In(k) {\n\n\t\t\treturn k * k * k;\n\t\t},\n\n\t\tOut: function Out(k) {\n\n\t\t\treturn --k * k * k + 1;\n\t\t},\n\n\t\tInOut: function InOut(k) {\n\n\t\t\tif ((k *= 2) < 1) {\n\t\t\t\treturn 0.5 * k * k * k;\n\t\t\t}\n\t\t\treturn 0.5 * ((k -= 2) * k * k + 2);\n\t\t}\n\n\t},\n\n\tQuartic: {\n\n\t\tIn: function In(k) {\n\n\t\t\treturn k * k * k * k;\n\t\t},\n\n\t\tOut: function Out(k) {\n\n\t\t\treturn 1 - --k * k * k * k;\n\t\t},\n\n\t\tInOut: function InOut(k) {\n\n\t\t\tif ((k *= 2) < 1) {\n\t\t\t\treturn 0.5 * k * k * k * k;\n\t\t\t}\n\t\t\treturn -0.5 * ((k -= 2) * k * k * k - 2);\n\t\t}\n\n\t},\n\n\tQuintic: {\n\n\t\tIn: function In(k) {\n\n\t\t\treturn k * k * k * k * k;\n\t\t},\n\n\t\tOut: function Out(k) {\n\n\t\t\treturn --k * k * k * k * k + 1;\n\t\t},\n\n\t\tInOut: function InOut(k) {\n\n\t\t\tif ((k *= 2) < 1) {\n\t\t\t\treturn 0.5 * k * k * k * k * k;\n\t\t\t}\n\t\t\treturn 0.5 * ((k -= 2) * k * k * k * k + 2);\n\t\t}\n\n\t},\n\n\tSinusoidal: {\n\n\t\tIn: function In(k) {\n\n\t\t\treturn 1 - Math.cos(k * Math.PI / 2);\n\t\t},\n\n\t\tOut: function Out(k) {\n\n\t\t\treturn Math.sin(k * Math.PI / 2);\n\t\t},\n\n\t\tInOut: function InOut(k) {\n\n\t\t\treturn 0.5 * (1 - Math.cos(Math.PI * k));\n\t\t}\n\n\t},\n\n\tExponential: {\n\n\t\tIn: function In(k) {\n\n\t\t\treturn k === 0 ? 0 : Math.pow(1024, k - 1);\n\t\t},\n\n\t\tOut: function Out(k) {\n\n\t\t\treturn k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\n\t\t},\n\n\t\tInOut: function InOut(k) {\n\n\t\t\tif (k === 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif (k === 1) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif ((k *= 2) < 1) {\n\t\t\t\treturn 0.5 * Math.pow(1024, k - 1);\n\t\t\t}\n\n\t\t\treturn 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\n\t\t}\n\n\t},\n\n\tCircular: {\n\n\t\tIn: function In(k) {\n\n\t\t\treturn 1 - Math.sqrt(1 - k * k);\n\t\t},\n\n\t\tOut: function Out(k) {\n\n\t\t\treturn Math.sqrt(1 - --k * k);\n\t\t},\n\n\t\tInOut: function InOut(k) {\n\n\t\t\tif ((k *= 2) < 1) {\n\t\t\t\treturn -0.5 * (Math.sqrt(1 - k * k) - 1);\n\t\t\t}\n\t\t\treturn 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n\t\t}\n\n\t},\n\n\tElastic: {\n\n\t\tIn: function In(k) {\n\n\t\t\tvar s,\n\t\t\t a = 0.1,\n\t\t\t p = 0.4;\n\t\t\tif (k === 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif (k === 1) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!a || a < 1) {\n\t\t\t\ta = 1;s = p / 4;\n\t\t\t} else {\n\t\t\t\ts = p * Math.asin(1 / a) / (2 * Math.PI);\n\t\t\t}\n\t\t\treturn -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));\n\t\t},\n\n\t\tOut: function Out(k) {\n\n\t\t\tvar s,\n\t\t\t a = 0.1,\n\t\t\t p = 0.4;\n\t\t\tif (k === 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif (k === 1) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif (!a || a < 1) {\n\t\t\t\ta = 1;s = p / 4;\n\t\t\t} else {\n\t\t\t\ts = p * Math.asin(1 / a) / (2 * Math.PI);\n\t\t\t}\n\t\t\treturn a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;\n\t\t},\n\n\t\tInOut: function InOut(k) {\n\n\t\t\tvar s,\n\t\t\t a = 0.1,\n\t\t\t p = 0.4;\n\t\t\tif (k === 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif (k === 1) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\tif (!a || a < 1) {\n\t\t\t\ta = 1;s = p / 4;\n\t\t\t} else {\n\t\t\t\ts = p * Math.asin(1 / a) / (2 * Math.PI);\n\t\t\t}\n\n\t\t\tif ((k *= 2) < 1) {\n\t\t\t\treturn -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));\n\t\t\t}\n\n\t\t\treturn a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\n\t\t}\n\n\t},\n\n\tBack: {\n\n\t\tIn: function In(k) {\n\n\t\t\tvar s = 1.70158;\n\t\t\treturn k * k * ((s + 1) * k - s);\n\t\t},\n\n\t\tOut: function Out(k) {\n\n\t\t\tvar s = 1.70158;\n\t\t\treturn --k * k * ((s + 1) * k + s) + 1;\n\t\t},\n\n\t\tInOut: function InOut(k) {\n\n\t\t\tvar s = 1.70158 * 1.525;\n\t\t\tif ((k *= 2) < 1) {\n\t\t\t\treturn 0.5 * (k * k * ((s + 1) * k - s));\n\t\t\t}\n\t\t\treturn 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n\t\t}\n\n\t},\n\n\tBounce: {\n\n\t\tIn: function In(k) {\n\n\t\t\treturn 1 - TWEEN.Easing.Bounce.Out(1 - k);\n\t\t},\n\n\t\tOut: function Out(k) {\n\n\t\t\tif (k < 1 / 2.75) {\n\n\t\t\t\treturn 7.5625 * k * k;\n\t\t\t} else if (k < 2 / 2.75) {\n\n\t\t\t\treturn 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;\n\t\t\t} else if (k < 2.5 / 2.75) {\n\n\t\t\t\treturn 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;\n\t\t\t} else {\n\n\t\t\t\treturn 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;\n\t\t\t}\n\t\t},\n\n\t\tInOut: function InOut(k) {\n\n\t\t\tif (k < 0.5) {\n\t\t\t\treturn TWEEN.Easing.Bounce.In(k * 2) * 0.5;\n\t\t\t}\n\t\t\treturn TWEEN.Easing.Bounce.Out(k * 2 - 1) * 0.5 + 0.5;\n\t\t}\n\n\t}\n\n};\n\nTWEEN.Interpolation = {\n\n\tLinear: function Linear(v, k) {\n\n\t\tvar m = v.length - 1,\n\t\t f = m * k,\n\t\t i = Math.floor(f),\n\t\t fn = TWEEN.Interpolation.Utils.Linear;\n\n\t\tif (k < 0) {\n\t\t\treturn fn(v[0], v[1], f);\n\t\t}\n\n\t\tif (k > 1) {\n\t\t\treturn fn(v[m], v[m - 1], m - f);\n\t\t}\n\n\t\treturn fn(v[i], v[i + 1 > m ? m : i + 1], f - i);\n\t},\n\n\tBezier: function Bezier(v, k) {\n\n\t\tvar b = 0,\n\t\t n = v.length - 1,\n\t\t pw = Math.pow,\n\t\t bn = TWEEN.Interpolation.Utils.Bernstein,\n\t\t i;\n\n\t\tfor (i = 0; i <= n; i++) {\n\t\t\tb += pw(1 - k, n - i) * pw(k, i) * v[i] * bn(n, i);\n\t\t}\n\n\t\treturn b;\n\t},\n\n\tCatmullRom: function CatmullRom(v, k) {\n\n\t\tvar m = v.length - 1,\n\t\t f = m * k,\n\t\t i = Math.floor(f),\n\t\t fn = TWEEN.Interpolation.Utils.CatmullRom;\n\n\t\tif (v[0] === v[m]) {\n\n\t\t\tif (k < 0) {\n\t\t\t\ti = Math.floor(f = m * (1 + k));\n\t\t\t}\n\n\t\t\treturn fn(v[(i - 1 + m) % m], v[i], v[(i + 1) % m], v[(i + 2) % m], f - i);\n\t\t} else {\n\n\t\t\tif (k < 0) {\n\t\t\t\treturn v[0] - (fn(v[0], v[0], v[1], v[1], -f) - v[0]);\n\t\t\t}\n\n\t\t\tif (k > 1) {\n\t\t\t\treturn v[m] - (fn(v[m], v[m], v[m - 1], v[m - 1], f - m) - v[m]);\n\t\t\t}\n\n\t\t\treturn fn(v[i ? i - 1 : 0], v[i], v[m < i + 1 ? m : i + 1], v[m < i + 2 ? m : i + 2], f - i);\n\t\t}\n\t},\n\n\tUtils: {\n\n\t\tLinear: function Linear(p0, p1, t) {\n\n\t\t\treturn (p1 - p0) * t + p0;\n\t\t},\n\n\t\tBernstein: function Bernstein(n, i) {\n\n\t\t\tvar fc = TWEEN.Interpolation.Utils.Factorial;\n\t\t\treturn fc(n) / fc(i) / fc(n - i);\n\t\t},\n\n\t\tFactorial: function () {\n\n\t\t\tvar a = [1];\n\n\t\t\treturn function (n) {\n\n\t\t\t\tvar s = 1,\n\t\t\t\t i;\n\t\t\t\tif (a[n]) {\n\t\t\t\t\treturn a[n];\n\t\t\t\t}\n\n\t\t\t\tfor (i = n; i > 1; i--) {\n\t\t\t\t\ts *= i;\n\t\t\t\t}\n\n\t\t\t\ta[n] = s;\n\t\t\t\treturn s;\n\t\t\t};\n\t\t}(),\n\n\t\tCatmullRom: function CatmullRom(p0, p1, p2, p3, t) {\n\n\t\t\tvar v0 = (p2 - p0) * 0.5,\n\t\t\t v1 = (p3 - p1) * 0.5,\n\t\t\t t2 = t * t,\n\t\t\t t3 = t * t2;\n\t\t\treturn (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\n\t\t}\n\n\t}\n\n};\n\n// UMD (Universal Module Definition)\n(function (root) {\n\n\tif (true) {\n\n\t\t// AMD\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t\t\treturn TWEEN;\n\t\t}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') {\n\n\t\t// Node.js\n\t\tmodule.exports = TWEEN;\n\t} else {\n\n\t\t// Global variable\n\t\troot.TWEEN = TWEEN;\n\t}\n})(undefined);\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/tween.js/src/Tween.js\n ** module id = 3\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/tween.js/src/Tween.js?"); + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\r\n * @author alteredq / http://alteredqualia.com/\r\n * @author mr.doob / http://mrdoob.com/\r\n */\n\nexports.default = {\n\n canvas: !!window.CanvasRenderingContext2D,\n webgl: function () {\n\n try {\n\n var canvas = document.createElement('canvas');\n return !!(window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl')));\n } catch (e) {\n\n return false;\n }\n }(),\n workers: !!window.Worker,\n fileapi: window.File && window.FileReader && window.FileList && window.Blob,\n\n getWebGLErrorMessage: function getWebGLErrorMessage() {\n\n var element = document.createElement('div');\n element.id = 'webgl-error-message';\n element.style.fontFamily = 'monospace';\n element.style.fontSize = '13px';\n element.style.fontWeight = 'normal';\n element.style.textAlign = 'center';\n element.style.background = '#fff';\n element.style.color = '#000';\n element.style.padding = '1.5em';\n element.style.width = '400px';\n element.style.margin = '5em auto 0';\n\n if (!this.webgl) {\n\n element.innerHTML = window.WebGLRenderingContext ? ['Your graphics card does not seem to support WebGL.
    ', 'Find out how to get it here.'].join('\\n') : ['Your browser does not seem to support WebGL.
    ', 'Find out how to get it here.'].join('\\n');\n }\n\n return element;\n },\n\n addGetWebGLMessage: function addGetWebGLMessage(parameters) {\n\n var parent, id, element;\n\n parameters = parameters || {};\n\n parent = parameters.parent !== undefined ? parameters.parent : document.body;\n id = parameters.id !== undefined ? parameters.id : 'oldie';\n\n element = this.getWebGLErrorMessage();\n element.id = id;\n\n parent.appendChild(element);\n }\n\n};\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/utils/detector.js\n ** module id = 4\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/utils/detector.js?"); + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); // global imports\n\n\n// local imports\n\n\n// data\n\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nvar _tween = __webpack_require__(3);\n\nvar _tween2 = _interopRequireDefault(_tween);\n\nvar _renderer = __webpack_require__(7);\n\nvar _renderer2 = _interopRequireDefault(_renderer);\n\nvar _camera = __webpack_require__(8);\n\nvar _camera2 = _interopRequireDefault(_camera);\n\nvar _light = __webpack_require__(9);\n\nvar _light2 = _interopRequireDefault(_light);\n\nvar _controls = __webpack_require__(10);\n\nvar _controls2 = _interopRequireDefault(_controls);\n\nvar _geometry = __webpack_require__(12);\n\nvar _geometry2 = _interopRequireDefault(_geometry);\n\nvar _texture = __webpack_require__(13);\n\nvar _texture2 = _interopRequireDefault(_texture);\n\nvar _model = __webpack_require__(19);\n\nvar _model2 = _interopRequireDefault(_model);\n\nvar _interaction = __webpack_require__(22);\n\nvar _interaction2 = _interopRequireDefault(_interaction);\n\nvar _gui = __webpack_require__(25);\n\nvar _gui2 = _interopRequireDefault(_gui);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// stats\nvar rS = void 0,\n bS = void 0,\n glS = void 0,\n tS = void 0;\n\nvar Main = function () {\n function Main(container) {\n var _this = this;\n\n _classCallCheck(this, Main);\n\n this.container = container;\n\n // Start Three clock\n this.clock = new _three2.default.Clock();\n\n // Main scene\n this.scene = new _three2.default.Scene();\n this.scene.fog = new _three2.default.FogExp2(_config2.default.fog.color, _config2.default.fog.near);\n\n // Get Device Pixel Ratio first\n if (window.devicePixelRatio) {\n _config2.default.dpr = window.devicePixelRatio;\n }\n\n // Main renderer\n this.renderer = new _renderer2.default(container, this.scene);\n\n // Components\n this.camera = new _camera2.default(this.renderer.threeRenderer);\n this.controls = new _controls2.default(this.camera.threeCamera, this.container);\n this.light = new _light2.default(this.scene);\n\n // Place lights\n var lights = ['ambient', 'directional', 'point', 'hemi'];\n for (var i = 0; i < lights.length; i++) {\n this.light.place(lights[i]);\n }\n\n // Place geo\n this.geometry = new _geometry2.default(this.scene);\n this.geometry.make('plane')(100, 100, 10, 10);\n this.geometry.place([0, -20, 0], [Math.PI / 2, 0, 0]);\n\n // Set up stats if dev\n if (_config2.default.isDev) {\n bS = new BrowserStats();\n glS = new glStats();\n tS = new threeStats(this.renderer.threeRenderer);\n\n rS = new rStats({\n CSSPath: '/assets/css/',\n userTimingAPI: true,\n values: {\n frame: { caption: 'Total frame time (ms)', over: 16, average: true, avgMs: 100 },\n fps: { caption: 'Framerate (FPS)', below: 30 },\n calls: { caption: 'Calls (three.js)', over: 3000 },\n raf: { caption: 'Time since last rAF (ms)', average: true, avgMs: 100 },\n rstats: { caption: 'rStats update (ms)', average: true, avgMs: 100 },\n texture: { caption: 'GenTex', average: true, avgMs: 100 }\n },\n groups: [{ caption: 'Framerate', values: ['fps', 'raf'] }, { caption: 'Frame Budget', values: ['frame', 'texture', 'setup', 'render'] }],\n fractions: [{ base: 'frame', steps: ['texture', 'setup', 'render'] }],\n plugins: [bS, tS, glS]\n });\n }\n\n this.texture = new _texture2.default();\n // Start loading the textures\n this.texture.load().then(function () {\n _this.manager = new _three2.default.LoadingManager();\n // Textures loaded, load main model\n _this.model = new _model2.default(_this.scene, _this.manager, _this.texture.textures);\n _this.model.load();\n\n // onProgress\n _this.manager.onProgress = function (item, loaded, total) {\n console.log(item + ': ' + loaded + ' ' + total);\n };\n\n // All loaders done\n _this.manager.onLoad = function () {\n // Set up interaction with app\n new _interaction2.default(_this.renderer.threeRenderer, _this.scene, _this.camera.threeCamera, _this.controls.threeControls);\n\n if (_config2.default.isDev) {\n new _gui2.default(_this, _this.model.obj);\n }\n\n _config2.default.isLoaded = true;\n };\n });\n\n this.render();\n }\n\n _createClass(Main, [{\n key: 'render',\n value: function render() {\n var delta = this.clock.getDelta();\n\n if (_config2.default.isDev) {\n rS('frame').start();\n glS.start();\n\n rS('rAF').tick();\n rS('FPS').frame();\n\n rS('render').start();\n }\n\n // Clear renderer\n this.renderer.threeRenderer.clear();\n this.renderer.render(this.scene, this.camera.threeCamera);\n\n if (_config2.default.isDev) {\n rS('render').end();\n rS('frame').end();\n\n rS('rStats').start();\n rS().update();\n rS('rStats').end();\n }\n\n // Updates\n _tween2.default.update();\n this.controls.threeControls.update();\n\n // raf\n requestAnimationFrame(this.render.bind(this));\n }\n }]);\n\n return Main;\n}();\n\nexports.default = Main;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/main.js\n ** module id = 5\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/main.js?"); + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;'use strict';// File:src/Three.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */var THREE={REVISION:'79'};//\nif(true){!(__WEBPACK_AMD_DEFINE_FACTORY__ = (THREE), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));}else if('undefined'!==typeof exports&&'undefined'!==typeof module){module.exports=THREE;}// Polyfills\nif(Number.EPSILON===undefined){Number.EPSILON=Math.pow(2,-52);}//\nif(Math.sign===undefined){// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign\nMath.sign=function(x){return x<0?-1:x>0?1:+x;};}if(Function.prototype.name===undefined){// Missing in IE9-11.\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name\nObject.defineProperty(Function.prototype,'name',{get:function get(){return this.toString().match(/^\\s*function\\s*(\\S*)\\s*\\(/)[1];}});}if(Object.assign===undefined){// Missing in IE.\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n(function(){Object.assign=function(target){'use strict';if(target===undefined||target===null){throw new TypeError('Cannot convert undefined or null to object');}var output=Object(target);for(var index=1;index>16&255)/255;this.g=(hex>>8&255)/255;this.b=(hex&255)/255;return this;},setRGB:function setRGB(r,g,b){this.r=r;this.g=g;this.b=b;return this;},setHSL:function(){function hue2rgb(p,q,t){if(t<0)t+=1;if(t>1)t-=1;if(t<1/6)return p+(q-p)*6*t;if(t<1/2)return q;if(t<2/3)return p+(q-p)*6*(2/3-t);return p;}return function setHSL(h,s,l){// h,s,l ranges are in 0.0 - 1.0\nh=THREE.Math.euclideanModulo(h,1);s=THREE.Math.clamp(s,0,1);l=THREE.Math.clamp(l,0,1);if(s===0){this.r=this.g=this.b=l;}else{var p=l<=0.5?l*(1+s):l+s-l*s;var q=2*l-p;this.r=hue2rgb(q,p,h+1/3);this.g=hue2rgb(q,p,h);this.b=hue2rgb(q,p,h-1/3);}return this;};}(),setStyle:function setStyle(style){function handleAlpha(string){if(string===undefined)return;if(parseFloat(string)<1){console.warn('THREE.Color: Alpha component of '+style+' will be ignored.');}}var m;if(m=/^((?:rgb|hsl)a?)\\(\\s*([^\\)]*)\\)/.exec(style)){// rgb / hsl\nvar color;var name=m[1];var components=m[2];switch(name){case'rgb':case'rgba':if(color=/^(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(components)){// rgb(255,0,0) rgba(255,0,0,0.5)\nthis.r=Math.min(255,parseInt(color[1],10))/255;this.g=Math.min(255,parseInt(color[2],10))/255;this.b=Math.min(255,parseInt(color[3],10))/255;handleAlpha(color[5]);return this;}if(color=/^(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(components)){// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\nthis.r=Math.min(100,parseInt(color[1],10))/100;this.g=Math.min(100,parseInt(color[2],10))/100;this.b=Math.min(100,parseInt(color[3],10))/100;handleAlpha(color[5]);return this;}break;case'hsl':case'hsla':if(color=/^([0-9]*\\.?[0-9]+)\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(components)){// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\nvar h=parseFloat(color[1])/360;var s=parseInt(color[2],10)/100;var l=parseInt(color[3],10)/100;handleAlpha(color[5]);return this.setHSL(h,s,l);}break;}}else if(m=/^\\#([A-Fa-f0-9]+)$/.exec(style)){// hex color\nvar hex=m[1];var size=hex.length;if(size===3){// #ff0\nthis.r=parseInt(hex.charAt(0)+hex.charAt(0),16)/255;this.g=parseInt(hex.charAt(1)+hex.charAt(1),16)/255;this.b=parseInt(hex.charAt(2)+hex.charAt(2),16)/255;return this;}else if(size===6){// #ff0000\nthis.r=parseInt(hex.charAt(0)+hex.charAt(1),16)/255;this.g=parseInt(hex.charAt(2)+hex.charAt(3),16)/255;this.b=parseInt(hex.charAt(4)+hex.charAt(5),16)/255;return this;}}if(style&&style.length>0){// color keywords\nvar hex=THREE.ColorKeywords[style];if(hex!==undefined){// red\nthis.setHex(hex);}else{// unknown color\nconsole.warn('THREE.Color: Unknown color '+style);}}return this;},clone:function clone(){return new this.constructor(this.r,this.g,this.b);},copy:function copy(color){this.r=color.r;this.g=color.g;this.b=color.b;return this;},copyGammaToLinear:function copyGammaToLinear(color,gammaFactor){if(gammaFactor===undefined)gammaFactor=2.0;this.r=Math.pow(color.r,gammaFactor);this.g=Math.pow(color.g,gammaFactor);this.b=Math.pow(color.b,gammaFactor);return this;},copyLinearToGamma:function copyLinearToGamma(color,gammaFactor){if(gammaFactor===undefined)gammaFactor=2.0;var safeInverse=gammaFactor>0?1.0/gammaFactor:1.0;this.r=Math.pow(color.r,safeInverse);this.g=Math.pow(color.g,safeInverse);this.b=Math.pow(color.b,safeInverse);return this;},convertGammaToLinear:function convertGammaToLinear(){var r=this.r,g=this.g,b=this.b;this.r=r*r;this.g=g*g;this.b=b*b;return this;},convertLinearToGamma:function convertLinearToGamma(){this.r=Math.sqrt(this.r);this.g=Math.sqrt(this.g);this.b=Math.sqrt(this.b);return this;},getHex:function getHex(){return this.r*255<<16^this.g*255<<8^this.b*255<<0;},getHexString:function getHexString(){return('000000'+this.getHex().toString(16)).slice(-6);},getHSL:function getHSL(optionalTarget){// h,s,l ranges are in 0.0 - 1.0\nvar hsl=optionalTarget||{h:0,s:0,l:0};var r=this.r,g=this.g,b=this.b;var max=Math.max(r,g,b);var min=Math.min(r,g,b);var hue,saturation;var lightness=(min+max)/2.0;if(min===max){hue=0;saturation=0;}else{var delta=max-min;saturation=lightness<=0.5?delta/(max+min):delta/(2-max-min);switch(max){case r:hue=(g-b)/delta+(g0){s=0.5/Math.sqrt(trace+1.0);this._w=0.25/s;this._x=(m32-m23)*s;this._y=(m13-m31)*s;this._z=(m21-m12)*s;}else if(m11>m22&&m11>m33){s=2.0*Math.sqrt(1.0+m11-m22-m33);this._w=(m32-m23)/s;this._x=0.25*s;this._y=(m12+m21)/s;this._z=(m13+m31)/s;}else if(m22>m33){s=2.0*Math.sqrt(1.0+m22-m11-m33);this._w=(m13-m31)/s;this._x=(m12+m21)/s;this._y=0.25*s;this._z=(m23+m32)/s;}else{s=2.0*Math.sqrt(1.0+m33-m11-m22);this._w=(m21-m12)/s;this._x=(m13+m31)/s;this._y=(m23+m32)/s;this._z=0.25*s;}this.onChangeCallback();return this;},setFromUnitVectors:function(){// http://lolengine.net/blog/2014/02/24/quaternion-from-two-vectors-final\n// assumes direction vectors vFrom and vTo are normalized\nvar v1,r;var EPS=0.000001;return function setFromUnitVectors(vFrom,vTo){if(v1===undefined)v1=new THREE.Vector3();r=vFrom.dot(vTo)+1;if(rMath.abs(vFrom.z)){v1.set(-vFrom.y,vFrom.x,0);}else{v1.set(0,-vFrom.z,vFrom.y);}}else{v1.crossVectors(vFrom,vTo);}this._x=v1.x;this._y=v1.y;this._z=v1.z;this._w=r;return this.normalize();};}(),inverse:function inverse(){return this.conjugate().normalize();},conjugate:function conjugate(){this._x*=-1;this._y*=-1;this._z*=-1;this.onChangeCallback();return this;},dot:function dot(v){return this._x*v._x+this._y*v._y+this._z*v._z+this._w*v._w;},lengthSq:function lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w;},length:function length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w);},normalize:function normalize(){var l=this.length();if(l===0){this._x=0;this._y=0;this._z=0;this._w=1;}else{l=1/l;this._x=this._x*l;this._y=this._y*l;this._z=this._z*l;this._w=this._w*l;}this.onChangeCallback();return this;},multiply:function multiply(q,p){if(p!==undefined){console.warn('THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.');return this.multiplyQuaternions(q,p);}return this.multiplyQuaternions(this,q);},premultiply:function premultiply(q){return this.multiplyQuaternions(q,this);},multiplyQuaternions:function multiplyQuaternions(a,b){// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\nvar qax=a._x,qay=a._y,qaz=a._z,qaw=a._w;var qbx=b._x,qby=b._y,qbz=b._z,qbw=b._w;this._x=qax*qbw+qaw*qbx+qay*qbz-qaz*qby;this._y=qay*qbw+qaw*qby+qaz*qbx-qax*qbz;this._z=qaz*qbw+qaw*qbz+qax*qby-qay*qbx;this._w=qaw*qbw-qax*qbx-qay*qby-qaz*qbz;this.onChangeCallback();return this;},slerp:function slerp(qb,t){if(t===0)return this;if(t===1)return this.copy(qb);var x=this._x,y=this._y,z=this._z,w=this._w;// http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\nvar cosHalfTheta=w*qb._w+x*qb._x+y*qb._y+z*qb._z;if(cosHalfTheta<0){this._w=-qb._w;this._x=-qb._x;this._y=-qb._y;this._z=-qb._z;cosHalfTheta=-cosHalfTheta;}else{this.copy(qb);}if(cosHalfTheta>=1.0){this._w=w;this._x=x;this._y=y;this._z=z;return this;}var sinHalfTheta=Math.sqrt(1.0-cosHalfTheta*cosHalfTheta);if(Math.abs(sinHalfTheta)<0.001){this._w=0.5*(w+this._w);this._x=0.5*(x+this._x);this._y=0.5*(y+this._y);this._z=0.5*(z+this._z);return this;}var halfTheta=Math.atan2(sinHalfTheta,cosHalfTheta);var ratioA=Math.sin((1-t)*halfTheta)/sinHalfTheta,ratioB=Math.sin(t*halfTheta)/sinHalfTheta;this._w=w*ratioA+this._w*ratioB;this._x=x*ratioA+this._x*ratioB;this._y=y*ratioA+this._y*ratioB;this._z=z*ratioA+this._z*ratioB;this.onChangeCallback();return this;},equals:function equals(quaternion){return quaternion._x===this._x&&quaternion._y===this._y&&quaternion._z===this._z&&quaternion._w===this._w;},fromArray:function fromArray(array,offset){if(offset===undefined)offset=0;this._x=array[offset];this._y=array[offset+1];this._z=array[offset+2];this._w=array[offset+3];this.onChangeCallback();return this;},toArray:function toArray(array,offset){if(array===undefined)array=[];if(offset===undefined)offset=0;array[offset]=this._x;array[offset+1]=this._y;array[offset+2]=this._z;array[offset+3]=this._w;return array;},onChange:function onChange(callback){this.onChangeCallback=callback;return this;},onChangeCallback:function onChangeCallback(){}};Object.assign(THREE.Quaternion,{slerp:function slerp(qa,qb,qm,t){return qm.copy(qa).slerp(qb,t);},slerpFlat:function slerpFlat(dst,dstOffset,src0,srcOffset0,src1,srcOffset1,t){// fuzz-free, array-based Quaternion SLERP operation\nvar x0=src0[srcOffset0+0],y0=src0[srcOffset0+1],z0=src0[srcOffset0+2],w0=src0[srcOffset0+3],x1=src1[srcOffset1+0],y1=src1[srcOffset1+1],z1=src1[srcOffset1+2],w1=src1[srcOffset1+3];if(w0!==w1||x0!==x1||y0!==y1||z0!==z1){var s=1-t,cos=x0*x1+y0*y1+z0*z1+w0*w1,dir=cos>=0?1:-1,sqrSin=1-cos*cos;// Skip the Slerp for tiny steps to avoid numeric problems:\nif(sqrSin>Number.EPSILON){var sin=Math.sqrt(sqrSin),len=Math.atan2(sin,cos*dir);s=Math.sin(s*len)/sin;t=Math.sin(t*len)/sin;}var tDir=t*dir;x0=x0*s+x1*tDir;y0=y0*s+y1*tDir;z0=z0*s+z1*tDir;w0=w0*s+w1*tDir;// Normalize in case we just did a lerp:\nif(s===1-t){var f=1/Math.sqrt(x0*x0+y0*y0+z0*z0+w0*w0);x0*=f;y0*=f;z0*=f;w0*=f;}}dst[dstOffset]=x0;dst[dstOffset+1]=y0;dst[dstOffset+2]=z0;dst[dstOffset+3]=w0;}});// File:src/math/Vector2.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author philogb / http://blog.thejit.org/\n * @author egraether / http://egraether.com/\n * @author zz85 / http://www.lab4games.net/zz85/blog\n */THREE.Vector2=function(x,y){this.x=x||0;this.y=y||0;};THREE.Vector2.prototype={constructor:THREE.Vector2,get width(){return this.x;},set width(value){this.x=value;},get height(){return this.y;},set height(value){this.y=value;},//\nset:function set(x,y){this.x=x;this.y=y;return this;},setScalar:function setScalar(scalar){this.x=scalar;this.y=scalar;return this;},setX:function setX(x){this.x=x;return this;},setY:function setY(y){this.y=y;return this;},setComponent:function setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;default:throw new Error('index is out of range: '+index);}},getComponent:function getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;default:throw new Error('index is out of range: '+index);}},clone:function clone(){return new this.constructor(this.x,this.y);},copy:function copy(v){this.x=v.x;this.y=v.y;return this;},add:function add(v,w){if(w!==undefined){console.warn('THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.');return this.addVectors(v,w);}this.x+=v.x;this.y+=v.y;return this;},addScalar:function addScalar(s){this.x+=s;this.y+=s;return this;},addVectors:function addVectors(a,b){this.x=a.x+b.x;this.y=a.y+b.y;return this;},addScaledVector:function addScaledVector(v,s){this.x+=v.x*s;this.y+=v.y*s;return this;},sub:function sub(v,w){if(w!==undefined){console.warn('THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.');return this.subVectors(v,w);}this.x-=v.x;this.y-=v.y;return this;},subScalar:function subScalar(s){this.x-=s;this.y-=s;return this;},subVectors:function subVectors(a,b){this.x=a.x-b.x;this.y=a.y-b.y;return this;},multiply:function multiply(v){this.x*=v.x;this.y*=v.y;return this;},multiplyScalar:function multiplyScalar(scalar){if(isFinite(scalar)){this.x*=scalar;this.y*=scalar;}else{this.x=0;this.y=0;}return this;},divide:function divide(v){this.x/=v.x;this.y/=v.y;return this;},divideScalar:function divideScalar(scalar){return this.multiplyScalar(1/scalar);},min:function min(v){this.x=Math.min(this.x,v.x);this.y=Math.min(this.y,v.y);return this;},max:function max(v){this.x=Math.max(this.x,v.x);this.y=Math.max(this.y,v.y);return this;},clamp:function clamp(min,max){// This function assumes min < max, if this assumption isn't true it will not operate correctly\nthis.x=Math.max(min.x,Math.min(max.x,this.x));this.y=Math.max(min.y,Math.min(max.y,this.y));return this;},clampScalar:function(){var min,max;return function clampScalar(minVal,maxVal){if(min===undefined){min=new THREE.Vector2();max=new THREE.Vector2();}min.set(minVal,minVal);max.set(maxVal,maxVal);return this.clamp(min,max);};}(),clampLength:function clampLength(min,max){var length=this.length();return this.multiplyScalar(Math.max(min,Math.min(max,length))/length);},floor:function floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this;},ceil:function ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this;},round:function round(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this;},roundToZero:function roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);return this;},negate:function negate(){this.x=-this.x;this.y=-this.y;return this;},dot:function dot(v){return this.x*v.x+this.y*v.y;},lengthSq:function lengthSq(){return this.x*this.x+this.y*this.y;},length:function length(){return Math.sqrt(this.x*this.x+this.y*this.y);},lengthManhattan:function lengthManhattan(){return Math.abs(this.x)+Math.abs(this.y);},normalize:function normalize(){return this.divideScalar(this.length());},angle:function angle(){// computes the angle in radians with respect to the positive x-axis\nvar angle=Math.atan2(this.y,this.x);if(angle<0)angle+=2*Math.PI;return angle;},distanceTo:function distanceTo(v){return Math.sqrt(this.distanceToSquared(v));},distanceToSquared:function distanceToSquared(v){var dx=this.x-v.x,dy=this.y-v.y;return dx*dx+dy*dy;},distanceToManhattan:function distanceToManhattan(v){return Math.abs(this.x-v.x)+Math.abs(this.y-v.y);},setLength:function setLength(length){return this.multiplyScalar(length/this.length());},lerp:function lerp(v,alpha){this.x+=(v.x-this.x)*alpha;this.y+=(v.y-this.y)*alpha;return this;},lerpVectors:function lerpVectors(v1,v2,alpha){return this.subVectors(v2,v1).multiplyScalar(alpha).add(v1);},equals:function equals(v){return v.x===this.x&&v.y===this.y;},fromArray:function fromArray(array,offset){if(offset===undefined)offset=0;this.x=array[offset];this.y=array[offset+1];return this;},toArray:function toArray(array,offset){if(array===undefined)array=[];if(offset===undefined)offset=0;array[offset]=this.x;array[offset+1]=this.y;return array;},fromAttribute:function fromAttribute(attribute,index,offset){if(offset===undefined)offset=0;index=index*attribute.itemSize+offset;this.x=attribute.array[index];this.y=attribute.array[index+1];return this;},rotateAround:function rotateAround(center,angle){var c=Math.cos(angle),s=Math.sin(angle);var x=this.x-center.x;var y=this.y-center.y;this.x=x*c-y*s+center.x;this.y=x*s+y*c+center.y;return this;}};// File:src/math/Vector3.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author *kile / http://kile.stravaganza.org/\n * @author philogb / http://blog.thejit.org/\n * @author mikael emtinger / http://gomo.se/\n * @author egraether / http://egraether.com/\n * @author WestLangley / http://github.com/WestLangley\n */THREE.Vector3=function(x,y,z){this.x=x||0;this.y=y||0;this.z=z||0;};THREE.Vector3.prototype={constructor:THREE.Vector3,set:function set(x,y,z){this.x=x;this.y=y;this.z=z;return this;},setScalar:function setScalar(scalar){this.x=scalar;this.y=scalar;this.z=scalar;return this;},setX:function setX(x){this.x=x;return this;},setY:function setY(y){this.y=y;return this;},setZ:function setZ(z){this.z=z;return this;},setComponent:function setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;case 2:this.z=value;break;default:throw new Error('index is out of range: '+index);}},getComponent:function getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error('index is out of range: '+index);}},clone:function clone(){return new this.constructor(this.x,this.y,this.z);},copy:function copy(v){this.x=v.x;this.y=v.y;this.z=v.z;return this;},add:function add(v,w){if(w!==undefined){console.warn('THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.');return this.addVectors(v,w);}this.x+=v.x;this.y+=v.y;this.z+=v.z;return this;},addScalar:function addScalar(s){this.x+=s;this.y+=s;this.z+=s;return this;},addVectors:function addVectors(a,b){this.x=a.x+b.x;this.y=a.y+b.y;this.z=a.z+b.z;return this;},addScaledVector:function addScaledVector(v,s){this.x+=v.x*s;this.y+=v.y*s;this.z+=v.z*s;return this;},sub:function sub(v,w){if(w!==undefined){console.warn('THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.');return this.subVectors(v,w);}this.x-=v.x;this.y-=v.y;this.z-=v.z;return this;},subScalar:function subScalar(s){this.x-=s;this.y-=s;this.z-=s;return this;},subVectors:function subVectors(a,b){this.x=a.x-b.x;this.y=a.y-b.y;this.z=a.z-b.z;return this;},multiply:function multiply(v,w){if(w!==undefined){console.warn('THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.');return this.multiplyVectors(v,w);}this.x*=v.x;this.y*=v.y;this.z*=v.z;return this;},multiplyScalar:function multiplyScalar(scalar){if(isFinite(scalar)){this.x*=scalar;this.y*=scalar;this.z*=scalar;}else{this.x=0;this.y=0;this.z=0;}return this;},multiplyVectors:function multiplyVectors(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 quaternion;return function applyEuler(euler){if(euler instanceof THREE.Euler===false){console.error('THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.');}if(quaternion===undefined)quaternion=new THREE.Quaternion();return this.applyQuaternion(quaternion.setFromEuler(euler));};}(),applyAxisAngle:function(){var quaternion;return function applyAxisAngle(axis,angle){if(quaternion===undefined)quaternion=new THREE.Quaternion();return this.applyQuaternion(quaternion.setFromAxisAngle(axis,angle));};}(),applyMatrix3:function applyMatrix3(m){var x=this.x,y=this.y,z=this.z;var e=m.elements;this.x=e[0]*x+e[3]*y+e[6]*z;this.y=e[1]*x+e[4]*y+e[7]*z;this.z=e[2]*x+e[5]*y+e[8]*z;return this;},applyMatrix4:function applyMatrix4(m){// input: THREE.Matrix4 affine matrix\nvar x=this.x,y=this.y,z=this.z;var e=m.elements;this.x=e[0]*x+e[4]*y+e[8]*z+e[12];this.y=e[1]*x+e[5]*y+e[9]*z+e[13];this.z=e[2]*x+e[6]*y+e[10]*z+e[14];return this;},applyProjection:function applyProjection(m){// input: THREE.Matrix4 projection matrix\nvar x=this.x,y=this.y,z=this.z;var e=m.elements;var d=1/(e[3]*x+e[7]*y+e[11]*z+e[15]);// perspective divide\nthis.x=(e[0]*x+e[4]*y+e[8]*z+e[12])*d;this.y=(e[1]*x+e[5]*y+e[9]*z+e[13])*d;this.z=(e[2]*x+e[6]*y+e[10]*z+e[14])*d;return this;},applyQuaternion:function applyQuaternion(q){var x=this.x,y=this.y,z=this.z;var qx=q.x,qy=q.y,qz=q.z,qw=q.w;// calculate quat * vector\nvar ix=qw*x+qy*z-qz*y;var iy=qw*y+qz*x-qx*z;var iz=qw*z+qx*y-qy*x;var iw=-qx*x-qy*y-qz*z;// calculate result * inverse quat\nthis.x=ix*qw+iw*-qx+iy*-qz-iz*-qy;this.y=iy*qw+iw*-qy+iz*-qx-ix*-qz;this.z=iz*qw+iw*-qz+ix*-qy-iy*-qx;return this;},project:function(){var matrix;return function project(camera){if(matrix===undefined)matrix=new THREE.Matrix4();matrix.multiplyMatrices(camera.projectionMatrix,matrix.getInverse(camera.matrixWorld));return this.applyProjection(matrix);};}(),unproject:function(){var matrix;return function unproject(camera){if(matrix===undefined)matrix=new THREE.Matrix4();matrix.multiplyMatrices(camera.matrixWorld,matrix.getInverse(camera.projectionMatrix));return this.applyProjection(matrix);};}(),transformDirection:function transformDirection(m){// input: THREE.Matrix4 affine matrix\n// vector interpreted as a direction\nvar x=this.x,y=this.y,z=this.z;var e=m.elements;this.x=e[0]*x+e[4]*y+e[8]*z;this.y=e[1]*x+e[5]*y+e[9]*z;this.z=e[2]*x+e[6]*y+e[10]*z;return this.normalize();},divide:function divide(v){this.x/=v.x;this.y/=v.y;this.z/=v.z;return this;},divideScalar:function divideScalar(scalar){return this.multiplyScalar(1/scalar);},min:function min(v){this.x=Math.min(this.x,v.x);this.y=Math.min(this.y,v.y);this.z=Math.min(this.z,v.z);return this;},max:function max(v){this.x=Math.max(this.x,v.x);this.y=Math.max(this.y,v.y);this.z=Math.max(this.z,v.z);return this;},clamp:function clamp(min,max){// This function assumes min < max, if this assumption isn't true it will not operate correctly\nthis.x=Math.max(min.x,Math.min(max.x,this.x));this.y=Math.max(min.y,Math.min(max.y,this.y));this.z=Math.max(min.z,Math.min(max.z,this.z));return this;},clampScalar:function(){var min,max;return function clampScalar(minVal,maxVal){if(min===undefined){min=new THREE.Vector3();max=new THREE.Vector3();}min.set(minVal,minVal,minVal);max.set(maxVal,maxVal,maxVal);return this.clamp(min,max);};}(),clampLength:function clampLength(min,max){var length=this.length();return this.multiplyScalar(Math.max(min,Math.min(max,length))/length);},floor:function floor(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);this.z=Math.floor(this.z);return this;},ceil:function ceil(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);this.z=Math.ceil(this.z);return this;},round:function round(){this.x=Math.round(this.x);this.y=Math.round(this.y);this.z=Math.round(this.z);return this;},roundToZero:function roundToZero(){this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x);this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y);this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z);return this;},negate:function negate(){this.x=-this.x;this.y=-this.y;this.z=-this.z;return this;},dot:function dot(v){return this.x*v.x+this.y*v.y+this.z*v.z;},lengthSq:function lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z;},length:function length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z);},lengthManhattan:function lengthManhattan(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z);},normalize:function normalize(){return this.divideScalar(this.length());},setLength:function setLength(length){return this.multiplyScalar(length/this.length());},lerp:function lerp(v,alpha){this.x+=(v.x-this.x)*alpha;this.y+=(v.y-this.y)*alpha;this.z+=(v.z-this.z)*alpha;return this;},lerpVectors:function lerpVectors(v1,v2,alpha){return this.subVectors(v2,v1).multiplyScalar(alpha).add(v1);},cross:function cross(v,w){if(w!==undefined){console.warn('THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.');return this.crossVectors(v,w);}var x=this.x,y=this.y,z=this.z;this.x=y*v.z-z*v.y;this.y=z*v.x-x*v.z;this.z=x*v.y-y*v.x;return this;},crossVectors:function crossVectors(a,b){var ax=a.x,ay=a.y,az=a.z;var bx=b.x,by=b.y,bz=b.z;this.x=ay*bz-az*by;this.y=az*bx-ax*bz;this.z=ax*by-ay*bx;return this;},projectOnVector:function projectOnVector(vector){var scalar=vector.dot(this)/vector.lengthSq();return this.copy(vector).multiplyScalar(scalar);},projectOnPlane:function(){var v1;return function projectOnPlane(planeNormal){if(v1===undefined)v1=new THREE.Vector3();v1.copy(this).projectOnVector(planeNormal);return this.sub(v1);};}(),reflect:function(){// reflect incident vector off plane orthogonal to normal\n// normal is assumed to have unit length\nvar v1;return function reflect(normal){if(v1===undefined)v1=new THREE.Vector3();return this.sub(v1.copy(normal).multiplyScalar(2*this.dot(normal)));};}(),angleTo:function angleTo(v){var theta=this.dot(v)/Math.sqrt(this.lengthSq()*v.lengthSq());// clamp, to handle numerical problems\nreturn Math.acos(THREE.Math.clamp(theta,-1,1));},distanceTo:function distanceTo(v){return Math.sqrt(this.distanceToSquared(v));},distanceToSquared:function distanceToSquared(v){var dx=this.x-v.x,dy=this.y-v.y,dz=this.z-v.z;return dx*dx+dy*dy+dz*dz;},distanceToManhattan:function distanceToManhattan(v){return Math.abs(this.x-v.x)+Math.abs(this.y-v.y)+Math.abs(this.z-v.z);},setFromSpherical:function setFromSpherical(s){var sinPhiRadius=Math.sin(s.phi)*s.radius;this.x=sinPhiRadius*Math.sin(s.theta);this.y=Math.cos(s.phi)*s.radius;this.z=sinPhiRadius*Math.cos(s.theta);return this;},setFromMatrixPosition:function setFromMatrixPosition(m){return this.setFromMatrixColumn(m,3);},setFromMatrixScale:function setFromMatrixScale(m){var sx=this.setFromMatrixColumn(m,0).length();var sy=this.setFromMatrixColumn(m,1).length();var sz=this.setFromMatrixColumn(m,2).length();this.x=sx;this.y=sy;this.z=sz;return this;},setFromMatrixColumn:function setFromMatrixColumn(m,index){if(typeof m==='number'){console.warn('THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).');var temp=m;m=index;index=temp;}return this.fromArray(m.elements,index*4);},equals:function equals(v){return v.x===this.x&&v.y===this.y&&v.z===this.z;},fromArray:function fromArray(array,offset){if(offset===undefined)offset=0;this.x=array[offset];this.y=array[offset+1];this.z=array[offset+2];return this;},toArray:function toArray(array,offset){if(array===undefined)array=[];if(offset===undefined)offset=0;array[offset]=this.x;array[offset+1]=this.y;array[offset+2]=this.z;return array;},fromAttribute:function fromAttribute(attribute,index,offset){if(offset===undefined)offset=0;index=index*attribute.itemSize+offset;this.x=attribute.array[index];this.y=attribute.array[index+1];this.z=attribute.array[index+2];return this;}};// File:src/math/Vector4.js\n/**\n * @author supereggbert / http://www.paulbrunt.co.uk/\n * @author philogb / http://blog.thejit.org/\n * @author mikael emtinger / http://gomo.se/\n * @author egraether / http://egraether.com/\n * @author WestLangley / http://github.com/WestLangley\n */THREE.Vector4=function(x,y,z,w){this.x=x||0;this.y=y||0;this.z=z||0;this.w=w!==undefined?w:1;};THREE.Vector4.prototype={constructor:THREE.Vector4,set:function set(x,y,z,w){this.x=x;this.y=y;this.z=z;this.w=w;return this;},setScalar:function setScalar(scalar){this.x=scalar;this.y=scalar;this.z=scalar;this.w=scalar;return this;},setX:function setX(x){this.x=x;return this;},setY:function setY(y){this.y=y;return this;},setZ:function setZ(z){this.z=z;return this;},setW:function setW(w){this.w=w;return this;},setComponent:function setComponent(index,value){switch(index){case 0:this.x=value;break;case 1:this.y=value;break;case 2:this.z=value;break;case 3:this.w=value;break;default:throw new Error('index is out of range: '+index);}},getComponent:function getComponent(index){switch(index){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error('index is out of range: '+index);}},clone:function clone(){return new this.constructor(this.x,this.y,this.z,this.w);},copy:function copy(v){this.x=v.x;this.y=v.y;this.z=v.z;this.w=v.w!==undefined?v.w:1;return this;},add:function add(v,w){if(w!==undefined){console.warn('THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.');return this.addVectors(v,w);}this.x+=v.x;this.y+=v.y;this.z+=v.z;this.w+=v.w;return this;},addScalar:function addScalar(s){this.x+=s;this.y+=s;this.z+=s;this.w+=s;return this;},addVectors:function addVectors(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 addScaledVector(v,s){this.x+=v.x*s;this.y+=v.y*s;this.z+=v.z*s;this.w+=v.w*s;return this;},sub:function sub(v,w){if(w!==undefined){console.warn('THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.');return this.subVectors(v,w);}this.x-=v.x;this.y-=v.y;this.z-=v.z;this.w-=v.w;return this;},subScalar:function subScalar(s){this.x-=s;this.y-=s;this.z-=s;this.w-=s;return this;},subVectors:function subVectors(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 multiplyScalar(scalar){if(isFinite(scalar)){this.x*=scalar;this.y*=scalar;this.z*=scalar;this.w*=scalar;}else{this.x=0;this.y=0;this.z=0;this.w=0;}return this;},applyMatrix4:function applyMatrix4(m){var x=this.x,y=this.y,z=this.z,w=this.w;var e=m.elements;this.x=e[0]*x+e[4]*y+e[8]*z+e[12]*w;this.y=e[1]*x+e[5]*y+e[9]*z+e[13]*w;this.z=e[2]*x+e[6]*y+e[10]*z+e[14]*w;this.w=e[3]*x+e[7]*y+e[11]*z+e[15]*w;return this;},divideScalar:function divideScalar(scalar){return this.multiplyScalar(1/scalar);},setAxisAngleFromQuaternion:function setAxisAngleFromQuaternion(q){// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n// q is assumed to be normalized\nthis.w=2*Math.acos(q.w);var s=Math.sqrt(1-q.w*q.w);if(s<0.0001){this.x=1;this.y=0;this.z=0;}else{this.x=q.x/s;this.y=q.y/s;this.z=q.z/s;}return this;},setAxisAngleFromRotationMatrix:function setAxisAngleFromRotationMatrix(m){// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\nvar angle,x,y,z,// variables for result\nepsilon=0.01,// margin to allow for rounding errors\nepsilon2=0.1,// margin to distinguish between 0 and 180 degrees\nte=m.elements,m11=te[0],m12=te[4],m13=te[8],m21=te[1],m22=te[5],m23=te[9],m31=te[2],m32=te[6],m33=te[10];if(Math.abs(m12-m21)yy&&xx>zz){// m11 is the largest diagonal term\nif(xxzz){// m22 is the largest diagonal term\nif(yythis.max.x||point.ythis.max.y){return false;}return true;},containsBox:function containsBox(box){if(this.min.x<=box.min.x&&box.max.x<=this.max.x&&this.min.y<=box.min.y&&box.max.y<=this.max.y){return true;}return false;},getParameter:function getParameter(point,optionalTarget){// This can potentially have a divide by zero if the box\n// has a size dimension of 0.\nvar result=optionalTarget||new THREE.Vector2();return result.set((point.x-this.min.x)/(this.max.x-this.min.x),(point.y-this.min.y)/(this.max.y-this.min.y));},intersectsBox:function intersectsBox(box){// using 6 splitting planes to rule out intersections.\nif(box.max.xthis.max.x||box.max.ythis.max.y){return false;}return true;},clampPoint:function clampPoint(point,optionalTarget){var result=optionalTarget||new THREE.Vector2();return result.copy(point).clamp(this.min,this.max);},distanceToPoint:function(){var v1=new THREE.Vector2();return function distanceToPoint(point){var clampedPoint=v1.copy(point).clamp(this.min,this.max);return clampedPoint.sub(point).length();};}(),intersect:function intersect(box){this.min.max(box.min);this.max.min(box.max);return this;},union:function union(box){this.min.min(box.min);this.max.max(box.max);return this;},translate:function translate(offset){this.min.add(offset);this.max.add(offset);return this;},equals:function equals(box){return box.min.equals(this.min)&&box.max.equals(this.max);}};// File:src/math/Box3.js\n/**\n * @author bhouston / http://clara.io\n * @author WestLangley / http://github.com/WestLangley\n */THREE.Box3=function(min,max){this.min=min!==undefined?min:new THREE.Vector3(+Infinity,+Infinity,+Infinity);this.max=max!==undefined?max:new THREE.Vector3(-Infinity,-Infinity,-Infinity);};THREE.Box3.prototype={constructor:THREE.Box3,set:function set(min,max){this.min.copy(min);this.max.copy(max);return this;},setFromArray:function setFromArray(array){var minX=+Infinity;var minY=+Infinity;var minZ=+Infinity;var maxX=-Infinity;var maxY=-Infinity;var maxZ=-Infinity;for(var i=0,l=array.length;imaxX)maxX=x;if(y>maxY)maxY=y;if(z>maxZ)maxZ=z;}this.min.set(minX,minY,minZ);this.max.set(maxX,maxY,maxZ);},setFromPoints:function setFromPoints(points){this.makeEmpty();for(var i=0,il=points.length;ithis.max.x||point.ythis.max.y||point.zthis.max.z){return false;}return true;},containsBox:function containsBox(box){if(this.min.x<=box.min.x&&box.max.x<=this.max.x&&this.min.y<=box.min.y&&box.max.y<=this.max.y&&this.min.z<=box.min.z&&box.max.z<=this.max.z){return true;}return false;},getParameter:function getParameter(point,optionalTarget){// This can potentially have a divide by zero if the box\n// has a size dimension of 0.\nvar result=optionalTarget||new THREE.Vector3();return result.set((point.x-this.min.x)/(this.max.x-this.min.x),(point.y-this.min.y)/(this.max.y-this.min.y),(point.z-this.min.z)/(this.max.z-this.min.z));},intersectsBox:function intersectsBox(box){// using 6 splitting planes to rule out intersections.\nif(box.max.xthis.max.x||box.max.ythis.max.y||box.max.zthis.max.z){return false;}return true;},intersectsSphere:function(){var closestPoint;return function intersectsSphere(sphere){if(closestPoint===undefined)closestPoint=new THREE.Vector3();// Find the point on the AABB closest to the sphere center.\nthis.clampPoint(sphere.center,closestPoint);// If that point is inside the sphere, the AABB and sphere intersect.\nreturn closestPoint.distanceToSquared(sphere.center)<=sphere.radius*sphere.radius;};}(),intersectsPlane:function intersectsPlane(plane){// We compute the minimum and maximum dot product values. If those values\n// are on the same side (back or front) of the plane, then there is no intersection.\nvar min,max;if(plane.normal.x>0){min=plane.normal.x*this.min.x;max=plane.normal.x*this.max.x;}else{min=plane.normal.x*this.max.x;max=plane.normal.x*this.min.x;}if(plane.normal.y>0){min+=plane.normal.y*this.min.y;max+=plane.normal.y*this.max.y;}else{min+=plane.normal.y*this.max.y;max+=plane.normal.y*this.min.y;}if(plane.normal.z>0){min+=plane.normal.z*this.min.z;max+=plane.normal.z*this.max.z;}else{min+=plane.normal.z*this.max.z;max+=plane.normal.z*this.min.z;}return min<=plane.constant&&max>=plane.constant;},clampPoint:function clampPoint(point,optionalTarget){var result=optionalTarget||new THREE.Vector3();return result.copy(point).clamp(this.min,this.max);},distanceToPoint:function(){var v1=new THREE.Vector3();return function distanceToPoint(point){var clampedPoint=v1.copy(point).clamp(this.min,this.max);return clampedPoint.sub(point).length();};}(),getBoundingSphere:function(){var v1=new THREE.Vector3();return function getBoundingSphere(optionalTarget){var result=optionalTarget||new THREE.Sphere();result.center=this.center();result.radius=this.size(v1).length()*0.5;return result;};}(),intersect:function intersect(box){this.min.max(box.min);this.max.min(box.max);// ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\nif(this.isEmpty())this.makeEmpty();return this;},union:function union(box){this.min.min(box.min);this.max.max(box.max);return this;},applyMatrix4:function(){var points=[new THREE.Vector3(),new THREE.Vector3(),new THREE.Vector3(),new THREE.Vector3(),new THREE.Vector3(),new THREE.Vector3(),new THREE.Vector3(),new THREE.Vector3()];return function applyMatrix4(matrix){// transform of empty box is an empty box.\nif(this.isEmpty())return this;// NOTE: I am using a binary pattern to specify all 2^3 combinations below\npoints[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(matrix);// 000\npoints[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(matrix);// 001\npoints[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(matrix);// 010\npoints[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(matrix);// 011\npoints[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(matrix);// 100\npoints[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(matrix);// 101\npoints[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(matrix);// 110\npoints[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(matrix);// 111\nthis.setFromPoints(points);return this;};}(),translate:function translate(offset){this.min.add(offset);this.max.add(offset);return this;},equals:function equals(box){return box.min.equals(this.min)&&box.max.equals(this.max);}};// File:src/math/Matrix3.js\n/**\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n * @author bhouston / http://clara.io\n * @author tschw\n */THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]);if(arguments.length>0){console.error('THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.');}};THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function set(n11,n12,n13,n21,n22,n23,n31,n32,n33){var te=this.elements;te[0]=n11;te[1]=n21;te[2]=n31;te[3]=n12;te[4]=n22;te[5]=n32;te[6]=n13;te[7]=n23;te[8]=n33;return this;},identity:function identity(){this.set(1,0,0,0,1,0,0,0,1);return this;},clone:function clone(){return new this.constructor().fromArray(this.elements);},copy:function copy(m){var me=m.elements;this.set(me[0],me[3],me[6],me[1],me[4],me[7],me[2],me[5],me[8]);return this;},setFromMatrix4:function setFromMatrix4(m){var me=m.elements;this.set(me[0],me[4],me[8],me[1],me[5],me[9],me[2],me[6],me[10]);return this;},applyToVector3Array:function(){var v1;return function applyToVector3Array(array,offset,length){if(v1===undefined)v1=new THREE.Vector3();if(offset===undefined)offset=0;if(length===undefined)length=array.length;for(var i=0,j=offset;i0){console.error('THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.');}};THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function set(n11,n12,n13,n14,n21,n22,n23,n24,n31,n32,n33,n34,n41,n42,n43,n44){var te=this.elements;te[0]=n11;te[4]=n12;te[8]=n13;te[12]=n14;te[1]=n21;te[5]=n22;te[9]=n23;te[13]=n24;te[2]=n31;te[6]=n32;te[10]=n33;te[14]=n34;te[3]=n41;te[7]=n42;te[11]=n43;te[15]=n44;return this;},identity:function identity(){this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);return this;},clone:function clone(){return new THREE.Matrix4().fromArray(this.elements);},copy:function copy(m){this.elements.set(m.elements);return this;},copyPosition:function copyPosition(m){var te=this.elements;var me=m.elements;te[12]=me[12];te[13]=me[13];te[14]=me[14];return this;},extractBasis:function extractBasis(xAxis,yAxis,zAxis){xAxis.setFromMatrixColumn(this,0);yAxis.setFromMatrixColumn(this,1);zAxis.setFromMatrixColumn(this,2);return this;},makeBasis:function makeBasis(xAxis,yAxis,zAxis){this.set(xAxis.x,yAxis.x,zAxis.x,0,xAxis.y,yAxis.y,zAxis.y,0,xAxis.z,yAxis.z,zAxis.z,0,0,0,0,1);return this;},extractRotation:function(){var v1;return function extractRotation(m){if(v1===undefined)v1=new THREE.Vector3();var te=this.elements;var me=m.elements;var scaleX=1/v1.setFromMatrixColumn(m,0).length();var scaleY=1/v1.setFromMatrixColumn(m,1).length();var scaleZ=1/v1.setFromMatrixColumn(m,2).length();te[0]=me[0]*scaleX;te[1]=me[1]*scaleX;te[2]=me[2]*scaleX;te[4]=me[4]*scaleY;te[5]=me[5]*scaleY;te[6]=me[6]*scaleY;te[8]=me[8]*scaleZ;te[9]=me[9]*scaleZ;te[10]=me[10]*scaleZ;return this;};}(),makeRotationFromEuler:function makeRotationFromEuler(euler){if(euler instanceof THREE.Euler===false){console.error('THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.');}var te=this.elements;var x=euler.x,y=euler.y,z=euler.z;var a=Math.cos(x),b=Math.sin(x);var c=Math.cos(y),d=Math.sin(y);var e=Math.cos(z),f=Math.sin(z);if(euler.order==='XYZ'){var ae=a*e,af=a*f,be=b*e,bf=b*f;te[0]=c*e;te[4]=-c*f;te[8]=d;te[1]=af+be*d;te[5]=ae-bf*d;te[9]=-b*c;te[2]=bf-ae*d;te[6]=be+af*d;te[10]=a*c;}else if(euler.order==='YXZ'){var ce=c*e,cf=c*f,de=d*e,df=d*f;te[0]=ce+df*b;te[4]=de*b-cf;te[8]=a*d;te[1]=a*f;te[5]=a*e;te[9]=-b;te[2]=cf*b-de;te[6]=df+ce*b;te[10]=a*c;}else if(euler.order==='ZXY'){var ce=c*e,cf=c*f,de=d*e,df=d*f;te[0]=ce-df*b;te[4]=-a*f;te[8]=de+cf*b;te[1]=cf+de*b;te[5]=a*e;te[9]=df-ce*b;te[2]=-a*d;te[6]=b;te[10]=a*c;}else if(euler.order==='ZYX'){var ae=a*e,af=a*f,be=b*e,bf=b*f;te[0]=c*e;te[4]=be*d-af;te[8]=ae*d+bf;te[1]=c*f;te[5]=bf*d+ae;te[9]=af*d-be;te[2]=-d;te[6]=b*c;te[10]=a*c;}else if(euler.order==='YZX'){var ac=a*c,ad=a*d,bc=b*c,bd=b*d;te[0]=c*e;te[4]=bd-ac*f;te[8]=bc*f+ad;te[1]=f;te[5]=a*e;te[9]=-b*e;te[2]=-d*e;te[6]=ad*f+bc;te[10]=ac-bd*f;}else if(euler.order==='XZY'){var ac=a*c,ad=a*d,bc=b*c,bd=b*d;te[0]=c*e;te[4]=-f;te[8]=d*e;te[1]=ac*f+bd;te[5]=a*e;te[9]=ad*f-bc;te[2]=bc*f-ad;te[6]=b*e;te[10]=bd*f+ac;}// last column\nte[3]=0;te[7]=0;te[11]=0;// bottom row\nte[12]=0;te[13]=0;te[14]=0;te[15]=1;return this;},makeRotationFromQuaternion:function makeRotationFromQuaternion(q){var te=this.elements;var x=q.x,y=q.y,z=q.z,w=q.w;var x2=x+x,y2=y+y,z2=z+z;var xx=x*x2,xy=x*y2,xz=x*z2;var yy=y*y2,yz=y*z2,zz=z*z2;var wx=w*x2,wy=w*y2,wz=w*z2;te[0]=1-(yy+zz);te[4]=xy-wz;te[8]=xz+wy;te[1]=xy+wz;te[5]=1-(xx+zz);te[9]=yz-wx;te[2]=xz-wy;te[6]=yz+wx;te[10]=1-(xx+yy);// last column\nte[3]=0;te[7]=0;te[11]=0;// bottom row\nte[12]=0;te[13]=0;te[14]=0;te[15]=1;return this;},lookAt:function(){var x,y,z;return function lookAt(eye,target,up){if(x===undefined){x=new THREE.Vector3();y=new THREE.Vector3();z=new THREE.Vector3();}var te=this.elements;z.subVectors(eye,target).normalize();if(z.lengthSq()===0){z.z=1;}x.crossVectors(up,z).normalize();if(x.lengthSq()===0){z.z+=0.0001;x.crossVectors(up,z).normalize();}y.crossVectors(z,x);te[0]=x.x;te[4]=y.x;te[8]=z.x;te[1]=x.y;te[5]=y.y;te[9]=z.y;te[2]=x.z;te[6]=y.z;te[10]=z.z;return this;};}(),multiply:function multiply(m,n){if(n!==undefined){console.warn('THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.');return this.multiplyMatrices(m,n);}return this.multiplyMatrices(this,m);},premultiply:function premultiply(m){return this.multiplyMatrices(m,this);},multiplyMatrices:function multiplyMatrices(a,b){var ae=a.elements;var be=b.elements;var te=this.elements;var a11=ae[0],a12=ae[4],a13=ae[8],a14=ae[12];var a21=ae[1],a22=ae[5],a23=ae[9],a24=ae[13];var a31=ae[2],a32=ae[6],a33=ae[10],a34=ae[14];var a41=ae[3],a42=ae[7],a43=ae[11],a44=ae[15];var b11=be[0],b12=be[4],b13=be[8],b14=be[12];var b21=be[1],b22=be[5],b23=be[9],b24=be[13];var b31=be[2],b32=be[6],b33=be[10],b34=be[14];var b41=be[3],b42=be[7],b43=be[11],b44=be[15];te[0]=a11*b11+a12*b21+a13*b31+a14*b41;te[4]=a11*b12+a12*b22+a13*b32+a14*b42;te[8]=a11*b13+a12*b23+a13*b33+a14*b43;te[12]=a11*b14+a12*b24+a13*b34+a14*b44;te[1]=a21*b11+a22*b21+a23*b31+a24*b41;te[5]=a21*b12+a22*b22+a23*b32+a24*b42;te[9]=a21*b13+a22*b23+a23*b33+a24*b43;te[13]=a21*b14+a22*b24+a23*b34+a24*b44;te[2]=a31*b11+a32*b21+a33*b31+a34*b41;te[6]=a31*b12+a32*b22+a33*b32+a34*b42;te[10]=a31*b13+a32*b23+a33*b33+a34*b43;te[14]=a31*b14+a32*b24+a33*b34+a34*b44;te[3]=a41*b11+a42*b21+a43*b31+a44*b41;te[7]=a41*b12+a42*b22+a43*b32+a44*b42;te[11]=a41*b13+a42*b23+a43*b33+a44*b43;te[15]=a41*b14+a42*b24+a43*b34+a44*b44;return this;},multiplyToArray:function multiplyToArray(a,b,r){var te=this.elements;this.multiplyMatrices(a,b);r[0]=te[0];r[1]=te[1];r[2]=te[2];r[3]=te[3];r[4]=te[4];r[5]=te[5];r[6]=te[6];r[7]=te[7];r[8]=te[8];r[9]=te[9];r[10]=te[10];r[11]=te[11];r[12]=te[12];r[13]=te[13];r[14]=te[14];r[15]=te[15];return this;},multiplyScalar:function multiplyScalar(s){var te=this.elements;te[0]*=s;te[4]*=s;te[8]*=s;te[12]*=s;te[1]*=s;te[5]*=s;te[9]*=s;te[13]*=s;te[2]*=s;te[6]*=s;te[10]*=s;te[14]*=s;te[3]*=s;te[7]*=s;te[11]*=s;te[15]*=s;return this;},applyToVector3Array:function(){var v1;return function applyToVector3Array(array,offset,length){if(v1===undefined)v1=new THREE.Vector3();if(offset===undefined)offset=0;if(length===undefined)length=array.length;for(var i=0,j=offset;i0){// The ray and segment are not parallel.\ns0=a01*b1-b0;s1=a01*b0-b1;extDet=segExtent*det;if(s0>=0){if(s1>=-extDet){if(s1<=extDet){// region 0\n// Minimum at interior points of ray and segment.\nvar invDet=1/det;s0*=invDet;s1*=invDet;sqrDist=s0*(s0+a01*s1+2*b0)+s1*(a01*s0+s1+2*b1)+c;}else{// region 1\ns1=segExtent;s0=Math.max(0,-(a01*s1+b0));sqrDist=-s0*s0+s1*(s1+2*b1)+c;}}else{// region 5\ns1=-segExtent;s0=Math.max(0,-(a01*s1+b0));sqrDist=-s0*s0+s1*(s1+2*b1)+c;}}else{if(s1<=-extDet){// region 4\ns0=Math.max(0,-(-a01*segExtent+b0));s1=s0>0?-segExtent:Math.min(Math.max(-segExtent,-b1),segExtent);sqrDist=-s0*s0+s1*(s1+2*b1)+c;}else if(s1<=extDet){// region 3\ns0=0;s1=Math.min(Math.max(-segExtent,-b1),segExtent);sqrDist=s1*(s1+2*b1)+c;}else{// region 2\ns0=Math.max(0,-(a01*segExtent+b0));s1=s0>0?segExtent:Math.min(Math.max(-segExtent,-b1),segExtent);sqrDist=-s0*s0+s1*(s1+2*b1)+c;}}}else{// Ray and segment are parallel.\ns1=a01>0?-segExtent:segExtent;s0=Math.max(0,-(a01*s1+b0));sqrDist=-s0*s0+s1*(s1+2*b1)+c;}if(optionalPointOnRay){optionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);}if(optionalPointOnSegment){optionalPointOnSegment.copy(segDir).multiplyScalar(s1).add(segCenter);}return sqrDist;};}(),intersectSphere:function(){var v1=new THREE.Vector3();return function intersectSphere(sphere,optionalTarget){v1.subVectors(sphere.center,this.origin);var tca=v1.dot(this.direction);var d2=v1.dot(v1)-tca*tca;var radius2=sphere.radius*sphere.radius;if(d2>radius2)return null;var thc=Math.sqrt(radius2-d2);// t0 = first intersect point - entrance on front of sphere\nvar t0=tca-thc;// t1 = second intersect point - exit point on back of sphere\nvar t1=tca+thc;// test to see if both t0 and t1 are behind the ray - if so, return null\nif(t0<0&&t1<0)return null;// test to see if t0 is behind the ray:\n// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n// in order to always return an intersect point that is in front of the ray.\nif(t0<0)return this.at(t1,optionalTarget);// else t0 is in front of the ray, so return the first collision point scaled by t0\nreturn this.at(t0,optionalTarget);};}(),intersectsSphere:function intersectsSphere(sphere){return this.distanceToPoint(sphere.center)<=sphere.radius;},distanceToPlane:function distanceToPlane(plane){var denominator=plane.normal.dot(this.direction);if(denominator===0){// line is coplanar, return origin\nif(plane.distanceToPoint(this.origin)===0){return 0;}// Null is preferable to undefined since undefined means.... it is undefined\nreturn null;}var t=-(this.origin.dot(plane.normal)+plane.constant)/denominator;// Return if the ray never intersects the plane\nreturn t>=0?t:null;},intersectPlane:function intersectPlane(plane,optionalTarget){var t=this.distanceToPlane(plane);if(t===null){return null;}return this.at(t,optionalTarget);},intersectsPlane:function intersectsPlane(plane){// check if the ray lies on the plane first\nvar distToPoint=plane.distanceToPoint(this.origin);if(distToPoint===0){return true;}var denominator=plane.normal.dot(this.direction);if(denominator*distToPoint<0){return true;}// ray origin is behind the plane (and is pointing behind it)\nreturn false;},intersectBox:function intersectBox(box,optionalTarget){var tmin,tmax,tymin,tymax,tzmin,tzmax;var invdirx=1/this.direction.x,invdiry=1/this.direction.y,invdirz=1/this.direction.z;var origin=this.origin;if(invdirx>=0){tmin=(box.min.x-origin.x)*invdirx;tmax=(box.max.x-origin.x)*invdirx;}else{tmin=(box.max.x-origin.x)*invdirx;tmax=(box.min.x-origin.x)*invdirx;}if(invdiry>=0){tymin=(box.min.y-origin.y)*invdiry;tymax=(box.max.y-origin.y)*invdiry;}else{tymin=(box.max.y-origin.y)*invdiry;tymax=(box.min.y-origin.y)*invdiry;}if(tmin>tymax||tymin>tmax)return null;// These lines also handle the case where tmin or tmax is NaN\n// (result of 0 * Infinity). x !== x returns true if x is NaN\nif(tymin>tmin||tmin!==tmin)tmin=tymin;if(tymax=0){tzmin=(box.min.z-origin.z)*invdirz;tzmax=(box.max.z-origin.z)*invdirz;}else{tzmin=(box.max.z-origin.z)*invdirz;tzmax=(box.min.z-origin.z)*invdirz;}if(tmin>tzmax||tzmin>tmax)return null;if(tzmin>tmin||tmin!==tmin)tmin=tzmin;if(tzmax=0?tmin:tmax,optionalTarget);},intersectsBox:function(){var v=new THREE.Vector3();return function intersectsBox(box){return this.intersectBox(box,v)!==null;};}(),intersectTriangle:function(){// Compute the offset origin, edges, and normal.\nvar diff=new THREE.Vector3();var edge1=new THREE.Vector3();var edge2=new THREE.Vector3();var normal=new THREE.Vector3();return function intersectTriangle(a,b,c,backfaceCulling,optionalTarget){// from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\nedge1.subVectors(b,a);edge2.subVectors(c,a);normal.crossVectors(edge1,edge2);// Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n// |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n// |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n// |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\nvar DdN=this.direction.dot(normal);var sign;if(DdN>0){if(backfaceCulling)return null;sign=1;}else if(DdN<0){sign=-1;DdN=-DdN;}else{return null;}diff.subVectors(this.origin,a);var DdQxE2=sign*this.direction.dot(edge2.crossVectors(diff,edge2));// b1 < 0, no intersection\nif(DdQxE2<0){return null;}var DdE1xQ=sign*this.direction.dot(edge1.cross(diff));// b2 < 0, no intersection\nif(DdE1xQ<0){return null;}// b1+b2 > 1, no intersection\nif(DdQxE2+DdE1xQ>DdN){return null;}// Line intersects triangle, check if ray does.\nvar QdN=-sign*diff.dot(normal);// t < 0, no intersection\nif(QdN<0){return null;}// Ray intersects triangle.\nreturn this.at(QdN/DdN,optionalTarget);};}(),applyMatrix4:function applyMatrix4(matrix4){this.direction.add(this.origin).applyMatrix4(matrix4);this.origin.applyMatrix4(matrix4);this.direction.sub(this.origin);this.direction.normalize();return this;},equals:function equals(ray){return ray.origin.equals(this.origin)&&ray.direction.equals(this.direction);}};// File:src/math/Sphere.js\n/**\n * @author bhouston / http://clara.io\n * @author mrdoob / http://mrdoob.com/\n */THREE.Sphere=function(center,radius){this.center=center!==undefined?center:new THREE.Vector3();this.radius=radius!==undefined?radius:0;};THREE.Sphere.prototype={constructor:THREE.Sphere,set:function set(center,radius){this.center.copy(center);this.radius=radius;return this;},setFromPoints:function(){var box=new THREE.Box3();return function setFromPoints(points,optionalCenter){var center=this.center;if(optionalCenter!==undefined){center.copy(optionalCenter);}else{box.setFromPoints(points).center(center);}var maxRadiusSq=0;for(var i=0,il=points.length;ithis.radius*this.radius){result.sub(this.center).normalize();result.multiplyScalar(this.radius).add(this.center);}return result;},getBoundingBox:function getBoundingBox(optionalTarget){var box=optionalTarget||new THREE.Box3();box.set(this.center,this.center);box.expandByScalar(this.radius);return box;},applyMatrix4:function applyMatrix4(matrix){this.center.applyMatrix4(matrix);this.radius=this.radius*matrix.getMaxScaleOnAxis();return this;},translate:function translate(offset){this.center.add(offset);return this;},equals:function equals(sphere){return sphere.center.equals(this.center)&&sphere.radius===this.radius;}};// File:src/math/Frustum.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n * @author bhouston / http://clara.io\n */THREE.Frustum=function(p0,p1,p2,p3,p4,p5){this.planes=[p0!==undefined?p0:new THREE.Plane(),p1!==undefined?p1:new THREE.Plane(),p2!==undefined?p2:new THREE.Plane(),p3!==undefined?p3:new THREE.Plane(),p4!==undefined?p4:new THREE.Plane(),p5!==undefined?p5:new THREE.Plane()];};THREE.Frustum.prototype={constructor:THREE.Frustum,set:function set(p0,p1,p2,p3,p4,p5){var planes=this.planes;planes[0].copy(p0);planes[1].copy(p1);planes[2].copy(p2);planes[3].copy(p3);planes[4].copy(p4);planes[5].copy(p5);return this;},clone:function clone(){return new this.constructor().copy(this);},copy:function copy(frustum){var planes=this.planes;for(var i=0;i<6;i++){planes[i].copy(frustum.planes[i]);}return this;},setFromMatrix:function setFromMatrix(m){var planes=this.planes;var me=m.elements;var me0=me[0],me1=me[1],me2=me[2],me3=me[3];var me4=me[4],me5=me[5],me6=me[6],me7=me[7];var me8=me[8],me9=me[9],me10=me[10],me11=me[11];var me12=me[12],me13=me[13],me14=me[14],me15=me[15];planes[0].setComponents(me3-me0,me7-me4,me11-me8,me15-me12).normalize();planes[1].setComponents(me3+me0,me7+me4,me11+me8,me15+me12).normalize();planes[2].setComponents(me3+me1,me7+me5,me11+me9,me15+me13).normalize();planes[3].setComponents(me3-me1,me7-me5,me11-me9,me15-me13).normalize();planes[4].setComponents(me3-me2,me7-me6,me11-me10,me15-me14).normalize();planes[5].setComponents(me3+me2,me7+me6,me11+me10,me15+me14).normalize();return this;},intersectsObject:function(){var sphere=new THREE.Sphere();return function intersectsObject(object){var geometry=object.geometry;if(geometry.boundingSphere===null)geometry.computeBoundingSphere();sphere.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld);return this.intersectsSphere(sphere);};}(),intersectsSprite:function(){var sphere=new THREE.Sphere();return function intersectsSprite(sprite){sphere.center.set(0,0,0);sphere.radius=0.7071067811865476;sphere.applyMatrix4(sprite.matrixWorld);return this.intersectsSphere(sphere);};}(),intersectsSphere:function intersectsSphere(sphere){var planes=this.planes;var center=sphere.center;var negRadius=-sphere.radius;for(var i=0;i<6;i++){var distance=planes[i].distanceToPoint(center);if(distance0?box.min.x:box.max.x;p2.x=plane.normal.x>0?box.max.x:box.min.x;p1.y=plane.normal.y>0?box.min.y:box.max.y;p2.y=plane.normal.y>0?box.max.y:box.min.y;p1.z=plane.normal.z>0?box.min.z:box.max.z;p2.z=plane.normal.z>0?box.max.z:box.min.z;var d1=plane.distanceToPoint(p1);var d2=plane.distanceToPoint(p2);// if both outside plane, no intersection\nif(d1<0&&d2<0){return false;}}return true;};}(),containsPoint:function containsPoint(point){var planes=this.planes;for(var i=0;i<6;i++){if(planes[i].distanceToPoint(point)<0){return false;}}return true;}};// File:src/math/Plane.js\n/**\n * @author bhouston / http://clara.io\n */THREE.Plane=function(normal,constant){this.normal=normal!==undefined?normal:new THREE.Vector3(1,0,0);this.constant=constant!==undefined?constant:0;};THREE.Plane.prototype={constructor:THREE.Plane,set:function set(normal,constant){this.normal.copy(normal);this.constant=constant;return this;},setComponents:function setComponents(x,y,z,w){this.normal.set(x,y,z);this.constant=w;return this;},setFromNormalAndCoplanarPoint:function setFromNormalAndCoplanarPoint(normal,point){this.normal.copy(normal);this.constant=-point.dot(this.normal);// must be this.normal, not normal, as this.normal is normalized\nreturn this;},setFromCoplanarPoints:function(){var v1=new THREE.Vector3();var v2=new THREE.Vector3();return function setFromCoplanarPoints(a,b,c){var normal=v1.subVectors(c,b).cross(v2.subVectors(a,b)).normalize();// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\nthis.setFromNormalAndCoplanarPoint(normal,a);return this;};}(),clone:function clone(){return new this.constructor().copy(this);},copy:function copy(plane){this.normal.copy(plane.normal);this.constant=plane.constant;return this;},normalize:function normalize(){// Note: will lead to a divide by zero if the plane is invalid.\nvar inverseNormalLength=1.0/this.normal.length();this.normal.multiplyScalar(inverseNormalLength);this.constant*=inverseNormalLength;return this;},negate:function negate(){this.constant*=-1;this.normal.negate();return this;},distanceToPoint:function distanceToPoint(point){return this.normal.dot(point)+this.constant;},distanceToSphere:function distanceToSphere(sphere){return this.distanceToPoint(sphere.center)-sphere.radius;},projectPoint:function projectPoint(point,optionalTarget){return this.orthoPoint(point,optionalTarget).sub(point).negate();},orthoPoint:function orthoPoint(point,optionalTarget){var perpendicularMagnitude=this.distanceToPoint(point);var result=optionalTarget||new THREE.Vector3();return result.copy(this.normal).multiplyScalar(perpendicularMagnitude);},intersectLine:function(){var v1=new THREE.Vector3();return function intersectLine(line,optionalTarget){var result=optionalTarget||new THREE.Vector3();var direction=line.delta(v1);var denominator=this.normal.dot(direction);if(denominator===0){// line is coplanar, return origin\nif(this.distanceToPoint(line.start)===0){return result.copy(line.start);}// Unsure if this is the correct method to handle this case.\nreturn undefined;}var t=-(line.start.dot(this.normal)+this.constant)/denominator;if(t<0||t>1){return undefined;}return result.copy(direction).multiplyScalar(t).add(line.start);};}(),intersectsLine:function intersectsLine(line){// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\nvar startSign=this.distanceToPoint(line.start);var endSign=this.distanceToPoint(line.end);return startSign<0&&endSign>0||endSign<0&&startSign>0;},intersectsBox:function intersectsBox(box){return box.intersectsPlane(this);},intersectsSphere:function intersectsSphere(sphere){return sphere.intersectsPlane(this);},coplanarPoint:function coplanarPoint(optionalTarget){var result=optionalTarget||new THREE.Vector3();return result.copy(this.normal).multiplyScalar(-this.constant);},applyMatrix4:function(){var v1=new THREE.Vector3();var m1=new THREE.Matrix3();return function applyMatrix4(matrix,optionalNormalMatrix){var referencePoint=this.coplanarPoint(v1).applyMatrix4(matrix);// transform normal based on theory here:\n// http://www.songho.ca/opengl/gl_normaltransform.html\nvar normalMatrix=optionalNormalMatrix||m1.getNormalMatrix(matrix);var normal=this.normal.applyMatrix3(normalMatrix).normalize();// recalculate constant (like in setFromNormalAndCoplanarPoint)\nthis.constant=-referencePoint.dot(normal);return this;};}(),translate:function translate(offset){this.constant=this.constant-offset.dot(this.normal);return this;},equals:function equals(plane){return plane.normal.equals(this.normal)&&plane.constant===this.constant;}};// File:src/math/Spherical.js\n/**\n * @author bhouston / http://clara.io\n * @author WestLangley / http://github.com/WestLangley\n *\n * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\n *\n * The poles (phi) are at the positive and negative y axis.\n * The equator starts at positive z.\n */THREE.Spherical=function(radius,phi,theta){this.radius=radius!==undefined?radius:1.0;this.phi=phi!==undefined?phi:0;// up / down towards top and bottom pole\nthis.theta=theta!==undefined?theta:0;// around the equator of the sphere\nreturn this;};THREE.Spherical.prototype={constructor:THREE.Spherical,set:function set(radius,phi,theta){this.radius=radius;this.phi=phi;this.theta=theta;return this;},clone:function clone(){return new this.constructor().copy(this);},copy:function copy(other){this.radius.copy(other.radius);this.phi.copy(other.phi);this.theta.copy(other.theta);return this;},// restrict phi to be betwee EPS and PI-EPS\nmakeSafe:function makeSafe(){var EPS=0.000001;this.phi=Math.max(EPS,Math.min(Math.PI-EPS,this.phi));return this;},setFromVector3:function setFromVector3(vec3){this.radius=vec3.length();if(this.radius===0){this.theta=0;this.phi=0;}else{this.theta=Math.atan2(vec3.x,vec3.z);// equator angle around y-up axis\nthis.phi=Math.acos(THREE.Math.clamp(vec3.y/this.radius,-1,1));// polar angle\n}return this;}};// File:src/math/Math.js\n/**\n * @author alteredq / http://alteredqualia.com/\n * @author mrdoob / http://mrdoob.com/\n */THREE.Math={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){// http://www.broofa.com/Tools/Math.uuid.htm\nvar chars='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');var uuid=new Array(36);var rnd=0,r;return function generateUUID(){for(var i=0;i<36;i++){if(i===8||i===13||i===18||i===23){uuid[i]='-';}else if(i===14){uuid[i]='4';}else{if(rnd<=0x02)rnd=0x2000000+Math.random()*0x1000000|0;r=rnd&0xf;rnd=rnd>>4;uuid[i]=chars[i===19?r&0x3|0x8:r];}}return uuid.join('');};}(),clamp:function clamp(value,min,max){return Math.max(min,Math.min(max,value));},// compute euclidian modulo of m % n\n// https://en.wikipedia.org/wiki/Modulo_operation\neuclideanModulo:function euclideanModulo(n,m){return(n%m+m)%m;},// Linear mapping from range to range \nmapLinear:function mapLinear(x,a1,a2,b1,b2){return b1+(x-a1)*(b2-b1)/(a2-a1);},// http://en.wikipedia.org/wiki/Smoothstep\nsmoothstep:function smoothstep(x,min,max){if(x<=min)return 0;if(x>=max)return 1;x=(x-min)/(max-min);return x*x*(3-2*x);},smootherstep:function smootherstep(x,min,max){if(x<=min)return 0;if(x>=max)return 1;x=(x-min)/(max-min);return x*x*x*(x*(x*6-15)+10);},random16:function random16(){console.warn('THREE.Math.random16() has been deprecated. Use Math.random() instead.');return Math.random();},// Random integer from interval\nrandInt:function randInt(low,high){return low+Math.floor(Math.random()*(high-low+1));},// Random float from interval\nrandFloat:function randFloat(low,high){return low+Math.random()*(high-low);},// Random float from <-range/2, range/2> interval\nrandFloatSpread:function randFloatSpread(range){return range*(0.5-Math.random());},degToRad:function degToRad(degrees){return degrees*THREE.Math.DEG2RAD;},radToDeg:function radToDeg(radians){return radians*THREE.Math.RAD2DEG;},isPowerOfTwo:function isPowerOfTwo(value){return(value&value-1)===0&&value!==0;},nearestPowerOfTwo:function nearestPowerOfTwo(value){return Math.pow(2,Math.round(Math.log(value)/Math.LN2));},nextPowerOfTwo:function nextPowerOfTwo(value){value--;value|=value>>1;value|=value>>2;value|=value>>4;value|=value>>8;value|=value>>16;value++;return value;}};// File:src/math/Spline.js\n/**\n * Spline from Tween.js, slightly optimized (and trashed)\n * http://sole.github.com/tween.js/examples/05_spline.html\n *\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n */THREE.Spline=function(points){this.points=points;var c=[],v3={x:0,y:0,z:0},point,intPoint,weight,w2,w3,pa,pb,pc,pd;this.initFromArray=function(a){this.points=[];for(var i=0;ithis.points.length-2?this.points.length-1:intPoint+1;c[3]=intPoint>this.points.length-3?this.points.length-1:intPoint+2;pa=this.points[c[0]];pb=this.points[c[1]];pc=this.points[c[2]];pd=this.points[c[3]];w2=weight*weight;w3=weight*w2;v3.x=interpolate(pa.x,pb.x,pc.x,pd.x,weight,w2,w3);v3.y=interpolate(pa.y,pb.y,pc.y,pd.y,weight,w2,w3);v3.z=interpolate(pa.z,pb.z,pc.z,pd.z,weight,w2,w3);return v3;};this.getControlPointsArray=function(){var i,p,l=this.points.length,coords=[];for(i=0;i0){return result.multiplyScalar(1/Math.sqrt(resultLengthSq));}return result.set(0,0,0);};}();// static/instance method to calculate barycentric coordinates\n// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\nTHREE.Triangle.barycoordFromPoint=function(){var v0=new THREE.Vector3();var v1=new THREE.Vector3();var v2=new THREE.Vector3();return function barycoordFromPoint(point,a,b,c,optionalTarget){v0.subVectors(c,a);v1.subVectors(b,a);v2.subVectors(point,a);var dot00=v0.dot(v0);var dot01=v0.dot(v1);var dot02=v0.dot(v2);var dot11=v1.dot(v1);var dot12=v1.dot(v2);var denom=dot00*dot11-dot01*dot01;var result=optionalTarget||new THREE.Vector3();// collinear or singular triangle\nif(denom===0){// arbitrary location outside of triangle?\n// not sure if this is the best idea, maybe should be returning undefined\nreturn result.set(-2,-1,-1);}var invDenom=1/denom;var u=(dot11*dot02-dot01*dot12)*invDenom;var v=(dot00*dot12-dot01*dot02)*invDenom;// barycentric coordinates must always sum to 1\nreturn result.set(1-u-v,v,u);};}();THREE.Triangle.containsPoint=function(){var v1=new THREE.Vector3();return function containsPoint(point,a,b,c){var result=THREE.Triangle.barycoordFromPoint(point,a,b,c,v1);return result.x>=0&&result.y>=0&&result.x+result.y<=1;};}();THREE.Triangle.prototype={constructor:THREE.Triangle,set:function set(a,b,c){this.a.copy(a);this.b.copy(b);this.c.copy(c);return this;},setFromPointsAndIndices:function setFromPointsAndIndices(points,i0,i1,i2){this.a.copy(points[i0]);this.b.copy(points[i1]);this.c.copy(points[i2]);return this;},clone:function clone(){return new this.constructor().copy(this);},copy:function copy(triangle){this.a.copy(triangle.a);this.b.copy(triangle.b);this.c.copy(triangle.c);return this;},area:function(){var v0=new THREE.Vector3();var v1=new THREE.Vector3();return function area(){v0.subVectors(this.c,this.b);v1.subVectors(this.a,this.b);return v0.cross(v1).length()*0.5;};}(),midpoint:function midpoint(optionalTarget){var result=optionalTarget||new THREE.Vector3();return result.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3);},normal:function normal(optionalTarget){return THREE.Triangle.normal(this.a,this.b,this.c,optionalTarget);},plane:function plane(optionalTarget){var result=optionalTarget||new THREE.Plane();return result.setFromCoplanarPoints(this.a,this.b,this.c);},barycoordFromPoint:function barycoordFromPoint(point,optionalTarget){return THREE.Triangle.barycoordFromPoint(point,this.a,this.b,this.c,optionalTarget);},containsPoint:function containsPoint(point){return THREE.Triangle.containsPoint(point,this.a,this.b,this.c);},closestPointToPoint:function(){var plane,edgeList,projectedPoint,closestPoint;return function closestPointToPoint(point,optionalTarget){if(plane===undefined){plane=new THREE.Plane();edgeList=[new THREE.Line3(),new THREE.Line3(),new THREE.Line3()];projectedPoint=new THREE.Vector3();closestPoint=new THREE.Vector3();}var result=optionalTarget||new THREE.Vector3();var minDistance=Infinity;// project the point onto the plane of the triangle\nplane.setFromCoplanarPoints(this.a,this.b,this.c);plane.projectPoint(point,projectedPoint);// check if the projection lies within the triangle\nif(this.containsPoint(projectedPoint)===true){// if so, this is the closest point\nresult.copy(projectedPoint);}else{// if not, the point falls outside the triangle. the result is the closest point to the triangle's edges or vertices\nedgeList[0].set(this.a,this.b);edgeList[1].set(this.b,this.c);edgeList[2].set(this.c,this.a);for(var i=0;i= t1 || t1 === undefined ) {\nforward_scan:if(!(t=t0)){// looping?\nvar t1global=pp[1];if(t=t0){// we have arrived at the sought interval\nbreak seek;}}// prepare binary search on the left side of the index\nright=i1;i1=0;break linear_scan;}// the interval is valid\nbreak validate_interval;}// linear scan\n// binary search\nwhile(i1>>1;if(t1){for(var i=0;i1){for(var i=0;i0){object.children=[];for(var i=0;i0)output.geometries=geometries;if(materials.length>0)output.materials=materials;if(textures.length>0)output.textures=textures;if(images.length>0)output.images=images;}output.object=object;return output;// extract data from the cache hash\n// remove metadata on each item\n// and return as array\nfunction extractFromCache(cache){var values=[];for(var key in cache){var data=cache[key];delete data.metadata;values.push(data);}return values;}},clone:function clone(recursive){return new this.constructor().copy(this,recursive);},copy:function copy(source,recursive){if(recursive===undefined)recursive=true;this.name=source.name;this.up.copy(source.up);this.position.copy(source.position);this.quaternion.copy(source.quaternion);this.scale.copy(source.scale);this.matrix.copy(source.matrix);this.matrixWorld.copy(source.matrixWorld);this.matrixAutoUpdate=source.matrixAutoUpdate;this.matrixWorldNeedsUpdate=source.matrixWorldNeedsUpdate;this.visible=source.visible;this.castShadow=source.castShadow;this.receiveShadow=source.receiveShadow;this.frustumCulled=source.frustumCulled;this.renderOrder=source.renderOrder;this.userData=JSON.parse(JSON.stringify(source.userData));if(recursive===true){for(var i=0;i0){for(var i=0;i0){this.normalsNeedUpdate=true;}},computeMorphNormals:function computeMorphNormals(){var i,il,f,fl,face;// save original normals\n// - create temp variables on first access\n// otherwise just copy (for faster repeated calls)\nfor(f=0,fl=this.faces.length;f0){d+=vertices[i].distanceTo(vertices[i-1]);}this.lineDistances[i]=d;}},computeBoundingBox:function computeBoundingBox(){if(this.boundingBox===null){this.boundingBox=new THREE.Box3();}this.boundingBox.setFromPoints(this.vertices);},computeBoundingSphere:function computeBoundingSphere(){if(this.boundingSphere===null){this.boundingSphere=new THREE.Sphere();}this.boundingSphere.setFromPoints(this.vertices);},merge:function merge(geometry,matrix,materialIndexOffset){if(geometry instanceof THREE.Geometry===false){console.error('THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.',geometry);return;}var normalMatrix,vertexOffset=this.vertices.length,vertices1=this.vertices,vertices2=geometry.vertices,faces1=this.faces,faces2=geometry.faces,uvs1=this.faceVertexUvs[0],uvs2=geometry.faceVertexUvs[0];if(materialIndexOffset===undefined)materialIndexOffset=0;if(matrix!==undefined){normalMatrix=new THREE.Matrix3().getNormalMatrix(matrix);}// vertices\nfor(var i=0,il=vertices2.length;i=0;i--){var idx=faceIndicesToRemove[i];this.faces.splice(idx,1);for(j=0,jl=this.faceVertexUvs.length;j0;var hasFaceVertexNormal=face.vertexNormals.length>0;var hasFaceColor=face.color.r!==1||face.color.g!==1||face.color.b!==1;var hasFaceVertexColor=face.vertexColors.length>0;var faceType=0;faceType=setBit(faceType,0,0);// isQuad\nfaceType=setBit(faceType,1,hasMaterial);faceType=setBit(faceType,2,hasFaceUv);faceType=setBit(faceType,3,hasFaceVertexUv);faceType=setBit(faceType,4,hasFaceNormal);faceType=setBit(faceType,5,hasFaceVertexNormal);faceType=setBit(faceType,6,hasFaceColor);faceType=setBit(faceType,7,hasFaceVertexColor);faces.push(faceType);faces.push(face.a,face.b,face.c);faces.push(face.materialIndex);if(hasFaceVertexUv){var faceVertexUvs=this.faceVertexUvs[0][i];faces.push(getUvIndex(faceVertexUvs[0]),getUvIndex(faceVertexUvs[1]),getUvIndex(faceVertexUvs[2]));}if(hasFaceNormal){faces.push(getNormalIndex(face.normal));}if(hasFaceVertexNormal){var vertexNormals=face.vertexNormals;faces.push(getNormalIndex(vertexNormals[0]),getNormalIndex(vertexNormals[1]),getNormalIndex(vertexNormals[2]));}if(hasFaceColor){faces.push(getColorIndex(face.color));}if(hasFaceVertexColor){var vertexColors=face.vertexColors;faces.push(getColorIndex(vertexColors[0]),getColorIndex(vertexColors[1]),getColorIndex(vertexColors[2]));}}function setBit(value,position,enabled){return enabled?value|1<0)data.data.colors=colors;if(uvs.length>0)data.data.uvs=[uvs];// temporal backward compatibility\ndata.data.faces=faces;return data;},clone:function clone(){/*\n\t\t// Handle primitives\n\n\t\tvar parameters = this.parameters;\n\n\t\tif ( parameters !== undefined ) {\n\n\t\t\tvar values = [];\n\n\t\t\tfor ( var key in parameters ) {\n\n\t\t\t\tvalues.push( parameters[ key ] );\n\n\t\t\t}\n\n\t\t\tvar geometry = Object.create( this.constructor.prototype );\n\t\t\tthis.constructor.apply( geometry, values );\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\treturn new this.constructor().copy( this );\n\t\t*/return new THREE.Geometry().copy(this);},copy:function copy(source){this.vertices=[];this.faces=[];this.faceVertexUvs=[[]];var vertices=source.vertices;for(var i=0,il=vertices.length;i0;var hasFaceVertexUv2=faceVertexUvs[1]&&faceVertexUvs[1].length>0;// morphs\nvar morphTargets=geometry.morphTargets;var morphTargetsLength=morphTargets.length;var morphTargetsPosition;if(morphTargetsLength>0){morphTargetsPosition=[];for(var i=0;i0){morphTargetsNormal=[];for(var i=0;i0){var normals=new Float32Array(geometry.normals.length*3);this.addAttribute('normal',new THREE.BufferAttribute(normals,3).copyVector3sArray(geometry.normals));}if(geometry.colors.length>0){var colors=new Float32Array(geometry.colors.length*3);this.addAttribute('color',new THREE.BufferAttribute(colors,3).copyColorsArray(geometry.colors));}if(geometry.uvs.length>0){var uvs=new Float32Array(geometry.uvs.length*2);this.addAttribute('uv',new THREE.BufferAttribute(uvs,2).copyVector2sArray(geometry.uvs));}if(geometry.uvs2.length>0){var uvs2=new Float32Array(geometry.uvs2.length*2);this.addAttribute('uv2',new THREE.BufferAttribute(uvs2,2).copyVector2sArray(geometry.uvs2));}if(geometry.indices.length>0){var TypeArray=geometry.vertices.length>65535?Uint32Array:Uint16Array;var indices=new TypeArray(geometry.indices.length*3);this.setIndex(new THREE.BufferAttribute(indices,1).copyIndicesArray(geometry.indices));}// groups\nthis.groups=geometry.groups;// morphs\nfor(var name in geometry.morphTargets){var array=[];var morphTargets=geometry.morphTargets[name];for(var i=0,l=morphTargets.length;i0){var skinIndices=new THREE.Float32Attribute(geometry.skinIndices.length*4,4);this.addAttribute('skinIndex',skinIndices.copyVector4sArray(geometry.skinIndices));}if(geometry.skinWeights.length>0){var skinWeights=new THREE.Float32Attribute(geometry.skinWeights.length*4,4);this.addAttribute('skinWeight',skinWeights.copyVector4sArray(geometry.skinWeights));}//\nif(geometry.boundingSphere!==null){this.boundingSphere=geometry.boundingSphere.clone();}if(geometry.boundingBox!==null){this.boundingBox=geometry.boundingBox.clone();}return this;},computeBoundingBox:function computeBoundingBox(){if(this.boundingBox===null){this.boundingBox=new THREE.Box3();}var positions=this.attributes.position.array;if(positions!==undefined){this.boundingBox.setFromArray(positions);}else{this.boundingBox.makeEmpty();}if(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)){console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.',this);}},computeBoundingSphere:function(){var box=new THREE.Box3();var vector=new THREE.Vector3();return function computeBoundingSphere(){if(this.boundingSphere===null){this.boundingSphere=new THREE.Sphere();}var positions=this.attributes.position;if(positions){var array=positions.array;var center=this.boundingSphere.center;box.setFromArray(array);box.center(center);// hoping to find a boundingSphere with a radius smaller than the\n// boundingSphere of the boundingBox: sqrt(3) smaller in the best case\nvar maxRadiusSq=0;for(var i=0,il=array.length;i0){data.data.groups=JSON.parse(JSON.stringify(groups));}var boundingSphere=this.boundingSphere;if(boundingSphere!==null){data.data.boundingSphere={center:boundingSphere.center.toArray(),radius:boundingSphere.radius};}return data;},clone:function clone(){/*\n\t\t// Handle primitives\n\n\t\tvar parameters = this.parameters;\n\n\t\tif ( parameters !== undefined ) {\n\n\t\t\tvar values = [];\n\n\t\t\tfor ( var key in parameters ) {\n\n\t\t\t\tvalues.push( parameters[ key ] );\n\n\t\t\t}\n\n\t\t\tvar geometry = Object.create( this.constructor.prototype );\n\t\t\tthis.constructor.apply( geometry, values );\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\treturn new this.constructor().copy( this );\n\t\t*/return new THREE.BufferGeometry().copy(this);},copy:function copy(source){var index=source.index;if(index!==null){this.setIndex(index.clone());}var attributes=source.attributes;for(var name in attributes){var attribute=attributes[name];this.addAttribute(name,attribute.clone());}var groups=source.groups;for(var i=0,l=groups.length;i zero effective time scale\nthis.enabled=true;// true -> zero effective weight\nthis.clampWhenFinished=false;// keep feeding the last frame?\nthis.zeroSlopeAtStart=true;// for smooth interpolation w/o separate\nthis.zeroSlopeAtEnd=true;// clips for start, loop and end\n};THREE.AnimationAction._new.prototype={constructor:THREE.AnimationAction._new,// State & Scheduling\nplay:function play(){this._mixer._activateAction(this);return this;},stop:function stop(){this._mixer._deactivateAction(this);return this.reset();},reset:function reset(){this.paused=false;this.enabled=true;this.time=0;// restart clip\nthis._loopCount=-1;// forget previous loops\nthis._startTime=null;// forget scheduling\nreturn this.stopFading().stopWarping();},isRunning:function isRunning(){var start=this._startTime;return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this);},// return true when play has been called\nisScheduled:function isScheduled(){return this._mixer._isActiveAction(this);},startAt:function startAt(time){this._startTime=time;return this;},setLoop:function setLoop(mode,repetitions){this.loop=mode;this.repetitions=repetitions;return this;},// Weight\n// set the weight stopping any scheduled fading\n// although .enabled = false yields an effective weight of zero, this\n// method does *not* change .enabled, because it would be confusing\nsetEffectiveWeight:function setEffectiveWeight(weight){this.weight=weight;// note: same logic as when updated at runtime\nthis._effectiveWeight=this.enabled?weight:0;return this.stopFading();},// return the weight considering fading and .enabled\ngetEffectiveWeight:function getEffectiveWeight(){return this._effectiveWeight;},fadeIn:function fadeIn(duration){return this._scheduleFading(duration,0,1);},fadeOut:function fadeOut(duration){return this._scheduleFading(duration,1,0);},crossFadeFrom:function crossFadeFrom(fadeOutAction,duration,warp){var mixer=this._mixer;fadeOutAction.fadeOut(duration);this.fadeIn(duration);if(warp){var fadeInDuration=this._clip.duration,fadeOutDuration=fadeOutAction._clip.duration,startEndRatio=fadeOutDuration/fadeInDuration,endStartRatio=fadeInDuration/fadeOutDuration;fadeOutAction.warp(1.0,startEndRatio,duration);this.warp(endStartRatio,1.0,duration);}return this;},crossFadeTo:function crossFadeTo(fadeInAction,duration,warp){return fadeInAction.crossFadeFrom(this,duration,warp);},stopFading:function stopFading(){var weightInterpolant=this._weightInterpolant;if(weightInterpolant!==null){this._weightInterpolant=null;this._mixer._takeBackControlInterpolant(weightInterpolant);}return this;},// Time Scale Control\n// set the weight stopping any scheduled warping\n// although .paused = true yields an effective time scale of zero, this\n// method does *not* change .paused, because it would be confusing\nsetEffectiveTimeScale:function setEffectiveTimeScale(timeScale){this.timeScale=timeScale;this._effectiveTimeScale=this.paused?0:timeScale;return this.stopWarping();},// return the time scale considering warping and .paused\ngetEffectiveTimeScale:function getEffectiveTimeScale(){return this._effectiveTimeScale;},setDuration:function setDuration(duration){this.timeScale=this._clip.duration/duration;return this.stopWarping();},syncWith:function syncWith(action){this.time=action.time;this.timeScale=action.timeScale;return this.stopWarping();},halt:function halt(duration){return this.warp(this._effectiveTimeScale,0,duration);},warp:function warp(startTimeScale,endTimeScale,duration){var mixer=this._mixer,now=mixer.time,interpolant=this._timeScaleInterpolant,timeScale=this.timeScale;if(interpolant===null){interpolant=mixer._lendControlInterpolant(),this._timeScaleInterpolant=interpolant;}var times=interpolant.parameterPositions,values=interpolant.sampleValues;times[0]=now;times[1]=now+duration;values[0]=startTimeScale/timeScale;values[1]=endTimeScale/timeScale;return this;},stopWarping:function stopWarping(){var timeScaleInterpolant=this._timeScaleInterpolant;if(timeScaleInterpolant!==null){this._timeScaleInterpolant=null;this._mixer._takeBackControlInterpolant(timeScaleInterpolant);}return this;},// Object Accessors\ngetMixer:function getMixer(){return this._mixer;},getClip:function getClip(){return this._clip;},getRoot:function getRoot(){return this._localRoot||this._mixer._root;},// Interna\n_update:function _update(time,deltaTime,timeDirection,accuIndex){// called by the mixer\nvar startTime=this._startTime;if(startTime!==null){// check for scheduled start of action\nvar timeRunning=(time-startTime)*timeDirection;if(timeRunning<0||timeDirection===0){return;// yet to come / don't decide when delta = 0\n}// start\nthis._startTime=null;// unschedule\ndeltaTime=timeDirection*timeRunning;}// apply time scale and advance time\ndeltaTime*=this._updateTimeScale(time);var clipTime=this._updateTime(deltaTime);// note: _updateTime may disable the action resulting in\n// an effective weight of 0\nvar weight=this._updateWeight(time);if(weight>0){var interpolants=this._interpolants;var propertyMixers=this._propertyBindings;for(var j=0,m=interpolants.length;j!==m;++j){interpolants[j].evaluate(clipTime);propertyMixers[j].accumulate(accuIndex,weight);}}},_updateWeight:function _updateWeight(time){var weight=0;if(this.enabled){weight=this.weight;var interpolant=this._weightInterpolant;if(interpolant!==null){var interpolantValue=interpolant.evaluate(time)[0];weight*=interpolantValue;if(time>interpolant.parameterPositions[1]){this.stopFading();if(interpolantValue===0){// faded out, disable\nthis.enabled=false;}}}}this._effectiveWeight=weight;return weight;},_updateTimeScale:function _updateTimeScale(time){var timeScale=0;if(!this.paused){timeScale=this.timeScale;var interpolant=this._timeScaleInterpolant;if(interpolant!==null){var interpolantValue=interpolant.evaluate(time)[0];timeScale*=interpolantValue;if(time>interpolant.parameterPositions[1]){this.stopWarping();if(timeScale===0){// motion has halted, pause\nthis.paused=true;}else{// warp done - apply final time scale\nthis.timeScale=timeScale;}}}}this._effectiveTimeScale=timeScale;return timeScale;},_updateTime:function _updateTime(deltaTime){var time=this.time+deltaTime;if(deltaTime===0)return time;var duration=this._clip.duration,loop=this.loop,loopCount=this._loopCount;if(loop===THREE.LoopOnce){if(loopCount===-1){// just started\nthis.loopCount=0;this._setEndings(true,true,false);}handle_stop:{if(time>=duration){time=duration;}else if(time<0){time=0;}else break handle_stop;if(this.clampWhenFinished)this.paused=true;else this.enabled=false;this._mixer.dispatchEvent({type:'finished',action:this,direction:deltaTime<0?-1:1});}}else{// repetitive Repeat or PingPong\nvar pingPong=loop===THREE.LoopPingPong;if(loopCount===-1){// just started\nif(deltaTime>=0){loopCount=0;this._setEndings(true,this.repetitions===0,pingPong);}else{// when looping in reverse direction, the initial\n// transition through zero counts as a repetition,\n// so leave loopCount at -1\nthis._setEndings(this.repetitions===0,true,pingPong);}}if(time>=duration||time<0){// wrap around\nvar loopDelta=Math.floor(time/duration);// signed\ntime-=duration*loopDelta;loopCount+=Math.abs(loopDelta);var pending=this.repetitions-loopCount;if(pending<0){// have to stop (switch state, clamp time, fire event)\nif(this.clampWhenFinished)this.paused=true;else this.enabled=false;time=deltaTime>0?duration:0;this._mixer.dispatchEvent({type:'finished',action:this,direction:deltaTime>0?1:-1});}else{// keep running\nif(pending===0){// entering the last round\nvar atStart=deltaTime<0;this._setEndings(atStart,!atStart,pingPong);}else{this._setEndings(false,false,pingPong);}this._loopCount=loopCount;this._mixer.dispatchEvent({type:'loop',action:this,loopDelta:loopDelta});}}if(pingPong&&(loopCount&1)===1){// invert time for the \"pong round\"\nthis.time=time;return duration-time;}}this.time=time;return time;},_setEndings:function _setEndings(atStart,atEnd,pingPong){var settings=this._interpolantSettings;if(pingPong){settings.endingStart=THREE.ZeroSlopeEnding;settings.endingEnd=THREE.ZeroSlopeEnding;}else{// assuming for LoopOnce atStart == atEnd == true\nif(atStart){settings.endingStart=this.zeroSlopeAtStart?THREE.ZeroSlopeEnding:THREE.ZeroCurvatureEnding;}else{settings.endingStart=THREE.WrapAroundEnding;}if(atEnd){settings.endingEnd=this.zeroSlopeAtEnd?THREE.ZeroSlopeEnding:THREE.ZeroCurvatureEnding;}else{settings.endingEnd=THREE.WrapAroundEnding;}}},_scheduleFading:function _scheduleFading(duration,weightNow,weightThen){var mixer=this._mixer,now=mixer.time,interpolant=this._weightInterpolant;if(interpolant===null){interpolant=mixer._lendControlInterpolant(),this._weightInterpolant=interpolant;}var times=interpolant.parameterPositions,values=interpolant.sampleValues;times[0]=now;values[0]=weightNow;times[1]=now+duration;values[1]=weightThen;return this;}};// File:src/animation/AnimationClip.js\n/**\n *\n * Reusable set of Tracks that represent an animation.\n *\n * @author Ben Houston / http://clara.io/\n * @author David Sarno / http://lighthaus.us/\n */THREE.AnimationClip=function(name,duration,tracks){this.name=name;this.tracks=tracks;this.duration=duration!==undefined?duration:-1;this.uuid=THREE.Math.generateUUID();// this means it should figure out its duration by scanning the tracks\nif(this.duration<0){this.resetDuration();}// maybe only do these on demand, as doing them here could potentially slow down loading\n// but leaving these here during development as this ensures a lot of testing of these functions\nthis.trim();this.optimize();};THREE.AnimationClip.prototype={constructor:THREE.AnimationClip,resetDuration:function resetDuration(){var tracks=this.tracks,duration=0;for(var i=0,n=tracks.length;i!==n;++i){var track=this.tracks[i];duration=Math.max(duration,track.times[track.times.length-1]);}this.duration=duration;},trim:function trim(){for(var i=0;i1){var name=parts[1];var animationMorphTargets=animationToMorphTargets[name];if(!animationMorphTargets){animationToMorphTargets[name]=animationMorphTargets=[];}animationMorphTargets.push(morphTarget);}}var clips=[];for(var name in animationToMorphTargets){clips.push(THREE.AnimationClip.CreateFromMorphTargetSequence(name,animationToMorphTargets[name],fps,noLoop));}return clips;},// parse the animation.hierarchy format\nparseAnimation:function parseAnimation(animation,bones,nodeName){if(!animation){console.error(\" no animation in JSONLoader data\");return null;}var addNonemptyTrack=function addNonemptyTrack(trackType,trackName,animationKeys,propertyName,destTracks){// only return track if there are actually keys.\nif(animationKeys.length!==0){var times=[];var values=[];THREE.AnimationUtils.flattenJSON(animationKeys,times,values,propertyName);// empty keys are filtered out, so check again\nif(times.length!==0){destTracks.push(new trackType(trackName,times,values));}}};var tracks=[];var clipName=animation.name||'default';// automatic length determination in AnimationClip.\nvar duration=animation.length||-1;var fps=animation.fps||30;var hierarchyTracks=animation.hierarchy||[];for(var h=0;h rebind\nvar rootUuid=(action._localRoot||this._root).uuid,clipUuid=action._clip.uuid,actionsForClip=this._actionsByClip[clipUuid];this._bindAction(action,actionsForClip&&actionsForClip.knownActions[0]);this._addInactiveAction(action,clipUuid,rootUuid);}var bindings=action._propertyBindings;// increment reference counts / sort out state\nfor(var i=0,n=bindings.length;i!==n;++i){var binding=bindings[i];if(binding.useCount++===0){this._lendBinding(binding);binding.saveOriginalState();}}this._lendAction(action);}},_deactivateAction:function _deactivateAction(action){if(this._isActiveAction(action)){var bindings=action._propertyBindings;// decrement reference counts / sort out state\nfor(var i=0,n=bindings.length;i!==n;++i){var binding=bindings[i];if(--binding.useCount===0){binding.restoreOriginalState();this._takeBackBinding(binding);}}this._takeBackAction(action);}},// Memory manager\n_initMemoryManager:function _initMemoryManager(){this._actions=[];// 'nActiveActions' followed by inactive ones\nthis._nActiveActions=0;this._actionsByClip={};// inside:\n// {\n// \t\tknownActions: Array< _Action >\t- used as prototypes\n// \t\tactionByRoot: _Action\t\t\t- lookup\n// }\nthis._bindings=[];// 'nActiveBindings' followed by inactive ones\nthis._nActiveBindings=0;this._bindingsByRootAndName={};// inside: Map< name, PropertyMixer >\nthis._controlInterpolants=[];// same game as above\nthis._nActiveControlInterpolants=0;var scope=this;this.stats={actions:{get total(){return scope._actions.length;},get inUse(){return scope._nActiveActions;}},bindings:{get total(){return scope._bindings.length;},get inUse(){return scope._nActiveBindings;}},controlInterpolants:{get total(){return scope._controlInterpolants.length;},get inUse(){return scope._nActiveControlInterpolants;}}};},// Memory management for _Action objects\n_isActiveAction:function _isActiveAction(action){var index=action._cacheIndex;return index!==null&&index| inactive actions ]\n// s a\n// <-swap->\n// a s\nvar actions=this._actions,prevIndex=action._cacheIndex,lastActiveIndex=this._nActiveActions++,firstInactiveAction=actions[lastActiveIndex];action._cacheIndex=lastActiveIndex;actions[lastActiveIndex]=action;firstInactiveAction._cacheIndex=prevIndex;actions[prevIndex]=firstInactiveAction;},_takeBackAction:function _takeBackAction(action){// [ active actions | inactive actions ]\n// [ active actions |< inactive actions ]\n// a s\n// <-swap->\n// s a\nvar actions=this._actions,prevIndex=action._cacheIndex,firstInactiveIndex=--this._nActiveActions,lastActiveAction=actions[firstInactiveIndex];action._cacheIndex=firstInactiveIndex;actions[firstInactiveIndex]=action;lastActiveAction._cacheIndex=prevIndex;actions[prevIndex]=lastActiveAction;},// Memory management for PropertyMixer objects\n_addInactiveBinding:function _addInactiveBinding(binding,rootUuid,trackName){var bindingsByRoot=this._bindingsByRootAndName,bindingByName=bindingsByRoot[rootUuid],bindings=this._bindings;if(bindingByName===undefined){bindingByName={};bindingsByRoot[rootUuid]=bindingByName;}bindingByName[trackName]=binding;binding._cacheIndex=bindings.length;bindings.push(binding);},_removeInactiveBinding:function _removeInactiveBinding(binding){var bindings=this._bindings,propBinding=binding.binding,rootUuid=propBinding.rootNode.uuid,trackName=propBinding.path,bindingsByRoot=this._bindingsByRootAndName,bindingByName=bindingsByRoot[rootUuid],lastInactiveBinding=bindings[bindings.length-1],cacheIndex=binding._cacheIndex;lastInactiveBinding._cacheIndex=cacheIndex;bindings[cacheIndex]=lastInactiveBinding;bindings.pop();delete bindingByName[trackName];remove_empty_map:{for(var _ in bindingByName){break remove_empty_map;}delete bindingsByRoot[rootUuid];}},_lendBinding:function _lendBinding(binding){var bindings=this._bindings,prevIndex=binding._cacheIndex,lastActiveIndex=this._nActiveBindings++,firstInactiveBinding=bindings[lastActiveIndex];binding._cacheIndex=lastActiveIndex;bindings[lastActiveIndex]=binding;firstInactiveBinding._cacheIndex=prevIndex;bindings[prevIndex]=firstInactiveBinding;},_takeBackBinding:function _takeBackBinding(binding){var bindings=this._bindings,prevIndex=binding._cacheIndex,firstInactiveIndex=--this._nActiveBindings,lastActiveBinding=bindings[firstInactiveIndex];binding._cacheIndex=firstInactiveIndex;bindings[firstInactiveIndex]=binding;lastActiveBinding._cacheIndex=prevIndex;bindings[prevIndex]=lastActiveBinding;},// Memory management of Interpolants for weight and time scale\n_lendControlInterpolant:function _lendControlInterpolant(){var interpolants=this._controlInterpolants,lastActiveIndex=this._nActiveControlInterpolants++,interpolant=interpolants[lastActiveIndex];if(interpolant===undefined){interpolant=new THREE.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer);interpolant.__cacheIndex=lastActiveIndex;interpolants[lastActiveIndex]=interpolant;}return interpolant;},_takeBackControlInterpolant:function _takeBackControlInterpolant(interpolant){var interpolants=this._controlInterpolants,prevIndex=interpolant.__cacheIndex,firstInactiveIndex=--this._nActiveControlInterpolants,lastActiveInterpolant=interpolants[firstInactiveIndex];interpolant.__cacheIndex=firstInactiveIndex;interpolants[firstInactiveIndex]=interpolant;lastActiveInterpolant.__cacheIndex=prevIndex;interpolants[prevIndex]=lastActiveInterpolant;},_controlInterpolantsResultBuffer:new Float32Array(1)});// File:src/animation/AnimationObjectGroup.js\n/**\n *\n * A group of objects that receives a shared animation state.\n *\n * Usage:\n *\n * \t-\tAdd objects you would otherwise pass as 'root' to the\n * \t\tconstructor or the .clipAction method of AnimationMixer.\n *\n * \t-\tInstead pass this object as 'root'.\n *\n * \t-\tYou can also add and remove objects later when the mixer\n * \t\tis running.\n *\n * Note:\n *\n * \tObjects of this class appear as one object to the mixer,\n * \tso cache control of the individual objects must be done\n * \ton the group.\n *\n * Limitation:\n *\n * \t- \tThe animated properties must be compatible among the\n * \t\tall objects in the group.\n *\n * -\tA single property can either be controlled through a\n * \ttarget group or directly, but not both.\n *\n * @author tschw\n */THREE.AnimationObjectGroup=function(var_args){this.uuid=THREE.Math.generateUUID();// cached objects followed by the active ones\nthis._objects=Array.prototype.slice.call(arguments);this.nCachedObjects_=0;// threshold\n// note: read by PropertyBinding.Composite\nvar indices={};this._indicesByUUID=indices;// for bookkeeping\nfor(var i=0,n=arguments.length;i!==n;++i){indices[arguments[i].uuid]=i;}this._paths=[];// inside: string\nthis._parsedPaths=[];// inside: { we don't care, here }\nthis._bindings=[];// inside: Array< PropertyBinding >\nthis._bindingsIndicesByPath={};// inside: indices in these arrays\nvar scope=this;this.stats={objects:{get total(){return scope._objects.length;},get inUse(){return this.total-scope.nCachedObjects_;}},get bindingsPerObject(){return scope._bindings.length;}};};THREE.AnimationObjectGroup.prototype={constructor:THREE.AnimationObjectGroup,add:function add(var_args){var objects=this._objects,nObjects=objects.length,nCachedObjects=this.nCachedObjects_,indicesByUUID=this._indicesByUUID,paths=this._paths,parsedPaths=this._parsedPaths,bindings=this._bindings,nBindings=bindings.length;for(var i=0,n=arguments.length;i!==n;++i){var object=arguments[i],uuid=object.uuid,index=indicesByUUID[uuid];if(index===undefined){// unknown object -> add it to the ACTIVE region\nindex=nObjects++;indicesByUUID[uuid]=index;objects.push(object);// accounting is done, now do the same for all bindings\nfor(var j=0,m=nBindings;j!==m;++j){bindings[j].push(new THREE.PropertyBinding(object,paths[j],parsedPaths[j]));}}else if(index=nCachedObjects){// move existing object into the CACHED region\nvar lastCachedIndex=nCachedObjects++,firstActiveObject=objects[lastCachedIndex];indicesByUUID[firstActiveObject.uuid]=index;objects[index]=firstActiveObject;indicesByUUID[uuid]=lastCachedIndex;objects[lastCachedIndex]=object;// accounting is done, now do the same for all bindings\nfor(var j=0,m=nBindings;j!==m;++j){var bindingsForPath=bindings[j],firstActive=bindingsForPath[lastCachedIndex],binding=bindingsForPath[index];bindingsForPath[index]=firstActive;bindingsForPath[lastCachedIndex]=binding;}}}// for arguments\nthis.nCachedObjects_=nCachedObjects;},// remove & forget\nuncache:function uncache(var_args){var objects=this._objects,nObjects=objects.length,nCachedObjects=this.nCachedObjects_,indicesByUUID=this._indicesByUUID,bindings=this._bindings,nBindings=bindings.length;for(var i=0,n=arguments.length;i!==n;++i){var object=arguments[i],uuid=object.uuid,index=indicesByUUID[uuid];if(index!==undefined){delete indicesByUUID[uuid];if(index seconds conversions)\nscale:function scale(timeScale){if(timeScale!==1.0){var times=this.times;for(var i=0,n=times.length;i!==n;++i){times[i]*=timeScale;}}return this;},// removes keyframes before and after animation without changing any values within the range [startTime, endTime].\n// IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values\ntrim:function trim(startTime,endTime){var times=this.times,nKeys=times.length,from=0,to=nKeys-1;while(from!==nKeys&×[from]endTime){--to;}++to;// inclusive -> exclusive bound\nif(from!==0||to!==nKeys){// empty tracks are forbidden, so keep at least one keyframe\nif(from>=to)to=Math.max(to,1),from=to-1;var stride=this.getValueSize();this.times=THREE.AnimationUtils.arraySlice(times,from,to);this.values=THREE.AnimationUtils.arraySlice(this.values,from*stride,to*stride);}return this;},// ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable\nvalidate:function validate(){var valid=true;var valueSize=this.getValueSize();if(valueSize-Math.floor(valueSize)!==0){console.error(\"invalid value size in track\",this);valid=false;}var times=this.times,values=this.values,nKeys=times.length;if(nKeys===0){console.error(\"track is empty\",this);valid=false;}var prevTime=null;for(var i=0;i!==nKeys;i++){var currTime=times[i];if(typeof currTime==='number'&&isNaN(currTime)){console.error(\"time is not a valid number\",this,i,currTime);valid=false;break;}if(prevTime!==null&&prevTime>currTime){console.error(\"out of order keys\",this,i,currTime,prevTime);valid=false;break;}prevTime=currTime;}if(values!==undefined){if(THREE.AnimationUtils.isTypedArray(values)){for(var i=0,n=values.length;i!==n;++i){var value=values[i];if(isNaN(value)){console.error(\"value is not a valid number\",this,i,value);valid=false;break;}}}}return valid;},// removes equivalent sequential keys as common in morph target sequences\n// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)\noptimize:function optimize(){var times=this.times,values=this.values,stride=this.getValueSize(),writeIndex=1;for(var i=1,n=times.length-1;i<=n;++i){var keep=false;var time=times[i];var timeNext=times[i+1];// remove adjacent keyframes scheduled at the same time\nif(time!==timeNext&&(i!==1||time!==time[0])){// remove unnecessary keyframes same as their neighbors\nvar offset=i*stride,offsetP=offset-stride,offsetN=offset+stride;for(var j=0;j!==stride;++j){var value=values[offset+j];if(value!==values[offsetP+j]||value!==values[offsetN+j]){keep=true;break;}}}// in-place compaction\nif(keep){if(i!==writeIndex){times[writeIndex]=times[i];var readOffset=i*stride,writeOffset=writeIndex*stride;for(var j=0;j!==stride;++j){values[writeOffset+j]=values[readOffset+j];}}++writeIndex;}}if(writeIndex!==times.length){this.times=THREE.AnimationUtils.arraySlice(times,0,writeIndex);this.values=THREE.AnimationUtils.arraySlice(values,0,writeIndex*stride);}return this;}};// Static methods:\nObject.assign(THREE.KeyframeTrack,{// Serialization (in static context, because of constructor invocation\n// and automatic invocation of .toJSON):\nparse:function parse(json){if(json.type===undefined){throw new Error(\"track type undefined, can not parse\");}var trackType=THREE.KeyframeTrack._getTrackTypeForValueTypeName(json.type);if(json.times===undefined){var times=[],values=[];THREE.AnimationUtils.flattenJSON(json.keys,times,values,'value');json.times=times;json.values=values;}// derived classes can define a static parse method\nif(trackType.parse!==undefined){return trackType.parse(json);}else{// by default, we asssume a constructor compatible with the base\nreturn new trackType(json.name,json.times,json.values,json.interpolation);}},toJSON:function toJSON(track){var trackType=track.constructor;var json;// derived classes can define a static toJSON method\nif(trackType.toJSON!==undefined){json=trackType.toJSON(track);}else{// by default, we assume the data can be serialized as-is\njson={'name':track.name,'times':THREE.AnimationUtils.convertArray(track.times,Array),'values':THREE.AnimationUtils.convertArray(track.values,Array)};var interpolation=track.getInterpolation();if(interpolation!==track.DefaultInterpolation){json.interpolation=interpolation;}}json.type=track.ValueTypeName;// mandatory\nreturn json;},_getTrackTypeForValueTypeName:function _getTrackTypeForValueTypeName(typeName){switch(typeName.toLowerCase()){case\"scalar\":case\"double\":case\"float\":case\"number\":case\"integer\":return THREE.NumberKeyframeTrack;case\"vector\":case\"vector2\":case\"vector3\":case\"vector4\":return THREE.VectorKeyframeTrack;case\"color\":return THREE.ColorKeyframeTrack;case\"quaternion\":return THREE.QuaternionKeyframeTrack;case\"bool\":case\"boolean\":return THREE.BooleanKeyframeTrack;case\"string\":return THREE.StringKeyframeTrack;}throw new Error(\"Unsupported typeName: \"+typeName);}});// File:src/animation/PropertyBinding.js\n/**\n *\n * A reference to a real property in the scene graph.\n *\n *\n * @author Ben Houston / http://clara.io/\n * @author David Sarno / http://lighthaus.us/\n * @author tschw\n */THREE.PropertyBinding=function(rootNode,path,parsedPath){this.path=path;this.parsedPath=parsedPath||THREE.PropertyBinding.parseTrackName(path);this.node=THREE.PropertyBinding.findNode(rootNode,this.parsedPath.nodeName)||rootNode;this.rootNode=rootNode;};THREE.PropertyBinding.prototype={constructor:THREE.PropertyBinding,getValue:function getValue_unbound(targetArray,offset){this.bind();this.getValue(targetArray,offset);// Note: This class uses a State pattern on a per-method basis:\n// 'bind' sets 'this.getValue' / 'setValue' and shadows the\n// prototype version of these methods with one that represents\n// the bound state. When the property is not found, the methods\n// become no-ops.\n},setValue:function getValue_unbound(sourceArray,offset){this.bind();this.setValue(sourceArray,offset);},// create getter / setter pair for a property in the scene graph\nbind:function bind(){var targetObject=this.node,parsedPath=this.parsedPath,objectName=parsedPath.objectName,propertyName=parsedPath.propertyName,propertyIndex=parsedPath.propertyIndex;if(!targetObject){targetObject=THREE.PropertyBinding.findNode(this.rootNode,parsedPath.nodeName)||this.rootNode;this.node=targetObject;}// set fail state so we can just 'return' on error\nthis.getValue=this._getValue_unavailable;this.setValue=this._setValue_unavailable;// ensure there is a value node\nif(!targetObject){console.error(\" trying to update node for track: \"+this.path+\" but it wasn't found.\");return;}if(objectName){var objectIndex=parsedPath.objectIndex;// special cases were we need to reach deeper into the hierarchy to get the face materials....\nswitch(objectName){case'materials':if(!targetObject.material){console.error(' can not bind to material as node does not have a material',this);return;}if(!targetObject.material.materials){console.error(' can not bind to material.materials as node.material does not have a materials array',this);return;}targetObject=targetObject.material.materials;break;case'bones':if(!targetObject.skeleton){console.error(' can not bind to bones as node does not have a skeleton',this);return;}// potential future optimization: skip this if propertyIndex is already an integer\n// and convert the integer string to a true integer.\ntargetObject=targetObject.skeleton.bones;// support resolving morphTarget names into indices.\nfor(var i=0;i'\naccumulate:function accumulate(accuIndex,weight){// note: happily accumulating nothing when weight = 0, the caller knows\n// the weight and shouldn't have made the call in the first place\nvar buffer=this.buffer,stride=this.valueSize,offset=accuIndex*stride+stride,currentWeight=this.cumulativeWeight;if(currentWeight===0){// accuN := incoming * weight\nfor(var i=0;i!==stride;++i){buffer[offset+i]=buffer[i];}currentWeight=weight;}else{// accuN := accuN + incoming * weight\ncurrentWeight+=weight;var mix=weight/currentWeight;this._mixBufferRegion(buffer,offset,0,mix,stride);}this.cumulativeWeight=currentWeight;},// apply the state of 'accu' to the binding when accus differ\napply:function apply(accuIndex){var stride=this.valueSize,buffer=this.buffer,offset=accuIndex*stride+stride,weight=this.cumulativeWeight,binding=this.binding;this.cumulativeWeight=0;if(weight<1){// accuN := accuN + original * ( 1 - cumulativeWeight )\nvar originalValueOffset=stride*3;this._mixBufferRegion(buffer,offset,originalValueOffset,1-weight,stride);}for(var i=stride,e=stride+stride;i!==e;++i){if(buffer[i]!==buffer[i+stride]){// value has changed -> update scene graph\nbinding.setValue(buffer,offset);break;}}},// remember the state of the bound property and copy it to both accus\nsaveOriginalState:function saveOriginalState(){var binding=this.binding;var buffer=this.buffer,stride=this.valueSize,originalValueOffset=stride*3;binding.getValue(buffer,originalValueOffset);// accu[0..1] := orig -- initially detect changes against the original\nfor(var i=stride,e=originalValueOffset;i!==e;++i){buffer[i]=buffer[originalValueOffset+i%stride];}this.cumulativeWeight=0;},// apply the state previously taken via 'saveOriginalState' to the binding\nrestoreOriginalState:function restoreOriginalState(){var originalValueOffset=this.valueSize*3;this.binding.setValue(this.buffer,originalValueOffset);},// mix functions\n_select:function _select(buffer,dstOffset,srcOffset,t,stride){if(t>=0.5){for(var i=0;i!==stride;++i){buffer[dstOffset+i]=buffer[srcOffset+i];}}},_slerp:function _slerp(buffer,dstOffset,srcOffset,t,stride){THREE.Quaternion.slerpFlat(buffer,dstOffset,buffer,dstOffset,buffer,srcOffset,t);},_lerp:function _lerp(buffer,dstOffset,srcOffset,t,stride){var s=1-t;for(var i=0;i!==stride;++i){var j=dstOffset+i;buffer[j]=buffer[j]*s+buffer[srcOffset+i]*t;}}};// File:src/animation/tracks/BooleanKeyframeTrack.js\n/**\n *\n * A Track of Boolean keyframe values.\n *\n *\n * @author Ben Houston / http://clara.io/\n * @author David Sarno / http://lighthaus.us/\n * @author tschw\n */THREE.BooleanKeyframeTrack=function(name,times,values){THREE.KeyframeTrack.call(this,name,times,values);};THREE.BooleanKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.BooleanKeyframeTrack,ValueTypeName:'bool',ValueBufferType:Array,DefaultInterpolation:THREE.InterpolateDiscrete,InterpolantFactoryMethodLinear:undefined,InterpolantFactoryMethodSmooth:undefined// Note: Actually this track could have a optimized / compressed\n// representation of a single value and a custom interpolant that\n// computes \"firstValue ^ isOdd( index )\".\n});// File:src/animation/tracks/ColorKeyframeTrack.js\n/**\n *\n * A Track of keyframe values that represent color.\n *\n *\n * @author Ben Houston / http://clara.io/\n * @author David Sarno / http://lighthaus.us/\n * @author tschw\n */THREE.ColorKeyframeTrack=function(name,times,values,interpolation){THREE.KeyframeTrack.call(this,name,times,values,interpolation);};THREE.ColorKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.ColorKeyframeTrack,ValueTypeName:'color'// ValueBufferType is inherited\n// DefaultInterpolation is inherited\n// Note: Very basic implementation and nothing special yet.\n// However, this is the place for color space parameterization.\n});// File:src/animation/tracks/NumberKeyframeTrack.js\n/**\n *\n * A Track of numeric keyframe values.\n *\n * @author Ben Houston / http://clara.io/\n * @author David Sarno / http://lighthaus.us/\n * @author tschw\n */THREE.NumberKeyframeTrack=function(name,times,values,interpolation){THREE.KeyframeTrack.call(this,name,times,values,interpolation);};THREE.NumberKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.NumberKeyframeTrack,ValueTypeName:'number'});// File:src/animation/tracks/QuaternionKeyframeTrack.js\n/**\n *\n * A Track of quaternion keyframe values.\n *\n * @author Ben Houston / http://clara.io/\n * @author David Sarno / http://lighthaus.us/\n * @author tschw\n */THREE.QuaternionKeyframeTrack=function(name,times,values,interpolation){THREE.KeyframeTrack.call(this,name,times,values,interpolation);};THREE.QuaternionKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.QuaternionKeyframeTrack,ValueTypeName:'quaternion',// ValueBufferType is inherited\nDefaultInterpolation:THREE.InterpolateLinear,InterpolantFactoryMethodLinear:function InterpolantFactoryMethodLinear(result){return new THREE.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),result);},InterpolantFactoryMethodSmooth:undefined// not yet implemented\n});// File:src/animation/tracks/StringKeyframeTrack.js\n/**\n *\n * A Track that interpolates Strings\n *\n *\n * @author Ben Houston / http://clara.io/\n * @author David Sarno / http://lighthaus.us/\n * @author tschw\n */THREE.StringKeyframeTrack=function(name,times,values,interpolation){THREE.KeyframeTrack.call(this,name,times,values,interpolation);};THREE.StringKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.StringKeyframeTrack,ValueTypeName:'string',ValueBufferType:Array,DefaultInterpolation:THREE.InterpolateDiscrete,InterpolantFactoryMethodLinear:undefined,InterpolantFactoryMethodSmooth:undefined});// File:src/animation/tracks/VectorKeyframeTrack.js\n/**\n *\n * A Track of vectored keyframe values.\n *\n *\n * @author Ben Houston / http://clara.io/\n * @author David Sarno / http://lighthaus.us/\n * @author tschw\n */THREE.VectorKeyframeTrack=function(name,times,values,interpolation){THREE.KeyframeTrack.call(this,name,times,values,interpolation);};THREE.VectorKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.VectorKeyframeTrack,ValueTypeName:'vector'// ValueBufferType is inherited\n// DefaultInterpolation is inherited\n});// File:src/audio/Audio.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author Reece Aaron Lecrivain / http://reecenotes.com/\n */THREE.Audio=function(listener){THREE.Object3D.call(this);this.type='Audio';this.context=listener.context;this.source=this.context.createBufferSource();this.source.onended=this.onEnded.bind(this);this.gain=this.context.createGain();this.gain.connect(listener.getInput());this.autoplay=false;this.startTime=0;this.playbackRate=1;this.isPlaying=false;this.hasPlaybackControl=true;this.sourceType='empty';this.filters=[];};THREE.Audio.prototype=Object.assign(Object.create(THREE.Object3D.prototype),{constructor:THREE.Audio,getOutput:function getOutput(){return this.gain;},setNodeSource:function setNodeSource(audioNode){this.hasPlaybackControl=false;this.sourceType='audioNode';this.source=audioNode;this.connect();return this;},setBuffer:function setBuffer(audioBuffer){this.source.buffer=audioBuffer;this.sourceType='buffer';if(this.autoplay)this.play();return this;},play:function play(){if(this.isPlaying===true){console.warn('THREE.Audio: Audio is already playing.');return;}if(this.hasPlaybackControl===false){console.warn('THREE.Audio: this Audio has no playback control.');return;}var source=this.context.createBufferSource();source.buffer=this.source.buffer;source.loop=this.source.loop;source.onended=this.source.onended;source.start(0,this.startTime);source.playbackRate.value=this.playbackRate;this.isPlaying=true;this.source=source;return this.connect();},pause:function pause(){if(this.hasPlaybackControl===false){console.warn('THREE.Audio: this Audio has no playback control.');return;}this.source.stop();this.startTime=this.context.currentTime;this.isPlaying=false;return this;},stop:function stop(){if(this.hasPlaybackControl===false){console.warn('THREE.Audio: this Audio has no playback control.');return;}this.source.stop();this.startTime=0;this.isPlaying=false;return this;},connect:function connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var i=1,l=this.filters.length;i0){this.source.disconnect(this.filters[0]);for(var i=1,l=this.filters.length;i 1)\nreturn this.filmGauge/Math.max(this.aspect,1);},/**\n\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t * multi-monitor/multi-machine setups.\n\t *\n\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t * the monitors are in grid like this\n\t *\n\t * +---+---+---+\n\t * | A | B | C |\n\t * +---+---+---+\n\t * | D | E | F |\n\t * +---+---+---+\n\t *\n\t * then for each monitor you would call it like this\n\t *\n\t * var w = 1920;\n\t * var h = 1080;\n\t * var fullWidth = w * 3;\n\t * var fullHeight = h * 2;\n\t *\n\t * --A--\n\t * camera.setOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t * --B--\n\t * camera.setOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t * --C--\n\t * camera.setOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t * --D--\n\t * camera.setOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t * --E--\n\t * camera.setOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t * --F--\n\t * camera.setOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t *\n\t * Note there is no reason monitors have to be the same size or in a grid.\n\t */setViewOffset:function setViewOffset(fullWidth,fullHeight,x,y,width,height){this.aspect=fullWidth/fullHeight;this.view={fullWidth:fullWidth,fullHeight:fullHeight,offsetX:x,offsetY:y,width:width,height:height};this.updateProjectionMatrix();},clearViewOffset:function clearViewOffset(){this.view=null;this.updateProjectionMatrix();},updateProjectionMatrix:function updateProjectionMatrix(){var near=this.near,top=near*Math.tan(THREE.Math.DEG2RAD*0.5*this.fov)/this.zoom,height=2*top,width=this.aspect*height,left=-0.5*width,view=this.view;if(view!==null){var fullWidth=view.fullWidth,fullHeight=view.fullHeight;left+=view.offsetX*width/fullWidth;top-=view.offsetY*height/fullHeight;width*=view.width/fullWidth;height*=view.height/fullHeight;}var skew=this.filmOffset;if(skew!==0)left+=near*skew/this.getFilmWidth();this.projectionMatrix.makeFrustum(left,left+width,top-height,top,near,this.far);},toJSON:function toJSON(meta){var data=THREE.Object3D.prototype.toJSON.call(this,meta);data.object.fov=this.fov;data.object.zoom=this.zoom;data.object.near=this.near;data.object.far=this.far;data.object.focus=this.focus;data.object.aspect=this.aspect;if(this.view!==null)data.object.view=Object.assign({},this.view);data.object.filmGauge=this.filmGauge;data.object.filmOffset=this.filmOffset;return data;}});// File:src/cameras/StereoCamera.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.StereoCamera=function(){this.type='StereoCamera';this.aspect=1;this.cameraL=new THREE.PerspectiveCamera();this.cameraL.layers.enable(1);this.cameraL.matrixAutoUpdate=false;this.cameraR=new THREE.PerspectiveCamera();this.cameraR.layers.enable(2);this.cameraR.matrixAutoUpdate=false;};Object.assign(THREE.StereoCamera.prototype,{update:function(){var focus,fov,aspect,near,far;var eyeRight=new THREE.Matrix4();var eyeLeft=new THREE.Matrix4();return function update(camera){var needsUpdate=focus!==camera.focus||fov!==camera.fov||aspect!==camera.aspect*this.aspect||near!==camera.near||far!==camera.far;if(needsUpdate){focus=camera.focus;fov=camera.fov;aspect=camera.aspect*this.aspect;near=camera.near;far=camera.far;// Off-axis stereoscopic effect based on\n// http://paulbourke.net/stereographics/stereorender/\nvar projectionMatrix=camera.projectionMatrix.clone();var eyeSep=0.064/2;var eyeSepOnProjection=eyeSep*near/focus;var ymax=near*Math.tan(THREE.Math.DEG2RAD*fov*0.5);var xmin,xmax;// translate xOffset\neyeLeft.elements[12]=-eyeSep;eyeRight.elements[12]=eyeSep;// for left eye\nxmin=-ymax*aspect+eyeSepOnProjection;xmax=ymax*aspect+eyeSepOnProjection;projectionMatrix.elements[0]=2*near/(xmax-xmin);projectionMatrix.elements[8]=(xmax+xmin)/(xmax-xmin);this.cameraL.projectionMatrix.copy(projectionMatrix);// for right eye\nxmin=-ymax*aspect-eyeSepOnProjection;xmax=ymax*aspect-eyeSepOnProjection;projectionMatrix.elements[0]=2*near/(xmax-xmin);projectionMatrix.elements[8]=(xmax+xmin)/(xmax-xmin);this.cameraR.projectionMatrix.copy(projectionMatrix);}this.cameraL.matrixWorld.copy(camera.matrixWorld).multiply(eyeLeft);this.cameraR.matrixWorld.copy(camera.matrixWorld).multiply(eyeRight);};}()});// File:src/lights/Light.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n */THREE.Light=function(color,intensity){THREE.Object3D.call(this);this.type='Light';this.color=new THREE.Color(color);this.intensity=intensity!==undefined?intensity:1;this.receiveShadow=undefined;};THREE.Light.prototype=Object.assign(Object.create(THREE.Object3D.prototype),{constructor:THREE.Light,copy:function copy(source){THREE.Object3D.prototype.copy.call(this,source);this.color.copy(source.color);this.intensity=source.intensity;return this;},toJSON:function toJSON(meta){var data=THREE.Object3D.prototype.toJSON.call(this,meta);data.object.color=this.color.getHex();data.object.intensity=this.intensity;if(this.groundColor!==undefined)data.object.groundColor=this.groundColor.getHex();if(this.distance!==undefined)data.object.distance=this.distance;if(this.angle!==undefined)data.object.angle=this.angle;if(this.decay!==undefined)data.object.decay=this.decay;if(this.penumbra!==undefined)data.object.penumbra=this.penumbra;return data;}});// File:src/lights/LightShadow.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.LightShadow=function(camera){this.camera=camera;this.bias=0;this.radius=1;this.mapSize=new THREE.Vector2(512,512);this.map=null;this.matrix=new THREE.Matrix4();};Object.assign(THREE.LightShadow.prototype,{copy:function copy(source){this.camera=source.camera.clone();this.bias=source.bias;this.radius=source.radius;this.mapSize.copy(source.mapSize);return this;},clone:function clone(){return new this.constructor().copy(this);}});// File:src/lights/AmbientLight.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.AmbientLight=function(color,intensity){THREE.Light.call(this,color,intensity);this.type='AmbientLight';this.castShadow=undefined;};THREE.AmbientLight.prototype=Object.assign(Object.create(THREE.Light.prototype),{constructor:THREE.AmbientLight});// File:src/lights/DirectionalLight.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n */THREE.DirectionalLight=function(color,intensity){THREE.Light.call(this,color,intensity);this.type='DirectionalLight';this.position.copy(THREE.Object3D.DefaultUp);this.updateMatrix();this.target=new THREE.Object3D();this.shadow=new THREE.DirectionalLightShadow();};THREE.DirectionalLight.prototype=Object.assign(Object.create(THREE.Light.prototype),{constructor:THREE.DirectionalLight,copy:function copy(source){THREE.Light.prototype.copy.call(this,source);this.target=source.target.clone();this.shadow=source.shadow.clone();return this;}});// File:src/lights/DirectionalLightShadow.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.DirectionalLightShadow=function(light){THREE.LightShadow.call(this,new THREE.OrthographicCamera(-5,5,5,-5,0.5,500));};THREE.DirectionalLightShadow.prototype=Object.assign(Object.create(THREE.LightShadow.prototype),{constructor:THREE.DirectionalLightShadow});// File:src/lights/HemisphereLight.js\n/**\n * @author alteredq / http://alteredqualia.com/\n */THREE.HemisphereLight=function(skyColor,groundColor,intensity){THREE.Light.call(this,skyColor,intensity);this.type='HemisphereLight';this.castShadow=undefined;this.position.copy(THREE.Object3D.DefaultUp);this.updateMatrix();this.groundColor=new THREE.Color(groundColor);};THREE.HemisphereLight.prototype=Object.assign(Object.create(THREE.Light.prototype),{constructor:THREE.HemisphereLight,copy:function copy(source){THREE.Light.prototype.copy.call(this,source);this.groundColor.copy(source.groundColor);return this;}});// File:src/lights/PointLight.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.PointLight=function(color,intensity,distance,decay){THREE.Light.call(this,color,intensity);this.type='PointLight';Object.defineProperty(this,'power',{get:function get(){// intensity = power per solid angle.\n// ref: equation (15) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf\nreturn this.intensity*4*Math.PI;},set:function set(power){// intensity = power per solid angle.\n// ref: equation (15) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf\nthis.intensity=power/(4*Math.PI);}});this.distance=distance!==undefined?distance:0;this.decay=decay!==undefined?decay:1;// for physically correct lights, should be 2.\nthis.shadow=new THREE.LightShadow(new THREE.PerspectiveCamera(90,1,0.5,500));};THREE.PointLight.prototype=Object.assign(Object.create(THREE.Light.prototype),{constructor:THREE.PointLight,copy:function copy(source){THREE.Light.prototype.copy.call(this,source);this.distance=source.distance;this.decay=source.decay;this.shadow=source.shadow.clone();return this;}});// File:src/lights/SpotLight.js\n/**\n * @author alteredq / http://alteredqualia.com/\n */THREE.SpotLight=function(color,intensity,distance,angle,penumbra,decay){THREE.Light.call(this,color,intensity);this.type='SpotLight';this.position.copy(THREE.Object3D.DefaultUp);this.updateMatrix();this.target=new THREE.Object3D();Object.defineProperty(this,'power',{get:function get(){// intensity = power per solid angle.\n// ref: equation (17) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf\nreturn this.intensity*Math.PI;},set:function set(power){// intensity = power per solid angle.\n// ref: equation (17) from http://www.frostbite.com/wp-content/uploads/2014/11/course_notes_moving_frostbite_to_pbr.pdf\nthis.intensity=power/Math.PI;}});this.distance=distance!==undefined?distance:0;this.angle=angle!==undefined?angle:Math.PI/3;this.penumbra=penumbra!==undefined?penumbra:0;this.decay=decay!==undefined?decay:1;// for physically correct lights, should be 2.\nthis.shadow=new THREE.SpotLightShadow();};THREE.SpotLight.prototype=Object.assign(Object.create(THREE.Light.prototype),{constructor:THREE.SpotLight,copy:function copy(source){THREE.Light.prototype.copy.call(this,source);this.distance=source.distance;this.angle=source.angle;this.penumbra=source.penumbra;this.decay=source.decay;this.target=source.target.clone();this.shadow=source.shadow.clone();return this;}});// File:src/lights/SpotLightShadow.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.SpotLightShadow=function(){THREE.LightShadow.call(this,new THREE.PerspectiveCamera(50,1,0.5,500));};THREE.SpotLightShadow.prototype=Object.assign(Object.create(THREE.LightShadow.prototype),{constructor:THREE.SpotLightShadow,update:function update(light){var fov=THREE.Math.RAD2DEG*2*light.angle;var aspect=this.mapSize.width/this.mapSize.height;var far=light.distance||500;var camera=this.camera;if(fov!==camera.fov||aspect!==camera.aspect||far!==camera.far){camera.fov=fov;camera.aspect=aspect;camera.far=far;camera.updateProjectionMatrix();}}});// File:src/loaders/AudioLoader.js\n/**\n * @author Reece Aaron Lecrivain / http://reecenotes.com/\n */THREE.AudioLoader=function(manager){this.manager=manager!==undefined?manager:THREE.DefaultLoadingManager;};Object.assign(THREE.AudioLoader.prototype,{load:function load(url,onLoad,onProgress,onError){var loader=new THREE.XHRLoader(this.manager);loader.setResponseType('arraybuffer');loader.load(url,function(buffer){var context=THREE.AudioContext;context.decodeAudioData(buffer,function(audioBuffer){onLoad(audioBuffer);});},onProgress,onError);}});// File:src/loaders/Cache.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.Cache={enabled:false,files:{},add:function add(key,file){if(this.enabled===false)return;// console.log( 'THREE.Cache', 'Adding key:', key );\nthis.files[key]=file;},get:function get(key){if(this.enabled===false)return;// console.log( 'THREE.Cache', 'Checking key:', key );\nreturn this.files[key];},remove:function remove(key){delete this.files[key];},clear:function clear(){this.files={};}};// File:src/loaders/Loader.js\n/**\n * @author alteredq / http://alteredqualia.com/\n */THREE.Loader=function(){this.onLoadStart=function(){};this.onLoadProgress=function(){};this.onLoadComplete=function(){};};THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:undefined,extractUrlBase:function extractUrlBase(url){var parts=url.split('/');if(parts.length===1)return'./';parts.pop();return parts.join('/')+'/';},initMaterials:function initMaterials(materials,texturePath,crossOrigin){var array=[];for(var i=0;i uv index correspondence\nfi=geometry.faces.length;if(hasFaceVertexUv){for(i=0;i uv index correspondence\nfi=geometry.faces.length;if(hasFaceVertexUv){for(i=0;i1?json.skinWeights[i+1]:0;var z=influencesPerVertex>2?json.skinWeights[i+2]:0;var w=influencesPerVertex>3?json.skinWeights[i+3]:0;geometry.skinWeights.push(new THREE.Vector4(x,y,z,w));}}if(json.skinIndices){for(var i=0,l=json.skinIndices.length;i1?json.skinIndices[i+1]:0;var c=influencesPerVertex>2?json.skinIndices[i+2]:0;var d=influencesPerVertex>3?json.skinIndices[i+3]:0;geometry.skinIndices.push(new THREE.Vector4(a,b,c,d));}}geometry.bones=json.bones;if(geometry.bones&&geometry.bones.length>0&&(geometry.skinWeights.length!==geometry.skinIndices.length||geometry.skinIndices.length!==geometry.vertices.length)){console.warn('When skinning, number of vertices ('+geometry.vertices.length+'), skinIndices ('+geometry.skinIndices.length+'), and skinWeights ('+geometry.skinWeights.length+') should match.');}}function parseMorphing(scale){if(json.morphTargets!==undefined){for(var i=0,l=json.morphTargets.length;i0){console.warn('THREE.JSONLoader: \"morphColors\" no longer supported. Using them as face colors.');var faces=geometry.faces;var morphColors=json.morphColors[0].colors;for(var i=0,l=faces.length;i0)geometry.animations=outputAnimations;}if(json.materials===undefined||json.materials.length===0){return{geometry:geometry};}else{var materials=THREE.Loader.prototype.initMaterials(json.materials,texturePath,this.crossOrigin);return{geometry:geometry,materials:materials};}}});// File:src/loaders/LoadingManager.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.LoadingManager=function(onLoad,onProgress,onError){var scope=this;var isLoading=false,itemsLoaded=0,itemsTotal=0;this.onStart=undefined;this.onLoad=onLoad;this.onProgress=onProgress;this.onError=onError;this.itemStart=function(url){itemsTotal++;if(isLoading===false){if(scope.onStart!==undefined){scope.onStart(url,itemsLoaded,itemsTotal);}}isLoading=true;};this.itemEnd=function(url){itemsLoaded++;if(scope.onProgress!==undefined){scope.onProgress(url,itemsLoaded,itemsTotal);}if(itemsLoaded===itemsTotal){isLoading=false;if(scope.onLoad!==undefined){scope.onLoad();}}};this.itemError=function(url){if(scope.onError!==undefined){scope.onError(url);}};};THREE.DefaultLoadingManager=new THREE.LoadingManager();// File:src/loaders/BufferGeometryLoader.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.BufferGeometryLoader=function(manager){this.manager=manager!==undefined?manager:THREE.DefaultLoadingManager;};Object.assign(THREE.BufferGeometryLoader.prototype,{load:function load(url,onLoad,onProgress,onError){var scope=this;var loader=new THREE.XHRLoader(scope.manager);loader.load(url,function(text){onLoad(scope.parse(JSON.parse(text)));},onProgress,onError);},parse:function parse(json){var geometry=new THREE.BufferGeometry();var index=json.data.index;var TYPED_ARRAYS={'Int8Array':Int8Array,'Uint8Array':Uint8Array,'Uint8ClampedArray':Uint8ClampedArray,'Int16Array':Int16Array,'Uint16Array':Uint16Array,'Int32Array':Int32Array,'Uint32Array':Uint32Array,'Float32Array':Float32Array,'Float64Array':Float64Array};if(index!==undefined){var typedArray=new TYPED_ARRAYS[index.type](index.array);geometry.setIndex(new THREE.BufferAttribute(typedArray,1));}var attributes=json.data.attributes;for(var key in attributes){var attribute=attributes[key];var typedArray=new TYPED_ARRAYS[attribute.type](attribute.array);geometry.addAttribute(key,new THREE.BufferAttribute(typedArray,attribute.itemSize,attribute.normalized));}var groups=json.data.groups||json.data.drawcalls||json.data.offsets;if(groups!==undefined){for(var i=0,n=groups.length;i!==n;++i){var group=groups[i];geometry.addGroup(group.start,group.count,group.materialIndex);}}var boundingSphere=json.data.boundingSphere;if(boundingSphere!==undefined){var center=new THREE.Vector3();if(boundingSphere.center!==undefined){center.fromArray(boundingSphere.center);}geometry.boundingSphere=new THREE.Sphere(center,boundingSphere.radius);}return geometry;}});// File:src/loaders/MaterialLoader.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.MaterialLoader=function(manager){this.manager=manager!==undefined?manager:THREE.DefaultLoadingManager;this.textures={};};Object.assign(THREE.MaterialLoader.prototype,{load:function load(url,onLoad,onProgress,onError){var scope=this;var loader=new THREE.XHRLoader(scope.manager);loader.load(url,function(text){onLoad(scope.parse(JSON.parse(text)));},onProgress,onError);},setTextures:function setTextures(value){this.textures=value;},getTexture:function getTexture(name){var textures=this.textures;if(textures[name]===undefined){console.warn('THREE.MaterialLoader: Undefined texture',name);}return textures[name];},parse:function parse(json){var material=new THREE[json.type]();if(json.uuid!==undefined)material.uuid=json.uuid;if(json.name!==undefined)material.name=json.name;if(json.color!==undefined)material.color.setHex(json.color);if(json.roughness!==undefined)material.roughness=json.roughness;if(json.metalness!==undefined)material.metalness=json.metalness;if(json.emissive!==undefined)material.emissive.setHex(json.emissive);if(json.specular!==undefined)material.specular.setHex(json.specular);if(json.shininess!==undefined)material.shininess=json.shininess;if(json.uniforms!==undefined)material.uniforms=json.uniforms;if(json.vertexShader!==undefined)material.vertexShader=json.vertexShader;if(json.fragmentShader!==undefined)material.fragmentShader=json.fragmentShader;if(json.vertexColors!==undefined)material.vertexColors=json.vertexColors;if(json.shading!==undefined)material.shading=json.shading;if(json.blending!==undefined)material.blending=json.blending;if(json.side!==undefined)material.side=json.side;if(json.opacity!==undefined)material.opacity=json.opacity;if(json.transparent!==undefined)material.transparent=json.transparent;if(json.alphaTest!==undefined)material.alphaTest=json.alphaTest;if(json.depthTest!==undefined)material.depthTest=json.depthTest;if(json.depthWrite!==undefined)material.depthWrite=json.depthWrite;if(json.colorWrite!==undefined)material.colorWrite=json.colorWrite;if(json.wireframe!==undefined)material.wireframe=json.wireframe;if(json.wireframeLinewidth!==undefined)material.wireframeLinewidth=json.wireframeLinewidth;// for PointsMaterial\nif(json.size!==undefined)material.size=json.size;if(json.sizeAttenuation!==undefined)material.sizeAttenuation=json.sizeAttenuation;// maps\nif(json.map!==undefined)material.map=this.getTexture(json.map);if(json.alphaMap!==undefined){material.alphaMap=this.getTexture(json.alphaMap);material.transparent=true;}if(json.bumpMap!==undefined)material.bumpMap=this.getTexture(json.bumpMap);if(json.bumpScale!==undefined)material.bumpScale=json.bumpScale;if(json.normalMap!==undefined)material.normalMap=this.getTexture(json.normalMap);if(json.normalScale!==undefined){var normalScale=json.normalScale;if(Array.isArray(normalScale)===false){// Blender exporter used to export a scalar. See #7459\nnormalScale=[normalScale,normalScale];}material.normalScale=new THREE.Vector2().fromArray(normalScale);}if(json.displacementMap!==undefined)material.displacementMap=this.getTexture(json.displacementMap);if(json.displacementScale!==undefined)material.displacementScale=json.displacementScale;if(json.displacementBias!==undefined)material.displacementBias=json.displacementBias;if(json.roughnessMap!==undefined)material.roughnessMap=this.getTexture(json.roughnessMap);if(json.metalnessMap!==undefined)material.metalnessMap=this.getTexture(json.metalnessMap);if(json.emissiveMap!==undefined)material.emissiveMap=this.getTexture(json.emissiveMap);if(json.emissiveIntensity!==undefined)material.emissiveIntensity=json.emissiveIntensity;if(json.specularMap!==undefined)material.specularMap=this.getTexture(json.specularMap);if(json.envMap!==undefined){material.envMap=this.getTexture(json.envMap);material.combine=THREE.MultiplyOperation;}if(json.reflectivity!==undefined)material.reflectivity=json.reflectivity;if(json.lightMap!==undefined)material.lightMap=this.getTexture(json.lightMap);if(json.lightMapIntensity!==undefined)material.lightMapIntensity=json.lightMapIntensity;if(json.aoMap!==undefined)material.aoMap=this.getTexture(json.aoMap);if(json.aoMapIntensity!==undefined)material.aoMapIntensity=json.aoMapIntensity;// MultiMaterial\nif(json.materials!==undefined){for(var i=0,l=json.materials.length;i0){var manager=new THREE.LoadingManager(onLoad);var loader=new THREE.ImageLoader(manager);loader.setCrossOrigin(this.crossOrigin);for(var i=0,l=json.length;i0){object=new THREE.SkinnedMesh(geometry,material);}else{object=new THREE.Mesh(geometry,material);}break;case'LOD':object=new THREE.LOD();break;case'Line':object=new THREE.Line(getGeometry(data.geometry),getMaterial(data.material),data.mode);break;case'PointCloud':case'Points':object=new THREE.Points(getGeometry(data.geometry),getMaterial(data.material));break;case'Sprite':object=new THREE.Sprite(getMaterial(data.material));break;case'Group':object=new THREE.Group();break;default:object=new THREE.Object3D();}object.uuid=data.uuid;if(data.name!==undefined)object.name=data.name;if(data.matrix!==undefined){matrix.fromArray(data.matrix);matrix.decompose(object.position,object.quaternion,object.scale);}else{if(data.position!==undefined)object.position.fromArray(data.position);if(data.rotation!==undefined)object.rotation.fromArray(data.rotation);if(data.scale!==undefined)object.scale.fromArray(data.scale);}if(data.castShadow!==undefined)object.castShadow=data.castShadow;if(data.receiveShadow!==undefined)object.receiveShadow=data.receiveShadow;if(data.visible!==undefined)object.visible=data.visible;if(data.userData!==undefined)object.userData=data.userData;if(data.children!==undefined){for(var child in data.children){object.add(this.parseObject(data.children[child],geometries,materials));}}if(data.type==='LOD'){var levels=data.levels;for(var l=0;l0||url.search(/^data\\:image\\/jpeg/)===0;texture.format=isJPEG?THREE.RGBFormat:THREE.RGBAFormat;texture.image=image;texture.needsUpdate=true;if(onLoad!==undefined){onLoad(texture);}},onProgress,onError);return texture;},setCrossOrigin:function setCrossOrigin(value){this.crossOrigin=value;return this;},setPath:function setPath(value){this.path=value;return this;}});// File:src/loaders/CubeTextureLoader.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.CubeTextureLoader=function(manager){this.manager=manager!==undefined?manager:THREE.DefaultLoadingManager;};Object.assign(THREE.CubeTextureLoader.prototype,{load:function load(urls,onLoad,onProgress,onError){var texture=new THREE.CubeTexture();var loader=new THREE.ImageLoader(this.manager);loader.setCrossOrigin(this.crossOrigin);loader.setPath(this.path);var loaded=0;function loadTexture(i){loader.load(urls[i],function(image){texture.images[i]=image;loaded++;if(loaded===6){texture.needsUpdate=true;if(onLoad)onLoad(texture);}},undefined,onError);}for(var i=0;i0)data.alphaTest=this.alphaTest;if(this.premultipliedAlpha===true)data.premultipliedAlpha=this.premultipliedAlpha;if(this.wireframe===true)data.wireframe=this.wireframe;if(this.wireframeLinewidth>1)data.wireframeLinewidth=this.wireframeLinewidth;// TODO: Copied from Object3D.toJSON\nfunction extractFromCache(cache){var values=[];for(var key in cache){var data=cache[key];delete data.metadata;values.push(data);}return values;}if(isRoot){var textures=extractFromCache(meta.textures);var images=extractFromCache(meta.images);if(textures.length>0)data.textures=textures;if(images.length>0)data.images=images;}return data;},clone:function clone(){return new this.constructor().copy(this);},copy:function copy(source){this.name=source.name;this.fog=source.fog;this.lights=source.lights;this.blending=source.blending;this.side=source.side;this.shading=source.shading;this.vertexColors=source.vertexColors;this.opacity=source.opacity;this.transparent=source.transparent;this.blendSrc=source.blendSrc;this.blendDst=source.blendDst;this.blendEquation=source.blendEquation;this.blendSrcAlpha=source.blendSrcAlpha;this.blendDstAlpha=source.blendDstAlpha;this.blendEquationAlpha=source.blendEquationAlpha;this.depthFunc=source.depthFunc;this.depthTest=source.depthTest;this.depthWrite=source.depthWrite;this.colorWrite=source.colorWrite;this.precision=source.precision;this.polygonOffset=source.polygonOffset;this.polygonOffsetFactor=source.polygonOffsetFactor;this.polygonOffsetUnits=source.polygonOffsetUnits;this.alphaTest=source.alphaTest;this.premultipliedAlpha=source.premultipliedAlpha;this.overdraw=source.overdraw;this.visible=source.visible;this.clipShadows=source.clipShadows;var srcPlanes=source.clippingPlanes,dstPlanes=null;if(srcPlanes!==null){var n=srcPlanes.length;dstPlanes=new Array(n);for(var i=0;i!==n;++i){dstPlanes[i]=srcPlanes[i].clone();}}this.clippingPlanes=dstPlanes;return this;},update:function update(){this.dispatchEvent({type:'update'});},dispose:function dispose(){this.dispatchEvent({type:'dispose'});}};Object.assign(THREE.Material.prototype,THREE.EventDispatcher.prototype);THREE.MaterialIdCount=0;// File:src/materials/LineBasicMaterial.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n *\n * parameters = {\n * color: ,\n * opacity: ,\n *\n * linewidth: ,\n * linecap: \"round\",\n * linejoin: \"round\"\n * }\n */THREE.LineBasicMaterial=function(parameters){THREE.Material.call(this);this.type='LineBasicMaterial';this.color=new THREE.Color(0xffffff);this.linewidth=1;this.linecap='round';this.linejoin='round';this.lights=false;this.setValues(parameters);};THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial;THREE.LineBasicMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.color.copy(source.color);this.linewidth=source.linewidth;this.linecap=source.linecap;this.linejoin=source.linejoin;return this;};// File:src/materials/LineDashedMaterial.js\n/**\n * @author alteredq / http://alteredqualia.com/\n *\n * parameters = {\n * color: ,\n * opacity: ,\n *\n * linewidth: ,\n *\n * scale: ,\n * dashSize: ,\n * gapSize: \n * }\n */THREE.LineDashedMaterial=function(parameters){THREE.Material.call(this);this.type='LineDashedMaterial';this.color=new THREE.Color(0xffffff);this.linewidth=1;this.scale=1;this.dashSize=3;this.gapSize=1;this.lights=false;this.setValues(parameters);};THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype);THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial;THREE.LineDashedMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.color.copy(source.color);this.linewidth=source.linewidth;this.scale=source.scale;this.dashSize=source.dashSize;this.gapSize=source.gapSize;return this;};// File:src/materials/MeshBasicMaterial.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n *\n * parameters = {\n * color: ,\n * opacity: ,\n * map: new THREE.Texture( ),\n *\n * aoMap: new THREE.Texture( ),\n * aoMapIntensity: \n *\n * specularMap: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),\n * combine: THREE.Multiply,\n * reflectivity: ,\n * refractionRatio: ,\n *\n * shading: THREE.SmoothShading,\n * depthTest: ,\n * depthWrite: ,\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n *\n * skinning: ,\n * morphTargets: \n * }\n */THREE.MeshBasicMaterial=function(parameters){THREE.Material.call(this);this.type='MeshBasicMaterial';this.color=new THREE.Color(0xffffff);// emissive\nthis.map=null;this.aoMap=null;this.aoMapIntensity=1.0;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap='round';this.wireframeLinejoin='round';this.skinning=false;this.morphTargets=false;this.lights=false;this.setValues(parameters);};THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial;THREE.MeshBasicMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.color.copy(source.color);this.map=source.map;this.aoMap=source.aoMap;this.aoMapIntensity=source.aoMapIntensity;this.specularMap=source.specularMap;this.alphaMap=source.alphaMap;this.envMap=source.envMap;this.combine=source.combine;this.reflectivity=source.reflectivity;this.refractionRatio=source.refractionRatio;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.wireframeLinecap=source.wireframeLinecap;this.wireframeLinejoin=source.wireframeLinejoin;this.skinning=source.skinning;this.morphTargets=source.morphTargets;return this;};// File:src/materials/MeshDepthMaterial.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n * @author bhouston / https://clara.io\n * @author WestLangley / http://github.com/WestLangley\n *\n * parameters = {\n *\n * opacity: ,\n *\n * map: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * displacementMap: new THREE.Texture( ),\n * displacementScale: ,\n * displacementBias: ,\n *\n * wireframe: ,\n * wireframeLinewidth: \n * }\n */THREE.MeshDepthMaterial=function(parameters){THREE.Material.call(this);this.type='MeshDepthMaterial';this.depthPacking=THREE.BasicDepthPacking;this.skinning=false;this.morphTargets=false;this.map=null;this.alphaMap=null;this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.wireframe=false;this.wireframeLinewidth=1;this.fog=false;this.lights=false;this.setValues(parameters);};THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial;THREE.MeshDepthMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.depthPacking=source.depthPacking;this.skinning=source.skinning;this.morphTargets=source.morphTargets;this.map=source.map;this.alphaMap=source.alphaMap;this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;return this;};// File:src/materials/MeshLambertMaterial.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n *\n * parameters = {\n * color: ,\n * opacity: ,\n *\n * map: new THREE.Texture( ),\n *\n * lightMap: new THREE.Texture( ),\n * lightMapIntensity: \n *\n * aoMap: new THREE.Texture( ),\n * aoMapIntensity: \n *\n * emissive: ,\n * emissiveIntensity: \n * emissiveMap: new THREE.Texture( ),\n *\n * specularMap: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),\n * combine: THREE.Multiply,\n * reflectivity: ,\n * refractionRatio: ,\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n *\n * skinning: ,\n * morphTargets: ,\n * morphNormals: \n * }\n */THREE.MeshLambertMaterial=function(parameters){THREE.Material.call(this);this.type='MeshLambertMaterial';this.color=new THREE.Color(0xffffff);// diffuse\nthis.map=null;this.lightMap=null;this.lightMapIntensity=1.0;this.aoMap=null;this.aoMapIntensity=1.0;this.emissive=new THREE.Color(0x000000);this.emissiveIntensity=1.0;this.emissiveMap=null;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap='round';this.wireframeLinejoin='round';this.skinning=false;this.morphTargets=false;this.morphNormals=false;this.setValues(parameters);};THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial;THREE.MeshLambertMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.color.copy(source.color);this.map=source.map;this.lightMap=source.lightMap;this.lightMapIntensity=source.lightMapIntensity;this.aoMap=source.aoMap;this.aoMapIntensity=source.aoMapIntensity;this.emissive.copy(source.emissive);this.emissiveMap=source.emissiveMap;this.emissiveIntensity=source.emissiveIntensity;this.specularMap=source.specularMap;this.alphaMap=source.alphaMap;this.envMap=source.envMap;this.combine=source.combine;this.reflectivity=source.reflectivity;this.refractionRatio=source.refractionRatio;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.wireframeLinecap=source.wireframeLinecap;this.wireframeLinejoin=source.wireframeLinejoin;this.skinning=source.skinning;this.morphTargets=source.morphTargets;this.morphNormals=source.morphNormals;return this;};// File:src/materials/MeshNormalMaterial.js\n/**\n * @author mrdoob / http://mrdoob.com/\n *\n * parameters = {\n * opacity: ,\n *\n * wireframe: ,\n * wireframeLinewidth: \n * }\n */THREE.MeshNormalMaterial=function(parameters){THREE.Material.call(this,parameters);this.type='MeshNormalMaterial';this.wireframe=false;this.wireframeLinewidth=1;this.fog=false;this.lights=false;this.morphTargets=false;this.setValues(parameters);};THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial;THREE.MeshNormalMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;return this;};// File:src/materials/MeshPhongMaterial.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n *\n * parameters = {\n * color: ,\n * specular: ,\n * shininess: ,\n * opacity: ,\n *\n * map: new THREE.Texture( ),\n *\n * lightMap: new THREE.Texture( ),\n * lightMapIntensity: \n *\n * aoMap: new THREE.Texture( ),\n * aoMapIntensity: \n *\n * emissive: ,\n * emissiveIntensity: \n * emissiveMap: new THREE.Texture( ),\n *\n * bumpMap: new THREE.Texture( ),\n * bumpScale: ,\n *\n * normalMap: new THREE.Texture( ),\n * normalScale: ,\n *\n * displacementMap: new THREE.Texture( ),\n * displacementScale: ,\n * displacementBias: ,\n *\n * specularMap: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * envMap: new THREE.TextureCube( [posx, negx, posy, negy, posz, negz] ),\n * combine: THREE.Multiply,\n * reflectivity: ,\n * refractionRatio: ,\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n *\n * skinning: ,\n * morphTargets: ,\n * morphNormals: \n * }\n */THREE.MeshPhongMaterial=function(parameters){THREE.Material.call(this);this.type='MeshPhongMaterial';this.color=new THREE.Color(0xffffff);// diffuse\nthis.specular=new THREE.Color(0x111111);this.shininess=30;this.map=null;this.lightMap=null;this.lightMapIntensity=1.0;this.aoMap=null;this.aoMapIntensity=1.0;this.emissive=new THREE.Color(0x000000);this.emissiveIntensity=1.0;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new THREE.Vector2(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.specularMap=null;this.alphaMap=null;this.envMap=null;this.combine=THREE.MultiplyOperation;this.reflectivity=1;this.refractionRatio=0.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap='round';this.wireframeLinejoin='round';this.skinning=false;this.morphTargets=false;this.morphNormals=false;this.setValues(parameters);};THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial;THREE.MeshPhongMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.color.copy(source.color);this.specular.copy(source.specular);this.shininess=source.shininess;this.map=source.map;this.lightMap=source.lightMap;this.lightMapIntensity=source.lightMapIntensity;this.aoMap=source.aoMap;this.aoMapIntensity=source.aoMapIntensity;this.emissive.copy(source.emissive);this.emissiveMap=source.emissiveMap;this.emissiveIntensity=source.emissiveIntensity;this.bumpMap=source.bumpMap;this.bumpScale=source.bumpScale;this.normalMap=source.normalMap;this.normalScale.copy(source.normalScale);this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;this.specularMap=source.specularMap;this.alphaMap=source.alphaMap;this.envMap=source.envMap;this.combine=source.combine;this.reflectivity=source.reflectivity;this.refractionRatio=source.refractionRatio;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.wireframeLinecap=source.wireframeLinecap;this.wireframeLinejoin=source.wireframeLinejoin;this.skinning=source.skinning;this.morphTargets=source.morphTargets;this.morphNormals=source.morphNormals;return this;};// File:src/materials/MeshStandardMaterial.js\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n * parameters = {\n * color: ,\n * roughness: ,\n * metalness: ,\n * opacity: ,\n *\n * map: new THREE.Texture( ),\n *\n * lightMap: new THREE.Texture( ),\n * lightMapIntensity: \n *\n * aoMap: new THREE.Texture( ),\n * aoMapIntensity: \n *\n * emissive: ,\n * emissiveIntensity: \n * emissiveMap: new THREE.Texture( ),\n *\n * bumpMap: new THREE.Texture( ),\n * bumpScale: ,\n *\n * normalMap: new THREE.Texture( ),\n * normalScale: ,\n *\n * displacementMap: new THREE.Texture( ),\n * displacementScale: ,\n * displacementBias: ,\n *\n * roughnessMap: new THREE.Texture( ),\n *\n * metalnessMap: new THREE.Texture( ),\n *\n * alphaMap: new THREE.Texture( ),\n *\n * envMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n * envMapIntensity: \n *\n * refractionRatio: ,\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n *\n * skinning: ,\n * morphTargets: ,\n * morphNormals: \n * }\n */THREE.MeshStandardMaterial=function(parameters){THREE.Material.call(this);this.defines={'STANDARD':''};this.type='MeshStandardMaterial';this.color=new THREE.Color(0xffffff);// diffuse\nthis.roughness=0.5;this.metalness=0.5;this.map=null;this.lightMap=null;this.lightMapIntensity=1.0;this.aoMap=null;this.aoMapIntensity=1.0;this.emissive=new THREE.Color(0x000000);this.emissiveIntensity=1.0;this.emissiveMap=null;this.bumpMap=null;this.bumpScale=1;this.normalMap=null;this.normalScale=new THREE.Vector2(1,1);this.displacementMap=null;this.displacementScale=1;this.displacementBias=0;this.roughnessMap=null;this.metalnessMap=null;this.alphaMap=null;this.envMap=null;this.envMapIntensity=1.0;this.refractionRatio=0.98;this.wireframe=false;this.wireframeLinewidth=1;this.wireframeLinecap='round';this.wireframeLinejoin='round';this.skinning=false;this.morphTargets=false;this.morphNormals=false;this.setValues(parameters);};THREE.MeshStandardMaterial.prototype=Object.create(THREE.Material.prototype);THREE.MeshStandardMaterial.prototype.constructor=THREE.MeshStandardMaterial;THREE.MeshStandardMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.defines={'STANDARD':''};this.color.copy(source.color);this.roughness=source.roughness;this.metalness=source.metalness;this.map=source.map;this.lightMap=source.lightMap;this.lightMapIntensity=source.lightMapIntensity;this.aoMap=source.aoMap;this.aoMapIntensity=source.aoMapIntensity;this.emissive.copy(source.emissive);this.emissiveMap=source.emissiveMap;this.emissiveIntensity=source.emissiveIntensity;this.bumpMap=source.bumpMap;this.bumpScale=source.bumpScale;this.normalMap=source.normalMap;this.normalScale.copy(source.normalScale);this.displacementMap=source.displacementMap;this.displacementScale=source.displacementScale;this.displacementBias=source.displacementBias;this.roughnessMap=source.roughnessMap;this.metalnessMap=source.metalnessMap;this.alphaMap=source.alphaMap;this.envMap=source.envMap;this.envMapIntensity=source.envMapIntensity;this.refractionRatio=source.refractionRatio;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.wireframeLinecap=source.wireframeLinecap;this.wireframeLinejoin=source.wireframeLinejoin;this.skinning=source.skinning;this.morphTargets=source.morphTargets;this.morphNormals=source.morphNormals;return this;};// File:src/materials/MeshPhysicalMaterial.js\n/**\n * @author WestLangley / http://github.com/WestLangley\n *\n * parameters = {\n * reflectivity: \n * }\n */THREE.MeshPhysicalMaterial=function(parameters){THREE.MeshStandardMaterial.call(this);this.defines={'PHYSICAL':''};this.type='MeshPhysicalMaterial';this.reflectivity=0.5;// maps to F0 = 0.04\nthis.clearCoat=0.0;this.clearCoatRoughness=0.0;this.setValues(parameters);};THREE.MeshPhysicalMaterial.prototype=Object.create(THREE.MeshStandardMaterial.prototype);THREE.MeshPhysicalMaterial.prototype.constructor=THREE.MeshPhysicalMaterial;THREE.MeshPhysicalMaterial.prototype.copy=function(source){THREE.MeshStandardMaterial.prototype.copy.call(this,source);this.defines={'PHYSICAL':''};this.reflectivity=source.reflectivity;this.clearCoat=source.clearCoat;this.clearCoatRoughness=source.clearCoatRoughness;return this;};// File:src/materials/MultiMaterial.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.MultiMaterial=function(materials){this.uuid=THREE.Math.generateUUID();this.type='MultiMaterial';this.materials=materials instanceof Array?materials:[];this.visible=true;};THREE.MultiMaterial.prototype={constructor:THREE.MultiMaterial,toJSON:function toJSON(meta){var output={metadata:{version:4.2,type:'material',generator:'MaterialExporter'},uuid:this.uuid,type:this.type,materials:[]};var materials=this.materials;for(var i=0,l=materials.length;i,\n * opacity: ,\n * map: new THREE.Texture( ),\n *\n * size: ,\n * sizeAttenuation: \n * }\n */THREE.PointsMaterial=function(parameters){THREE.Material.call(this);this.type='PointsMaterial';this.color=new THREE.Color(0xffffff);this.map=null;this.size=1;this.sizeAttenuation=true;this.lights=false;this.setValues(parameters);};THREE.PointsMaterial.prototype=Object.create(THREE.Material.prototype);THREE.PointsMaterial.prototype.constructor=THREE.PointsMaterial;THREE.PointsMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.color.copy(source.color);this.map=source.map;this.size=source.size;this.sizeAttenuation=source.sizeAttenuation;return this;};// File:src/materials/ShaderMaterial.js\n/**\n * @author alteredq / http://alteredqualia.com/\n *\n * parameters = {\n * defines: { \"label\" : \"value\" },\n * uniforms: { \"parameter1\": { value: 1.0 }, \"parameter2\": { value2: 2 } },\n *\n * fragmentShader: ,\n * vertexShader: ,\n *\n * wireframe: ,\n * wireframeLinewidth: ,\n *\n * lights: ,\n *\n * skinning: ,\n * morphTargets: ,\n * morphNormals: \n * }\n */THREE.ShaderMaterial=function(parameters){THREE.Material.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=false;this.wireframeLinewidth=1;this.fog=false;// set to use scene fog\nthis.lights=false;// set to use scene lights\nthis.clipping=false;// set to use user-defined clipping planes\nthis.skinning=false;// set to use skinning attribute streams\nthis.morphTargets=false;// set to use morph targets\nthis.morphNormals=false;// set to use morph normals\nthis.extensions={derivatives:false,// set to use derivatives\nfragDepth:false,// set to use fragment depth values\ndrawBuffers:false,// set to use draw buffers\nshaderTextureLOD:false// set to use shader texture LOD\n};// When rendered geometry doesn't include these attributes but the material does,\n// use these default values in WebGL. This avoids errors when buffer data is missing.\nthis.defaultAttributeValues={'color':[1,1,1],'uv':[0,0],'uv2':[0,0]};this.index0AttributeName=undefined;if(parameters!==undefined){if(parameters.attributes!==undefined){console.error('THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.');}this.setValues(parameters);}};THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype);THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial;THREE.ShaderMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.fragmentShader=source.fragmentShader;this.vertexShader=source.vertexShader;this.uniforms=THREE.UniformsUtils.clone(source.uniforms);this.defines=source.defines;this.wireframe=source.wireframe;this.wireframeLinewidth=source.wireframeLinewidth;this.lights=source.lights;this.clipping=source.clipping;this.skinning=source.skinning;this.morphTargets=source.morphTargets;this.morphNormals=source.morphNormals;this.extensions=source.extensions;return this;};THREE.ShaderMaterial.prototype.toJSON=function(meta){var data=THREE.Material.prototype.toJSON.call(this,meta);data.uniforms=this.uniforms;data.vertexShader=this.vertexShader;data.fragmentShader=this.fragmentShader;return data;};// File:src/materials/RawShaderMaterial.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.RawShaderMaterial=function(parameters){THREE.ShaderMaterial.call(this,parameters);this.type='RawShaderMaterial';};THREE.RawShaderMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype);THREE.RawShaderMaterial.prototype.constructor=THREE.RawShaderMaterial;// File:src/materials/SpriteMaterial.js\n/**\n * @author alteredq / http://alteredqualia.com/\n *\n * parameters = {\n * color: ,\n * opacity: ,\n * map: new THREE.Texture( ),\n *\n *\tuvOffset: new THREE.Vector2(),\n *\tuvScale: new THREE.Vector2()\n * }\n */THREE.SpriteMaterial=function(parameters){THREE.Material.call(this);this.type='SpriteMaterial';this.color=new THREE.Color(0xffffff);this.map=null;this.rotation=0;this.fog=false;this.lights=false;this.setValues(parameters);};THREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype);THREE.SpriteMaterial.prototype.constructor=THREE.SpriteMaterial;THREE.SpriteMaterial.prototype.copy=function(source){THREE.Material.prototype.copy.call(this,source);this.color.copy(source.color);this.map=source.map;this.rotation=source.rotation;return this;};// File:src/materials/ShadowMaterial.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.ShadowMaterial=function(){THREE.ShaderMaterial.call(this,{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib[\"lights\"],{opacity:{value:1.0}}]),vertexShader:THREE.ShaderChunk['shadow_vert'],fragmentShader:THREE.ShaderChunk['shadow_frag']});this.lights=true;this.transparent=true;Object.defineProperties(this,{opacity:{enumerable:true,get:function get(){return this.uniforms.opacity.value;},set:function set(value){this.uniforms.opacity.value=value;}}});};THREE.ShadowMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype);THREE.ShadowMaterial.prototype.constructor=THREE.ShadowMaterial;// File:src/textures/Texture.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n * @author szimek / https://github.com/szimek/\n */THREE.Texture=function(image,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,encoding){Object.defineProperty(this,'id',{value:THREE.TextureIdCount++});this.uuid=THREE.Math.generateUUID();this.name='';this.sourceFile='';this.image=image!==undefined?image:THREE.Texture.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=mapping!==undefined?mapping:THREE.Texture.DEFAULT_MAPPING;this.wrapS=wrapS!==undefined?wrapS:THREE.ClampToEdgeWrapping;this.wrapT=wrapT!==undefined?wrapT:THREE.ClampToEdgeWrapping;this.magFilter=magFilter!==undefined?magFilter:THREE.LinearFilter;this.minFilter=minFilter!==undefined?minFilter:THREE.LinearMipMapLinearFilter;this.anisotropy=anisotropy!==undefined?anisotropy:1;this.format=format!==undefined?format:THREE.RGBAFormat;this.type=type!==undefined?type:THREE.UnsignedByteType;this.offset=new THREE.Vector2(0,0);this.repeat=new THREE.Vector2(1,1);this.generateMipmaps=true;this.premultiplyAlpha=false;this.flipY=true;this.unpackAlignment=4;// valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)\n// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.\n//\n// Also changing the encoding after already used by a Material will not automatically make the Material\n// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.\nthis.encoding=encoding!==undefined?encoding:THREE.LinearEncoding;this.version=0;this.onUpdate=null;};THREE.Texture.DEFAULT_IMAGE=undefined;THREE.Texture.DEFAULT_MAPPING=THREE.UVMapping;THREE.Texture.prototype={constructor:THREE.Texture,set needsUpdate(value){if(value===true)this.version++;},clone:function clone(){return new this.constructor().copy(this);},copy:function copy(source){this.image=source.image;this.mipmaps=source.mipmaps.slice(0);this.mapping=source.mapping;this.wrapS=source.wrapS;this.wrapT=source.wrapT;this.magFilter=source.magFilter;this.minFilter=source.minFilter;this.anisotropy=source.anisotropy;this.format=source.format;this.type=source.type;this.offset.copy(source.offset);this.repeat.copy(source.repeat);this.generateMipmaps=source.generateMipmaps;this.premultiplyAlpha=source.premultiplyAlpha;this.flipY=source.flipY;this.unpackAlignment=source.unpackAlignment;this.encoding=source.encoding;return this;},toJSON:function toJSON(meta){if(meta.textures[this.uuid]!==undefined){return meta.textures[this.uuid];}function getDataURL(image){var canvas;if(image.toDataURL!==undefined){canvas=image;}else{canvas=document.createElementNS('http://www.w3.org/1999/xhtml','canvas');canvas.width=image.width;canvas.height=image.height;canvas.getContext('2d').drawImage(image,0,0,image.width,image.height);}if(canvas.width>2048||canvas.height>2048){return canvas.toDataURL('image/jpeg',0.6);}else{return canvas.toDataURL('image/png');}}var output={metadata:{version:4.4,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],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(this.image!==undefined){// TODO: Move to THREE.Image\nvar image=this.image;if(image.uuid===undefined){image.uuid=THREE.Math.generateUUID();// UGH\n}if(meta.images[image.uuid]===undefined){meta.images[image.uuid]={uuid:image.uuid,url:getDataURL(image)};}output.image=image.uuid;}meta.textures[this.uuid]=output;return output;},dispose:function dispose(){this.dispatchEvent({type:'dispose'});},transformUv:function transformUv(uv){if(this.mapping!==THREE.UVMapping)return;uv.multiply(this.repeat);uv.add(this.offset);if(uv.x<0||uv.x>1){switch(this.wrapS){case THREE.RepeatWrapping:uv.x=uv.x-Math.floor(uv.x);break;case THREE.ClampToEdgeWrapping:uv.x=uv.x<0?0:1;break;case THREE.MirroredRepeatWrapping:if(Math.abs(Math.floor(uv.x)%2)===1){uv.x=Math.ceil(uv.x)-uv.x;}else{uv.x=uv.x-Math.floor(uv.x);}break;}}if(uv.y<0||uv.y>1){switch(this.wrapT){case THREE.RepeatWrapping:uv.y=uv.y-Math.floor(uv.y);break;case THREE.ClampToEdgeWrapping:uv.y=uv.y<0?0:1;break;case THREE.MirroredRepeatWrapping:if(Math.abs(Math.floor(uv.y)%2)===1){uv.y=Math.ceil(uv.y)-uv.y;}else{uv.y=uv.y-Math.floor(uv.y);}break;}}if(this.flipY){uv.y=1-uv.y;}}};Object.assign(THREE.Texture.prototype,THREE.EventDispatcher.prototype);THREE.TextureIdCount=0;// File:src/textures/DepthTexture.js\n/**\n * @author Matt DesLauriers / @mattdesl\n */THREE.DepthTexture=function(width,height,type,mapping,wrapS,wrapT,magFilter,minFilter,anisotropy){THREE.Texture.call(this,null,mapping,wrapS,wrapT,magFilter,minFilter,THREE.DepthFormat,type,anisotropy);this.image={width:width,height:height};this.type=type!==undefined?type:THREE.UnsignedShortType;this.magFilter=magFilter!==undefined?magFilter:THREE.NearestFilter;this.minFilter=minFilter!==undefined?minFilter:THREE.NearestFilter;this.flipY=false;this.generateMipmaps=false;};THREE.DepthTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DepthTexture.prototype.constructor=THREE.DepthTexture;// File:src/textures/CanvasTexture.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.CanvasTexture=function(canvas,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy){THREE.Texture.call(this,canvas,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy);this.needsUpdate=true;};THREE.CanvasTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CanvasTexture.prototype.constructor=THREE.CanvasTexture;// File:src/textures/CubeTexture.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.CubeTexture=function(images,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,encoding){images=images!==undefined?images:[];mapping=mapping!==undefined?mapping:THREE.CubeReflectionMapping;THREE.Texture.call(this,images,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,encoding);this.flipY=false;};THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CubeTexture.prototype.constructor=THREE.CubeTexture;Object.defineProperty(THREE.CubeTexture.prototype,'images',{get:function get(){return this.image;},set:function set(value){this.image=value;}});// File:src/textures/CompressedTexture.js\n/**\n * @author alteredq / http://alteredqualia.com/\n */THREE.CompressedTexture=function(mipmaps,width,height,format,type,mapping,wrapS,wrapT,magFilter,minFilter,anisotropy,encoding){THREE.Texture.call(this,null,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,encoding);this.image={width:width,height:height};this.mipmaps=mipmaps;// no flipping for cube textures\n// (also flipping doesn't work for compressed textures )\nthis.flipY=false;// can't generate mipmaps for compressed textures\n// mips must be embedded in DDS files\nthis.generateMipmaps=false;};THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype);THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture;// File:src/textures/DataTexture.js\n/**\n * @author alteredq / http://alteredqualia.com/\n */THREE.DataTexture=function(data,width,height,format,type,mapping,wrapS,wrapT,magFilter,minFilter,anisotropy,encoding){THREE.Texture.call(this,null,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy,encoding);this.image={data:data,width:width,height:height};this.magFilter=magFilter!==undefined?magFilter:THREE.NearestFilter;this.minFilter=minFilter!==undefined?minFilter:THREE.NearestFilter;this.flipY=false;this.generateMipmaps=false;};THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype);THREE.DataTexture.prototype.constructor=THREE.DataTexture;// File:src/textures/VideoTexture.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.VideoTexture=function(video,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy){THREE.Texture.call(this,video,mapping,wrapS,wrapT,magFilter,minFilter,format,type,anisotropy);this.generateMipmaps=false;var scope=this;function update(){requestAnimationFrame(update);if(video.readyState>=video.HAVE_CURRENT_DATA){scope.needsUpdate=true;}}update();};THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype);THREE.VideoTexture.prototype.constructor=THREE.VideoTexture;// File:src/objects/Group.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.Group=function(){THREE.Object3D.call(this);this.type='Group';};THREE.Group.prototype=Object.assign(Object.create(THREE.Object3D.prototype),{constructor:THREE.Group});// File:src/objects/Points.js\n/**\n * @author alteredq / http://alteredqualia.com/\n */THREE.Points=function(geometry,material){THREE.Object3D.call(this);this.type='Points';this.geometry=geometry!==undefined?geometry:new THREE.BufferGeometry();this.material=material!==undefined?material:new THREE.PointsMaterial({color:Math.random()*0xffffff});};THREE.Points.prototype=Object.assign(Object.create(THREE.Object3D.prototype),{constructor:THREE.Points,raycast:function(){var inverseMatrix=new THREE.Matrix4();var ray=new THREE.Ray();var sphere=new THREE.Sphere();return function raycast(raycaster,intersects){var object=this;var geometry=this.geometry;var matrixWorld=this.matrixWorld;var threshold=raycaster.params.Points.threshold;// Checking boundingSphere distance to ray\nif(geometry.boundingSphere===null)geometry.computeBoundingSphere();sphere.copy(geometry.boundingSphere);sphere.applyMatrix4(matrixWorld);if(raycaster.ray.intersectsSphere(sphere)===false)return;//\ninverseMatrix.getInverse(matrixWorld);ray.copy(raycaster.ray).applyMatrix4(inverseMatrix);var localThreshold=threshold/((this.scale.x+this.scale.y+this.scale.z)/3);var localThresholdSq=localThreshold*localThreshold;var position=new THREE.Vector3();function testPoint(point,index){var rayPointDistanceSq=ray.distanceSqToPoint(point);if(rayPointDistanceSqraycaster.far)return;intersects.push({distance:distance,distanceToRay:Math.sqrt(rayPointDistanceSq),point:intersectPoint.clone(),index:index,face:null,object:object});}}if(geometry instanceof THREE.BufferGeometry){var index=geometry.index;var attributes=geometry.attributes;var positions=attributes.position.array;if(index!==null){var indices=index.array;for(var i=0,il=indices.length;iprecisionSq)continue;interRay.applyMatrix4(this.matrixWorld);//Move back to world space for distance calculation\nvar distance=raycaster.ray.origin.distanceTo(interRay);if(distanceraycaster.far)continue;intersects.push({distance:distance,// What do we want? intersection point on the ray or on the segment??\n// point: raycaster.ray.at( distance ),\npoint:interSegment.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this});}}else{for(var i=0,l=positions.length/3-1;iprecisionSq)continue;interRay.applyMatrix4(this.matrixWorld);//Move back to world space for distance calculation\nvar distance=raycaster.ray.origin.distanceTo(interRay);if(distanceraycaster.far)continue;intersects.push({distance:distance,// What do we want? intersection point on the ray or on the segment??\n// point: raycaster.ray.at( distance ),\npoint:interSegment.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this});}}}else if(geometry instanceof THREE.Geometry){var vertices=geometry.vertices;var nbVertices=vertices.length;for(var i=0;iprecisionSq)continue;interRay.applyMatrix4(this.matrixWorld);//Move back to world space for distance calculation\nvar distance=raycaster.ray.origin.distanceTo(interRay);if(distanceraycaster.far)continue;intersects.push({distance:distance,// What do we want? intersection point on the ray or on the segment??\n// point: raycaster.ray.at( distance ),\npoint:interSegment.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this});}}};}(),clone:function clone(){return new this.constructor(this.geometry,this.material).copy(this);}});// File:src/objects/LineSegments.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.LineSegments=function(geometry,material){THREE.Line.call(this,geometry,material);this.type='LineSegments';};THREE.LineSegments.prototype=Object.assign(Object.create(THREE.Line.prototype),{constructor:THREE.LineSegments});// File:src/objects/Mesh.js\n/**\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n * @author mikael emtinger / http://gomo.se/\n * @author jonobr1 / http://jonobr1.com/\n */THREE.Mesh=function(geometry,material){THREE.Object3D.call(this);this.type='Mesh';this.geometry=geometry!==undefined?geometry:new THREE.BufferGeometry();this.material=material!==undefined?material:new THREE.MeshBasicMaterial({color:Math.random()*0xffffff});this.drawMode=THREE.TrianglesDrawMode;this.updateMorphTargets();};THREE.Mesh.prototype=Object.assign(Object.create(THREE.Object3D.prototype),{constructor:THREE.Mesh,setDrawMode:function setDrawMode(value){this.drawMode=value;},copy:function copy(source){THREE.Object3D.prototype.copy.call(this,source);this.drawMode=source.drawMode;return this;},updateMorphTargets:function updateMorphTargets(){if(this.geometry.morphTargets!==undefined&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1;this.morphTargetInfluences=[];this.morphTargetDictionary={};for(var m=0,ml=this.geometry.morphTargets.length;mraycaster.far)return null;return{distance:distance,point:intersectionPointWorld.clone(),object:object};}function checkBufferGeometryIntersection(object,raycaster,ray,positions,uvs,a,b,c){vA.fromArray(positions,a*3);vB.fromArray(positions,b*3);vC.fromArray(positions,c*3);var intersection=checkIntersection(object,raycaster,ray,vA,vB,vC,intersectionPoint);if(intersection){if(uvs){uvA.fromArray(uvs,a*2);uvB.fromArray(uvs,b*2);uvC.fromArray(uvs,c*2);intersection.uv=uvIntersection(intersectionPoint,vA,vB,vC,uvA,uvB,uvC);}intersection.face=new THREE.Face3(a,b,c,THREE.Triangle.normal(vA,vB,vC));intersection.faceIndex=a;}return intersection;}return function raycast(raycaster,intersects){var geometry=this.geometry;var material=this.material;var matrixWorld=this.matrixWorld;if(material===undefined)return;// Checking boundingSphere distance to ray\nif(geometry.boundingSphere===null)geometry.computeBoundingSphere();sphere.copy(geometry.boundingSphere);sphere.applyMatrix4(matrixWorld);if(raycaster.ray.intersectsSphere(sphere)===false)return;//\ninverseMatrix.getInverse(matrixWorld);ray.copy(raycaster.ray).applyMatrix4(inverseMatrix);// Check boundingBox before continuing\nif(geometry.boundingBox!==null){if(ray.intersectsBox(geometry.boundingBox)===false)return;}var uvs,intersection;if(geometry instanceof THREE.BufferGeometry){var a,b,c;var index=geometry.index;var attributes=geometry.attributes;var positions=attributes.position.array;if(attributes.uv!==undefined){uvs=attributes.uv.array;}if(index!==null){var indices=index.array;for(var i=0,l=indices.length;i0)uvs=faceVertexUvs;for(var f=0,fl=faces.length;f column1, column2, column3, column4)\n// with 8x8 pixel texture max 16 bones * 4 pixels = (8 * 8)\n// 16x16 pixel texture max 64 bones * 4 pixels = (16 * 16)\n// 32x32 pixel texture max 256 bones * 4 pixels = (32 * 32)\n// 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)\nvar size=Math.sqrt(this.bones.length*4);// 4 pixels needed for 1 matrix\nsize=THREE.Math.nextPowerOfTwo(Math.ceil(size));size=Math.max(size,4);this.boneTextureWidth=size;this.boneTextureHeight=size;this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4);// 4 floats per RGBA pixel\nthis.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType);}else{this.boneMatrices=new Float32Array(16*this.bones.length);}// use the supplied bone inverses or calculate the inverses\nif(boneInverses===undefined){this.calculateInverses();}else{if(this.bones.length===boneInverses.length){this.boneInverses=boneInverses.slice(0);}else{console.warn('THREE.Skeleton bonInverses is the wrong length.');this.boneInverses=[];for(var b=0,bl=this.bones.length;b1){v1.setFromMatrixPosition(camera.matrixWorld);v2.setFromMatrixPosition(this.matrixWorld);var distance=v1.distanceTo(v2);levels[0].object.visible=true;for(var i=1,l=levels.length;i=levels[i].distance){levels[i-1].object.visible=false;levels[i].object.visible=true;}else{break;}}for(;iguessSizeSq){return;}intersects.push({distance:Math.sqrt(distanceSq),point:this.position,face:null,object:this});};}(),clone:function clone(){return new this.constructor(this.material).copy(this);}});// File:src/objects/LensFlare.js\n/**\n * @author mikael emtinger / http://gomo.se/\n * @author alteredq / http://alteredqualia.com/\n */THREE.LensFlare=function(texture,size,distance,blending,color){THREE.Object3D.call(this);this.lensFlares=[];this.positionScreen=new THREE.Vector3();this.customUpdateCallback=undefined;if(texture!==undefined){this.add(texture,size,distance,blending,color);}};THREE.LensFlare.prototype=Object.assign(Object.create(THREE.Object3D.prototype),{constructor:THREE.LensFlare,copy:function copy(source){THREE.Object3D.prototype.copy.call(this,source);this.positionScreen.copy(source.positionScreen);this.customUpdateCallback=source.customUpdateCallback;for(var i=0,l=source.lensFlares.length;i 1) z = 0 is in front z = 1 is back\nscale:1,// scale\nrotation:0,// rotation\nopacity:opacity,// opacity\ncolor:color,// color\nblending:blending// blending\n});},/*\n\t * Update lens flares update positions on all flares based on the screen position\n\t * Set myLensFlare.customUpdateCallback to alter the flares in your project specific way.\n\t */updateLensFlares:function updateLensFlares(){var f,fl=this.lensFlares.length;var flare;var vecX=-this.positionScreen.x*2;var vecY=-this.positionScreen.y*2;for(f=0;f 0.0 ) {\\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\\n#else\\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n#endif\\n\t\t}\\n\t\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}\\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\\n\tvec4 r = roughness * c0 + c1;\\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\\n\treturn specularColor * AB.x + AB.y;\\n}\\nfloat G_BlinnPhong_Implicit( ) {\\n\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\\n\tvec3 F = F_Schlick( specularColor, dotLH );\\n\tfloat G = G_BlinnPhong_Implicit( );\\n\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\treturn F * ( G * D );\\n}\\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\\n}\\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\\n}\\n\";// File:src/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl\nTHREE.ShaderChunk['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 = dFdx( surf_pos );\\n\t\tvec3 vSigmaY = dFdy( surf_pos );\\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\";// File:src/renderers/shaders/ShaderChunk/clipping_planes_fragment.glsl\nTHREE.ShaderChunk['clipping_planes_fragment']=\"#if NUM_CLIPPING_PLANES > 0\\n\tfor ( int i = 0; i < NUM_CLIPPING_PLANES; ++ i ) {\\n\t\tvec4 plane = clippingPlanes[ i ];\\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\\n\t}\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/clipping_planes_pars_fragment.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/clipping_planes_pars_vertex.glsl\nTHREE.ShaderChunk['clipping_planes_pars_vertex']=\"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\\n\tvarying vec3 vViewPosition;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/clipping_planes_vertex.glsl\nTHREE.ShaderChunk['clipping_planes_vertex']=\"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\\n\tvViewPosition = - mvPosition.xyz;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/color_fragment.glsl\nTHREE.ShaderChunk['color_fragment']=\"#ifdef USE_COLOR\\n\tdiffuseColor.rgb *= vColor;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/color_pars_fragment.glsl\nTHREE.ShaderChunk['color_pars_fragment']=\"#ifdef USE_COLOR\\n\tvarying vec3 vColor;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl\nTHREE.ShaderChunk['color_pars_vertex']=\"#ifdef USE_COLOR\\n\tvarying vec3 vColor;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/color_vertex.glsl\nTHREE.ShaderChunk['color_vertex']=\"#ifdef USE_COLOR\\n\tvColor.xyz = color.xyz;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/common.glsl\nTHREE.ShaderChunk['common']=\"#define PI 3.14159265359\\n#define PI2 6.28318530718\\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}\\n\";// File:src/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl\nTHREE.ShaderChunk['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(texture2D(envMap, uv_20));\\n\tvec4 result = mix(color10, color20, t);\\n\treturn vec4(result.rgb, 1.0);\\n}\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl\nTHREE.ShaderChunk['defaultnormal_vertex']=\"#ifdef FLIP_SIDED\\n\tobjectNormal = -objectNormal;\\n#endif\\nvec3 transformedNormal = normalMatrix * objectNormal;\\n\";// File:src/renderers/shaders/ShaderChunk/displacementmap_vertex.glsl\nTHREE.ShaderChunk['displacementmap_vertex']=\"#ifdef USE_DISPLACEMENTMAP\\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/displacementmap_pars_vertex.glsl\nTHREE.ShaderChunk['displacementmap_pars_vertex']=\"#ifdef USE_DISPLACEMENTMAP\\n\tuniform sampler2D displacementMap;\\n\tuniform float displacementScale;\\n\tuniform float displacementBias;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl\nTHREE.ShaderChunk['emissivemap_fragment']=\"#ifdef USE_EMISSIVEMAP\\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/emissivemap_pars_fragment.glsl\nTHREE.ShaderChunk['emissivemap_pars_fragment']=\"#ifdef USE_EMISSIVEMAP\\n\tuniform sampler2D emissiveMap;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl\nTHREE.ShaderChunk['encodings_pars_fragment']=\"\\nvec4 LinearToLinear( in vec4 value ) {\\n return value;\\n}\\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\\n}\\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\\n}\\nvec4 sRGBToLinear( in vec4 value ) {\\n return 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 return 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 return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\\n}\\nvec4 LinearToRGBE( in vec4 value ) {\\n float maxComponent = max( max( value.r, value.g ), value.b );\\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\\n}\\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\\n return vec4( value.xyz * value.w * maxRange, 1.0 );\\n}\\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\\n float maxRGB = max( value.x, max( value.g, value.b ) );\\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\\n M = ceil( M * 255.0 ) / 255.0;\\n return vec4( value.rgb / ( M * maxRange ), M );\\n}\\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\\n}\\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\\n float maxRGB = max( value.x, max( value.g, value.b ) );\\n float D = max( maxRange / maxRGB, 1.0 );\\n D = min( floor( D ) / 255.0, 1.0 );\\n return 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 vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\\n vec4 vResult;\\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\\n vResult.w = fract(Le);\\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\\n return 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 float Le = value.z * 255.0 + value.w;\\n vec3 Xp_Y_XYZp;\\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\\n return vec4( max(vRGB, 0.0), 1.0 );\\n}\\n\";// File:src/renderers/shaders/ShaderChunk/encodings_fragment.glsl\nTHREE.ShaderChunk['encodings_fragment']=\" gl_FragColor = linearToOutputTexel( gl_FragColor );\\n\";// File:src/renderers/shaders/ShaderChunk/envmap_fragment.glsl\nTHREE.ShaderChunk['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, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\\n\t\tvec2 sampleUV;\\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\\n\t#elif defined( ENVMAP_TYPE_SPHERE )\\n\t\tvec3 reflectView = flipNormal * 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#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\";// File:src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl\nTHREE.ShaderChunk['envmap_pars_fragment']=\"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\\n\tuniform float reflectivity;\\n\tuniform float envMapIntenstiy;\\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\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\";// File:src/renderers/shaders/ShaderChunk/envmap_pars_vertex.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/envmap_vertex.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/fog_fragment.glsl\nTHREE.ShaderChunk['fog_fragment']=\"#ifdef USE_FOG\\n\t#ifdef USE_LOGDEPTHBUF_EXT\\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\\n\t#else\\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\\n\t#endif\\n\t#ifdef FOG_EXP2\\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\\n\t#else\\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\\n\t#endif\\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/fog_pars_fragment.glsl\nTHREE.ShaderChunk['fog_pars_fragment']=\"#ifdef USE_FOG\\n\tuniform vec3 fogColor;\\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\";// File:src/renderers/shaders/ShaderChunk/lightmap_fragment.glsl\nTHREE.ShaderChunk['lightmap_fragment']=\"#ifdef USE_LIGHTMAP\\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/lightmap_pars_fragment.glsl\nTHREE.ShaderChunk['lightmap_pars_fragment']=\"#ifdef USE_LIGHTMAP\\n\tuniform sampler2D lightMap;\\n\tuniform float lightMapIntensity;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/lights_lambert_vertex.glsl\nTHREE.ShaderChunk['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\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\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\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\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\";// File:src/renderers/shaders/ShaderChunk/lights_pars.glsl\nTHREE.ShaderChunk['lights_pars']=\"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};\\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\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\\n\t\t\tdirectLight.color = pointLight.color;\\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.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_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 ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\\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_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#if defined( USE_ENVMAP ) && defined( PHYSICAL )\\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\\n\t\t#include \\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\\n\t\t#ifdef ENVMAP_TYPE_CUBE\\n\t\t\tvec3 queryVec = flipNormal * 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 = flipNormal * 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\t#include \\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 = flipNormal * 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 = flipNormal * 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 = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * 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 = flipNormal * 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\";// File:src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl\nTHREE.ShaderChunk['lights_phong_fragment']=\"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\\n\";// File:src/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl\nTHREE.ShaderChunk['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\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\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\";// File:src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl\nTHREE.ShaderChunk['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}\\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, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\\n\t#endif\\n}\\n#define RE_Direct\t\t\t\tRE_Direct_Physical\\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\\n\";// File:src/renderers/shaders/ShaderChunk/lights_template.glsl\nTHREE.ShaderChunk['lights_template']=\"\\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\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 ] ) : 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\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\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 defined( RE_IndirectDiffuse )\\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\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 ( NUM_HEMI_LIGHTS > 0 )\\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\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\\n\t#endif\\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\\n\t#ifndef STANDARD\\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\\n\t#else\\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\\n\t#endif\\n\t\t\\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl\nTHREE.ShaderChunk['logdepthbuf_fragment']=\"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl\nTHREE.ShaderChunk['logdepthbuf_vertex']=\"#ifdef USE_LOGDEPTHBUF\\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\\n\t#ifdef USE_LOGDEPTHBUF_EXT\\n\t\tvFragDepth = 1.0 + gl_Position.w;\\n\t#else\\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\\n\t#endif\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/map_fragment.glsl\nTHREE.ShaderChunk['map_fragment']=\"#ifdef USE_MAP\\n\tvec4 texelColor = texture2D( map, vUv );\\n\ttexelColor = mapTexelToLinear( texelColor );\\n\tdiffuseColor *= texelColor;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/map_pars_fragment.glsl\nTHREE.ShaderChunk['map_pars_fragment']=\"#ifdef USE_MAP\\n\tuniform sampler2D map;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/map_particle_fragment.glsl\nTHREE.ShaderChunk['map_particle_fragment']=\"#ifdef USE_MAP\\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/map_particle_pars_fragment.glsl\nTHREE.ShaderChunk['map_particle_pars_fragment']=\"#ifdef USE_MAP\\n\tuniform vec4 offsetRepeat;\\n\tuniform sampler2D map;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/metalnessmap_fragment.glsl\nTHREE.ShaderChunk['metalnessmap_fragment']=\"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\\n\tmetalnessFactor *= texelMetalness.r;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/metalnessmap_pars_fragment.glsl\nTHREE.ShaderChunk['metalnessmap_pars_fragment']=\"#ifdef USE_METALNESSMAP\\n\tuniform sampler2D metalnessMap;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/normal_flip.glsl\nTHREE.ShaderChunk['normal_flip']=\"#ifdef DOUBLE_SIDED\\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\\n#else\\n\tfloat flipNormal = 1.0;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/normal_fragment.glsl\nTHREE.ShaderChunk['normal_fragment']=\"#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 ) * flipNormal;\\n#endif\\n#ifdef USE_NORMALMAP\\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\\n#elif defined( USE_BUMPMAP )\\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl\nTHREE.ShaderChunk['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 = dFdx( eye_pos.xyz );\\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\\n\t\tvec2 st0 = dFdx( vUv.st );\\n\t\tvec2 st1 = dFdy( vUv.st );\\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\\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\";// File:src/renderers/shaders/ShaderChunk/packing.glsl\nTHREE.ShaderChunk['packing']=\"vec3 packNormalToRGB( const in vec3 normal ) {\\n return normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n return 1.0 - 2.0 * rgb.xyz;\\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 return ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\\n return linearClipZ * ( near - far ) - near;\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\\n}\\n\";// File:src/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl\nTHREE.ShaderChunk['premultiplied_alpha_fragment']=\"#ifdef PREMULTIPLIED_ALPHA\\n\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/project_vertex.glsl\nTHREE.ShaderChunk['project_vertex']=\"#ifdef USE_SKINNING\\n\tvec4 mvPosition = modelViewMatrix * skinned;\\n#else\\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\\n#endif\\ngl_Position = projectionMatrix * mvPosition;\\n\";// File:src/renderers/shaders/ShaderChunk/roughnessmap_fragment.glsl\nTHREE.ShaderChunk['roughnessmap_fragment']=\"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\\n\troughnessFactor *= texelRoughness.r;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/roughnessmap_pars_fragment.glsl\nTHREE.ShaderChunk['roughnessmap_pars_fragment']=\"#ifdef USE_ROUGHNESSMAP\\n\tuniform sampler2D roughnessMap;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl\nTHREE.ShaderChunk['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\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\treturn (\\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\treturn (\\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\t\t\t) * ( 1.0 / 9.0 );\\n\t\t#else\\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\t\t#endif\\n\t\t}\\n\t\treturn 1.0;\\n\t}\\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\\n\t\tvec3 absV = abs( v );\\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\\n\t\tabsV *= scaleToCube;\\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\\n\t\tvec2 planar = v.xy;\\n\t\tfloat almostATexel = 1.5 * texelSizeY;\\n\t\tfloat almostOne = 1.0 - almostATexel;\\n\t\tif ( absV.z >= almostOne ) {\\n\t\t\tif ( v.z > 0.0 )\\n\t\t\t\tplanar.x = 4.0 - v.x;\\n\t\t} else if ( absV.x >= almostOne ) {\\n\t\t\tfloat signX = sign( v.x );\\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\\n\t\t} else if ( absV.y >= almostOne ) {\\n\t\t\tfloat signY = sign( v.y );\\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\\n\t\t\tplanar.y = v.z * signY - 2.0;\\n\t\t}\\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\\n\t}\\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\t\tvec3 lightToPosition = shadowCoord.xyz;\\n\t\tvec3 bd3D = normalize( lightToPosition );\\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\n\t\t\treturn (\\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\\n\t\t\t) * ( 1.0 / 9.0 );\\n\t\t#else\\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\t\t#endif\\n\t}\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl\nTHREE.ShaderChunk['shadowmap_vertex']=\"#ifdef USE_SHADOWMAP\\n\t#if NUM_DIR_LIGHTS > 0\\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\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\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\\n\t}\\n\t#endif\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl\nTHREE.ShaderChunk['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\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\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\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 ] ) : 1.0;\\n\t}\\n\t#endif\\n\t#endif\\n\treturn shadow;\\n}\\n\";// File:src/renderers/shaders/ShaderChunk/skinbase_vertex.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/skinning_pars_vertex.glsl\nTHREE.ShaderChunk['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 boneTextureWidth;\\n\t\tuniform int boneTextureHeight;\\n\t\tmat4 getBoneMatrix( const in float i ) {\\n\t\t\tfloat j = i * 4.0;\\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\\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\";// File:src/renderers/shaders/ShaderChunk/skinning_vertex.glsl\nTHREE.ShaderChunk['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\tskinned = bindMatrixInverse * skinned;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/skinnormal_vertex.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/specularmap_fragment.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/specularmap_pars_fragment.glsl\nTHREE.ShaderChunk['specularmap_pars_fragment']=\"#ifdef USE_SPECULARMAP\\n\tuniform sampler2D specularMap;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/tonemapping_fragment.glsl\nTHREE.ShaderChunk['tonemapping_fragment']=\"#if defined( TONE_MAPPING )\\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl\nTHREE.ShaderChunk['tonemapping_pars_fragment']=\"#define saturate(a) clamp( a, 0.0, 1.0 )\\nuniform float toneMappingExposure;\\nuniform float toneMappingWhitePoint;\\nvec3 LinearToneMapping( vec3 color ) {\\n return toneMappingExposure * color;\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n color *= toneMappingExposure;\\n return 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 color *= toneMappingExposure;\\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\\n}\\nvec3 OptimizedCineonToneMapping( vec3 color ) {\\n color *= toneMappingExposure;\\n color = max( vec3( 0.0 ), color - 0.004 );\\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\n\";// File:src/renderers/shaders/ShaderChunk/uv2_pars_fragment.glsl\nTHREE.ShaderChunk['uv2_pars_fragment']=\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\tvarying vec2 vUv2;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/uv2_pars_vertex.glsl\nTHREE.ShaderChunk['uv2_pars_vertex']=\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\tattribute vec2 uv2;\\n\tvarying vec2 vUv2;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/uv2_vertex.glsl\nTHREE.ShaderChunk['uv2_vertex']=\"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\tvUv2 = uv2;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl\nTHREE.ShaderChunk['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\";// File:src/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl\nTHREE.ShaderChunk['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 vec4 offsetRepeat;\\n#endif\\n\";// File:src/renderers/shaders/ShaderChunk/uv_vertex.glsl\nTHREE.ShaderChunk['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 = uv * offsetRepeat.zw + offsetRepeat.xy;\\n#endif\";// File:src/renderers/shaders/ShaderChunk/worldpos_vertex.glsl\nTHREE.ShaderChunk['worldpos_vertex']=\"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\\n\t#ifdef USE_SKINNING\\n\t\tvec4 worldPosition = modelMatrix * skinned;\\n\t#else\\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\\n\t#endif\\n#endif\\n\";// File:src/renderers/shaders/UniformsUtils.js\n/**\n * Uniform Utilities\n */THREE.UniformsUtils={merge:function merge(uniforms){var merged={};for(var u=0;u\\nvoid main() {\\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\\n\tgl_FragColor.a *= opacity;\\n}\\n\";// File:src/renderers/shaders/ShaderLib/cube_vert.glsl\nTHREE.ShaderChunk['cube_vert']=\"varying vec3 vWorldPosition;\\n#include \\nvoid main() {\\n\tvWorldPosition = transformDirection( position, modelMatrix );\\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/depth_frag.glsl\nTHREE.ShaderChunk['depth_frag']=\"#if DEPTH_PACKING == 3200\\n\tuniform float opacity;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\tvec4 diffuseColor = vec4( 1.0 );\\n\t#if DEPTH_PACKING == 3200\\n\t\tdiffuseColor.a = opacity;\\n\t#endif\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#if DEPTH_PACKING == 3200\\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\\n\t#elif DEPTH_PACKING == 3201\\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\\n\t#endif\\n}\\n\";// File:src/renderers/shaders/ShaderLib/depth_vert.glsl\nTHREE.ShaderChunk['depth_vert']=\"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/distanceRGBA_frag.glsl\nTHREE.ShaderChunk['distanceRGBA_frag']=\"uniform vec3 lightPos;\\nvarying vec4 vWorldPosition;\\n#include \\n#include \\n#include \\nvoid main () {\\n\t#include \\n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\\n}\\n\";// File:src/renderers/shaders/ShaderLib/distanceRGBA_vert.glsl\nTHREE.ShaderChunk['distanceRGBA_vert']=\"varying vec4 vWorldPosition;\\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\tvWorldPosition = worldPosition;\\n}\\n\";// File:src/renderers/shaders/ShaderLib/equirect_frag.glsl\nTHREE.ShaderChunk['equirect_frag']=\"uniform sampler2D tEquirect;\\nuniform float tFlip;\\nvarying vec3 vWorldPosition;\\n#include \\nvoid main() {\\n\tvec3 direction = normalize( vWorldPosition );\\n\tvec2 sampleUV;\\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\\n}\\n\";// File:src/renderers/shaders/ShaderLib/equirect_vert.glsl\nTHREE.ShaderChunk['equirect_vert']=\"varying vec3 vWorldPosition;\\n#include \\nvoid main() {\\n\tvWorldPosition = transformDirection( position, modelMatrix );\\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/linedashed_frag.glsl\nTHREE.ShaderChunk['linedashed_frag']=\"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\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 \\n\t#include \\n\toutgoingLight = diffuseColor.rgb;\\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/linedashed_vert.glsl\nTHREE.ShaderChunk['linedashed_vert']=\"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\tvLineDistance = scale * lineDistance;\\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\tgl_Position = projectionMatrix * mvPosition;\\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/meshbasic_frag.glsl\nTHREE.ShaderChunk['meshbasic_frag']=\"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\tReflectedLight reflectedLight;\\n\treflectedLight.directDiffuse = vec3( 0.0 );\\n\treflectedLight.directSpecular = vec3( 0.0 );\\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\\n\treflectedLight.indirectSpecular = vec3( 0.0 );\\n\t#include \\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\t#include \\n\t#include \\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/meshbasic_vert.glsl\nTHREE.ShaderChunk['meshbasic_vert']=\"#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#ifdef USE_ENVMAP\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#endif\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/meshlambert_frag.glsl\nTHREE.ShaderChunk['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 \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\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 \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\\n\t#include \\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 \\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\t#include \\n\t#include \\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/meshlambert_vert.glsl\nTHREE.ShaderChunk['meshlambert_vert']=\"#define LAMBERT\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\tvarying vec3 vLightBack;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/meshphong_frag.glsl\nTHREE.ShaderChunk['meshphong_frag']=\"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\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 \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\t#include \\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/meshphong_vert.glsl\nTHREE.ShaderChunk['meshphong_vert']=\"#define PHONG\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n#ifndef FLAT_SHADED\\n\tvNormal = normalize( transformedNormal );\\n#endif\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\tvViewPosition = - mvPosition.xyz;\\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/meshphysical_frag.glsl\nTHREE.ShaderChunk['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\\nuniform float envMapIntensity;\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\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 \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/meshphysical_vert.glsl\nTHREE.ShaderChunk['meshphysical_vert']=\"#define PHYSICAL\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n#ifndef FLAT_SHADED\\n\tvNormal = normalize( transformedNormal );\\n#endif\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\tvViewPosition = - mvPosition.xyz;\\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/normal_frag.glsl\nTHREE.ShaderChunk['normal_frag']=\"uniform float opacity;\\nvarying vec3 vNormal;\\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\tgl_FragColor = vec4( packNormalToRGB( vNormal ), opacity );\\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/normal_vert.glsl\nTHREE.ShaderChunk['normal_vert']=\"varying vec3 vNormal;\\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\tvNormal = normalize( normalMatrix * normal );\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/points_frag.glsl\nTHREE.ShaderChunk['points_frag']=\"uniform vec3 diffuse;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\tvec3 outgoingLight = vec3( 0.0 );\\n\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n\toutgoingLight = diffuseColor.rgb;\\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/points_vert.glsl\nTHREE.ShaderChunk['points_vert']=\"uniform float size;\\nuniform float scale;\\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\t#include \\n\t#include \\n\t#include \\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 \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib/shadow_frag.glsl\nTHREE.ShaderChunk['shadow_frag']=\"uniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\\n}\\n\";// File:src/renderers/shaders/ShaderLib/shadow_vert.glsl\nTHREE.ShaderChunk['shadow_vert']=\"#include \\nvoid main() {\\n\t#include \\n\t#include \\n\t#include \\n\t#include \\n}\\n\";// File:src/renderers/shaders/ShaderLib.js\n/**\n * Webgl Shader Library for three.js\n *\n * @author alteredq / http://alteredqualia.com/\n * @author mrdoob / http://mrdoob.com/\n * @author mikael emtinger / http://gomo.se/\n */THREE.ShaderLib={'basic':{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib['common'],THREE.UniformsLib['aomap'],THREE.UniformsLib['fog']]),vertexShader:THREE.ShaderChunk['meshbasic_vert'],fragmentShader:THREE.ShaderChunk['meshbasic_frag']},'lambert':{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib['common'],THREE.UniformsLib['aomap'],THREE.UniformsLib['lightmap'],THREE.UniformsLib['emissivemap'],THREE.UniformsLib['fog'],THREE.UniformsLib['lights'],{\"emissive\":{value:new THREE.Color(0x000000)}}]),vertexShader:THREE.ShaderChunk['meshlambert_vert'],fragmentShader:THREE.ShaderChunk['meshlambert_frag']},'phong':{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib['common'],THREE.UniformsLib['aomap'],THREE.UniformsLib['lightmap'],THREE.UniformsLib['emissivemap'],THREE.UniformsLib['bumpmap'],THREE.UniformsLib['normalmap'],THREE.UniformsLib['displacementmap'],THREE.UniformsLib['fog'],THREE.UniformsLib['lights'],{\"emissive\":{value:new THREE.Color(0x000000)},\"specular\":{value:new THREE.Color(0x111111)},\"shininess\":{value:30}}]),vertexShader:THREE.ShaderChunk['meshphong_vert'],fragmentShader:THREE.ShaderChunk['meshphong_frag']},'standard':{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib['common'],THREE.UniformsLib['aomap'],THREE.UniformsLib['lightmap'],THREE.UniformsLib['emissivemap'],THREE.UniformsLib['bumpmap'],THREE.UniformsLib['normalmap'],THREE.UniformsLib['displacementmap'],THREE.UniformsLib['roughnessmap'],THREE.UniformsLib['metalnessmap'],THREE.UniformsLib['fog'],THREE.UniformsLib['lights'],{\"emissive\":{value:new THREE.Color(0x000000)},\"roughness\":{value:0.5},\"metalness\":{value:0},\"envMapIntensity\":{value:1}}]),vertexShader:THREE.ShaderChunk['meshphysical_vert'],fragmentShader:THREE.ShaderChunk['meshphysical_frag']},'points':{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib['points'],THREE.UniformsLib['fog']]),vertexShader:THREE.ShaderChunk['points_vert'],fragmentShader:THREE.ShaderChunk['points_frag']},'dashed':{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib['common'],THREE.UniformsLib['fog'],{\"scale\":{value:1},\"dashSize\":{value:1},\"totalSize\":{value:2}}]),vertexShader:THREE.ShaderChunk['linedashed_vert'],fragmentShader:THREE.ShaderChunk['linedashed_frag']},'depth':{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib['common'],THREE.UniformsLib['displacementmap']]),vertexShader:THREE.ShaderChunk['depth_vert'],fragmentShader:THREE.ShaderChunk['depth_frag']},'normal':{uniforms:{\"opacity\":{value:1.0}},vertexShader:THREE.ShaderChunk['normal_vert'],fragmentShader:THREE.ShaderChunk['normal_frag']},/* -------------------------------------------------------------------------\n\t//\tCube map shader\n\t ------------------------------------------------------------------------- */'cube':{uniforms:{\"tCube\":{value:null},\"tFlip\":{value:-1},\"opacity\":{value:1.0}},vertexShader:THREE.ShaderChunk['cube_vert'],fragmentShader:THREE.ShaderChunk['cube_frag']},/* -------------------------------------------------------------------------\n\t//\tCube map shader\n\t ------------------------------------------------------------------------- */'equirect':{uniforms:{\"tEquirect\":{value:null},\"tFlip\":{value:-1}},vertexShader:THREE.ShaderChunk['equirect_vert'],fragmentShader:THREE.ShaderChunk['equirect_frag']},'distanceRGBA':{uniforms:{\"lightPos\":{value:new THREE.Vector3()}},vertexShader:THREE.ShaderChunk['distanceRGBA_vert'],fragmentShader:THREE.ShaderChunk['distanceRGBA_frag']}};THREE.ShaderLib['physical']={uniforms:THREE.UniformsUtils.merge([THREE.ShaderLib['standard'].uniforms,{\"clearCoat\":{value:0},\"clearCoatRoughness\":{value:0}}]),vertexShader:THREE.ShaderChunk['meshphysical_vert'],fragmentShader:THREE.ShaderChunk['meshphysical_frag']};// File:src/renderers/WebGLRenderer.js\n/**\n * @author supereggbert / http://www.paulbrunt.co.uk/\n * @author mrdoob / http://mrdoob.com/\n * @author alteredq / http://alteredqualia.com/\n * @author szimek / https://github.com/szimek/\n * @author tschw\n */THREE.WebGLRenderer=function(parameters){console.log('THREE.WebGLRenderer',THREE.REVISION);parameters=parameters||{};var _canvas=parameters.canvas!==undefined?parameters.canvas:document.createElementNS('http://www.w3.org/1999/xhtml','canvas'),_context=parameters.context!==undefined?parameters.context:null,_alpha=parameters.alpha!==undefined?parameters.alpha:false,_depth=parameters.depth!==undefined?parameters.depth:true,_stencil=parameters.stencil!==undefined?parameters.stencil:true,_antialias=parameters.antialias!==undefined?parameters.antialias:false,_premultipliedAlpha=parameters.premultipliedAlpha!==undefined?parameters.premultipliedAlpha:true,_preserveDrawingBuffer=parameters.preserveDrawingBuffer!==undefined?parameters.preserveDrawingBuffer:false;var lights=[];var opaqueObjects=[];var opaqueObjectsLastIndex=-1;var transparentObjects=[];var transparentObjectsLastIndex=-1;var morphInfluences=new Float32Array(8);var sprites=[];var lensFlares=[];// public properties\nthis.domElement=_canvas;this.context=null;// clearing\nthis.autoClear=true;this.autoClearColor=true;this.autoClearDepth=true;this.autoClearStencil=true;// scene graph\nthis.sortObjects=true;// user-defined clipping\nthis.clippingPlanes=[];this.localClippingEnabled=false;// physically based shading\nthis.gammaFactor=2.0;// for backwards compatibility\nthis.gammaInput=false;this.gammaOutput=false;// physical lights\nthis.physicallyCorrectLights=false;// tone mapping\nthis.toneMapping=THREE.LinearToneMapping;this.toneMappingExposure=1.0;this.toneMappingWhitePoint=1.0;// morphs\nthis.maxMorphTargets=8;this.maxMorphNormals=4;// internal properties\nvar _this=this,// internal state cache\n_currentProgram=null,_currentRenderTarget=null,_currentFramebuffer=null,_currentMaterialId=-1,_currentGeometryProgram='',_currentCamera=null,_currentScissor=new THREE.Vector4(),_currentScissorTest=null,_currentViewport=new THREE.Vector4(),//\n_usedTextureUnits=0,//\n_clearColor=new THREE.Color(0x000000),_clearAlpha=0,_width=_canvas.width,_height=_canvas.height,_pixelRatio=1,_scissor=new THREE.Vector4(0,0,_width,_height),_scissorTest=false,_viewport=new THREE.Vector4(0,0,_width,_height),// frustum\n_frustum=new THREE.Frustum(),// clipping\n_clipping=new THREE.WebGLClipping(),_clippingEnabled=false,_localClippingEnabled=false,_sphere=new THREE.Sphere(),// camera matrices cache\n_projScreenMatrix=new THREE.Matrix4(),_vector3=new THREE.Vector3(),// light arrays cache\n_lights={hash:'',ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},// info\n_infoRender={calls:0,vertices:0,faces:0,points:0};this.info={render:_infoRender,memory:{geometries:0,textures:0},programs:null};// initialize\nvar _gl;try{var attributes={alpha:_alpha,depth:_depth,stencil:_stencil,antialias:_antialias,premultipliedAlpha:_premultipliedAlpha,preserveDrawingBuffer:_preserveDrawingBuffer};_gl=_context||_canvas.getContext('webgl',attributes)||_canvas.getContext('experimental-webgl',attributes);if(_gl===null){if(_canvas.getContext('webgl')!==null){throw'Error creating WebGL context with your selected attributes.';}else{throw'Error creating WebGL context.';}}// Some experimental-webgl implementations do not have getShaderPrecisionFormat\nif(_gl.getShaderPrecisionFormat===undefined){_gl.getShaderPrecisionFormat=function(){return{'rangeMin':1,'rangeMax':1,'precision':1};};}_canvas.addEventListener('webglcontextlost',onContextLost,false);}catch(error){console.error('THREE.WebGLRenderer: '+error);}var extensions=new THREE.WebGLExtensions(_gl);extensions.get('WEBGL_depth_texture');extensions.get('OES_texture_float');extensions.get('OES_texture_float_linear');extensions.get('OES_texture_half_float');extensions.get('OES_texture_half_float_linear');extensions.get('OES_standard_derivatives');extensions.get('ANGLE_instanced_arrays');if(extensions.get('OES_element_index_uint')){THREE.BufferGeometry.MaxIndex=4294967296;}var capabilities=new THREE.WebGLCapabilities(_gl,extensions,parameters);var state=new THREE.WebGLState(_gl,extensions,paramThreeToGL);var properties=new THREE.WebGLProperties();var textures=new THREE.WebGLTextures(_gl,extensions,state,properties,capabilities,paramThreeToGL,this.info);var objects=new THREE.WebGLObjects(_gl,properties,this.info);var programCache=new THREE.WebGLPrograms(this,capabilities);var lightCache=new THREE.WebGLLights();this.info.programs=programCache.programs;var bufferRenderer=new THREE.WebGLBufferRenderer(_gl,extensions,_infoRender);var indexedBufferRenderer=new THREE.WebGLIndexedBufferRenderer(_gl,extensions,_infoRender);//\nvar backgroundCamera=new THREE.OrthographicCamera(-1,1,1,-1,0,1);var backgroundCamera2=new THREE.PerspectiveCamera();var backgroundPlaneMesh=new THREE.Mesh(new THREE.PlaneBufferGeometry(2,2),new THREE.MeshBasicMaterial({depthTest:false,depthWrite:false,fog:false}));var backgroundBoxShader=THREE.ShaderLib['cube'];var backgroundBoxMesh=new THREE.Mesh(new THREE.BoxBufferGeometry(5,5,5),new THREE.ShaderMaterial({uniforms:backgroundBoxShader.uniforms,vertexShader:backgroundBoxShader.vertexShader,fragmentShader:backgroundBoxShader.fragmentShader,side:THREE.BackSide,depthTest:false,depthWrite:false,fog:false}));//\nfunction getTargetPixelRatio(){return _currentRenderTarget===null?_pixelRatio:1;}function glClearColor(r,g,b,a){if(_premultipliedAlpha===true){r*=a;g*=a;b*=a;}state.clearColor(r,g,b,a);}function setDefaultGLState(){state.init();state.scissor(_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio));state.viewport(_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio));glClearColor(_clearColor.r,_clearColor.g,_clearColor.b,_clearAlpha);}function resetGLState(){_currentProgram=null;_currentCamera=null;_currentGeometryProgram='';_currentMaterialId=-1;state.reset();}setDefaultGLState();this.context=_gl;this.capabilities=capabilities;this.extensions=extensions;this.properties=properties;this.state=state;// shadow map\nvar shadowMap=new THREE.WebGLShadowMap(this,_lights,objects,capabilities);this.shadowMap=shadowMap;// Plugins\nvar spritePlugin=new THREE.SpritePlugin(this,sprites);var lensFlarePlugin=new THREE.LensFlarePlugin(this,lensFlares);// API\nthis.getContext=function(){return _gl;};this.getContextAttributes=function(){return _gl.getContextAttributes();};this.forceContextLoss=function(){extensions.get('WEBGL_lose_context').loseContext();};this.getMaxAnisotropy=function(){return capabilities.getMaxAnisotropy();};this.getPrecision=function(){return capabilities.precision;};this.getPixelRatio=function(){return _pixelRatio;};this.setPixelRatio=function(value){if(value===undefined)return;_pixelRatio=value;this.setSize(_viewport.z,_viewport.w,false);};this.getSize=function(){return{width:_width,height:_height};};this.setSize=function(width,height,updateStyle){_width=width;_height=height;_canvas.width=width*_pixelRatio;_canvas.height=height*_pixelRatio;if(updateStyle!==false){_canvas.style.width=width+'px';_canvas.style.height=height+'px';}this.setViewport(0,0,width,height);};this.setViewport=function(x,y,width,height){state.viewport(_viewport.set(x,y,width,height));};this.setScissor=function(x,y,width,height){state.scissor(_scissor.set(x,y,width,height));};this.setScissorTest=function(boolean){state.setScissorTest(_scissorTest=boolean);};// Clearing\nthis.getClearColor=function(){return _clearColor;};this.setClearColor=function(color,alpha){_clearColor.set(color);_clearAlpha=alpha!==undefined?alpha:1;glClearColor(_clearColor.r,_clearColor.g,_clearColor.b,_clearAlpha);};this.getClearAlpha=function(){return _clearAlpha;};this.setClearAlpha=function(alpha){_clearAlpha=alpha;glClearColor(_clearColor.r,_clearColor.g,_clearColor.b,_clearAlpha);};this.clear=function(color,depth,stencil){var bits=0;if(color===undefined||color)bits|=_gl.COLOR_BUFFER_BIT;if(depth===undefined||depth)bits|=_gl.DEPTH_BUFFER_BIT;if(stencil===undefined||stencil)bits|=_gl.STENCIL_BUFFER_BIT;_gl.clear(bits);};this.clearColor=function(){this.clear(true,false,false);};this.clearDepth=function(){this.clear(false,true,false);};this.clearStencil=function(){this.clear(false,false,true);};this.clearTarget=function(renderTarget,color,depth,stencil){this.setRenderTarget(renderTarget);this.clear(color,depth,stencil);};// Reset\nthis.resetGLState=resetGLState;this.dispose=function(){transparentObjects=[];transparentObjectsLastIndex=-1;opaqueObjects=[];opaqueObjectsLastIndex=-1;_canvas.removeEventListener('webglcontextlost',onContextLost,false);};// Events\nfunction onContextLost(event){event.preventDefault();resetGLState();setDefaultGLState();properties.clear();}function onMaterialDispose(event){var material=event.target;material.removeEventListener('dispose',onMaterialDispose);deallocateMaterial(material);}// Buffer deallocation\nfunction deallocateMaterial(material){releaseMaterialProgramReference(material);properties.delete(material);}function releaseMaterialProgramReference(material){var programInfo=properties.get(material).program;material.program=undefined;if(programInfo!==undefined){programCache.releaseProgram(programInfo);}}// Buffer rendering\nthis.renderBufferImmediate=function(object,program,material){state.initAttributes();var buffers=properties.get(object);if(object.hasPositions&&!buffers.position)buffers.position=_gl.createBuffer();if(object.hasNormals&&!buffers.normal)buffers.normal=_gl.createBuffer();if(object.hasUvs&&!buffers.uv)buffers.uv=_gl.createBuffer();if(object.hasColors&&!buffers.color)buffers.color=_gl.createBuffer();var attributes=program.getAttributes();if(object.hasPositions){_gl.bindBuffer(_gl.ARRAY_BUFFER,buffers.position);_gl.bufferData(_gl.ARRAY_BUFFER,object.positionArray,_gl.DYNAMIC_DRAW);state.enableAttribute(attributes.position);_gl.vertexAttribPointer(attributes.position,3,_gl.FLOAT,false,0,0);}if(object.hasNormals){_gl.bindBuffer(_gl.ARRAY_BUFFER,buffers.normal);if(material.type!=='MeshPhongMaterial'&&material.type!=='MeshStandardMaterial'&&material.type!=='MeshPhysicalMaterial'&&material.shading===THREE.FlatShading){for(var i=0,l=object.count*3;i8){activeInfluences.length=8;}var morphAttributes=geometry.morphAttributes;for(var i=0,l=activeInfluences.length;i0){renderer.renderInstances(geometry,drawStart,drawCount);}}else{renderer.render(drawStart,drawCount);}};function setupVertexAttributes(material,program,geometry,startIndex){var extension;if(geometry instanceof THREE.InstancedBufferGeometry){extension=extensions.get('ANGLE_instanced_arrays');if(extension===null){console.error('THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.');return;}}if(startIndex===undefined)startIndex=0;state.initAttributes();var geometryAttributes=geometry.attributes;var programAttributes=program.getAttributes();var materialDefaultAttributeValues=material.defaultAttributeValues;for(var name in programAttributes){var programAttribute=programAttributes[name];if(programAttribute>=0){var geometryAttribute=geometryAttributes[name];if(geometryAttribute!==undefined){var type=_gl.FLOAT;var array=geometryAttribute.array;var normalized=geometryAttribute.normalized;if(array instanceof Float32Array){type=_gl.FLOAT;}else if(array instanceof Float64Array){console.warn(\"Unsupported data buffer format: Float64Array\");}else if(array instanceof Uint16Array){type=_gl.UNSIGNED_SHORT;}else if(array instanceof Int16Array){type=_gl.SHORT;}else if(array instanceof Uint32Array){type=_gl.UNSIGNED_INT;}else if(array instanceof Int32Array){type=_gl.INT;}else if(array instanceof Int8Array){type=_gl.BYTE;}else if(array instanceof Uint8Array){type=_gl.UNSIGNED_BYTE;}var size=geometryAttribute.itemSize;var buffer=objects.getAttributeBuffer(geometryAttribute);if(geometryAttribute instanceof THREE.InterleavedBufferAttribute){var data=geometryAttribute.data;var stride=data.stride;var offset=geometryAttribute.offset;if(data instanceof THREE.InstancedInterleavedBuffer){state.enableAttributeAndDivisor(programAttribute,data.meshPerAttribute,extension);if(geometry.maxInstancedCount===undefined){geometry.maxInstancedCount=data.meshPerAttribute*data.count;}}else{state.enableAttribute(programAttribute);}_gl.bindBuffer(_gl.ARRAY_BUFFER,buffer);_gl.vertexAttribPointer(programAttribute,size,type,normalized,stride*data.array.BYTES_PER_ELEMENT,(startIndex*stride+offset)*data.array.BYTES_PER_ELEMENT);}else{if(geometryAttribute instanceof THREE.InstancedBufferAttribute){state.enableAttributeAndDivisor(programAttribute,geometryAttribute.meshPerAttribute,extension);if(geometry.maxInstancedCount===undefined){geometry.maxInstancedCount=geometryAttribute.meshPerAttribute*geometryAttribute.count;}}else{state.enableAttribute(programAttribute);}_gl.bindBuffer(_gl.ARRAY_BUFFER,buffer);_gl.vertexAttribPointer(programAttribute,size,type,normalized,0,startIndex*size*geometryAttribute.array.BYTES_PER_ELEMENT);}}else if(materialDefaultAttributeValues!==undefined){var value=materialDefaultAttributeValues[name];if(value!==undefined){switch(value.length){case 2:_gl.vertexAttrib2fv(programAttribute,value);break;case 3:_gl.vertexAttrib3fv(programAttribute,value);break;case 4:_gl.vertexAttrib4fv(programAttribute,value);break;default:_gl.vertexAttrib1fv(programAttribute,value);}}}}}state.disableUnusedAttributes();}// Sorting\nfunction absNumericalSort(a,b){return Math.abs(b[0])-Math.abs(a[0]);}function painterSortStable(a,b){if(a.object.renderOrder!==b.object.renderOrder){return a.object.renderOrder-b.object.renderOrder;}else if(a.material.program&&b.material.program&&a.material.program!==b.material.program){return a.material.program.id-b.material.program.id;}else if(a.material.id!==b.material.id){return a.material.id-b.material.id;}else if(a.z!==b.z){return a.z-b.z;}else{return a.id-b.id;}}function reversePainterSortStable(a,b){if(a.object.renderOrder!==b.object.renderOrder){return a.object.renderOrder-b.object.renderOrder;}if(a.z!==b.z){return b.z-a.z;}else{return a.id-b.id;}}// Rendering\nthis.render=function(scene,camera,renderTarget,forceClear){if(camera instanceof THREE.Camera===false){console.error('THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.');return;}var fog=scene.fog;// reset caching for this frame\n_currentGeometryProgram='';_currentMaterialId=-1;_currentCamera=null;// update scene graph\nif(scene.autoUpdate===true)scene.updateMatrixWorld();// update camera matrices and frustum\nif(camera.parent===null)camera.updateMatrixWorld();camera.matrixWorldInverse.getInverse(camera.matrixWorld);_projScreenMatrix.multiplyMatrices(camera.projectionMatrix,camera.matrixWorldInverse);_frustum.setFromMatrix(_projScreenMatrix);lights.length=0;opaqueObjectsLastIndex=-1;transparentObjectsLastIndex=-1;sprites.length=0;lensFlares.length=0;_localClippingEnabled=this.localClippingEnabled;_clippingEnabled=_clipping.init(this.clippingPlanes,_localClippingEnabled,camera);projectObject(scene,camera);opaqueObjects.length=opaqueObjectsLastIndex+1;transparentObjects.length=transparentObjectsLastIndex+1;if(_this.sortObjects===true){opaqueObjects.sort(painterSortStable);transparentObjects.sort(reversePainterSortStable);}//\nif(_clippingEnabled)_clipping.beginShadows();setupShadows(lights);shadowMap.render(scene,camera);setupLights(lights,camera);if(_clippingEnabled)_clipping.endShadows();//\n_infoRender.calls=0;_infoRender.vertices=0;_infoRender.faces=0;_infoRender.points=0;if(renderTarget===undefined){renderTarget=null;}this.setRenderTarget(renderTarget);//\nvar background=scene.background;if(background===null){glClearColor(_clearColor.r,_clearColor.g,_clearColor.b,_clearAlpha);}else if(background instanceof THREE.Color){glClearColor(background.r,background.g,background.b,1);}if(this.autoClear||forceClear){this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);}if(background instanceof THREE.CubeTexture){backgroundCamera2.projectionMatrix.copy(camera.projectionMatrix);backgroundCamera2.matrixWorld.extractRotation(camera.matrixWorld);backgroundCamera2.matrixWorldInverse.getInverse(backgroundCamera2.matrixWorld);backgroundBoxMesh.material.uniforms[\"tCube\"].value=background;backgroundBoxMesh.modelViewMatrix.multiplyMatrices(backgroundCamera2.matrixWorldInverse,backgroundBoxMesh.matrixWorld);objects.update(backgroundBoxMesh);_this.renderBufferDirect(backgroundCamera2,null,backgroundBoxMesh.geometry,backgroundBoxMesh.material,backgroundBoxMesh,null);}else if(background instanceof THREE.Texture){backgroundPlaneMesh.material.map=background;objects.update(backgroundPlaneMesh);_this.renderBufferDirect(backgroundCamera,null,backgroundPlaneMesh.geometry,backgroundPlaneMesh.material,backgroundPlaneMesh,null);}//\nif(scene.overrideMaterial){var overrideMaterial=scene.overrideMaterial;renderObjects(opaqueObjects,camera,fog,overrideMaterial);renderObjects(transparentObjects,camera,fog,overrideMaterial);}else{// opaque pass (front-to-back order)\nstate.setBlending(THREE.NoBlending);renderObjects(opaqueObjects,camera,fog);// transparent pass (back-to-front order)\nrenderObjects(transparentObjects,camera,fog);}// custom render plugins (post pass)\nspritePlugin.render(scene,camera);lensFlarePlugin.render(scene,camera,_currentViewport);// Generate mipmap if we're using any kind of mipmap filtering\nif(renderTarget){textures.updateRenderTargetMipmap(renderTarget);}// Ensure depth buffer writing is enabled so it can be cleared on next render\nstate.setDepthTest(true);state.setDepthWrite(true);state.setColorWrite(true);// _gl.finish();\n};function pushRenderItem(object,geometry,material,z,group){var array,index;// allocate the next position in the appropriate array\nif(material.transparent){array=transparentObjects;index=++transparentObjectsLastIndex;}else{array=opaqueObjects;index=++opaqueObjectsLastIndex;}// recycle existing render item or grow the array\nvar renderItem=array[index];if(renderItem!==undefined){renderItem.id=object.id;renderItem.object=object;renderItem.geometry=geometry;renderItem.material=material;renderItem.z=_vector3.z;renderItem.group=group;}else{renderItem={id:object.id,object:object,geometry:geometry,material:material,z:_vector3.z,group:group};// assert( index === array.length );\narray.push(renderItem);}}// TODO Duplicated code (Frustum)\nfunction isObjectViewable(object){var geometry=object.geometry;if(geometry.boundingSphere===null)geometry.computeBoundingSphere();_sphere.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld);return isSphereViewable(_sphere);}function isSpriteViewable(sprite){_sphere.center.set(0,0,0);_sphere.radius=0.7071067811865476;_sphere.applyMatrix4(sprite.matrixWorld);return isSphereViewable(_sphere);}function isSphereViewable(sphere){if(!_frustum.intersectsSphere(sphere))return false;var numPlanes=_clipping.numPlanes;if(numPlanes===0)return true;var planes=_this.clippingPlanes,center=sphere.center,negRad=-sphere.radius,i=0;do{// out when deeper than radius in the negative halfspace\nif(planes[i].distanceToPoint(center)=0){material.numSupportedMorphTargets++;}}}if(material.morphNormals){material.numSupportedMorphNormals=0;for(var i=0;i<_this.maxMorphNormals;i++){if(attributes['morphNormal'+i]>=0){material.numSupportedMorphNormals++;}}}var uniforms=materialProperties.__webglShader.uniforms;if(!(material instanceof THREE.ShaderMaterial)&&!(material instanceof THREE.RawShaderMaterial)||material.clipping===true){materialProperties.numClippingPlanes=_clipping.numPlanes;uniforms.clippingPlanes=_clipping.uniform;}if(material.lights){// store the light setup it was created for\nmaterialProperties.lightsHash=_lights.hash;// wire up the material to this renderer's lighting state\nuniforms.ambientLightColor.value=_lights.ambient;uniforms.directionalLights.value=_lights.directional;uniforms.spotLights.value=_lights.spot;uniforms.pointLights.value=_lights.point;uniforms.hemisphereLights.value=_lights.hemi;uniforms.directionalShadowMap.value=_lights.directionalShadowMap;uniforms.directionalShadowMatrix.value=_lights.directionalShadowMatrix;uniforms.spotShadowMap.value=_lights.spotShadowMap;uniforms.spotShadowMatrix.value=_lights.spotShadowMatrix;uniforms.pointShadowMap.value=_lights.pointShadowMap;uniforms.pointShadowMatrix.value=_lights.pointShadowMatrix;}var progUniforms=materialProperties.program.getUniforms(),uniformsList=THREE.WebGLUniforms.seqWithValue(progUniforms.seq,uniforms);materialProperties.uniformsList=uniformsList;materialProperties.dynamicUniforms=THREE.WebGLUniforms.splitDynamic(uniformsList,uniforms);}function setMaterial(material){if(material.side!==THREE.DoubleSide)state.enable(_gl.CULL_FACE);else state.disable(_gl.CULL_FACE);state.setFlipSided(material.side===THREE.BackSide);if(material.transparent===true){state.setBlending(material.blending,material.blendEquation,material.blendSrc,material.blendDst,material.blendEquationAlpha,material.blendSrcAlpha,material.blendDstAlpha,material.premultipliedAlpha);}else{state.setBlending(THREE.NoBlending);}state.setDepthFunc(material.depthFunc);state.setDepthTest(material.depthTest);state.setDepthWrite(material.depthWrite);state.setColorWrite(material.colorWrite);state.setPolygonOffset(material.polygonOffset,material.polygonOffsetFactor,material.polygonOffsetUnits);}function setProgram(camera,fog,material,object){_usedTextureUnits=0;var materialProperties=properties.get(material);if(_clippingEnabled){if(_localClippingEnabled||camera!==_currentCamera){var useCache=camera===_currentCamera&&material.id===_currentMaterialId;// we might want to call this function with some ClippingGroup\n// object instead of the material, once it becomes feasible\n// (#8465, #8379)\n_clipping.setState(material.clippingPlanes,material.clipShadows,camera,materialProperties,useCache);}if(materialProperties.numClippingPlanes!==undefined&&materialProperties.numClippingPlanes!==_clipping.numPlanes){material.needsUpdate=true;}}if(materialProperties.program===undefined){material.needsUpdate=true;}if(materialProperties.lightsHash!==undefined&&materialProperties.lightsHash!==_lights.hash){material.needsUpdate=true;}if(material.needsUpdate){initMaterial(material,fog,object);material.needsUpdate=false;}var refreshProgram=false;var refreshMaterial=false;var refreshLights=false;var program=materialProperties.program,p_uniforms=program.getUniforms(),m_uniforms=materialProperties.__webglShader.uniforms;if(program.id!==_currentProgram){_gl.useProgram(program.program);_currentProgram=program.id;refreshProgram=true;refreshMaterial=true;refreshLights=true;}if(material.id!==_currentMaterialId){_currentMaterialId=material.id;refreshMaterial=true;}if(refreshProgram||camera!==_currentCamera){p_uniforms.set(_gl,camera,'projectionMatrix');if(capabilities.logarithmicDepthBuffer){p_uniforms.setValue(_gl,'logDepthBufFC',2.0/(Math.log(camera.far+1.0)/Math.LN2));}if(camera!==_currentCamera){_currentCamera=camera;// lighting uniforms depend on the camera so enforce an update\n// now, in case this material supports lights - or later, when\n// the next material that does gets activated:\nrefreshMaterial=true;// set to true on material change\nrefreshLights=true;// remains set until update done\n}// load material specific uniforms\n// (shader material also gets them for the sake of genericity)\nif(material instanceof THREE.ShaderMaterial||material instanceof THREE.MeshPhongMaterial||material instanceof THREE.MeshStandardMaterial||material.envMap){var uCamPos=p_uniforms.map.cameraPosition;if(uCamPos!==undefined){uCamPos.setValue(_gl,_vector3.setFromMatrixPosition(camera.matrixWorld));}}if(material instanceof THREE.MeshPhongMaterial||material instanceof THREE.MeshLambertMaterial||material instanceof THREE.MeshBasicMaterial||material instanceof THREE.MeshStandardMaterial||material instanceof THREE.ShaderMaterial||material.skinning){p_uniforms.setValue(_gl,'viewMatrix',camera.matrixWorldInverse);}p_uniforms.set(_gl,_this,'toneMappingExposure');p_uniforms.set(_gl,_this,'toneMappingWhitePoint');}// skinning uniforms must be set even if material didn't change\n// auto-setting of texture unit for bone texture must go before other textures\n// not sure why, but otherwise weird things happen\nif(material.skinning){p_uniforms.setOptional(_gl,object,'bindMatrix');p_uniforms.setOptional(_gl,object,'bindMatrixInverse');var skeleton=object.skeleton;if(skeleton){if(capabilities.floatVertexTextures&&skeleton.useVertexTexture){p_uniforms.set(_gl,skeleton,'boneTexture');p_uniforms.set(_gl,skeleton,'boneTextureWidth');p_uniforms.set(_gl,skeleton,'boneTextureHeight');}else{p_uniforms.setOptional(_gl,skeleton,'boneMatrices');}}}if(refreshMaterial){if(material.lights){// the current material requires lighting info\n// note: all lighting uniforms are always set correctly\n// they simply reference the renderer's state for their\n// values\n//\n// use the current material's .needsUpdate flags to set\n// the GL state when required\nmarkUniformsLightsNeedsUpdate(m_uniforms,refreshLights);}// refresh uniforms common to several materials\nif(fog&&material.fog){refreshUniformsFog(m_uniforms,fog);}if(material instanceof THREE.MeshBasicMaterial||material instanceof THREE.MeshLambertMaterial||material instanceof THREE.MeshPhongMaterial||material instanceof THREE.MeshStandardMaterial||material instanceof THREE.MeshDepthMaterial){refreshUniformsCommon(m_uniforms,material);}// refresh single material specific uniforms\nif(material instanceof THREE.LineBasicMaterial){refreshUniformsLine(m_uniforms,material);}else if(material instanceof THREE.LineDashedMaterial){refreshUniformsLine(m_uniforms,material);refreshUniformsDash(m_uniforms,material);}else if(material instanceof THREE.PointsMaterial){refreshUniformsPoints(m_uniforms,material);}else if(material instanceof THREE.MeshLambertMaterial){refreshUniformsLambert(m_uniforms,material);}else if(material instanceof THREE.MeshPhongMaterial){refreshUniformsPhong(m_uniforms,material);}else if(material instanceof THREE.MeshPhysicalMaterial){refreshUniformsPhysical(m_uniforms,material);}else if(material instanceof THREE.MeshStandardMaterial){refreshUniformsStandard(m_uniforms,material);}else if(material instanceof THREE.MeshDepthMaterial){if(material.displacementMap){m_uniforms.displacementMap.value=material.displacementMap;m_uniforms.displacementScale.value=material.displacementScale;m_uniforms.displacementBias.value=material.displacementBias;}}else if(material instanceof THREE.MeshNormalMaterial){m_uniforms.opacity.value=material.opacity;}THREE.WebGLUniforms.upload(_gl,materialProperties.uniformsList,m_uniforms,_this);}// common matrices\np_uniforms.set(_gl,object,'modelViewMatrix');p_uniforms.set(_gl,object,'normalMatrix');p_uniforms.setValue(_gl,'modelMatrix',object.matrixWorld);// dynamic uniforms\nvar dynUniforms=materialProperties.dynamicUniforms;if(dynUniforms!==null){THREE.WebGLUniforms.evalDynamic(dynUniforms,m_uniforms,object,camera);THREE.WebGLUniforms.upload(_gl,dynUniforms,m_uniforms,_this);}return program;}// Uniforms (refresh uniforms objects)\nfunction refreshUniformsCommon(uniforms,material){uniforms.opacity.value=material.opacity;uniforms.diffuse.value=material.color;if(material.emissive){uniforms.emissive.value.copy(material.emissive).multiplyScalar(material.emissiveIntensity);}uniforms.map.value=material.map;uniforms.specularMap.value=material.specularMap;uniforms.alphaMap.value=material.alphaMap;if(material.aoMap){uniforms.aoMap.value=material.aoMap;uniforms.aoMapIntensity.value=material.aoMapIntensity;}// uv repeat and offset setting priorities\n// 1. color map\n// 2. specular map\n// 3. normal map\n// 4. bump map\n// 5. alpha map\n// 6. emissive map\nvar uvScaleMap;if(material.map){uvScaleMap=material.map;}else if(material.specularMap){uvScaleMap=material.specularMap;}else if(material.displacementMap){uvScaleMap=material.displacementMap;}else if(material.normalMap){uvScaleMap=material.normalMap;}else if(material.bumpMap){uvScaleMap=material.bumpMap;}else if(material.roughnessMap){uvScaleMap=material.roughnessMap;}else if(material.metalnessMap){uvScaleMap=material.metalnessMap;}else if(material.alphaMap){uvScaleMap=material.alphaMap;}else if(material.emissiveMap){uvScaleMap=material.emissiveMap;}if(uvScaleMap!==undefined){// backwards compatibility\nif(uvScaleMap instanceof THREE.WebGLRenderTarget){uvScaleMap=uvScaleMap.texture;}var offset=uvScaleMap.offset;var repeat=uvScaleMap.repeat;uniforms.offsetRepeat.value.set(offset.x,offset.y,repeat.x,repeat.y);}uniforms.envMap.value=material.envMap;// don't flip CubeTexture envMaps, flip everything else:\n// WebGLRenderTargetCube will be flipped for backwards compatibility\n// WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture\n// this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future\nuniforms.flipEnvMap.value=!(material.envMap instanceof THREE.CubeTexture)?1:-1;uniforms.reflectivity.value=material.reflectivity;uniforms.refractionRatio.value=material.refractionRatio;}function refreshUniformsLine(uniforms,material){uniforms.diffuse.value=material.color;uniforms.opacity.value=material.opacity;}function refreshUniformsDash(uniforms,material){uniforms.dashSize.value=material.dashSize;uniforms.totalSize.value=material.dashSize+material.gapSize;uniforms.scale.value=material.scale;}function refreshUniformsPoints(uniforms,material){uniforms.diffuse.value=material.color;uniforms.opacity.value=material.opacity;uniforms.size.value=material.size*_pixelRatio;uniforms.scale.value=_canvas.clientHeight*0.5;uniforms.map.value=material.map;if(material.map!==null){var offset=material.map.offset;var repeat=material.map.repeat;uniforms.offsetRepeat.value.set(offset.x,offset.y,repeat.x,repeat.y);}}function refreshUniformsFog(uniforms,fog){uniforms.fogColor.value=fog.color;if(fog instanceof THREE.Fog){uniforms.fogNear.value=fog.near;uniforms.fogFar.value=fog.far;}else if(fog instanceof THREE.FogExp2){uniforms.fogDensity.value=fog.density;}}function refreshUniformsLambert(uniforms,material){if(material.lightMap){uniforms.lightMap.value=material.lightMap;uniforms.lightMapIntensity.value=material.lightMapIntensity;}if(material.emissiveMap){uniforms.emissiveMap.value=material.emissiveMap;}}function refreshUniformsPhong(uniforms,material){uniforms.specular.value=material.specular;uniforms.shininess.value=Math.max(material.shininess,1e-4);// to prevent pow( 0.0, 0.0 )\nif(material.lightMap){uniforms.lightMap.value=material.lightMap;uniforms.lightMapIntensity.value=material.lightMapIntensity;}if(material.emissiveMap){uniforms.emissiveMap.value=material.emissiveMap;}if(material.bumpMap){uniforms.bumpMap.value=material.bumpMap;uniforms.bumpScale.value=material.bumpScale;}if(material.normalMap){uniforms.normalMap.value=material.normalMap;uniforms.normalScale.value.copy(material.normalScale);}if(material.displacementMap){uniforms.displacementMap.value=material.displacementMap;uniforms.displacementScale.value=material.displacementScale;uniforms.displacementBias.value=material.displacementBias;}}function refreshUniformsStandard(uniforms,material){uniforms.roughness.value=material.roughness;uniforms.metalness.value=material.metalness;if(material.roughnessMap){uniforms.roughnessMap.value=material.roughnessMap;}if(material.metalnessMap){uniforms.metalnessMap.value=material.metalnessMap;}if(material.lightMap){uniforms.lightMap.value=material.lightMap;uniforms.lightMapIntensity.value=material.lightMapIntensity;}if(material.emissiveMap){uniforms.emissiveMap.value=material.emissiveMap;}if(material.bumpMap){uniforms.bumpMap.value=material.bumpMap;uniforms.bumpScale.value=material.bumpScale;}if(material.normalMap){uniforms.normalMap.value=material.normalMap;uniforms.normalScale.value.copy(material.normalScale);}if(material.displacementMap){uniforms.displacementMap.value=material.displacementMap;uniforms.displacementScale.value=material.displacementScale;uniforms.displacementBias.value=material.displacementBias;}if(material.envMap){//uniforms.envMap.value = material.envMap; // part of uniforms common\nuniforms.envMapIntensity.value=material.envMapIntensity;}}function refreshUniformsPhysical(uniforms,material){uniforms.clearCoat.value=material.clearCoat;uniforms.clearCoatRoughness.value=material.clearCoatRoughness;refreshUniformsStandard(uniforms,material);}// If uniforms are marked as clean, they don't need to be loaded to the GPU.\nfunction markUniformsLightsNeedsUpdate(uniforms,value){uniforms.ambientLightColor.needsUpdate=value;uniforms.directionalLights.needsUpdate=value;uniforms.pointLights.needsUpdate=value;uniforms.spotLights.needsUpdate=value;uniforms.hemisphereLights.needsUpdate=value;}// Lighting\nfunction setupShadows(lights){var lightShadowsLength=0;for(var i=0,l=lights.length;i=capabilities.maxTextures){console.warn('WebGLRenderer: trying to use '+textureUnit+' texture units while this GPU supports only '+capabilities.maxTextures);}_usedTextureUnits+=1;return textureUnit;}this.allocTextureUnit=allocTextureUnit;// this.setTexture2D = setTexture2D;\nthis.setTexture2D=function(){var warned=false;// backwards compatibility: peel texture.texture\nreturn function setTexture2D(texture,slot){if(texture instanceof THREE.WebGLRenderTarget){if(!warned){console.warn(\"THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead.\");warned=true;}texture=texture.texture;}textures.setTexture2D(texture,slot);};}();this.setTexture=function(){var warned=false;return function setTexture(texture,slot){if(!warned){console.warn(\"THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead.\");warned=true;}textures.setTexture2D(texture,slot);};}();this.setTextureCube=function(){var warned=false;return function setTextureCube(texture,slot){// backwards compatibility: peel texture.texture\nif(texture instanceof THREE.WebGLRenderTargetCube){if(!warned){console.warn(\"THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead.\");warned=true;}texture=texture.texture;}// currently relying on the fact that WebGLRenderTargetCube.texture is a Texture and NOT a CubeTexture\n// TODO: unify these code paths\nif(texture instanceof THREE.CubeTexture||Array.isArray(texture.image)&&texture.image.length===6){// CompressedTexture can have Array in image :/\n// this function alone should take care of cube textures\ntextures.setTextureCube(texture,slot);}else{// assumed: texture property of THREE.WebGLRenderTargetCube\ntextures.setTextureCubeDynamic(texture,slot);}};}();this.getCurrentRenderTarget=function(){return _currentRenderTarget;};this.setRenderTarget=function(renderTarget){_currentRenderTarget=renderTarget;if(renderTarget&&properties.get(renderTarget).__webglFramebuffer===undefined){textures.setupRenderTarget(renderTarget);}var isCube=renderTarget instanceof THREE.WebGLRenderTargetCube;var framebuffer;if(renderTarget){var renderTargetProperties=properties.get(renderTarget);if(isCube){framebuffer=renderTargetProperties.__webglFramebuffer[renderTarget.activeCubeFace];}else{framebuffer=renderTargetProperties.__webglFramebuffer;}_currentScissor.copy(renderTarget.scissor);_currentScissorTest=renderTarget.scissorTest;_currentViewport.copy(renderTarget.viewport);}else{framebuffer=null;_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio);_currentScissorTest=_scissorTest;_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio);}if(_currentFramebuffer!==framebuffer){_gl.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);_currentFramebuffer=framebuffer;}state.scissor(_currentScissor);state.setScissorTest(_currentScissorTest);state.viewport(_currentViewport);if(isCube){var textureProperties=properties.get(renderTarget.texture);_gl.framebufferTexture2D(_gl.FRAMEBUFFER,_gl.COLOR_ATTACHMENT0,_gl.TEXTURE_CUBE_MAP_POSITIVE_X+renderTarget.activeCubeFace,textureProperties.__webglTexture,renderTarget.activeMipMapLevel);}};this.readRenderTargetPixels=function(renderTarget,x,y,width,height,buffer){if(renderTarget instanceof THREE.WebGLRenderTarget===false){console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.');return;}var framebuffer=properties.get(renderTarget).__webglFramebuffer;if(framebuffer){var restore=false;if(framebuffer!==_currentFramebuffer){_gl.bindFramebuffer(_gl.FRAMEBUFFER,framebuffer);restore=true;}try{var texture=renderTarget.texture;if(texture.format!==THREE.RGBAFormat&¶mThreeToGL(texture.format)!==_gl.getParameter(_gl.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.');return;}if(texture.type!==THREE.UnsignedByteType&¶mThreeToGL(texture.type)!==_gl.getParameter(_gl.IMPLEMENTATION_COLOR_READ_TYPE)&&!(texture.type===THREE.FloatType&&extensions.get('WEBGL_color_buffer_float'))&&!(texture.type===THREE.HalfFloatType&&extensions.get('EXT_color_buffer_half_float'))){console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.');return;}if(_gl.checkFramebufferStatus(_gl.FRAMEBUFFER)===_gl.FRAMEBUFFER_COMPLETE){// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\nif(x>=0&&x<=renderTarget.width-width&&y>=0&&y<=renderTarget.height-height){_gl.readPixels(x,y,width,height,paramThreeToGL(texture.format),paramThreeToGL(texture.type),buffer);}}else{console.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.');}}finally{if(restore){_gl.bindFramebuffer(_gl.FRAMEBUFFER,_currentFramebuffer);}}}};// Map three.js constants to WebGL constants\nfunction paramThreeToGL(p){var extension;if(p===THREE.RepeatWrapping)return _gl.REPEAT;if(p===THREE.ClampToEdgeWrapping)return _gl.CLAMP_TO_EDGE;if(p===THREE.MirroredRepeatWrapping)return _gl.MIRRORED_REPEAT;if(p===THREE.NearestFilter)return _gl.NEAREST;if(p===THREE.NearestMipMapNearestFilter)return _gl.NEAREST_MIPMAP_NEAREST;if(p===THREE.NearestMipMapLinearFilter)return _gl.NEAREST_MIPMAP_LINEAR;if(p===THREE.LinearFilter)return _gl.LINEAR;if(p===THREE.LinearMipMapNearestFilter)return _gl.LINEAR_MIPMAP_NEAREST;if(p===THREE.LinearMipMapLinearFilter)return _gl.LINEAR_MIPMAP_LINEAR;if(p===THREE.UnsignedByteType)return _gl.UNSIGNED_BYTE;if(p===THREE.UnsignedShort4444Type)return _gl.UNSIGNED_SHORT_4_4_4_4;if(p===THREE.UnsignedShort5551Type)return _gl.UNSIGNED_SHORT_5_5_5_1;if(p===THREE.UnsignedShort565Type)return _gl.UNSIGNED_SHORT_5_6_5;if(p===THREE.ByteType)return _gl.BYTE;if(p===THREE.ShortType)return _gl.SHORT;if(p===THREE.UnsignedShortType)return _gl.UNSIGNED_SHORT;if(p===THREE.IntType)return _gl.INT;if(p===THREE.UnsignedIntType)return _gl.UNSIGNED_INT;if(p===THREE.FloatType)return _gl.FLOAT;extension=extensions.get('OES_texture_half_float');if(extension!==null){if(p===THREE.HalfFloatType)return extension.HALF_FLOAT_OES;}if(p===THREE.AlphaFormat)return _gl.ALPHA;if(p===THREE.RGBFormat)return _gl.RGB;if(p===THREE.RGBAFormat)return _gl.RGBA;if(p===THREE.LuminanceFormat)return _gl.LUMINANCE;if(p===THREE.LuminanceAlphaFormat)return _gl.LUMINANCE_ALPHA;if(p===THREE.DepthFormat)return _gl.DEPTH_COMPONENT;if(p===THREE.AddEquation)return _gl.FUNC_ADD;if(p===THREE.SubtractEquation)return _gl.FUNC_SUBTRACT;if(p===THREE.ReverseSubtractEquation)return _gl.FUNC_REVERSE_SUBTRACT;if(p===THREE.ZeroFactor)return _gl.ZERO;if(p===THREE.OneFactor)return _gl.ONE;if(p===THREE.SrcColorFactor)return _gl.SRC_COLOR;if(p===THREE.OneMinusSrcColorFactor)return _gl.ONE_MINUS_SRC_COLOR;if(p===THREE.SrcAlphaFactor)return _gl.SRC_ALPHA;if(p===THREE.OneMinusSrcAlphaFactor)return _gl.ONE_MINUS_SRC_ALPHA;if(p===THREE.DstAlphaFactor)return _gl.DST_ALPHA;if(p===THREE.OneMinusDstAlphaFactor)return _gl.ONE_MINUS_DST_ALPHA;if(p===THREE.DstColorFactor)return _gl.DST_COLOR;if(p===THREE.OneMinusDstColorFactor)return _gl.ONE_MINUS_DST_COLOR;if(p===THREE.SrcAlphaSaturateFactor)return _gl.SRC_ALPHA_SATURATE;extension=extensions.get('WEBGL_compressed_texture_s3tc');if(extension!==null){if(p===THREE.RGB_S3TC_DXT1_Format)return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;if(p===THREE.RGBA_S3TC_DXT1_Format)return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(p===THREE.RGBA_S3TC_DXT3_Format)return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(p===THREE.RGBA_S3TC_DXT5_Format)return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;}extension=extensions.get('WEBGL_compressed_texture_pvrtc');if(extension!==null){if(p===THREE.RGB_PVRTC_4BPPV1_Format)return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(p===THREE.RGB_PVRTC_2BPPV1_Format)return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(p===THREE.RGBA_PVRTC_4BPPV1_Format)return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(p===THREE.RGBA_PVRTC_2BPPV1_Format)return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;}extension=extensions.get('WEBGL_compressed_texture_etc1');if(extension!==null){if(p===THREE.RGB_ETC1_Format)return extension.COMPRESSED_RGB_ETC1_WEBGL;}extension=extensions.get('EXT_blend_minmax');if(extension!==null){if(p===THREE.MinEquation)return extension.MIN_EXT;if(p===THREE.MaxEquation)return extension.MAX_EXT;}return 0;}};// File:src/renderers/WebGLRenderTarget.js\n/**\n * @author szimek / https://github.com/szimek/\n * @author alteredq / http://alteredqualia.com/\n * @author Marius Kintel / https://github.com/kintel\n *//*\n In options, we can specify:\n * Texture parameters for an auto-generated target texture\n * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers\n*/THREE.WebGLRenderTarget=function(width,height,options){this.uuid=THREE.Math.generateUUID();this.width=width;this.height=height;this.scissor=new THREE.Vector4(0,0,width,height);this.scissorTest=false;this.viewport=new THREE.Vector4(0,0,width,height);options=options||{};if(options.minFilter===undefined)options.minFilter=THREE.LinearFilter;this.texture=new THREE.Texture(undefined,undefined,options.wrapS,options.wrapT,options.magFilter,options.minFilter,options.format,options.type,options.anisotropy,options.encoding);this.depthBuffer=options.depthBuffer!==undefined?options.depthBuffer:true;this.stencilBuffer=options.stencilBuffer!==undefined?options.stencilBuffer:true;this.depthTexture=null;};Object.assign(THREE.WebGLRenderTarget.prototype,THREE.EventDispatcher.prototype,{setSize:function setSize(width,height){if(this.width!==width||this.height!==height){this.width=width;this.height=height;this.dispose();}this.viewport.set(0,0,width,height);this.scissor.set(0,0,width,height);},clone:function clone(){return new this.constructor().copy(this);},copy:function copy(source){this.width=source.width;this.height=source.height;this.viewport.copy(source.viewport);this.texture=source.texture.clone();this.depthBuffer=source.depthBuffer;this.stencilBuffer=source.stencilBuffer;this.depthTexture=source.depthTexture;return this;},dispose:function dispose(){this.dispatchEvent({type:'dispose'});}});// File:src/renderers/WebGLRenderTargetCube.js\n/**\n * @author alteredq / http://alteredqualia.com\n */THREE.WebGLRenderTargetCube=function(width,height,options){THREE.WebGLRenderTarget.call(this,width,height,options);this.activeCubeFace=0;// PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5\nthis.activeMipMapLevel=0;};THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype);THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube;// File:src/renderers/webgl/WebGLBufferRenderer.js\n/**\n* @author mrdoob / http://mrdoob.com/\n*/THREE.WebGLBufferRenderer=function(_gl,extensions,_infoRender){var mode;function setMode(value){mode=value;}function render(start,count){_gl.drawArrays(mode,start,count);_infoRender.calls++;_infoRender.vertices+=count;if(mode===_gl.TRIANGLES)_infoRender.faces+=count/3;}function renderInstances(geometry){var extension=extensions.get('ANGLE_instanced_arrays');if(extension===null){console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.');return;}var position=geometry.attributes.position;var count=0;if(position instanceof THREE.InterleavedBufferAttribute){count=position.data.count;extension.drawArraysInstancedANGLE(mode,0,count,geometry.maxInstancedCount);}else{count=position.count;extension.drawArraysInstancedANGLE(mode,0,count,geometry.maxInstancedCount);}_infoRender.calls++;_infoRender.vertices+=count*geometry.maxInstancedCount;if(mode===_gl.TRIANGLES)_infoRender.faces+=geometry.maxInstancedCount*count/3;}this.setMode=setMode;this.render=render;this.renderInstances=renderInstances;};// File:src/renderers/webgl/WebGLClipping.js\nTHREE.WebGLClipping=function(){var scope=this,globalState=null,numGlobalPlanes=0,localClippingEnabled=false,renderingShadows=false,plane=new THREE.Plane(),viewNormalMatrix=new THREE.Matrix3(),uniform={value:null,needsUpdate:false};this.uniform=uniform;this.numPlanes=0;this.init=function(planes,enableLocalClipping,camera){var enabled=planes.length!==0||enableLocalClipping||// enable state of previous frame - the clipping code has to\n// run another frame in order to reset the state:\nnumGlobalPlanes!==0||localClippingEnabled;localClippingEnabled=enableLocalClipping;globalState=projectPlanes(planes,camera,0);numGlobalPlanes=planes.length;return enabled;};this.beginShadows=function(){renderingShadows=true;projectPlanes(null);};this.endShadows=function(){renderingShadows=false;resetGlobalState();};this.setState=function(planes,clipShadows,camera,cache,fromCache){if(!localClippingEnabled||planes===null||planes.length===0||renderingShadows&&!clipShadows){// there's no local clipping\nif(renderingShadows){// there's no global clipping\nprojectPlanes(null);}else{resetGlobalState();}}else{var nGlobal=renderingShadows?0:numGlobalPlanes,lGlobal=nGlobal*4,dstArray=cache.clippingState||null;uniform.value=dstArray;// ensure unique state\ndstArray=projectPlanes(planes,camera,lGlobal,fromCache);for(var i=0;i!==lGlobal;++i){dstArray[i]=globalState[i];}cache.clippingState=dstArray;this.numPlanes+=nGlobal;}};function resetGlobalState(){if(uniform.value!==globalState){uniform.value=globalState;uniform.needsUpdate=numGlobalPlanes>0;}scope.numPlanes=numGlobalPlanes;}function projectPlanes(planes,camera,dstOffset,skipTransform){var nPlanes=planes!==null?planes.length:0,dstArray=null;if(nPlanes!==0){dstArray=uniform.value;if(skipTransform!==true||dstArray===null){var flatSize=dstOffset+nPlanes*4,viewMatrix=camera.matrixWorldInverse;viewNormalMatrix.getNormalMatrix(viewMatrix);if(dstArray===null||dstArray.length0&&gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.HIGH_FLOAT).precision>0){return'highp';}precision='mediump';}if(precision==='mediump'){if(gl.getShaderPrecisionFormat(gl.VERTEX_SHADER,gl.MEDIUM_FLOAT).precision>0&&gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER,gl.MEDIUM_FLOAT).precision>0){return'mediump';}}return'lowp';}this.getMaxAnisotropy=getMaxAnisotropy;this.getMaxPrecision=getMaxPrecision;this.precision=parameters.precision!==undefined?parameters.precision:'highp';this.logarithmicDepthBuffer=parameters.logarithmicDepthBuffer!==undefined?parameters.logarithmicDepthBuffer:false;this.maxTextures=gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);this.maxVertexTextures=gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);this.maxTextureSize=gl.getParameter(gl.MAX_TEXTURE_SIZE);this.maxCubemapSize=gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);this.maxAttributes=gl.getParameter(gl.MAX_VERTEX_ATTRIBS);this.maxVertexUniforms=gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);this.maxVaryings=gl.getParameter(gl.MAX_VARYING_VECTORS);this.maxFragmentUniforms=gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);this.vertexTextures=this.maxVertexTextures>0;this.floatFragmentTextures=!!extensions.get('OES_texture_float');this.floatVertexTextures=this.vertexTextures&&this.floatFragmentTextures;var _maxPrecision=getMaxPrecision(this.precision);if(_maxPrecision!==this.precision){console.warn('THREE.WebGLRenderer:',this.precision,'not supported, using',_maxPrecision,'instead.');this.precision=_maxPrecision;}if(this.logarithmicDepthBuffer){this.logarithmicDepthBuffer=!!extensions.get('EXT_frag_depth');}};// File:src/renderers/webgl/WebGLGeometries.js\n/**\n* @author mrdoob / http://mrdoob.com/\n*/THREE.WebGLGeometries=function(gl,properties,info){var geometries={};function get(object){var geometry=object.geometry;if(geometries[geometry.id]!==undefined){return geometries[geometry.id];}geometry.addEventListener('dispose',onGeometryDispose);var buffergeometry;if(geometry instanceof THREE.BufferGeometry){buffergeometry=geometry;}else if(geometry instanceof THREE.Geometry){if(geometry._bufferGeometry===undefined){geometry._bufferGeometry=new THREE.BufferGeometry().setFromObject(object);}buffergeometry=geometry._bufferGeometry;}geometries[geometry.id]=buffergeometry;info.memory.geometries++;return buffergeometry;}function onGeometryDispose(event){var geometry=event.target;var buffergeometry=geometries[geometry.id];if(buffergeometry.index!==null){deleteAttribute(buffergeometry.index);}deleteAttributes(buffergeometry.attributes);geometry.removeEventListener('dispose',onGeometryDispose);delete geometries[geometry.id];// TODO\nvar property=properties.get(geometry);if(property.wireframe){deleteAttribute(property.wireframe);}properties.delete(geometry);var bufferproperty=properties.get(buffergeometry);if(bufferproperty.wireframe){deleteAttribute(bufferproperty.wireframe);}properties.delete(buffergeometry);//\ninfo.memory.geometries--;}function getAttributeBuffer(attribute){if(attribute instanceof THREE.InterleavedBufferAttribute){return properties.get(attribute.data).__webglBuffer;}return properties.get(attribute).__webglBuffer;}function deleteAttribute(attribute){var buffer=getAttributeBuffer(attribute);if(buffer!==undefined){gl.deleteBuffer(buffer);removeAttributeBuffer(attribute);}}function deleteAttributes(attributes){for(var name in attributes){deleteAttribute(attributes[name]);}}function removeAttributeBuffer(attribute){if(attribute instanceof THREE.InterleavedBufferAttribute){properties.delete(attribute.data);}else{properties.delete(attribute);}}this.get=get;};// File:src/renderers/webgl/WebGLLights.js\n/**\n* @author mrdoob / http://mrdoob.com/\n*/THREE.WebGLLights=function(){var lights={};this.get=function(light){if(lights[light.id]!==undefined){return lights[light.id];}var uniforms;switch(light.type){case'DirectionalLight':uniforms={direction:new THREE.Vector3(),color:new THREE.Color(),shadow:false,shadowBias:0,shadowRadius:1,shadowMapSize:new THREE.Vector2()};break;case'SpotLight':uniforms={position:new THREE.Vector3(),direction:new THREE.Vector3(),color:new THREE.Color(),distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:false,shadowBias:0,shadowRadius:1,shadowMapSize:new THREE.Vector2()};break;case'PointLight':uniforms={position:new THREE.Vector3(),color:new THREE.Color(),distance:0,decay:0,shadow:false,shadowBias:0,shadowRadius:1,shadowMapSize:new THREE.Vector2()};break;case'HemisphereLight':uniforms={direction:new THREE.Vector3(),skyColor:new THREE.Color(),groundColor:new THREE.Color()};break;}lights[light.id]=uniforms;return uniforms;};};// File:src/renderers/webgl/WebGLObjects.js\n/**\n* @author mrdoob / http://mrdoob.com/\n*/THREE.WebGLObjects=function(gl,properties,info){var geometries=new THREE.WebGLGeometries(gl,properties,info);//\nfunction update(object){// TODO: Avoid updating twice (when using shadowMap). Maybe add frame counter.\nvar geometry=geometries.get(object);if(object.geometry instanceof THREE.Geometry){geometry.updateFromObject(object);}var index=geometry.index;var attributes=geometry.attributes;if(index!==null){updateAttribute(index,gl.ELEMENT_ARRAY_BUFFER);}for(var name in attributes){updateAttribute(attributes[name],gl.ARRAY_BUFFER);}// morph targets\nvar morphAttributes=geometry.morphAttributes;for(var name in morphAttributes){var array=morphAttributes[name];for(var i=0,l=array.length;i65535?Uint32Array:Uint16Array;var attribute=new THREE.BufferAttribute(new TypeArray(indices),1);updateAttribute(attribute,gl.ELEMENT_ARRAY_BUFFER);property.wireframe=attribute;return attribute;}function checkEdge(edges,a,b){if(a>b){var tmp=a;a=b;b=tmp;}var list=edges[a];if(list===undefined){edges[a]=[b];return true;}else if(list.indexOf(b)===-1){list.push(b);return true;}return false;}this.getAttributeBuffer=getAttributeBuffer;this.getWireframeAttribute=getWireframeAttribute;this.update=update;};// File:src/renderers/webgl/WebGLProgram.js\nTHREE.WebGLProgram=function(){var programIdCount=0;function getEncodingComponents(encoding){switch(encoding){case THREE.LinearEncoding:return['Linear','( value )'];case THREE.sRGBEncoding:return['sRGB','( value )'];case THREE.RGBEEncoding:return['RGBE','( value )'];case THREE.RGBM7Encoding:return['RGBM','( value, 7.0 )'];case THREE.RGBM16Encoding:return['RGBM','( value, 16.0 )'];case THREE.RGBDEncoding:return['RGBD','( value, 256.0 )'];case THREE.GammaEncoding:return['Gamma','( value, float( GAMMA_FACTOR ) )'];default:throw new Error('unsupported encoding: '+encoding);}}function getTexelDecodingFunction(functionName,encoding){var components=getEncodingComponents(encoding);return\"vec4 \"+functionName+\"( vec4 value ) { return \"+components[0]+\"ToLinear\"+components[1]+\"; }\";}function getTexelEncodingFunction(functionName,encoding){var components=getEncodingComponents(encoding);return\"vec4 \"+functionName+\"( vec4 value ) { return LinearTo\"+components[0]+components[1]+\"; }\";}function getToneMappingFunction(functionName,toneMapping){var toneMappingName;switch(toneMapping){case THREE.LinearToneMapping:toneMappingName=\"Linear\";break;case THREE.ReinhardToneMapping:toneMappingName=\"Reinhard\";break;case THREE.Uncharted2ToneMapping:toneMappingName=\"Uncharted2\";break;case THREE.CineonToneMapping:toneMappingName=\"OptimizedCineon\";break;default:throw new Error('unsupported toneMapping: '+toneMapping);}return\"vec3 \"+functionName+\"( vec3 color ) { return \"+toneMappingName+\"ToneMapping( color ); }\";}function generateExtensions(extensions,parameters,rendererExtensions){extensions=extensions||{};var chunks=[extensions.derivatives||parameters.envMapCubeUV||parameters.bumpMap||parameters.normalMap||parameters.flatShading?'#extension GL_OES_standard_derivatives : enable':'',(extensions.fragDepth||parameters.logarithmicDepthBuffer)&&rendererExtensions.get('EXT_frag_depth')?'#extension GL_EXT_frag_depth : enable':'',extensions.drawBuffers&&rendererExtensions.get('WEBGL_draw_buffers')?'#extension GL_EXT_draw_buffers : require':'',(extensions.shaderTextureLOD||parameters.envMap)&&rendererExtensions.get('EXT_shader_texture_lod')?'#extension GL_EXT_shader_texture_lod : enable':''];return chunks.filter(filterEmptyLine).join('\\n');}function generateDefines(defines){var chunks=[];for(var name in defines){var value=defines[name];if(value===false)continue;chunks.push('#define '+name+' '+value);}return chunks.join('\\n');}function fetchAttributeLocations(gl,program,identifiers){var attributes={};var n=gl.getProgramParameter(program,gl.ACTIVE_ATTRIBUTES);for(var i=0;i/g;function replace(match,include){var replace=THREE.ShaderChunk[include];if(replace===undefined){throw new Error('Can not resolve #include <'+include+'>');}return parseIncludes(replace);}return string.replace(pattern,replace);}function unrollLoops(string){var pattern=/for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g;function replace(match,start,end,snippet){var unroll='';for(var i=parseInt(start);i0?renderer.gammaFactor:1.0;// console.log( 'building new program ' );\n//\nvar customExtensions=generateExtensions(extensions,parameters,renderer.extensions);var customDefines=generateDefines(defines);//\nvar program=gl.createProgram();var prefixVertex,prefixFragment;if(material instanceof THREE.RawShaderMaterial){prefixVertex=[customDefines].filter(filterEmptyLine).join('\\n');prefixFragment=[customDefines].filter(filterEmptyLine).join('\\n');}else{prefixVertex=['precision '+parameters.precision+' float;','precision '+parameters.precision+' int;','#define SHADER_NAME '+material.__webglShader.name,customDefines,parameters.supportsVertexTextures?'#define VERTEX_TEXTURES':'','#define GAMMA_FACTOR '+gammaFactorDefine,'#define MAX_BONES '+parameters.maxBones,parameters.map?'#define USE_MAP':'',parameters.envMap?'#define USE_ENVMAP':'',parameters.envMap?'#define '+envMapModeDefine:'',parameters.lightMap?'#define USE_LIGHTMAP':'',parameters.aoMap?'#define USE_AOMAP':'',parameters.emissiveMap?'#define USE_EMISSIVEMAP':'',parameters.bumpMap?'#define USE_BUMPMAP':'',parameters.normalMap?'#define USE_NORMALMAP':'',parameters.displacementMap&¶meters.supportsVertexTextures?'#define USE_DISPLACEMENTMAP':'',parameters.specularMap?'#define USE_SPECULARMAP':'',parameters.roughnessMap?'#define USE_ROUGHNESSMAP':'',parameters.metalnessMap?'#define USE_METALNESSMAP':'',parameters.alphaMap?'#define USE_ALPHAMAP':'',parameters.vertexColors?'#define USE_COLOR':'',parameters.flatShading?'#define FLAT_SHADED':'',parameters.skinning?'#define USE_SKINNING':'',parameters.useVertexTexture?'#define BONE_TEXTURE':'',parameters.morphTargets?'#define USE_MORPHTARGETS':'',parameters.morphNormals&¶meters.flatShading===false?'#define USE_MORPHNORMALS':'',parameters.doubleSided?'#define DOUBLE_SIDED':'',parameters.flipSided?'#define FLIP_SIDED':'','#define NUM_CLIPPING_PLANES '+parameters.numClippingPlanes,parameters.shadowMapEnabled?'#define USE_SHADOWMAP':'',parameters.shadowMapEnabled?'#define '+shadowMapTypeDefine:'',parameters.sizeAttenuation?'#define USE_SIZEATTENUATION':'',parameters.logarithmicDepthBuffer?'#define USE_LOGDEPTHBUF':'',parameters.logarithmicDepthBuffer&&renderer.extensions.get('EXT_frag_depth')?'#define USE_LOGDEPTHBUF_EXT':'','uniform mat4 modelMatrix;','uniform mat4 modelViewMatrix;','uniform mat4 projectionMatrix;','uniform mat4 viewMatrix;','uniform mat3 normalMatrix;','uniform vec3 cameraPosition;','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(filterEmptyLine).join('\\n');prefixFragment=[customExtensions,'precision '+parameters.precision+' float;','precision '+parameters.precision+' int;','#define SHADER_NAME '+material.__webglShader.name,customDefines,parameters.alphaTest?'#define ALPHATEST '+parameters.alphaTest:'','#define GAMMA_FACTOR '+gammaFactorDefine,parameters.useFog&¶meters.fog?'#define USE_FOG':'',parameters.useFog&¶meters.fogExp?'#define FOG_EXP2':'',parameters.map?'#define USE_MAP':'',parameters.envMap?'#define USE_ENVMAP':'',parameters.envMap?'#define '+envMapTypeDefine:'',parameters.envMap?'#define '+envMapModeDefine:'',parameters.envMap?'#define '+envMapBlendingDefine:'',parameters.lightMap?'#define USE_LIGHTMAP':'',parameters.aoMap?'#define USE_AOMAP':'',parameters.emissiveMap?'#define USE_EMISSIVEMAP':'',parameters.bumpMap?'#define USE_BUMPMAP':'',parameters.normalMap?'#define USE_NORMALMAP':'',parameters.specularMap?'#define USE_SPECULARMAP':'',parameters.roughnessMap?'#define USE_ROUGHNESSMAP':'',parameters.metalnessMap?'#define USE_METALNESSMAP':'',parameters.alphaMap?'#define USE_ALPHAMAP':'',parameters.vertexColors?'#define USE_COLOR':'',parameters.flatShading?'#define FLAT_SHADED':'',parameters.doubleSided?'#define DOUBLE_SIDED':'',parameters.flipSided?'#define FLIP_SIDED':'','#define NUM_CLIPPING_PLANES '+parameters.numClippingPlanes,parameters.shadowMapEnabled?'#define USE_SHADOWMAP':'',parameters.shadowMapEnabled?'#define '+shadowMapTypeDefine:'',parameters.premultipliedAlpha?\"#define PREMULTIPLIED_ALPHA\":'',parameters.physicallyCorrectLights?\"#define PHYSICALLY_CORRECT_LIGHTS\":'',parameters.logarithmicDepthBuffer?'#define USE_LOGDEPTHBUF':'',parameters.logarithmicDepthBuffer&&renderer.extensions.get('EXT_frag_depth')?'#define USE_LOGDEPTHBUF_EXT':'',parameters.envMap&&renderer.extensions.get('EXT_shader_texture_lod')?'#define TEXTURE_LOD_EXT':'','uniform mat4 viewMatrix;','uniform vec3 cameraPosition;',parameters.toneMapping!==THREE.NoToneMapping?\"#define TONE_MAPPING\":'',parameters.toneMapping!==THREE.NoToneMapping?THREE.ShaderChunk['tonemapping_pars_fragment']:'',// this code is required here because it is used by the toneMapping() function defined below\nparameters.toneMapping!==THREE.NoToneMapping?getToneMappingFunction(\"toneMapping\",parameters.toneMapping):'',parameters.outputEncoding||parameters.mapEncoding||parameters.envMapEncoding||parameters.emissiveMapEncoding?THREE.ShaderChunk['encodings_pars_fragment']:'',// this code is required here because it is used by the various encoding/decoding function defined below\nparameters.mapEncoding?getTexelDecodingFunction('mapTexelToLinear',parameters.mapEncoding):'',parameters.envMapEncoding?getTexelDecodingFunction('envMapTexelToLinear',parameters.envMapEncoding):'',parameters.emissiveMapEncoding?getTexelDecodingFunction('emissiveMapTexelToLinear',parameters.emissiveMapEncoding):'',parameters.outputEncoding?getTexelEncodingFunction(\"linearToOutputTexel\",parameters.outputEncoding):'',parameters.depthPacking?\"#define DEPTH_PACKING \"+material.depthPacking:'','\\n'].filter(filterEmptyLine).join('\\n');}vertexShader=parseIncludes(vertexShader,parameters);vertexShader=replaceLightNums(vertexShader,parameters);fragmentShader=parseIncludes(fragmentShader,parameters);fragmentShader=replaceLightNums(fragmentShader,parameters);if(material instanceof THREE.ShaderMaterial===false){vertexShader=unrollLoops(vertexShader);fragmentShader=unrollLoops(fragmentShader);}var vertexGlsl=prefixVertex+vertexShader;var fragmentGlsl=prefixFragment+fragmentShader;// console.log( '*VERTEX*', vertexGlsl );\n// console.log( '*FRAGMENT*', fragmentGlsl );\nvar glVertexShader=THREE.WebGLShader(gl,gl.VERTEX_SHADER,vertexGlsl);var glFragmentShader=THREE.WebGLShader(gl,gl.FRAGMENT_SHADER,fragmentGlsl);gl.attachShader(program,glVertexShader);gl.attachShader(program,glFragmentShader);// Force a particular attribute to index 0.\nif(material.index0AttributeName!==undefined){gl.bindAttribLocation(program,0,material.index0AttributeName);}else if(parameters.morphTargets===true){// programs with morphTargets displace position out of attribute 0\ngl.bindAttribLocation(program,0,'position');}gl.linkProgram(program);var programLog=gl.getProgramInfoLog(program);var vertexLog=gl.getShaderInfoLog(glVertexShader);var fragmentLog=gl.getShaderInfoLog(glFragmentShader);var runnable=true;var haveDiagnostics=true;// console.log( '**VERTEX**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glVertexShader ) );\n// console.log( '**FRAGMENT**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( glFragmentShader ) );\nif(gl.getProgramParameter(program,gl.LINK_STATUS)===false){runnable=false;console.error('THREE.WebGLProgram: shader error: ',gl.getError(),'gl.VALIDATE_STATUS',gl.getProgramParameter(program,gl.VALIDATE_STATUS),'gl.getProgramInfoLog',programLog,vertexLog,fragmentLog);}else if(programLog!==''){console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()',programLog);}else if(vertexLog===''||fragmentLog===''){haveDiagnostics=false;}if(haveDiagnostics){this.diagnostics={runnable:runnable,material:material,programLog:programLog,vertexShader:{log:vertexLog,prefix:prefixVertex},fragmentShader:{log:fragmentLog,prefix:prefixFragment}};}// clean up\ngl.deleteShader(glVertexShader);gl.deleteShader(glFragmentShader);// set up caching for uniform locations\nvar cachedUniforms;this.getUniforms=function(){if(cachedUniforms===undefined){cachedUniforms=new THREE.WebGLUniforms(gl,program,renderer);}return cachedUniforms;};// set up caching for attribute locations\nvar cachedAttributes;this.getAttributes=function(){if(cachedAttributes===undefined){cachedAttributes=fetchAttributeLocations(gl,program);}return cachedAttributes;};// free resource\nthis.destroy=function(){gl.deleteProgram(program);this.program=undefined;};// DEPRECATED\nObject.defineProperties(this,{uniforms:{get:function get(){console.warn('THREE.WebGLProgram: .uniforms is now .getUniforms().');return this.getUniforms();}},attributes:{get:function get(){console.warn('THREE.WebGLProgram: .attributes is now .getAttributes().');return this.getAttributes();}}});//\nthis.id=programIdCount++;this.code=code;this.usedTimes=1;this.program=program;this.vertexShader=glVertexShader;this.fragmentShader=glFragmentShader;return this;};}();// File:src/renderers/webgl/WebGLPrograms.js\nTHREE.WebGLPrograms=function(renderer,capabilities){var programs=[];var shaderIDs={MeshDepthMaterial:'depth',MeshNormalMaterial:'normal',MeshBasicMaterial:'basic',MeshLambertMaterial:'lambert',MeshPhongMaterial:'phong',MeshStandardMaterial:'physical',MeshPhysicalMaterial:'physical',LineBasicMaterial:'basic',LineDashedMaterial:'dashed',PointsMaterial:'points'};var parameterNames=[\"precision\",\"supportsVertexTextures\",\"map\",\"mapEncoding\",\"envMap\",\"envMapMode\",\"envMapEncoding\",\"lightMap\",\"aoMap\",\"emissiveMap\",\"emissiveMapEncoding\",\"bumpMap\",\"normalMap\",\"displacementMap\",\"specularMap\",\"roughnessMap\",\"metalnessMap\",\"alphaMap\",\"combine\",\"vertexColors\",\"fog\",\"useFog\",\"fogExp\",\"flatShading\",\"sizeAttenuation\",\"logarithmicDepthBuffer\",\"skinning\",\"maxBones\",\"useVertexTexture\",\"morphTargets\",\"morphNormals\",\"maxMorphTargets\",\"maxMorphNormals\",\"premultipliedAlpha\",\"numDirLights\",\"numPointLights\",\"numSpotLights\",\"numHemiLights\",\"shadowMapEnabled\",\"shadowMapType\",\"toneMapping\",'physicallyCorrectLights',\"alphaTest\",\"doubleSided\",\"flipSided\",\"numClippingPlanes\",\"depthPacking\"];function allocateBones(object){if(capabilities.floatVertexTextures&&object&&object.skeleton&&object.skeleton.useVertexTexture){return 1024;}else{// default for when object is not specified\n// ( for example when prebuilding shader to be used with multiple objects )\n//\n// - leave some extra space for other uniforms\n// - limit here is ANGLE's 254 max uniform vectors\n// (up to 54 should be safe)\nvar nVertexUniforms=capabilities.maxVertexUniforms;var nVertexMatrices=Math.floor((nVertexUniforms-20)/4);var maxBones=nVertexMatrices;if(object!==undefined&&object instanceof THREE.SkinnedMesh){maxBones=Math.min(object.skeleton.bones.length,maxBones);if(maxBones0,shadowMapType:renderer.shadowMap.type,toneMapping:renderer.toneMapping,physicallyCorrectLights:renderer.physicallyCorrectLights,premultipliedAlpha:material.premultipliedAlpha,alphaTest:material.alphaTest,doubleSided:material.side===THREE.DoubleSide,flipSided:material.side===THREE.BackSide,depthPacking:material.depthPacking!==undefined?material.depthPacking:false};return parameters;};this.getProgramCode=function(material,parameters){var array=[];if(parameters.shaderID){array.push(parameters.shaderID);}else{array.push(material.fragmentShader);array.push(material.vertexShader);}if(material.defines!==undefined){for(var name in material.defines){array.push(name);array.push(material.defines[name]);}}for(var i=0;i0;}else if(geometry instanceof THREE.Geometry){useMorphing=geometry.morphTargets&&geometry.morphTargets.length>0;}}var useSkinning=object instanceof THREE.SkinnedMesh&&material.skinning;var variantIndex=0;if(useMorphing)variantIndex|=_MorphingFlag;if(useSkinning)variantIndex|=_SkinningFlag;result=materialVariants[variantIndex];}else{result=customMaterial;}if(_renderer.localClippingEnabled&&material.clipShadows===true&&material.clippingPlanes.length!==0){// in this case we need a unique material instance reflecting the\n// appropriate state\nvar keyA=result.uuid,keyB=material.uuid;var materialsForVariant=_materialCache[keyA];if(materialsForVariant===undefined){materialsForVariant={};_materialCache[keyA]=materialsForVariant;}var cachedMaterial=materialsForVariant[keyB];if(cachedMaterial===undefined){cachedMaterial=result.clone();materialsForVariant[keyB]=cachedMaterial;}result=cachedMaterial;}result.visible=material.visible;result.wireframe=material.wireframe;var side=material.side;if(scope.renderSingleSided&&side==THREE.DoubleSide){side=THREE.FrontSide;}if(scope.renderReverseSided){if(side===THREE.FrontSide)side=THREE.BackSide;else if(side===THREE.BackSide)side=THREE.FrontSide;}result.side=side;result.clipShadows=material.clipShadows;result.clippingPlanes=material.clippingPlanes;result.wireframeLinewidth=material.wireframeLinewidth;result.linewidth=material.linewidth;if(isPointLight&&result.uniforms.lightPos!==undefined){result.uniforms.lightPos.value.copy(lightPositionWorld);}return result;}function projectObject(object,camera,shadowCamera){if(object.visible===false)return;if(object.layers.test(camera.layers)&&(object instanceof THREE.Mesh||object instanceof THREE.Line||object instanceof THREE.Points)){if(object.castShadow&&(object.frustumCulled===false||_frustum.intersectsObject(object)===true)){var material=object.material;if(material.visible===true){object.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse,object.matrixWorld);_renderList.push(object);}}}var children=object.children;for(var i=0,l=children.length;imaxSize||image.height>maxSize){// Warning: Scaling through the canvas will only work with images that use\n// premultiplied alpha.\nvar scale=maxSize/Math.max(image.width,image.height);var canvas=document.createElementNS('http://www.w3.org/1999/xhtml','canvas');canvas.width=Math.floor(image.width*scale);canvas.height=Math.floor(image.height*scale);var context=canvas.getContext('2d');context.drawImage(image,0,0,image.width,image.height,0,0,canvas.width,canvas.height);console.warn('THREE.WebGLRenderer: image is too big ('+image.width+'x'+image.height+'). Resized to '+canvas.width+'x'+canvas.height,image);return canvas;}return image;}function isPowerOfTwo(image){return THREE.Math.isPowerOfTwo(image.width)&&THREE.Math.isPowerOfTwo(image.height);}function makePowerOfTwo(image){if(image instanceof HTMLImageElement||image instanceof HTMLCanvasElement){var canvas=document.createElementNS('http://www.w3.org/1999/xhtml','canvas');canvas.width=THREE.Math.nearestPowerOfTwo(image.width);canvas.height=THREE.Math.nearestPowerOfTwo(image.height);var context=canvas.getContext('2d');context.drawImage(image,0,0,canvas.width,canvas.height);console.warn('THREE.WebGLRenderer: image is not power of two ('+image.width+'x'+image.height+'). Resized to '+canvas.width+'x'+canvas.height,image);return canvas;}return image;}function textureNeedsPowerOfTwo(texture){if(texture.wrapS!==THREE.ClampToEdgeWrapping||texture.wrapT!==THREE.ClampToEdgeWrapping)return true;if(texture.minFilter!==THREE.NearestFilter&&texture.minFilter!==THREE.LinearFilter)return true;return false;}// Fallback filters for non-power-of-2 textures\nfunction filterFallback(f){if(f===THREE.NearestFilter||f===THREE.NearestMipMapNearestFilter||f===THREE.NearestMipMapLinearFilter){return _gl.NEAREST;}return _gl.LINEAR;}//\nfunction onTextureDispose(event){var texture=event.target;texture.removeEventListener('dispose',onTextureDispose);deallocateTexture(texture);_infoMemory.textures--;}function onRenderTargetDispose(event){var renderTarget=event.target;renderTarget.removeEventListener('dispose',onRenderTargetDispose);deallocateRenderTarget(renderTarget);_infoMemory.textures--;}//\nfunction deallocateTexture(texture){var textureProperties=properties.get(texture);if(texture.image&&textureProperties.__image__webglTextureCube){// cube texture\n_gl.deleteTexture(textureProperties.__image__webglTextureCube);}else{// 2D texture\nif(textureProperties.__webglInit===undefined)return;_gl.deleteTexture(textureProperties.__webglTexture);}// remove all webgl properties\nproperties.delete(texture);}function deallocateRenderTarget(renderTarget){var renderTargetProperties=properties.get(renderTarget);var textureProperties=properties.get(renderTarget.texture);if(!renderTarget)return;if(textureProperties.__webglTexture!==undefined){_gl.deleteTexture(textureProperties.__webglTexture);}if(renderTarget.depthTexture){renderTarget.depthTexture.dispose();}if(renderTarget instanceof THREE.WebGLRenderTargetCube){for(var i=0;i<6;i++){_gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer[i]);if(renderTargetProperties.__webglDepthbuffer)_gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer[i]);}}else{_gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer);if(renderTargetProperties.__webglDepthbuffer)_gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer);}properties.delete(renderTarget.texture);properties.delete(renderTarget);}//\nfunction setTexture2D(texture,slot){var textureProperties=properties.get(texture);if(texture.version>0&&textureProperties.__version!==texture.version){var image=texture.image;if(image===undefined){console.warn('THREE.WebGLRenderer: Texture marked for update but image is undefined',texture);}else if(image.complete===false){console.warn('THREE.WebGLRenderer: Texture marked for update but image is incomplete',texture);}else{uploadTexture(textureProperties,texture,slot);return;}}state.activeTexture(_gl.TEXTURE0+slot);state.bindTexture(_gl.TEXTURE_2D,textureProperties.__webglTexture);}function setTextureCube(texture,slot){var textureProperties=properties.get(texture);if(texture.image.length===6){if(texture.version>0&&textureProperties.__version!==texture.version){if(!textureProperties.__image__webglTextureCube){texture.addEventListener('dispose',onTextureDispose);textureProperties.__image__webglTextureCube=_gl.createTexture();_infoMemory.textures++;}state.activeTexture(_gl.TEXTURE0+slot);state.bindTexture(_gl.TEXTURE_CUBE_MAP,textureProperties.__image__webglTextureCube);_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,texture.flipY);var isCompressed=texture instanceof THREE.CompressedTexture;var isDataTexture=texture.image[0]instanceof THREE.DataTexture;var cubeImage=[];for(var i=0;i<6;i++){if(!isCompressed&&!isDataTexture){cubeImage[i]=clampToMaxSize(texture.image[i],capabilities.maxCubemapSize);}else{cubeImage[i]=isDataTexture?texture.image[i].image:texture.image[i];}}var image=cubeImage[0],isPowerOfTwoImage=isPowerOfTwo(image),glFormat=paramThreeToGL(texture.format),glType=paramThreeToGL(texture.type);setTextureParameters(_gl.TEXTURE_CUBE_MAP,texture,isPowerOfTwoImage);for(var i=0;i<6;i++){if(!isCompressed){if(isDataTexture){state.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,glFormat,cubeImage[i].width,cubeImage[i].height,0,glFormat,glType,cubeImage[i].data);}else{state.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X+i,0,glFormat,glFormat,glType,cubeImage[i]);}}else{var mipmap,mipmaps=cubeImage[i].mipmaps;for(var j=0,jl=mipmaps.length;j-1){state.compressedTexImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X+i,j,glFormat,mipmap.width,mipmap.height,0,mipmap.data);}else{console.warn(\"THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()\");}}else{state.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X+i,j,glFormat,mipmap.width,mipmap.height,0,glFormat,glType,mipmap.data);}}}}if(texture.generateMipmaps&&isPowerOfTwoImage){_gl.generateMipmap(_gl.TEXTURE_CUBE_MAP);}textureProperties.__version=texture.version;if(texture.onUpdate)texture.onUpdate(texture);}else{state.activeTexture(_gl.TEXTURE0+slot);state.bindTexture(_gl.TEXTURE_CUBE_MAP,textureProperties.__image__webglTextureCube);}}}function setTextureCubeDynamic(texture,slot){state.activeTexture(_gl.TEXTURE0+slot);state.bindTexture(_gl.TEXTURE_CUBE_MAP,properties.get(texture).__webglTexture);}function setTextureParameters(textureType,texture,isPowerOfTwoImage){var extension;if(isPowerOfTwoImage){_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_S,paramThreeToGL(texture.wrapS));_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_T,paramThreeToGL(texture.wrapT));_gl.texParameteri(textureType,_gl.TEXTURE_MAG_FILTER,paramThreeToGL(texture.magFilter));_gl.texParameteri(textureType,_gl.TEXTURE_MIN_FILTER,paramThreeToGL(texture.minFilter));}else{_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_S,_gl.CLAMP_TO_EDGE);_gl.texParameteri(textureType,_gl.TEXTURE_WRAP_T,_gl.CLAMP_TO_EDGE);if(texture.wrapS!==THREE.ClampToEdgeWrapping||texture.wrapT!==THREE.ClampToEdgeWrapping){console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.',texture);}_gl.texParameteri(textureType,_gl.TEXTURE_MAG_FILTER,filterFallback(texture.magFilter));_gl.texParameteri(textureType,_gl.TEXTURE_MIN_FILTER,filterFallback(texture.minFilter));if(texture.minFilter!==THREE.NearestFilter&&texture.minFilter!==THREE.LinearFilter){console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.',texture);}}extension=extensions.get('EXT_texture_filter_anisotropic');if(extension){if(texture.type===THREE.FloatType&&extensions.get('OES_texture_float_linear')===null)return;if(texture.type===THREE.HalfFloatType&&extensions.get('OES_texture_half_float_linear')===null)return;if(texture.anisotropy>1||properties.get(texture).__currentAnisotropy){_gl.texParameterf(textureType,extension.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(texture.anisotropy,capabilities.getMaxAnisotropy()));properties.get(texture).__currentAnisotropy=texture.anisotropy;}}}function uploadTexture(textureProperties,texture,slot){if(textureProperties.__webglInit===undefined){textureProperties.__webglInit=true;texture.addEventListener('dispose',onTextureDispose);textureProperties.__webglTexture=_gl.createTexture();_infoMemory.textures++;}state.activeTexture(_gl.TEXTURE0+slot);state.bindTexture(_gl.TEXTURE_2D,textureProperties.__webglTexture);_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL,texture.flipY);_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL,texture.premultiplyAlpha);_gl.pixelStorei(_gl.UNPACK_ALIGNMENT,texture.unpackAlignment);var image=clampToMaxSize(texture.image,capabilities.maxTextureSize);if(textureNeedsPowerOfTwo(texture)&&isPowerOfTwo(image)===false){image=makePowerOfTwo(image);}var isPowerOfTwoImage=isPowerOfTwo(image),glFormat=paramThreeToGL(texture.format),glType=paramThreeToGL(texture.type);setTextureParameters(_gl.TEXTURE_2D,texture,isPowerOfTwoImage);var mipmap,mipmaps=texture.mipmaps;if(texture instanceof THREE.DepthTexture){// populate depth texture with dummy data\nvar internalFormat=_gl.DEPTH_COMPONENT;if(texture.type===THREE.FloatType){if(!_isWebGL2)throw new Error('Float Depth Texture only supported in WebGL2.0');internalFormat=_gl.DEPTH_COMPONENT32F;}else if(_isWebGL2){// WebGL 2.0 requires signed internalformat for glTexImage2D\ninternalFormat=_gl.DEPTH_COMPONENT16;}state.texImage2D(_gl.TEXTURE_2D,0,internalFormat,image.width,image.height,0,glFormat,glType,null);}else if(texture instanceof THREE.DataTexture){// use manually created mipmaps if available\n// if there are no manual mipmaps\n// set 0 level mipmap and then use GL to generate other mipmap levels\nif(mipmaps.length>0&&isPowerOfTwoImage){for(var i=0,il=mipmaps.length;i-1){state.compressedTexImage2D(_gl.TEXTURE_2D,i,glFormat,mipmap.width,mipmap.height,0,mipmap.data);}else{console.warn(\"THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()\");}}else{state.texImage2D(_gl.TEXTURE_2D,i,glFormat,mipmap.width,mipmap.height,0,glFormat,glType,mipmap.data);}}}else{// regular Texture (image, video, canvas)\n// use manually created mipmaps if available\n// if there are no manual mipmaps\n// set 0 level mipmap and then use GL to generate other mipmap levels\nif(mipmaps.length>0&&isPowerOfTwoImage){for(var i=0,il=mipmaps.length;i0)return array;// unoptimized: ! isNaN( firstElem )\n// see http://jacksondunstan.com/articles/983\nvar n=nBlocks*blockSize,r=arrayCacheF32[n];if(r===undefined){r=new Float32Array(n);arrayCacheF32[n]=r;}if(nBlocks!==0){firstElem.toArray(r,0);for(var i=1,offset=0;i!==nBlocks;++i){offset+=blockSize;array[i].toArray(r,offset);}}return r;},// Texture unit allocation\nallocTexUnits=function allocTexUnits(renderer,n){var r=arrayCacheI32[n];if(r===undefined){r=new Int32Array(n);arrayCacheI32[n]=r;}for(var i=0;i!==n;++i){r[i]=renderer.allocTextureUnit();}return r;},// --- Setters ---\n// Note: Defining these methods externally, because they come in a bunch\n// and this way their names minify.\n// Single scalar\nsetValue1f=function setValue1f(gl,v){gl.uniform1f(this.addr,v);},setValue1i=function setValue1i(gl,v){gl.uniform1i(this.addr,v);},// Single float vector (from flat array or THREE.VectorN)\nsetValue2fv=function setValue2fv(gl,v){if(v.x===undefined)gl.uniform2fv(this.addr,v);else gl.uniform2f(this.addr,v.x,v.y);},setValue3fv=function setValue3fv(gl,v){if(v.x!==undefined)gl.uniform3f(this.addr,v.x,v.y,v.z);else if(v.r!==undefined)gl.uniform3f(this.addr,v.r,v.g,v.b);else gl.uniform3fv(this.addr,v);},setValue4fv=function setValue4fv(gl,v){if(v.x===undefined)gl.uniform4fv(this.addr,v);else gl.uniform4f(this.addr,v.x,v.y,v.z,v.w);},// Single matrix (from flat array or MatrixN)\nsetValue2fm=function setValue2fm(gl,v){gl.uniformMatrix2fv(this.addr,false,v.elements||v);},setValue3fm=function setValue3fm(gl,v){gl.uniformMatrix3fv(this.addr,false,v.elements||v);},setValue4fm=function setValue4fm(gl,v){gl.uniformMatrix4fv(this.addr,false,v.elements||v);},// Single texture (2D / Cube)\nsetValueT1=function setValueT1(gl,v,renderer){var unit=renderer.allocTextureUnit();gl.uniform1i(this.addr,unit);renderer.setTexture2D(v||emptyTexture,unit);},setValueT6=function setValueT6(gl,v,renderer){var unit=renderer.allocTextureUnit();gl.uniform1i(this.addr,unit);renderer.setTextureCube(v||emptyCubeTexture,unit);},// Integer / Boolean vectors or arrays thereof (always flat arrays)\nsetValue2iv=function setValue2iv(gl,v){gl.uniform2iv(this.addr,v);},setValue3iv=function setValue3iv(gl,v){gl.uniform3iv(this.addr,v);},setValue4iv=function setValue4iv(gl,v){gl.uniform4iv(this.addr,v);},// Helper to pick the right setter for the singular case\ngetSingularSetter=function getSingularSetter(type){switch(type){case 0x1406:return setValue1f;// FLOAT\ncase 0x8b50:return setValue2fv;// _VEC2\ncase 0x8b51:return setValue3fv;// _VEC3\ncase 0x8b52:return setValue4fv;// _VEC4\ncase 0x8b5a:return setValue2fm;// _MAT2\ncase 0x8b5b:return setValue3fm;// _MAT3\ncase 0x8b5c:return setValue4fm;// _MAT4\ncase 0x8b5e:return setValueT1;// SAMPLER_2D\ncase 0x8b60:return setValueT6;// SAMPLER_CUBE\ncase 0x1404:case 0x8b56:return setValue1i;// INT, BOOL\ncase 0x8b53:case 0x8b57:return setValue2iv;// _VEC2\ncase 0x8b54:case 0x8b58:return setValue3iv;// _VEC3\ncase 0x8b55:case 0x8b59:return setValue4iv;// _VEC4\n}},// Array of scalars\nsetValue1fv=function setValue1fv(gl,v){gl.uniform1fv(this.addr,v);},setValue1iv=function setValue1iv(gl,v){gl.uniform1iv(this.addr,v);},// Array of vectors (flat or from THREE classes)\nsetValueV2a=function setValueV2a(gl,v){gl.uniform2fv(this.addr,flatten(v,this.size,2));},setValueV3a=function setValueV3a(gl,v){gl.uniform3fv(this.addr,flatten(v,this.size,3));},setValueV4a=function setValueV4a(gl,v){gl.uniform4fv(this.addr,flatten(v,this.size,4));},// Array of matrices (flat or from THREE clases)\nsetValueM2a=function setValueM2a(gl,v){gl.uniformMatrix2fv(this.addr,false,flatten(v,this.size,4));},setValueM3a=function setValueM3a(gl,v){gl.uniformMatrix3fv(this.addr,false,flatten(v,this.size,9));},setValueM4a=function setValueM4a(gl,v){gl.uniformMatrix4fv(this.addr,false,flatten(v,this.size,16));},// Array of textures (2D / Cube)\nsetValueT1a=function setValueT1a(gl,v,renderer){var n=v.length,units=allocTexUnits(renderer,n);gl.uniform1iv(this.addr,units);for(var i=0;i!==n;++i){renderer.setTexture2D(v[i]||emptyTexture,units[i]);}},setValueT6a=function setValueT6a(gl,v,renderer){var n=v.length,units=allocTexUnits(renderer,n);gl.uniform1iv(this.addr,units);for(var i=0;i!==n;++i){renderer.setTextureCube(v[i]||emptyCubeTexture,units[i]);}},// Helper to pick the right setter for a pure (bottom-level) array\ngetPureArraySetter=function getPureArraySetter(type){switch(type){case 0x1406:return setValue1fv;// FLOAT\ncase 0x8b50:return setValueV2a;// _VEC2\ncase 0x8b51:return setValueV3a;// _VEC3\ncase 0x8b52:return setValueV4a;// _VEC4\ncase 0x8b5a:return setValueM2a;// _MAT2\ncase 0x8b5b:return setValueM3a;// _MAT3\ncase 0x8b5c:return setValueM4a;// _MAT4\ncase 0x8b5e:return setValueT1a;// SAMPLER_2D\ncase 0x8b60:return setValueT6a;// SAMPLER_CUBE\ncase 0x1404:case 0x8b56:return setValue1iv;// INT, BOOL\ncase 0x8b53:case 0x8b57:return setValue2iv;// _VEC2\ncase 0x8b54:case 0x8b58:return setValue3iv;// _VEC3\ncase 0x8b55:case 0x8b59:return setValue4iv;// _VEC4\n}},// --- Uniform Classes ---\nSingleUniform=function SingleUniform(id,activeInfo,addr){this.id=id;this.addr=addr;this.setValue=getSingularSetter(activeInfo.type);// this.path = activeInfo.name; // DEBUG\n},PureArrayUniform=function PureArrayUniform(id,activeInfo,addr){this.id=id;this.addr=addr;this.size=activeInfo.size;this.setValue=getPureArraySetter(activeInfo.type);// this.path = activeInfo.name; // DEBUG\n},StructuredUniform=function StructuredUniform(id){this.id=id;UniformContainer.call(this);// mix-in\n};StructuredUniform.prototype.setValue=function(gl,value){// Note: Don't need an extra 'renderer' parameter, since samplers\n// are not allowed in structured uniforms.\nvar seq=this.seq;for(var i=0,n=seq.length;i!==n;++i){var u=seq[i];u.setValue(gl,value[u.id]);}};// --- Top-level ---\n// Parser - builds up the property tree from the path strings\nvar RePathPart=/([\\w\\d_]+)(\\])?(\\[|\\.)?/g,// extracts\n// \t- the identifier (member name or array index)\n// - followed by an optional right bracket (found when array index)\n// - followed by an optional left bracket or dot (type of subscript)\n//\n// Note: These portions can be read in a non-overlapping fashion and\n// allow straightforward parsing of the hierarchy that WebGL encodes\n// in the uniform names.\naddUniform=function addUniform(container,uniformObject){container.seq.push(uniformObject);container.map[uniformObject.id]=uniformObject;},parseUniform=function parseUniform(activeInfo,addr,container){var path=activeInfo.name,pathLength=path.length;// reset RegExp object, because of the early exit of a previous run\nRePathPart.lastIndex=0;for(;;){var match=RePathPart.exec(path),matchEnd=RePathPart.lastIndex,id=match[1],idIsIndex=match[2]===']',subscript=match[3];if(idIsIndex)id=id|0;// convert to integer\nif(subscript===undefined||subscript==='['&&matchEnd+2===pathLength){// bare name or \"pure\" bottom-level array \"[0]\" suffix\naddUniform(container,subscript===undefined?new SingleUniform(id,activeInfo,addr):new PureArrayUniform(id,activeInfo,addr));break;}else{// step into inner node / create it in case it doesn't exist\nvar map=container.map,next=map[id];if(next===undefined){next=new StructuredUniform(id);addUniform(container,next);}container=next;}}},// Root Container\nWebGLUniforms=function WebGLUniforms(gl,program,renderer){UniformContainer.call(this);this.renderer=renderer;var n=gl.getProgramParameter(program,gl.ACTIVE_UNIFORMS);for(var i=0;i!==n;++i){var info=gl.getActiveUniform(program,i),path=info.name,addr=gl.getUniformLocation(program,path);parseUniform(info,addr,this);}};WebGLUniforms.prototype.setValue=function(gl,name,value){var u=this.map[name];if(u!==undefined)u.setValue(gl,value,this.renderer);};WebGLUniforms.prototype.set=function(gl,object,name){var u=this.map[name];if(u!==undefined)u.setValue(gl,object[name],this.renderer);};WebGLUniforms.prototype.setOptional=function(gl,object,name){var v=object[name];if(v!==undefined)this.setValue(gl,name,v);};// Static interface\nWebGLUniforms.upload=function(gl,seq,values,renderer){for(var i=0,n=seq.length;i!==n;++i){var u=seq[i],v=values[u.id];if(v.needsUpdate!==false){// note: always updating when .needsUpdate is undefined\nu.setValue(gl,v.value,renderer);}}};WebGLUniforms.seqWithValue=function(seq,values){var r=[];for(var i=0,n=seq.length;i!==n;++i){var u=seq[i];if(u.id in values)r.push(u);}return r;};WebGLUniforms.splitDynamic=function(seq,values){var r=null,n=seq.length,w=0;for(var i=0;i!==n;++i){var u=seq[i],v=values[u.id];if(v&&v.dynamic===true){if(r===null)r=[];r.push(u);}else{// in-place compact 'seq', removing the matches\nif(w0.001&&sprite.scale>0.001){screenPosition.x=sprite.x;screenPosition.y=sprite.y;screenPosition.z=sprite.z;size=sprite.size*sprite.scale/viewport.w;scale.x=size*invAspect;scale.y=size;gl.uniform3f(uniforms.screenPosition,screenPosition.x,screenPosition.y,screenPosition.z);gl.uniform2f(uniforms.scale,scale.x,scale.y);gl.uniform1f(uniforms.rotation,sprite.rotation);gl.uniform1f(uniforms.opacity,sprite.opacity);gl.uniform3f(uniforms.color,sprite.color.r,sprite.color.g,sprite.color.b);state.setBlending(sprite.blending,sprite.blendEquation,sprite.blendSrc,sprite.blendDst);renderer.setTexture2D(sprite.texture,1);gl.drawElements(gl.TRIANGLES,6,gl.UNSIGNED_SHORT,0);}}}}// restore gl\nstate.enable(gl.CULL_FACE);state.enable(gl.DEPTH_TEST);state.setDepthWrite(true);renderer.resetGLState();};function createProgram(shader){var program=gl.createProgram();var fragmentShader=gl.createShader(gl.FRAGMENT_SHADER);var vertexShader=gl.createShader(gl.VERTEX_SHADER);var prefix=\"precision \"+renderer.getPrecision()+\" float;\\n\";gl.shaderSource(fragmentShader,prefix+shader.fragmentShader);gl.shaderSource(vertexShader,prefix+shader.vertexShader);gl.compileShader(fragmentShader);gl.compileShader(vertexShader);gl.attachShader(program,fragmentShader);gl.attachShader(program,vertexShader);gl.linkProgram(program);return program;}};// File:src/renderers/webgl/plugins/SpritePlugin.js\n/**\n * @author mikael emtinger / http://gomo.se/\n * @author alteredq / http://alteredqualia.com/\n */THREE.SpritePlugin=function(renderer,sprites){var gl=renderer.context;var state=renderer.state;var vertexBuffer,elementBuffer;var program,attributes,uniforms;var texture;// decompose matrixWorld\nvar spritePosition=new THREE.Vector3();var spriteRotation=new THREE.Quaternion();var spriteScale=new THREE.Vector3();function init(){var vertices=new Float32Array([-0.5,-0.5,0,0,0.5,-0.5,1,0,0.5,0.5,1,1,-0.5,0.5,0,1]);var faces=new Uint16Array([0,1,2,0,2,3]);vertexBuffer=gl.createBuffer();elementBuffer=gl.createBuffer();gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer);gl.bufferData(gl.ARRAY_BUFFER,vertices,gl.STATIC_DRAW);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,elementBuffer);gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,faces,gl.STATIC_DRAW);program=createProgram();attributes={position:gl.getAttribLocation(program,'position'),uv:gl.getAttribLocation(program,'uv')};uniforms={uvOffset:gl.getUniformLocation(program,'uvOffset'),uvScale:gl.getUniformLocation(program,'uvScale'),rotation:gl.getUniformLocation(program,'rotation'),scale:gl.getUniformLocation(program,'scale'),color:gl.getUniformLocation(program,'color'),map:gl.getUniformLocation(program,'map'),opacity:gl.getUniformLocation(program,'opacity'),modelViewMatrix:gl.getUniformLocation(program,'modelViewMatrix'),projectionMatrix:gl.getUniformLocation(program,'projectionMatrix'),fogType:gl.getUniformLocation(program,'fogType'),fogDensity:gl.getUniformLocation(program,'fogDensity'),fogNear:gl.getUniformLocation(program,'fogNear'),fogFar:gl.getUniformLocation(program,'fogFar'),fogColor:gl.getUniformLocation(program,'fogColor'),alphaTest:gl.getUniformLocation(program,'alphaTest')};var canvas=document.createElementNS('http://www.w3.org/1999/xhtml','canvas');canvas.width=8;canvas.height=8;var context=canvas.getContext('2d');context.fillStyle='white';context.fillRect(0,0,8,8);texture=new THREE.Texture(canvas);texture.needsUpdate=true;}this.render=function(scene,camera){if(sprites.length===0)return;// setup gl\nif(program===undefined){init();}gl.useProgram(program);state.initAttributes();state.enableAttribute(attributes.position);state.enableAttribute(attributes.uv);state.disableUnusedAttributes();state.disable(gl.CULL_FACE);state.enable(gl.BLEND);gl.bindBuffer(gl.ARRAY_BUFFER,vertexBuffer);gl.vertexAttribPointer(attributes.position,2,gl.FLOAT,false,2*8,0);gl.vertexAttribPointer(attributes.uv,2,gl.FLOAT,false,2*8,8);gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER,elementBuffer);gl.uniformMatrix4fv(uniforms.projectionMatrix,false,camera.projectionMatrix.elements);state.activeTexture(gl.TEXTURE0);gl.uniform1i(uniforms.map,0);var oldFogType=0;var sceneFogType=0;var fog=scene.fog;if(fog){gl.uniform3f(uniforms.fogColor,fog.color.r,fog.color.g,fog.color.b);if(fog instanceof THREE.Fog){gl.uniform1f(uniforms.fogNear,fog.near);gl.uniform1f(uniforms.fogFar,fog.far);gl.uniform1i(uniforms.fogType,1);oldFogType=1;sceneFogType=1;}else if(fog instanceof THREE.FogExp2){gl.uniform1f(uniforms.fogDensity,fog.density);gl.uniform1i(uniforms.fogType,2);oldFogType=2;sceneFogType=2;}}else{gl.uniform1i(uniforms.fogType,0);oldFogType=0;sceneFogType=0;}// update positions and sort\nfor(var i=0,l=sprites.length;i 0 ) {','float depth = gl_FragCoord.z / gl_FragCoord.w;','float fogFactor = 0.0;','if ( fogType == 1 ) {','fogFactor = smoothstep( fogNear, fogFar, depth );','} else {','const float LOG2 = 1.442695;','fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );','fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );','}','gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );','}','}'].join('\\n'));gl.compileShader(vertexShader);gl.compileShader(fragmentShader);gl.attachShader(program,vertexShader);gl.attachShader(program,fragmentShader);gl.linkProgram(program);return program;}function painterSortStable(a,b){if(a.renderOrder!==b.renderOrder){return a.renderOrder-b.renderOrder;}else if(a.z!==b.z){return b.z-a.z;}else{return b.id-a.id;}}};// File:src/Three.Legacy.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */Object.assign(THREE,{Face4:function Face4(a,b,c,d,normal,color,materialIndex){console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.');return new THREE.Face3(a,b,c,normal,color,materialIndex);},LineStrip:0,LinePieces:1,MeshFaceMaterial:THREE.MultiMaterial,PointCloud:function PointCloud(geometry,material){console.warn('THREE.PointCloud has been renamed to THREE.Points.');return new THREE.Points(geometry,material);},Particle:THREE.Sprite,ParticleSystem:function ParticleSystem(geometry,material){console.warn('THREE.ParticleSystem has been renamed to THREE.Points.');return new THREE.Points(geometry,material);},PointCloudMaterial:function PointCloudMaterial(parameters){console.warn('THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.');return new THREE.PointsMaterial(parameters);},ParticleBasicMaterial:function ParticleBasicMaterial(parameters){console.warn('THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.');return new THREE.PointsMaterial(parameters);},ParticleSystemMaterial:function ParticleSystemMaterial(parameters){console.warn('THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.');return new THREE.PointsMaterial(parameters);},Vertex:function Vertex(x,y,z){console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.');return new THREE.Vector3(x,y,z);}});//\nObject.assign(THREE.Box2.prototype,{empty:function empty(){console.warn('THREE.Box2: .empty() has been renamed to .isEmpty().');return this.isEmpty();},isIntersectionBox:function isIntersectionBox(box){console.warn('THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().');return this.intersectsBox(box);}});Object.assign(THREE.Box3.prototype,{empty:function empty(){console.warn('THREE.Box3: .empty() has been renamed to .isEmpty().');return this.isEmpty();},isIntersectionBox:function isIntersectionBox(box){console.warn('THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().');return this.intersectsBox(box);},isIntersectionSphere:function isIntersectionSphere(sphere){console.warn('THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().');return this.intersectsSphere(sphere);}});Object.assign(THREE.Matrix3.prototype,{multiplyVector3:function multiplyVector3(vector){console.warn('THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.');return vector.applyMatrix3(this);},multiplyVector3Array:function multiplyVector3Array(a){console.warn('THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.');return this.applyToVector3Array(a);}});Object.assign(THREE.Matrix4.prototype,{extractPosition:function extractPosition(m){console.warn('THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().');return this.copyPosition(m);},setRotationFromQuaternion:function setRotationFromQuaternion(q){console.warn('THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().');return this.makeRotationFromQuaternion(q);},multiplyVector3:function multiplyVector3(vector){console.warn('THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.');return vector.applyProjection(this);},multiplyVector4:function multiplyVector4(vector){console.warn('THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.');return vector.applyMatrix4(this);},multiplyVector3Array:function multiplyVector3Array(a){console.warn('THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.');return this.applyToVector3Array(a);},rotateAxis:function rotateAxis(v){console.warn('THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.');v.transformDirection(this);},crossVector:function crossVector(vector){console.warn('THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.');return vector.applyMatrix4(this);},translate:function translate(v){console.error('THREE.Matrix4: .translate() has been removed.');},rotateX:function rotateX(angle){console.error('THREE.Matrix4: .rotateX() has been removed.');},rotateY:function rotateY(angle){console.error('THREE.Matrix4: .rotateY() has been removed.');},rotateZ:function rotateZ(angle){console.error('THREE.Matrix4: .rotateZ() has been removed.');},rotateByAxis:function rotateByAxis(axis,angle){console.error('THREE.Matrix4: .rotateByAxis() has been removed.');}});Object.assign(THREE.Plane.prototype,{isIntersectionLine:function isIntersectionLine(line){console.warn('THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().');return this.intersectsLine(line);}});Object.assign(THREE.Quaternion.prototype,{multiplyVector3:function multiplyVector3(vector){console.warn('THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.');return vector.applyQuaternion(this);}});Object.assign(THREE.Ray.prototype,{isIntersectionBox:function isIntersectionBox(box){console.warn('THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().');return this.intersectsBox(box);},isIntersectionPlane:function isIntersectionPlane(plane){console.warn('THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().');return this.intersectsPlane(plane);},isIntersectionSphere:function isIntersectionSphere(sphere){console.warn('THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().');return this.intersectsSphere(sphere);}});Object.assign(THREE.Vector3.prototype,{setEulerFromRotationMatrix:function setEulerFromRotationMatrix(){console.error('THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.');},setEulerFromQuaternion:function setEulerFromQuaternion(){console.error('THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.');},getPositionFromMatrix:function getPositionFromMatrix(m){console.warn('THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().');return this.setFromMatrixPosition(m);},getScaleFromMatrix:function getScaleFromMatrix(m){console.warn('THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().');return this.setFromMatrixScale(m);},getColumnFromMatrix:function getColumnFromMatrix(index,matrix){console.warn('THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().');return this.setFromMatrixColumn(matrix,index);}});//\nObject.assign(THREE.Object3D.prototype,{getChildByName:function getChildByName(name){console.warn('THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().');return this.getObjectByName(name);},renderDepth:function renderDepth(value){console.warn('THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.');},translate:function translate(distance,axis){console.warn('THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.');return this.translateOnAxis(axis,distance);}});Object.defineProperties(THREE.Object3D.prototype,{eulerOrder:{get:function get(){console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.');return this.rotation.order;},set:function set(value){console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.');this.rotation.order=value;}},useQuaternion:{get:function get(){console.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.');},set:function set(value){console.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.');}}});Object.defineProperties(THREE.LOD.prototype,{objects:{get:function get(){console.warn('THREE.LOD: .objects has been renamed to .levels.');return this.levels;}}});//\nTHREE.PerspectiveCamera.prototype.setLens=function(focalLength,filmGauge){console.warn(\"THREE.PerspectiveCamera.setLens is deprecated. \"+\"Use .setFocalLength and .filmGauge for a photographic setup.\");if(filmGauge!==undefined)this.filmGauge=filmGauge;this.setFocalLength(focalLength);};//\nObject.defineProperties(THREE.Light.prototype,{onlyShadow:{set:function set(value){console.warn('THREE.Light: .onlyShadow has been removed.');}},shadowCameraFov:{set:function set(value){console.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.');this.shadow.camera.fov=value;}},shadowCameraLeft:{set:function set(value){console.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.');this.shadow.camera.left=value;}},shadowCameraRight:{set:function set(value){console.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.');this.shadow.camera.right=value;}},shadowCameraTop:{set:function set(value){console.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.');this.shadow.camera.top=value;}},shadowCameraBottom:{set:function set(value){console.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.');this.shadow.camera.bottom=value;}},shadowCameraNear:{set:function set(value){console.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.');this.shadow.camera.near=value;}},shadowCameraFar:{set:function set(value){console.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.');this.shadow.camera.far=value;}},shadowCameraVisible:{set:function set(value){console.warn('THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.');}},shadowBias:{set:function set(value){console.warn('THREE.Light: .shadowBias is now .shadow.bias.');this.shadow.bias=value;}},shadowDarkness:{set:function set(value){console.warn('THREE.Light: .shadowDarkness has been removed.');}},shadowMapWidth:{set:function set(value){console.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.');this.shadow.mapSize.width=value;}},shadowMapHeight:{set:function set(value){console.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.');this.shadow.mapSize.height=value;}}});//\nObject.defineProperties(THREE.BufferAttribute.prototype,{length:{get:function get(){console.warn('THREE.BufferAttribute: .length has been deprecated. Please use .count.');return this.array.length;}}});Object.assign(THREE.BufferGeometry.prototype,{addIndex:function addIndex(index){console.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().');this.setIndex(index);},addDrawCall:function addDrawCall(start,count,indexOffset){if(indexOffset!==undefined){console.warn('THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.');}console.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().');this.addGroup(start,count);},clearDrawCalls:function clearDrawCalls(){console.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().');this.clearGroups();},computeTangents:function computeTangents(){console.warn('THREE.BufferGeometry: .computeTangents() has been removed.');},computeOffsets:function computeOffsets(){console.warn('THREE.BufferGeometry: .computeOffsets() has been removed.');}});Object.defineProperties(THREE.BufferGeometry.prototype,{drawcalls:{get:function get(){console.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.');return this.groups;}},offsets:{get:function get(){console.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.');return this.groups;}}});//\nObject.defineProperties(THREE.Material.prototype,{wrapAround:{get:function get(){console.warn('THREE.'+this.type+': .wrapAround has been removed.');},set:function set(value){console.warn('THREE.'+this.type+': .wrapAround has been removed.');}},wrapRGB:{get:function get(){console.warn('THREE.'+this.type+': .wrapRGB has been removed.');return new THREE.Color();}}});Object.defineProperties(THREE.MeshPhongMaterial.prototype,{metal:{get:function get(){console.warn('THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.');return false;},set:function set(value){console.warn('THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead');}}});Object.defineProperties(THREE.ShaderMaterial.prototype,{derivatives:{get:function get(){console.warn('THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.');return this.extensions.derivatives;},set:function set(value){console.warn('THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.');this.extensions.derivatives=value;}}});//\nTHREE.EventDispatcher.prototype=Object.assign(Object.create({// Note: Extra base ensures these properties are not 'assign'ed.\nconstructor:THREE.EventDispatcher,apply:function apply(target){console.warn(\"THREE.EventDispatcher: .apply is deprecated, \"+\"just inherit or Object.assign the prototype to mix-in.\");Object.assign(target,this);}}),THREE.EventDispatcher.prototype);//\nObject.assign(THREE.WebGLRenderer.prototype,{supportsFloatTextures:function supportsFloatTextures(){console.warn('THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \\'OES_texture_float\\' ).');return this.extensions.get('OES_texture_float');},supportsHalfFloatTextures:function supportsHalfFloatTextures(){console.warn('THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \\'OES_texture_half_float\\' ).');return this.extensions.get('OES_texture_half_float');},supportsStandardDerivatives:function supportsStandardDerivatives(){console.warn('THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \\'OES_standard_derivatives\\' ).');return this.extensions.get('OES_standard_derivatives');},supportsCompressedTextureS3TC:function supportsCompressedTextureS3TC(){console.warn('THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \\'WEBGL_compressed_texture_s3tc\\' ).');return this.extensions.get('WEBGL_compressed_texture_s3tc');},supportsCompressedTexturePVRTC:function supportsCompressedTexturePVRTC(){console.warn('THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \\'WEBGL_compressed_texture_pvrtc\\' ).');return this.extensions.get('WEBGL_compressed_texture_pvrtc');},supportsBlendMinMax:function supportsBlendMinMax(){console.warn('THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \\'EXT_blend_minmax\\' ).');return this.extensions.get('EXT_blend_minmax');},supportsVertexTextures:function supportsVertexTextures(){return this.capabilities.vertexTextures;},supportsInstancedArrays:function supportsInstancedArrays(){console.warn('THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \\'ANGLE_instanced_arrays\\' ).');return this.extensions.get('ANGLE_instanced_arrays');},enableScissorTest:function enableScissorTest(boolean){console.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().');this.setScissorTest(boolean);},initMaterial:function initMaterial(){console.warn('THREE.WebGLRenderer: .initMaterial() has been removed.');},addPrePlugin:function addPrePlugin(){console.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.');},addPostPlugin:function addPostPlugin(){console.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.');},updateShadowMap:function updateShadowMap(){console.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.');}});Object.defineProperties(THREE.WebGLRenderer.prototype,{shadowMapEnabled:{get:function get(){return this.shadowMap.enabled;},set:function set(value){console.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.');this.shadowMap.enabled=value;}},shadowMapType:{get:function get(){return this.shadowMap.type;},set:function set(value){console.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.');this.shadowMap.type=value;}},shadowMapCullFace:{get:function get(){return this.shadowMap.cullFace;},set:function set(value){console.warn('THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.');this.shadowMap.cullFace=value;}}});Object.defineProperties(THREE.WebGLShadowMap.prototype,{cullFace:{get:function get(){return this.renderReverseSided?THREE.CullFaceFront:THREE.CullFaceBack;},set:function set(cullFace){var value=cullFace!==THREE.CullFaceBack;console.warn(\"WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to \"+value+\".\");this.renderReverseSided=value;}}});//\nObject.defineProperties(THREE.WebGLRenderTarget.prototype,{wrapS:{get:function get(){console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.');return this.texture.wrapS;},set:function set(value){console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.');this.texture.wrapS=value;}},wrapT:{get:function get(){console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.');return this.texture.wrapT;},set:function set(value){console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.');this.texture.wrapT=value;}},magFilter:{get:function get(){console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.');return this.texture.magFilter;},set:function set(value){console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.');this.texture.magFilter=value;}},minFilter:{get:function get(){console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.');return this.texture.minFilter;},set:function set(value){console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.');this.texture.minFilter=value;}},anisotropy:{get:function get(){console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.');return this.texture.anisotropy;},set:function set(value){console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.');this.texture.anisotropy=value;}},offset:{get:function get(){console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.');return this.texture.offset;},set:function set(value){console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.');this.texture.offset=value;}},repeat:{get:function get(){console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.');return this.texture.repeat;},set:function set(value){console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.');this.texture.repeat=value;}},format:{get:function get(){console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.');return this.texture.format;},set:function set(value){console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.');this.texture.format=value;}},type:{get:function get(){console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.');return this.texture.type;},set:function set(value){console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.');this.texture.type=value;}},generateMipmaps:{get:function get(){console.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.');return this.texture.generateMipmaps;},set:function set(value){console.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.');this.texture.generateMipmaps=value;}}});//\nObject.assign(THREE.Audio.prototype,{load:function load(file){console.warn('THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader.');var scope=this;var audioLoader=new THREE.AudioLoader();audioLoader.load(file,function(buffer){scope.setBuffer(buffer);});return this;}});Object.assign(THREE.AudioAnalyser.prototype,{getData:function getData(file){console.warn('THREE.AudioAnalyser: .getData() is now .getFrequencyData().');return this.getFrequencyData();}});//\nTHREE.GeometryUtils={merge:function merge(geometry1,geometry2,materialIndexOffset){console.warn('THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.');var matrix;if(geometry2 instanceof THREE.Mesh){geometry2.matrixAutoUpdate&&geometry2.updateMatrix();matrix=geometry2.matrix;geometry2=geometry2.geometry;}geometry1.merge(geometry2,matrix,materialIndexOffset);},center:function center(geometry){console.warn('THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.');return geometry.center();}};THREE.ImageUtils={crossOrigin:undefined,loadTexture:function loadTexture(url,mapping,onLoad,onError){console.warn('THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.');var loader=new THREE.TextureLoader();loader.setCrossOrigin(this.crossOrigin);var texture=loader.load(url,onLoad,undefined,onError);if(mapping)texture.mapping=mapping;return texture;},loadTextureCube:function loadTextureCube(urls,mapping,onLoad,onError){console.warn('THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.');var loader=new THREE.CubeTextureLoader();loader.setCrossOrigin(this.crossOrigin);var texture=loader.load(urls,onLoad,undefined,onError);if(mapping)texture.mapping=mapping;return texture;},loadCompressedTexture:function loadCompressedTexture(){console.error('THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.');},loadCompressedTextureCube:function loadCompressedTextureCube(){console.error('THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.');}};//\nTHREE.Projector=function(){console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.');this.projectVector=function(vector,camera){console.warn('THREE.Projector: .projectVector() is now vector.project().');vector.project(camera);};this.unprojectVector=function(vector,camera){console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().');vector.unproject(camera);};this.pickingRay=function(vector,camera){console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().');};};//\nTHREE.CanvasRenderer=function(){console.error('THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js');this.domElement=document.createElementNS('http://www.w3.org/1999/xhtml','canvas');this.clear=function(){};this.render=function(){};this.setClearColor=function(){};this.setSize=function(){};};// File:src/extras/CurveUtils.js\n/**\n * @author zz85 / http://www.lab4games.net/zz85/blog\n */THREE.CurveUtils={tangentQuadraticBezier:function tangentQuadraticBezier(t,p0,p1,p2){return 2*(1-t)*(p1-p0)+2*t*(p2-p1);},// Puay Bing, thanks for helping with this derivative!\ntangentCubicBezier:function tangentCubicBezier(t,p0,p1,p2,p3){return-3*p0*(1-t)*(1-t)+3*p1*(1-t)*(1-t)-6*t*p1*(1-t)+6*t*p2*(1-t)-3*t*t*p2+3*t*t*p3;},tangentSpline:function tangentSpline(t,p0,p1,p2,p3){// To check if my formulas are correct\nvar h00=6*t*t-6*t;// derived from 2t^3 − 3t^2 + 1\nvar h10=3*t*t-4*t+1;// t^3 − 2t^2 + t\nvar h01=-6*t*t+6*t;// − 2t3 + 3t2\nvar h11=3*t*t-2*t;// t3 − t2\nreturn h00+h10+h01+h11;},// Catmull-Rom\ninterpolate:function interpolate(p0,p1,p2,p3,t){var v0=(p2-p0)*0.5;var v1=(p3-p1)*0.5;var t2=t*t;var t3=t*t2;return(2*p1-2*p2+v0+v1)*t3+(-3*p1+3*p2-2*v0-v1)*t2+v0*t+p1;}};// File:src/extras/SceneUtils.js\n/**\n * @author alteredq / http://alteredqualia.com/\n */THREE.SceneUtils={createMultiMaterialObject:function createMultiMaterialObject(geometry,materials){var group=new THREE.Group();for(var i=0,l=materials.length;i(bx-ax)*(cy-ay)-(by-ay)*(cx-ax))return false;var aX,aY,bX,bY,cX,cY;var apx,apy,bpx,bpy,cpx,cpy;var cCROSSap,bCROSScp,aCROSSbp;aX=cx-bx;aY=cy-by;bX=ax-cx;bY=ay-cy;cX=bx-ax;cY=by-ay;for(p=0;p=-Number.EPSILON&&bCROSScp>=-Number.EPSILON&&cCROSSap>=-Number.EPSILON)return false;}return true;}// takes in an contour array and returns\nreturn function triangulate(contour,indices){var n=contour.length;if(n<3)return null;var result=[],verts=[],vertIndices=[];/* we want a counter-clockwise polygon in verts */var u,v,w;if(THREE.ShapeUtils.area(contour)>0.0){for(v=0;v2;){/* if we loop, it is probably a non-simple polygon */if(count--<=0){//** Triangulate: ERROR - probable bad polygon!\n//throw ( \"Warning, unable to triangulate polygon!\" );\n//return null;\n// Sometimes warning is fine, especially polygons are triangulated in reverse.\nconsole.warn('THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()');if(indices)return vertIndices;return result;}/* three consecutive vertices in current polygon, */u=v;if(nv<=u)u=0;/* previous */v=u+1;if(nv<=v)v=0;/* new v */w=v+1;if(nv<=w)w=0;/* next */if(snip(contour,u,v,w,nv,verts)){var a,b,c,s,t;/* true names of the vertices */a=verts[u];b=verts[v];c=verts[w];/* output Triangle */result.push([contour[a],contour[b],contour[c]]);vertIndices.push([verts[u],verts[v],verts[w]]);/* remove v from the remaining polygon */for(s=v,t=v+1;t2&&points[l-1].equals(points[0])){points.pop();}}removeDupEndPts(contour);holes.forEach(removeDupEndPts);function point_in_segment_2D_colin(inSegPt1,inSegPt2,inOtherPt){// inOtherPt needs to be collinear to the inSegment\nif(inSegPt1.x!==inSegPt2.x){if(inSegPt1.xNumber.EPSILON){// not parallel\nvar perpSeg2;if(limit>0){if(perpSeg1<0||perpSeg1>limit)return[];perpSeg2=seg2dy*seg1seg2dx-seg2dx*seg1seg2dy;if(perpSeg2<0||perpSeg2>limit)return[];}else{if(perpSeg1>0||perpSeg10||perpSeg2seg2maxVal)return[];if(seg1minVal===seg2maxVal){if(inExcludeAdjacentSegs)return[];return[seg1min];}if(seg1maxVal<=seg2maxVal)return[seg1min,seg1max];return[seg1min,seg2max];}}}function isPointInsideAngle(inVertex,inLegFromPt,inLegToPt,inOtherPt){// The order of legs is important\n// translation of all points, so that Vertex is at (0,0)\nvar legFromPtX=inLegFromPt.x-inVertex.x,legFromPtY=inLegFromPt.y-inVertex.y;var legToPtX=inLegToPt.x-inVertex.x,legToPtY=inLegToPt.y-inVertex.y;var otherPtX=inOtherPt.x-inVertex.x,otherPtY=inOtherPt.y-inVertex.y;// main angle >0: < 180 deg.; 0: 180 deg.; <0: > 180 deg.\nvar from2toAngle=legFromPtX*legToPtY-legFromPtY*legToPtX;var from2otherAngle=legFromPtX*otherPtY-legFromPtY*otherPtX;if(Math.abs(from2toAngle)>Number.EPSILON){// angle != 180 deg.\nvar other2toAngle=otherPtX*legToPtY-otherPtY*legToPtX;// console.log( \"from2to: \" + from2toAngle + \", from2other: \" + from2otherAngle + \", other2to: \" + other2toAngle );\nif(from2toAngle>0){// main angle < 180 deg.\nreturn from2otherAngle>=0&&other2toAngle>=0;}else{// main angle > 180 deg.\nreturn from2otherAngle>=0||other2toAngle>=0;}}else{// angle == 180 deg.\n// console.log( \"from2to: 180 deg., from2other: \" + from2otherAngle );\nreturn from2otherAngle>0;}}function removeHoles(contour,holes){var shape=contour.concat();// work on this shape\nvar hole;function isCutLineInsideAngles(inShapeIdx,inHoleIdx){// Check if hole point lies within angle around shape point\nvar lastShapeIdx=shape.length-1;var prevShapeIdx=inShapeIdx-1;if(prevShapeIdx<0)prevShapeIdx=lastShapeIdx;var nextShapeIdx=inShapeIdx+1;if(nextShapeIdx>lastShapeIdx)nextShapeIdx=0;var insideAngle=isPointInsideAngle(shape[inShapeIdx],shape[prevShapeIdx],shape[nextShapeIdx],hole[inHoleIdx]);if(!insideAngle){// console.log( \"Vertex (Shape): \" + inShapeIdx + \", Point: \" + hole[inHoleIdx].x + \"/\" + hole[inHoleIdx].y );\nreturn false;}// Check if shape point lies within angle around hole point\nvar lastHoleIdx=hole.length-1;var prevHoleIdx=inHoleIdx-1;if(prevHoleIdx<0)prevHoleIdx=lastHoleIdx;var nextHoleIdx=inHoleIdx+1;if(nextHoleIdx>lastHoleIdx)nextHoleIdx=0;insideAngle=isPointInsideAngle(hole[inHoleIdx],hole[prevHoleIdx],hole[nextHoleIdx],shape[inShapeIdx]);if(!insideAngle){// console.log( \"Vertex (Hole): \" + inHoleIdx + \", Point: \" + shape[inShapeIdx].x + \"/\" + shape[inShapeIdx].y );\nreturn false;}return true;}function intersectsShapeEdge(inShapePt,inHolePt){// checks for intersections with shape edges\nvar sIdx,nextIdx,intersection;for(sIdx=0;sIdx0)return true;}return false;}var indepHoles=[];function intersectsHoleEdge(inShapePt,inHolePt){// checks for intersections with hole edges\nvar ihIdx,chkHole,hIdx,nextIdx,intersection;for(ihIdx=0;ihIdx0)return true;}}return false;}var holeIndex,shapeIndex,shapePt,holePt,holeIdx,cutKey,failedCuts=[],tmpShape1,tmpShape2,tmpHole1,tmpHole2;for(var h=0,hl=holes.length;h0){counter--;if(counter<0){console.log(\"Infinite Loop! Holes left:\"+indepHoles.length+\", Probably Hole outside Shape!\");break;}// search for shape-vertex and hole-vertex,\n// which can be connected without intersections\nfor(shapeIndex=minShapeIndex;shapeIndex=0)break;// hole-vertex found\nfailedCuts[cutKey]=true;// remember failure\n}if(holeIndex>=0)break;// hole-vertex found\n}}return shape;/* shape with no holes */}var i,il,f,face,key,index,allPointsMap={};// To maintain reference to old shape, one must match coordinates, or offset the indices from original arrays. It's probably easier to do the first.\nvar allpoints=contour.concat();for(var h=0,hl=holes.length;h0){high=i-1;}else{high=i;break;// DONE\n}}i=high;//console.log('b' , i, low, high, Date.now()- time);\nif(arcLengths[i]===targetArcLength){var t=i/(il-1);return t;}// we could get finer grain at lengths, or use simple interpolation between two points\nvar lengthBefore=arcLengths[i];var lengthAfter=arcLengths[i+1];var segmentLength=lengthAfter-lengthBefore;// determine where we are between the 'before' and 'after' points\nvar segmentFraction=(targetArcLength-lengthBefore)/segmentLength;// add that fractional amount to t\nvar t=(i+segmentFraction)/(il-1);return t;},// Returns a unit vector tangent at t\n// In case any sub curve does not implement its tangent derivation,\n// 2 points a small delta apart will be used to find its gradient\n// which seems to give a reasonable approximation\ngetTangent:function getTangent(t){var delta=0.0001;var t1=t-delta;var t2=t+delta;// Capping in case of danger\nif(t1<0)t1=0;if(t2>1)t2=1;var pt1=this.getPoint(t1);var pt2=this.getPoint(t2);var vec=pt2.clone().sub(pt1);return vec.normalize();},getTangentAt:function getTangentAt(u){var t=this.getUtoTmapping(u);return this.getTangent(t);}};// TODO: Transformation for Curves?\n/**************************************************************\n *\t3D Curves\n **************************************************************/// A Factory method for creating new curve subclasses\nTHREE.Curve.create=function(constructor,getPointFunc){constructor.prototype=Object.create(THREE.Curve.prototype);constructor.prototype.constructor=constructor;constructor.prototype.getPoint=getPointFunc;return constructor;};// File:src/extras/core/CurvePath.js\n/**\n * @author zz85 / http://www.lab4games.net/zz85/blog\n *\n **//**************************************************************\n *\tCurved Path - a curve path is simply a array of connected\n * curves, but retains the api of a curve\n **************************************************************/THREE.CurvePath=function(){this.curves=[];this.autoClose=false;// Automatically closes the path\n};THREE.CurvePath.prototype=Object.assign(Object.create(THREE.Curve.prototype),{constructor:THREE.CurvePath,add:function add(curve){this.curves.push(curve);},closePath:function closePath(){// Add a line curve if start and end of lines are not connected\nvar startPoint=this.curves[0].getPoint(0);var endPoint=this.curves[this.curves.length-1].getPoint(1);if(!startPoint.equals(endPoint)){this.curves.push(new THREE.LineCurve(endPoint,startPoint));}},// To get accurate point with reference to\n// entire path distance at time t,\n// following has to be done:\n// 1. Length of each sub path have to be known\n// 2. Locate and identify type of curve\n// 3. Get t for the curve\n// 4. Return curve.getPointAt(t')\ngetPoint:function getPoint(t){var d=t*this.getLength();var curveLengths=this.getCurveLengths();var i=0;// To think about boundaries points.\nwhile(i=d){var diff=curveLengths[i]-d;var curve=this.curves[i];var segmentLength=curve.getLength();var u=segmentLength===0?0:1-diff/segmentLength;return curve.getPointAt(u);}i++;}return null;// loop where sum != 0, sum > d , sum+1 1&&!points[points.length-1].equals(points[0])){points.push(points[0]);}return points;},/**************************************************************\n\t *\tCreate Geometries Helpers\n\t **************************************************************//// Generate geometry from path points (for Line or Points objects)\ncreatePointsGeometry:function createPointsGeometry(divisions){var pts=this.getPoints(divisions);return this.createGeometry(pts);},// Generate geometry from equidistant sampling along the path\ncreateSpacedPointsGeometry:function createSpacedPointsGeometry(divisions){var pts=this.getSpacedPoints(divisions);return this.createGeometry(pts);},createGeometry:function createGeometry(points){var geometry=new THREE.Geometry();for(var i=0,l=points.length;i0){// if a previous curve is present, attempt to join\nvar firstPoint=curve.getPoint(0);if(!firstPoint.equals(this.currentPoint)){this.lineTo(firstPoint.x,firstPoint.y);}}this.curves.push(curve);var lastPoint=curve.getPoint(1);this.currentPoint.copy(lastPoint);}});// minimal class for proxing functions to Path. Replaces old \"extractSubpaths()\"\nTHREE.ShapePath=function(){this.subPaths=[];this.currentPath=null;};THREE.ShapePath.prototype={moveTo:function moveTo(x,y){this.currentPath=new THREE.Path();this.subPaths.push(this.currentPath);this.currentPath.moveTo(x,y);},lineTo:function lineTo(x,y){this.currentPath.lineTo(x,y);},quadraticCurveTo:function quadraticCurveTo(aCPx,aCPy,aX,aY){this.currentPath.quadraticCurveTo(aCPx,aCPy,aX,aY);},bezierCurveTo:function bezierCurveTo(aCP1x,aCP1y,aCP2x,aCP2y,aX,aY){this.currentPath.bezierCurveTo(aCP1x,aCP1y,aCP2x,aCP2y,aX,aY);},splineThru:function splineThru(pts){this.currentPath.splineThru(pts);},toShapes:function toShapes(isCCW,noHoles){function toShapesNoHoles(inSubpaths){var shapes=[];for(var i=0,l=inSubpaths.length;i immediate success or\n// toggling of inside/outside at every single! intersection point of an edge\n// with the horizontal line through inPt, left of inPt\n// not counting lowerY endpoints of edges and whole edges on that line\nvar inside=false;for(var p=polyLen-1,q=0;qNumber.EPSILON){// not parallel\nif(edgeDy<0){edgeLowPt=inPolygon[q];edgeDx=-edgeDx;edgeHighPt=inPolygon[p];edgeDy=-edgeDy;}if(inPt.yedgeHighPt.y)continue;if(inPt.y===edgeLowPt.y){if(inPt.x===edgeLowPt.x)return true;// inPt is on contour ?\n// continue;\t\t\t\t// no intersection or edgeLowPt => doesn't count !!!\n}else{var perpEdge=edgeDy*(inPt.x-edgeLowPt.x)-edgeDx*(inPt.y-edgeLowPt.y);if(perpEdge===0)return true;// inPt is on contour ?\nif(perpEdge<0)continue;inside=!inside;// true intersection left of inPt\n}}else{// parallel or collinear\nif(inPt.y!==edgeLowPt.y)continue;// parallel\n// edge lies on the same horizontal line as inPt\nif(edgeHighPt.x<=inPt.x&&inPt.x<=edgeLowPt.x||edgeLowPt.x<=inPt.x&&inPt.x<=edgeHighPt.x)return true;// inPt: Point on contour !\n// continue;\n}}return inside;}var isClockWise=THREE.ShapeUtils.isClockWise;var subPaths=this.subPaths;if(subPaths.length===0)return[];if(noHoles===true)return toShapesNoHoles(subPaths);var solid,tmpPath,tmpShape,shapes=[];if(subPaths.length===1){tmpPath=subPaths[0];tmpShape=new THREE.Shape();tmpShape.curves=tmpPath.curves;shapes.push(tmpShape);return shapes;}var holesFirst=!isClockWise(subPaths[0].getPoints());holesFirst=isCCW?!holesFirst:holesFirst;// console.log(\"Holes first\", holesFirst);\nvar betterShapeHoles=[];var newShapes=[];var newShapeHoles=[];var mainIdx=0;var tmpPoints;newShapes[mainIdx]=undefined;newShapeHoles[mainIdx]=[];for(var i=0,l=subPaths.length;i probably all Shapes with wrong orientation\nif(!newShapes[0])return toShapesNoHoles(subPaths);if(newShapes.length>1){var ambiguous=false;var toChange=[];for(var sIdx=0,sLen=newShapes.length;sIdx0){// console.log(\"to change: \", toChange);\nif(!ambiguous)newShapeHoles=betterShapeHoles;}}var tmpHoles;for(var i=0,il=newShapes.length;ipoints.length-2?points.length-1:intPoint+1];var point3=points[intPoint>points.length-3?points.length-1:intPoint+2];var interpolate=THREE.CurveUtils.interpolate;return new THREE.Vector2(interpolate(point0.x,point1.x,point2.x,point3.x,weight),interpolate(point0.y,point1.y,point2.y,point3.y,weight));};// File:src/extras/curves/EllipseCurve.js\n/**************************************************************\n *\tEllipse curve\n **************************************************************/THREE.EllipseCurve=function(aX,aY,xRadius,yRadius,aStartAngle,aEndAngle,aClockwise,aRotation){this.aX=aX;this.aY=aY;this.xRadius=xRadius;this.yRadius=yRadius;this.aStartAngle=aStartAngle;this.aEndAngle=aEndAngle;this.aClockwise=aClockwise;this.aRotation=aRotation||0;};THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype);THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve;THREE.EllipseCurve.prototype.getPoint=function(t){var twoPi=Math.PI*2;var deltaAngle=this.aEndAngle-this.aStartAngle;var samePoints=Math.abs(deltaAngle)twoPi){deltaAngle-=twoPi;}if(deltaAnglepoints.length-2?points.length-1:intPoint+1];var point3=points[intPoint>points.length-3?points.length-1:intPoint+2];var interpolate=THREE.CurveUtils.interpolate;return new THREE.Vector3(interpolate(point0.x,point1.x,point2.x,point3.x,weight),interpolate(point0.y,point1.y,point2.y,point3.y,weight),interpolate(point0.z,point1.z,point2.z,point3.z,weight));});// File:src/extras/curves/CatmullRomCurve3.js\n/**\n * @author zz85 https://github.com/zz85\n *\n * Centripetal CatmullRom Curve - which is useful for avoiding\n * cusps and self-intersections in non-uniform catmull rom curves.\n * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\n *\n * curve.type accepts centripetal(default), chordal and catmullrom\n * curve.tension is used for catmullrom which defaults to 0.5\n */THREE.CatmullRomCurve3=function(){var tmp=new THREE.Vector3(),px=new CubicPoly(),py=new CubicPoly(),pz=new CubicPoly();/*\n\tBased on an optimized c++ solution in\n\t - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/\n\t - http://ideone.com/NoEbVM\n\n\tThis CubicPoly class could be used for reusing some variables and calculations,\n\tbut for three.js curve use, it could be possible inlined and flatten into a single function call\n\twhich can be placed in CurveUtils.\n\t*/function CubicPoly(){}/*\n\t * Compute coefficients for a cubic polynomial\n\t * p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t * such that\n\t * p(0) = x0, p(1) = x1\n\t * and\n\t * p'(0) = t0, p'(1) = t1.\n\t */CubicPoly.prototype.init=function(x0,x1,t0,t1){this.c0=x0;this.c1=t0;this.c2=-3*x0+3*x1-2*t0-t1;this.c3=2*x0-2*x1+t0+t1;};CubicPoly.prototype.initNonuniformCatmullRom=function(x0,x1,x2,x3,dt0,dt1,dt2){// compute tangents when parameterized in [t1,t2]\nvar t1=(x1-x0)/dt0-(x2-x0)/(dt0+dt1)+(x2-x1)/dt1;var t2=(x2-x1)/dt1-(x3-x1)/(dt1+dt2)+(x3-x2)/dt2;// rescale tangents for parametrization in [0,1]\nt1*=dt1;t2*=dt1;// initCubicPoly\nthis.init(x1,x2,t1,t2);};// standard Catmull-Rom spline: interpolate between x1 and x2 with previous/following points x1/x4\nCubicPoly.prototype.initCatmullRom=function(x0,x1,x2,x3,tension){this.init(x1,x2,tension*(x2-x0),tension*(x3-x1));};CubicPoly.prototype.calc=function(t){var t2=t*t;var t3=t2*t;return this.c0+this.c1*t+this.c2*t2+this.c3*t3;};// Subclass Three.js curve\nreturn THREE.Curve.create(function(p/* array of Vector3 */){this.points=p||[];this.closed=false;},function(t){var points=this.points,point,intPoint,weight,l;l=points.length;if(l<2)console.log('duh, you need at least 2 points');point=(l-(this.closed?0:1))*t;intPoint=Math.floor(point);weight=point-intPoint;if(this.closed){intPoint+=intPoint>0?0:(Math.floor(Math.abs(intPoint)/points.length)+1)*points.length;}else if(weight===0&&intPoint===l-1){intPoint=l-2;weight=1;}var p0,p1,p2,p3;// 4 points\nif(this.closed||intPoint>0){p0=points[(intPoint-1)%l];}else{// extrapolate first point\ntmp.subVectors(points[0],points[1]).add(points[0]);p0=tmp;}p1=points[intPoint%l];p2=points[(intPoint+1)%l];if(this.closed||intPoint+265535?Uint32Array:Uint16Array)(indexCount);var vertices=new Float32Array(vertexCount*3);var normals=new Float32Array(vertexCount*3);var uvs=new Float32Array(vertexCount*2);// offset variables\nvar vertexBufferOffset=0;var uvBufferOffset=0;var indexBufferOffset=0;var numberOfVertices=0;// group variables\nvar groupStart=0;// build each side of the box geometry\nbuildPlane('z','y','x',-1,-1,depth,height,width,depthSegments,heightSegments,0);// px\nbuildPlane('z','y','x',1,-1,depth,height,-width,depthSegments,heightSegments,1);// nx\nbuildPlane('x','z','y',1,1,width,depth,height,widthSegments,depthSegments,2);// py\nbuildPlane('x','z','y',1,-1,width,depth,-height,widthSegments,depthSegments,3);// ny\nbuildPlane('x','y','z',1,-1,width,height,depth,widthSegments,heightSegments,4);// pz\nbuildPlane('x','y','z',-1,-1,width,height,-depth,widthSegments,heightSegments,5);// nz\n// build geometry\nthis.setIndex(new THREE.BufferAttribute(indices,1));this.addAttribute('position',new THREE.BufferAttribute(vertices,3));this.addAttribute('normal',new THREE.BufferAttribute(normals,3));this.addAttribute('uv',new THREE.BufferAttribute(uvs,2));// helper functions\nfunction calculateVertexCount(w,h,d){var vertices=0;// calculate the amount of vertices for each side (plane)\nvertices+=(w+1)*(h+1)*2;// xy\nvertices+=(w+1)*(d+1)*2;// xz\nvertices+=(d+1)*(h+1)*2;// zy\nreturn vertices;}function calculateIndexCount(w,h,d){var index=0;// calculate the amount of squares for each side\nindex+=w*h*2;// xy\nindex+=w*d*2;// xz\nindex+=d*h*2;// zy\nreturn index*6;// two triangles per square => six vertices per square\n}function buildPlane(u,v,w,udir,vdir,width,height,depth,gridX,gridY,materialIndex){var segmentWidth=width/gridX;var segmentHeight=height/gridY;var widthHalf=width/2;var heightHalf=height/2;var depthHalf=depth/2;var gridX1=gridX+1;var gridY1=gridY+1;var vertexCounter=0;var groupCount=0;var vector=new THREE.Vector3();// generate vertices, normals and uvs\nfor(var iy=0;iy0?1:-1;// now apply vector to normal buffer\nnormals[vertexBufferOffset]=vector.x;normals[vertexBufferOffset+1]=vector.y;normals[vertexBufferOffset+2]=vector.z;// uvs\nuvs[uvBufferOffset]=ix/gridX;uvs[uvBufferOffset+1]=1-iy/gridY;// update offsets and counters\nvertexBufferOffset+=3;uvBufferOffset+=2;vertexCounter+=1;}}// 1. you need three indices to draw a single face\n// 2. a single segment consists of two faces\n// 3. so we need to generate six (2*3) indices per segment\nfor(iy=0;iy0)nbCap++;if(radiusBottom>0)nbCap++;}var vertexCount=calculateVertexCount();var indexCount=calculateIndexCount();// buffers\nvar indices=new THREE.BufferAttribute(new(indexCount>65535?Uint32Array:Uint16Array)(indexCount),1);var vertices=new THREE.BufferAttribute(new Float32Array(vertexCount*3),3);var normals=new THREE.BufferAttribute(new Float32Array(vertexCount*3),3);var uvs=new THREE.BufferAttribute(new Float32Array(vertexCount*2),2);// helper variables\nvar index=0,indexOffset=0,indexArray=[],halfHeight=height/2;// group variables\nvar groupStart=0;// generate geometry\ngenerateTorso();if(openEnded===false){if(radiusTop>0)generateCap(true);if(radiusBottom>0)generateCap(false);}// build geometry\nthis.setIndex(indices);this.addAttribute('position',vertices);this.addAttribute('normal',normals);this.addAttribute('uv',uvs);// helper functions\nfunction calculateVertexCount(){var count=(radialSegments+1)*(heightSegments+1);if(openEnded===false){count+=(radialSegments+1)*nbCap+radialSegments*nbCap;}return count;}function calculateIndexCount(){var count=radialSegments*heightSegments*2*3;if(openEnded===false){count+=radialSegments*nbCap*3;}return count;}function generateTorso(){var x,y;var normal=new THREE.Vector3();var vertex=new THREE.Vector3();var groupCount=0;// this will be used to calculate the normal\nvar tanTheta=(radiusBottom-radiusTop)/height;// generate vertices, normals and uvs\nfor(y=0;y<=heightSegments;y++){var indexRow=[];var v=y/heightSegments;// calculate the radius of the current row\nvar radius=v*(radiusBottom-radiusTop)+radiusTop;for(x=0;x<=radialSegments;x++){var u=x/radialSegments;// vertex\nvertex.x=radius*Math.sin(u*thetaLength+thetaStart);vertex.y=-v*height+halfHeight;vertex.z=radius*Math.cos(u*thetaLength+thetaStart);vertices.setXYZ(index,vertex.x,vertex.y,vertex.z);// normal\nnormal.copy(vertex);// handle special case if radiusTop/radiusBottom is zero\nif(radiusTop===0&&y===0||radiusBottom===0&&y===heightSegments){normal.x=Math.sin(u*thetaLength+thetaStart);normal.z=Math.cos(u*thetaLength+thetaStart);}normal.setY(Math.sqrt(normal.x*normal.x+normal.z*normal.z)*tanTheta).normalize();normals.setXYZ(index,normal.x,normal.y,normal.z);// uv\nuvs.setXY(index,u,1-v);// save index of vertex in respective row\nindexRow.push(index);// increase index\nindex++;}// now save vertices of the row in our index array\nindexArray.push(indexRow);}// generate indices\nfor(x=0;x, // number of points on the curves\n * steps: , // number of points for z-side extrusions / used for subdividing segments of extrude spline too\n * amount: , // Depth to extrude the shape\n *\n * bevelEnabled: , // turn on bevel\n * bevelThickness: , // how deep into the original shape bevel goes\n * bevelSize: , // how far from shape outline is bevel\n * bevelSegments: , // number of bevel layers\n *\n * extrudePath: // 3d spline path to extrude shape along. (creates Frames if .frames aren't defined)\n * frames: // containing arrays of tangents, normals, binormals\n *\n * uvGenerator: // object that provides UV generator functions\n *\n * }\n **/THREE.ExtrudeGeometry=function(shapes,options){if(typeof shapes===\"undefined\"){shapes=[];return;}THREE.Geometry.call(this);this.type='ExtrudeGeometry';shapes=Array.isArray(shapes)?shapes:[shapes];this.addShapeList(shapes,options);this.computeFaceNormals();// can't really use automatic vertex normals\n// as then front and back sides get smoothed too\n// should do separate smoothing just for sides\n//this.computeVertexNormals();\n//console.log( \"took\", ( Date.now() - startTime ) );\n};THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry;THREE.ExtrudeGeometry.prototype.addShapeList=function(shapes,options){var sl=shapes.length;for(var s=0;sNumber.EPSILON){// not collinear\n// length of vectors for normalizing\nvar v_prev_len=Math.sqrt(v_prev_lensq);var v_next_len=Math.sqrt(v_next_x*v_next_x+v_next_y*v_next_y);// shift adjacent points by unit vectors to the left\nvar ptPrevShift_x=inPrev.x-v_prev_y/v_prev_len;var ptPrevShift_y=inPrev.y+v_prev_x/v_prev_len;var ptNextShift_x=inNext.x-v_next_y/v_next_len;var ptNextShift_y=inNext.y+v_next_x/v_next_len;// scaling factor for v_prev to intersection point\nvar sf=((ptNextShift_x-ptPrevShift_x)*v_next_y-(ptNextShift_y-ptPrevShift_y)*v_next_x)/(v_prev_x*v_next_y-v_prev_y*v_next_x);// vector from inPt to intersection point\nv_trans_x=ptPrevShift_x+v_prev_x*sf-inPt.x;v_trans_y=ptPrevShift_y+v_prev_y*sf-inPt.y;// Don't normalize!, otherwise sharp corners become ugly\n// but prevent crazy spikes\nvar v_trans_lensq=v_trans_x*v_trans_x+v_trans_y*v_trans_y;if(v_trans_lensq<=2){return new THREE.Vector2(v_trans_x,v_trans_y);}else{shrink_by=Math.sqrt(v_trans_lensq/2);}}else{// handle special case of collinear edges\nvar direction_eq=false;// assumes: opposite\nif(v_prev_x>Number.EPSILON){if(v_next_x>Number.EPSILON){direction_eq=true;}}else{if(v_prev_x<-Number.EPSILON){if(v_next_x<-Number.EPSILON){direction_eq=true;}}else{if(Math.sign(v_prev_y)===Math.sign(v_next_y)){direction_eq=true;}}}if(direction_eq){// console.log(\"Warning: lines are a straight sequence\");\nv_trans_x=-v_prev_y;v_trans_y=v_prev_x;shrink_by=Math.sqrt(v_prev_lensq);}else{// console.log(\"Warning: lines are a straight spike\");\nv_trans_x=v_prev_x;v_trans_y=v_prev_y;shrink_by=Math.sqrt(v_prev_lensq/2);}}return new THREE.Vector2(v_trans_x/shrink_by,v_trans_y/shrink_by);}var contourMovements=[];for(var i=0,il=contour.length,j=il-1,k=i+1;i 0; b -- ) {\nt=b/bevelSegments;z=bevelThickness*(1-t);//z = bevelThickness * t;\nbs=bevelSize*Math.sin(t*Math.PI/2);// curved\n//bs = bevelSize * t; // linear\n// contract shape\nfor(i=0,il=contour.length;i=0;b--){t=b/bevelSegments;z=bevelThickness*(1-t);//bs = bevelSize * ( 1-Math.sin ( ( 1 - t ) * Math.PI/2 ) );\nbs=bevelSize*Math.sin(t*Math.PI/2);// contract shape\nfor(i=0,il=contour.length;i=0){j=i;k=i-1;if(k<0)k=contour.length-1;//console.log('b', i,j, i-1, k,vertices.length);\nvar s=0,sl=steps+bevelSegments*2;for(s=0;s, // number of points on the curves. NOT USED AT THE MOMENT.\n *\n *\tmaterial: // material index for front and back faces\n *\tuvGenerator: // object that provides UV generator functions\n *\n * }\n **/THREE.ShapeGeometry=function(shapes,options){THREE.Geometry.call(this);this.type='ShapeGeometry';if(Array.isArray(shapes)===false)shapes=[shapes];this.addShapeList(shapes,options);this.computeFaceNormals();};THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry;/**\n * Add an array of shapes to THREE.ShapeGeometry.\n */THREE.ShapeGeometry.prototype.addShapeList=function(shapes,options){for(var i=0,l=shapes.length;i65535?Uint32Array:Uint16Array)(indexCount),1);var vertices=new THREE.BufferAttribute(new Float32Array(vertexCount*3),3);var uvs=new THREE.BufferAttribute(new Float32Array(vertexCount*2),2);// helper variables\nvar index=0,indexOffset=0,base;var inversePointLength=1.0/(points.length-1);var inverseSegments=1.0/segments;var vertex=new THREE.Vector3();var uv=new THREE.Vector2();var i,j;// generate vertices and uvs\nfor(i=0;i<=segments;i++){var phi=phiStart+i*inverseSegments*phiLength;var sin=Math.sin(phi);var cos=Math.cos(phi);for(j=0;j<=points.length-1;j++){// vertex\nvertex.x=points[j].x*sin;vertex.y=points[j].y;vertex.z=points[j].x*cos;vertices.setXYZ(index,vertex.x,vertex.y,vertex.z);// uv\nuv.x=i/segments;uv.y=j/(points.length-1);uvs.setXY(index,uv.x,uv.y);// increase index\nindex++;}}// generate indices\nfor(i=0;i65535?Uint32Array:Uint16Array)(gridX*gridY*6);for(var iy=0;iy65535?Uint32Array:Uint16Array)(indexCount),1);var vertices=new THREE.BufferAttribute(new Float32Array(vertexCount*3),3);var normals=new THREE.BufferAttribute(new Float32Array(vertexCount*3),3);var uvs=new THREE.BufferAttribute(new Float32Array(vertexCount*2),2);// some helper variables\nvar index=0,indexOffset=0,segment;var radius=innerRadius;var radiusStep=(outerRadius-innerRadius)/phiSegments;var vertex=new THREE.Vector3();var uv=new THREE.Vector2();var j,i;// generate vertices, normals and uvs\n// values are generate from the inside of the ring to the outside\nfor(j=0;j<=phiSegments;j++){for(i=0;i<=thetaSegments;i++){segment=thetaStart+i/thetaSegments*thetaLength;// vertex\nvertex.x=radius*Math.cos(segment);vertex.y=radius*Math.sin(segment);vertices.setXYZ(index,vertex.x,vertex.y,vertex.z);// normal\nnormals.setXYZ(index,0,0,1);// uv\nuv.x=(vertex.x/outerRadius+1)/2;uv.y=(vertex.y/outerRadius+1)/2;uvs.setXY(index,uv.x,uv.y);// increase index\nindex++;}// increase the radius for next row of vertices\nradius+=radiusStep;}// generate indices\nfor(j=0;j0)indices.push(v1,v2,v4);if(y!==heightSegments-1||thetaEnd65535?THREE.Uint32Attribute:THREE.Uint16Attribute)(indices,1));this.addAttribute('position',positions);this.addAttribute('normal',normals);this.addAttribute('uv',uvs);this.boundingSphere=new THREE.Sphere(new THREE.Vector3(),radius);};THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry;// File:src/extras/geometries/TextGeometry.js\n/**\n * @author zz85 / http://www.lab4games.net/zz85/blog\n * @author alteredq / http://alteredqualia.com/\n *\n * Text = 3D Text\n *\n * parameters = {\n * font: , // font\n *\n * size: , // size of the text\n * height: , // thickness to extrude text\n * curveSegments: , // number of points on the curves\n *\n * bevelEnabled: , // turn on bevel\n * bevelThickness: , // how deep into text bevel goes\n * bevelSize: // how far from text outline is bevel\n * }\n */THREE.TextGeometry=function(text,parameters){parameters=parameters||{};var font=parameters.font;if(font instanceof THREE.Font===false){console.error('THREE.TextGeometry: font parameter is not an instance of THREE.Font.');return new THREE.Geometry();}var shapes=font.generateShapes(text,parameters.size,parameters.curveSegments);// translate parameters to ExtrudeGeometry API\nparameters.amount=parameters.height!==undefined?parameters.height:50;// defaults\nif(parameters.bevelThickness===undefined)parameters.bevelThickness=10;if(parameters.bevelSize===undefined)parameters.bevelSize=8;if(parameters.bevelEnabled===undefined)parameters.bevelEnabled=false;THREE.ExtrudeGeometry.call(this,shapes,parameters);this.type='TextGeometry';};THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype);THREE.TextGeometry.prototype.constructor=THREE.TextGeometry;// File:src/extras/geometries/TorusBufferGeometry.js\n/**\n * @author Mugen87 / https://github.com/Mugen87\n */THREE.TorusBufferGeometry=function(radius,tube,radialSegments,tubularSegments,arc){THREE.BufferGeometry.call(this);this.type='TorusBufferGeometry';this.parameters={radius:radius,tube:tube,radialSegments:radialSegments,tubularSegments:tubularSegments,arc:arc};radius=radius||100;tube=tube||40;radialSegments=Math.floor(radialSegments)||8;tubularSegments=Math.floor(tubularSegments)||6;arc=arc||Math.PI*2;// used to calculate buffer length\nvar vertexCount=(radialSegments+1)*(tubularSegments+1);var indexCount=radialSegments*tubularSegments*2*3;// buffers\nvar indices=new(indexCount>65535?Uint32Array:Uint16Array)(indexCount);var vertices=new Float32Array(vertexCount*3);var normals=new Float32Array(vertexCount*3);var uvs=new Float32Array(vertexCount*2);// offset variables\nvar vertexBufferOffset=0;var uvBufferOffset=0;var indexBufferOffset=0;// helper variables\nvar center=new THREE.Vector3();var vertex=new THREE.Vector3();var normal=new THREE.Vector3();var j,i;// generate vertices, normals and uvs\nfor(j=0;j<=radialSegments;j++){for(i=0;i<=tubularSegments;i++){var u=i/tubularSegments*arc;var v=j/radialSegments*Math.PI*2;// vertex\nvertex.x=(radius+tube*Math.cos(v))*Math.cos(u);vertex.y=(radius+tube*Math.cos(v))*Math.sin(u);vertex.z=tube*Math.sin(v);vertices[vertexBufferOffset]=vertex.x;vertices[vertexBufferOffset+1]=vertex.y;vertices[vertexBufferOffset+2]=vertex.z;// this vector is used to calculate the normal\ncenter.x=radius*Math.cos(u);center.y=radius*Math.sin(u);// normal\nnormal.subVectors(vertex,center).normalize();normals[vertexBufferOffset]=normal.x;normals[vertexBufferOffset+1]=normal.y;normals[vertexBufferOffset+2]=normal.z;// uv\nuvs[uvBufferOffset]=i/tubularSegments;uvs[uvBufferOffset+1]=j/radialSegments;// update offsets\nvertexBufferOffset+=3;uvBufferOffset+=2;}}// generate indices\nfor(j=1;j<=radialSegments;j++){for(i=1;i<=tubularSegments;i++){// indices\nvar a=(tubularSegments+1)*j+i-1;var b=(tubularSegments+1)*(j-1)+i-1;var c=(tubularSegments+1)*(j-1)+i;var d=(tubularSegments+1)*j+i;// face one\nindices[indexBufferOffset]=a;indices[indexBufferOffset+1]=b;indices[indexBufferOffset+2]=d;// face two\nindices[indexBufferOffset+3]=b;indices[indexBufferOffset+4]=c;indices[indexBufferOffset+5]=d;// update offset\nindexBufferOffset+=6;}}// build geometry\nthis.setIndex(new THREE.BufferAttribute(indices,1));this.addAttribute('position',new THREE.BufferAttribute(vertices,3));this.addAttribute('normal',new THREE.BufferAttribute(normals,3));this.addAttribute('uv',new THREE.BufferAttribute(uvs,2));};THREE.TorusBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.TorusBufferGeometry.prototype.constructor=THREE.TorusBufferGeometry;// File:src/extras/geometries/TorusGeometry.js\n/**\n * @author oosmoxiecode\n * @author mrdoob / http://mrdoob.com/\n * based on http://code.google.com/p/away3d/source/browse/trunk/fp10/Away3DLite/src/away3dlite/primitives/Torus.as?r=2888\n */THREE.TorusGeometry=function(radius,tube,radialSegments,tubularSegments,arc){THREE.Geometry.call(this);this.type='TorusGeometry';this.parameters={radius:radius,tube:tube,radialSegments:radialSegments,tubularSegments:tubularSegments,arc:arc};this.fromBufferGeometry(new THREE.TorusBufferGeometry(radius,tube,radialSegments,tubularSegments,arc));};THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry;// File:src/extras/geometries/TorusKnotBufferGeometry.js\n/**\n * @author Mugen87 / https://github.com/Mugen87\n *\n * see: http://www.blackpawn.com/texts/pqtorus/\n */THREE.TorusKnotBufferGeometry=function(radius,tube,tubularSegments,radialSegments,p,q){THREE.BufferGeometry.call(this);this.type='TorusKnotBufferGeometry';this.parameters={radius:radius,tube:tube,tubularSegments:tubularSegments,radialSegments:radialSegments,p:p,q:q};radius=radius||100;tube=tube||40;tubularSegments=Math.floor(tubularSegments)||64;radialSegments=Math.floor(radialSegments)||8;p=p||2;q=q||3;// used to calculate buffer length\nvar vertexCount=(radialSegments+1)*(tubularSegments+1);var indexCount=radialSegments*tubularSegments*2*3;// buffers\nvar indices=new THREE.BufferAttribute(new(indexCount>65535?Uint32Array:Uint16Array)(indexCount),1);var vertices=new THREE.BufferAttribute(new Float32Array(vertexCount*3),3);var normals=new THREE.BufferAttribute(new Float32Array(vertexCount*3),3);var uvs=new THREE.BufferAttribute(new Float32Array(vertexCount*2),2);// helper variables\nvar i,j,index=0,indexOffset=0;var vertex=new THREE.Vector3();var normal=new THREE.Vector3();var uv=new THREE.Vector2();var P1=new THREE.Vector3();var P2=new THREE.Vector3();var B=new THREE.Vector3();var T=new THREE.Vector3();var N=new THREE.Vector3();// generate vertices, normals and uvs\nfor(i=0;i<=tubularSegments;++i){// the radian \"u\" is used to calculate the position on the torus curve of the current tubular segement\nvar u=i/tubularSegments*p*Math.PI*2;// now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead.\n// these points are used to create a special \"coordinate space\", which is necessary to calculate the correct vertex positions\ncalculatePositionOnCurve(u,p,q,radius,P1);calculatePositionOnCurve(u+0.01,p,q,radius,P2);// calculate orthonormal basis\nT.subVectors(P2,P1);N.addVectors(P2,P1);B.crossVectors(T,N);N.crossVectors(B,T);// normalize B, N. T can be ignored, we don't use it\nB.normalize();N.normalize();for(j=0;j<=radialSegments;++j){// now calculate the vertices. they are nothing more than an extrusion of the torus curve.\n// because we extrude a shape in the xy-plane, there is no need to calculate a z-value.\nvar v=j/radialSegments*Math.PI*2;var cx=-tube*Math.cos(v);var cy=tube*Math.sin(v);// now calculate the final vertex position.\n// first we orient the extrusion with our basis vectos, then we add it to the current position on the curve\nvertex.x=P1.x+(cx*N.x+cy*B.x);vertex.y=P1.y+(cx*N.y+cy*B.y);vertex.z=P1.z+(cx*N.z+cy*B.z);// vertex\nvertices.setXYZ(index,vertex.x,vertex.y,vertex.z);// normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal)\nnormal.subVectors(vertex,P1).normalize();normals.setXYZ(index,normal.x,normal.y,normal.z);// uv\nuv.x=i/tubularSegments;uv.y=j/radialSegments;uvs.setXY(index,uv.x,uv.y);// increase index\nindex++;}}// generate indices\nfor(j=1;j<=tubularSegments;j++){for(i=1;i<=radialSegments;i++){// indices\nvar a=(radialSegments+1)*(j-1)+(i-1);var b=(radialSegments+1)*j+(i-1);var c=(radialSegments+1)*j+i;var d=(radialSegments+1)*(j-1)+i;// face one\nindices.setX(indexOffset,a);indexOffset++;indices.setX(indexOffset,b);indexOffset++;indices.setX(indexOffset,d);indexOffset++;// face two\nindices.setX(indexOffset,b);indexOffset++;indices.setX(indexOffset,c);indexOffset++;indices.setX(indexOffset,d);indexOffset++;}}// build geometry\nthis.setIndex(indices);this.addAttribute('position',vertices);this.addAttribute('normal',normals);this.addAttribute('uv',uvs);// this function calculates the current position on the torus curve\nfunction calculatePositionOnCurve(u,p,q,radius,position){var cu=Math.cos(u);var su=Math.sin(u);var quOverP=q/p*u;var cs=Math.cos(quOverP);position.x=radius*(2+cs)*0.5*cu;position.y=radius*(2+cs)*su*0.5;position.z=radius*Math.sin(quOverP)*0.5;}};THREE.TorusKnotBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype);THREE.TorusKnotBufferGeometry.prototype.constructor=THREE.TorusKnotBufferGeometry;// File:src/extras/geometries/TorusKnotGeometry.js\n/**\n * @author oosmoxiecode\n */THREE.TorusKnotGeometry=function(radius,tube,tubularSegments,radialSegments,p,q,heightScale){THREE.Geometry.call(this);this.type='TorusKnotGeometry';this.parameters={radius:radius,tube:tube,tubularSegments:tubularSegments,radialSegments:radialSegments,p:p,q:q};if(heightScale!==undefined)console.warn('THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.');this.fromBufferGeometry(new THREE.TorusKnotBufferGeometry(radius,tube,tubularSegments,radialSegments,p,q));this.mergeVertices();};THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype);THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry;// File:src/extras/geometries/TubeGeometry.js\n/**\n * @author WestLangley / https://github.com/WestLangley\n * @author zz85 / https://github.com/zz85\n * @author miningold / https://github.com/miningold\n * @author jonobr1 / https://github.com/jonobr1\n *\n * Modified from the TorusKnotGeometry by @oosmoxiecode\n *\n * Creates a tube which extrudes along a 3d spline\n *\n * Uses parallel transport frames as described in\n * http://www.cs.indiana.edu/pub/techreports/TR425.pdf\n */THREE.TubeGeometry=function(path,segments,radius,radialSegments,closed,taper){THREE.Geometry.call(this);this.type='TubeGeometry';this.parameters={path:path,segments:segments,radius:radius,radialSegments:radialSegments,closed:closed,taper:taper};segments=segments||64;radius=radius||1;radialSegments=radialSegments||8;closed=closed||false;taper=taper||THREE.TubeGeometry.NoTaper;var grid=[];var scope=this,tangent,normal,binormal,numpoints=segments+1,u,v,r,cx,cy,pos,pos2=new THREE.Vector3(),i,j,ip,jp,a,b,c,d,uva,uvb,uvc,uvd;var frames=new THREE.TubeGeometry.FrenetFrames(path,segments,closed),tangents=frames.tangents,normals=frames.normals,binormals=frames.binormals;// proxy internals\nthis.tangents=tangents;this.normals=normals;this.binormals=binormals;function vert(x,y,z){return scope.vertices.push(new THREE.Vector3(x,y,z))-1;}// construct the grid\nfor(i=0;iNumber.EPSILON){vec.normalize();theta=Math.acos(THREE.Math.clamp(tangents[i-1].dot(tangents[i]),-1,1));// clamp for floating pt errors\nnormals[i].applyMatrix4(mat.makeRotationAxis(vec,theta));}binormals[i].crossVectors(tangents[i],normals[i]);}// if the curve is closed, postprocess the vectors so the first and last normal vectors are the same\nif(closed){theta=Math.acos(THREE.Math.clamp(normals[0].dot(normals[numpoints-1]),-1,1));theta/=numpoints-1;if(tangents[0].dot(vec.crossVectors(normals[0],normals[numpoints-1]))>0){theta=-theta;}for(i=1;i0.9&&min<0.1){// 0.9 is somewhat arbitrary\nif(x0<0.2)uvs[0].x+=1;if(x1<0.2)uvs[1].x+=1;if(x2<0.2)uvs[2].x+=1;}}// Apply radius\nfor(var i=0,l=this.vertices.length;i0.99999){this.quaternion.set(0,0,0,1);}else if(dir.y<-0.99999){this.quaternion.set(1,0,0,0);}else{axis.set(dir.z,0,-dir.x).normalize();radians=Math.acos(dir.y);this.quaternion.setFromAxisAngle(axis,radians);}};}();THREE.ArrowHelper.prototype.setLength=function(length,headLength,headWidth){if(headLength===undefined)headLength=0.2*length;if(headWidth===undefined)headWidth=0.2*headLength;this.line.scale.set(1,Math.max(0,length-headLength),1);this.line.updateMatrix();this.cone.scale.set(headWidth,headLength,headWidth);this.cone.position.y=length;this.cone.updateMatrix();};THREE.ArrowHelper.prototype.setColor=function(color){this.line.material.color.copy(color);this.cone.material.color.copy(color);};// File:src/extras/helpers/BoxHelper.js\n/**\n * @author mrdoob / http://mrdoob.com/\n */THREE.BoxHelper=function(object,color){if(color===undefined)color=0xffff00;var indices=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 positions=new Float32Array(8*3);var geometry=new THREE.BufferGeometry();geometry.setIndex(new THREE.BufferAttribute(indices,1));geometry.addAttribute('position',new THREE.BufferAttribute(positions,3));THREE.LineSegments.call(this,geometry,new THREE.LineBasicMaterial({color:color}));if(object!==undefined){this.update(object);}};THREE.BoxHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.BoxHelper.prototype.constructor=THREE.BoxHelper;THREE.BoxHelper.prototype.update=function(){var box=new THREE.Box3();return function update(object){if(object instanceof THREE.Box3){box.copy(object);}else{box.setFromObject(object);}if(box.isEmpty())return;var min=box.min;var max=box.max;/*\n\t\t 5____4\n\t\t1/___0/|\n\t\t| 6__|_7\n\t\t2/___3/\n\n\t\t0: max.x, max.y, max.z\n\t\t1: min.x, max.y, max.z\n\t\t2: min.x, min.y, max.z\n\t\t3: max.x, min.y, max.z\n\t\t4: max.x, max.y, min.z\n\t\t5: min.x, max.y, min.z\n\t\t6: min.x, min.y, min.z\n\t\t7: max.x, min.y, min.z\n\t\t*/var position=this.geometry.attributes.position;var array=position.array;array[0]=max.x;array[1]=max.y;array[2]=max.z;array[3]=min.x;array[4]=max.y;array[5]=max.z;array[6]=min.x;array[7]=min.y;array[8]=max.z;array[9]=max.x;array[10]=min.y;array[11]=max.z;array[12]=max.x;array[13]=max.y;array[14]=min.z;array[15]=min.x;array[16]=max.y;array[17]=min.z;array[18]=min.x;array[19]=min.y;array[20]=min.z;array[21]=max.x;array[22]=min.y;array[23]=min.z;position.needsUpdate=true;this.geometry.computeBoundingSphere();};}();// File:src/extras/helpers/BoundingBoxHelper.js\n/**\n * @author WestLangley / http://github.com/WestLangley\n */// a helper to show the world-axis-aligned bounding box for an object\nTHREE.BoundingBoxHelper=function(object,hex){var color=hex!==undefined?hex:0x888888;this.object=object;this.box=new THREE.Box3();THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:color,wireframe:true}));};THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype);THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper;THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object);this.box.size(this.scale);this.box.center(this.position);};// File:src/extras/helpers/CameraHelper.js\n/**\n * @author alteredq / http://alteredqualia.com/\n *\n *\t- shows frustum, line of sight and up of the camera\n *\t- suitable for fast updates\n * \t- based on frustum visualization in lightgl.js shadowmap example\n *\t\thttp://evanw.github.com/lightgl.js/tests/shadowmap.html\n */THREE.CameraHelper=function(camera){var geometry=new THREE.Geometry();var material=new THREE.LineBasicMaterial({color:0xffffff,vertexColors:THREE.FaceColors});var pointMap={};// colors\nvar hexFrustum=0xffaa00;var hexCone=0xff0000;var hexUp=0x00aaff;var hexTarget=0xffffff;var hexCross=0x333333;// near\naddLine(\"n1\",\"n2\",hexFrustum);addLine(\"n2\",\"n4\",hexFrustum);addLine(\"n4\",\"n3\",hexFrustum);addLine(\"n3\",\"n1\",hexFrustum);// far\naddLine(\"f1\",\"f2\",hexFrustum);addLine(\"f2\",\"f4\",hexFrustum);addLine(\"f4\",\"f3\",hexFrustum);addLine(\"f3\",\"f1\",hexFrustum);// sides\naddLine(\"n1\",\"f1\",hexFrustum);addLine(\"n2\",\"f2\",hexFrustum);addLine(\"n3\",\"f3\",hexFrustum);addLine(\"n4\",\"f4\",hexFrustum);// cone\naddLine(\"p\",\"n1\",hexCone);addLine(\"p\",\"n2\",hexCone);addLine(\"p\",\"n3\",hexCone);addLine(\"p\",\"n4\",hexCone);// up\naddLine(\"u1\",\"u2\",hexUp);addLine(\"u2\",\"u3\",hexUp);addLine(\"u3\",\"u1\",hexUp);// target\naddLine(\"c\",\"t\",hexTarget);addLine(\"p\",\"c\",hexCross);// cross\naddLine(\"cn1\",\"cn2\",hexCross);addLine(\"cn3\",\"cn4\",hexCross);addLine(\"cf1\",\"cf2\",hexCross);addLine(\"cf3\",\"cf4\",hexCross);function addLine(a,b,hex){addPoint(a,hex);addPoint(b,hex);}function addPoint(id,hex){geometry.vertices.push(new THREE.Vector3());geometry.colors.push(new THREE.Color(hex));if(pointMap[id]===undefined){pointMap[id]=[];}pointMap[id].push(geometry.vertices.length-1);}THREE.LineSegments.call(this,geometry,material);this.camera=camera;if(this.camera.updateProjectionMatrix)this.camera.updateProjectionMatrix();this.matrix=camera.matrixWorld;this.matrixAutoUpdate=false;this.pointMap=pointMap;this.update();};THREE.CameraHelper.prototype=Object.create(THREE.LineSegments.prototype);THREE.CameraHelper.prototype.constructor=THREE.CameraHelper;THREE.CameraHelper.prototype.update=function(){var geometry,pointMap;var vector=new THREE.Vector3();var camera=new THREE.Camera();function setPoint(point,x,y,z){vector.set(x,y,z).unproject(camera);var points=pointMap[point];if(points!==undefined){for(var i=0,il=points.length;i1){var name=chunks[1];if(!frameRanges[name])frameRanges[name]={start:Infinity,end:-Infinity};var range=frameRanges[name];if(irange.end)range.end=i;if(!firstAnimation)firstAnimation=name;}}for(var name in frameRanges){var range=frameRanges[name];this.createAnimation(name,range.start,range.end,fps);}this.firstAnimation=firstAnimation;};THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(name){var animation=this.animationsMap[name];if(animation){animation.direction=1;animation.directionBackwards=false;}};THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(name){var animation=this.animationsMap[name];if(animation){animation.direction=-1;animation.directionBackwards=true;}};THREE.MorphBlendMesh.prototype.setAnimationFPS=function(name,fps){var animation=this.animationsMap[name];if(animation){animation.fps=fps;animation.duration=(animation.end-animation.start)/animation.fps;}};THREE.MorphBlendMesh.prototype.setAnimationDuration=function(name,duration){var animation=this.animationsMap[name];if(animation){animation.duration=duration;animation.fps=(animation.end-animation.start)/animation.duration;}};THREE.MorphBlendMesh.prototype.setAnimationWeight=function(name,weight){var animation=this.animationsMap[name];if(animation){animation.weight=weight;}};THREE.MorphBlendMesh.prototype.setAnimationTime=function(name,time){var animation=this.animationsMap[name];if(animation){animation.time=time;}};THREE.MorphBlendMesh.prototype.getAnimationTime=function(name){var time=0;var animation=this.animationsMap[name];if(animation){time=animation.time;}return time;};THREE.MorphBlendMesh.prototype.getAnimationDuration=function(name){var duration=-1;var animation=this.animationsMap[name];if(animation){duration=animation.duration;}return duration;};THREE.MorphBlendMesh.prototype.playAnimation=function(name){var animation=this.animationsMap[name];if(animation){animation.time=0;animation.active=true;}else{console.warn(\"THREE.MorphBlendMesh: animation[\"+name+\"] undefined in .playAnimation()\");}};THREE.MorphBlendMesh.prototype.stopAnimation=function(name){var animation=this.animationsMap[name];if(animation){animation.active=false;}};THREE.MorphBlendMesh.prototype.update=function(delta){for(var i=0,il=this.animationsList.length;ianimation.duration||animation.time<0){animation.direction*=-1;if(animation.time>animation.duration){animation.time=animation.duration;animation.directionBackwards=true;}if(animation.time<0){animation.time=0;animation.directionBackwards=false;}}}else{animation.time=animation.time%animation.duration;if(animation.time<0)animation.time+=animation.duration;}var keyframe=animation.start+THREE.Math.clamp(Math.floor(animation.time/frameTime),0,animation.length-1);var weight=animation.weight;if(keyframe!==animation.currentFrame){this.morphTargetInfluences[animation.lastFrame]=0;this.morphTargetInfluences[animation.currentFrame]=1*weight;this.morphTargetInfluences[keyframe]=0;animation.lastFrame=animation.currentFrame;animation.currentFrame=keyframe;}var mix=animation.time%frameTime/frameTime;if(animation.directionBackwards)mix=1-mix;if(animation.currentFrame!==animation.lastFrame){this.morphTargetInfluences[animation.currentFrame]=mix*weight;this.morphTargetInfluences[animation.lastFrame]=(1-mix)*weight;}else{this.morphTargetInfluences[animation.currentFrame]=weight;}}};\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/three/build/three.js\n ** module id = 6\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/three/build/three.js?"); + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Renderer = function () {\n function Renderer(container, scene) {\n var _this = this;\n\n _classCallCheck(this, Renderer);\n\n this.container = container;\n this.scene = scene;\n\n this.threeRenderer = new _three2.default.WebGLRenderer({ antialias: true });\n\n //this.renderer.setClearColor(0x000000, 0);\n this.threeRenderer.setClearColor(scene.fog.color);\n this.threeRenderer.setPixelRatio(window.devicePixelRatio);\n\n container.appendChild(this.threeRenderer.domElement);\n\n this.threeRenderer.gammaInput = true;\n this.threeRenderer.gammaOutput = true;\n\n // shadow\n this.threeRenderer.shadowMap.enabled = true;\n this.threeRenderer.shadowMap.type = _three2.default.PCFSoftShadowMap;\n this.threeRenderer.shadowMapSoft = true;\n\n this.threeRenderer.autoClear = false;\n\n _config2.default.maxAnisotropy = this.threeRenderer.getMaxAnisotropy();\n\n this.updateSize();\n\n // Listeners\n document.addEventListener('DOMContentLoaded', function () {\n return _this.updateSize();\n }, false);\n window.addEventListener('resize', function () {\n return _this.updateSize();\n }, false);\n }\n\n _createClass(Renderer, [{\n key: 'updateSize',\n value: function updateSize() {\n this.threeRenderer.setSize(this.container.offsetWidth, this.container.offsetHeight);\n }\n }, {\n key: 'render',\n value: function render(scene, camera) {\n this.threeRenderer.render(scene, camera);\n }\n }]);\n\n return Renderer;\n}();\n\nexports.default = Renderer;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/renderer.js\n ** module id = 7\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/renderer.js?"); + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Camera = function () {\n function Camera(renderer) {\n var _this = this;\n\n _classCallCheck(this, Camera);\n\n var width = renderer.domElement.width;\n var height = renderer.domElement.height;\n\n this.threeCamera = new _three2.default.PerspectiveCamera(_config2.default.camera.fov, width / height, _config2.default.camera.near, _config2.default.camera.far);\n this.threeCamera.position.set(_config2.default.camera.posX, _config2.default.camera.posY, _config2.default.camera.posZ);\n\n this.updateSize(renderer);\n\n // listeners\n window.addEventListener('resize', function () {\n return _this.updateSize(renderer);\n }, false);\n }\n\n _createClass(Camera, [{\n key: 'updateSize',\n value: function updateSize(renderer) {\n this.threeCamera.aspect = renderer.domElement.width * _config2.default.dpr / (renderer.domElement.height * _config2.default.dpr);\n this.threeCamera.updateProjectionMatrix();\n }\n }]);\n\n return Camera;\n}();\n\nexports.default = Camera;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/camera.js\n ** module id = 8\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/camera.js?"); + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Light = function () {\n function Light(scene) {\n _classCallCheck(this, Light);\n\n this.scene = scene;\n\n this.init();\n }\n\n _createClass(Light, [{\n key: 'init',\n value: function init() {\n // ambient\n this.ambientLight = new _three2.default.AmbientLight(_config2.default.ambientLight.color);\n this.ambientLight.visible = _config2.default.ambientLight.enabled;\n\n // point light\n this.pointLight = new _three2.default.PointLight(_config2.default.pointLight.color, _config2.default.pointLight.intensity, _config2.default.pointLight.distance);\n this.pointLight.position.set(_config2.default.pointLight.x, _config2.default.pointLight.y, _config2.default.pointLight.z);\n this.pointLight.visible = _config2.default.pointLight.enabled;\n\n // directional light\n this.directionalLight = new _three2.default.DirectionalLight(_config2.default.directionalLight.color, _config2.default.directionalLight.intensity);\n this.directionalLight.position.set(_config2.default.directionalLight.x, _config2.default.directionalLight.y, _config2.default.directionalLight.z);\n this.directionalLight.visible = _config2.default.directionalLight.enabled;\n\n // shadow map\n this.directionalLight.castShadow = _config2.default.shadow.enabled;\n this.directionalLight.shadow.bias = _config2.default.shadow.bias;\n this.directionalLight.shadow.camera.near = _config2.default.shadow.near;\n this.directionalLight.shadow.camera.far = _config2.default.shadow.far;\n this.directionalLight.shadow.camera.left = _config2.default.shadow.left;\n this.directionalLight.shadow.camera.right = _config2.default.shadow.right;\n this.directionalLight.shadow.camera.top = _config2.default.shadow.top;\n this.directionalLight.shadow.camera.bottom = _config2.default.shadow.bottom;\n this.directionalLight.shadow.mapSize.width = _config2.default.shadow.mapWidth;\n this.directionalLight.shadow.mapSize.height = _config2.default.shadow.mapHeight;\n\n // shadow camera helper\n this.directionalLightHelper = new _three2.default.CameraHelper(this.directionalLight.shadow.camera);\n this.directionalLightHelper.visible = _config2.default.shadow.helperEnabled;\n\n // hemisphere light\n this.hemiLight = new _three2.default.HemisphereLight(_config2.default.hemiLight.color, _config2.default.hemiLight.groundColor, _config2.default.hemiLight.intensity);\n this.hemiLight.position.set(_config2.default.hemiLight.x, _config2.default.hemiLight.y, _config2.default.hemiLight.z);\n this.hemiLight.visible = _config2.default.hemiLight.enabled;\n }\n }, {\n key: 'place',\n value: function place(lightName) {\n switch (lightName) {\n case 'ambient':\n this.scene.add(this.ambientLight);\n break;\n\n case 'directional':\n this.scene.add(this.directionalLight);\n this.scene.add(this.directionalLightHelper);\n break;\n\n case 'point':\n this.scene.add(this.pointLight);\n break;\n\n case 'hemi':\n this.scene.add(this.hemiLight);\n break;\n }\n }\n }]);\n\n return Light;\n}();\n\nexports.default = Light;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/light.js\n ** module id = 9\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/light.js?"); + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nvar _orbitControls = __webpack_require__(11);\n\nvar _orbitControls2 = _interopRequireDefault(_orbitControls);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Controls = function () {\n function Controls(camera, container) {\n _classCallCheck(this, Controls);\n\n var orbitControls = new _orbitControls2.default(_three2.default);\n this.threeControls = new orbitControls(camera, container);\n\n this.init();\n }\n\n _createClass(Controls, [{\n key: 'init',\n value: function init() {\n this.threeControls.target.set(_config2.default.controls.target.x, _config2.default.controls.target.y, _config2.default.controls.target.z);\n this.threeControls.autoRotate = _config2.default.controls.autoRotate;\n this.threeControls.autoRotateSpeed = _config2.default.controls.autoRotateSpeed;\n this.threeControls.rotateSpeed = _config2.default.controls.rotateSpeed;\n this.threeControls.zoomSpeed = _config2.default.controls.zoomSpeed;\n this.threeControls.minDistance = _config2.default.controls.minDistance;\n this.threeControls.maxDistance = _config2.default.controls.maxDistance;\n this.threeControls.minPolarAngle = _config2.default.controls.minPolarAngle;\n this.threeControls.maxPolarAngle = _config2.default.controls.maxPolarAngle;\n this.threeControls.enableDamping = _config2.default.controls.enableDamping;\n this.threeControls.enableZoom = _config2.default.controls.enableZoom;\n this.threeControls.dampingFactor = _config2.default.controls.dampingFactor;\n }\n }]);\n\n return Controls;\n}();\n\nexports.default = Controls;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/controls.js\n ** module id = 10\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/controls.js?"); + +/***/ }, +/* 11 */ +/***/ function(module, exports) { + + eval("'use strict';\n\nmodule.exports = function (THREE) {\n var MOUSE = THREE.MOUSE;\n if (!MOUSE) MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };\n\n /**\n * @author qiao / https://github.com/qiao\n * @author mrdoob / http://mrdoob.com\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n * @author erich666 / http://erichaines.com\n */\n /*global THREE, console */\n\n function OrbitConstraint(object) {\n\n this.object = object;\n\n // \"target\" sets the location of focus, where the object orbits around\n // and where it pans with respect to.\n this.target = new THREE.Vector3();\n\n // Limits to how far you can dolly in and out ( PerspectiveCamera only )\n this.minDistance = 0;\n this.maxDistance = Infinity;\n\n // Limits to how far you can zoom in and out ( OrthographicCamera only )\n this.minZoom = 0;\n this.maxZoom = Infinity;\n\n // How far you can orbit vertically, upper and lower limits.\n // Range is 0 to Math.PI radians.\n this.minPolarAngle = 0; // radians\n this.maxPolarAngle = Math.PI; // radians\n\n // How far you can orbit horizontally, upper and lower limits.\n // If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].\n this.minAzimuthAngle = -Infinity; // radians\n this.maxAzimuthAngle = Infinity; // radians\n\n // Set to true to enable damping (inertia)\n // If damping is enabled, you must call controls.update() in your animation loop\n this.enableDamping = false;\n this.dampingFactor = 0.25;\n\n ////////////\n // internals\n\n var scope = this;\n\n var EPS = 0.000001;\n\n // Current position in spherical coordinate system.\n var theta;\n var phi;\n\n // Pending changes\n var phiDelta = 0;\n var thetaDelta = 0;\n var scale = 1;\n var panOffset = new THREE.Vector3();\n var zoomChanged = false;\n\n // API\n\n this.getPolarAngle = function () {\n\n return phi;\n };\n\n this.getAzimuthalAngle = function () {\n\n return theta;\n };\n\n this.rotateLeft = function (angle) {\n\n thetaDelta -= angle;\n };\n\n this.rotateUp = function (angle) {\n\n phiDelta -= angle;\n };\n\n // pass in distance in world space to move left\n this.panLeft = function () {\n\n var v = new THREE.Vector3();\n\n return function panLeft(distance) {\n\n var te = this.object.matrix.elements;\n\n // get X column of matrix\n v.set(te[0], te[1], te[2]);\n v.multiplyScalar(-distance);\n\n panOffset.add(v);\n };\n }();\n\n // pass in distance in world space to move up\n this.panUp = function () {\n\n var v = new THREE.Vector3();\n\n return function panUp(distance) {\n\n var te = this.object.matrix.elements;\n\n // get Y column of matrix\n v.set(te[4], te[5], te[6]);\n v.multiplyScalar(distance);\n\n panOffset.add(v);\n };\n }();\n\n // pass in x,y of change desired in pixel space,\n // right and down are positive\n this.pan = function (deltaX, deltaY, screenWidth, screenHeight) {\n\n if (scope.object instanceof THREE.PerspectiveCamera) {\n\n // perspective\n var position = scope.object.position;\n var offset = position.clone().sub(scope.target);\n var targetDistance = offset.length();\n\n // half of the fov is center to top of screen\n targetDistance *= Math.tan(scope.object.fov / 2 * Math.PI / 180.0);\n\n // we actually don't use screenWidth, since perspective camera is fixed to screen height\n scope.panLeft(2 * deltaX * targetDistance / screenHeight);\n scope.panUp(2 * deltaY * targetDistance / screenHeight);\n } else if (scope.object instanceof THREE.OrthographicCamera) {\n\n // orthographic\n scope.panLeft(deltaX * (scope.object.right - scope.object.left) / screenWidth);\n scope.panUp(deltaY * (scope.object.top - scope.object.bottom) / screenHeight);\n } else {\n\n // camera neither orthographic or perspective\n console.warn('WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.');\n }\n };\n\n this.dollyIn = function (dollyScale) {\n\n if (scope.object instanceof THREE.PerspectiveCamera) {\n\n scale /= dollyScale;\n } else if (scope.object instanceof THREE.OrthographicCamera) {\n\n scope.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom * dollyScale));\n scope.object.updateProjectionMatrix();\n zoomChanged = true;\n } else {\n\n console.warn('WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.');\n }\n };\n\n this.dollyOut = function (dollyScale) {\n\n if (scope.object instanceof THREE.PerspectiveCamera) {\n\n scale *= dollyScale;\n } else if (scope.object instanceof THREE.OrthographicCamera) {\n\n scope.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / dollyScale));\n scope.object.updateProjectionMatrix();\n zoomChanged = true;\n } else {\n\n console.warn('WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.');\n }\n };\n\n this.update = function () {\n\n var offset = new THREE.Vector3();\n\n // so camera.up is the orbit axis\n var quat = new THREE.Quaternion().setFromUnitVectors(object.up, new THREE.Vector3(0, 1, 0));\n var quatInverse = quat.clone().inverse();\n\n var lastPosition = new THREE.Vector3();\n var lastQuaternion = new THREE.Quaternion();\n\n return function () {\n\n var position = this.object.position;\n\n offset.copy(position).sub(this.target);\n\n // rotate offset to \"y-axis-is-up\" space\n offset.applyQuaternion(quat);\n\n // angle from z-axis around y-axis\n\n theta = Math.atan2(offset.x, offset.z);\n\n // angle from y-axis\n\n phi = Math.atan2(Math.sqrt(offset.x * offset.x + offset.z * offset.z), offset.y);\n\n theta += thetaDelta;\n phi += phiDelta;\n\n // restrict theta to be between desired limits\n theta = Math.max(this.minAzimuthAngle, Math.min(this.maxAzimuthAngle, theta));\n\n // restrict phi to be between desired limits\n phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, phi));\n\n // restrict phi to be betwee EPS and PI-EPS\n phi = Math.max(EPS, Math.min(Math.PI - EPS, phi));\n\n var radius = offset.length() * scale;\n\n // restrict radius to be between desired limits\n radius = Math.max(this.minDistance, Math.min(this.maxDistance, radius));\n\n // move target to panned location\n this.target.add(panOffset);\n\n offset.x = radius * Math.sin(phi) * Math.sin(theta);\n offset.y = radius * Math.cos(phi);\n offset.z = radius * Math.sin(phi) * Math.cos(theta);\n\n // rotate offset back to \"camera-up-vector-is-up\" space\n offset.applyQuaternion(quatInverse);\n\n position.copy(this.target).add(offset);\n\n this.object.lookAt(this.target);\n\n if (this.enableDamping === true) {\n\n thetaDelta *= 1 - this.dampingFactor;\n phiDelta *= 1 - this.dampingFactor;\n } else {\n\n thetaDelta = 0;\n phiDelta = 0;\n }\n\n scale = 1;\n panOffset.set(0, 0, 0);\n\n // update condition is:\n // min(camera displacement, camera rotation in radians)^2 > EPS\n // using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n if (zoomChanged || lastPosition.distanceToSquared(this.object.position) > EPS || 8 * (1 - lastQuaternion.dot(this.object.quaternion)) > EPS) {\n\n lastPosition.copy(this.object.position);\n lastQuaternion.copy(this.object.quaternion);\n zoomChanged = false;\n\n return true;\n }\n\n return false;\n };\n }();\n };\n\n // This set of controls performs orbiting, dollying (zooming), and panning. It maintains\n // the \"up\" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is\n // supported.\n //\n // Orbit - left mouse / touch: one finger move\n // Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n // Pan - right mouse, or arrow keys / touch: three finter swipe\n\n function OrbitControls(object, domElement) {\n\n var constraint = new OrbitConstraint(object);\n\n this.domElement = domElement !== undefined ? domElement : document;\n\n // API\n\n Object.defineProperty(this, 'constraint', {\n\n get: function get() {\n\n return constraint;\n }\n\n });\n\n this.getPolarAngle = function () {\n\n return constraint.getPolarAngle();\n };\n\n this.getAzimuthalAngle = function () {\n\n return constraint.getAzimuthalAngle();\n };\n\n // Set to false to disable this control\n this.enabled = true;\n\n // center is old, deprecated; use \"target\" instead\n this.center = this.target;\n\n // This option actually enables dollying in and out; left as \"zoom\" for\n // backwards compatibility.\n // Set to false to disable zooming\n this.enableZoom = true;\n this.zoomSpeed = 1.0;\n\n // Set to false to disable rotating\n this.enableRotate = true;\n this.rotateSpeed = 1.0;\n\n // Set to false to disable panning\n this.enablePan = true;\n this.keyPanSpeed = 7.0; // pixels moved per arrow key push\n\n // Set to true to automatically rotate around the target\n // If auto-rotate is enabled, you must call controls.update() in your animation loop\n this.autoRotate = false;\n this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\n // Set to false to disable use of the keys\n this.enableKeys = true;\n\n // The four arrow keys\n this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\n // Mouse buttons\n this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };\n\n ////////////\n // internals\n\n var scope = this;\n\n var rotateStart = new THREE.Vector2();\n var rotateEnd = new THREE.Vector2();\n var rotateDelta = new THREE.Vector2();\n\n var panStart = new THREE.Vector2();\n var panEnd = new THREE.Vector2();\n var panDelta = new THREE.Vector2();\n\n var dollyStart = new THREE.Vector2();\n var dollyEnd = new THREE.Vector2();\n var dollyDelta = new THREE.Vector2();\n\n var STATE = { NONE: -1, ROTATE: 0, DOLLY: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_DOLLY: 4, TOUCH_PAN: 5 };\n\n var state = STATE.NONE;\n\n // for reset\n\n this.target0 = this.target.clone();\n this.position0 = this.object.position.clone();\n this.zoom0 = this.object.zoom;\n\n // events\n\n var changeEvent = { type: 'change' };\n var startEvent = { type: 'start' };\n var endEvent = { type: 'end' };\n\n // pass in x,y of change desired in pixel space,\n // right and down are positive\n function pan(deltaX, deltaY) {\n\n var element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n constraint.pan(deltaX, deltaY, element.clientWidth, element.clientHeight);\n }\n\n this.update = function () {\n\n if (this.autoRotate && state === STATE.NONE) {\n\n constraint.rotateLeft(getAutoRotationAngle());\n }\n\n if (constraint.update() === true) {\n\n this.dispatchEvent(changeEvent);\n }\n };\n\n this.reset = function () {\n\n state = STATE.NONE;\n\n this.target.copy(this.target0);\n this.object.position.copy(this.position0);\n this.object.zoom = this.zoom0;\n\n this.object.updateProjectionMatrix();\n this.dispatchEvent(changeEvent);\n\n this.update();\n };\n\n function getAutoRotationAngle() {\n\n return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n }\n\n function getZoomScale() {\n\n return Math.pow(0.95, scope.zoomSpeed);\n }\n\n function onMouseDown(event) {\n\n if (scope.enabled === false) return;\n\n event.preventDefault();\n\n if (event.button === scope.mouseButtons.ORBIT) {\n\n if (scope.enableRotate === false) return;\n\n state = STATE.ROTATE;\n\n rotateStart.set(event.clientX, event.clientY);\n } else if (event.button === scope.mouseButtons.ZOOM) {\n\n if (scope.enableZoom === false) return;\n\n state = STATE.DOLLY;\n\n dollyStart.set(event.clientX, event.clientY);\n } else if (event.button === scope.mouseButtons.PAN) {\n\n if (scope.enablePan === false) return;\n\n state = STATE.PAN;\n\n panStart.set(event.clientX, event.clientY);\n }\n\n if (state !== STATE.NONE) {\n\n document.addEventListener('mousemove', onMouseMove, false);\n document.addEventListener('mouseup', onMouseUp, false);\n scope.dispatchEvent(startEvent);\n }\n }\n\n function onMouseMove(event) {\n\n if (scope.enabled === false) return;\n\n event.preventDefault();\n\n var element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n if (state === STATE.ROTATE) {\n\n if (scope.enableRotate === false) return;\n\n rotateEnd.set(event.clientX, event.clientY);\n rotateDelta.subVectors(rotateEnd, rotateStart);\n\n // rotating across whole screen goes 360 degrees around\n constraint.rotateLeft(2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed);\n\n // rotating up and down along whole screen attempts to go 360, but limited to 180\n constraint.rotateUp(2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed);\n\n rotateStart.copy(rotateEnd);\n } else if (state === STATE.DOLLY) {\n\n if (scope.enableZoom === false) return;\n\n dollyEnd.set(event.clientX, event.clientY);\n dollyDelta.subVectors(dollyEnd, dollyStart);\n\n if (dollyDelta.y > 0) {\n\n constraint.dollyIn(getZoomScale());\n } else if (dollyDelta.y < 0) {\n\n constraint.dollyOut(getZoomScale());\n }\n\n dollyStart.copy(dollyEnd);\n } else if (state === STATE.PAN) {\n\n if (scope.enablePan === false) return;\n\n panEnd.set(event.clientX, event.clientY);\n panDelta.subVectors(panEnd, panStart);\n\n pan(panDelta.x, panDelta.y);\n\n panStart.copy(panEnd);\n }\n\n if (state !== STATE.NONE) scope.update();\n }\n\n function onMouseUp() /* event */{\n\n if (scope.enabled === false) return;\n\n document.removeEventListener('mousemove', onMouseMove, false);\n document.removeEventListener('mouseup', onMouseUp, false);\n scope.dispatchEvent(endEvent);\n state = STATE.NONE;\n }\n\n function onMouseWheel(event) {\n\n if (scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n var delta = 0;\n\n if (event.wheelDelta !== undefined) {\n\n // WebKit / Opera / Explorer 9\n\n delta = event.wheelDelta;\n } else if (event.detail !== undefined) {\n\n // Firefox\n\n delta = -event.detail;\n }\n\n if (delta > 0) {\n\n constraint.dollyOut(getZoomScale());\n } else if (delta < 0) {\n\n constraint.dollyIn(getZoomScale());\n }\n\n scope.update();\n scope.dispatchEvent(startEvent);\n scope.dispatchEvent(endEvent);\n }\n\n function onKeyDown(event) {\n\n if (scope.enabled === false || scope.enableKeys === false || scope.enablePan === false) return;\n\n switch (event.keyCode) {\n\n case scope.keys.UP:\n pan(0, scope.keyPanSpeed);\n scope.update();\n break;\n\n case scope.keys.BOTTOM:\n pan(0, -scope.keyPanSpeed);\n scope.update();\n break;\n\n case scope.keys.LEFT:\n pan(scope.keyPanSpeed, 0);\n scope.update();\n break;\n\n case scope.keys.RIGHT:\n pan(-scope.keyPanSpeed, 0);\n scope.update();\n break;\n\n }\n }\n\n function touchstart(event) {\n\n if (scope.enabled === false) return;\n\n switch (event.touches.length) {\n\n case 1:\n // one-fingered touch: rotate\n\n if (scope.enableRotate === false) return;\n\n state = STATE.TOUCH_ROTATE;\n\n rotateStart.set(event.touches[0].pageX, event.touches[0].pageY);\n break;\n\n case 2:\n // two-fingered touch: dolly\n\n if (scope.enableZoom === false) return;\n\n state = STATE.TOUCH_DOLLY;\n\n var dx = event.touches[0].pageX - event.touches[1].pageX;\n var dy = event.touches[0].pageY - event.touches[1].pageY;\n var distance = Math.sqrt(dx * dx + dy * dy);\n dollyStart.set(0, distance);\n break;\n\n case 3:\n // three-fingered touch: pan\n\n if (scope.enablePan === false) return;\n\n state = STATE.TOUCH_PAN;\n\n panStart.set(event.touches[0].pageX, event.touches[0].pageY);\n break;\n\n default:\n\n state = STATE.NONE;\n\n }\n\n if (state !== STATE.NONE) scope.dispatchEvent(startEvent);\n }\n\n function touchmove(event) {\n\n if (scope.enabled === false) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n var element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n switch (event.touches.length) {\n\n case 1:\n // one-fingered touch: rotate\n\n if (scope.enableRotate === false) return;\n if (state !== STATE.TOUCH_ROTATE) return;\n\n rotateEnd.set(event.touches[0].pageX, event.touches[0].pageY);\n rotateDelta.subVectors(rotateEnd, rotateStart);\n\n // rotating across whole screen goes 360 degrees around\n constraint.rotateLeft(2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed);\n // rotating up and down along whole screen attempts to go 360, but limited to 180\n constraint.rotateUp(2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed);\n\n rotateStart.copy(rotateEnd);\n\n scope.update();\n break;\n\n case 2:\n // two-fingered touch: dolly\n\n if (scope.enableZoom === false) return;\n if (state !== STATE.TOUCH_DOLLY) return;\n\n var dx = event.touches[0].pageX - event.touches[1].pageX;\n var dy = event.touches[0].pageY - event.touches[1].pageY;\n var distance = Math.sqrt(dx * dx + dy * dy);\n\n dollyEnd.set(0, distance);\n dollyDelta.subVectors(dollyEnd, dollyStart);\n\n if (dollyDelta.y > 0) {\n\n constraint.dollyOut(getZoomScale());\n } else if (dollyDelta.y < 0) {\n\n constraint.dollyIn(getZoomScale());\n }\n\n dollyStart.copy(dollyEnd);\n\n scope.update();\n break;\n\n case 3:\n // three-fingered touch: pan\n\n if (scope.enablePan === false) return;\n if (state !== STATE.TOUCH_PAN) return;\n\n panEnd.set(event.touches[0].pageX, event.touches[0].pageY);\n panDelta.subVectors(panEnd, panStart);\n\n pan(panDelta.x, panDelta.y);\n\n panStart.copy(panEnd);\n\n scope.update();\n break;\n\n default:\n\n state = STATE.NONE;\n\n }\n }\n\n function touchend() /* event */{\n\n if (scope.enabled === false) return;\n\n scope.dispatchEvent(endEvent);\n state = STATE.NONE;\n }\n\n function contextmenu(event) {\n\n event.preventDefault();\n }\n\n this.dispose = function () {\n\n this.domElement.removeEventListener('contextmenu', contextmenu, false);\n this.domElement.removeEventListener('mousedown', onMouseDown, false);\n this.domElement.removeEventListener('mousewheel', onMouseWheel, false);\n this.domElement.removeEventListener('MozMousePixelScroll', onMouseWheel, false); // firefox\n\n this.domElement.removeEventListener('touchstart', touchstart, false);\n this.domElement.removeEventListener('touchend', touchend, false);\n this.domElement.removeEventListener('touchmove', touchmove, false);\n\n document.removeEventListener('mousemove', onMouseMove, false);\n document.removeEventListener('mouseup', onMouseUp, false);\n\n window.removeEventListener('keydown', onKeyDown, false);\n };\n\n this.domElement.addEventListener('contextmenu', contextmenu, false);\n\n this.domElement.addEventListener('mousedown', onMouseDown, false);\n this.domElement.addEventListener('mousewheel', onMouseWheel, false);\n this.domElement.addEventListener('MozMousePixelScroll', onMouseWheel, false); // firefox\n\n this.domElement.addEventListener('touchstart', touchstart, false);\n this.domElement.addEventListener('touchend', touchend, false);\n this.domElement.addEventListener('touchmove', touchmove, false);\n\n window.addEventListener('keydown', onKeyDown, false);\n\n // force an update at start\n this.update();\n };\n\n OrbitControls.prototype = Object.create(THREE.EventDispatcher.prototype);\n OrbitControls.prototype.constructor = OrbitControls;\n\n Object.defineProperties(OrbitControls.prototype, {\n\n object: {\n\n get: function get() {\n\n return this.constraint.object;\n }\n\n },\n\n target: {\n\n get: function get() {\n\n return this.constraint.target;\n },\n\n set: function set(value) {\n\n console.warn('THREE.OrbitControls: target is now immutable. Use target.set() instead.');\n this.constraint.target.copy(value);\n }\n\n },\n\n minDistance: {\n\n get: function get() {\n\n return this.constraint.minDistance;\n },\n\n set: function set(value) {\n\n this.constraint.minDistance = value;\n }\n\n },\n\n maxDistance: {\n\n get: function get() {\n\n return this.constraint.maxDistance;\n },\n\n set: function set(value) {\n\n this.constraint.maxDistance = value;\n }\n\n },\n\n minZoom: {\n\n get: function get() {\n\n return this.constraint.minZoom;\n },\n\n set: function set(value) {\n\n this.constraint.minZoom = value;\n }\n\n },\n\n maxZoom: {\n\n get: function get() {\n\n return this.constraint.maxZoom;\n },\n\n set: function set(value) {\n\n this.constraint.maxZoom = value;\n }\n\n },\n\n minPolarAngle: {\n\n get: function get() {\n\n return this.constraint.minPolarAngle;\n },\n\n set: function set(value) {\n\n this.constraint.minPolarAngle = value;\n }\n\n },\n\n maxPolarAngle: {\n\n get: function get() {\n\n return this.constraint.maxPolarAngle;\n },\n\n set: function set(value) {\n\n this.constraint.maxPolarAngle = value;\n }\n\n },\n\n minAzimuthAngle: {\n\n get: function get() {\n\n return this.constraint.minAzimuthAngle;\n },\n\n set: function set(value) {\n\n this.constraint.minAzimuthAngle = value;\n }\n\n },\n\n maxAzimuthAngle: {\n\n get: function get() {\n\n return this.constraint.maxAzimuthAngle;\n },\n\n set: function set(value) {\n\n this.constraint.maxAzimuthAngle = value;\n }\n\n },\n\n enableDamping: {\n\n get: function get() {\n\n return this.constraint.enableDamping;\n },\n\n set: function set(value) {\n\n this.constraint.enableDamping = value;\n }\n\n },\n\n dampingFactor: {\n\n get: function get() {\n\n return this.constraint.dampingFactor;\n },\n\n set: function set(value) {\n\n this.constraint.dampingFactor = value;\n }\n\n },\n\n // backward compatibility\n\n noZoom: {\n\n get: function get() {\n\n console.warn('THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.');\n return !this.enableZoom;\n },\n\n set: function set(value) {\n\n console.warn('THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.');\n this.enableZoom = !value;\n }\n\n },\n\n noRotate: {\n\n get: function get() {\n\n console.warn('THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.');\n return !this.enableRotate;\n },\n\n set: function set(value) {\n\n console.warn('THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.');\n this.enableRotate = !value;\n }\n\n },\n\n noPan: {\n\n get: function get() {\n\n console.warn('THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.');\n return !this.enablePan;\n },\n\n set: function set(value) {\n\n console.warn('THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.');\n this.enablePan = !value;\n }\n\n },\n\n noKeys: {\n\n get: function get() {\n\n console.warn('THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.');\n return !this.enableKeys;\n },\n\n set: function set(value) {\n\n console.warn('THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.');\n this.enableKeys = !value;\n }\n\n },\n\n staticMoving: {\n\n get: function get() {\n\n console.warn('THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.');\n return !this.constraint.enableDamping;\n },\n\n set: function set(value) {\n\n console.warn('THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.');\n this.constraint.enableDamping = !value;\n }\n\n },\n\n dynamicDampingFactor: {\n\n get: function get() {\n\n console.warn('THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.');\n return this.constraint.dampingFactor;\n },\n\n set: function set(value) {\n\n console.warn('THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.');\n this.constraint.dampingFactor = value;\n }\n\n }\n\n });\n\n return OrbitControls;\n};\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/utils/orbitControls.js\n ** module id = 11\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/utils/orbitControls.js?"); + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Geometry = function () {\n function Geometry(scene) {\n _classCallCheck(this, Geometry);\n\n this.scene = scene;\n this.geo = null;\n }\n\n _createClass(Geometry, [{\n key: 'make',\n value: function make(type) {\n var _this = this;\n\n if (type == 'plane') {\n return function (width, height) {\n var widthSegments = arguments.length <= 2 || arguments[2] === undefined ? 1 : arguments[2];\n var heightSegments = arguments.length <= 3 || arguments[3] === undefined ? 1 : arguments[3];\n\n _this.geo = new _three2.default.PlaneGeometry(width, height, widthSegments, heightSegments);\n };\n }\n }\n }, {\n key: 'place',\n value: function place(position, rotation) {\n var _mesh$position, _mesh$rotation;\n\n var material = new _three2.default.MeshStandardMaterial({ color: 0xCCCCCC, side: _three2.default.DoubleSide });\n var mesh = new _three2.default.Mesh(this.geo, material);\n\n (_mesh$position = mesh.position).set.apply(_mesh$position, _toConsumableArray(position));\n (_mesh$rotation = mesh.rotation).set.apply(_mesh$rotation, _toConsumableArray(rotation));\n\n if (_config2.default.shadow.enabled) {\n mesh.receiveShadow = true;\n mesh.castShadow = true;\n }\n\n this.scene.add(mesh);\n }\n }]);\n\n return Geometry;\n}();\n\nexports.default = Geometry;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/geometry.js\n ** module id = 12\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/geometry.js?"); + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nvar _es6Promise = __webpack_require__(14);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Texture = function () {\n function Texture() {\n _classCallCheck(this, Texture);\n\n this.textures = {};\n }\n\n _createClass(Texture, [{\n key: 'load',\n value: function load() {\n var _this = this;\n\n var loader = new _three2.default.TextureLoader();\n var maxAnisotropy = _config2.default.maxAnisotropy;\n var imageFiles = _config2.default.texture.imageFiles;\n\n var promiseArray = [];\n\n loader.setPath(_config2.default.texture.path);\n\n imageFiles.forEach(function (imageFile) {\n promiseArray.push(new _es6Promise.Promise(function (resolve, reject) {\n loader.load(imageFile.image, function (texture) {\n texture.anisotropy = maxAnisotropy;\n\n var modelOBJ = {};\n modelOBJ[imageFile.name] = texture;\n if (modelOBJ[imageFile.name] instanceof _three2.default.Texture) resolve(modelOBJ);\n }, function (xhr) {\n console.log(xhr.loaded / xhr.total * 100 + '% loaded');\n }, function (xhr) {\n reject(new Error(xhr + 'An error occurred loading while loading ' + imageFile.image));\n });\n }));\n });\n\n return _es6Promise.Promise.all(promiseArray).then(function (textures) {\n for (var i = 0; i < textures.length; i++) {\n _this.textures[Object.keys(textures[i])[0]] = textures[i][Object.keys(textures[i])[0]];\n }\n });\n }\n }]);\n\n return Texture;\n}();\n\nexports.default = Texture;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/texture.js\n ** module id = 13\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/texture.js?"); + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + eval("var __WEBPACK_AMD_DEFINE_RESULT__;var require;/* WEBPACK VAR INJECTION */(function(process, global, module) {'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license Licensed under MIT license\n * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE\n * @version 3.2.1\n */\n\n(function () {\n \"use strict\";\n\n function lib$es6$promise$utils$$objectOrFunction(x) {\n return typeof x === 'function' || (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null;\n }\n\n function lib$es6$promise$utils$$isFunction(x) {\n return typeof x === 'function';\n }\n\n function lib$es6$promise$utils$$isMaybeThenable(x) {\n return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null;\n }\n\n var lib$es6$promise$utils$$_isArray;\n if (!Array.isArray) {\n lib$es6$promise$utils$$_isArray = function lib$es6$promise$utils$$_isArray(x) {\n return Object.prototype.toString.call(x) === '[object Array]';\n };\n } else {\n lib$es6$promise$utils$$_isArray = Array.isArray;\n }\n\n var lib$es6$promise$utils$$isArray = lib$es6$promise$utils$$_isArray;\n var lib$es6$promise$asap$$len = 0;\n var lib$es6$promise$asap$$vertxNext;\n var lib$es6$promise$asap$$customSchedulerFn;\n\n var lib$es6$promise$asap$$asap = function asap(callback, arg) {\n lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len] = callback;\n lib$es6$promise$asap$$queue[lib$es6$promise$asap$$len + 1] = arg;\n lib$es6$promise$asap$$len += 2;\n if (lib$es6$promise$asap$$len === 2) {\n // If len is 2, that means that we need to schedule an async flush.\n // If additional callbacks are queued before the queue is flushed, they\n // will be processed by this flush that we are scheduling.\n if (lib$es6$promise$asap$$customSchedulerFn) {\n lib$es6$promise$asap$$customSchedulerFn(lib$es6$promise$asap$$flush);\n } else {\n lib$es6$promise$asap$$scheduleFlush();\n }\n }\n };\n\n function lib$es6$promise$asap$$setScheduler(scheduleFn) {\n lib$es6$promise$asap$$customSchedulerFn = scheduleFn;\n }\n\n function lib$es6$promise$asap$$setAsap(asapFn) {\n lib$es6$promise$asap$$asap = asapFn;\n }\n\n var lib$es6$promise$asap$$browserWindow = typeof window !== 'undefined' ? window : undefined;\n var lib$es6$promise$asap$$browserGlobal = lib$es6$promise$asap$$browserWindow || {};\n var lib$es6$promise$asap$$BrowserMutationObserver = lib$es6$promise$asap$$browserGlobal.MutationObserver || lib$es6$promise$asap$$browserGlobal.WebKitMutationObserver;\n var lib$es6$promise$asap$$isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';\n\n // test for web worker but not in IE10\n var lib$es6$promise$asap$$isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n // node\n function lib$es6$promise$asap$$useNextTick() {\n // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n // see https://github.com/cujojs/when/issues/410 for details\n return function () {\n process.nextTick(lib$es6$promise$asap$$flush);\n };\n }\n\n // vertx\n function lib$es6$promise$asap$$useVertxTimer() {\n return function () {\n lib$es6$promise$asap$$vertxNext(lib$es6$promise$asap$$flush);\n };\n }\n\n function lib$es6$promise$asap$$useMutationObserver() {\n var iterations = 0;\n var observer = new lib$es6$promise$asap$$BrowserMutationObserver(lib$es6$promise$asap$$flush);\n var node = document.createTextNode('');\n observer.observe(node, { characterData: true });\n\n return function () {\n node.data = iterations = ++iterations % 2;\n };\n }\n\n // web worker\n function lib$es6$promise$asap$$useMessageChannel() {\n var channel = new MessageChannel();\n channel.port1.onmessage = lib$es6$promise$asap$$flush;\n return function () {\n channel.port2.postMessage(0);\n };\n }\n\n function lib$es6$promise$asap$$useSetTimeout() {\n return function () {\n setTimeout(lib$es6$promise$asap$$flush, 1);\n };\n }\n\n var lib$es6$promise$asap$$queue = new Array(1000);\n function lib$es6$promise$asap$$flush() {\n for (var i = 0; i < lib$es6$promise$asap$$len; i += 2) {\n var callback = lib$es6$promise$asap$$queue[i];\n var arg = lib$es6$promise$asap$$queue[i + 1];\n\n callback(arg);\n\n lib$es6$promise$asap$$queue[i] = undefined;\n lib$es6$promise$asap$$queue[i + 1] = undefined;\n }\n\n lib$es6$promise$asap$$len = 0;\n }\n\n function lib$es6$promise$asap$$attemptVertx() {\n try {\n var r = require;\n var vertx = __webpack_require__(17);\n lib$es6$promise$asap$$vertxNext = vertx.runOnLoop || vertx.runOnContext;\n return lib$es6$promise$asap$$useVertxTimer();\n } catch (e) {\n return lib$es6$promise$asap$$useSetTimeout();\n }\n }\n\n var lib$es6$promise$asap$$scheduleFlush;\n // Decide what async method to use to triggering processing of queued callbacks:\n if (lib$es6$promise$asap$$isNode) {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useNextTick();\n } else if (lib$es6$promise$asap$$BrowserMutationObserver) {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMutationObserver();\n } else if (lib$es6$promise$asap$$isWorker) {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useMessageChannel();\n } else if (lib$es6$promise$asap$$browserWindow === undefined && \"function\" === 'function') {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$attemptVertx();\n } else {\n lib$es6$promise$asap$$scheduleFlush = lib$es6$promise$asap$$useSetTimeout();\n }\n function lib$es6$promise$then$$then(onFulfillment, onRejection) {\n var parent = this;\n\n var child = new this.constructor(lib$es6$promise$$internal$$noop);\n\n if (child[lib$es6$promise$$internal$$PROMISE_ID] === undefined) {\n lib$es6$promise$$internal$$makePromise(child);\n }\n\n var state = parent._state;\n\n if (state) {\n var callback = arguments[state - 1];\n lib$es6$promise$asap$$asap(function () {\n lib$es6$promise$$internal$$invokeCallback(state, child, callback, parent._result);\n });\n } else {\n lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection);\n }\n\n return child;\n }\n var lib$es6$promise$then$$default = lib$es6$promise$then$$then;\n function lib$es6$promise$promise$resolve$$resolve(object) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (object && (typeof object === 'undefined' ? 'undefined' : _typeof(object)) === 'object' && object.constructor === Constructor) {\n return object;\n }\n\n var promise = new Constructor(lib$es6$promise$$internal$$noop);\n lib$es6$promise$$internal$$resolve(promise, object);\n return promise;\n }\n var lib$es6$promise$promise$resolve$$default = lib$es6$promise$promise$resolve$$resolve;\n var lib$es6$promise$$internal$$PROMISE_ID = Math.random().toString(36).substring(16);\n\n function lib$es6$promise$$internal$$noop() {}\n\n var lib$es6$promise$$internal$$PENDING = void 0;\n var lib$es6$promise$$internal$$FULFILLED = 1;\n var lib$es6$promise$$internal$$REJECTED = 2;\n\n var lib$es6$promise$$internal$$GET_THEN_ERROR = new lib$es6$promise$$internal$$ErrorObject();\n\n function lib$es6$promise$$internal$$selfFulfillment() {\n return new TypeError(\"You cannot resolve a promise with itself\");\n }\n\n function lib$es6$promise$$internal$$cannotReturnOwn() {\n return new TypeError('A promises callback cannot return that same promise.');\n }\n\n function lib$es6$promise$$internal$$getThen(promise) {\n try {\n return promise.then;\n } catch (error) {\n lib$es6$promise$$internal$$GET_THEN_ERROR.error = error;\n return lib$es6$promise$$internal$$GET_THEN_ERROR;\n }\n }\n\n function lib$es6$promise$$internal$$tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n try {\n then.call(value, fulfillmentHandler, rejectionHandler);\n } catch (e) {\n return e;\n }\n }\n\n function lib$es6$promise$$internal$$handleForeignThenable(promise, thenable, then) {\n lib$es6$promise$asap$$asap(function (promise) {\n var sealed = false;\n var error = lib$es6$promise$$internal$$tryThen(then, thenable, function (value) {\n if (sealed) {\n return;\n }\n sealed = true;\n if (thenable !== value) {\n lib$es6$promise$$internal$$resolve(promise, value);\n } else {\n lib$es6$promise$$internal$$fulfill(promise, value);\n }\n }, function (reason) {\n if (sealed) {\n return;\n }\n sealed = true;\n\n lib$es6$promise$$internal$$reject(promise, reason);\n }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n if (!sealed && error) {\n sealed = true;\n lib$es6$promise$$internal$$reject(promise, error);\n }\n }, promise);\n }\n\n function lib$es6$promise$$internal$$handleOwnThenable(promise, thenable) {\n if (thenable._state === lib$es6$promise$$internal$$FULFILLED) {\n lib$es6$promise$$internal$$fulfill(promise, thenable._result);\n } else if (thenable._state === lib$es6$promise$$internal$$REJECTED) {\n lib$es6$promise$$internal$$reject(promise, thenable._result);\n } else {\n lib$es6$promise$$internal$$subscribe(thenable, undefined, function (value) {\n lib$es6$promise$$internal$$resolve(promise, value);\n }, function (reason) {\n lib$es6$promise$$internal$$reject(promise, reason);\n });\n }\n }\n\n function lib$es6$promise$$internal$$handleMaybeThenable(promise, maybeThenable, then) {\n if (maybeThenable.constructor === promise.constructor && then === lib$es6$promise$then$$default && constructor.resolve === lib$es6$promise$promise$resolve$$default) {\n lib$es6$promise$$internal$$handleOwnThenable(promise, maybeThenable);\n } else {\n if (then === lib$es6$promise$$internal$$GET_THEN_ERROR) {\n lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$GET_THEN_ERROR.error);\n } else if (then === undefined) {\n lib$es6$promise$$internal$$fulfill(promise, maybeThenable);\n } else if (lib$es6$promise$utils$$isFunction(then)) {\n lib$es6$promise$$internal$$handleForeignThenable(promise, maybeThenable, then);\n } else {\n lib$es6$promise$$internal$$fulfill(promise, maybeThenable);\n }\n }\n }\n\n function lib$es6$promise$$internal$$resolve(promise, value) {\n if (promise === value) {\n lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$selfFulfillment());\n } else if (lib$es6$promise$utils$$objectOrFunction(value)) {\n lib$es6$promise$$internal$$handleMaybeThenable(promise, value, lib$es6$promise$$internal$$getThen(value));\n } else {\n lib$es6$promise$$internal$$fulfill(promise, value);\n }\n }\n\n function lib$es6$promise$$internal$$publishRejection(promise) {\n if (promise._onerror) {\n promise._onerror(promise._result);\n }\n\n lib$es6$promise$$internal$$publish(promise);\n }\n\n function lib$es6$promise$$internal$$fulfill(promise, value) {\n if (promise._state !== lib$es6$promise$$internal$$PENDING) {\n return;\n }\n\n promise._result = value;\n promise._state = lib$es6$promise$$internal$$FULFILLED;\n\n if (promise._subscribers.length !== 0) {\n lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, promise);\n }\n }\n\n function lib$es6$promise$$internal$$reject(promise, reason) {\n if (promise._state !== lib$es6$promise$$internal$$PENDING) {\n return;\n }\n promise._state = lib$es6$promise$$internal$$REJECTED;\n promise._result = reason;\n\n lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publishRejection, promise);\n }\n\n function lib$es6$promise$$internal$$subscribe(parent, child, onFulfillment, onRejection) {\n var subscribers = parent._subscribers;\n var length = subscribers.length;\n\n parent._onerror = null;\n\n subscribers[length] = child;\n subscribers[length + lib$es6$promise$$internal$$FULFILLED] = onFulfillment;\n subscribers[length + lib$es6$promise$$internal$$REJECTED] = onRejection;\n\n if (length === 0 && parent._state) {\n lib$es6$promise$asap$$asap(lib$es6$promise$$internal$$publish, parent);\n }\n }\n\n function lib$es6$promise$$internal$$publish(promise) {\n var subscribers = promise._subscribers;\n var settled = promise._state;\n\n if (subscribers.length === 0) {\n return;\n }\n\n var child,\n callback,\n detail = promise._result;\n\n for (var i = 0; i < subscribers.length; i += 3) {\n child = subscribers[i];\n callback = subscribers[i + settled];\n\n if (child) {\n lib$es6$promise$$internal$$invokeCallback(settled, child, callback, detail);\n } else {\n callback(detail);\n }\n }\n\n promise._subscribers.length = 0;\n }\n\n function lib$es6$promise$$internal$$ErrorObject() {\n this.error = null;\n }\n\n var lib$es6$promise$$internal$$TRY_CATCH_ERROR = new lib$es6$promise$$internal$$ErrorObject();\n\n function lib$es6$promise$$internal$$tryCatch(callback, detail) {\n try {\n return callback(detail);\n } catch (e) {\n lib$es6$promise$$internal$$TRY_CATCH_ERROR.error = e;\n return lib$es6$promise$$internal$$TRY_CATCH_ERROR;\n }\n }\n\n function lib$es6$promise$$internal$$invokeCallback(settled, promise, callback, detail) {\n var hasCallback = lib$es6$promise$utils$$isFunction(callback),\n value,\n error,\n succeeded,\n failed;\n\n if (hasCallback) {\n value = lib$es6$promise$$internal$$tryCatch(callback, detail);\n\n if (value === lib$es6$promise$$internal$$TRY_CATCH_ERROR) {\n failed = true;\n error = value.error;\n value = null;\n } else {\n succeeded = true;\n }\n\n if (promise === value) {\n lib$es6$promise$$internal$$reject(promise, lib$es6$promise$$internal$$cannotReturnOwn());\n return;\n }\n } else {\n value = detail;\n succeeded = true;\n }\n\n if (promise._state !== lib$es6$promise$$internal$$PENDING) {\n // noop\n } else if (hasCallback && succeeded) {\n lib$es6$promise$$internal$$resolve(promise, value);\n } else if (failed) {\n lib$es6$promise$$internal$$reject(promise, error);\n } else if (settled === lib$es6$promise$$internal$$FULFILLED) {\n lib$es6$promise$$internal$$fulfill(promise, value);\n } else if (settled === lib$es6$promise$$internal$$REJECTED) {\n lib$es6$promise$$internal$$reject(promise, value);\n }\n }\n\n function lib$es6$promise$$internal$$initializePromise(promise, resolver) {\n try {\n resolver(function resolvePromise(value) {\n lib$es6$promise$$internal$$resolve(promise, value);\n }, function rejectPromise(reason) {\n lib$es6$promise$$internal$$reject(promise, reason);\n });\n } catch (e) {\n lib$es6$promise$$internal$$reject(promise, e);\n }\n }\n\n var lib$es6$promise$$internal$$id = 0;\n function lib$es6$promise$$internal$$nextId() {\n return lib$es6$promise$$internal$$id++;\n }\n\n function lib$es6$promise$$internal$$makePromise(promise) {\n promise[lib$es6$promise$$internal$$PROMISE_ID] = lib$es6$promise$$internal$$id++;\n promise._state = undefined;\n promise._result = undefined;\n promise._subscribers = [];\n }\n\n function lib$es6$promise$promise$all$$all(entries) {\n return new lib$es6$promise$enumerator$$default(this, entries).promise;\n }\n var lib$es6$promise$promise$all$$default = lib$es6$promise$promise$all$$all;\n function lib$es6$promise$promise$race$$race(entries) {\n /*jshint validthis:true */\n var Constructor = this;\n\n if (!lib$es6$promise$utils$$isArray(entries)) {\n return new Constructor(function (resolve, reject) {\n reject(new TypeError('You must pass an array to race.'));\n });\n } else {\n return new Constructor(function (resolve, reject) {\n var length = entries.length;\n for (var i = 0; i < length; i++) {\n Constructor.resolve(entries[i]).then(resolve, reject);\n }\n });\n }\n }\n var lib$es6$promise$promise$race$$default = lib$es6$promise$promise$race$$race;\n function lib$es6$promise$promise$reject$$reject(reason) {\n /*jshint validthis:true */\n var Constructor = this;\n var promise = new Constructor(lib$es6$promise$$internal$$noop);\n lib$es6$promise$$internal$$reject(promise, reason);\n return promise;\n }\n var lib$es6$promise$promise$reject$$default = lib$es6$promise$promise$reject$$reject;\n\n function lib$es6$promise$promise$$needsResolver() {\n throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n }\n\n function lib$es6$promise$promise$$needsNew() {\n throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n }\n\n var lib$es6$promise$promise$$default = lib$es6$promise$promise$$Promise;\n /**\n Promise objects represent the eventual result of an asynchronous operation. The\n primary way of interacting with a promise is through its `then` method, which\n registers callbacks to receive either a promise's eventual value or the reason\n why the promise cannot be fulfilled.\n Terminology\n -----------\n - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n - `thenable` is an object or function that defines a `then` method.\n - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n - `exception` is a value that is thrown using the throw statement.\n - `reason` is a value that indicates why a promise was rejected.\n - `settled` the final resting state of a promise, fulfilled or rejected.\n A promise can be in one of three states: pending, fulfilled, or rejected.\n Promises that are fulfilled have a fulfillment value and are in the fulfilled\n state. Promises that are rejected have a rejection reason and are in the\n rejected state. A fulfillment value is never a thenable.\n Promises can also be said to *resolve* a value. If this value is also a\n promise, then the original promise's settled state will match the value's\n settled state. So a promise that *resolves* a promise that rejects will\n itself reject, and a promise that *resolves* a promise that fulfills will\n itself fulfill.\n Basic Usage:\n ------------\n ```js\n var promise = new Promise(function(resolve, reject) {\n // on success\n resolve(value);\n // on failure\n reject(reason);\n });\n promise.then(function(value) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n Advanced Usage:\n ---------------\n Promises shine when abstracting away asynchronous interactions such as\n `XMLHttpRequest`s.\n ```js\n function getJSON(url) {\n return new Promise(function(resolve, reject){\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.onreadystatechange = handler;\n xhr.responseType = 'json';\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.send();\n function handler() {\n if (this.readyState === this.DONE) {\n if (this.status === 200) {\n resolve(this.response);\n } else {\n reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n }\n }\n };\n });\n }\n getJSON('/posts.json').then(function(json) {\n // on fulfillment\n }, function(reason) {\n // on rejection\n });\n ```\n Unlike callbacks, promises are great composable primitives.\n ```js\n Promise.all([\n getJSON('/posts'),\n getJSON('/comments')\n ]).then(function(values){\n values[0] // => postsJSON\n values[1] // => commentsJSON\n return values;\n });\n ```\n @class Promise\n @param {function} resolver\n Useful for tooling.\n @constructor\n */\n function lib$es6$promise$promise$$Promise(resolver) {\n this[lib$es6$promise$$internal$$PROMISE_ID] = lib$es6$promise$$internal$$nextId();\n this._result = this._state = undefined;\n this._subscribers = [];\n\n if (lib$es6$promise$$internal$$noop !== resolver) {\n typeof resolver !== 'function' && lib$es6$promise$promise$$needsResolver();\n this instanceof lib$es6$promise$promise$$Promise ? lib$es6$promise$$internal$$initializePromise(this, resolver) : lib$es6$promise$promise$$needsNew();\n }\n }\n\n lib$es6$promise$promise$$Promise.all = lib$es6$promise$promise$all$$default;\n lib$es6$promise$promise$$Promise.race = lib$es6$promise$promise$race$$default;\n lib$es6$promise$promise$$Promise.resolve = lib$es6$promise$promise$resolve$$default;\n lib$es6$promise$promise$$Promise.reject = lib$es6$promise$promise$reject$$default;\n lib$es6$promise$promise$$Promise._setScheduler = lib$es6$promise$asap$$setScheduler;\n lib$es6$promise$promise$$Promise._setAsap = lib$es6$promise$asap$$setAsap;\n lib$es6$promise$promise$$Promise._asap = lib$es6$promise$asap$$asap;\n\n lib$es6$promise$promise$$Promise.prototype = {\n constructor: lib$es6$promise$promise$$Promise,\n\n /**\n The primary way of interacting with a promise is through its `then` method,\n which registers callbacks to receive either a promise's eventual value or the\n reason why the promise cannot be fulfilled.\n ```js\n findUser().then(function(user){\n // user is available\n }, function(reason){\n // user is unavailable, and you are given the reason why\n });\n ```\n Chaining\n --------\n The return value of `then` is itself a promise. This second, 'downstream'\n promise is resolved with the return value of the first promise's fulfillment\n or rejection handler, or rejected if the handler throws an exception.\n ```js\n findUser().then(function (user) {\n return user.name;\n }, function (reason) {\n return 'default name';\n }).then(function (userName) {\n // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n // will be `'default name'`\n });\n findUser().then(function (user) {\n throw new Error('Found user, but still unhappy');\n }, function (reason) {\n throw new Error('`findUser` rejected and we're unhappy');\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n });\n ```\n If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n ```js\n findUser().then(function (user) {\n throw new PedagogicalException('Upstream error');\n }).then(function (value) {\n // never reached\n }).then(function (value) {\n // never reached\n }, function (reason) {\n // The `PedgagocialException` is propagated all the way down to here\n });\n ```\n Assimilation\n ------------\n Sometimes the value you want to propagate to a downstream promise can only be\n retrieved asynchronously. This can be achieved by returning a promise in the\n fulfillment or rejection handler. The downstream promise will then be pending\n until the returned promise is settled. This is called *assimilation*.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // The user's comments are now available\n });\n ```\n If the assimliated promise rejects, then the downstream promise will also reject.\n ```js\n findUser().then(function (user) {\n return findCommentsByAuthor(user);\n }).then(function (comments) {\n // If `findCommentsByAuthor` fulfills, we'll have the value here\n }, function (reason) {\n // If `findCommentsByAuthor` rejects, we'll have the reason here\n });\n ```\n Simple Example\n --------------\n Synchronous Example\n ```javascript\n var result;\n try {\n result = findResult();\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n findResult(function(result, err){\n if (err) {\n // failure\n } else {\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findResult().then(function(result){\n // success\n }, function(reason){\n // failure\n });\n ```\n Advanced Example\n --------------\n Synchronous Example\n ```javascript\n var author, books;\n try {\n author = findAuthor();\n books = findBooksByAuthor(author);\n // success\n } catch(reason) {\n // failure\n }\n ```\n Errback Example\n ```js\n function foundBooks(books) {\n }\n function failure(reason) {\n }\n findAuthor(function(author, err){\n if (err) {\n failure(err);\n // failure\n } else {\n try {\n findBoooksByAuthor(author, function(books, err) {\n if (err) {\n failure(err);\n } else {\n try {\n foundBooks(books);\n } catch(reason) {\n failure(reason);\n }\n }\n });\n } catch(error) {\n failure(err);\n }\n // success\n }\n });\n ```\n Promise Example;\n ```javascript\n findAuthor().\n then(findBooksByAuthor).\n then(function(books){\n // found books\n }).catch(function(reason){\n // something went wrong\n });\n ```\n @method then\n @param {Function} onFulfilled\n @param {Function} onRejected\n Useful for tooling.\n @return {Promise}\n */\n then: lib$es6$promise$then$$default,\n\n /**\n `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n as the catch block of a try/catch statement.\n ```js\n function findAuthor(){\n throw new Error('couldn't find that author');\n }\n // synchronous\n try {\n findAuthor();\n } catch(reason) {\n // something went wrong\n }\n // async with promises\n findAuthor().catch(function(reason){\n // something went wrong\n });\n ```\n @method catch\n @param {Function} onRejection\n Useful for tooling.\n @return {Promise}\n */\n 'catch': function _catch(onRejection) {\n return this.then(null, onRejection);\n }\n };\n var lib$es6$promise$enumerator$$default = lib$es6$promise$enumerator$$Enumerator;\n function lib$es6$promise$enumerator$$Enumerator(Constructor, input) {\n this._instanceConstructor = Constructor;\n this.promise = new Constructor(lib$es6$promise$$internal$$noop);\n\n if (!this.promise[lib$es6$promise$$internal$$PROMISE_ID]) {\n lib$es6$promise$$internal$$makePromise(this.promise);\n }\n\n if (lib$es6$promise$utils$$isArray(input)) {\n this._input = input;\n this.length = input.length;\n this._remaining = input.length;\n\n this._result = new Array(this.length);\n\n if (this.length === 0) {\n lib$es6$promise$$internal$$fulfill(this.promise, this._result);\n } else {\n this.length = this.length || 0;\n this._enumerate();\n if (this._remaining === 0) {\n lib$es6$promise$$internal$$fulfill(this.promise, this._result);\n }\n }\n } else {\n lib$es6$promise$$internal$$reject(this.promise, lib$es6$promise$enumerator$$validationError());\n }\n }\n\n function lib$es6$promise$enumerator$$validationError() {\n return new Error('Array Methods must be provided an Array');\n }\n\n lib$es6$promise$enumerator$$Enumerator.prototype._enumerate = function () {\n var length = this.length;\n var input = this._input;\n\n for (var i = 0; this._state === lib$es6$promise$$internal$$PENDING && i < length; i++) {\n this._eachEntry(input[i], i);\n }\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._eachEntry = function (entry, i) {\n var c = this._instanceConstructor;\n var resolve = c.resolve;\n\n if (resolve === lib$es6$promise$promise$resolve$$default) {\n var then = lib$es6$promise$$internal$$getThen(entry);\n\n if (then === lib$es6$promise$then$$default && entry._state !== lib$es6$promise$$internal$$PENDING) {\n this._settledAt(entry._state, i, entry._result);\n } else if (typeof then !== 'function') {\n this._remaining--;\n this._result[i] = entry;\n } else if (c === lib$es6$promise$promise$$default) {\n var promise = new c(lib$es6$promise$$internal$$noop);\n lib$es6$promise$$internal$$handleMaybeThenable(promise, entry, then);\n this._willSettleAt(promise, i);\n } else {\n this._willSettleAt(new c(function (resolve) {\n resolve(entry);\n }), i);\n }\n } else {\n this._willSettleAt(resolve(entry), i);\n }\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._settledAt = function (state, i, value) {\n var promise = this.promise;\n\n if (promise._state === lib$es6$promise$$internal$$PENDING) {\n this._remaining--;\n\n if (state === lib$es6$promise$$internal$$REJECTED) {\n lib$es6$promise$$internal$$reject(promise, value);\n } else {\n this._result[i] = value;\n }\n }\n\n if (this._remaining === 0) {\n lib$es6$promise$$internal$$fulfill(promise, this._result);\n }\n };\n\n lib$es6$promise$enumerator$$Enumerator.prototype._willSettleAt = function (promise, i) {\n var enumerator = this;\n\n lib$es6$promise$$internal$$subscribe(promise, undefined, function (value) {\n enumerator._settledAt(lib$es6$promise$$internal$$FULFILLED, i, value);\n }, function (reason) {\n enumerator._settledAt(lib$es6$promise$$internal$$REJECTED, i, reason);\n });\n };\n function lib$es6$promise$polyfill$$polyfill() {\n var local;\n\n if (typeof global !== 'undefined') {\n local = global;\n } else if (typeof self !== 'undefined') {\n local = self;\n } else {\n try {\n local = Function('return this')();\n } catch (e) {\n throw new Error('polyfill failed because global object is unavailable in this environment');\n }\n }\n\n var P = local.Promise;\n\n if (P && Object.prototype.toString.call(P.resolve()) === '[object Promise]' && !P.cast) {\n return;\n }\n\n local.Promise = lib$es6$promise$promise$$default;\n }\n var lib$es6$promise$polyfill$$default = lib$es6$promise$polyfill$$polyfill;\n\n var lib$es6$promise$umd$$ES6Promise = {\n 'Promise': lib$es6$promise$promise$$default,\n 'polyfill': lib$es6$promise$polyfill$$default\n };\n\n /* global define:true module:true window: true */\n if (\"function\" === 'function' && __webpack_require__(18)['amd']) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n return lib$es6$promise$umd$$ES6Promise;\n }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else if (typeof module !== 'undefined' && module['exports']) {\n module['exports'] = lib$es6$promise$umd$$ES6Promise;\n } else if (typeof this !== 'undefined') {\n this['ES6Promise'] = lib$es6$promise$umd$$ES6Promise;\n }\n\n lib$es6$promise$polyfill$$default();\n}).call(undefined);\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(15), (function() { return this; }()), __webpack_require__(16)(module)))\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/es6-promise/dist/es6-promise.js\n ** module id = 14\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/es6-promise/dist/es6-promise.js?"); + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + eval("'use strict';\n\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout() {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n})();\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e) {\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e) {\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while (len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () {\n return '/';\n};\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function () {\n return 0;\n};\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/process/browser.js\n ** module id = 15\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./~/process/browser.js?"); + +/***/ }, +/* 16 */ +/***/ function(module, exports) { + + eval("\"use strict\";\n\nmodule.exports = function (module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function () {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tmodule.children = [];\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n/*****************\n ** WEBPACK FOOTER\n ** (webpack)/buildin/module.js\n ** module id = 16\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///(webpack)/buildin/module.js?"); + +/***/ }, +/* 17 */ +/***/ function(module, exports) { + + eval("/* (ignored) */\n\n/*****************\n ** WEBPACK FOOTER\n ** vertx (ignored)\n ** module id = 17\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///vertx_(ignored)?"); + +/***/ }, +/* 18 */ +/***/ function(module, exports) { + + eval("module.exports = function() { throw new Error(\"define cannot be used indirect\"); };\r\n\n\n/*****************\n ** WEBPACK FOOTER\n ** (webpack)/buildin/amd-define.js\n ** module id = 18\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///(webpack)/buildin/amd-define.js?"); + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nvar _material = __webpack_require__(20);\n\nvar _material2 = _interopRequireDefault(_material);\n\nvar _helper = __webpack_require__(21);\n\nvar _helper2 = _interopRequireDefault(_helper);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Model = function () {\n function Model(scene, manager, textures) {\n _classCallCheck(this, Model);\n\n this.scene = scene;\n this.textures = textures;\n\n this.loader = new _three2.default.ObjectLoader(manager);\n this.obj = null;\n }\n\n _createClass(Model, [{\n key: 'load',\n value: function load() {\n var _this = this;\n\n // load a resource\n this.loader.load(_config2.default.model.path, function (obj) {\n obj.traverse(function (child) {\n if (child instanceof _three2.default.Mesh) {\n var material = new _material2.default().standard;\n material.map = _this.textures.UV;\n child.material = material;\n\n if (_config2.default.shadow.enabled) {\n child.receiveShadow = true;\n child.castShadow = true;\n }\n }\n });\n\n if (_config2.default.isDev && _config2.default.mesh.enableHelper) {\n new _helper2.default(_this.scene, obj);\n }\n\n // set prop to obj\n _this.obj = obj;\n\n obj.scale.multiplyScalar(_config2.default.model.scale);\n\n // add object to scene\n _this.scene.add(obj);\n }, Model.onProgress, Model.onError);\n }\n }], [{\n key: 'onProgress',\n value: function onProgress(xhr) {\n if (xhr.lengthComputable) {\n var percentComplete = xhr.loaded / xhr.total * 100;\n\n console.log(Math.round(percentComplete, 2) + '% downloaded');\n }\n }\n }, {\n key: 'onError',\n value: function onError(xhr) {\n console.error(xhr);\n }\n }]);\n\n return Model;\n}();\n\nexports.default = Model;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/model.js\n ** module id = 19\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/model.js?"); + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Material = function Material() {\n _classCallCheck(this, Material);\n\n this.emissive = new _three2.default.MeshBasicMaterial({\n color: 0xeeeeee,\n side: _three2.default.DoubleSide,\n fog: false\n });\n\n this.standard = new _three2.default.MeshStandardMaterial({\n shading: _three2.default.FlatShading,\n roughness: 1,\n metalness: 0,\n side: _three2.default.DoubleSide,\n fog: false\n });\n\n this.wire = new _three2.default.MeshBasicMaterial({ wireframe: true });\n};\n\nexports.default = Material;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/material.js\n ** module id = 20\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/material.js?"); + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Helper = function Helper(scene, mesh) {\n _classCallCheck(this, Helper);\n\n var wireframe = new _three2.default.WireframeGeometry(mesh.geometry);\n var wireLine = new _three2.default.LineSegments(wireframe);\n wireLine.material.depthTest = false;\n wireLine.material.opacity = 0.25;\n wireLine.material.transparent = true;\n mesh.add(wireLine);\n\n var edges = new _three2.default.EdgesGeometry(mesh.geometry);\n var edgesLine = new _three2.default.LineSegments(edges);\n edgesLine.material.depthTest = false;\n edgesLine.material.opacity = 0.25;\n edgesLine.material.transparent = true;\n mesh.add(edgesLine);\n\n scene.add(new _three2.default.BoxHelper(mesh));\n scene.add(new _three2.default.FaceNormalsHelper(mesh, 2));\n scene.add(new _three2.default.VertexNormalsHelper(mesh, 2));\n};\n\nexports.default = Helper;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/helper.js\n ** module id = 21\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/helper.js?"); + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _three = __webpack_require__(6);\n\nvar _three2 = _interopRequireDefault(_three);\n\nvar _keyboard = __webpack_require__(23);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nvar _helpers = __webpack_require__(24);\n\nvar _helpers2 = _interopRequireDefault(_helpers);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Interaction = function () {\n function Interaction(renderer, scene, camera, controls) {\n var _this = this;\n\n _classCallCheck(this, Interaction);\n\n this.renderer = renderer;\n this.scene = scene;\n this.camera = camera;\n this.controls = controls;\n\n this.keyboard = new _keyboard2.default();\n\n // listeners\n // mouse events\n this.renderer.domElement.addEventListener('mouseup', function (event) {\n return _this.onMouseUp(event);\n }, false);\n this.renderer.domElement.addEventListener('mousemove', function (event) {\n return _helpers2.default.throttle(_this.onMouseMove(event), 250);\n }, false);\n this.renderer.domElement.addEventListener('mouseenter', function (event) {\n return _this.onMouseEnter(event);\n }, false);\n this.renderer.domElement.addEventListener('mouseleave', function (event) {\n return _this.onMouseLeave(event);\n }, false);\n this.renderer.domElement.addEventListener('mouseover', function (event) {\n return _this.onMouseOver(event);\n }, false);\n\n // keyboard events\n this.keyboard.domElement.addEventListener('keydown', function (event) {\n if (event.repeat) {\n return;\n }\n if (_this.keyboard.eventMatches(event, 'escape')) {\n console.log('Escape pressed');\n }\n });\n }\n\n _createClass(Interaction, [{\n key: 'onMouseEnter',\n value: function onMouseEnter(event) {\n event.preventDefault();\n }\n }, {\n key: 'onMouseOver',\n value: function onMouseOver(event) {\n event.preventDefault();\n }\n }, {\n key: 'onMouseLeave',\n value: function onMouseLeave(event) {\n event.preventDefault();\n }\n }, {\n key: 'onMouseMove',\n value: function onMouseMove(event) {\n event.preventDefault();\n }\n }, {\n key: 'onMouseUp',\n value: function onMouseUp(event) {\n event.preventDefault();\n }\n }]);\n\n return Interaction;\n}();\n\nexports.default = Interaction;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/interaction.js\n ** module id = 22\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/interaction.js?"); + +/***/ }, +/* 23 */ +/***/ function(module, exports) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ALIAS = {\n 'left': 37,\n 'up': 38,\n 'right': 39,\n 'down': 40,\n 'space': 32,\n 'pageup': 33,\n 'pagedown': 34,\n 'tab': 9,\n 'escape': 27\n};\n\nvar Keyboard = function () {\n function Keyboard(domElement) {\n var _this = this;\n\n _classCallCheck(this, Keyboard);\n\n this.domElement = domElement || document;\n this.keyCodes = {};\n\n // bind keyEvents\n this.domElement.addEventListener('keydown', function () {\n return _this.onKeyChange(event);\n }, false);\n this.domElement.addEventListener('keyup', function () {\n return _this.onKeyChange(event);\n }, false);\n\n // bind window blur\n window.addEventListener('blur', function () {\n return _this.onBlur;\n }, false);\n }\n\n _createClass(Keyboard, [{\n key: 'destroy',\n value: function destroy() {\n var _this2 = this;\n\n this.domElement.removeEventListener('keydown', function () {\n return _this2.onKeyChange(event);\n }, false);\n this.domElement.removeEventListener('keyup', function () {\n return _this2.onKeyChange(event);\n }, false);\n\n // unbind window blur event\n window.removeEventListener('blur', function () {\n return _this2.onBlur;\n }, false);\n }\n }, {\n key: 'onBlur',\n value: function onBlur() {\n for (var prop in this.keyCodes) {\n this.keyCodes[prop] = false;\n }\n }\n }, {\n key: 'onKeyChange',\n value: function onKeyChange(event) {\n // log to debug\n //console.log('onKeyChange', event, event.keyCode, event.shiftKey, event.ctrlKey, event.altKey, event.metaKey)\n\n // update this.keyCodes\n var keyCode = event.keyCode;\n this.keyCodes[keyCode] = event.type === 'keydown';\n }\n }, {\n key: 'pressed',\n value: function pressed(keyDesc) {\n var keys = keyDesc.split('+');\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var pressed = false;\n if (Object.keys(ALIAS).indexOf(key) != -1) {\n pressed = this.keyCodes[ALIAS[key]];\n } else {\n pressed = this.keyCodes[key.toUpperCase().charCodeAt(0)];\n }\n if (!pressed) return false;\n }\n\n return true;\n }\n }, {\n key: 'eventMatches',\n value: function eventMatches(event, keyDesc) {\n var aliases = ALIAS;\n var aliasKeys = Object.keys(aliases);\n var keys = keyDesc.split('+');\n // log to debug\n // console.log('eventMatches', event, event.keyCode, event.shiftKey, event.ctrlKey, event.altKey, event.metaKey)\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var pressed = false;\n if (key === 'shift') {\n pressed = event.shiftKey ? true : false;\n } else if (key === 'ctrl') {\n pressed = event.ctrlKey ? true : false;\n } else if (key === 'alt') {\n pressed = event.altKey ? true : false;\n } else if (key === 'meta') {\n pressed = event.metaKey ? true : false;\n } else if (aliasKeys.indexOf(key) !== -1) {\n pressed = event.keyCode === aliases[key];\n } else if (event.keyCode === key.toUpperCase().charCodeAt(0)) {\n pressed = true;\n }\n if (!pressed) return false;\n }\n\n return true;\n }\n }]);\n\n return Keyboard;\n}();\n\nexports.default = Keyboard;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/utils/keyboard.js\n ** module id = 23\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/utils/keyboard.js?"); + +/***/ }, +/* 24 */ +/***/ function(module, exports) { + + eval("\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Helpers = function () {\n function Helpers() {\n _classCallCheck(this, Helpers);\n }\n\n _createClass(Helpers, null, [{\n key: \"throttle\",\n value: function throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n\n return function () {\n var context = scope || this;\n\n var now = +new Date(),\n args = arguments;\n\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n }\n }]);\n\n return Helpers;\n}();\n\nexports.default = Helpers;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/utils/helpers.js\n ** module id = 24\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/utils/helpers.js?"); + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + eval("'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar GUI = function () {\n function GUI(main, mesh) {\n var _this = this;\n\n _classCallCheck(this, GUI);\n\n var gui = new dat.GUI();\n\n this.camera = main.camera.threeCamera;\n this.controls = main.controls.threeControls;\n this.light = main.light;\n\n /* Global */\n //gui.close();\n\n /* Camera */\n var cameraFolder = gui.addFolder('Camera');\n var cameraFOVGui = cameraFolder.add(_config2.default.camera, 'fov', 0, 180).name('Camera FOV');\n cameraFOVGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.camera.fov = value;\n });\n cameraFOVGui.onFinishChange(function (value) {\n _this.camera.updateProjectionMatrix();\n\n _this.controls.enableRotate = true;\n });\n var cameraAspectGui = cameraFolder.add(_config2.default.camera, 'aspect', 0, 4).name('Camera Aspect');\n cameraAspectGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.camera.aspect = value;\n });\n cameraAspectGui.onFinishChange(function (value) {\n _this.camera.updateProjectionMatrix();\n\n _this.controls.enableRotate = true;\n });\n var cameraFogColorGui = cameraFolder.addColor(_config2.default.fog, 'color').name('Fog Color');\n cameraFogColorGui.onChange(function (value) {\n main.scene.fog.color.setHex(value);\n });\n var cameraFogNearGui = cameraFolder.add(_config2.default.fog, 'near', 0.000, 0.010).name('Fog Near');\n cameraFogNearGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n main.scene.fog.density = value;\n });\n cameraFogNearGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n\n /* Controls */\n var controlsFolder = gui.addFolder('Controls');\n controlsFolder.add(_config2.default.controls, 'autoRotate').name('Auto Rotate').onChange(function (value) {\n _this.controls.autoRotate = value;\n });\n var controlsAutoRotateSpeedGui = controlsFolder.add(_config2.default.controls, 'autoRotateSpeed', -1, 1).name('Rotation Speed');\n controlsAutoRotateSpeedGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n _this.controls.autoRotateSpeed = value;\n });\n controlsAutoRotateSpeedGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n\n /* Mesh */\n var meshFolder = gui.addFolder('Mesh');\n meshFolder.add(_config2.default.mesh, 'translucent', true).name('Translucent').onChange(function (value) {\n if (value) {\n mesh.material.transparent = true;\n mesh.material.opacity = 0.5;\n } else {\n mesh.material.opacity = 1.0;\n }\n });\n meshFolder.add(_config2.default.mesh, 'wireframe', true).name('Wireframe').onChange(function (value) {\n mesh.material.wireframe = value;\n });\n\n /* Lights */\n // Ambient Light\n var ambientLightFolder = gui.addFolder('Ambient Light');\n ambientLightFolder.add(_config2.default.ambientLight, 'enabled').name('Enabled').onChange(function (value) {\n _this.light.ambientLight.visible = value;\n });\n ambientLightFolder.addColor(_config2.default.ambientLight, 'color').name('Color').onChange(function (value) {\n _this.light.ambientLight.color.setHex(value);\n });\n\n // Directional Light\n var directionalLightFolder = gui.addFolder('Directional Light');\n directionalLightFolder.add(_config2.default.directionalLight, 'enabled').name('Enabled').onChange(function (value) {\n _this.light.directionalLight.visible = value;\n });\n directionalLightFolder.addColor(_config2.default.directionalLight, 'color').name('Color').onChange(function (value) {\n _this.light.directionalLight.color.setHex(value);\n });\n var directionalLightIntensityGui = directionalLightFolder.add(_config2.default.directionalLight, 'intensity', 0, 2).name('Intensity');\n directionalLightIntensityGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.intensity = value;\n });\n directionalLightIntensityGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n var directionalLightPositionXGui = directionalLightFolder.add(_config2.default.directionalLight, 'x', -1000, 1000).name('Position X');\n directionalLightPositionXGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.position.x = value;\n });\n directionalLightPositionXGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n var directionalLightPositionYGui = directionalLightFolder.add(_config2.default.directionalLight, 'y', -1000, 1000).name('Position Y');\n directionalLightPositionYGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.position.y = value;\n });\n directionalLightPositionYGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n var directionalLightPositionZGui = directionalLightFolder.add(_config2.default.directionalLight, 'z', -1000, 1000).name('Position Z');\n directionalLightPositionZGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.position.z = value;\n });\n directionalLightPositionZGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n\n // Shadow Map\n var shadowFolder = gui.addFolder('Shadow Map');\n shadowFolder.add(_config2.default.shadow, 'enabled').name('Enabled').onChange(function (value) {\n _this.light.directionalLight.castShadow = value;\n });\n shadowFolder.add(_config2.default.shadow, 'helperEnabled').name('Helper Enabled').onChange(function (value) {\n _this.light.directionalLightHelper.visible = value;\n });\n var shadowNearGui = shadowFolder.add(_config2.default.shadow, 'near', 0, 100).name('Near');\n shadowNearGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.shadow.camera.near = value;\n });\n shadowNearGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n _this.light.directionalLight.shadow.map.dispose();\n _this.light.directionalLight.shadow.map = null;\n _this.light.directionalLightHelper.update();\n });\n var shadowFarGui = shadowFolder.add(_config2.default.shadow, 'far', 0, 1200).name('Far');\n shadowFarGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.shadow.camera.far = value;\n });\n shadowFarGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n _this.light.directionalLight.shadow.map.dispose();\n _this.light.directionalLight.shadow.map = null;\n _this.light.directionalLightHelper.update();\n });\n var shadowTopGui = shadowFolder.add(_config2.default.shadow, 'top', -400, 400).name('Top');\n shadowTopGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.shadow.camera.top = value;\n });\n shadowTopGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n _this.light.directionalLight.shadow.map.dispose();\n _this.light.directionalLight.shadow.map = null;\n _this.light.directionalLightHelper.update();\n });\n var shadowRightGui = shadowFolder.add(_config2.default.shadow, 'right', -400, 400).name('Right');\n shadowRightGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.shadow.camera.right = value;\n });\n shadowRightGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n _this.light.directionalLight.shadow.map.dispose();\n _this.light.directionalLight.shadow.map = null;\n _this.light.directionalLightHelper.update();\n });\n var shadowBottomGui = shadowFolder.add(_config2.default.shadow, 'bottom', -400, 400).name('Bottom');\n shadowBottomGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.shadow.camera.bottom = value;\n });\n shadowBottomGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n _this.light.directionalLight.shadow.map.dispose();\n _this.light.directionalLight.shadow.map = null;\n _this.light.directionalLightHelper.update();\n });\n var shadowLeftGui = shadowFolder.add(_config2.default.shadow, 'left', -400, 400).name('Left');\n shadowLeftGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.shadow.camera.left = value;\n });\n shadowLeftGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n _this.light.directionalLight.shadow.map.dispose();\n _this.light.directionalLight.shadow.map = null;\n _this.light.directionalLightHelper.update();\n });\n var shadowBiasGui = shadowFolder.add(_config2.default.shadow, 'bias', -0.000010, 1).name('Bias');\n shadowBiasGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.directionalLight.shadow.bias = value;\n });\n shadowBiasGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n _this.light.directionalLight.shadow.map.dispose();\n _this.light.directionalLight.shadow.map = null;\n _this.light.directionalLightHelper.update();\n });\n\n // Point Light\n var pointLightFolder = gui.addFolder('Point Light');\n pointLightFolder.add(_config2.default.pointLight, 'enabled').name('Enabled').onChange(function (value) {\n _this.light.pointLight.visible = value;\n });\n pointLightFolder.addColor(_config2.default.pointLight, 'color').name('Color').onChange(function (value) {\n _this.light.pointLight.color.setHex(value);\n });\n var pointLightIntensityGui = pointLightFolder.add(_config2.default.pointLight, 'intensity', 0, 2).name('Intensity');\n pointLightIntensityGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.pointLight.intensity = value;\n });\n pointLightIntensityGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n var pointLightDistanceGui = pointLightFolder.add(_config2.default.pointLight, 'distance', 0, 1000).name('Distance');\n pointLightDistanceGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.pointLight.distance = value;\n });\n pointLightDistanceGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n var pointLightPositionXGui = pointLightFolder.add(_config2.default.pointLight, 'x', -1000, 1000).name('Position X');\n pointLightPositionXGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.pointLight.position.x = value;\n });\n pointLightPositionXGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n var pointLightPositionYGui = pointLightFolder.add(_config2.default.pointLight, 'y', -1000, 1000).name('Position Y');\n pointLightPositionYGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.pointLight.position.y = value;\n });\n pointLightPositionYGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n var pointLightPositionZGui = pointLightFolder.add(_config2.default.pointLight, 'z', -1000, 1000).name('Position Z');\n pointLightPositionZGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.pointLight.position.z = value;\n });\n pointLightPositionZGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n\n // Hemi Light\n var hemiLightFolder = gui.addFolder('Hemi Light');\n hemiLightFolder.add(_config2.default.hemiLight, 'enabled').name('Enabled').onChange(function (value) {\n _this.light.hemiLight.visible = value;\n });\n hemiLightFolder.addColor(_config2.default.hemiLight, 'color').name('Color').onChange(function (value) {\n _this.light.hemiLight.color.setHex(value);\n });\n hemiLightFolder.addColor(_config2.default.hemiLight, 'groundColor').name('ground Color').onChange(function (value) {\n _this.light.hemiLight.groundColor.setHex(value);\n });\n var hemiLightIntensityGui = hemiLightFolder.add(_config2.default.hemiLight, 'intensity', 0, 2).name('Intensity');\n hemiLightIntensityGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.hemiLight.intensity = value;\n });\n hemiLightIntensityGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n var hemiLightPositionXGui = hemiLightFolder.add(_config2.default.hemiLight, 'x', -1000, 1000).name('Position X');\n hemiLightPositionXGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.hemiLight.position.x = value;\n });\n hemiLightPositionXGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n var hemiLightPositionYGui = hemiLightFolder.add(_config2.default.hemiLight, 'y', -500, 1000).name('Position Y');\n hemiLightPositionYGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.hemiLight.position.y = value;\n });\n hemiLightPositionYGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n var hemiLightPositionZGui = hemiLightFolder.add(_config2.default.hemiLight, 'z', -1000, 1000).name('Position Z');\n hemiLightPositionZGui.onChange(function (value) {\n _this.controls.enableRotate = false;\n\n _this.light.hemiLight.position.z = value;\n });\n hemiLightPositionZGui.onFinishChange(function (value) {\n _this.controls.enableRotate = true;\n });\n }\n\n _createClass(GUI, [{\n key: 'handleColorChange',\n value: function handleColorChange(color) {\n return function (value) {\n if (typeof value === 'string') {\n value = value.replace('#', '0x');\n }\n\n color.setHex(value);\n };\n }\n }, {\n key: 'needsUpdate',\n value: function needsUpdate(material, geometry) {\n return function () {\n material.shading = +material.shading; //Ensure number\n material.vertexColors = +material.vertexColors; //Ensure number\n material.side = +material.side; //Ensure number\n material.needsUpdate = true;\n geometry.verticesNeedUpdate = true;\n geometry.normalsNeedUpdate = true;\n geometry.colorsNeedUpdate = true;\n };\n }\n }, {\n key: 'updateTexture',\n value: function updateTexture(material, materialKey, textures) {\n return function (key) {\n material[materialKey] = textures[key];\n material.needsUpdate = true;\n };\n }\n }, {\n key: 'update',\n value: function update() {\n this.needsUpdate(mesh.material, mesh.geometry);\n }\n }]);\n\n return GUI;\n}();\n\nexports.default = GUI;\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/js/app/gui.js\n ** module id = 25\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/js/app/gui.js?"); + +/***/ } +/******/ ]); \ No newline at end of file diff --git a/src/public/assets/js/dat.gui.min.js b/src/public/assets/js/dat.gui.min.js new file mode 100644 index 0000000..e1da66c --- /dev/null +++ b/src/public/assets/js/dat.gui.min.js @@ -0,0 +1,95 @@ +/** + * dat-gui JavaScript Controller Library + * http://code.google.com/p/dat-gui + * + * Copyright 2011 Data Arts Team, Google Creative Lab + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ +var dat=dat||{};dat.gui=dat.gui||{};dat.utils=dat.utils||{};dat.controllers=dat.controllers||{};dat.dom=dat.dom||{};dat.color=dat.color||{};dat.utils.css=function(){return{load:function(f,a){a=a||document;var d=a.createElement("link");d.type="text/css";d.rel="stylesheet";d.href=f;a.getElementsByTagName("head")[0].appendChild(d)},inject:function(f,a){a=a||document;var d=document.createElement("style");d.type="text/css";d.innerHTML=f;a.getElementsByTagName("head")[0].appendChild(d)}}}(); +dat.utils.common=function(){var f=Array.prototype.forEach,a=Array.prototype.slice;return{BREAK:{},extend:function(d){this.each(a.call(arguments,1),function(a){for(var c in a)this.isUndefined(a[c])||(d[c]=a[c])},this);return d},defaults:function(d){this.each(a.call(arguments,1),function(a){for(var c in a)this.isUndefined(d[c])&&(d[c]=a[c])},this);return d},compose:function(){var d=a.call(arguments);return function(){for(var e=a.call(arguments),c=d.length-1;0<=c;c--)e=[d[c].apply(this,e)];return e[0]}}, + each:function(a,e,c){if(a)if(f&&a.forEach&&a.forEach===f)a.forEach(e,c);else if(a.length===a.length+0)for(var b=0,p=a.length;bthis.__max&&(a=this.__max);void 0!==this.__step&&0!=a%this.__step&&(a=Math.round(a/this.__step)*this.__step);return e.superclass.prototype.setValue.call(this,a)},min:function(a){this.__min=a;return this},max:function(a){this.__max=a;return this},step:function(a){this.__impliedStep=this.__step=a;this.__precision=d(a);return this}});return e}(dat.controllers.Controller,dat.utils.common); +dat.controllers.NumberControllerBox=function(f,a,d){var e=function(c,b,f){function q(){var a=parseFloat(n.__input.value);d.isNaN(a)||n.setValue(a)}function l(a){var b=u-a.clientY;n.setValue(n.getValue()+b*n.__impliedStep);u=a.clientY}function r(){a.unbind(window,"mousemove",l);a.unbind(window,"mouseup",r)}this.__truncationSuspended=!1;e.superclass.call(this,c,b,f);var n=this,u;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"change",q);a.bind(this.__input, + "blur",function(){q();n.__onFinishChange&&n.__onFinishChange.call(n,n.getValue())});a.bind(this.__input,"mousedown",function(b){a.bind(window,"mousemove",l);a.bind(window,"mouseup",r);u=b.clientY});a.bind(this.__input,"keydown",function(a){13===a.keyCode&&(n.__truncationSuspended=!0,this.blur(),n.__truncationSuspended=!1)});this.updateDisplay();this.domElement.appendChild(this.__input)};e.superclass=f;d.extend(e.prototype,f.prototype,{updateDisplay:function(){var a=this.__input,b;if(this.__truncationSuspended)b= + this.getValue();else{b=this.getValue();var d=Math.pow(10,this.__precision);b=Math.round(b*d)/d}a.value=b;return e.superclass.prototype.updateDisplay.call(this)}});return e}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common); +dat.controllers.NumberControllerSlider=function(f,a,d,e,c){function b(a,b,c,e,d){return e+(a-b)/(c-b)*(d-e)}var p=function(c,e,d,f,u){function A(c){c.preventDefault();var e=a.getOffset(k.__background),d=a.getWidth(k.__background);k.setValue(b(c.clientX,e.left,e.left+d,k.__min,k.__max));return!1}function g(){a.unbind(window,"mousemove",A);a.unbind(window,"mouseup",g);k.__onFinishChange&&k.__onFinishChange.call(k,k.getValue())}p.superclass.call(this,c,e,{min:d,max:f,step:u});var k=this;this.__background= + document.createElement("div");this.__foreground=document.createElement("div");a.bind(this.__background,"mousedown",function(b){a.bind(window,"mousemove",A);a.bind(window,"mouseup",g);A(b)});a.addClass(this.__background,"slider");a.addClass(this.__foreground,"slider-fg");this.updateDisplay();this.__background.appendChild(this.__foreground);this.domElement.appendChild(this.__background)};p.superclass=f;p.useDefaultStyles=function(){d.inject(c)};e.extend(p.prototype,f.prototype,{updateDisplay:function(){var a= + (this.getValue()-this.__min)/(this.__max-this.__min);this.__foreground.style.width=100*a+"%";return p.superclass.prototype.updateDisplay.call(this)}});return p}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,"/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"); +dat.controllers.FunctionController=function(f,a,d){var e=function(c,b,d){e.superclass.call(this,c,b);var f=this;this.__button=document.createElement("div");this.__button.innerHTML=void 0===d?"Fire":d;a.bind(this.__button,"click",function(a){a.preventDefault();f.fire();return!1});a.addClass(this.__button,"button");this.domElement.appendChild(this.__button)};e.superclass=f;d.extend(e.prototype,f.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this);this.getValue().call(this.object); + this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}});return e}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); +dat.controllers.BooleanController=function(f,a,d){var e=function(c,b){e.superclass.call(this,c,b);var d=this;this.__prev=this.getValue();this.__checkbox=document.createElement("input");this.__checkbox.setAttribute("type","checkbox");a.bind(this.__checkbox,"change",function(){d.setValue(!d.__prev)},!1);this.domElement.appendChild(this.__checkbox);this.updateDisplay()};e.superclass=f;d.extend(e.prototype,f.prototype,{setValue:function(a){a=e.superclass.prototype.setValue.call(this,a);this.__onFinishChange&& +this.__onFinishChange.call(this,this.getValue());this.__prev=this.getValue();return a},updateDisplay:function(){!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0):this.__checkbox.checked=!1;return e.superclass.prototype.updateDisplay.call(this)}});return e}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); +dat.color.toString=function(f){return function(a){if(1==a.a||f.isUndefined(a.a)){for(a=a.hex.toString(16);6>a.length;)a="0"+a;return"#"+a}return"rgba("+Math.round(a.r)+","+Math.round(a.g)+","+Math.round(a.b)+","+a.a+")"}}(dat.utils.common); +dat.color.interpret=function(f,a){var d,e,c=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null===a?!1:{space:"HEX",hex:parseInt("0x"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:f},SIX_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9]{6})$/i);return null===a?!1:{space:"HEX",hex:parseInt("0x"+a[1].toString())}},write:f},CSS_RGB:{read:function(a){a=a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); + return null===a?!1:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:f},CSS_RGBA:{read:function(a){a=a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return null===a?!1:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:f}}},{litmus:a.isNumber,conversions:{HEX:{read:function(a){return{space:"HEX",hex:a,conversionName:"HEX"}},write:function(a){return a.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(a){return 3!= +a.length?!1:{space:"RGB",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return 4!=a.length?!1:{space:"RGB",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(b){return a.isNumber(b.r)&&a.isNumber(b.g)&&a.isNumber(b.b)&&a.isNumber(b.a)?{space:"RGB",r:b.r,g:b.g,b:b.b,a:b.a}:!1},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(b){return a.isNumber(b.r)&& +a.isNumber(b.g)&&a.isNumber(b.b)?{space:"RGB",r:b.r,g:b.g,b:b.b}:!1},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)&&a.isNumber(b.a)?{space:"HSV",h:b.h,s:b.s,v:b.v,a:b.a}:!1},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)?{space:"HSV",h:b.h,s:b.s,v:b.v}:!1},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){e=!1; + var b=1\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
    \n\n Automatically save\n values to localStorage on exit.\n\n
    The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
    \n \n
    \n\n', + ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row,
  • */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n", + dat.controllers.factory=function(f,a,d,e,c,b,p){return function(q,l,r,n){var u=q[l];if(p.isArray(r)||p.isObject(r))return new f(q,l,r);if(p.isNumber(u))return p.isNumber(r)&&p.isNumber(n)?new d(q,l,r,n):new a(q,l,{min:r,max:n});if(p.isString(u))return new e(q,l);if(p.isFunction(u))return new c(q,l,"");if(p.isBoolean(u))return new b(q,l)}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(f,a,d){var e= + function(c,b){function d(){f.setValue(f.__input.value)}e.superclass.call(this,c,b);var f=this;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"keyup",d);a.bind(this.__input,"change",d);a.bind(this.__input,"blur",function(){f.__onFinishChange&&f.__onFinishChange.call(f,f.getValue())});a.bind(this.__input,"keydown",function(a){13===a.keyCode&&this.blur()});this.updateDisplay();this.domElement.appendChild(this.__input)};e.superclass=f;d.extend(e.prototype, + f.prototype,{updateDisplay:function(){a.isActive(this.__input)||(this.__input.value=this.getValue());return e.superclass.prototype.updateDisplay.call(this)}});return e}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController, + dat.controllers.ColorController=function(f,a,d,e,c){function b(a,b,d,e){a.style.background="";c.each(l,function(c){a.style.cssText+="background: "+c+"linear-gradient("+b+", "+d+" 0%, "+e+" 100%); "})}function p(a){a.style.background="";a.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);";a.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"; + a.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var q=function(f,n){function u(b){v(b);a.bind(window,"mousemove",v);a.bind(window, + "mouseup",l)}function l(){a.unbind(window,"mousemove",v);a.unbind(window,"mouseup",l)}function g(){var a=e(this.value);!1!==a?(t.__color.__state=a,t.setValue(t.__color.toOriginal())):this.value=t.__color.toString()}function k(){a.unbind(window,"mousemove",w);a.unbind(window,"mouseup",k)}function v(b){b.preventDefault();var c=a.getWidth(t.__saturation_field),d=a.getOffset(t.__saturation_field),e=(b.clientX-d.left+document.body.scrollLeft)/c;b=1-(b.clientY-d.top+document.body.scrollTop)/c;1 + b&&(b=0);1e&&(e=0);t.__color.v=b;t.__color.s=e;t.setValue(t.__color.toOriginal());return!1}function w(b){b.preventDefault();var c=a.getHeight(t.__hue_field),d=a.getOffset(t.__hue_field);b=1-(b.clientY-d.top+document.body.scrollTop)/c;1b&&(b=0);t.__color.h=360*b;t.setValue(t.__color.toOriginal());return!1}q.superclass.call(this,f,n);this.__color=new d(this.getValue());this.__temp=new d(0);var t=this;this.domElement=document.createElement("div");a.makeSelectable(this.domElement,!1); + this.__selector=document.createElement("div");this.__selector.className="selector";this.__saturation_field=document.createElement("div");this.__saturation_field.className="saturation-field";this.__field_knob=document.createElement("div");this.__field_knob.className="field-knob";this.__field_knob_border="2px solid ";this.__hue_knob=document.createElement("div");this.__hue_knob.className="hue-knob";this.__hue_field=document.createElement("div");this.__hue_field.className="hue-field";this.__input=document.createElement("input"); + this.__input.type="text";this.__input_textShadow="0 1px 1px ";a.bind(this.__input,"keydown",function(a){13===a.keyCode&&g.call(this)});a.bind(this.__input,"blur",g);a.bind(this.__selector,"mousedown",function(b){a.addClass(this,"drag").bind(window,"mouseup",function(b){a.removeClass(t.__selector,"drag")})});var y=document.createElement("div");c.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"});c.extend(this.__field_knob.style, + {position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(.5>this.__color.v?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1});c.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1});c.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"});c.extend(y.style,{width:"100%",height:"100%", + background:"none"});b(y,"top","rgba(0,0,0,0)","#000");c.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"});p(this.__hue_field);c.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"});a.bind(this.__saturation_field,"mousedown",u);a.bind(this.__field_knob,"mousedown",u);a.bind(this.__hue_field,"mousedown",function(b){w(b);a.bind(window, + "mousemove",w);a.bind(window,"mouseup",k)});this.__saturation_field.appendChild(y);this.__selector.appendChild(this.__field_knob);this.__selector.appendChild(this.__saturation_field);this.__selector.appendChild(this.__hue_field);this.__hue_field.appendChild(this.__hue_knob);this.domElement.appendChild(this.__input);this.domElement.appendChild(this.__selector);this.updateDisplay()};q.superclass=f;c.extend(q.prototype,f.prototype,{updateDisplay:function(){var a=e(this.getValue());if(!1!==a){var f=!1; + c.each(d.COMPONENTS,function(b){if(!c.isUndefined(a[b])&&!c.isUndefined(this.__color.__state[b])&&a[b]!==this.__color.__state[b])return f=!0,{}},this);f&&c.extend(this.__color.__state,a)}c.extend(this.__temp.__state,this.__color.__state);this.__temp.a=1;var l=.5>this.__color.v||.5a&&(a+=1);return{h:360*a,s:c/b,v:b/255}},rgb_to_hex:function(a,d,e){a=this.hex_with_component(0,2,a);a=this.hex_with_component(a,1,d);return a=this.hex_with_component(a,0,e)},component_from_hex:function(a,d){return a>>8*d&255},hex_with_component:function(a,d,e){return e<<(f=8*d)|a&~(255< _max ) _max = _current; + _ctx.drawImage( _canvas, 1, 0, _canvas.width - 1, _canvas.height, 0, 0, _canvas.width - 1, _canvas.height ); + if ( alarm ) { + _ctx.drawImage( _alarmCanvas, _canvas.width - 1, _canvas.height - _current * _canvas.height / _max - _elHeight ); + } else { + _ctx.drawImage( _dotCanvas, _canvas.width - 1, _canvas.height - _current * _canvas.height / _max - _elHeight ); + } + } + + _init(); + + return { + draw: _draw + }; + + } + + function StackGraph ( _dom, _num ) { + + var _canvas = document.createElement( 'canvas' ), + _ctx = _canvas.getContext( '2d' ); + + function _init () { + + _canvas.width = _elWidth; + _canvas.height = _elHeight * _num; + _canvas.style.width = _canvas.width + 'px'; + _canvas.style.height = _canvas.height + 'px'; + _canvas.className = 'rs-canvas'; + _dom.appendChild( _canvas ); + + _ctx.fillStyle = '#444444'; + _ctx.fillRect( 0, 0, _canvas.width, _canvas.height ); + + } + + function _draw ( v ) { + _ctx.drawImage( _canvas, 1, 0, _canvas.width - 1, _canvas.height, 0, 0, _canvas.width - 1, _canvas.height ); + var th = 0; + iterateKeys( v, function ( j ) { + var h = v[ j ] * _canvas.height; + _ctx.fillStyle = _colours[ j ]; + _ctx.fillRect( _canvas.width - 1, th, 1, h ); + th += h; + } ); + } + + _init(); + + return { + draw: _draw + }; + + } + + function PerfCounter ( id, group ) { + + var _id = id, + _time, + _value = 0, + _total = 0, + _averageValue = 0, + _accumValue = 0, + _accumStart = performance.now(), + _accumSamples = 0, + _dom = document.createElement( 'div' ), + _spanId = document.createElement( 'span' ), + _spanValue = document.createElement( 'div' ), + _spanValueText = document.createTextNode( '' ), + _def = _settings ? _settings.values[ _id.toLowerCase() ] : null, + _graph = new Graph( _dom, _id, _def ), + _started = false; + + _dom.className = 'rs-counter-base'; + + _spanId.className = 'rs-counter-id'; + _spanId.textContent = ( _def && _def.caption ) ? _def.caption : _id; + + _spanValue.className = 'rs-counter-value'; + _spanValue.appendChild( _spanValueText ); + + _dom.appendChild( _spanId ); + _dom.appendChild( _spanValue ); + if ( group ) group.div.appendChild( _dom ); + else _div.appendChild( _dom ); + + _time = performance.now(); + + function _average ( v ) { + if ( _def && _def.average ) { + _accumValue += v; + _accumSamples++; + var t = performance.now(); + if ( t - _accumStart >= ( _def.avgMs || 1000 ) ) { + _averageValue = _accumValue / _accumSamples; + _accumValue = 0; + _accumStart = t; + _accumSamples = 0; + } + } + } + + function _start () { + _time = performance.now(); + if( _settings.userTimingAPI ) performance.mark( _id + '-start' ); + _started = true; + } + + function _end () { + _value = performance.now() - _time; + if( _settings.userTimingAPI ) { + performance.mark( _id + '-end' ); + if( _started ) { + performance.measure( _id, _id + '-start', _id + '-end' ); + } + } + _average( _value ); + } + + function _tick () { + _end(); + _start(); + } + + function _draw () { + var v = ( _def && _def.average ) ? _averageValue : _value; + _spanValueText.nodeValue = Math.round( v * 100 ) / 100; + var a = ( _def && ( ( _def.below && _value < _def.below ) || ( _def.over && _value > _def.over ) ) ); + _graph.draw( _value, a ); + _dom.style.color = a ? '#b70000' : '#ffffff'; + } + + function _frame () { + var t = performance.now(); + var e = t - _time; + _total++; + if ( e > 1000 ) { + if ( _def && _def.interpolate === false ) { + _value = _total; + } else { + _value = _total * 1000 / e; + } + _total = 0; + _time = t; + _average( _value ); + } + } + + function _set ( v ) { + _value = v; + _average( _value ); + } + + return { + set: _set, + start: _start, + tick: _tick, + end: _end, + frame: _frame, + value: function () { + return _value; + }, + draw: _draw + }; + + } + + function sample () { + + var _value = 0; + + function _set ( v ) { + _value = v; + } + + return { + set: _set, + value: function () { + return _value; + } + }; + + } + + function _perf ( idArg ) { + + var id = idArg.toLowerCase(); + if ( id === undefined ) id = 'default'; + if ( _perfCounters[ id ] ) return _perfCounters[ id ]; + + var group = null; + if ( _settings && _settings.groups ) { + iterateKeys( _settings.groups, function ( j ) { + var g = _settings.groups[ parseInt( j, 10 ) ]; + if ( !group && g.values.indexOf( id.toLowerCase() ) !== -1 ) { + group = g; + } + } ); + } + + var p = new PerfCounter( id, group ); + _perfCounters[ id ] = p; + return p; + + } + + function _init () { + + if ( _settings.plugins ) { + if ( !_settings.values ) _settings.values = {}; + if ( !_settings.groups ) _settings.groups = []; + if ( !_settings.fractions ) _settings.fractions = []; + for ( var j = 0; j < _settings.plugins.length; j++ ) { + _settings.plugins[ j ].attach( _perf ); + iterateKeys( _settings.plugins[ j ].values, function ( k ) { + _settings.values[ k ] = _settings.plugins[ j ].values[ k ]; + } ); + _settings.groups = _settings.groups.concat( _settings.plugins[ j ].groups ); + _settings.fractions = _settings.fractions.concat( _settings.plugins[ j ].fractions ); + } + } else { + _settings.plugins = {}; + } + + _base = document.createElement( 'div' ); + _base.className = 'rs-base'; + _div = document.createElement( 'div' ); + _div.className = 'rs-container'; + _div.style.height = 'auto'; + _base.appendChild( _div ); + document.body.appendChild( _base ); + + if ( !_settings ) return; + + if ( _settings.groups ) { + iterateKeys( _settings.groups, function ( j ) { + var g = _settings.groups[ parseInt( j, 10 ) ]; + var div = document.createElement( 'div' ); + div.className = 'rs-group'; + g.div = div; + var h1 = document.createElement( 'h1' ); + h1.textContent = g.caption; + h1.addEventListener( 'click', function ( e ) { + this.classList.toggle( 'hidden' ); + e.preventDefault(); + }.bind( div ) ); + _div.appendChild( h1 ); + _div.appendChild( div ); + } ); + } + + if ( _settings.fractions ) { + iterateKeys( _settings.fractions, function ( j ) { + var f = _settings.fractions[ parseInt( j, 10 ) ]; + var div = document.createElement( 'div' ); + div.className = 'rs-fraction'; + var legend = document.createElement( 'div' ); + legend.className = 'rs-legend'; + + var h = 0; + iterateKeys( _settings.fractions[ j ].steps, function ( k ) { + var p = document.createElement( 'p' ); + p.textContent = _settings.fractions[ j ].steps[ k ]; + p.style.color = _colours[ h ]; + legend.appendChild( p ); + h++; + } ); + div.appendChild( legend ); + div.style.height = h * _elHeight + 'px'; + f.div = div; + var graph = new StackGraph( div, h ); + f.graph = graph; + _div.appendChild( div ); + } ); + } + + } + + function _update () { + + iterateKeys( _settings.plugins, function ( j ) { + _settings.plugins[ j ].update(); + } ); + + iterateKeys( _perfCounters, function ( j ) { + _perfCounters[ j ].draw(); + } ); + + if ( _settings && _settings.fractions ) { + iterateKeys( _settings.fractions, function ( j ) { + var f = _settings.fractions[ parseInt( j, 10 ) ]; + var v = []; + var base = _perfCounters[ f.base.toLowerCase() ]; + if ( base ) { + base = base.value(); + iterateKeys( _settings.fractions[ j ].steps, function ( k ) { + var s = _settings.fractions[ j ].steps[ parseInt( k, 10 ) ].toLowerCase(); + var val = _perfCounters[ s ]; + if ( val ) { + v.push( val.value() / base ); + } + } ); + } + f.graph.draw( v ); + } ); + } + + /*if( _height != _div.clientHeight ) { + _height = _div.clientHeight; + _base.style.height = _height + 2 * _elHeight + 'px'; + console.log( _base.clientHeight ); + }*/ + + } + + _init(); + + return function ( id ) { + if ( id ) return _perf( id ); + return { + element: _base, + update: _update + }; + }; + +} + +if (typeof module === 'object') { + module.exports = window.rStats; +} + +window.glStats = function () { + + var _rS = null; + + var _totalDrawArraysCalls = 0, + _totalDrawElementsCalls = 0, + _totalUseProgramCalls = 0, + _totalFaces = 0, + _totalVertices = 0, + _totalPoints = 0, + _totalBindTexures = 0; + + function _h ( f, c ) { + return function () { + c.apply( this, arguments ); + f.apply( this, arguments ); + }; + } + + WebGLRenderingContext.prototype.drawArrays = _h( WebGLRenderingContext.prototype.drawArrays, function () { + _totalDrawArraysCalls++; + if ( arguments[ 0 ] == this.POINTS ) _totalPoints += arguments[ 2 ]; + else _totalVertices += arguments[ 2 ]; + } ); + + WebGLRenderingContext.prototype.drawElements = _h( WebGLRenderingContext.prototype.drawElements, function () { + _totalDrawElementsCalls++; + _totalFaces += arguments[ 1 ] / 3; + _totalVertices += arguments[ 1 ]; + } ); + + WebGLRenderingContext.prototype.useProgram = _h( WebGLRenderingContext.prototype.useProgram, function () { + _totalUseProgramCalls++; + } ); + + WebGLRenderingContext.prototype.bindTexture = _h( WebGLRenderingContext.prototype.bindTexture, function () { + _totalBindTexures++; + } ); + + var _values = { + allcalls: { + over: 3000, + caption: 'Calls (hook)' + }, + drawelements: { + caption: 'drawElements (hook)' + }, + drawarrays: { + caption: 'drawArrays (hook)' + } + }; + + var _groups = [ { + caption: 'WebGL', + values: [ 'allcalls', 'drawelements', 'drawarrays', 'useprogram', 'bindtexture', 'glfaces', 'glvertices', 'glpoints' ] + } ]; + + var _fractions = [ { + base: 'allcalls', + steps: [ 'drawelements', 'drawarrays' ] + } ]; + + function _update () { + _rS( 'allcalls' ).set( _totalDrawArraysCalls + _totalDrawElementsCalls ); + _rS( 'drawElements' ).set( _totalDrawElementsCalls ); + _rS( 'drawArrays' ).set( _totalDrawArraysCalls ); + _rS( 'bindTexture' ).set( _totalBindTexures ); + _rS( 'useProgram' ).set( _totalUseProgramCalls ); + _rS( 'glfaces' ).set( _totalFaces ); + _rS( 'glvertices' ).set( _totalVertices ); + _rS( 'glpoints' ).set( _totalPoints ); + } + + function _start () { + _totalDrawArraysCalls = 0; + _totalDrawElementsCalls = 0; + _totalUseProgramCalls = 0; + _totalFaces = 0; + _totalVertices = 0; + _totalPoints = 0; + _totalBindTexures = 0; + } + + function _end () {} + + function _attach ( r ) { + _rS = r; + } + + return { + update: _update, + start: _start, + end: _end, + attach: _attach, + values: _values, + groups: _groups, + fractions: _fractions + }; + +}; + +window.threeStats = function ( renderer ) { + + var _rS = null; + + var _values = { + 'renderer.info.memory.geometries': { + caption: 'Geometries' + }, + 'renderer.info.memory.textures': { + caption: 'Textures' + }, + 'renderer.info.programs': { + caption: 'Programs' + }, + 'renderer.info.render.calls': { + caption: 'Calls' + }, + 'renderer.info.render.faces': { + caption: 'Faces', + over: 1000 + }, + 'renderer.info.render.points': { + caption: 'Points' + }, + 'renderer.info.render.vertices': { + caption: 'Vertices' + } + }; + + var _groups = [ { + caption: 'Three.js - Memory', + values: [ 'renderer.info.memory.geometries', 'renderer.info.programs', 'renderer.info.memory.textures' ] + }, { + caption: 'Three.js - Render', + values: [ 'renderer.info.render.calls', 'renderer.info.render.faces', 'renderer.info.render.points', 'renderer.info.render.vertices' ] + } ]; + + var _fractions = []; + + function _update () { + + _rS( 'renderer.info.memory.geometries' ).set( renderer.info.memory.geometries ); + //_rS( 'renderer.info.programs' ).set( renderer.info.programs.length ); + _rS( 'renderer.info.memory.textures' ).set( renderer.info.memory.textures ); + _rS( 'renderer.info.render.calls' ).set( renderer.info.render.calls ); + _rS( 'renderer.info.render.faces' ).set( renderer.info.render.faces ); + _rS( 'renderer.info.render.points' ).set( renderer.info.render.points ); + _rS( 'renderer.info.render.vertices' ).set( renderer.info.render.vertices ); + + } + + function _start () {} + + function _end () {} + + function _attach ( r ) { + _rS = r; + } + + return { + update: _update, + start: _start, + end: _end, + attach: _attach, + values: _values, + groups: _groups, + fractions: _fractions + }; + +}; + +/* + * From https://github.com/paulirish/memory-stats.js + */ + +window.BrowserStats = function () { + + var _rS = null; + + var _usedJSHeapSize = 0, + _totalJSHeapSize = 0; + + var memory = { + usedJSHeapSize: 0, + totalJSHeapSize: 0 + }; + + if ( window.performance && performance.memory ) + memory = performance.memory; + + if ( memory.totalJSHeapSize === 0 ) { + console.warn( 'totalJSHeapSize === 0... performance.memory is only available in Chrome .' ); + } + + var _values = { + memory: { + caption: 'Used Memory', + average: true, + avgMs: 1000, + over: 22 + }, + total: { + caption: 'Total Memory' + } + }; + + var _groups = [ { + caption: 'Browser', + values: [ 'memory', 'total' ] + } ]; + + var _fractions = [ { + base: 'total', + steps: [ 'memory' ] + } ]; + + var log1024 = Math.log( 1024 ); + + function _size ( v ) { + + var precision = 100; //Math.pow(10, 2); + var i = Math.floor( Math.log( v ) / log1024 ); + if( v === 0 ) i = 1; + return Math.round( v * precision / Math.pow( 1024, i ) ) / precision; // + ' ' + sizes[i]; + + } + + function _update () { + _usedJSHeapSize = _size( memory.usedJSHeapSize ); + _totalJSHeapSize = _size( memory.totalJSHeapSize ); + + _rS( 'memory' ).set( _usedJSHeapSize ); + _rS( 'total' ).set( _totalJSHeapSize ); + } + + function _start () { + _usedJSHeapSize = 0; + } + + function _end () {} + + function _attach ( r ) { + _rS = r; + } + + return { + update: _update, + start: _start, + end: _end, + attach: _attach, + values: _values, + groups: _groups, + fractions: _fractions + }; + +}; + +if (typeof module === 'object') { + module.exports = { + glStats: window.glStats, + threeStats: window.threeStats, + BrowserStats: window.BrowserStats + }; +} diff --git a/src/public/assets/models/teapot-claraio.json b/src/public/assets/models/teapot-claraio.json new file mode 100644 index 0000000..f75eb17 --- /dev/null +++ b/src/public/assets/models/teapot-claraio.json @@ -0,0 +1,2 @@ + +{"metadata":{"version":4.3,"type":"Object","generator":"ObjectExporter"},"geometries":[{"uuid":"15930b1c-1b50-4926-a0ac-df433b9c4f96","type":"Geometry","data":{"vertices":[0.699999988079071,1.2000000476837158,0,0.6456999778747559,1.2000000476837158,0.27469998598098755,0.6366999745368958,1.236899971961975,0.27090001106262207,0.6901999711990356,1.236899971961975,0,0.6471999883651733,1.2491999864578247,0.2754000127315521,0.7016000151634216,1.2491999864578247,0,0.6685000061988831,1.236899971961975,0.28439998626708984,0.7246000170707703,1.236899971961975,0,0.6919000148773193,1.2000000476837158,0.29440000653266907,0.75,1.2000000476837158,0,0.4970000088214874,1.2000000476837158,0.4970000088214874,0.4900999963283539,1.236899971961975,0.4900999963283539,0.49810001254081726,1.2491999864578247,0.49810001254081726,0.5145000219345093,1.236899971961975,0.5145000219345093,0.5325000286102295,1.2000000476837158,0.5325000286102295,0.27469998598098755,1.2000000476837158,0.6456999778747559,0.27090001106262207,1.236899971961975,0.6366999745368958,0.2754000127315521,1.2491999864578247,0.6471999883651733,0.28439998626708984,1.236899971961975,0.6685000061988831,0.29440000653266907,1.2000000476837158,0.6919000148773193,0,1.2000000476837158,0.699999988079071,0,1.236899971961975,0.6901999711990356,0,1.2491999864578247,0.7016000151634216,0,1.236899971961975,0.7246000170707703,0,1.2000000476837158,0.75,-0.2937000095844269,1.2000000476837158,0.6456999778747559,-0.27889999747276306,1.236899971961975,0.6366999745368958,-0.2777000069618225,1.2491999864578247,0.6471999883651733,-0.2847000062465668,1.236899971961975,0.6685000061988831,-0.29440000653266907,1.2000000476837158,0.6919000148773193,-0.5138999819755554,1.2000000476837158,0.4970000088214874,-0.49720001220703125,1.236899971961975,0.4900999963283539,-0.5001999735832214,1.2491999864578247,0.49810001254081726,-0.5146999955177307,1.236899971961975,0.5145000219345093,-0.5325000286102295,1.2000000476837158,0.5325000286102295,-0.6521000266075134,1.2000000476837158,0.27469998598098755,-0.6394000053405762,1.236899971961975,0.27090001106262207,-0.6480000019073486,1.2491999864578247,0.2754000127315521,-0.6686000227928162,1.236899971961975,0.28439998626708984,-0.6919000148773193,1.2000000476837158,0.29440000653266907,-0.699999988079071,1.2000000476837158,0,-0.6901999711990356,1.236899971961975,0,-0.7016000151634216,1.2491999864578247,0,-0.7246000170707703,1.236899971961975,0,-0.75,1.2000000476837158,0,-0.6456999778747559,1.2000000476837158,-0.27469998598098755,-0.6366999745368958,1.236899971961975,-0.27090001106262207,-0.6471999883651733,1.2491999864578247,-0.2754000127315521,-0.6685000061988831,1.236899971961975,-0.28439998626708984,-0.6919000148773193,1.2000000476837158,-0.29440000653266907,-0.4970000088214874,1.2000000476837158,-0.4970000088214874,-0.4900999963283539,1.236899971961975,-0.4900999963283539,-0.49810001254081726,1.2491999864578247,-0.49810001254081726,-0.5145000219345093,1.236899971961975,-0.5145000219345093,-0.5325000286102295,1.2000000476837158,-0.5325000286102295,-0.27469998598098755,1.2000000476837158,-0.6456999778747559,-0.27090001106262207,1.236899971961975,-0.6366999745368958,-0.2754000127315521,1.2491999864578247,-0.6471999883651733,-0.28439998626708984,1.236899971961975,-0.6685000061988831,-0.29440000653266907,1.2000000476837158,-0.6919000148773193,0,1.2000000476837158,-0.699999988079071,0,1.236899971961975,-0.6901999711990356,0,1.2491999864578247,-0.7016000151634216,0,1.236899971961975,-0.7246000170707703,0,1.2000000476837158,-0.75,0.27469998598098755,1.2000000476837158,-0.6456999778747559,0.27090001106262207,1.236899971961975,-0.6366999745368958,0.2754000127315521,1.2491999864578247,-0.6471999883651733,0.28439998626708984,1.236899971961975,-0.6685000061988831,0.29440000653266907,1.2000000476837158,-0.6919000148773193,0.4970000088214874,1.2000000476837158,-0.4970000088214874,0.4900999963283539,1.236899971961975,-0.4900999963283539,0.49810001254081726,1.2491999864578247,-0.49810001254081726,0.5145000219345093,1.236899971961975,-0.5145000219345093,0.5325000286102295,1.2000000476837158,-0.5325000286102295,0.6456999778747559,1.2000000476837158,-0.27469998598098755,0.6366999745368958,1.236899971961975,-0.27090001106262207,0.6471999883651733,1.2491999864578247,-0.2754000127315521,0.6685000061988831,1.236899971961975,-0.28439998626708984,0.6919000148773193,1.2000000476837158,-0.29440000653266907,0.7766000032424927,1.0037000179290771,0.3303999900817871,0.8417999744415283,1.0037000179290771,0,0.8503999710083008,0.8108999729156494,0.3617999851703644,0.9218999743461609,0.8108999729156494,0,0.9027000069618225,0.6251999735832214,0.3840999901294708,0.9785000085830688,0.6251999735832214,0,0.9225000143051147,0.44999998807907104,0.39250001311302185,1,0.44999998807907104,0,0.5976999998092651,1.0037000179290771,0.5976999998092651,0.6545000076293945,0.8108999729156494,0.6545000076293945,0.6947000026702881,0.6251999735832214,0.6947000026702881,0.7099999785423279,0.44999998807907104,0.7099999785423279,0.3303999900817871,1.0037000179290771,0.7766000032424927,0.3617999851703644,0.8108999729156494,0.8503999710083008,0.3840999901294708,0.6251999735832214,0.9027000069618225,0.39250001311302185,0.44999998807907104,0.9225000143051147,0,1.0037000179290771,0.8417999744415283,0,0.8108999729156494,0.9218999743461609,0,0.6251999735832214,0.9785000085830688,0,0.44999998807907104,1,-0.3303999900817871,1.0037000179290771,0.7766000032424927,-0.3617999851703644,0.8108999729156494,0.8503999710083008,-0.3840999901294708,0.6251999735832214,0.9027000069618225,-0.39250001311302185,0.44999998807907104,0.9225000143051147,-0.5976999998092651,1.0037000179290771,0.5976999998092651,-0.6545000076293945,0.8108999729156494,0.6545000076293945,-0.6947000026702881,0.6251999735832214,0.6947000026702881,-0.7099999785423279,0.44999998807907104,0.7099999785423279,-0.7766000032424927,1.0037000179290771,0.3303999900817871,-0.8503999710083008,0.8108999729156494,0.3617999851703644,-0.9027000069618225,0.6251999735832214,0.3840999901294708,-0.9225000143051147,0.44999998807907104,0.39250001311302185,-0.8417999744415283,1.0037000179290771,0,-0.9218999743461609,0.8108999729156494,0,-0.9785000085830688,0.6251999735832214,0,-1,0.44999998807907104,0,-0.7766000032424927,1.0037000179290771,-0.3303999900817871,-0.8503999710083008,0.8108999729156494,-0.3617999851703644,-0.9027000069618225,0.6251999735832214,-0.3840999901294708,-0.9225000143051147,0.44999998807907104,-0.39250001311302185,-0.5976999998092651,1.0037000179290771,-0.5976999998092651,-0.6545000076293945,0.8108999729156494,-0.6545000076293945,-0.6947000026702881,0.6251999735832214,-0.6947000026702881,-0.7099999785423279,0.44999998807907104,-0.7099999785423279,-0.3303999900817871,1.0037000179290771,-0.7766000032424927,-0.3617999851703644,0.8108999729156494,-0.8503999710083008,-0.3840999901294708,0.6251999735832214,-0.9027000069618225,-0.39250001311302185,0.44999998807907104,-0.9225000143051147,0,1.0037000179290771,-0.8417999744415283,0,0.8108999729156494,-0.9218999743461609,0,0.6251999735832214,-0.9785000085830688,0,0.44999998807907104,-1,0.3303999900817871,1.0037000179290771,-0.7766000032424927,0.3617999851703644,0.8108999729156494,-0.8503999710083008,0.3840999901294708,0.6251999735832214,-0.9027000069618225,0.39250001311302185,0.44999998807907104,-0.9225000143051147,0.5976999998092651,1.0037000179290771,-0.5976999998092651,0.6545000076293945,0.8108999729156494,-0.6545000076293945,0.6947000026702881,0.6251999735832214,-0.6947000026702881,0.7099999785423279,0.44999998807907104,-0.7099999785423279,0.7766000032424927,1.0037000179290771,-0.3303999900817871,0.8503999710083008,0.8108999729156494,-0.3617999851703644,0.9027000069618225,0.6251999735832214,-0.3840999901294708,0.9225000143051147,0.44999998807907104,-0.39250001311302185,0.8865000009536743,0.301800012588501,0.37720000743865967,0.9609000086784363,0.301800012588501,0,0.807200014591217,0.19220000505447388,0.3434000015258789,0.875,0.19220000505447388,0,0.7279000282287598,0.11779999732971191,0.30970001220703125,0.7890999913215637,0.11779999732971191,0,0.6919000148773193,0.07500000298023224,0.29440000653266907,0.75,0.07500000298023224,0,0.6822999715805054,0.301800012588501,0.6822999715805054,0.6212999820709229,0.19220000505447388,0.6212999820709229,0.5601999759674072,0.11779999732971191,0.5601999759674072,0.5325000286102295,0.07500000298023224,0.5325000286102295,0.37720000743865967,0.301800012588501,0.8865000009536743,0.3434000015258789,0.19220000505447388,0.807200014591217,0.30970001220703125,0.11779999732971191,0.7279000282287598,0.29440000653266907,0.07500000298023224,0.6919000148773193,0,0.301800012588501,0.9609000086784363,0,0.19220000505447388,0.875,0,0.11779999732971191,0.7890999913215637,0,0.07500000298023224,0.75,-0.37720000743865967,0.301800012588501,0.8865000009536743,-0.3434000015258789,0.19220000505447388,0.807200014591217,-0.30970001220703125,0.11779999732971191,0.7279000282287598,-0.29440000653266907,0.07500000298023224,0.6919000148773193,-0.6822999715805054,0.301800012588501,0.6822999715805054,-0.6212999820709229,0.19220000505447388,0.6212999820709229,-0.5601999759674072,0.11779999732971191,0.5601999759674072,-0.5325000286102295,0.07500000298023224,0.5325000286102295,-0.8865000009536743,0.301800012588501,0.37720000743865967,-0.807200014591217,0.19220000505447388,0.3434000015258789,-0.7279000282287598,0.11779999732971191,0.30970001220703125,-0.6919000148773193,0.07500000298023224,0.29440000653266907,-0.9609000086784363,0.301800012588501,0,-0.875,0.19220000505447388,0,-0.7890999913215637,0.11779999732971191,0,-0.75,0.07500000298023224,0,-0.8865000009536743,0.301800012588501,-0.37720000743865967,-0.807200014591217,0.19220000505447388,-0.3434000015258789,-0.7279000282287598,0.11779999732971191,-0.30970001220703125,-0.6919000148773193,0.07500000298023224,-0.29440000653266907,-0.6822999715805054,0.301800012588501,-0.6822999715805054,-0.6212999820709229,0.19220000505447388,-0.6212999820709229,-0.5601999759674072,0.11779999732971191,-0.5601999759674072,-0.5325000286102295,0.07500000298023224,-0.5325000286102295,-0.37720000743865967,0.301800012588501,-0.8865000009536743,-0.3434000015258789,0.19220000505447388,-0.807200014591217,-0.30970001220703125,0.11779999732971191,-0.7279000282287598,-0.29440000653266907,0.07500000298023224,-0.6919000148773193,0,0.301800012588501,-0.9609000086784363,0,0.19220000505447388,-0.875,0,0.11779999732971191,-0.7890999913215637,0,0.07500000298023224,-0.75,0.37720000743865967,0.301800012588501,-0.8865000009536743,0.3434000015258789,0.19220000505447388,-0.807200014591217,0.30970001220703125,0.11779999732971191,-0.7279000282287598,0.29440000653266907,0.07500000298023224,-0.6919000148773193,0.6822999715805054,0.301800012588501,-0.6822999715805054,0.6212999820709229,0.19220000505447388,-0.6212999820709229,0.5601999759674072,0.11779999732971191,-0.5601999759674072,0.5325000286102295,0.07500000298023224,-0.5325000286102295,0.8865000009536743,0.301800012588501,-0.37720000743865967,0.807200014591217,0.19220000505447388,-0.3434000015258789,0.7279000282287598,0.11779999732971191,-0.30970001220703125,0.6919000148773193,0.07500000298023224,-0.29440000653266907,0.6761999726295471,0.04749999940395355,0.28769999742507935,0.7329999804496765,0.04749999940395355,0,0.5924000144004822,0.023399999365210533,0.25209999084472656,0.6421999931335449,0.023399999365210533,0,0.3853999972343445,0.006399999838322401,0.164000004529953,0.41780000925064087,0.006399999838322401,0,0,0,0,0.5203999876976013,0.04749999940395355,0.5203999876976013,0.4560000002384186,0.023399999365210533,0.4560000002384186,0.29660001397132874,0.006399999838322401,0.29660001397132874,0.28769999742507935,0.04749999940395355,0.6761999726295471,0.25209999084472656,0.023399999365210533,0.5924000144004822,0.164000004529953,0.006399999838322401,0.3853999972343445,0,0.04749999940395355,0.7329999804496765,0,0.023399999365210533,0.6421999931335449,0,0.006399999838322401,0.41780000925064087,-0.28769999742507935,0.04749999940395355,0.6761999726295471,-0.25209999084472656,0.023399999365210533,0.5924000144004822,-0.164000004529953,0.006399999838322401,0.3853999972343445,-0.5203999876976013,0.04749999940395355,0.5203999876976013,-0.4560000002384186,0.023399999365210533,0.4560000002384186,-0.29660001397132874,0.006399999838322401,0.29660001397132874,-0.6761999726295471,0.04749999940395355,0.28769999742507935,-0.5924000144004822,0.023399999365210533,0.25209999084472656,-0.3853999972343445,0.006399999838322401,0.164000004529953,-0.7329999804496765,0.04749999940395355,0,-0.6421999931335449,0.023399999365210533,0,-0.41780000925064087,0.006399999838322401,0,-0.6761999726295471,0.04749999940395355,-0.28769999742507935,-0.5924000144004822,0.023399999365210533,-0.25209999084472656,-0.3853999972343445,0.006399999838322401,-0.164000004529953,-0.5203999876976013,0.04749999940395355,-0.5203999876976013,-0.4560000002384186,0.023399999365210533,-0.4560000002384186,-0.29660001397132874,0.006399999838322401,-0.29660001397132874,-0.28769999742507935,0.04749999940395355,-0.6761999726295471,-0.25209999084472656,0.023399999365210533,-0.5924000144004822,-0.164000004529953,0.006399999838322401,-0.3853999972343445,0,0.04749999940395355,-0.7329999804496765,0,0.023399999365210533,-0.6421999931335449,0,0.006399999838322401,-0.41780000925064087,0.28769999742507935,0.04749999940395355,-0.6761999726295471,0.25209999084472656,0.023399999365210533,-0.5924000144004822,0.164000004529953,0.006399999838322401,-0.3853999972343445,0.5203999876976013,0.04749999940395355,-0.5203999876976013,0.4560000002384186,0.023399999365210533,-0.4560000002384186,0.29660001397132874,0.006399999838322401,-0.29660001397132874,0.6761999726295471,0.04749999940395355,-0.28769999742507935,0.5924000144004822,0.023399999365210533,-0.25209999084472656,0.3853999972343445,0.006399999838322401,-0.164000004529953,-0.800000011920929,1.0125000476837158,0,-0.7922000288963318,1.0300999879837036,0.0843999981880188,-1.0405999422073364,1.027999997138977,0.0843999981880188,-1.0335999727249146,1.010699987411499,0,-1.2229000329971313,1.013800024986267,0.0843999981880188,-1.2063000202178955,0.9983999729156494,0,-1.3351000547409058,0.9751999974250793,0.0843999981880188,-1.3133000135421753,0.9649999737739563,0,-1.3733999729156494,0.8999999761581421,0.0843999981880188,-1.350000023841858,0.8999999761581421,0,-0.7749999761581421,1.0687999725341797,0.11249999701976776,-1.055899977684021,1.066100001335144,0.11249999701976776,-1.2594000101089478,1.047700047492981,0.11249999701976776,-1.3832000494003296,0.9976000189781189,0.11249999701976776,-1.4249999523162842,0.8999999761581421,0.11249999701976776,-0.7577999830245972,1.1073999404907227,0.0843999981880188,-1.0712000131607056,1.104200005531311,0.0843999981880188,-1.2958999872207642,1.0815000534057617,0.0843999981880188,-1.4313000440597534,1.0198999643325806,0.0843999981880188,-1.4766000509262085,0.8999999761581421,0.0843999981880188,-0.75,1.125,0,-1.0780999660491943,1.121500015258789,0,-1.3125,1.0968999862670898,0,-1.4530999660491943,1.0300999879837036,0,-1.5,0.8999999761581421,0,-0.7577999830245972,1.1073999404907227,-0.0843999981880188,-1.0712000131607056,1.104200005531311,-0.0843999981880188,-1.2958999872207642,1.0815000534057617,-0.0843999981880188,-1.4313000440597534,1.0198999643325806,-0.0843999981880188,-1.4766000509262085,0.8999999761581421,-0.0843999981880188,-0.7749999761581421,1.0687999725341797,-0.11249999701976776,-1.055899977684021,1.066100001335144,-0.11249999701976776,-1.2594000101089478,1.047700047492981,-0.11249999701976776,-1.3832000494003296,0.9976000189781189,-0.11249999701976776,-1.4249999523162842,0.8999999761581421,-0.11249999701976776,-0.7922000288963318,1.0300999879837036,-0.0843999981880188,-1.0405999422073364,1.027999997138977,-0.0843999981880188,-1.2229000329971313,1.013800024986267,-0.0843999981880188,-1.3351000547409058,0.9751999974250793,-0.0843999981880188,-1.3733999729156494,0.8999999761581421,-0.0843999981880188,-1.3517999649047852,0.7882000207901001,0.0843999981880188,-1.3305000066757202,0.7979999780654907,0,-1.2839000225067139,0.6600000262260437,0.0843999981880188,-1.2687000036239624,0.675000011920929,0,-1.1655000448226929,0.5333999991416931,0.0843999981880188,-1.1601999998092651,0.5519999861717224,0,-0.9922000169754028,0.42660000920295715,0.0843999981880188,-1.3985999822616577,0.7666000127792358,0.11249999701976776,-1.317199945449829,0.6269999742507935,0.11249999701976776,-1.1770999431610107,0.4925999939441681,0.11249999701976776,-0.9750000238418579,0.375,0.11249999701976776,-1.4455000162124634,0.7448999881744385,0.0843999981880188,-1.3504999876022339,0.5939000248908997,0.0843999981880188,-1.1887999773025513,0.45179998874664307,0.0843999981880188,-0.9577999711036682,0.32339999079704285,0.0843999981880188,-1.4667999744415283,0.7350999712944031,0,-1.3655999898910522,0.5788999795913696,0,-1.194100022315979,0.4332999885082245,0,-0.949999988079071,0.30000001192092896,0,-1.4455000162124634,0.7448999881744385,-0.0843999981880188,-1.3504999876022339,0.5939000248908997,-0.0843999981880188,-1.1887999773025513,0.45179998874664307,-0.0843999981880188,-0.9577999711036682,0.32339999079704285,-0.0843999981880188,-1.3985999822616577,0.7666000127792358,-0.11249999701976776,-1.317199945449829,0.6269999742507935,-0.11249999701976776,-1.1770999431610107,0.4925999939441681,-0.11249999701976776,-0.9750000238418579,0.375,-0.11249999701976776,-1.3517999649047852,0.7882000207901001,-0.0843999981880188,-1.2839000225067139,0.6600000262260437,-0.0843999981880188,-1.1655000448226929,0.5333999991416931,-0.0843999981880188,-0.9922000169754028,0.42660000920295715,-0.0843999981880188,0.8500000238418579,0.7124999761581421,0,0.8500000238418579,0.6480000019073486,0.18559999763965607,1.108199954032898,0.7197999954223633,0.16760000586509705,1.0898000001907349,0.7675999999046326,0,1.2172000408172607,0.8722000122070312,0.12800000607967377,1.1937999725341797,0.8999999761581421,0,1.2792999744415283,1.0505000352859497,0.08829999715089798,1.2508000135421753,1.0605000257492065,0,1.3969000577926636,1.2000000476837158,0.07029999792575836,1.350000023841858,1.2000000476837158,0,0.8500000238418579,0.5062999725341797,0.2475000023841858,1.1483999490737915,0.6146000027656555,0.22349999845027924,1.2687000036239624,0.8108999729156494,0.17059999704360962,1.3422000408172607,1.0283000469207764,0.11779999732971191,1.5,1.2000000476837158,0.09380000084638596,0.8500000238418579,0.3644999861717224,0.18559999763965607,1.1886999607086182,0.5095000267028809,0.16760000586509705,1.3202999830245972,0.7497000098228455,0.12800000607967377,1.4049999713897705,1.0061999559402466,0.08829999715089798,1.6030999422073364,1.2000000476837158,0.07029999792575836,0.8500000238418579,0.30000001192092896,0,1.2070000171661377,0.4616999924182892,0,1.3437000513076782,0.7218999862670898,0,1.4335999488830566,0.9961000084877014,0,1.649999976158142,1.2000000476837158,0,0.8500000238418579,0.3644999861717224,-0.18559999763965607,1.1886999607086182,0.5095000267028809,-0.16760000586509705,1.3202999830245972,0.7497000098228455,-0.12800000607967377,1.4049999713897705,1.0061999559402466,-0.08829999715089798,1.6030999422073364,1.2000000476837158,-0.07029999792575836,0.8500000238418579,0.5062000155448914,-0.2475000023841858,1.1483999490737915,0.6146000027656555,-0.22349999845027924,1.2687000036239624,0.8108999729156494,-0.17059999704360962,1.3422000408172607,1.0283000469207764,-0.11779999732971191,1.5,1.2000000476837158,-0.09380000084638596,0.8500000238418579,0.6480000019073486,-0.18559999763965607,1.108199954032898,0.7197999954223633,-0.16760000586509705,1.2172000408172607,0.8722000122070312,-0.12800000607967377,1.2792999744415283,1.0505000352859497,-0.08829999715089798,1.3969000577926636,1.2000000476837158,-0.07029999792575836,1.4361000061035156,1.222100019454956,0.06589999794960022,1.3859000205993652,1.2210999727249146,0,1.4595999717712402,1.2297999858856201,0.056299999356269836,1.412500023841858,1.2280999422073364,0,1.4602999687194824,1.222499966621399,0.04659999907016754,1.420300006866455,1.2210999727249146,0,1.4312000274658203,1.2000000476837158,0.0421999990940094,1.399999976158142,1.2000000476837158,0,1.5465999841690063,1.2244000434875488,0.08789999783039093,1.5633000135421753,1.2333999872207642,0.07500000298023224,1.54830002784729,1.2257000207901,0.06210000067949295,1.5,1.2000000476837158,0.056299999356269836,1.656999945640564,1.226699948310852,0.06589999794960022,1.6669000387191772,1.2369999885559082,0.056299999356269836,1.6363999843597412,1.2288999557495117,0.04659999907016754,1.5687999725341797,1.2000000476837158,0.0421999990940094,1.707200050354004,1.2276999950408936,0,1.7141000032424927,1.238700032234192,0,1.6763999462127686,1.230299949645996,0,1.600000023841858,1.2000000476837158,0,1.656999945640564,1.226699948310852,-0.06589999794960022,1.6669000387191772,1.2369999885559082,-0.056299999356269836,1.6363999843597412,1.2288999557495117,-0.04659999907016754,1.5687999725341797,1.2000000476837158,-0.0421999990940094,1.5465999841690063,1.2244000434875488,-0.08789999783039093,1.5633000135421753,1.2333999872207642,-0.07500000298023224,1.54830002784729,1.2257000207901,-0.06210000067949295,1.5,1.2000000476837158,-0.056299999356269836,1.4361000061035156,1.222100019454956,-0.06589999794960022,1.4595999717712402,1.2297999858856201,-0.056299999356269836,1.4602999687194824,1.222499966621399,-0.04659999907016754,1.4312000274658203,1.2000000476837158,-0.0421999990940094,0.15719999372959137,1.5504000186920166,0.06700000166893005,0.17030000686645508,1.5504000186920166,0,0,1.5750000476837158,0,0.15000000596046448,1.4905999898910522,0.06390000134706497,0.16249999403953552,1.4905999898910522,0,0.09080000221729279,1.4168000221252441,0.03869999945163727,0.09839999675750732,1.4168000221252441,0,0.09229999780654907,1.350000023841858,0.03929999843239784,0.10000000149011612,1.350000023841858,0,0.12110000103712082,1.5504000186920166,0.12110000103712082,0.11550000309944153,1.4905999898910522,0.11550000309944153,0.06989999860525131,1.4168000221252441,0.06989999860525131,0.07100000232458115,1.350000023841858,0.07100000232458115,0.06700000166893005,1.5504000186920166,0.15719999372959137,0.06390000134706497,1.4905999898910522,0.15000000596046448,0.03869999945163727,1.4168000221252441,0.09080000221729279,0.03929999843239784,1.350000023841858,0.09229999780654907,0,1.5504000186920166,0.17030000686645508,0,1.4905999898910522,0.16249999403953552,0,1.4168000221252441,0.09839999675750732,0,1.350000023841858,0.10000000149011612,-0.06700000166893005,1.5504000186920166,0.15719999372959137,-0.06390000134706497,1.4905999898910522,0.15000000596046448,-0.03869999945163727,1.4168000221252441,0.09080000221729279,-0.03929999843239784,1.350000023841858,0.09229999780654907,-0.12110000103712082,1.5504000186920166,0.12110000103712082,-0.11550000309944153,1.4905999898910522,0.11550000309944153,-0.06989999860525131,1.4168000221252441,0.06989999860525131,-0.07100000232458115,1.350000023841858,0.07100000232458115,-0.15719999372959137,1.5504000186920166,0.06700000166893005,-0.15000000596046448,1.4905999898910522,0.06390000134706497,-0.09080000221729279,1.4168000221252441,0.03869999945163727,-0.09229999780654907,1.350000023841858,0.03929999843239784,-0.17030000686645508,1.5504000186920166,0,-0.16249999403953552,1.4905999898910522,0,-0.09839999675750732,1.4168000221252441,0,-0.10000000149011612,1.350000023841858,0,-0.15719999372959137,1.5504000186920166,-0.06700000166893005,-0.15000000596046448,1.4905999898910522,-0.06390000134706497,-0.09080000221729279,1.4168000221252441,-0.03869999945163727,-0.09229999780654907,1.350000023841858,-0.03929999843239784,-0.12110000103712082,1.5504000186920166,-0.12110000103712082,-0.11550000309944153,1.4905999898910522,-0.11550000309944153,-0.06989999860525131,1.4168000221252441,-0.06989999860525131,-0.07100000232458115,1.350000023841858,-0.07100000232458115,-0.06700000166893005,1.5504000186920166,-0.15719999372959137,-0.06390000134706497,1.4905999898910522,-0.15000000596046448,-0.03869999945163727,1.4168000221252441,-0.09080000221729279,-0.03929999843239784,1.350000023841858,-0.09229999780654907,0,1.5504000186920166,-0.17030000686645508,0,1.4905999898910522,-0.16249999403953552,0,1.4168000221252441,-0.09839999675750732,0,1.350000023841858,-0.10000000149011612,0.06700000166893005,1.5504000186920166,-0.15719999372959137,0.06390000134706497,1.4905999898910522,-0.15000000596046448,0.03869999945163727,1.4168000221252441,-0.09080000221729279,0.03929999843239784,1.350000023841858,-0.09229999780654907,0.12110000103712082,1.5504000186920166,-0.12110000103712082,0.11550000309944153,1.4905999898910522,-0.11550000309944153,0.06989999860525131,1.4168000221252441,-0.06989999860525131,0.07100000232458115,1.350000023841858,-0.07100000232458115,0.15719999372959137,1.5504000186920166,-0.06700000166893005,0.15000000596046448,1.4905999898910522,-0.06390000134706497,0.09080000221729279,1.4168000221252441,-0.03869999945163727,0.09229999780654907,1.350000023841858,-0.03929999843239784,0.21040000021457672,1.3055000305175781,0.08950000256299973,0.2281000018119812,1.3055000305175781,0,0.3804999887943268,1.274999976158142,0.16189999878406525,0.4124999940395355,1.274999976158142,0,0.53329998254776,1.2445000410079956,0.22689999639987946,0.5781000256538391,1.2445000410079956,0,0.5996000170707703,1.2000000476837158,0.2551000118255615,0.6499999761581421,1.2000000476837158,0,0.16200000047683716,1.3055000305175781,0.16200000047683716,0.2928999960422516,1.274999976158142,0.2928999960422516,0.4104999899864197,1.2445000410079956,0.4104999899864197,0.46149998903274536,1.2000000476837158,0.46149998903274536,0.08950000256299973,1.3055000305175781,0.21040000021457672,0.16189999878406525,1.274999976158142,0.3804999887943268,0.22689999639987946,1.2445000410079956,0.53329998254776,0.2551000118255615,1.2000000476837158,0.5996000170707703,0,1.3055000305175781,0.2281000018119812,0,1.274999976158142,0.4124999940395355,0,1.2445000410079956,0.5781000256538391,0,1.2000000476837158,0.6499999761581421,-0.08950000256299973,1.3055000305175781,0.21040000021457672,-0.16189999878406525,1.274999976158142,0.3804999887943268,-0.22689999639987946,1.2445000410079956,0.53329998254776,-0.2551000118255615,1.2000000476837158,0.5996000170707703,-0.16200000047683716,1.3055000305175781,0.16200000047683716,-0.2928999960422516,1.274999976158142,0.2928999960422516,-0.4104999899864197,1.2445000410079956,0.4104999899864197,-0.46149998903274536,1.2000000476837158,0.46149998903274536,-0.21040000021457672,1.3055000305175781,0.08950000256299973,-0.3804999887943268,1.274999976158142,0.16189999878406525,-0.53329998254776,1.2445000410079956,0.22689999639987946,-0.5996000170707703,1.2000000476837158,0.2551000118255615,-0.2281000018119812,1.3055000305175781,0,-0.4124999940395355,1.274999976158142,0,-0.5781000256538391,1.2445000410079956,0,-0.6499999761581421,1.2000000476837158,0,-0.21040000021457672,1.3055000305175781,-0.08950000256299973,-0.3804999887943268,1.274999976158142,-0.16189999878406525,-0.53329998254776,1.2445000410079956,-0.22689999639987946,-0.5996000170707703,1.2000000476837158,-0.2551000118255615,-0.16200000047683716,1.3055000305175781,-0.16200000047683716,-0.2928999960422516,1.274999976158142,-0.2928999960422516,-0.4104999899864197,1.2445000410079956,-0.4104999899864197,-0.46149998903274536,1.2000000476837158,-0.46149998903274536,-0.08950000256299973,1.3055000305175781,-0.21040000021457672,-0.16189999878406525,1.274999976158142,-0.3804999887943268,-0.22689999639987946,1.2445000410079956,-0.53329998254776,-0.2551000118255615,1.2000000476837158,-0.5996000170707703,0,1.3055000305175781,-0.2281000018119812,0,1.274999976158142,-0.4124999940395355,0,1.2445000410079956,-0.5781000256538391,0,1.2000000476837158,-0.6499999761581421,0.08950000256299973,1.3055000305175781,-0.21040000021457672,0.16189999878406525,1.274999976158142,-0.3804999887943268,0.22689999639987946,1.2445000410079956,-0.53329998254776,0.2551000118255615,1.2000000476837158,-0.5996000170707703,0.16200000047683716,1.3055000305175781,-0.16200000047683716,0.2928999960422516,1.274999976158142,-0.2928999960422516,0.4104999899864197,1.2445000410079956,-0.4104999899864197,0.46149998903274536,1.2000000476837158,-0.46149998903274536,0.21040000021457672,1.3055000305175781,-0.08950000256299973,0.3804999887943268,1.274999976158142,-0.16189999878406525,0.53329998254776,1.2445000410079956,-0.22689999639987946,0.5996000170707703,1.2000000476837158,-0.2551000118255615],"normals":[-0.9494920694323845,-0.2515364269786189,-0.1876012686200115,-0.96670001745224,-0.2558000087738037,0,-0.8930000066757202,-0.2563000023365021,-0.3698999881744385,-0.8934000134468079,0.25600001215934753,-0.36910000443458557,-0.9667999744415283,0.25540000200271606,0,-0.7260149722024023,0.6725622315424132,-0.14339562350586094,-0.08389999717473984,0.9958000183105469,-0.03550000116229057,-0.09210000187158585,0.9958000183105469,0,0.46895168053340897,0.8783596159888912,0.09256730699733487,0.6297000050544739,0.7318999767303467,0.2603999972343445,0.6819999814033508,0.7312999963760376,0,0.8131828855771891,0.5594560236122703,0.16044485734451933,0.8036999702453613,0.4934000074863434,0.3325999975204468,0.8702999949455261,0.4925000071525574,0,-0.8045241032084407,-0.25135180073328567,-0.5381108060843871,-0.6833999752998352,-0.2567000091075897,-0.6833999752998352,-0.6834999918937683,0.25609999895095825,-0.6834999918937683,-0.6154172153756186,0.6720670779897282,-0.41181002137110273,-0.0649000033736229,0.9958000183105469,-0.0649000033736229,0.39550647488952684,0.8794788320983019,0.2647482053035805,0.4814000129699707,0.7325000166893005,0.4814000129699707,0.6880720658725188,0.5607374353912905,0.4605761182657241,0.614799976348877,0.49399998784065247,0.614799976348877,-0.5381108060843871,-0.25135180073328567,-0.8045241032084407,-0.3698999881744385,-0.2563000023365021,-0.8930000066757202,-0.36910000443458557,0.25600001215934753,-0.8934000134468079,-0.41181002137110273,0.6720670779897282,-0.6154172153756186,-0.03550000116229057,0.9958000183105469,-0.08389999717473984,0.2647482053035805,0.8794788320983019,0.39550647488952684,0.2603999972343445,0.7318999767303467,0.6297000050544739,0.4605761182657241,0.5607374353912905,0.6880720658725188,0.3325999975204468,0.4934000074863434,0.8036999702453613,-0.1876012686200115,-0.2515364269786189,-0.9494920694323845,-0.00279999990016222,-0.2578999996185303,-0.9661999940872192,-0.0019000000320374966,0.2547000050544739,-0.9670000076293945,-0.14339562350586094,0.6725622315424132,-0.7260149722024023,-0.0003000000142492354,0.9957000017166138,-0.09229999780654907,0.09256730699733487,0.8783596159888912,0.46895168053340897,0,0.7312999963760376,0.6820999979972839,0.16044485734451933,0.5594560236122703,0.8131828855771891,0,0.4925000071525574,0.8702999949455261,0.17781356971082418,-0.2762617871652753,-0.94449021137275,0.3790999948978424,-0.35929998755455017,-0.8528000116348267,0.37709999084472656,0.14910000562667847,-0.9140999913215637,0.14395780863022883,0.6540767852077758,-0.7426033317906966,0.027499999850988388,0.9921000003814697,-0.1225999966263771,-0.09276555608813127,0.8766296536816158,0.47213875279382633,-0.26100000739097595,0.7268000245094299,0.6353999972343445,-0.16042337038321952,0.5590076148671953,0.8134954386813597,-0.33250001072883606,0.4925000071525574,0.8043000102043152,0.5155281298975289,-0.3849732031227696,-0.7655235986968341,0.6635000109672546,-0.4108000099658966,-0.6252999901771545,0.7127000093460083,0.07370000332593918,-0.6976000070571899,0.4638206739517661,0.5539062400248373,-0.691417572582934,0.09969999641180038,0.987500011920929,-0.12200000137090683,-0.2749668019071642,0.8694154310328366,0.4104997760424887,-0.48730000853538513,0.723800003528595,0.4885999858379364,-0.46145001001631164,0.5585924142572216,0.6892302974987636,-0.6151999831199646,0.4925999939441681,0.6154999732971191,0.7799397173089967,-0.38252671106395425,-0.495345690085779,0.8799999952316284,-0.3328999876976013,-0.33869999647140503,0.9172999858856201,0.1670999974012375,-0.36149999499320984,0.6935905336506715,0.5583449082267957,-0.4551737416497001,0.1136000007390976,0.9923999905586243,-0.04809999838471413,-0.41112556129251077,0.8694462651166909,0.2739324094125316,-0.6341000199317932,0.7275000214576721,0.26190000772476196,-0.6892193216130235,0.5588149346665281,0.46119691619624625,-0.804099977016449,0.4925999939441681,0.3327000141143799,0.940120720168391,-0.2953801644080805,-0.1700693681540597,0.96670001745224,-0.2556999921798706,0.010499999858438969,0.9674000144004822,0.2529999911785126,0.008100000210106373,0.7547291638439781,0.639985268644528,-0.1442315678392254,0.0934000015258789,0.9955999851226807,0.0013000000035390258,-0.4746532582851164,0.8752533177838288,0.09292961910888725,-0.682200014591217,0.7311999797821045,-0.0003000000142492354,-0.8137112475669765,0.5586976998809986,0.1604084964416667,-0.8702999949455261,0.4925000071525574,-0.00009999999747378752,0.9494920694323845,-0.2515364269786189,0.1876012686200115,0.8930000066757202,-0.2563000023365021,0.3698999881744385,0.8934000134468079,0.25600001215934753,0.36910000443458557,0.7260149722024023,0.6725622315424132,0.14339562350586094,0.08389999717473984,0.9958000183105469,0.03550000116229057,-0.46895168053340897,0.8783596159888912,-0.09256730699733487,-0.6297000050544739,0.7318999767303467,-0.2603999972343445,-0.8131828855771891,0.5594560236122703,-0.16044485734451933,-0.8036999702453613,0.4934000074863434,-0.3325999975204468,0.8045241032084407,-0.25135180073328567,0.5381108060843871,0.6833999752998352,-0.2567000091075897,0.6833999752998352,0.6834999918937683,0.25609999895095825,0.6834999918937683,0.6154172153756186,0.6720670779897282,0.41181002137110273,0.0649000033736229,0.9958000183105469,0.0649000033736229,-0.39550647488952684,0.8794788320983019,-0.2647482053035805,-0.4814000129699707,0.7325000166893005,-0.4814000129699707,-0.6880720658725188,0.5607374353912905,-0.4605761182657241,-0.614799976348877,0.49399998784065247,-0.614799976348877,0.5381108060843871,-0.25135180073328567,0.8045241032084407,0.3698999881744385,-0.2563000023365021,0.8930000066757202,0.36910000443458557,0.25600001215934753,0.8934000134468079,0.41181002137110273,0.6720670779897282,0.6154172153756186,0.03550000116229057,0.9958000183105469,0.08389999717473984,-0.2647482053035805,0.8794788320983019,-0.39550647488952684,-0.2603999972343445,0.7318999767303467,-0.6297000050544739,-0.4605761182657241,0.5607374353912905,-0.6880720658725188,-0.3325999975204468,0.4934000074863434,-0.8036999702453613,0.1876012686200115,-0.2515364269786189,0.9494920694323845,0,-0.2558000087738037,0.96670001745224,0,0.25540000200271606,0.9667999744415283,0.14339562350586094,0.6725622315424132,0.7260149722024023,0,0.9958000183105469,0.09210000187158585,-0.09256730699733487,0.8783596159888912,-0.46895168053340897,0,0.7312999963760376,-0.6819999814033508,-0.16044485734451933,0.5594560236122703,-0.8131828855771891,0,0.4925000071525574,-0.8702999949455261,-0.1876012686200115,-0.2515364269786189,0.9494920694323845,-0.3698999881744385,-0.2563000023365021,0.8930000066757202,-0.36910000443458557,0.25600001215934753,0.8934000134468079,-0.14339562350586094,0.6725622315424132,0.7260149722024023,-0.03550000116229057,0.9958000183105469,0.08389999717473984,0.09256730699733487,0.8783596159888912,-0.46895168053340897,0.2603999972343445,0.7318999767303467,-0.6297000050544739,0.16044485734451933,0.5594560236122703,-0.8131828855771891,0.3325999975204468,0.4934000074863434,-0.8036999702453613,-0.5381108060843871,-0.25135180073328567,0.8045241032084407,-0.6833999752998352,-0.2567000091075897,0.6833999752998352,-0.6834999918937683,0.25609999895095825,0.6834999918937683,-0.41181002137110273,0.6720670779897282,0.6154172153756186,-0.0649000033736229,0.9958000183105469,0.0649000033736229,0.2647482053035805,0.8794788320983019,-0.39550647488952684,0.4814000129699707,0.7325000166893005,-0.4814000129699707,0.4605761182657241,0.5607374353912905,-0.6880720658725188,0.614799976348877,0.49399998784065247,-0.614799976348877,-0.8045241032084407,-0.25135180073328567,0.5381108060843871,-0.8930000066757202,-0.2563000023365021,0.3698999881744385,-0.8934000134468079,0.25600001215934753,0.36910000443458557,-0.6154172153756186,0.6720670779897282,0.41181002137110273,-0.08389999717473984,0.9958000183105469,0.03550000116229057,0.39550647488952684,0.8794788320983019,-0.2647482053035805,0.6297000050544739,0.7318999767303467,-0.2603999972343445,0.6880720658725188,0.5607374353912905,-0.4605761182657241,0.8036999702453613,0.4934000074863434,-0.3325999975204468,-0.9494920694323845,-0.2515364269786189,0.1876012686200115,-0.7260149722024023,0.6725622315424132,0.14339562350586094,0.46895168053340897,0.8783596159888912,-0.09256730699733487,0.8131828855771891,0.5594560236122703,-0.16044485734451933,0.89170186696973,0.4170154906217081,0.175971193734185,0.8453999757766724,0.4034999907016754,0.3497999906539917,0.9153000116348267,0.4027000069618225,0,0.9085685972138349,0.37723739278916374,0.17942980142250198,0.8700000047683716,0.336899995803833,0.36000001430511475,0.9417999982833862,0.3361999988555908,0,0.9398615330526648,0.28672575430335634,0.18560344960982264,0.90420001745224,0.20579999685287476,0.3743000030517578,0.9786999821662903,0.2053000032901764,0,0.974048141581515,0.11941584930670929,0.19227603286929457,0.9218999743461609,-0.06639999896287918,0.38179999589920044,0.9977999925613403,-0.06620000302791595,0,0.7547722509117953,0.41841261984957023,0.5052224547703327,0.6467999815940857,0.4041000008583069,0.6467999815940857,0.7692780597174184,0.3783166747117983,0.5148667404993367,0.6657000184059143,0.33739998936653137,0.6657000184059143,0.7957963785535204,0.28785546405722773,0.5327732685613087,0.6919000148773193,0.2061000019311905,0.6919000148773193,0.8249659082595298,0.1199935753008835,0.5522977386302068,0.7055000066757202,-0.06650000065565109,0.7055000066757202,0.5052224547703327,0.41841261984957023,0.7547722509117953,0.3497999906539917,0.4034999907016754,0.8453999757766724,0.5148667404993367,0.3783166747117983,0.7692780597174184,0.36000001430511475,0.336899995803833,0.8700000047683716,0.5327732685613087,0.28785546405722773,0.7957963785535204,0.3743000030517578,0.20579999685287476,0.90420001745224,0.5522977386302068,0.1199935753008835,0.8249659082595298,0.38179999589920044,-0.06639999896287918,0.9218999743461609,0.175971193734185,0.4170154906217081,0.89170186696973,0,0.4027000069618225,0.9153000116348267,0.17942980142250198,0.37723739278916374,0.9085685972138349,0,0.3361999988555908,0.9417999982833862,0.18560344960982264,0.28672575430335634,0.9398615330526648,0,0.2053000032901764,0.9786999821662903,0.19227603286929457,0.11941584930670929,0.974048141581515,0,-0.06620000302791595,0.9977999925613403,-0.175971193734185,0.4170154906217081,0.89170186696973,-0.3497999906539917,0.4034999907016754,0.8453999757766724,-0.17942980142250198,0.37723739278916374,0.9085685972138349,-0.36000001430511475,0.336899995803833,0.8700000047683716,-0.18560344960982264,0.28672575430335634,0.9398615330526648,-0.3743000030517578,0.20579999685287476,0.90420001745224,-0.19227603286929457,0.11941584930670929,0.974048141581515,-0.38179999589920044,-0.06639999896287918,0.9218999743461609,-0.5052224547703327,0.41841261984957023,0.7547722509117953,-0.6467999815940857,0.4041000008583069,0.6467999815940857,-0.5148667404993367,0.3783166747117983,0.7692780597174184,-0.6657000184059143,0.33739998936653137,0.6657000184059143,-0.5327732685613087,0.28785546405722773,0.7957963785535204,-0.6919000148773193,0.2061000019311905,0.6919000148773193,-0.5522977386302068,0.1199935753008835,0.8249659082595298,-0.7055000066757202,-0.06650000065565109,0.7055000066757202,-0.7547722509117953,0.41841261984957023,0.5052224547703327,-0.8453999757766724,0.4034999907016754,0.3497999906539917,-0.7692780597174184,0.3783166747117983,0.5148667404993367,-0.8700000047683716,0.336899995803833,0.36000001430511475,-0.7957963785535204,0.28785546405722773,0.5327732685613087,-0.90420001745224,0.20579999685287476,0.3743000030517578,-0.8249659082595298,0.1199935753008835,0.5522977386302068,-0.9218999743461609,-0.06639999896287918,0.38179999589920044,-0.89170186696973,0.4170154906217081,0.175971193734185,-0.9153000116348267,0.4027000069618225,0,-0.9085685972138349,0.37723739278916374,0.17942980142250198,-0.9417999982833862,0.3361999988555908,0,-0.9398615330526648,0.28672575430335634,0.18560344960982264,-0.9786999821662903,0.2053000032901764,0,-0.974048141581515,0.11941584930670929,0.19227603286929457,-0.9977999925613403,-0.06620000302791595,0,-0.89170186696973,0.4170154906217081,-0.175971193734185,-0.8453999757766724,0.4034999907016754,-0.3497999906539917,-0.9085685972138349,0.37723739278916374,-0.17942980142250198,-0.8700000047683716,0.336899995803833,-0.36000001430511475,-0.9398615330526648,0.28672575430335634,-0.18560344960982264,-0.90420001745224,0.20579999685287476,-0.3743000030517578,-0.974048141581515,0.11941584930670929,-0.19227603286929457,-0.9218999743461609,-0.06639999896287918,-0.38179999589920044,-0.7547722509117953,0.41841261984957023,-0.5052224547703327,-0.6467999815940857,0.4041000008583069,-0.6467999815940857,-0.7692780597174184,0.3783166747117983,-0.5148667404993367,-0.6657000184059143,0.33739998936653137,-0.6657000184059143,-0.7957963785535204,0.28785546405722773,-0.5327732685613087,-0.6919000148773193,0.2061000019311905,-0.6919000148773193,-0.8249659082595298,0.1199935753008835,-0.5522977386302068,-0.7055000066757202,-0.06650000065565109,-0.7055000066757202,-0.5052224547703327,0.41841261984957023,-0.7547722509117953,-0.3497999906539917,0.4034999907016754,-0.8453999757766724,-0.5148667404993367,0.3783166747117983,-0.7692780597174184,-0.36000001430511475,0.336899995803833,-0.8700000047683716,-0.5327732685613087,0.28785546405722773,-0.7957963785535204,-0.3743000030517578,0.20579999685287476,-0.90420001745224,-0.5522977386302068,0.1199935753008835,-0.8249659082595298,-0.38179999589920044,-0.06639999896287918,-0.9218999743461609,-0.175971193734185,0.4170154906217081,-0.89170186696973,0,0.4027000069618225,-0.9153000116348267,-0.17942980142250198,0.37723739278916374,-0.9085685972138349,0,0.3361999988555908,-0.9417999982833862,-0.18560344960982264,0.28672575430335634,-0.9398615330526648,0,0.2053000032901764,-0.9786999821662903,-0.19227603286929457,0.11941584930670929,-0.974048141581515,0,-0.06620000302791595,-0.9977999925613403,0.175971193734185,0.4170154906217081,-0.89170186696973,0.3497999906539917,0.4034999907016754,-0.8453999757766724,0.17942980142250198,0.37723739278916374,-0.9085685972138349,0.36000001430511475,0.336899995803833,-0.8700000047683716,0.18560344960982264,0.28672575430335634,-0.9398615330526648,0.3743000030517578,0.20579999685287476,-0.90420001745224,0.19227603286929457,0.11941584930670929,-0.974048141581515,0.38179999589920044,-0.06639999896287918,-0.9218999743461609,0.5052224547703327,0.41841261984957023,-0.7547722509117953,0.6467999815940857,0.4041000008583069,-0.6467999815940857,0.5148667404993367,0.3783166747117983,-0.7692780597174184,0.6657000184059143,0.33739998936653137,-0.6657000184059143,0.5327732685613087,0.28785546405722773,-0.7957963785535204,0.6919000148773193,0.2061000019311905,-0.6919000148773193,0.5522977386302068,0.1199935753008835,-0.8249659082595298,0.7055000066757202,-0.06650000065565109,-0.7055000066757202,0.7547722509117953,0.41841261984957023,-0.5052224547703327,0.8453999757766724,0.4034999907016754,-0.3497999906539917,0.7692780597174184,0.3783166747117983,-0.5148667404993367,0.8700000047683716,0.336899995803833,-0.36000001430511475,0.7957963785535204,0.28785546405722773,-0.5327732685613087,0.90420001745224,0.20579999685287476,-0.3743000030517578,0.8249659082595298,0.1199935753008835,-0.5522977386302068,0.9218999743461609,-0.06639999896287918,-0.38179999589920044,0.89170186696973,0.4170154906217081,-0.175971193734185,0.9085685972138349,0.37723739278916374,-0.17942980142250198,0.9398615330526648,0.28672575430335634,-0.18560344960982264,0.974048141581515,0.11941584930670929,-0.19227603286929457,0.949837996375371,-0.25034021126228206,0.18745015141838892,0.8313999772071838,-0.43619999289512634,0.3441999852657318,0.9002000093460083,-0.43549999594688416,0,0.7776228852967049,-0.6097170963557023,0.15345263332507184,0.6735000014305115,-0.6847000122070312,0.2786000072956085,0.7296000123023987,-0.683899998664856,0,0.649169927361788,-0.7497580231546305,0.12822368004526918,0.6403999924659729,-0.7208999991416931,0.26489999890327454,0.6940000057220459,-0.7200000286102295,0,0.7309008795580111,-0.6670453977388504,0.14434106005134031,0.7329000234603882,-0.609000027179718,0.30320000648498535,0.7939000129699707,-0.6079999804496765,0,0.8044401026352556,-0.2509927077580416,0.5384039207922486,0.6360999941825867,-0.4368000030517578,0.6360999941825867,0.6577259751592633,-0.611316221873683,0.4401011457322989,0.5149999856948853,-0.6852999925613403,0.5149999856948853,0.5484574657551682,-0.7513248159850185,0.3670223823454051,0.48969998955726624,-0.7214000225067139,0.48969998955726624,0.6183258124965243,-0.6680727822223783,0.41394679278158897,0.5605999827384949,-0.6096000075340271,0.5605999827384949,0.5384039207922486,-0.2509927077580416,0.8044401026352556,0.3441999852657318,-0.43619999289512634,0.8313999772071838,0.44010114573229886,-0.6113162218736828,0.6577259751592632,0.2786000072956085,-0.6847000122070312,0.6735000014305115,0.3670223823454051,-0.7513248159850185,0.5484574657551682,0.26489999890327454,-0.7208999991416931,0.6403999924659729,0.41394679278158897,-0.6680727822223783,0.6183258124965243,0.30320000648498535,-0.609000027179718,0.7329000234603882,0.18745015141838892,-0.25034021126228206,0.949837996375371,0,-0.43549999594688416,0.9002000093460083,0.15345263332507184,-0.6097170963557023,0.7776228852967049,0,-0.683899998664856,0.7296000123023987,0.12822368004526918,-0.7497580231546305,0.649169927361788,0,-0.7200000286102295,0.6940000057220459,0.14434106005134031,-0.6670453977388504,0.7309008795580111,0,-0.6079999804496765,0.7939000129699707,-0.18745015141838892,-0.25034021126228206,0.949837996375371,-0.3441999852657318,-0.43619999289512634,0.8313999772071838,-0.15345263332507184,-0.6097170963557023,0.7776228852967049,-0.2786000072956085,-0.6847000122070312,0.6735000014305115,-0.12822368004526918,-0.7497580231546305,0.649169927361788,-0.26489999890327454,-0.7208999991416931,0.6403999924659729,-0.14434106005134031,-0.6670453977388504,0.7309008795580111,-0.30320000648498535,-0.609000027179718,0.7329000234603882,-0.5384039207922486,-0.2509927077580416,0.8044401026352556,-0.6360999941825867,-0.4368000030517578,0.6360999941825867,-0.44010114573229886,-0.6113162218736828,0.6577259751592632,-0.5149999856948853,-0.6852999925613403,0.5149999856948853,-0.3670223823454051,-0.7513248159850185,0.5484574657551682,-0.48969998955726624,-0.7214000225067139,0.48969998955726624,-0.41394679278158897,-0.6680727822223783,0.6183258124965243,-0.5605999827384949,-0.6096000075340271,0.5605999827384949,-0.8044401026352556,-0.2509927077580416,0.5384039207922486,-0.8313999772071838,-0.43619999289512634,0.3441999852657318,-0.6577259751592633,-0.611316221873683,0.4401011457322989,-0.6735000014305115,-0.6847000122070312,0.2786000072956085,-0.5484574657551682,-0.7513248159850185,0.3670223823454051,-0.6403999924659729,-0.7208999991416931,0.26489999890327454,-0.6183258124965243,-0.6680727822223783,0.41394679278158897,-0.7329000234603882,-0.609000027179718,0.30320000648498535,-0.949837996375371,-0.25034021126228206,0.18745015141838892,-0.9002000093460083,-0.43549999594688416,0,-0.7776228852967049,-0.6097170963557023,0.15345263332507184,-0.7296000123023987,-0.683899998664856,0,-0.649169927361788,-0.7497580231546305,0.12822368004526918,-0.6940000057220459,-0.7200000286102295,0,-0.7309008795580111,-0.6670453977388504,0.14434106005134031,-0.7939000129699707,-0.6079999804496765,0,-0.949837996375371,-0.25034021126228206,-0.18745015141838892,-0.8313999772071838,-0.43619999289512634,-0.3441999852657318,-0.7776228852967049,-0.6097170963557023,-0.15345263332507184,-0.6735000014305115,-0.6847000122070312,-0.2786000072956085,-0.649169927361788,-0.7497580231546305,-0.12822368004526918,-0.6403999924659729,-0.7208999991416931,-0.26489999890327454,-0.7309008795580111,-0.6670453977388504,-0.14434106005134031,-0.7329000234603882,-0.609000027179718,-0.30320000648498535,-0.8044401026352556,-0.2509927077580416,-0.5384039207922486,-0.6360999941825867,-0.4368000030517578,-0.6360999941825867,-0.6577259751592633,-0.611316221873683,-0.4401011457322989,-0.5149999856948853,-0.6852999925613403,-0.5149999856948853,-0.5484574657551682,-0.7513248159850185,-0.3670223823454051,-0.48969998955726624,-0.7214000225067139,-0.48969998955726624,-0.6183258124965243,-0.6680727822223783,-0.41394679278158897,-0.5605999827384949,-0.6096000075340271,-0.5605999827384949,-0.5384039207922486,-0.2509927077580416,-0.8044401026352556,-0.3441999852657318,-0.43619999289512634,-0.8313999772071838,-0.44010114573229886,-0.6113162218736828,-0.6577259751592632,-0.2786000072956085,-0.6847000122070312,-0.6735000014305115,-0.3670223823454051,-0.7513248159850185,-0.5484574657551682,-0.26489999890327454,-0.7208999991416931,-0.6403999924659729,-0.41394679278158897,-0.6680727822223783,-0.6183258124965243,-0.30320000648498535,-0.609000027179718,-0.7329000234603882,-0.18745015141838892,-0.25034021126228206,-0.949837996375371,0,-0.43549999594688416,-0.9002000093460083,-0.15345263332507184,-0.6097170963557023,-0.7776228852967049,0,-0.683899998664856,-0.7296000123023987,-0.12822368004526918,-0.7497580231546305,-0.649169927361788,0,-0.7200000286102295,-0.6940000057220459,-0.14434106005134031,-0.6670453977388504,-0.7309008795580111,0,-0.6079999804496765,-0.7939000129699707,0.18745015141838892,-0.25034021126228206,-0.949837996375371,0.3441999852657318,-0.43619999289512634,-0.8313999772071838,0.15345263332507184,-0.6097170963557023,-0.7776228852967049,0.2786000072956085,-0.6847000122070312,-0.6735000014305115,0.12822368004526918,-0.7497580231546305,-0.649169927361788,0.26489999890327454,-0.7208999991416931,-0.6403999924659729,0.14434106005134031,-0.6670453977388504,-0.7309008795580111,0.30320000648498535,-0.609000027179718,-0.7329000234603882,0.5384039207922486,-0.2509927077580416,-0.8044401026352556,0.6360999941825867,-0.4368000030517578,-0.6360999941825867,0.44010114573229886,-0.6113162218736828,-0.6577259751592632,0.5149999856948853,-0.6852999925613403,-0.5149999856948853,0.3670223823454051,-0.7513248159850185,-0.5484574657551682,0.48969998955726624,-0.7214000225067139,-0.48969998955726624,0.41394679278158897,-0.6680727822223783,-0.6183258124965243,0.5605999827384949,-0.6096000075340271,-0.5605999827384949,0.8044401026352556,-0.2509927077580416,-0.5384039207922486,0.8313999772071838,-0.43619999289512634,-0.3441999852657318,0.6577259751592633,-0.611316221873683,-0.4401011457322989,0.6735000014305115,-0.6847000122070312,-0.2786000072956085,0.5484574657551682,-0.7513248159850185,-0.3670223823454051,0.6403999924659729,-0.7208999991416931,-0.26489999890327454,0.6183258124965243,-0.6680727822223783,-0.41394679278158897,0.7329000234603882,-0.609000027179718,-0.30320000648498535,0.949837996375371,-0.25034021126228206,-0.18745015141838892,0.7776228852967049,-0.6097170963557023,-0.15345263332507184,0.649169927361788,-0.7497580231546305,-0.12822368004526918,0.7309008795580111,-0.6670453977388504,-0.14434106005134031,0.8387035316725441,-0.518815353093059,0.16555064287077373,0.576200008392334,-0.7817999720573425,0.23819999396800995,0.6238999962806702,-0.781499981880188,0,0.25616783727492487,-0.9653076593733025,0.050588159692990436,0.16359999775886536,-0.9842000007629395,0.06750000268220901,0.17730000615119934,-0.9842000007629395,0,0.07553202574448914,-0.9970317293860195,0.014921249426803469,0.04540000110864639,-0.9987999796867371,0.018699999898672104,0.04919999837875366,-0.9987999796867371,0,0.015316466366009897,-0.9998781173537434,0.003025937076820533,0,-1,0,0.7093394127545394,-0.5208703290912265,0.47490177698703395,0.44040000438690186,-0.7822999954223633,0.44040000438690186,0.21633036433079836,-0.9655254553343809,0.14478179640355507,0.12489999830722809,-0.9843000173568726,0.12489999830722809,0.06371717584979004,-0.9970565493361698,0.04264222001229404,0.034699998795986176,-0.9987999796867371,0.034699998795986176,0.01292177647076656,-0.9998790650449104,0.008653495117885388,0.47490177698703395,-0.5208703290912265,0.7093394127545394,0.23819999396800995,-0.7817999720573425,0.576200008392334,0.14478179640355507,-0.9655254553343809,0.21633036433079836,0.06750000268220901,-0.9842000007629395,0.16359999775886536,0.04264222001229404,-0.9970565493361698,0.06371717584979004,0.018699999898672104,-0.9987999796867371,0.04540000110864639,0.008653495117885388,-0.9998790650449104,0.01292177647076656,0.16555064287077373,-0.5188153530930589,0.838703531672544,0,-0.781499981880188,0.6238999962806702,0.050588159692990436,-0.9653076593733025,0.25616783727492487,0,-0.9842000007629395,0.17730000615119934,0.014921249426803469,-0.9970317293860195,0.07553202574448914,0,-0.9987999796867371,0.04919999837875366,0.003025937076820533,-0.9998781173537434,0.015316466366009897,-0.16555064287077373,-0.5188153530930589,0.838703531672544,-0.23819999396800995,-0.7817999720573425,0.576200008392334,-0.050588159692990436,-0.9653076593733025,0.25616783727492487,-0.06750000268220901,-0.9842000007629395,0.16359999775886536,-0.014921249426803469,-0.9970317293860195,0.07553202574448914,-0.018699999898672104,-0.9987999796867371,0.04540000110864639,-0.003025937076820533,-0.9998781173537434,0.015316466366009897,-0.47490177698703395,-0.5208703290912265,0.7093394127545394,-0.44040000438690186,-0.7822999954223633,0.44040000438690186,-0.14478179640355507,-0.9655254553343809,0.21633036433079836,-0.12489999830722809,-0.9843000173568726,0.12489999830722809,-0.04264222001229404,-0.9970565493361698,0.06371717584979004,-0.034699998795986176,-0.9987999796867371,0.034699998795986176,-0.008653495117885388,-0.9998790650449104,0.01292177647076656,-0.7093394127545394,-0.5208703290912265,0.47490177698703395,-0.576200008392334,-0.7817999720573425,0.23819999396800995,-0.21633036433079836,-0.9655254553343809,0.14478179640355507,-0.16359999775886536,-0.9842000007629395,0.06750000268220901,-0.06371717584979004,-0.9970565493361698,0.04264222001229404,-0.04540000110864639,-0.9987999796867371,0.018699999898672104,-0.01292177647076656,-0.9998790650449104,0.008653495117885388,-0.8387035316725441,-0.518815353093059,0.16555064287077373,-0.6238999962806702,-0.781499981880188,0,-0.25616783727492487,-0.9653076593733025,0.050588159692990436,-0.17730000615119934,-0.9842000007629395,0,-0.07553202574448914,-0.9970317293860195,0.014921249426803469,-0.04919999837875366,-0.9987999796867371,0,-0.015316466366009897,-0.9998781173537434,0.003025937076820533,-0.8387035316725441,-0.518815353093059,-0.16555064287077373,-0.576200008392334,-0.7817999720573425,-0.23819999396800995,-0.25616783727492487,-0.9653076593733025,-0.050588159692990436,-0.16359999775886536,-0.9842000007629395,-0.06750000268220901,-0.07553202574448914,-0.9970317293860195,-0.014921249426803469,-0.04540000110864639,-0.9987999796867371,-0.018699999898672104,-0.015316466366009897,-0.9998781173537434,-0.003025937076820533,-0.7093394127545394,-0.5208703290912265,-0.47490177698703395,-0.44040000438690186,-0.7822999954223633,-0.44040000438690186,-0.21633036433079836,-0.9655254553343809,-0.14478179640355507,-0.12489999830722809,-0.9843000173568726,-0.12489999830722809,-0.06371717584979004,-0.9970565493361698,-0.04264222001229404,-0.034699998795986176,-0.9987999796867371,-0.034699998795986176,-0.01292177647076656,-0.9998790650449104,-0.008653495117885388,-0.47490177698703395,-0.5208703290912265,-0.7093394127545394,-0.23819999396800995,-0.7817999720573425,-0.576200008392334,-0.14478179640355507,-0.9655254553343809,-0.21633036433079836,-0.06750000268220901,-0.9842000007629395,-0.16359999775886536,-0.04264222001229404,-0.9970565493361698,-0.06371717584979004,-0.018699999898672104,-0.9987999796867371,-0.04540000110864639,-0.008653495117885388,-0.9998790650449104,-0.01292177647076656,-0.16555064287077373,-0.5188153530930589,-0.838703531672544,0,-0.781499981880188,-0.6238999962806702,-0.050588159692990436,-0.9653076593733025,-0.25616783727492487,0,-0.9842000007629395,-0.17730000615119934,-0.014921249426803469,-0.9970317293860195,-0.07553202574448914,0,-0.9987999796867371,-0.04919999837875366,-0.003025937076820533,-0.9998781173537434,-0.015316466366009897,0.16555064287077373,-0.5188153530930589,-0.838703531672544,0.23819999396800995,-0.7817999720573425,-0.576200008392334,0.050588159692990436,-0.9653076593733025,-0.25616783727492487,0.06750000268220901,-0.9842000007629395,-0.16359999775886536,0.014921249426803469,-0.9970317293860195,-0.07553202574448914,0.018699999898672104,-0.9987999796867371,-0.04540000110864639,0.003025937076820533,-0.9998781173537434,-0.015316466366009897,0.47490177698703395,-0.5208703290912265,-0.7093394127545394,0.44040000438690186,-0.7822999954223633,-0.44040000438690186,0.14478179640355507,-0.9655254553343809,-0.21633036433079836,0.12489999830722809,-0.9843000173568726,-0.12489999830722809,0.04264222001229404,-0.9970565493361698,-0.06371717584979004,0.034699998795986176,-0.9987999796867371,-0.034699998795986176,0.008653495117885388,-0.9998790650449104,-0.01292177647076656,0.7093394127545394,-0.5208703290912265,-0.47490177698703395,0.576200008392334,-0.7817999720573425,-0.23819999396800995,0.21633036433079836,-0.9655254553343809,-0.14478179640355507,0.16359999775886536,-0.9842000007629395,-0.06750000268220901,0.06371717584979004,-0.9970565493361698,-0.04264222001229404,0.04540000110864639,-0.9987999796867371,-0.018699999898672104,0.01292177647076656,-0.9998790650449104,-0.008653495117885388,0.8387035316725441,-0.518815353093059,-0.16555064287077373,0.25616783727492487,-0.9653076593733025,-0.050588159692990436,0.07553202574448914,-0.9970317293860195,-0.014921249426803469,0.015316466366009897,-0.9998781173537434,-0.003025937076820533,0.007923619032407068,-0.9792649536215844,0.20242867106698378,0.007799999788403511,-1,-0.00019999999494757503,0.007000000216066837,-0.8125,0.5828999876976013,0.03610000014305115,-0.8373000025749207,0.5455999970436096,0.03909999877214432,-0.9991999864578247,-0.0010000000474974513,0.07294431178951416,-0.9771793893951642,0.19949829151861947,0.16179999709129333,-0.8104000091552734,0.5630000233650208,0.17949999868869781,-0.9836999773979187,-0.004399999976158142,0.30508737694808447,-0.9288212891929031,0.2102681744082329,0.48240000009536743,-0.5950999855995178,0.6427000164985657,0.6122999787330627,-0.7906000018119812,-0.010499999858438969,0.85242181732101,-0.45600261568139905,0.2558098118659036,0.7386999726295471,-0.11460000276565552,0.6642000079154968,0.9861999750137329,-0.1657000035047531,-0.0066999997943639755,0.005356055160839852,-0.5906212413030134,0.8069311383227207,-0.0019000000320374966,0.16210000216960907,0.9868000149726868,0.00279999990016222,0.017100000753998756,0.9998000264167786,0.050017369857379264,-0.5919248852555064,0.8044396763759266,0.010499999858438969,0.07339999824762344,0.9972000122070312,0.19813039646486702,-0.5271562130528779,0.8263477918143327,-0.06599999964237213,0.13009999692440033,0.989300012588501,0.4449202026559152,-0.20623851513417835,0.8714996776498938,-0.09440000355243683,0.016599999740719795,0.9954000115394592,-0.005868425724113912,0.5911289942558654,0.8065556854486675,-0.009200000204145908,0.8715000152587891,0.4902999997138977,-0.04859999939799309,0.8406000137329102,0.5394999980926514,-0.0565568733345604,0.5892386602454603,0.8059771221013369,-0.2232999950647354,0.8029000163078308,0.5526999831199646,-0.21826903582935248,0.5064932454046728,0.8341601886673605,-0.5964000225067139,0.5600000023841858,0.5751000046730042,-0.4519125123063575,0.18097256755074448,0.8735124561304479,-0.8033000230789185,0.0681999996304512,0.5916000008583069,-0.010227406140092809,0.9792477063934721,0.20240881820407414,-0.010599999688565731,0.9998999834060669,0.00009999999747378752,-0.058800000697374344,0.9983000159263611,0.000699999975040555,-0.1003582147149349,0.9740903926657386,0.2026724837158167,-0.2806999981403351,0.9598000049591064,0.0032999999821186066,-0.4107606469303811,0.8829429191860411,0.22734883415704424,-0.7497000098228455,0.6617000102996826,0.00430000014603138,-0.905303034236947,0.33387590683454604,0.26258959430409023,-0.9973999857902527,0.07270000129938126,0.002099999925121665,-0.010227406140092809,0.9792477063934721,-0.20240881820407414,-0.008799999952316284,0.8715000152587891,-0.4902999997138977,-0.04650000110268593,0.8411999940872192,-0.5388000011444092,-0.1003582147149349,0.9740903926657386,-0.2026724837158167,-0.21789999306201935,0.8068000078201294,-0.5491999983787537,-0.4107606469303811,0.8829429191860411,-0.22734883415704424,-0.5972999930381775,0.5600000023841858,-0.5741000175476074,-0.905303034236947,0.33387590683454604,-0.26258959430409023,-0.8040000200271606,0.06289999932050705,-0.5913000106811523,-0.005868425724113912,0.5911289942558654,-0.8065556854486675,-0.0017999999690800905,0.16169999539852142,-0.9868000149726868,0.0020000000949949026,0.014600000344216824,-0.9998999834060669,-0.0565568733345604,0.5892386602454603,-0.8059771221013369,0.009200000204145908,0.060100000351667404,-0.998199999332428,-0.21826903582935248,0.5064932454046728,-0.8341601886673605,-0.059300001710653305,0.11389999836683273,-0.9916999936103821,-0.4519125123063575,0.18097256755074448,-0.8735124561304479,-0.0869000032544136,0.012299999594688416,-0.9961000084877014,0.005356055160839852,-0.5906212413030134,-0.8069311383227207,0.006399999838322401,-0.8123999834060669,-0.5831000208854675,0.033799998462200165,-0.8374999761581421,-0.5454000234603882,0.050017369857379264,-0.5919248852555064,-0.8044396763759266,0.15710000693798065,-0.8119000196456909,-0.5622000098228455,0.19813039646486702,-0.5271562130528779,-0.8263477918143327,0.4844000041484833,-0.5893999934196472,-0.6464999914169312,0.4449202026559152,-0.20623851513417835,-0.8714996776498938,0.7389000058174133,-0.10130000114440918,-0.6661999821662903,0.007923619032407068,-0.9792649536215844,-0.20242867106698378,0.07294431178951416,-0.9771793893951642,-0.19949829151861947,0.30508737694808447,-0.9288212891929031,-0.2102681744082329,0.85242181732101,-0.45600261568139905,-0.2558098118659036,0.9478292644663923,0.18220680595344424,0.2615728680221666,0.725600004196167,0.25940001010894775,0.6373999714851379,0.9465000033378601,0.32269999384880066,-0.0034000000450760126,0.8600566042901111,0.44406573291460566,0.25121357898803404,0.6459000110626221,0.4620000123977661,0.607699990272522,0.8258000016212463,0.5638999938964844,-0.007499999832361937,0.722097468072962,0.6564257510605728,0.21835860401454446,0.5315999984741211,0.6366999745368958,0.5586000084877014,0.6499999761581421,0.7598999738693237,-0.006899999920278788,0.5200506551893511,0.8306365796457171,0.1989728338029867,0.42500001192092896,0.6816999912261963,0.5954999923706055,0.5324000120162964,0.8464999794960022,-0.005200000014156103,0.4781972352408055,0.09361119253153362,0.8732493050904043,-0.04960000142455101,-0.01979999989271164,0.9986000061035156,0.4393956565632051,0.2449654752923344,0.8642472868966327,-0.03779999911785126,-0.035599999129772186,0.9986000061035156,0.39562746673558924,0.3918378901601171,0.830627458852191,-0.03790000081062317,-0.0364999994635582,0.9986000061035156,0.3039318735441624,0.5084492756925236,0.8056703732244866,-0.1688999980688095,-0.29789999127388,0.9394999742507935,-0.47742285385863215,-0.09515362565485244,0.8735062713788696,-0.7422999739646912,-0.29919999837875366,0.5995000004768372,-0.42856464276720363,-0.26014738661504994,0.8652489145946263,-0.6195999979972839,-0.5293999910354614,0.5795000195503235,-0.3729119034765285,-0.40703367257705336,0.8338227039568712,-0.4837000072002411,-0.6858000159263611,0.5437999963760376,-0.2896259899317443,-0.5099064991908379,0.8100074987547963,-0.44530001282691956,-0.7943999767303467,0.4131999909877777,-0.9462576942087682,-0.19013883790828634,0.26161727479199826,-0.9265000224113464,-0.37630000710487366,0.0020000000949949026,-0.8154980530103969,-0.5208357818286896,0.25237474894123124,-0.7538999915122986,-0.6570000052452087,0.00430000014603138,-0.6370197706643513,-0.7377648710591707,0.22340279052371467,-0.5662000179290771,-0.8241999745368958,0.0035000001080334187,-0.4721523712289914,-0.8571632880733152,0.2057747212905012,-0.48179998993873596,-0.8762999773025513,0.0019000000320374966,-0.9462576942087682,-0.19013883790828634,-0.26161727479199826,-0.744700014591217,-0.29440000653266907,-0.5989999771118164,-0.8154980530103969,-0.5208357818286896,-0.25237474894123124,-0.6219000220298767,-0.5281000137329102,-0.5781999826431274,-0.6370197706643513,-0.7377648710591707,-0.22340279052371467,-0.4812000095844269,-0.6883000135421753,-0.5428000092506409,-0.4721523712289914,-0.8571632880733152,-0.2057747212905012,-0.43810001015663147,-0.796999990940094,-0.4156999886035919,-0.47742285385863215,-0.09515362565485244,-0.8735062713788696,-0.04430000111460686,-0.017100000753998756,-0.9988999962806702,-0.42856464276720363,-0.26014738661504994,-0.8652489145946263,-0.026200000196695328,-0.028200000524520874,-0.9993000030517578,-0.3729119034765285,-0.40703367257705336,-0.8338227039568712,-0.025299999862909317,-0.028300000354647636,-0.9993000030517578,-0.2896259899317443,-0.5099064991908379,-0.8100074987547963,-0.1574999988079071,-0.28940001130104065,-0.9441999793052673,0.4781972352408055,0.09361119253153362,-0.8732493050904043,0.7282000184059143,0.2524000108242035,-0.6370999813079834,0.4393956565632051,0.2449654752923344,-0.8642472868966327,0.6470999717712402,0.45969998836517334,-0.608299970626831,0.39562746673558924,0.3918378901601171,-0.830627458852191,0.5230000019073486,0.6406999826431274,-0.5622000098228455,0.3039318735441624,0.5084492756925236,-0.8056703732244866,0.4099999964237213,0.6829000115394592,-0.6047000288963318,0.9478292644663923,0.18220680595344424,-0.2615728680221666,0.8600566042901111,0.44406573291460566,-0.25121357898803404,0.722097468072962,0.6564257510605728,-0.21835860401454446,0.5200506551893511,0.8306365796457171,-0.1989728338029867,-0.22469814643301808,0.9251791464063235,0.30586645786099653,-0.23080000281333923,0.9729999899864197,-0.006500000134110451,-0.15289999544620514,0.6872000098228455,0.7102000117301941,-0.3167000114917755,0.6377999782562256,0.7020999789237976,-0.5489000082015991,0.8359000086784363,-0.001500000013038516,-0.7554159687089509,0.6012029555014725,0.260579585761839,-0.6011000275611877,0.4715000092983246,0.6452999711036682,-0.8756999969482422,0.4828000068664551,0.00989999994635582,-0.8962608931532676,0.34737987822914146,0.2757600979213887,-0.6359000205993652,0.44609999656677246,0.629800021648407,-0.8776000142097473,0.47909998893737793,0.019099999219179153,-0.7277298905609964,0.5697090903460769,0.38189102995635527,-0.435699999332428,0.6010000109672546,0.6700000166893005,-0.6962000131607056,0.7174000144004822,0.02449999935925007,-0.06782871702682407,0.42060539852275436,0.9047045727086881,0.11110000312328339,-0.08510000258684158,0.9901999831199646,0.2232999950647354,0.006500000134110451,0.9746999740600586,-0.2397267208313023,0.393118607711727,0.8876873659066373,0.19009999930858612,0.1550000011920929,0.9695000052452087,-0.3269428225776823,0.3199115704344181,0.8892496712774892,0.0052999998442828655,0.18950000405311584,0.9818999767303467,-0.24664197962623152,0.33059209207256196,0.9109756322455285,-0.011800000444054604,0.2467000037431717,0.968999981880188,0.21474893554810956,-0.3917948594999005,0.8946394149322995,0.34389999508857727,-0.7228000164031982,0.599399983882904,0.5724999904632568,-0.5677000284194946,0.5916000008583069,0.5724729014296546,-0.15995477083527343,0.8041699126526359,0.7874000072479248,-0.2565000057220459,0.5605000257492065,0.5277329114283671,-0.01038778030367959,0.8493468480048075,0.6470999717712402,-0.30640000104904175,0.6980999708175659,0.2802675583364272,-0.16422675916009252,0.9457693520726449,0.42750000953674316,-0.4993000030517578,0.753600001335144,0.39159473040680615,-0.8708293307411027,0.2971697222777314,0.4108999967575073,-0.9117000102996826,0.0013000000035390258,0.671500027179718,-0.7409999966621399,-0.0008999999845400453,0.8641399116222908,-0.44467986513529173,0.23563113267282512,0.921999990940094,-0.3871000111103058,-0.007300000172108412,0.9202642753550175,-0.2825130464997946,0.2707398050946873,0.8468999862670898,-0.5315999984741211,-0.013899999670684338,0.6553517759350307,-0.6669930474005048,0.35444932571270243,0.5358999967575073,-0.8442000150680542,-0.010499999858438969,0.39159473040680615,-0.8708293307411027,-0.2971697222777314,0.34119999408721924,-0.7228000164031982,-0.6008999943733215,0.5787000060081482,-0.5611000061035156,-0.5917999744415283,0.8641399116222908,-0.44467986513529173,-0.23563113267282512,0.7849000096321106,-0.25099998712539673,-0.5665000081062317,0.9202642753550175,-0.2825130464997946,-0.2707398050946873,0.6427000164985657,-0.30230000615119934,-0.7039999961853027,0.6553517759350307,-0.6669930474005048,-0.35444932571270243,0.4185999929904938,-0.5,-0.7580999732017517,0.21484877208785355,-0.39190315580348,-0.894568008372541,0.11580000072717667,-0.07909999787807465,-0.9901000261306763,0.23280000686645508,0.012600000016391277,-0.9724000096321106,0.5724729014296546,-0.15995477083527343,-0.8041699126526359,0.20669999718666077,0.15360000729560852,-0.9663000106811523,0.5277329114283671,-0.01038778030367959,-0.8493468480048075,0.02449999935925007,0.16140000522136688,-0.9865999817848206,0.2802675583364272,-0.16422675916009252,-0.9457693520726449,0.0034000000450760126,0.2110999971628189,-0.9775000214576721,-0.06785298017190203,0.4204621294822817,-0.9047693467138552,-0.13490000367164612,0.6875,-0.7135999798774719,-0.31949999928474426,0.6330999732017517,-0.7050999999046326,-0.2397267208313023,0.393118607711727,-0.8876873659066373,-0.6039000153541565,0.46140000224113464,-0.6499000191688538,-0.3269428225776823,0.3199115704344181,-0.8892496712774892,-0.6317999958992004,0.43720000982284546,-0.6401000022888184,-0.24664197962623152,0.33059209207256196,-0.9109756322455285,-0.4242999851703644,0.6126999855041504,-0.666700005531311,-0.22469814643301808,0.9251791464063235,-0.30586645786099653,-0.7554159687089509,0.6012029555014725,-0.260579585761839,-0.8962608931532676,0.34737987822914146,-0.2757600979213887,-0.7277298905609964,0.5697090903460769,-0.38189102995635527,-0.4581346849192706,0.8290808733288989,0.32052693483404915,-0.2599000036716461,0.7918999791145325,0.5525000095367432,-0.42579999566078186,0.9047999978065491,0.01080000028014183,-0.246185208210748,0.9533009586111941,0.17495749646473896,0.009499999694526196,0.9997000098228455,-0.021700000390410423,0.02199999988079071,0.9998000264167786,0.0015999999595806003,0.5588645441304007,0.6666977641221954,-0.49313741759106583,0.41019999980926514,0.3328999876976013,-0.8490999937057495,0.9995999932289124,0.02590000070631504,0.011599999852478504,0.6055606832628622,-0.6381346851214208,-0.47547910840666874,0.5414999723434448,-0.5486000180244446,-0.6370000243186951,0.7095999717712402,-0.7045999765396118,0.009700000286102295,-0.18304741452057446,0.5222477728722519,0.8329171073806239,0.046300001442432404,0.4551999866962433,0.88919997215271,-0.11108392464029737,0.8826749299553293,0.45666763593981924,-0.010700000450015068,0.9887999892234802,0.14890000224113464,0.07555097805976921,0.8081131026014043,-0.5841620178667426,-0.04439999908208847,0.6829000115394592,-0.7290999889373779,0.1865265036320752,-0.09254615883689393,-0.9780813217352277,0.12280000001192093,0.009200000204145908,-0.9923999905586243,0.20586843545090303,-0.21233995694823685,0.9552643246600484,0.48179998993873596,-0.18039999902248383,0.8575000166893005,0.11889342221748984,0.6798112027299875,0.723685762466156,0.4553000032901764,0.7366999983787537,0.4999000132083893,-0.10639578264983571,0.9027074902947484,-0.4168922215634223,-0.22050000727176666,0.9071999788284302,-0.35830000042915344,-0.16898371149150437,0.5156251093433941,-0.8399852688381916,-0.23589999973773956,0.6572999954223633,-0.7157999873161316,0.4290978121327757,-0.8521036390277623,0.29965723081299106,0.7281000018119812,-0.6852999925613403,-0.015599999576807022,0.7436424021085918,-0.3226049926539566,0.5855954204917456,0.888700008392334,0.45809999108314514,-0.016699999570846558,-0.2121657419347905,0.9655431048711052,-0.15070570853529733,-0.26010000705718994,0.9656000137329102,0.0007999999797903001,-0.3585820114624871,0.8925522270977658,-0.2734400536833164,-0.3716000020503998,0.9283999800682068,-0.004399999976158142,0.4290978121327757,-0.8521036390277623,-0.29965723081299106,0.48019999265670776,-0.17839999496936798,-0.8589000105857849,0.7436424021085918,-0.3226049926539566,-0.5855954204917456,0.48809999227523804,0.7167999744415283,-0.49790000915527344,-0.2121657419347905,0.9655431048711052,0.15070570853529733,-0.22200000286102295,0.9053999781608582,0.3619000017642975,-0.3585820114624871,0.8925522270977658,0.2734400536833164,-0.2354000061750412,0.6632000207901001,0.7105000019073486,0.20586843545090303,-0.21233995694823685,-0.9552643246600484,0.05869999900460243,0.4377000033855438,-0.8971999883651733,0.11889342221748984,0.6798112027299875,-0.723685762466156,0.0013000000035390258,0.9865000247955322,-0.164000004529953,-0.10639578264983571,0.9027074902947484,0.4168922215634223,-0.044199999421834946,0.6816999912261963,0.7303000092506409,-0.16898371149150437,0.5156251093433941,0.8399852688381916,0.1387999951839447,-0.03420000150799751,0.9897000193595886,-0.18304741452057446,0.5222477728722519,-0.8329171073806239,-0.258899986743927,0.7972000241279602,-0.5454000234603882,-0.11108392464029737,0.8826749299553293,-0.45666763593981924,0.012299999594688416,0.9997000098228455,0.019300000742077827,0.07555097805976921,0.8081131026014043,0.5841620178667426,0.3986000120639801,0.3549000024795532,0.8457000255584717,0.1865265036320752,-0.09254615883689393,0.9780813217352277,0.5375999808311462,-0.5813999772071838,0.6107000112533569,-0.4581346849192706,0.8290808733288989,-0.32052693483404915,-0.246185208210748,0.9533009586111941,-0.17495749646473896,0.5588645441304007,0.6666977641221954,0.49313741759106583,0.6055606832628622,-0.6381346851214208,0.47547910840666874,0.14291142372842203,0.9893409658361559,0.02794241017337756,0.7626000046730042,0.5649999976158142,0.3147999942302704,0.8245000243186951,0.5658000111579895,0,0,1,0,0.973458284214919,-0.12702375109433608,0.1903784009578562,0.8479999899864197,-0.39800000190734863,0.3499999940395355,0.9176999926567078,-0.39730000495910645,0,0.746764468277477,-0.6487991657292128,0.14629583544084326,0.8640999794006348,-0.35530000925064087,0.3564000129699707,0.9352999925613403,-0.3538999855518341,0.00009999999747378752,0.981025828088616,0.023627540802087,0.19243197223614078,0.7210000157356262,0.6255999803543091,0.29789999127388,0.7807000279426575,0.6248999834060669,0.00009999999747378752,0.12055154584358733,0.9894424773820601,0.08044195886956569,0.5834000110626221,0.5651999711990356,0.583299994468689,0.8246900772851533,-0.12832997885984362,0.5508336345515219,0.6485000252723694,-0.3986999988555908,0.6484000086784363,0.6311228589976491,-0.650668419605885,0.422273068734218,0.6608999967575073,-0.35589998960494995,0.6607000231742859,0.8301974890908831,0.023243924461984086,0.5569846039908094,0.5519000291824341,0.6252999901771545,0.551800012588501,0.08044195886956569,0.9894424773820601,0.12055154584358733,0.3147999942302704,0.5651000142097473,0.7626000046730042,0.5508336345515219,-0.12832997885984362,0.8246900772851533,0.3499999940395355,-0.39800000190734863,0.8479999899864197,0.422273068734218,-0.650668419605885,0.6311228589976491,0.3564999997615814,-0.35519999265670776,0.8641999959945679,0.5569846039908094,0.023243924461984086,0.8301974890908831,0.2980000078678131,0.6255000233650208,0.7210999727249146,0.02794241017337756,0.9893409658361559,0.14291142372842203,0,0.5658000111579895,0.8245000243186951,0.1903784009578562,-0.12702375109433608,0.973458284214919,0,-0.39730000495910645,0.9176999926567078,0.14629583544084326,-0.6487991657292128,0.746764468277477,-0.00009999999747378752,-0.3538999855518341,0.9352999925613403,0.19243197223614078,0.023627540802087,0.981025828088616,-0.00009999999747378752,0.6248999834060669,0.7807000279426575,-0.02794241017337756,0.9893409658361559,0.14291142372842203,-0.3147999942302704,0.5649999976158142,0.7626000046730042,-0.1903784009578562,-0.12702375109433608,0.973458284214919,-0.3499999940395355,-0.39800000190734863,0.8479999899864197,-0.14629583544084326,-0.6487991657292128,0.746764468277477,-0.3564000129699707,-0.35530000925064087,0.8640999794006348,-0.19243197223614078,0.023627540802087,0.981025828088616,-0.29789999127388,0.6255999803543091,0.7210000157356262,-0.08044195886956569,0.9894424773820601,0.12055154584358733,-0.583299994468689,0.5651999711990356,0.5834000110626221,-0.5508336345515219,-0.12832997885984362,0.8246900772851533,-0.6484000086784363,-0.3986999988555908,0.6485000252723694,-0.422273068734218,-0.650668419605885,0.6311228589976491,-0.6607000231742859,-0.35589998960494995,0.6608999967575073,-0.5569846039908094,0.023243924461984086,0.8301974890908831,-0.551800012588501,0.6252999901771545,0.5519000291824341,-0.12055154584358733,0.9894424773820601,0.08044195886956569,-0.7626000046730042,0.5651000142097473,0.3147999942302704,-0.8246900772851533,-0.12832997885984362,0.5508336345515219,-0.8479999899864197,-0.39800000190734863,0.3499999940395355,-0.6311228589976491,-0.650668419605885,0.422273068734218,-0.8641999959945679,-0.35519999265670776,0.3564999997615814,-0.8301974890908831,0.023243924461984086,0.5569846039908094,-0.7210999727249146,0.6255000233650208,0.2980000078678131,-0.14291142372842203,0.9893409658361559,0.02794241017337756,-0.8245000243186951,0.5658000111579895,0,-0.973458284214919,-0.12702375109433608,0.1903784009578562,-0.9176999926567078,-0.39730000495910645,0,-0.746764468277477,-0.6487991657292128,0.14629583544084326,-0.9352999925613403,-0.3538999855518341,-0.00009999999747378752,-0.981025828088616,0.023627540802087,0.19243197223614078,-0.7807000279426575,0.6248999834060669,-0.00009999999747378752,-0.14291142372842203,0.9893409658361559,-0.02794241017337756,-0.7626000046730042,0.5649999976158142,-0.3147999942302704,-0.973458284214919,-0.12702375109433608,-0.1903784009578562,-0.8479999899864197,-0.39800000190734863,-0.3499999940395355,-0.746764468277477,-0.6487991657292128,-0.14629583544084326,-0.8640999794006348,-0.35530000925064087,-0.3564000129699707,-0.981025828088616,0.023627540802087,-0.19243197223614078,-0.7210000157356262,0.6255999803543091,-0.29789999127388,-0.12055154584358733,0.9894424773820601,-0.08044195886956569,-0.5834000110626221,0.5651999711990356,-0.583299994468689,-0.8246900772851533,-0.12832997885984362,-0.5508336345515219,-0.6485000252723694,-0.3986999988555908,-0.6484000086784363,-0.6311228589976491,-0.650668419605885,-0.422273068734218,-0.6608999967575073,-0.35589998960494995,-0.6607000231742859,-0.8301974890908831,0.023243924461984086,-0.5569846039908094,-0.5519000291824341,0.6252999901771545,-0.551800012588501,-0.08044195886956569,0.9894424773820601,-0.12055154584358733,-0.3147999942302704,0.5651000142097473,-0.7626000046730042,-0.5508336345515219,-0.12832997885984362,-0.8246900772851533,-0.3499999940395355,-0.39800000190734863,-0.8479999899864197,-0.422273068734218,-0.650668419605885,-0.6311228589976491,-0.3564999997615814,-0.35519999265670776,-0.8641999959945679,-0.5569846039908094,0.023243924461984086,-0.8301974890908831,-0.2980000078678131,0.6255000233650208,-0.7210999727249146,-0.02794241017337756,0.9893409658361559,-0.14291142372842203,0,0.5658000111579895,-0.8245000243186951,-0.1903784009578562,-0.12702375109433608,-0.973458284214919,0,-0.39730000495910645,-0.9176999926567078,-0.14629583544084326,-0.6487991657292128,-0.746764468277477,0.00009999999747378752,-0.3538999855518341,-0.9352999925613403,-0.19243197223614078,0.023627540802087,-0.981025828088616,0.00009999999747378752,0.6248999834060669,-0.7807000279426575,0.02794241017337756,0.9893409658361559,-0.14291142372842203,0.3147999942302704,0.5649999976158142,-0.7626000046730042,0.1903784009578562,-0.12702375109433608,-0.973458284214919,0.3499999940395355,-0.39800000190734863,-0.8479999899864197,0.14629583544084326,-0.6487991657292128,-0.746764468277477,0.3564000129699707,-0.35530000925064087,-0.8640999794006348,0.19243197223614078,0.023627540802087,-0.981025828088616,0.29789999127388,0.6255999803543091,-0.7210000157356262,0.08044195886956569,0.9894424773820601,-0.12055154584358733,0.583299994468689,0.5651999711990356,-0.5834000110626221,0.5508336345515219,-0.12832997885984362,-0.8246900772851533,0.6484000086784363,-0.3986999988555908,-0.6485000252723694,0.422273068734218,-0.650668419605885,-0.6311228589976491,0.6607000231742859,-0.35589998960494995,-0.6608999967575073,0.5569846039908094,0.023243924461984086,-0.8301974890908831,0.551800012588501,0.6252999901771545,-0.5519000291824341,0.12055154584358733,0.9894424773820601,-0.08044195886956569,0.7626000046730042,0.5651000142097473,-0.3147999942302704,0.8246900772851533,-0.12832997885984362,-0.5508336345515219,0.8479999899864197,-0.39800000190734863,-0.3499999940395355,0.6311228589976491,-0.650668419605885,-0.422273068734218,0.8641999959945679,-0.35519999265670776,-0.3564999997615814,0.8301974890908831,0.023243924461984086,-0.5569846039908094,0.7210999727249146,0.6255000233650208,-0.2980000078678131,0.14291142372842203,0.9893409658361559,-0.02794241017337756,0.973458284214919,-0.12702375109433608,-0.1903784009578562,0.746764468277477,-0.6487991657292128,-0.14629583544084326,0.981025828088616,0.023627540802087,-0.19243197223614078,0.3275777539387444,0.9426132072697088,0.06459997372414784,0.21799999475479126,0.9718000292778015,0.09019999951124191,0.23659999668598175,0.9715999960899353,0,0.16309406473662258,0.9860835381794821,0.03224254610169826,0.15960000455379486,0.9850000143051147,0.06599999964237213,0.17309999465942383,0.9848999977111816,0,0.18099512760445208,0.982833937027952,0.035752146922720544,0.3504999876022339,0.9253000020980835,0.14470000565052032,0.3797000050544739,0.9251000285148621,0,0.5235316128339348,0.8457082744477594,0.10340292497841669,0.48559999465942383,0.8507000207901001,0.20149999856948853,0.5267000198364258,0.8500999808311462,0,0.27649957959472143,0.9430486026192276,0.18495219809957497,0.16660000383853912,0.9718000292778015,0.16660000383853912,0.13770263578303485,0.9861891086646662,0.09202731143305214,0.12189999967813492,0.9850000143051147,0.12189999967813492,0.15275889985296257,0.9829686899991592,0.1021629727300915,0.2676999866962433,0.925599992275238,0.2676999866962433,0.44245158541572593,0.8465383737127242,0.29598881126645027,0.37130001187324524,0.8510000109672546,0.37130001187324524,0.18495219809957497,0.9430486026192276,0.27649957959472143,0.09019999951124191,0.9718000292778015,0.21799999475479126,0.09202731143305214,0.9861891086646662,0.13770263578303485,0.06599999964237213,0.9850000143051147,0.15960000455379486,0.1021629727300915,0.9829686899991592,0.15275889985296257,0.14470000565052032,0.9253000020980835,0.3504999876022339,0.29598881126645027,0.8465383737127242,0.44245158541572593,0.20149999856948853,0.8507000207901001,0.48559999465942383,0.06459997372414784,0.9426132072697088,0.3275777539387444,0,0.9715999960899353,0.23659999668598175,0.03224254610169826,0.9860835381794821,0.16309406473662258,0,0.9848999977111816,0.17309999465942383,0.035752146922720544,0.982833937027952,0.18099512760445208,0,0.9251000285148621,0.3797000050544739,0.1034029249784167,0.8457082744477595,0.5235316128339349,0,0.8500999808311462,0.5267000198364258,-0.06459997372414784,0.9426132072697088,0.3275777539387444,-0.09019999951124191,0.9718000292778015,0.21799999475479126,-0.03224254610169826,0.9860835381794821,0.16309406473662258,-0.06599999964237213,0.9850000143051147,0.15960000455379486,-0.035752146922720544,0.982833937027952,0.18099512760445208,-0.14470000565052032,0.9253000020980835,0.3504999876022339,-0.1034029249784167,0.8457082744477595,0.5235316128339349,-0.20149999856948853,0.8507000207901001,0.48559999465942383,-0.18495219809957497,0.9430486026192276,0.27649957959472143,-0.16660000383853912,0.9718000292778015,0.16660000383853912,-0.09202731143305214,0.9861891086646662,0.13770263578303485,-0.12189999967813492,0.9850000143051147,0.12189999967813492,-0.1021629727300915,0.9829686899991592,0.15275889985296257,-0.2676999866962433,0.925599992275238,0.2676999866962433,-0.29598881126645027,0.8465383737127242,0.44245158541572593,-0.37130001187324524,0.8510000109672546,0.37130001187324524,-0.27649957959472143,0.9430486026192276,0.18495219809957497,-0.21799999475479126,0.9718000292778015,0.09019999951124191,-0.13770263578303485,0.9861891086646662,0.09202731143305214,-0.15960000455379486,0.9850000143051147,0.06599999964237213,-0.15275889985296257,0.9829686899991592,0.1021629727300915,-0.3504999876022339,0.9253000020980835,0.14470000565052032,-0.44245158541572593,0.8465383737127242,0.29598881126645027,-0.48559999465942383,0.8507000207901001,0.20149999856948853,-0.3275777539387444,0.9426132072697088,0.06459997372414784,-0.23659999668598175,0.9715999960899353,0,-0.16309406473662258,0.9860835381794821,0.03224254610169826,-0.17309999465942383,0.9848999977111816,0,-0.18099512760445208,0.982833937027952,0.035752146922720544,-0.3797000050544739,0.9251000285148621,0,-0.5235316128339348,0.8457082744477594,0.10340292497841669,-0.5267000198364258,0.8500999808311462,0,-0.3275777539387444,0.9426132072697088,-0.06459997372414784,-0.21799999475479126,0.9718000292778015,-0.09019999951124191,-0.16309406473662258,0.9860835381794821,-0.03224254610169826,-0.15960000455379486,0.9850000143051147,-0.06599999964237213,-0.18099512760445208,0.982833937027952,-0.035752146922720544,-0.3504999876022339,0.9253000020980835,-0.14470000565052032,-0.5235316128339348,0.8457082744477594,-0.10340292497841669,-0.48559999465942383,0.8507000207901001,-0.20149999856948853,-0.27649957959472143,0.9430486026192276,-0.18495219809957497,-0.16660000383853912,0.9718000292778015,-0.16660000383853912,-0.13770263578303485,0.9861891086646662,-0.09202731143305214,-0.12189999967813492,0.9850000143051147,-0.12189999967813492,-0.15275889985296257,0.9829686899991592,-0.1021629727300915,-0.2676999866962433,0.925599992275238,-0.2676999866962433,-0.44245158541572593,0.8465383737127242,-0.29598881126645027,-0.37130001187324524,0.8510000109672546,-0.37130001187324524,-0.18495219809957497,0.9430486026192276,-0.27649957959472143,-0.09019999951124191,0.9718000292778015,-0.21799999475479126,-0.09202731143305214,0.9861891086646662,-0.13770263578303485,-0.06599999964237213,0.9850000143051147,-0.15960000455379486,-0.1021629727300915,0.9829686899991592,-0.15275889985296257,-0.14470000565052032,0.9253000020980835,-0.3504999876022339,-0.29598881126645027,0.8465383737127242,-0.44245158541572593,-0.20149999856948853,0.8507000207901001,-0.48559999465942383,-0.06459997372414784,0.9426132072697088,-0.3275777539387444,0,0.9715999960899353,-0.23659999668598175,-0.03224254610169826,0.9860835381794821,-0.16309406473662258,0,0.9848999977111816,-0.17309999465942383,-0.035752146922720544,0.982833937027952,-0.18099512760445208,0,0.9251000285148621,-0.3797000050544739,-0.1034029249784167,0.8457082744477595,-0.5235316128339349,0,0.8500999808311462,-0.5267000198364258,0.06459997372414784,0.9426132072697088,-0.3275777539387444,0.09019999951124191,0.9718000292778015,-0.21799999475479126,0.03224254610169826,0.9860835381794821,-0.16309406473662258,0.06599999964237213,0.9850000143051147,-0.15960000455379486,0.035752146922720544,0.982833937027952,-0.18099512760445208,0.14470000565052032,0.9253000020980835,-0.3504999876022339,0.1034029249784167,0.8457082744477595,-0.5235316128339349,0.20149999856948853,0.8507000207901001,-0.48559999465942383,0.18495219809957497,0.9430486026192276,-0.27649957959472143,0.16660000383853912,0.9718000292778015,-0.16660000383853912,0.09202731143305214,0.9861891086646662,-0.13770263578303485,0.12189999967813492,0.9850000143051147,-0.12189999967813492,0.1021629727300915,0.9829686899991592,-0.15275889985296257,0.2676999866962433,0.925599992275238,-0.2676999866962433,0.29598881126645027,0.8465383737127242,-0.44245158541572593,0.37130001187324524,0.8510000109672546,-0.37130001187324524,0.27649957959472143,0.9430486026192276,-0.18495219809957497,0.21799999475479126,0.9718000292778015,-0.09019999951124191,0.13770263578303485,0.9861891086646662,-0.09202731143305214,0.15960000455379486,0.9850000143051147,-0.06599999964237213,0.15275889985296257,0.9829686899991592,-0.1021629727300915,0.3504999876022339,0.9253000020980835,-0.14470000565052032,0.44245158541572593,0.8465383737127242,-0.29598881126645027,0.48559999465942383,0.8507000207901001,-0.20149999856948853,0.3275777539387444,0.9426132072697088,-0.06459997372414784,0.16309406473662258,0.9860835381794821,-0.03224254610169826,0.18099512760445208,0.982833937027952,-0.035752146922720544,0.5235316128339348,0.8457082744477594,-0.10340292497841669],"uvs":[[2,2,1.75,2,1.75,1.975000023841858,2,1.975000023841858,1.75,1.9500000476837158,2,1.9500000476837158,1.75,1.9249999523162842,2,1.9249999523162842,1.75,1.899999976158142,2,1.899999976158142,1.5,2,1.5,1.975000023841858,1.5,1.9500000476837158,1.5,1.9249999523162842,1.5,1.899999976158142,1.25,2,1.25,1.975000023841858,1.25,1.9500000476837158,1.25,1.9249999523162842,1.25,1.899999976158142,1,2,1,1.975000023841858,1,1.9500000476837158,1,1.9249999523162842,1,1.899999976158142,0.75,2,0.75,1.975000023841858,0.75,1.9500000476837158,0.75,1.9249999523162842,0.75,1.899999976158142,0.5,2,0.5,1.975000023841858,0.5,1.9500000476837158,0.5,1.9249999523162842,0.5,1.899999976158142,0.25,2,0.25,1.975000023841858,0.25,1.9500000476837158,0.25,1.9249999523162842,0.25,1.899999976158142,0,2,0,1.975000023841858,0,1.9500000476837158,0,1.9249999523162842,0,1.899999976158142,1.75,1.6749999523162842,2,1.6749999523162842,1.75,1.4500000476837158,2,1.4500000476837158,1.75,1.225000023841858,2,1.225000023841858,1.75,1,2,1,1.5,1.6749999523162842,1.5,1.4500000476837158,1.5,1.225000023841858,1.5,1,1.25,1.6749999523162842,1.25,1.4500000476837158,1.25,1.225000023841858,1.25,1,1,1.6749999523162842,1,1.4500000476837158,1,1.225000023841858,1,1,0.75,1.6749999523162842,0.75,1.4500000476837158,0.75,1.225000023841858,0.75,1,0.5,1.6749999523162842,0.5,1.4500000476837158,0.5,1.225000023841858,0.5,1,0.25,1.6749999523162842,0.25,1.4500000476837158,0.25,1.225000023841858,0.25,1,0,1.6749999523162842,0,1.4500000476837158,0,1.225000023841858,0,1,1.75,0.8500000238418579,2,0.8500000238418579,1.75,0.699999988079071,2,0.699999988079071,1.75,0.550000011920929,2,0.550000011920929,1.75,0.4000000059604645,2,0.4000000059604645,1.5,0.8500000238418579,1.5,0.699999988079071,1.5,0.550000011920929,1.5,0.4000000059604645,1.25,0.8500000238418579,1.25,0.699999988079071,1.25,0.550000011920929,1.25,0.4000000059604645,1,0.8500000238418579,1,0.699999988079071,1,0.550000011920929,1,0.4000000059604645,0.75,0.8500000238418579,0.75,0.699999988079071,0.75,0.550000011920929,0.75,0.4000000059604645,0.5,0.8500000238418579,0.5,0.699999988079071,0.5,0.550000011920929,0.5,0.4000000059604645,0.25,0.8500000238418579,0.25,0.699999988079071,0.25,0.550000011920929,0.25,0.4000000059604645,0,0.8500000238418579,0,0.699999988079071,0,0.550000011920929,0,0.4000000059604645,1.75,0.30000001192092896,2,0.30000001192092896,1.75,0.20000000298023224,2,0.20000000298023224,1.75,0.10000000149011612,2,0.10000000149011612,1.75,0,1.5,0.30000001192092896,1.5,0.20000000298023224,1.5,0.10000000149011612,1.5,0,1.25,0.30000001192092896,1.25,0.20000000298023224,1.25,0.10000000149011612,1.25,0,1,0.30000001192092896,1,0.20000000298023224,1,0.10000000149011612,1,0,0.75,0.30000001192092896,0.75,0.20000000298023224,0.75,0.10000000149011612,0.75,0,0.5,0.30000001192092896,0.5,0.20000000298023224,0.5,0.10000000149011612,0.5,0,0.25,0.30000001192092896,0.25,0.20000000298023224,0.25,0.10000000149011612,0.25,0,0,0.30000001192092896,0,0.20000000298023224,0,0.10000000149011612,0,0,0.875,1,0.875,0.875,1,0.875,0.875,0.75,1,0.75,0.875,0.625,1,0.625,0.875,0.5,1,0.5,0.75,0.875,0.75,0.75,0.75,0.625,0.75,0.5,0.625,1,0.625,0.875,0.625,0.75,0.625,0.625,0.625,0.5,0.5,0.875,0.5,0.75,0.5,0.625,0.5,0.5,0.375,1,0.375,0.875,0.375,0.75,0.375,0.625,0.375,0.5,0.25,0.875,0.25,0.75,0.25,0.625,0.25,0.5,0.125,1,0.125,0.875,0.125,0.75,0.125,0.625,0.125,0.5,0,0.875,0,0.75,0,0.625,0,0.5,0.875,0.375,1,0.375,0.875,0.25,1,0.25,0.875,0.125,1,0.125,0.875,0,0.75,0.375,0.75,0.25,0.75,0.125,0.625,0.375,0.625,0.25,0.625,0.125,0.625,0,0.5,0.375,0.5,0.25,0.5,0.125,0.375,0.375,0.375,0.25,0.375,0.125,0.375,0,0.25,0.375,0.25,0.25,0.25,0.125,0.125,0.375,0.125,0.25,0.125,0.125,0.125,0,0,0.375,0,0.25,0,0.125,0.625,0.22499999403953552,0.5,0.22499999403953552,0.625,0.44999998807907104,0.5,0.44999998807907104,0.625,0.675000011920929,0.5,0.675000011920929,0.625,0.8999999761581421,0.5,0.8999999761581421,0.75,0.22499999403953552,0.75,0.44999998807907104,0.75,0.675000011920929,0.75,0.8999999761581421,0.875,0.22499999403953552,0.875,0.44999998807907104,0.875,0.675000011920929,0.875,0.8999999761581421,1,0.22499999403953552,1,0.44999998807907104,1,0.675000011920929,1,0.8999999761581421,0.125,0.22499999403953552,0,0.22499999403953552,0.125,0.44999998807907104,0,0.44999998807907104,0.125,0.675000011920929,0,0.675000011920929,0.125,0.8999999761581421,0,0.8999999761581421,0.25,0.22499999403953552,0.25,0.44999998807907104,0.25,0.675000011920929,0.25,0.8999999761581421,0.375,0.22499999403953552,0.375,0.44999998807907104,0.375,0.675000011920929,0.375,0.8999999761581421,0.625,0.925000011920929,0.5,0.925000011920929,0.625,0.949999988079071,0.5,0.949999988079071,0.625,0.9750000238418579,0.5,0.9750000238418579,0.75,0.925000011920929,0.75,0.949999988079071,0.75,0.9750000238418579,0.875,0.925000011920929,0.875,0.949999988079071,0.875,0.9750000238418579,1,0.925000011920929,1,0.949999988079071,1,0.9750000238418579,0.125,0.925000011920929,0,0.925000011920929,0.125,0.949999988079071,0,0.949999988079071,0.125,0.9750000238418579,0,0.9750000238418579,0.25,0.925000011920929,0.25,0.949999988079071,0.25,0.9750000238418579,0.375,0.925000011920929,0.375,0.949999988079071,0.375,0.9750000238418579]],"faces":[56,0,1,2,0,1,2,0,1,2,3,56,0,2,3,0,2,3,0,1,3,4,56,3,2,4,3,2,4,5,4,3,6,56,3,4,5,3,4,5,5,4,6,7,56,5,4,6,5,4,6,8,7,6,9,56,5,6,7,5,6,7,8,7,9,10,56,7,6,8,7,6,8,11,10,9,12,56,7,8,9,7,8,9,11,10,12,13,56,1,10,11,1,10,11,14,2,15,16,56,1,11,2,1,11,2,14,2,16,3,56,2,11,12,2,11,12,17,3,16,18,56,2,12,4,2,12,4,17,3,18,6,56,4,12,13,4,12,13,19,6,18,20,56,4,13,6,4,13,6,19,6,20,9,56,6,13,14,6,13,14,21,9,20,22,56,6,14,8,6,14,8,21,9,22,12,56,10,15,16,10,15,16,23,15,24,25,56,10,16,11,10,16,11,23,15,25,16,56,11,16,17,11,16,17,26,16,25,27,56,11,17,12,11,17,12,26,16,27,18,56,12,17,18,12,17,18,28,18,27,29,56,12,18,13,12,18,13,28,18,29,20,56,13,18,19,13,18,19,30,20,29,31,56,13,19,14,13,19,14,30,20,31,22,56,15,20,21,15,20,21,32,24,33,34,56,15,21,16,15,21,16,32,24,34,25,56,16,21,22,16,21,22,35,25,34,36,56,16,22,17,16,22,17,35,25,36,27,56,17,22,23,17,22,23,37,27,36,38,56,17,23,18,17,23,18,37,27,38,29,56,18,23,24,18,23,24,39,29,38,40,56,18,24,19,18,24,19,39,29,40,31,56,20,25,26,20,25,26,41,33,42,43,56,20,26,21,20,26,21,41,33,43,34,56,21,26,27,21,26,27,44,34,43,45,56,21,27,22,21,27,22,44,34,45,36,56,22,27,28,22,27,28,46,36,45,47,56,22,28,23,22,28,23,46,36,47,38,56,23,28,29,23,28,29,48,38,47,49,56,23,29,24,23,29,24,48,38,49,40,56,25,30,31,25,30,31,50,42,51,52,56,25,31,26,25,31,26,50,42,52,43,56,26,31,32,26,31,32,53,43,52,54,56,26,32,27,26,32,27,53,43,54,45,56,27,32,33,27,32,33,55,45,54,56,56,27,33,28,27,33,28,55,45,56,47,56,28,33,34,28,33,34,57,47,56,58,56,28,34,29,28,34,29,57,47,58,49,56,30,35,36,30,35,36,59,51,60,61,56,30,36,31,30,36,31,59,51,61,52,56,31,36,37,31,36,37,62,52,61,63,56,31,37,32,31,37,32,62,52,63,54,56,32,37,38,32,37,38,64,54,63,65,56,32,38,33,32,38,33,64,54,65,56,56,33,38,39,33,38,39,66,56,65,67,56,33,39,34,33,39,34,66,56,67,58,56,35,40,41,35,40,41,68,60,69,70,56,35,41,36,35,41,36,68,60,70,61,56,36,41,42,36,41,42,71,61,70,72,56,36,42,37,36,42,37,71,61,72,63,56,37,42,43,37,42,43,73,63,72,74,56,37,43,38,37,43,38,73,63,74,65,56,38,43,44,38,43,44,75,65,74,76,56,38,44,39,38,44,39,75,65,76,67,56,40,45,46,0,1,2,77,69,78,79,56,40,46,41,0,2,3,77,69,79,70,56,41,46,47,3,2,4,80,70,79,81,56,41,47,42,3,4,5,80,70,81,72,56,42,47,48,5,4,6,82,72,81,83,56,42,48,43,5,6,7,82,72,83,74,56,43,48,49,7,6,8,84,74,83,85,56,43,49,44,7,8,9,84,74,85,76,56,45,50,51,1,10,11,86,78,87,88,56,45,51,46,1,11,2,86,78,88,79,56,46,51,52,2,11,12,89,79,88,90,56,46,52,47,2,12,4,89,79,90,81,56,47,52,53,4,12,13,91,81,90,92,56,47,53,48,4,13,6,91,81,92,83,56,48,53,54,6,13,14,93,83,92,94,56,48,54,49,6,14,8,93,83,94,85,56,50,55,56,10,15,16,95,87,96,97,56,50,56,51,10,16,11,95,87,97,88,56,51,56,57,11,16,17,98,88,97,99,56,51,57,52,11,17,12,98,88,99,90,56,52,57,58,12,17,18,100,90,99,101,56,52,58,53,12,18,13,100,90,101,92,56,53,58,59,13,18,19,102,92,101,103,56,53,59,54,13,19,14,102,92,103,94,56,55,60,61,15,20,21,104,96,105,106,56,55,61,56,15,21,16,104,96,106,97,56,56,61,62,16,21,22,107,97,106,108,56,56,62,57,16,22,17,107,97,108,99,56,57,62,63,17,22,23,109,99,108,110,56,57,63,58,17,23,18,109,99,110,101,56,58,63,64,18,23,24,111,101,110,112,56,58,64,59,18,24,19,111,101,112,103,56,60,65,66,20,25,26,113,105,114,115,56,60,66,61,20,26,21,113,105,115,106,56,61,66,67,21,26,27,116,106,115,117,56,61,67,62,21,27,22,116,106,117,108,56,62,67,68,22,27,28,118,108,117,119,56,62,68,63,22,28,23,118,108,119,110,56,63,68,69,23,28,29,120,110,119,121,56,63,69,64,23,29,24,120,110,121,112,56,65,70,71,25,30,31,122,114,123,124,56,65,71,66,25,31,26,122,114,124,115,56,66,71,72,26,31,32,125,115,124,126,56,66,72,67,26,32,27,125,115,126,117,56,67,72,73,27,32,33,127,117,126,128,56,67,73,68,27,33,28,127,117,128,119,56,68,73,74,28,33,34,129,119,128,130,56,68,74,69,28,34,29,129,119,130,121,56,70,75,76,30,35,36,131,123,132,133,56,70,76,71,30,36,31,131,123,133,124,56,71,76,77,31,36,37,134,124,133,135,56,71,77,72,31,37,32,134,124,135,126,56,72,77,78,32,37,38,136,126,135,137,56,72,78,73,32,38,33,136,126,137,128,56,73,78,79,33,38,39,138,128,137,139,56,73,79,74,33,39,34,138,128,139,130,56,75,0,3,35,40,41,140,132,1,4,56,75,3,76,35,41,36,140,132,4,133,56,76,3,5,36,41,42,141,133,4,7,56,76,5,77,36,42,37,141,133,7,135,56,77,5,7,37,42,43,142,135,7,10,56,77,7,78,37,43,38,142,135,10,137,56,78,7,9,38,43,44,143,137,10,13,56,78,9,79,38,44,39,143,137,13,139,56,9,8,80,9,8,45,144,13,12,145,56,9,80,81,9,45,46,144,13,145,146,56,81,80,82,46,45,47,147,146,145,148,56,81,82,83,46,47,48,147,146,148,149,56,83,82,84,48,47,49,150,149,148,151,56,83,84,85,48,49,50,150,149,151,152,56,85,84,86,50,49,51,153,152,151,154,56,85,86,87,50,51,52,153,152,154,155,56,8,14,88,8,14,53,156,12,22,157,56,8,88,80,8,53,45,156,12,157,145,56,80,88,89,45,53,54,158,145,157,159,56,80,89,82,45,54,47,158,145,159,148,56,82,89,90,47,54,55,160,148,159,161,56,82,90,84,47,55,49,160,148,161,151,56,84,90,91,49,55,56,162,151,161,163,56,84,91,86,49,56,51,162,151,163,154,56,14,19,92,14,19,57,164,22,31,165,56,14,92,88,14,57,53,164,22,165,157,56,88,92,93,53,57,58,166,157,165,167,56,88,93,89,53,58,54,166,157,167,159,56,89,93,94,54,58,59,168,159,167,169,56,89,94,90,54,59,55,168,159,169,161,56,90,94,95,55,59,60,170,161,169,171,56,90,95,91,55,60,56,170,161,171,163,56,19,24,96,19,24,61,172,31,40,173,56,19,96,92,19,61,57,172,31,173,165,56,92,96,97,57,61,62,174,165,173,175,56,92,97,93,57,62,58,174,165,175,167,56,93,97,98,58,62,63,176,167,175,177,56,93,98,94,58,63,59,176,167,177,169,56,94,98,99,59,63,64,178,169,177,179,56,94,99,95,59,64,60,178,169,179,171,56,24,29,100,24,29,65,180,40,49,181,56,24,100,96,24,65,61,180,40,181,173,56,96,100,101,61,65,66,182,173,181,183,56,96,101,97,61,66,62,182,173,183,175,56,97,101,102,62,66,67,184,175,183,185,56,97,102,98,62,67,63,184,175,185,177,56,98,102,103,63,67,68,186,177,185,187,56,98,103,99,63,68,64,186,177,187,179,56,29,34,104,29,34,69,188,49,58,189,56,29,104,100,29,69,65,188,49,189,181,56,100,104,105,65,69,70,190,181,189,191,56,100,105,101,65,70,66,190,181,191,183,56,101,105,106,66,70,71,192,183,191,193,56,101,106,102,66,71,67,192,183,193,185,56,102,106,107,67,71,72,194,185,193,195,56,102,107,103,67,72,68,194,185,195,187,56,34,39,108,34,39,73,196,58,67,197,56,34,108,104,34,73,69,196,58,197,189,56,104,108,109,69,73,74,198,189,197,199,56,104,109,105,69,74,70,198,189,199,191,56,105,109,110,70,74,75,200,191,199,201,56,105,110,106,70,75,71,200,191,201,193,56,106,110,111,71,75,76,202,193,201,203,56,106,111,107,71,76,72,202,193,203,195,56,39,44,112,39,44,77,204,67,76,205,56,39,112,108,39,77,73,204,67,205,197,56,108,112,113,73,77,78,206,197,205,207,56,108,113,109,73,78,74,206,197,207,199,56,109,113,114,74,78,79,208,199,207,209,56,109,114,110,74,79,75,208,199,209,201,56,110,114,115,75,79,80,210,201,209,211,56,110,115,111,75,80,76,210,201,211,203,56,44,49,116,9,8,45,212,76,85,213,56,44,116,112,9,45,46,212,76,213,205,56,112,116,117,46,45,47,214,205,213,215,56,112,117,113,46,47,48,214,205,215,207,56,113,117,118,48,47,49,216,207,215,217,56,113,118,114,48,49,50,216,207,217,209,56,114,118,119,50,49,51,218,209,217,219,56,114,119,115,50,51,52,218,209,219,211,56,49,54,120,8,14,53,220,85,94,221,56,49,120,116,8,53,45,220,85,221,213,56,116,120,121,45,53,54,222,213,221,223,56,116,121,117,45,54,47,222,213,223,215,56,117,121,122,47,54,55,224,215,223,225,56,117,122,118,47,55,49,224,215,225,217,56,118,122,123,49,55,56,226,217,225,227,56,118,123,119,49,56,51,226,217,227,219,56,54,59,124,14,19,57,228,94,103,229,56,54,124,120,14,57,53,228,94,229,221,56,120,124,125,53,57,58,230,221,229,231,56,120,125,121,53,58,54,230,221,231,223,56,121,125,126,54,58,59,232,223,231,233,56,121,126,122,54,59,55,232,223,233,225,56,122,126,127,55,59,60,234,225,233,235,56,122,127,123,55,60,56,234,225,235,227,56,59,64,128,19,24,61,236,103,112,237,56,59,128,124,19,61,57,236,103,237,229,56,124,128,129,57,61,62,238,229,237,239,56,124,129,125,57,62,58,238,229,239,231,56,125,129,130,58,62,63,240,231,239,241,56,125,130,126,58,63,59,240,231,241,233,56,126,130,131,59,63,64,242,233,241,243,56,126,131,127,59,64,60,242,233,243,235,56,64,69,132,24,29,65,244,112,121,245,56,64,132,128,24,65,61,244,112,245,237,56,128,132,133,61,65,66,246,237,245,247,56,128,133,129,61,66,62,246,237,247,239,56,129,133,134,62,66,67,248,239,247,249,56,129,134,130,62,67,63,248,239,249,241,56,130,134,135,63,67,68,250,241,249,251,56,130,135,131,63,68,64,250,241,251,243,56,69,74,136,29,34,69,252,121,130,253,56,69,136,132,29,69,65,252,121,253,245,56,132,136,137,65,69,70,254,245,253,255,56,132,137,133,65,70,66,254,245,255,247,56,133,137,138,66,70,71,256,247,255,257,56,133,138,134,66,71,67,256,247,257,249,56,134,138,139,67,71,72,258,249,257,259,56,134,139,135,67,72,68,258,249,259,251,56,74,79,140,34,39,73,260,130,139,261,56,74,140,136,34,73,69,260,130,261,253,56,136,140,141,69,73,74,262,253,261,263,56,136,141,137,69,74,70,262,253,263,255,56,137,141,142,70,74,75,264,255,263,265,56,137,142,138,70,75,71,264,255,265,257,56,138,142,143,71,75,76,266,257,265,267,56,138,143,139,71,76,72,266,257,267,259,56,79,9,81,39,44,77,268,139,13,146,56,79,81,140,39,77,73,268,139,146,261,56,140,81,83,73,77,78,269,261,146,149,56,140,83,141,73,78,74,269,261,149,263,56,141,83,85,74,78,79,270,263,149,152,56,141,85,142,74,79,75,270,263,152,265,56,142,85,87,75,79,80,271,265,152,155,56,142,87,143,75,80,76,271,265,155,267,56,87,86,144,52,51,81,272,155,154,273,56,87,144,145,52,81,82,272,155,273,274,56,145,144,146,82,81,83,275,274,273,276,56,145,146,147,82,83,84,275,274,276,277,56,147,146,148,84,83,85,278,277,276,279,56,147,148,149,84,85,86,278,277,279,280,56,149,148,150,86,85,87,281,280,279,282,56,149,150,151,86,87,88,281,280,282,283,56,86,91,152,51,56,89,284,154,163,285,56,86,152,144,51,89,81,284,154,285,273,56,144,152,153,81,89,90,286,273,285,287,56,144,153,146,81,90,83,286,273,287,276,56,146,153,154,83,90,91,288,276,287,289,56,146,154,148,83,91,85,288,276,289,279,56,148,154,155,85,91,92,290,279,289,291,56,148,155,150,85,92,87,290,279,291,282,56,91,95,156,56,60,93,292,163,171,293,56,91,156,152,56,93,89,292,163,293,285,56,152,156,157,89,93,94,294,285,293,295,56,152,157,153,89,94,90,294,285,295,287,56,153,157,158,90,94,95,296,287,295,297,56,153,158,154,90,95,91,296,287,297,289,56,154,158,159,91,95,96,298,289,297,299,56,154,159,155,91,96,92,298,289,299,291,56,95,99,160,60,64,97,300,171,179,301,56,95,160,156,60,97,93,300,171,301,293,56,156,160,161,93,97,98,302,293,301,303,56,156,161,157,93,98,94,302,293,303,295,56,157,161,162,94,98,99,304,295,303,305,56,157,162,158,94,99,95,304,295,305,297,56,158,162,163,95,99,100,306,297,305,307,56,158,163,159,95,100,96,306,297,307,299,56,99,103,164,64,68,101,308,179,187,309,56,99,164,160,64,101,97,308,179,309,301,56,160,164,165,97,101,102,310,301,309,311,56,160,165,161,97,102,98,310,301,311,303,56,161,165,166,98,102,103,312,303,311,313,56,161,166,162,98,103,99,312,303,313,305,56,162,166,167,99,103,104,314,305,313,315,56,162,167,163,99,104,100,314,305,315,307,56,103,107,168,68,72,105,316,187,195,317,56,103,168,164,68,105,101,316,187,317,309,56,164,168,169,101,105,106,318,309,317,319,56,164,169,165,101,106,102,318,309,319,311,56,165,169,170,102,106,107,320,311,319,321,56,165,170,166,102,107,103,320,311,321,313,56,166,170,171,103,107,108,322,313,321,323,56,166,171,167,103,108,104,322,313,323,315,56,107,111,172,72,76,109,324,195,203,325,56,107,172,168,72,109,105,324,195,325,317,56,168,172,173,105,109,110,326,317,325,327,56,168,173,169,105,110,106,326,317,327,319,56,169,173,174,106,110,111,328,319,327,329,56,169,174,170,106,111,107,328,319,329,321,56,170,174,175,107,111,112,330,321,329,331,56,170,175,171,107,112,108,330,321,331,323,56,111,115,176,76,80,113,332,203,211,333,56,111,176,172,76,113,109,332,203,333,325,56,172,176,177,109,113,114,334,325,333,335,56,172,177,173,109,114,110,334,325,335,327,56,173,177,178,110,114,115,336,327,335,337,56,173,178,174,110,115,111,336,327,337,329,56,174,178,179,111,115,116,338,329,337,339,56,174,179,175,111,116,112,338,329,339,331,56,115,119,180,52,51,81,340,211,219,341,56,115,180,176,52,81,82,340,211,341,333,56,176,180,181,82,81,83,342,333,341,343,56,176,181,177,82,83,84,342,333,343,335,56,177,181,182,84,83,85,344,335,343,345,56,177,182,178,84,85,86,344,335,345,337,56,178,182,183,86,85,87,346,337,345,347,56,178,183,179,86,87,88,346,337,347,339,56,119,123,184,51,56,89,348,219,227,349,56,119,184,180,51,89,81,348,219,349,341,56,180,184,185,81,89,90,350,341,349,351,56,180,185,181,81,90,83,350,341,351,343,56,181,185,186,83,90,91,352,343,351,353,56,181,186,182,83,91,85,352,343,353,345,56,182,186,187,85,91,92,354,345,353,355,56,182,187,183,85,92,87,354,345,355,347,56,123,127,188,56,60,93,356,227,235,357,56,123,188,184,56,93,89,356,227,357,349,56,184,188,189,89,93,94,358,349,357,359,56,184,189,185,89,94,90,358,349,359,351,56,185,189,190,90,94,95,360,351,359,361,56,185,190,186,90,95,91,360,351,361,353,56,186,190,191,91,95,96,362,353,361,363,56,186,191,187,91,96,92,362,353,363,355,56,127,131,192,60,64,97,364,235,243,365,56,127,192,188,60,97,93,364,235,365,357,56,188,192,193,93,97,98,366,357,365,367,56,188,193,189,93,98,94,366,357,367,359,56,189,193,194,94,98,99,368,359,367,369,56,189,194,190,94,99,95,368,359,369,361,56,190,194,195,95,99,100,370,361,369,371,56,190,195,191,95,100,96,370,361,371,363,56,131,135,196,64,68,101,372,243,251,373,56,131,196,192,64,101,97,372,243,373,365,56,192,196,197,97,101,102,374,365,373,375,56,192,197,193,97,102,98,374,365,375,367,56,193,197,198,98,102,103,376,367,375,377,56,193,198,194,98,103,99,376,367,377,369,56,194,198,199,99,103,104,378,369,377,379,56,194,199,195,99,104,100,378,369,379,371,56,135,139,200,68,72,105,380,251,259,381,56,135,200,196,68,105,101,380,251,381,373,56,196,200,201,101,105,106,382,373,381,383,56,196,201,197,101,106,102,382,373,383,375,56,197,201,202,102,106,107,384,375,383,385,56,197,202,198,102,107,103,384,375,385,377,56,198,202,203,103,107,108,386,377,385,387,56,198,203,199,103,108,104,386,377,387,379,56,139,143,204,72,76,109,388,259,267,389,56,139,204,200,72,109,105,388,259,389,381,56,200,204,205,105,109,110,390,381,389,391,56,200,205,201,105,110,106,390,381,391,383,56,201,205,206,106,110,111,392,383,391,393,56,201,206,202,106,111,107,392,383,393,385,56,202,206,207,107,111,112,394,385,393,395,56,202,207,203,107,112,108,394,385,395,387,56,143,87,145,76,80,113,396,267,155,274,56,143,145,204,76,113,109,396,267,274,389,56,204,145,147,109,113,114,397,389,274,277,56,204,147,205,109,114,110,397,389,277,391,56,205,147,149,110,114,115,398,391,277,280,56,205,149,206,110,115,111,398,391,280,393,56,206,149,151,111,115,116,399,393,280,283,56,206,151,207,111,116,112,399,393,283,395,56,151,150,208,88,87,117,400,283,282,401,56,151,208,209,88,117,118,400,283,401,402,56,209,208,210,118,117,119,403,402,401,404,56,209,210,211,118,119,120,403,402,404,405,56,211,210,212,120,119,121,406,405,404,407,56,211,212,213,120,121,122,406,405,407,408,56,213,212,214,122,121,123,409,408,407,410,56,150,155,215,87,92,124,411,282,291,412,56,150,215,208,87,124,117,411,282,412,401,56,208,215,216,117,124,125,413,401,412,414,56,208,216,210,117,125,119,413,401,414,404,56,210,216,217,119,125,126,415,404,414,416,56,210,217,212,119,126,121,415,404,416,407,56,212,217,214,121,126,127,417,407,416,410,56,155,159,218,92,96,128,418,291,299,419,56,155,218,215,92,128,124,418,291,419,412,56,215,218,219,124,128,129,420,412,419,421,56,215,219,216,124,129,125,420,412,421,414,56,216,219,220,125,129,130,422,414,421,423,56,216,220,217,125,130,126,422,414,423,416,56,217,220,214,126,130,131,424,416,423,410,56,159,163,221,96,100,132,425,299,307,426,56,159,221,218,96,132,128,425,299,426,419,56,218,221,222,128,132,133,427,419,426,428,56,218,222,219,128,133,129,427,419,428,421,56,219,222,223,129,133,134,429,421,428,430,56,219,223,220,129,134,130,429,421,430,423,56,220,223,214,130,134,135,431,423,430,410,56,163,167,224,100,104,136,432,307,315,433,56,163,224,221,100,136,132,432,307,433,426,56,221,224,225,132,136,137,434,426,433,435,56,221,225,222,132,137,133,434,426,435,428,56,222,225,226,133,137,138,436,428,435,437,56,222,226,223,133,138,134,436,428,437,430,56,223,226,214,134,138,139,438,430,437,410,56,167,171,227,104,108,140,439,315,323,440,56,167,227,224,104,140,136,439,315,440,433,56,224,227,228,136,140,141,441,433,440,442,56,224,228,225,136,141,137,441,433,442,435,56,225,228,229,137,141,142,443,435,442,444,56,225,229,226,137,142,138,443,435,444,437,56,226,229,214,138,142,143,445,437,444,410,56,171,175,230,108,112,144,446,323,331,447,56,171,230,227,108,144,140,446,323,447,440,56,227,230,231,140,144,145,448,440,447,449,56,227,231,228,140,145,141,448,440,449,442,56,228,231,232,141,145,146,450,442,449,451,56,228,232,229,141,146,142,450,442,451,444,56,229,232,214,142,146,147,452,444,451,410,56,175,179,233,112,116,148,453,331,339,454,56,175,233,230,112,148,144,453,331,454,447,56,230,233,234,144,148,149,455,447,454,456,56,230,234,231,144,149,145,455,447,456,449,56,231,234,235,145,149,150,457,449,456,458,56,231,235,232,145,150,146,457,449,458,451,56,232,235,214,146,150,151,459,451,458,410,56,179,183,236,88,87,117,460,339,347,461,56,179,236,233,88,117,118,460,339,461,454,56,233,236,237,118,117,119,462,454,461,463,56,233,237,234,118,119,120,462,454,463,456,56,234,237,238,120,119,121,464,456,463,465,56,234,238,235,120,121,122,464,456,465,458,56,235,238,214,122,121,123,466,458,465,410,56,183,187,239,87,92,124,467,347,355,468,56,183,239,236,87,124,117,467,347,468,461,56,236,239,240,117,124,125,469,461,468,470,56,236,240,237,117,125,119,469,461,470,463,56,237,240,241,119,125,126,471,463,470,472,56,237,241,238,119,126,121,471,463,472,465,56,238,241,214,121,126,127,473,465,472,410,56,187,191,242,92,96,128,474,355,363,475,56,187,242,239,92,128,124,474,355,475,468,56,239,242,243,124,128,129,476,468,475,477,56,239,243,240,124,129,125,476,468,477,470,56,240,243,244,125,129,130,478,470,477,479,56,240,244,241,125,130,126,478,470,479,472,56,241,244,214,126,130,131,480,472,479,410,56,191,195,245,96,100,132,481,363,371,482,56,191,245,242,96,132,128,481,363,482,475,56,242,245,246,128,132,133,483,475,482,484,56,242,246,243,128,133,129,483,475,484,477,56,243,246,247,129,133,134,485,477,484,486,56,243,247,244,129,134,130,485,477,486,479,56,244,247,214,130,134,135,487,479,486,410,56,195,199,248,100,104,136,488,371,379,489,56,195,248,245,100,136,132,488,371,489,482,56,245,248,249,132,136,137,490,482,489,491,56,245,249,246,132,137,133,490,482,491,484,56,246,249,250,133,137,138,492,484,491,493,56,246,250,247,133,138,134,492,484,493,486,56,247,250,214,134,138,139,494,486,493,410,56,199,203,251,104,108,140,495,379,387,496,56,199,251,248,104,140,136,495,379,496,489,56,248,251,252,136,140,141,497,489,496,498,56,248,252,249,136,141,137,497,489,498,491,56,249,252,253,137,141,142,499,491,498,500,56,249,253,250,137,142,138,499,491,500,493,56,250,253,214,138,142,143,501,493,500,410,56,203,207,254,108,112,144,502,387,395,503,56,203,254,251,108,144,140,502,387,503,496,56,251,254,255,140,144,145,504,496,503,505,56,251,255,252,140,145,141,504,496,505,498,56,252,255,256,141,145,146,506,498,505,507,56,252,256,253,141,146,142,506,498,507,500,56,253,256,214,142,146,147,508,500,507,410,56,207,151,209,112,116,148,509,395,283,402,56,207,209,254,112,148,144,509,395,402,503,56,254,209,211,144,148,149,510,503,402,405,56,254,211,255,144,149,145,510,503,405,505,56,255,211,213,145,149,150,511,505,405,408,56,255,213,256,145,150,146,511,505,408,507,56,256,213,214,146,150,151,512,507,408,410,56,257,258,259,64,152,153,513,514,515,516,56,257,259,260,64,153,154,513,514,516,517,56,260,259,261,154,153,155,518,517,516,519,56,260,261,262,154,155,156,518,517,519,520,56,262,261,263,156,155,157,521,520,519,522,56,262,263,264,156,157,158,521,520,522,523,56,264,263,265,158,157,159,524,523,522,525,56,264,265,266,158,159,160,524,523,525,526,56,258,267,268,152,68,161,527,515,528,529,56,258,268,259,152,161,153,527,515,529,516,56,259,268,269,153,161,162,530,516,529,531,56,259,269,261,153,162,155,530,516,531,519,56,261,269,270,155,162,163,532,519,531,533,56,261,270,263,155,163,157,532,519,533,522,56,263,270,271,157,163,164,534,522,533,535,56,263,271,265,157,164,159,534,522,535,525,56,267,272,273,68,165,166,536,528,537,538,56,267,273,268,68,166,161,536,528,538,529,56,268,273,274,161,166,167,539,529,538,540,56,268,274,269,161,167,162,539,529,540,531,56,269,274,275,162,167,168,541,531,540,542,56,269,275,270,162,168,163,541,531,542,533,56,270,275,276,163,168,169,543,533,542,544,56,270,276,271,163,169,164,543,533,544,535,56,272,277,278,165,72,170,545,537,546,547,56,272,278,273,165,170,166,545,537,547,538,56,273,278,279,166,170,171,548,538,547,549,56,273,279,274,166,171,167,548,538,549,540,56,274,279,280,167,171,172,550,540,549,551,56,274,280,275,167,172,168,550,540,551,542,56,275,280,281,168,172,173,552,542,551,553,56,275,281,276,168,173,169,552,542,553,544,56,277,282,283,72,174,175,554,546,555,556,56,277,283,278,72,175,170,554,546,556,547,56,278,283,284,170,175,176,557,547,556,558,56,278,284,279,170,176,171,557,547,558,549,56,279,284,285,171,176,177,559,549,558,560,56,279,285,280,171,177,172,559,549,560,551,56,280,285,286,172,177,178,561,551,560,562,56,280,286,281,172,178,173,561,551,562,553,56,282,287,288,174,76,179,563,555,564,565,56,282,288,283,174,179,175,563,555,565,556,56,283,288,289,175,179,180,566,556,565,567,56,283,289,284,175,180,176,566,556,567,558,56,284,289,290,176,180,181,568,558,567,569,56,284,290,285,176,181,177,568,558,569,560,56,285,290,291,177,181,182,570,560,569,571,56,285,291,286,177,182,178,570,560,571,562,56,287,292,293,76,183,184,572,564,573,574,56,287,293,288,76,184,179,572,564,574,565,56,288,293,294,179,184,185,575,565,574,576,56,288,294,289,179,185,180,575,565,576,567,56,289,294,295,180,185,186,577,567,576,578,56,289,295,290,180,186,181,577,567,578,569,56,290,295,296,181,186,187,579,569,578,580,56,290,296,291,181,187,182,579,569,580,571,56,292,257,260,183,80,188,581,573,514,517,56,292,260,293,183,188,184,581,573,517,574,56,293,260,262,184,188,189,582,574,517,520,56,293,262,294,184,189,185,582,574,520,576,56,294,262,264,185,189,190,583,576,520,523,56,294,264,295,185,190,186,583,576,523,578,56,295,264,266,186,190,191,584,578,523,526,56,295,266,296,186,191,187,584,578,526,580,56,266,265,297,160,159,192,585,526,525,586,56,266,297,298,160,192,193,585,526,586,587,56,298,297,299,193,192,194,588,587,586,589,56,298,299,300,193,194,195,588,587,589,590,56,300,299,301,195,194,196,591,590,589,592,56,300,301,302,195,196,197,591,590,592,593,56,302,301,303,197,196,198,594,593,592,595,56,302,303,115,197,198,135,594,593,595,596,56,265,271,304,159,164,199,597,525,535,598,56,265,304,297,159,199,192,597,525,598,586,56,297,304,305,192,199,200,599,586,598,600,56,297,305,299,192,200,194,599,586,600,589,56,299,305,306,194,200,201,601,589,600,602,56,299,306,301,194,201,196,601,589,602,592,56,301,306,307,196,201,139,603,592,602,604,56,301,307,303,196,139,198,603,592,604,595,56,271,276,308,164,169,202,605,535,544,606,56,271,308,304,164,202,199,605,535,606,598,56,304,308,309,199,202,203,607,598,606,608,56,304,309,305,199,203,200,607,598,608,600,56,305,309,310,200,203,204,609,600,608,610,56,305,310,306,200,204,201,609,600,610,602,56,306,310,311,201,204,205,611,602,610,612,56,306,311,307,201,205,139,611,602,612,604,56,276,281,312,169,173,206,613,544,553,614,56,276,312,308,169,206,202,613,544,614,606,56,308,312,313,202,206,207,615,606,614,616,56,308,313,309,202,207,203,615,606,616,608,56,309,313,314,203,207,208,617,608,616,618,56,309,314,310,203,208,204,617,608,618,610,56,310,314,315,204,208,143,619,610,618,620,56,310,315,311,204,143,205,619,610,620,612,56,281,286,316,173,178,209,621,553,562,622,56,281,316,312,173,209,206,621,553,622,614,56,312,316,317,206,209,210,623,614,622,624,56,312,317,313,206,210,207,623,614,624,616,56,313,317,318,207,210,211,625,616,624,626,56,313,318,314,207,211,208,625,616,626,618,56,314,318,319,208,211,212,627,618,626,628,56,314,319,315,208,212,143,627,618,628,620,56,286,291,320,178,182,213,629,562,571,630,56,286,320,316,178,213,209,629,562,630,622,56,316,320,321,209,213,214,631,622,630,632,56,316,321,317,209,214,210,631,622,632,624,56,317,321,322,210,214,215,633,624,632,634,56,317,322,318,210,215,211,633,624,634,626,56,318,322,323,211,215,147,635,626,634,636,56,318,323,319,211,147,212,635,626,636,628,56,291,296,324,182,187,216,637,571,580,638,56,291,324,320,182,216,213,637,571,638,630,56,320,324,325,213,216,217,639,630,638,640,56,320,325,321,213,217,214,639,630,640,632,56,321,325,326,214,217,218,641,632,640,642,56,321,326,322,214,218,215,641,632,642,634,56,322,326,327,215,218,219,643,634,642,644,56,322,327,323,215,219,147,643,634,644,636,56,296,266,298,187,191,220,645,580,526,587,56,296,298,324,187,220,216,645,580,587,638,56,324,298,300,216,220,221,646,638,587,590,56,324,300,325,216,221,217,646,638,590,640,56,325,300,302,217,221,222,647,640,590,593,56,325,302,326,217,222,218,647,640,593,642,56,326,302,115,218,222,151,648,642,593,596,56,326,115,327,218,151,219,648,642,596,644,56,328,329,330,143,205,223,649,650,651,652,56,328,330,331,143,223,224,649,650,652,653,56,331,330,332,224,223,225,654,653,652,655,56,331,332,333,224,225,226,654,653,655,656,56,333,332,334,226,225,227,657,656,655,658,56,333,334,335,226,227,228,657,656,658,659,56,335,334,336,228,227,229,660,659,658,661,56,335,336,337,228,229,230,660,659,661,662,56,329,338,339,205,139,231,663,651,664,665,56,329,339,330,205,231,223,663,651,665,652,56,330,339,340,223,231,232,666,652,665,667,56,330,340,332,223,232,225,666,652,667,655,56,332,340,341,225,232,233,668,655,667,669,56,332,341,334,225,233,227,668,655,669,658,56,334,341,342,227,233,234,670,658,669,671,56,334,342,336,227,234,229,670,658,671,661,56,338,343,344,139,198,235,672,664,673,674,56,338,344,339,139,235,231,672,664,674,665,56,339,344,345,231,235,236,675,665,674,676,56,339,345,340,231,236,232,675,665,676,667,56,340,345,346,232,236,237,677,667,676,678,56,340,346,341,232,237,233,677,667,678,669,56,341,346,347,233,237,238,679,669,678,680,56,341,347,342,233,238,234,679,669,680,671,56,343,348,349,198,135,239,681,673,682,683,56,343,349,344,198,239,235,681,673,683,674,56,344,349,350,235,239,240,684,674,683,685,56,344,350,345,235,240,236,684,674,685,676,56,345,350,351,236,240,241,686,676,685,687,56,345,351,346,236,241,237,686,676,687,678,56,346,351,352,237,241,242,688,678,687,689,56,346,352,347,237,242,238,688,678,689,680,56,348,353,354,151,219,243,690,682,691,692,56,348,354,349,151,243,244,690,682,692,683,56,349,354,355,244,243,245,693,683,692,694,56,349,355,350,244,245,246,693,683,694,685,56,350,355,356,246,245,247,695,685,694,696,56,350,356,351,246,247,248,695,685,696,687,56,351,356,357,248,247,249,697,687,696,698,56,351,357,352,248,249,250,697,687,698,689,56,353,358,359,219,147,251,699,691,700,701,56,353,359,354,219,251,243,699,691,701,692,56,354,359,360,243,251,252,702,692,701,703,56,354,360,355,243,252,245,702,692,703,694,56,355,360,361,245,252,253,704,694,703,705,56,355,361,356,245,253,247,704,694,705,696,56,356,361,362,247,253,254,706,696,705,707,56,356,362,357,247,254,249,706,696,707,698,56,358,363,364,147,212,255,708,700,709,710,56,358,364,359,147,255,251,708,700,710,701,56,359,364,365,251,255,256,711,701,710,712,56,359,365,360,251,256,252,711,701,712,703,56,360,365,366,252,256,257,713,703,712,714,56,360,366,361,252,257,253,713,703,714,705,56,361,366,367,253,257,258,715,705,714,716,56,361,367,362,253,258,254,715,705,716,707,56,363,328,331,212,143,224,717,709,650,653,56,363,331,364,212,224,255,717,709,653,710,56,364,331,333,255,224,226,718,710,653,656,56,364,333,365,255,226,256,718,710,656,712,56,365,333,335,256,226,228,719,712,656,659,56,365,335,366,256,228,257,719,712,659,714,56,366,335,337,257,228,230,720,714,659,662,56,366,337,367,257,230,258,720,714,662,716,56,337,336,368,230,229,259,721,662,661,722,56,337,368,369,230,259,260,721,662,722,723,56,369,368,370,260,259,261,724,723,722,725,56,369,370,371,260,261,262,724,723,725,726,56,371,370,372,262,261,263,727,726,725,728,56,371,372,373,262,263,264,727,726,728,729,56,373,372,374,264,263,165,730,729,728,731,56,373,374,375,264,165,72,730,729,731,732,56,336,342,376,229,234,265,733,661,671,734,56,336,376,368,229,265,259,733,661,734,722,56,368,376,377,259,265,266,735,722,734,736,56,368,377,370,259,266,261,735,722,736,725,56,370,377,378,261,266,267,737,725,736,738,56,370,378,372,261,267,263,737,725,738,728,56,372,378,379,263,267,68,739,728,738,740,56,372,379,374,263,68,165,739,728,740,731,56,342,347,380,234,238,268,741,671,680,742,56,342,380,376,234,268,265,741,671,742,734,56,376,380,381,265,268,269,743,734,742,744,56,376,381,377,265,269,266,743,734,744,736,56,377,381,382,266,269,270,745,736,744,746,56,377,382,378,266,270,267,745,736,746,738,56,378,382,383,267,270,152,747,738,746,748,56,378,383,379,267,152,68,747,738,748,740,56,347,352,384,238,242,271,749,680,689,750,56,347,384,380,238,271,268,749,680,750,742,56,380,384,385,268,271,272,751,742,750,752,56,380,385,381,268,272,269,751,742,752,744,56,381,385,386,269,272,273,753,744,752,754,56,381,386,382,269,273,270,753,744,754,746,56,382,386,387,270,273,64,755,746,754,756,56,382,387,383,270,64,152,755,746,756,748,56,352,357,388,250,249,274,757,689,698,758,56,352,388,384,250,274,275,757,689,758,750,56,384,388,389,275,274,276,759,750,758,760,56,384,389,385,275,276,277,759,750,760,752,56,385,389,390,277,276,278,761,752,760,762,56,385,390,386,277,278,279,761,752,762,754,56,386,390,391,279,278,183,763,754,762,764,56,386,391,387,279,183,80,763,754,764,756,56,357,362,392,249,254,280,765,698,707,766,56,357,392,388,249,280,274,765,698,766,758,56,388,392,393,274,280,281,767,758,766,768,56,388,393,389,274,281,276,767,758,768,760,56,389,393,394,276,281,282,769,760,768,770,56,389,394,390,276,282,278,769,760,770,762,56,390,394,395,278,282,76,771,762,770,772,56,390,395,391,278,76,183,771,762,772,764,56,362,367,396,254,258,283,773,707,716,774,56,362,396,392,254,283,280,773,707,774,766,56,392,396,397,280,283,284,775,766,774,776,56,392,397,393,280,284,281,775,766,776,768,56,393,397,398,281,284,285,777,768,776,778,56,393,398,394,281,285,282,777,768,778,770,56,394,398,399,282,285,174,779,770,778,780,56,394,399,395,282,174,76,779,770,780,772,56,367,337,369,258,230,260,781,716,662,723,56,367,369,396,258,260,283,781,716,723,774,56,396,369,371,283,260,262,782,774,723,726,56,396,371,397,283,262,284,782,774,726,776,56,397,371,373,284,262,264,783,776,726,729,56,397,373,398,284,264,285,783,776,729,778,56,398,373,375,285,264,72,784,778,729,732,56,398,375,399,285,72,174,784,778,732,780,56,400,401,402,155,156,64,785,786,787,788,56,401,400,403,156,155,159,789,787,786,790,56,401,403,404,156,159,160,789,787,790,791,56,404,403,405,160,159,194,792,791,790,793,56,404,405,406,160,194,195,792,791,793,794,56,406,405,407,195,194,198,795,794,793,796,56,406,407,408,195,198,135,795,794,796,797,56,409,400,402,162,155,152,798,799,786,788,56,400,409,410,155,162,164,800,786,799,801,56,400,410,403,155,164,159,800,786,801,790,56,403,410,411,159,164,200,802,790,801,803,56,403,411,405,159,200,194,802,790,803,793,56,405,411,412,194,200,139,804,793,803,805,56,405,412,407,194,139,198,804,793,805,796,56,413,409,402,167,162,68,806,807,799,788,56,409,413,414,162,167,169,808,799,807,809,56,409,414,410,162,169,164,808,799,809,801,56,410,414,415,164,169,203,810,801,809,811,56,410,415,411,164,203,200,810,801,811,803,56,411,415,416,200,203,205,812,803,811,813,56,411,416,412,200,205,139,812,803,813,805,56,417,413,402,171,167,165,814,815,807,788,56,413,417,418,167,171,173,816,807,815,817,56,413,418,414,167,173,169,816,807,817,809,56,414,418,419,169,173,207,818,809,817,819,56,414,419,415,169,207,203,818,809,819,811,56,415,419,420,203,207,143,820,811,819,821,56,415,420,416,203,143,205,820,811,821,813,56,421,417,402,176,171,72,822,823,815,788,56,417,421,422,171,176,178,824,815,823,825,56,417,422,418,171,178,173,824,815,825,817,56,418,422,423,173,178,210,826,817,825,827,56,418,423,419,173,210,207,826,817,827,819,56,419,423,424,207,210,212,828,819,827,829,56,419,424,420,207,212,143,828,819,829,821,56,425,421,402,180,176,174,830,831,823,788,56,421,425,426,176,180,182,832,823,831,833,56,421,426,422,176,182,178,832,823,833,825,56,422,426,427,178,182,214,834,825,833,835,56,422,427,423,178,214,210,834,825,835,827,56,423,427,428,210,214,147,836,827,835,837,56,423,428,424,210,147,212,836,827,837,829,56,429,425,402,185,180,76,838,839,831,788,56,425,429,430,180,185,187,840,831,839,841,56,425,430,426,180,187,182,840,831,841,833,56,426,430,431,182,187,217,842,833,841,843,56,426,431,427,182,217,214,842,833,843,835,56,427,431,432,214,217,219,844,835,843,845,56,427,432,428,214,219,147,844,835,845,837,56,433,429,402,189,185,183,846,847,839,788,56,429,433,434,185,189,191,848,839,847,849,56,429,434,430,185,191,187,848,839,849,841,56,430,434,435,187,191,221,850,841,849,851,56,430,435,431,187,221,217,850,841,851,843,56,431,435,436,217,221,151,852,843,851,853,56,431,436,432,217,151,219,852,843,853,845,56,437,433,402,155,156,64,854,855,847,788,56,433,437,438,156,155,159,856,847,855,857,56,433,438,434,156,159,160,856,847,857,849,56,434,438,439,160,159,194,858,849,857,859,56,434,439,435,160,194,195,858,849,859,851,56,435,439,440,195,194,198,860,851,859,861,56,435,440,436,195,198,135,860,851,861,853,56,441,437,402,162,155,152,862,863,855,788,56,437,441,442,155,162,164,864,855,863,865,56,437,442,438,155,164,159,864,855,865,857,56,438,442,443,159,164,200,866,857,865,867,56,438,443,439,159,200,194,866,857,867,859,56,439,443,444,194,200,139,868,859,867,869,56,439,444,440,194,139,198,868,859,869,861,56,445,441,402,167,162,68,870,871,863,788,56,441,445,446,162,167,169,872,863,871,873,56,441,446,442,162,169,164,872,863,873,865,56,442,446,447,164,169,203,874,865,873,875,56,442,447,443,164,203,200,874,865,875,867,56,443,447,448,200,203,205,876,867,875,877,56,443,448,444,200,205,139,876,867,877,869,56,449,445,402,171,167,165,878,879,871,788,56,445,449,450,167,171,173,880,871,879,881,56,445,450,446,167,173,169,880,871,881,873,56,446,450,451,169,173,207,882,873,881,883,56,446,451,447,169,207,203,882,873,883,875,56,447,451,452,203,207,143,884,875,883,885,56,447,452,448,203,143,205,884,875,885,877,56,453,449,402,176,171,72,886,887,879,788,56,449,453,454,171,176,178,888,879,887,889,56,449,454,450,171,178,173,888,879,889,881,56,450,454,455,173,178,210,890,881,889,891,56,450,455,451,173,210,207,890,881,891,883,56,451,455,456,207,210,212,892,883,891,893,56,451,456,452,207,212,143,892,883,893,885,56,457,453,402,180,176,174,894,895,887,788,56,453,457,458,176,180,182,896,887,895,897,56,453,458,454,176,182,178,896,887,897,889,56,454,458,459,178,182,214,898,889,897,899,56,454,459,455,178,214,210,898,889,899,891,56,455,459,460,210,214,147,900,891,899,901,56,455,460,456,210,147,212,900,891,901,893,56,461,457,402,185,180,76,902,903,895,788,56,457,461,462,180,185,187,904,895,903,905,56,457,462,458,180,187,182,904,895,905,897,56,458,462,463,182,187,217,906,897,905,907,56,458,463,459,182,217,214,906,897,907,899,56,459,463,464,214,217,219,908,899,907,909,56,459,464,460,214,219,147,908,899,909,901,56,401,461,402,189,185,183,910,787,903,788,56,461,401,404,185,189,191,911,903,787,791,56,461,404,462,185,191,187,911,903,791,905,56,462,404,406,187,191,221,912,905,791,794,56,462,406,463,187,221,217,912,905,794,907,56,463,406,408,217,221,151,913,907,794,797,56,463,408,464,217,151,219,913,907,797,909,56,408,407,465,64,152,155,914,797,796,915,56,408,465,466,64,155,156,914,797,915,916,56,466,465,467,156,155,159,917,916,915,918,56,466,467,468,156,159,160,917,916,918,919,56,468,467,469,160,159,194,920,919,918,921,56,468,469,470,160,194,195,920,919,921,922,56,470,469,471,195,194,198,923,922,921,924,56,470,471,472,195,198,135,923,922,924,925,56,407,412,473,152,68,162,926,796,805,927,56,407,473,465,152,162,155,926,796,927,915,56,465,473,474,155,162,164,928,915,927,929,56,465,474,467,155,164,159,928,915,929,918,56,467,474,475,159,164,200,930,918,929,931,56,467,475,469,159,200,194,930,918,931,921,56,469,475,476,194,200,139,932,921,931,933,56,469,476,471,194,139,198,932,921,933,924,56,412,416,477,68,165,167,934,805,813,935,56,412,477,473,68,167,162,934,805,935,927,56,473,477,478,162,167,169,936,927,935,937,56,473,478,474,162,169,164,936,927,937,929,56,474,478,479,164,169,203,938,929,937,939,56,474,479,475,164,203,200,938,929,939,931,56,475,479,480,200,203,205,940,931,939,941,56,475,480,476,200,205,139,940,931,941,933,56,416,420,481,165,72,171,942,813,821,943,56,416,481,477,165,171,167,942,813,943,935,56,477,481,482,167,171,173,944,935,943,945,56,477,482,478,167,173,169,944,935,945,937,56,478,482,483,169,173,207,946,937,945,947,56,478,483,479,169,207,203,946,937,947,939,56,479,483,484,203,207,143,948,939,947,949,56,479,484,480,203,143,205,948,939,949,941,56,420,424,485,72,174,176,950,821,829,951,56,420,485,481,72,176,171,950,821,951,943,56,481,485,486,171,176,178,952,943,951,953,56,481,486,482,171,178,173,952,943,953,945,56,482,486,487,173,178,210,954,945,953,955,56,482,487,483,173,210,207,954,945,955,947,56,483,487,488,207,210,212,956,947,955,957,56,483,488,484,207,212,143,956,947,957,949,56,424,428,489,174,76,180,958,829,837,959,56,424,489,485,174,180,176,958,829,959,951,56,485,489,490,176,180,182,960,951,959,961,56,485,490,486,176,182,178,960,951,961,953,56,486,490,491,178,182,214,962,953,961,963,56,486,491,487,178,214,210,962,953,963,955,56,487,491,492,210,214,147,964,955,963,965,56,487,492,488,210,147,212,964,955,965,957,56,428,432,493,76,183,185,966,837,845,967,56,428,493,489,76,185,180,966,837,967,959,56,489,493,494,180,185,187,968,959,967,969,56,489,494,490,180,187,182,968,959,969,961,56,490,494,495,182,187,217,970,961,969,971,56,490,495,491,182,217,214,970,961,971,963,56,491,495,496,214,217,219,972,963,971,973,56,491,496,492,214,219,147,972,963,973,965,56,432,436,497,183,80,189,974,845,853,975,56,432,497,493,183,189,185,974,845,975,967,56,493,497,498,185,189,191,976,967,975,977,56,493,498,494,185,191,187,976,967,977,969,56,494,498,499,187,191,221,978,969,977,979,56,494,499,495,187,221,217,978,969,979,971,56,495,499,500,217,221,151,980,971,979,981,56,495,500,496,217,151,219,980,971,981,973,56,436,440,501,64,152,155,982,853,861,983,56,436,501,497,64,155,156,982,853,983,975,56,497,501,502,156,155,159,984,975,983,985,56,497,502,498,156,159,160,984,975,985,977,56,498,502,503,160,159,194,986,977,985,987,56,498,503,499,160,194,195,986,977,987,979,56,499,503,504,195,194,198,988,979,987,989,56,499,504,500,195,198,135,988,979,989,981,56,440,444,505,152,68,162,990,861,869,991,56,440,505,501,152,162,155,990,861,991,983,56,501,505,506,155,162,164,992,983,991,993,56,501,506,502,155,164,159,992,983,993,985,56,502,506,507,159,164,200,994,985,993,995,56,502,507,503,159,200,194,994,985,995,987,56,503,507,508,194,200,139,996,987,995,997,56,503,508,504,194,139,198,996,987,997,989,56,444,448,509,68,165,167,998,869,877,999,56,444,509,505,68,167,162,998,869,999,991,56,505,509,510,162,167,169,1000,991,999,1001,56,505,510,506,162,169,164,1000,991,1001,993,56,506,510,511,164,169,203,1002,993,1001,1003,56,506,511,507,164,203,200,1002,993,1003,995,56,507,511,512,200,203,205,1004,995,1003,1005,56,507,512,508,200,205,139,1004,995,1005,997,56,448,452,513,165,72,171,1006,877,885,1007,56,448,513,509,165,171,167,1006,877,1007,999,56,509,513,514,167,171,173,1008,999,1007,1009,56,509,514,510,167,173,169,1008,999,1009,1001,56,510,514,515,169,173,207,1010,1001,1009,1011,56,510,515,511,169,207,203,1010,1001,1011,1003,56,511,515,516,203,207,143,1012,1003,1011,1013,56,511,516,512,203,143,205,1012,1003,1013,1005,56,452,456,517,72,174,176,1014,885,893,1015,56,452,517,513,72,176,171,1014,885,1015,1007,56,513,517,518,171,176,178,1016,1007,1015,1017,56,513,518,514,171,178,173,1016,1007,1017,1009,56,514,518,519,173,178,210,1018,1009,1017,1019,56,514,519,515,173,210,207,1018,1009,1019,1011,56,515,519,520,207,210,212,1020,1011,1019,1021,56,515,520,516,207,212,143,1020,1011,1021,1013,56,456,460,521,174,76,180,1022,893,901,1023,56,456,521,517,174,180,176,1022,893,1023,1015,56,517,521,522,176,180,182,1024,1015,1023,1025,56,517,522,518,176,182,178,1024,1015,1025,1017,56,518,522,523,178,182,214,1026,1017,1025,1027,56,518,523,519,178,214,210,1026,1017,1027,1019,56,519,523,524,210,214,147,1028,1019,1027,1029,56,519,524,520,210,147,212,1028,1019,1029,1021,56,460,464,525,76,183,185,1030,901,909,1031,56,460,525,521,76,185,180,1030,901,1031,1023,56,521,525,526,180,185,187,1032,1023,1031,1033,56,521,526,522,180,187,182,1032,1023,1033,1025,56,522,526,527,182,187,217,1034,1025,1033,1035,56,522,527,523,182,217,214,1034,1025,1035,1027,56,523,527,528,214,217,219,1036,1027,1035,1037,56,523,528,524,214,219,147,1036,1027,1037,1029,56,464,408,466,183,80,189,1038,909,797,916,56,464,466,525,183,189,185,1038,909,916,1031,56,525,466,468,185,189,191,1039,1031,916,919,56,525,468,526,185,191,187,1039,1031,919,1033,56,526,468,470,187,191,221,1040,1033,919,922,56,526,470,527,187,221,217,1040,1033,922,1035,56,527,470,472,217,221,151,1041,1035,922,925,56,527,472,528,217,151,219,1041,1035,925,1037]}}],"materials":[{"uuid":"7AAB18E5-FF88-4A82-8018-4DF34EDB7539","type":"MeshPhongMaterial","color":16714940,"ambient":16714940,"emissive":0,"specular":0,"shininess":50,"opacity":1,"transparent":false,"wireframe":false}],"object":{"uuid":"0D4F494E-35AD-4D5B-9696-7DF60B73E7F0","name":"Teapot001","type":"Mesh","geometry":"15930b1c-1b50-4926-a0ac-df433b9c4f96","material":"7AAB18E5-FF88-4A82-8018-4DF34EDB7539","castShadow":true,"receiveShadow":true,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}} diff --git a/src/public/assets/textures/UV_Grid_Sm.jpg b/src/public/assets/textures/UV_Grid_Sm.jpg new file mode 100644 index 0000000..bcc6ee1 Binary files /dev/null and b/src/public/assets/textures/UV_Grid_Sm.jpg differ diff --git a/src/public/index.html b/src/public/index.html new file mode 100644 index 0000000..9cb97f5 --- /dev/null +++ b/src/public/index.html @@ -0,0 +1,19 @@ + + + + + Three.js Webpack ES6 Boilerplate + + + + +
    +
    +
    +
    + + + + + + diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..984d3ef --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,95 @@ +var webpack = require('webpack'), + path = require('path'); + +var entry = './src/js/app.js', + includePath = path.join(__dirname, 'src/js'), + nodeModulesPath = path.join(__dirname, 'node_modules'), + outputPath = path.join(__dirname, 'src/public/assets/js'); + +var PROD = JSON.parse(process.env.NODE_ENV || 0); + +var env = 'dev', + time = Date.now(), + devtool = 'eval', + debug = true, + plugins = [ + new webpack.NoErrorsPlugin(), + new webpack.DefinePlugin({ + __ENV__: JSON.stringify(env), + ___BUILD_TIME___: time + }) + ]; + +if(PROD) { + env = 'prod'; + devtool = 'hidden-source-map'; + debug = false; + outputPath = __dirname + '/build/public/assets/js'; + + uglifyOptions = { + sourceMap: false, + mangle: true, + compress: { + drop_console: true + }, + output: { + comments: false + } + }; + plugins.push(new webpack.optimize.UglifyJsPlugin(uglifyOptions)); +} + +console.log('Webpack build - ENV: ' + env + ' V: ' + time); +console.log(' - outputPath ', outputPath); +console.log(' - includePath ', includePath); +console.log(' - nodeModulesPath ', nodeModulesPath); + +module.exports = { + stats: { + colors: true + }, + + debug: debug, + + devtool: devtool, + + devServer: { + contentBase: 'src/public' + }, + + entry: [ + entry + ], + + output: { + path: outputPath, + publicPath: 'assets/js', + filename: 'app.js' + }, + + module: { + loaders: [ + { + test: /\.js?$/, + loader: 'babel-loader', + query: { + presets: ['es2015'] + }, + include: [ + includePath, nodeModulesPath + ] + } + ] + }, + + sassLoader: { + outputStyle: 'compressed', + outFile: __dirname + '/src/public/assets/css' + }, + + plugins: plugins, + + resolve: { + alias: {} + } +};