diff --git a/src/public/assets/css/app.css b/src/public/assets/css/app.css
index e2d0dab..d1f2af3 100644
--- a/src/public/assets/css/app.css
+++ b/src/public/assets/css/app.css
@@ -1,4 +1,76 @@
+html {
+ -ms-text-size-adjust: 100%;
+ -webkit-text-size-adjust: 100%; }
+
+body {
+ margin: 0;
+ font: 16px/1 sans-serif;
+ -moz-osx-font-smoothing: grayscale;
+ -webkit-font-smoothing: antialiased; }
+
+h1,
+h2,
+h3,
+h4,
+p,
+blockquote,
+figure,
+ol,
+ul {
+ margin: 0;
+ padding: 0; }
+
+main,
+li {
+ display: block; }
+
+h1,
+h2,
+h3,
+h4 {
+ font-size: inherit; }
+
+strong {
+ font-weight: bold; }
+
+a,
+button {
+ color: inherit;
+ transition: .3s; }
+
+a {
+ text-decoration: none; }
+
+button {
+ overflow: visible;
+ border: 0;
+ font: inherit;
+ -webkit-font-smoothing: inherit;
+ letter-spacing: inherit;
+ background: none;
+ cursor: pointer; }
+
+::-moz-focus-inner {
+ padding: 0;
+ border: 0; }
+
+:focus {
+ outline: 0; }
+
+img {
+ max-width: 100%;
+ height: auto;
+ border: 0; }
+
+body {
+ overflow: hidden; }
+
.main {
+ position: relative;
width: 100%;
- height: 100vh;
-}
+ height: 100vh; }
+
+#loading {
+ position: absolute;
+ top: calc(50% - 8px);
+ left: calc(50% - 35px); }
diff --git a/src/public/assets/js/app.js b/src/public/assets/js/app.js
index 0914eb0..4fa4fc3 100644
--- a/src/public/assets/js/app.js
+++ b/src/public/assets/js/app.js
@@ -50,61 +50,61 @@
/* 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?");
+ 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// Check environment and set the Config helper\nif (true) {\n console.log('----- RUNNING IN DEV ENVIRONMENT! -----');\n\n _config2.default.isDev = true;\n}\n\nfunction init() {\n // Check for webGL capabilities\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\ninit();\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?");
+ 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\n// This object contains the state of the app\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.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,\n mapWidth: 2048,\n mapHeight: 2048,\n near: 250,\n far: 400,\n top: 100,\n right: 100,\n bottom: -100,\n left: -100\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.55,\n x: 0,\n y: 0,\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?");
+ 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 && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n/**\n * Tween.js - Licensed under the MIT license\n * https://github.com/tweenjs/tween.js\n * ----------------------------------------------\n *\n * See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.\n * Thank you all, you're awesome!\n */\n\n// Include a 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\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\t\t\t\t\ti++;\n\t\t\t\t} else {\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\t\t_valuesStart[field] = parseFloat(object[field], 10);\n\t}\n\n\tthis.to = function (properties, duration) {\n\n\t\tif (duration !== undefined) {\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\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\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\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\t\tvar elapsed;\n\t\tvar value;\n\n\t\tif (time < _startTime) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (_onStartCallbackFired === false) {\n\n\t\t\tif (_onStartCallback !== null) {\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\telapsed = (time - _startTime) / _duration;\n\t\telapsed = elapsed > 1 ? 1 : elapsed;\n\n\t\tvalue = _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\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\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\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\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\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\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\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\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\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\tvar a = 0.1;\n\t\t\tvar p = 0.4;\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 (!a || a < 1) {\n\t\t\t\ta = 1;\n\t\t\t\ts = 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\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\tvar a = 0.1;\n\t\t\tvar p = 0.4;\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 (!a || a < 1) {\n\t\t\t\ta = 1;\n\t\t\t\ts = 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\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\tvar a = 0.1;\n\t\t\tvar p = 0.4;\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 (!a || a < 1) {\n\t\t\t\ta = 1;\n\t\t\t\ts = 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\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\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\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\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\t\t\t\treturn 7.5625 * k * k;\n\t\t\t} else if (k < 2 / 2.75) {\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\t\t\t\treturn 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;\n\t\t\t} else {\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\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\tvar f = m * k;\n\t\tvar i = Math.floor(f);\n\t\tvar 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\tvar n = v.length - 1;\n\t\tvar pw = Math.pow;\n\t\tvar bn = TWEEN.Interpolation.Utils.Bernstein;\n\n\t\tfor (var 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\tvar f = m * k;\n\t\tvar i = Math.floor(f);\n\t\tvar 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\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\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 (var 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\tvar v1 = (p3 - p1) * 0.5;\n\t\t\tvar t2 = t * t;\n\t\t\tvar t3 = t * t2;\n\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?");
+ 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 canvas: !!window.CanvasRenderingContext2D,\n webgl: function () {\n try {\n var canvas = document.createElement('canvas');\n\n return !!(window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl')));\n } catch (e) {\n return false;\n }\n }(),\n\n workers: !!window.Worker,\n fileapi: window.File && window.FileReader && window.FileList && window.Blob,\n\n getWebGLErrorMessage: function getWebGLErrorMessage() {\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 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 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 ** 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?");
+ 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// Components\n\n\n// Helpers\n\n\n// Model\n\n\n// Managers\n\n\n// data\n\n\nvar _three = __webpack_require__(6);\n\nvar THREE = _interopRequireWildcard(_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__(14);\n\nvar _texture2 = _interopRequireDefault(_texture);\n\nvar _model = __webpack_require__(19);\n\nvar _model2 = _interopRequireDefault(_model);\n\nvar _interaction = __webpack_require__(21);\n\nvar _interaction2 = _interopRequireDefault(_interaction);\n\nvar _datGUI = __webpack_require__(23);\n\nvar _datGUI2 = _interopRequireDefault(_datGUI);\n\nvar _config = __webpack_require__(2);\n\nvar _config2 = _interopRequireDefault(_config);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// -- End of imports\n\n// Local vars for rStats\nvar rS = void 0,\n bS = void 0,\n glS = void 0,\n tS = void 0;\n\n// This class instantiates and ties all of the components together, starts the loading process and renders the main loop\n\nvar Main = function () {\n function Main(container) {\n var _this = this;\n\n _classCallCheck(this, Main);\n\n // Set container property to container element\n this.container = container;\n\n // Start Three clock\n this.clock = new THREE.Clock();\n\n // Main scene creation\n this.scene = new THREE.Scene();\n this.scene.fog = new THREE.FogExp2(_config2.default.fog.color, _config2.default.fog.near);\n\n // Get Device Pixel Ratio first for retina\n if (window.devicePixelRatio) {\n _config2.default.dpr = window.devicePixelRatio;\n }\n\n // Main renderer instantiation\n this.renderer = new _renderer2.default(this.scene, container);\n\n // Components instantiation\n this.camera = new _camera2.default(this.renderer.threeRenderer);\n this.controls = new _controls2.default(this.camera.threeCamera, container);\n this.light = new _light2.default(this.scene);\n\n // Create and place lights in scene\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 // Create and place geo in scene\n this.geometry = new _geometry2.default(this.scene);\n this.geometry.make('plane')(150, 150, 10, 10);\n this.geometry.place([0, -20, 0], [Math.PI / 2, 0, 0]);\n\n // Set up rStats if dev environment\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 // Instantiate texture class\n this.texture = new _texture2.default();\n\n // Start loading the textures and then go on to load the model after the texture Promises have resolved\n this.texture.load().then(function () {\n _this.manager = new THREE.LoadingManager();\n\n // Textures loaded, load model\n _this.model = new _model2.default(_this.scene, _this.manager, _this.texture.textures);\n _this.model.load();\n\n // onProgress callback\n _this.manager.onProgress = function (item, loaded, total) {\n console.log(item + ': ' + loaded + ' ' + total);\n };\n\n // All loaders done now\n _this.manager.onLoad = function () {\n // Set up interaction manager with the app now that the model is finished loading\n new _interaction2.default(_this.renderer.threeRenderer, _this.scene, _this.camera.threeCamera, _this.controls.threeControls);\n\n // Add dat.GUI controls if dev\n if (_config2.default.isDev) {\n new _datGUI2.default(_this, _this.model.obj);\n }\n\n // Everything is now fully loaded\n _config2.default.isLoaded = true;\n _this.container.querySelector('#loading').style.display = 'none';\n };\n });\n\n // Start render which does not wait for model fully loaded\n this.render();\n }\n\n _createClass(Main, [{\n key: 'render',\n value: function render() {\n // Render rStats if Dev\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 // Call render function and pass in created scene and camera\n this.renderer.render(this.scene, this.camera.threeCamera);\n\n // rStats has finished determining render call now\n if (_config2.default.isDev) {\n rS('render').end(); // render finished\n rS('frame').end(); // frame finished\n\n // Local rStats update\n rS('rStats').start();\n rS().update();\n rS('rStats').end();\n }\n\n // Delta time is sometimes needed for certain updates\n //const delta = this.clock.getDelta();\n\n // Call any vendor or module updates here\n _tween2.default.update();\n this.controls.threeControls.update();\n\n // RAF\n requestAnimationFrame(this.render.bind(this)); // Bind the main class instead of window object\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