From 4017c4811155afc240ff076f58869d65a50341fe Mon Sep 17 00:00:00 2001 From: Brian Chirls Date: Wed, 6 May 2015 12:46:46 -0400 Subject: [PATCH] Fix parsing bug in text with newlines --- build/vr.dev.js | 108 ++++++++++++++++++++++---------------------- build/vr.js | 31 +++++++------ build/vr.js.map | 2 +- src/objects/text.js | 1 + 4 files changed, 72 insertions(+), 70 deletions(-) diff --git a/build/vr.dev.js b/build/vr.dev.js index fa76b43..23a90a9 100644 --- a/build/vr.dev.js +++ b/build/vr.dev.js @@ -44,37 +44,37 @@ /* 0 */ /***/ function(module, exports, __webpack_require__) { - eval("(function () {\n\t'use strict';\n\n\t//global-ish declarations\n\tvar VR,\n\t\tNoSleep = __webpack_require__(13).NoSleep;\n\n\tfunction initRequirements() {\n\t\t//load styles\n\t\t__webpack_require__(2);\n\n\t\tVR = __webpack_require__(1);\n\t}\n\n\tfunction initUI() {\n\t\tvar container,\n\t\t\tenableFullscreen,\n\t\t\tdisableFullscreen,\n\t\t\tvrButton,\n\t\t\torientationButton,\n\t\t\telement,\n\n\t\t\tnoSleep = new NoSleep(),\n\n\t\t\tfullScreenElement = document.body,\n\n\t\t\tfullscreenEnabled = document.fullscreenEnabled ||\n\t\t\t\tdocument.webkitFullscreenEnabled ||\n\t\t\t\tdocument.mozFullScreenEnabled ||\n\t\t\t\tdocument.msFullscreenEnabled,\n\n\t\t\trequestFullscreen = fullScreenElement.webkitRequestFullscreen ||\n\t\t\t\tfullScreenElement.mozRequestFullScreen ||\n\t\t\t\tfullScreenElement.msRequestFullscreen;\n\n\t\tfunction svgButton(source, id) {\n\t\t\tvar span = document.createElement('span'),\n\t\t\t\tsvg;\n\n\t\t\tspan.innerHTML = source;\n\t\t\tspan.id = id;\n\n\t\t\tsvg = span.firstChild;\n\t\t\tsvg.setAttribute('width', 18);\n\t\t\tsvg.setAttribute('height', 18);\n\n\t\t\tcontainer.appendChild(span);\n\n\t\t\treturn span;\n\t\t}\n\n\t\tfunction toggleOrientation() {\n\t\t\tif (VR.orientationEnabled()) {\n\t\t\t\tVR.disableOrientation();\n\t\t\t} else {\n\t\t\t\tVR.enableOrientation();\n\t\t\t}\n\t\t}\n\n\t\tfunction deviceChange() {\n\t\t\tif (VR.controlMode()) {\n\t\t\t\tvrButton.classList.remove('unsupported');\n\t\t\t\torientationButton.classList.remove('unsupported');\n\t\t\t}\n\n\t\t\t//todo: enable this\n\t\t\t//info.innerHTML = hmd && hmd.deviceName ? 'HMD: ' + hmd.deviceName : '';\n\t\t\t//info.className = hmd && hmd.deviceId !== 'debug-0' ? 'has-hmd' : '';\n\t\t}\n\n\t\t//set up meta viewport tag for mobile devices\n\t\telement = document.createElement('meta');\n\t\telement.setAttribute('name', 'viewport');\n\t\telement.setAttribute('content', 'width=device-width, initial-scale=1, user-scalable=no');\n\t\tdocument.head.appendChild(element);\n\n\t\tcontainer = document.createElement('div');\n\t\tcontainer.id = 'buttons';\n\t\tdocument.body.appendChild(container);\n\n\t\t//todo: use icons instead of text\n\t\tif (requestFullscreen && fullscreenEnabled) {\n\t\t\tenableFullscreen = svgButton(__webpack_require__(4), 'fs-enable');\n\t\t\tenableFullscreen.setAttribute('title', 'Enable Full Screen');\n\t\t\tenableFullscreen.addEventListener('click', requestFullscreen.bind(fullScreenElement), false);\n\n\t\t\tdisableFullscreen = svgButton(__webpack_require__(5), 'fs-disable');\n\t\t\tdisableFullscreen.setAttribute('title', 'Exit Full Screen');\n\t\t\tdisableFullscreen.addEventListener('click', VR.exitFullscreen, false);\n\t\t}\n\n\t\tVR.on('fullscreenchange', function () {\n\t\t\tif (VR.isFullscreen()) {\n\t\t\t\tdisableFullscreen.style.display = 'inline-block';\n\t\t\t\tenableFullscreen.style.display = 'none';\n\t\t\t} else {\n\t\t\t\tdisableFullscreen.style.display = '';\n\t\t\t\tenableFullscreen.style.display = '';\n\t\t\t}\n\n\t\t\t//disable sleep on mobile devices in VR mode\n\t\t\tif (VR.vrMode()) {\n\t\t\t\tnoSleep.enable();\n\t\t\t} else {\n\t\t\t\tnoSleep.disable();\n\t\t\t}\n\t\t});\n\n\t\tvrButton = svgButton(__webpack_require__(6), 'vr');\n\t\tvrButton.setAttribute('title', 'Toggle Virtual Reality');\n\t\tvrButton.className = 'unsupported';\n\t\tvrButton.addEventListener('click', VR.requestVR, false);\n\n\t\torientationButton = svgButton(__webpack_require__(7), 'orientation');\n\t\torientationButton.setAttribute('title', 'Toggle Orientation');\n\t\torientationButton.className = 'unsupported';\n\t\torientationButton.addEventListener('click', toggleOrientation, false);\n\n\t\t//report on HMD\n\t\tVR.on('devicechange', deviceChange);\n\t\tdeviceChange();\n\n\t\t//keyboard shortcuts for making life a little easier\n\t\twindow.addEventListener('keydown', function (evt) {\n\t\t\tif (evt.keyCode === 'Z'.charCodeAt(0)) {\n\t\t\t\tVR.zeroSensor();\n\t\t\t} else if (evt.keyCode === 'O'.charCodeAt(0)) {\n\t\t\t\tVR.enableOrientation();\n\t\t\t} else if (evt.keyCode === 13) {\n\t\t\t\tVR.requestVR();\n\t\t\t}\n\t\t}, false);\n\n\t\tVR.resize();\n\t}\n\n\tfunction initialize() {\n\t\tinitRequirements();\n\n\t\t//todo: set up button/info elements\n\n\t\tVR.init();\n\n\t\tif (document.body) {\n\t\t\tinitUI();\n\t\t} else {\n\t\t\twindow.addEventListener('load', initUI, false);\n\t\t}\n\n\t\twindow.addEventListener('resize', VR.resize, false);\n\n\t\t/*\n\t\texport global things\n\t\t*/\n\t\twindow.VR = VR;\n\t\twindow.THREE = VR.THREE;\n\t}\n\n\tinitialize();\n\tVR.start();\n}());\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/entry.js\n ** module id = 0\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/entry.js?"); + eval("(function () {\n\t'use strict';\n\n\t//global-ish declarations\n\tvar VR,\n\t\tNoSleep = __webpack_require__(9).NoSleep;\n\n\tfunction initRequirements() {\n\t\t//load styles\n\t\t__webpack_require__(2);\n\n\t\tVR = __webpack_require__(1);\n\t}\n\n\tfunction initUI() {\n\t\tvar container,\n\t\t\tenableFullscreen,\n\t\t\tdisableFullscreen,\n\t\t\tvrButton,\n\t\t\torientationButton,\n\t\t\telement,\n\n\t\t\tnoSleep = new NoSleep(),\n\n\t\t\tfullScreenElement = document.body,\n\n\t\t\tfullscreenEnabled = document.fullscreenEnabled ||\n\t\t\t\tdocument.webkitFullscreenEnabled ||\n\t\t\t\tdocument.mozFullScreenEnabled ||\n\t\t\t\tdocument.msFullscreenEnabled,\n\n\t\t\trequestFullscreen = fullScreenElement.webkitRequestFullscreen ||\n\t\t\t\tfullScreenElement.mozRequestFullScreen ||\n\t\t\t\tfullScreenElement.msRequestFullscreen;\n\n\t\tfunction svgButton(source, id) {\n\t\t\tvar span = document.createElement('span'),\n\t\t\t\tsvg;\n\n\t\t\tspan.innerHTML = source;\n\t\t\tspan.id = id;\n\n\t\t\tsvg = span.firstChild;\n\t\t\tsvg.setAttribute('width', 18);\n\t\t\tsvg.setAttribute('height', 18);\n\n\t\t\tcontainer.appendChild(span);\n\n\t\t\treturn span;\n\t\t}\n\n\t\tfunction toggleOrientation() {\n\t\t\tif (VR.orientationEnabled()) {\n\t\t\t\tVR.disableOrientation();\n\t\t\t} else {\n\t\t\t\tVR.enableOrientation();\n\t\t\t}\n\t\t}\n\n\t\tfunction deviceChange() {\n\t\t\tif (VR.controlMode()) {\n\t\t\t\tvrButton.classList.remove('unsupported');\n\t\t\t\torientationButton.classList.remove('unsupported');\n\t\t\t}\n\n\t\t\t//todo: enable this\n\t\t\t//info.innerHTML = hmd && hmd.deviceName ? 'HMD: ' + hmd.deviceName : '';\n\t\t\t//info.className = hmd && hmd.deviceId !== 'debug-0' ? 'has-hmd' : '';\n\t\t}\n\n\t\t//set up meta viewport tag for mobile devices\n\t\telement = document.createElement('meta');\n\t\telement.setAttribute('name', 'viewport');\n\t\telement.setAttribute('content', 'width=device-width, initial-scale=1, user-scalable=no');\n\t\tdocument.head.appendChild(element);\n\n\t\tcontainer = document.createElement('div');\n\t\tcontainer.id = 'buttons';\n\t\tdocument.body.appendChild(container);\n\n\t\t//todo: use icons instead of text\n\t\tif (requestFullscreen && fullscreenEnabled) {\n\t\t\tenableFullscreen = svgButton(__webpack_require__(5), 'fs-enable');\n\t\t\tenableFullscreen.setAttribute('title', 'Enable Full Screen');\n\t\t\tenableFullscreen.addEventListener('click', requestFullscreen.bind(fullScreenElement), false);\n\n\t\t\tdisableFullscreen = svgButton(__webpack_require__(7), 'fs-disable');\n\t\t\tdisableFullscreen.setAttribute('title', 'Exit Full Screen');\n\t\t\tdisableFullscreen.addEventListener('click', VR.exitFullscreen, false);\n\t\t}\n\n\t\tVR.on('fullscreenchange', function () {\n\t\t\tif (VR.isFullscreen()) {\n\t\t\t\tdisableFullscreen.style.display = 'inline-block';\n\t\t\t\tenableFullscreen.style.display = 'none';\n\t\t\t} else {\n\t\t\t\tdisableFullscreen.style.display = '';\n\t\t\t\tenableFullscreen.style.display = '';\n\t\t\t}\n\n\t\t\t//disable sleep on mobile devices in VR mode\n\t\t\tif (VR.vrMode()) {\n\t\t\t\tnoSleep.enable();\n\t\t\t} else {\n\t\t\t\tnoSleep.disable();\n\t\t\t}\n\t\t});\n\n\t\tvrButton = svgButton(__webpack_require__(6), 'vr');\n\t\tvrButton.setAttribute('title', 'Toggle Virtual Reality');\n\t\tvrButton.className = 'unsupported';\n\t\tvrButton.addEventListener('click', VR.requestVR, false);\n\n\t\torientationButton = svgButton(__webpack_require__(8), 'orientation');\n\t\torientationButton.setAttribute('title', 'Toggle Orientation');\n\t\torientationButton.className = 'unsupported';\n\t\torientationButton.addEventListener('click', toggleOrientation, false);\n\n\t\t//report on HMD\n\t\tVR.on('devicechange', deviceChange);\n\t\tdeviceChange();\n\n\t\t//keyboard shortcuts for making life a little easier\n\t\twindow.addEventListener('keydown', function (evt) {\n\t\t\tif (evt.keyCode === 'Z'.charCodeAt(0)) {\n\t\t\t\tVR.zeroSensor();\n\t\t\t} else if (evt.keyCode === 'O'.charCodeAt(0)) {\n\t\t\t\tVR.enableOrientation();\n\t\t\t} else if (evt.keyCode === 13) {\n\t\t\t\tVR.requestVR();\n\t\t\t}\n\t\t}, false);\n\n\t\tVR.resize();\n\t}\n\n\tfunction initialize() {\n\t\tinitRequirements();\n\n\t\t//todo: set up button/info elements\n\n\t\tVR.init();\n\n\t\tif (document.body) {\n\t\t\tinitUI();\n\t\t} else {\n\t\t\twindow.addEventListener('load', initUI, false);\n\t\t}\n\n\t\twindow.addEventListener('resize', VR.resize, false);\n\n\t\t/*\n\t\texport global things\n\t\t*/\n\t\twindow.VR = VR;\n\t\twindow.THREE = VR.THREE;\n\t}\n\n\tinitialize();\n\tVR.start();\n}());\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/entry.js\n ** module id = 0\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/entry.js?"); /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { - eval("(function () {\n\t'use strict';\n\n\t//constants\n\tvar NEAR = 0.1,\n\t\tFAR = 1000000,\n\n\t//global-ish declarations\n\t\tTHREE,\n\t\teventEmitter,\n\t\tmaterials = __webpack_require__(9),\n\t\tnop = function () {},\n\t\trequestFullscreen = nop,\n\t\texitFullscreen = (\n\t\t\tdocument.exitFullscreen ||\n\t\t\tdocument.mozCancelFullScreen ||\n\t\t\tdocument.webkitExitFullscreen ||\n\t\t\tdocument.msExitFullscreen ||\n\t\t\tnop\n\t\t).bind(document),\n\n\t//scene assets\n\t\tcamera,\n\t\tscene,\n\t\tbody,\n\t\trenderer,\n\t\taudioListener,\n\t\tvrControls,\n\t\tvrEffect,\n\t\tmouseControls,\n\t\traycaster,\n\t\ttarget,\n\n\t\tbodyWrapper,\n\t\tcameraWrapper,\n\n\t\tfloor,\n\n\t//state\n\t\tgoing = false,\n\t\tvrMode = false,\n\t\torientationEnabled,\n\t\torientationPossible = false,\n\n\t//exported object\n\t\tVR,\n\n\t\tVRObject = __webpack_require__(10),\n\t\tobjectMethods = [\n\t\t\t'box',\n\t\t\t'cylinder',\n\t\t\t'torus',\n\t\t\t'sphere',\n\t\t\t'empty',\n\t\t\t'sound',\n\t\t\t'floor',\n\t\t\t'sky',\n\t\t\t'panorama',\n\t\t\t'image',\n\t\t\t'video',\n\t\t\t'text'\n\t\t],\n\n\t\t//todo: use a weak map or set instead\n\t\tvrObjects = [],\n\n\t\tlastTick = 0,\n\t\tanimationCallbacks = [];\n\n\tfunction isFullscreen() {\n\t\treturn !!(document.fullscreenElement ||\n\t\t\tdocument.mozFullScreenElement ||\n\t\t\tdocument.webkitFullscreenElement ||\n\t\t\tdocument.msFullscreenElement);\n\t}\n\n\tfunction fullScreenError() {\n\t\tvrMode = false;\n\t\tif (vrEffect) {\n\t\t\tvrEffect.exit();\n\t\t}\n\t}\n\n\tfunction raycast() {\n\t\tvar i,\n\t\t\tintersect,\n\t\t\tobject,\n\t\t\tintersects,\n\t\t\tvrObject;\n\n\t\traycaster.ray.origin.copy( camera.position );\n\t\traycaster.ray.direction.set(0, 0, 0.5).unproject(camera).sub(camera.position).normalize();\n\n\t\tintersects = raycaster.intersectObjects( scene.children );\n\t\tfor (i = 0; i < intersects.length; i++) {\n\t\t\tintersect = intersects[i];\n\t\t\tif (intersect.object instanceof THREE.Mesh) {\n\t\t\t\tobject = intersect.object;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (target !== object) {\n\t\t\tif (target) {\n\t\t\t\tvrObject = VRObject.findObject(target);\n\t\t\t\tvrObject.emit('lookaway');\n\t\t\t\tVR.emit('lookaway', vrObject);\n\t\t\t}\n\t\t\ttarget = object;\n\t\t\tif (target) {\n\t\t\t\tvrObject = VRObject.findObject(target);\n\t\t\t\tvrObject.emit('lookat', intersect);\n\t\t\t\tVR.emit('lookat', vrObject, intersect);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction render() {\n\t\tvar now = Date.now() / 1000,\n\t\t\tdelta = Math.min(1, now - lastTick);\n\n\t\tvrControls.update();\n\n\t\tanimationCallbacks.forEach(function (cb) {\n\t\t\tcb(delta, now);\n\t\t});\n\n\t\tscene.updateMatrixWorld();\n\n\t\tvrObjects.forEach(function (object) {\n\t\t\tobject.update(now);\n\t\t});\n\n\t\traycast();\n\n\t\tvrEffect.render(scene, camera);\n\n\t\tlastTick = now;\n\t}\n\n\tfunction renderLoop() {\n\t\tif (going) {\n\t\t\trender();\n\t\t\trequestAnimationFrame(renderLoop);\n\t\t}\n\t}\n\n\tfunction stop() {\n\t\tgoing = false;\n\t}\n\n\tfunction start() {\n\t\tif (!going) {\n\t\t\tgoing = true;\n\t\t\trenderLoop();\n\t\t}\n\t}\n\n\t/*\n\tMute any sounds when this browser tab is in the background or minimized.\n\t*/\n\tfunction visibilityChange() {\n\t\tif (document.hidden || document.mozHidden || document.msHidden || document.webkitHidden) {\n\t\t\taudioListener.volume(0);\n\t\t} else {\n\t\t\taudioListener.volume(1);\n\t\t}\n\t}\n\n\tfunction resize(width, height) {\n\t\twidth = typeof width === 'number' && width || window.innerWidth;\n\t\theight = typeof height === 'number' && height || window.innerHeight;\n\n\t\tcamera.aspect = width / height;\n\t\tcamera.updateProjectionMatrix();\n\t\trenderer.setSize(width, height);\n\t}\n\n\tfunction initShake() {\n\t\tvar lastTime = 0,\n\t\t\tlastX,\n\t\t\tlastY,\n\t\t\tlastZ,\n\t\t\tthreshold = 15;\n\n\t\twindow.addEventListener('devicemotion', function (evt) {\n\t\t\tvar current = evt.accelerationIncludingGravity,\n\t\t\t\ttime,\n\t\t\t\tdiff,\n\t\t\t\tdeltaX = 0,\n\t\t\t\tdeltaY = 0,\n\t\t\t\tdeltaZ = 0,\n\t\t\t\tdist;\n\n\t\t\tif (lastX !== undefined) {\n\t\t\t\tdeltaX = Math.abs(lastX - current.x);\n\t\t\t\tdeltaY = Math.abs(lastY - current.y);\n\t\t\t\tdeltaZ = Math.abs(lastZ - current.z);\n\n\t\t\t\t// if (deltaX > threshold &&\n\t\t\t\t// \t\t(deltaY > threshold || deltaZ > threshold)\n\t\t\t\t// \t) {\n\t\t\t\tdist = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);\n\t\t\t\tif (dist > threshold) {\n\n\t\t\t\t\ttime = Date.now();\n\t\t\t\t\tdiff = time - lastTime;\n\t\t\t\t\tif (diff > 1000) {\n\t\t\t\t\t\tif (navigator.vibrate) {\n\t\t\t\t\t\t\tnavigator.vibrate(100);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlastTime = Date.now();\n\n\t\t\t\t\t\tVR.emit('shake');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlastX = current.x;\n\t\t\tlastY = current.y;\n\t\t\tlastZ = current.z;\n\n\t\t\torientationPossible = true;\n\t\t}, false);\n\t}\n\n\tfunction initScene() {\n\t\tfunction attachCanvas() {\n\t\t\tdocument.body.insertBefore(renderer.domElement, document.body.firstChild || null);\n\t\t\tresize();\n\t\t}\n\n\t\tif (renderer) {\n\t\t\treturn;\n\t\t}\n\n\t\t//create renderer and place in document\n\t\trenderer = new THREE.WebGLRenderer();\n\t\trenderer.domElement.addEventListener('webglcontextlost', function contextLost(event) {\n\t\t\tconsole.log('lost context', event);\n\t\t});\n\t\t// renderer.shadowMapEnabled = true;\n\t\t// renderer.shadowMapSoft = true;\n\n\t\t//need a scene to put all our objects in\n\t\tscene = new THREE.Scene();\n\n\t\tbodyWrapper = new VRObject(scene, __webpack_require__(12), null, {\n\t\t\tname: 'body'\n\t\t}).moveTo(0, 1.5, 4);\n\t\tbody = bodyWrapper.object;\n\n\t\tcameraWrapper = new VRObject(body, function (parent) {\n\t\t\t//need a camera with which to look at stuff\n\t\t\tcamera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, NEAR, FAR);\n\t\t\tparent.add(camera);\n\n\t\t\treturn camera;\n\t\t})\n\t\t// set camera position so that OrbitControls works properly.\n\t\t\t.moveTo(0, 0.0001, 0.0001);\n\n\t\taudioListener = new THREE.AudioListener();\n\t\taudioListener.name = 'audio-listener';\n\t\tcamera.add(audioListener);\n\n\t\t//VRControls point the camera wherever we're looking\n\t\tvrControls = new THREE.VRControls(camera);\n\t\tvrControls.freeze = !orientationEnabled;\n\n\t\t//render left and right eye\n\t\tvrEffect = new THREE.VRStereoEffect(renderer);\n\t\tvrEffect.near = NEAR;\n\t\tvrEffect.far = FAR;\n\t\tvrEffect.addEventListener('fullscreenchange', function (evt) {\n\t\t\tvar screen;\n\t\t\tif (isFullscreen()) {\n\t\t\t\tif (vrMode) {\n\t\t\t\t\t//no mouse control\n\t\t\t\t\tmouseControls.enabled = false;\n\n\t\t\t\t\tvrControls.freeze = false;\n\t\t\t\t\tvrControls.reset();\n\n\t\t\t\t\tscreen = window.screen;\n\t\t\t\t\tif (screen.lockOrientation) {\n\t\t\t\t\t\tscreen.lockOrientation('landscape-primary');\n\t\t\t\t\t} else if (screen.mozLockOrientation) {\n\t\t\t\t\t\tscreen.mozLockOrientation('landscape-primary');\n\t\t\t\t\t} else if (screen.orientation && screen.orientation.lock) {\n\t\t\t\t\t\tscreen.orientation.lock('landscape-primary');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tVR.exitVR();\n\t\t\t}\n\n\t\t\tcamera.position.set(0, 0.0001, 0.0001);\n\t\t\tcamera.rotation.set(0, 0, 0);\n\n\t\t\tVR.emit('fullscreenchange', evt);\n\t\t});\n\n\t\t//report on HMD\n\t\tvrControls.addEventListener('devicechange', function () {\n\t\t\torientationPossible = true;\n\t\t\tif (orientationEnabled === undefined) {\n\t\t\t\torientationEnabled = vrControls.mode() === 'deviceorientation';\n\t\t\t}\n\n\t\t\tvrControls.freeze = !orientationEnabled && !vrMode;\n\n\t\t\tVR.emit('devicechange', vrControls.mode(), vrEffect.hmd());\n\t\t});\n\n\t\t//mouse control in case got no orientation device\n\t\tmouseControls = new THREE.OrbitControls(camera);\n\t\tmouseControls.target0.set(0, 0.0001, 0.000);\n\t\tmouseControls.target.copy(mouseControls.target0);\n\t\tmouseControls.update();\n\n\t\t//todo: remove any default lights once other lights are added\n\t\tvar dLight = new THREE.DirectionalLight(0xffffff, 0.8);\n\t\tdLight.name = 'directional-light';\n\t\tdLight.position.set(20, 100, 100);\n\n\t\tdLight.castShadow = true;\n\t\tdLight.shadowCameraVisible = true;\n\n\t\tdLight.shadowMapWidth = 2048;\n\t\tdLight.shadowMapHeight = 2048;\n\n\t\tdLight.shadowCameraLeft = -10;\n\t\tdLight.shadowCameraRight = 10;\n\t\tdLight.shadowCameraTop = 10;\n\t\tdLight.shadowCameraBottom = -10;\n\n\t\tdLight.shadowCameraFar = 150;\n\t\tdLight.shadowCameraNear = 100;\n\t\tdLight.shadowDarkness = 1;\n\n\t\tscene.add(dLight);\n\n\t\tscene.add(new THREE.AmbientLight(0x444444));\n\n\t\tif (VR) {\n\t\t\tVR.camera = cameraWrapper;\n\t\t\tVR.body = bodyWrapper;\n\t\t\tVR.scene = scene;\n\t\t\tVR.canvas = renderer.domElement;\n\t\t\tVR.zeroSensor = vrControls.zeroSensor;\n\t\t}\n\n\t\traycaster = new THREE.Raycaster();\n\n\t\tif (document.body) {\n\t\t\tattachCanvas();\n\t\t} else {\n\t\t\twindow.addEventListener('load', attachCanvas, false);\n\t\t}\n\n\t\tVR.canvas.addEventListener('mozfullscreenerror', fullScreenError, false);\n\t\tVR.canvas.addEventListener('webkitfullscreenerror', fullScreenError, false);\n\t\tVR.canvas.addEventListener('fullscreenerror', fullScreenError, false);\n\t}\n\n\tfunction initRequirements() {\n\t\t//load external requirements\n\t\tTHREE = __webpack_require__(32);\n\t\t__webpack_require__(27);\n\t\t__webpack_require__(28);\n\n\t\t//if (typeof __DEV__ !== 'undefined' && __DEV__) {\n\t\t\t__webpack_require__(29);\n\t\t//}\n\n\t\tTHREE.ImageUtils.crossOrigin = '';\n\n\t\teventEmitter = __webpack_require__(26);\n\n\t\t//my VR stuff. todo: move these to a separate repo or two for easy packaging\n\t\t__webpack_require__(30);\n\t\t__webpack_require__(31);\n\t}\n\n\tfunction initialize() {\n\t\t//todo: set up button/info elements\n\n\t\tinitScene();\n\n\t\tinitShake();\n\n\t\tresize();\n\n\t\tdocument.addEventListener('visibilitychange', visibilityChange);\n\t\tdocument.addEventListener('mozvisibilitychange', visibilityChange);\n\t\tdocument.addEventListener('msvisibilitychange', visibilityChange);\n\t\tdocument.addEventListener('webkitvisibilitychange', visibilityChange);\n\t}\n\n\tinitRequirements();\n\n\tmodule.exports = VR = {\n\t\tinit: initialize,\n\t\trender: render,\n\t\tstart: start,\n\t\tstop: stop,\n\t\tresize: resize,\n\n\t\tTHREE: THREE,\n\n\t\tmaterials: materials,\n\n\t\tanimate: function (callback) {\n\t\t\tvar i;\n\t\t\tif (typeof callback === 'function') {\n\t\t\t\ti = animationCallbacks.indexOf(callback);\n\t\t\t\tif (i < 0) {\n\t\t\t\t\tanimationCallbacks.push(callback);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tend: function (callback) {\n\t\t\tvar i;\n\n\t\t\tif (!callback) {\n\t\t\t\tanimationCallbacks.length = 0;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof callback === 'function') {\n\t\t\t\ti = animationCallbacks.indexOf(callback);\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tanimationCallbacks.splice(i, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\trequestVR: function () {\n\t\t\t//todo: check if it's possible\n\t\t\tif (vrMode || !vrEffect) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvrMode = true;\n\n\t\t\t//full screen and render two eyes\n\t\t\t//always full screen\n\t\t\tvrEffect.requestFullScreen();\n\t\t},\n\n\t\texitVR: function () {\n\t\t\tvrMode = false;\n\t\t\tif (isFullscreen()) {\n\t\t\t\texitFullscreen();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmouseControls.enabled = true;\n\t\t\tvrControls.freeze = !orientationEnabled;\n\t\t\tcamera.rotation.set(0, 0, 0);\n\t\t},\n\n\t\tvrMode: function () {\n\t\t\treturn vrMode && isFullscreen();\n\t\t},\n\n\t\torientationEnabled: function () {\n\t\t\treturn !!orientationEnabled;\n\t\t},\n\t\tenableOrientation: function () {\n\t\t\torientationEnabled = true;\n\t\t\tif (!vrMode) {\n\t\t\t\tvrControls.freeze = false;\n\t\t\t}\n\t\t},\n\t\tdisableOrientation: function () {\n\t\t\torientationEnabled = false;\n\t\t\tcamera.rotation.set(0, 0, 0);\n\t\t\tvrControls.freeze = !vrMode;\n\t\t},\n\n\t\tisFullscreen: isFullscreen,\n\t\trequestFullscreen: requestFullscreen,\n\t\texitFullscreen: function () {\n\t\t\tif (isFullscreen()) {\n\t\t\t\texitFullscreen();\n\t\t\t}\n\t\t},\n\n\t\tcontrolMode: function () {\n\t\t\treturn vrControls && vrControls.mode();\n\t\t},\n\n\t\tzeroSensor: nop,\n\n\t\tvibrate: navigator.vibrate ? navigator.vibrate.bind(navigator) : nop,\n\n\t\t// Utility\n\t\ttimes: function (n, callback) {\n\t\t\tvar i;\n\n\t\t\tfor (i = 0; i < n; i++) {\n\t\t\t\tcallback(i);\n\t\t\t}\n\t\t},\n\n\t\tcamera: cameraWrapper,\n\t\tbody: bodyWrapper,\n\t\tscene: scene,\n\t\tcanvas: renderer && renderer.domElement || null\n\t};\n\n\tobjectMethods.forEach(function (method) {\n\t\tvar creator = __webpack_require__(11)(\"./\" + method),\n\t\t\tkey;\n\n\t\tVR[method] = function (options) {\n\t\t\tvar obj = new VRObject(scene, creator, body, options);\n\t\t\tvrObjects.push(obj);\n\t\t\treturn obj;\n\t\t};\n\n\t\tVRObject.prototype[method] = function (options) {\n\t\t\tvar obj = new VRObject(this.object, creator, body, options);\n\t\t\tvrObjects.push(obj);\n\t\t\treturn obj;\n\t\t};\n\n\t\tfor (key in creator) {\n\t\t\tif (creator.hasOwnProperty(key) && typeof creator[key] === 'function') {\n\t\t\t\tVR[method][key] = creator[key];\n\t\t\t\tVRObject.prototype[method][key] = creator[key];\n\t\t\t}\n\t\t}\n\t});\n\n\teventEmitter(VR);\n\n\tObject.defineProperty(VR, 'target', {\n\t\tget: function () {\n\t\t\treturn target;\n\t\t}\n\t});\n}());\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/vr.js\n ** module id = 1\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/vr.js?"); + eval("(function () {\n\t'use strict';\n\n\t//constants\n\tvar NEAR = 0.1,\n\t\tFAR = 1000000,\n\n\t//global-ish declarations\n\t\tTHREE,\n\t\teventEmitter,\n\t\tmaterials = __webpack_require__(10),\n\t\tnop = function () {},\n\t\trequestFullscreen = nop,\n\t\texitFullscreen = (\n\t\t\tdocument.exitFullscreen ||\n\t\t\tdocument.mozCancelFullScreen ||\n\t\t\tdocument.webkitExitFullscreen ||\n\t\t\tdocument.msExitFullscreen ||\n\t\t\tnop\n\t\t).bind(document),\n\n\t//scene assets\n\t\tcamera,\n\t\tscene,\n\t\tbody,\n\t\trenderer,\n\t\taudioListener,\n\t\tvrControls,\n\t\tvrEffect,\n\t\tmouseControls,\n\t\traycaster,\n\t\ttarget,\n\n\t\tbodyWrapper,\n\t\tcameraWrapper,\n\n\t\tfloor,\n\n\t//state\n\t\tgoing = false,\n\t\tvrMode = false,\n\t\torientationEnabled,\n\t\torientationPossible = false,\n\n\t//exported object\n\t\tVR,\n\n\t\tVRObject = __webpack_require__(11),\n\t\tobjectMethods = [\n\t\t\t'box',\n\t\t\t'cylinder',\n\t\t\t'torus',\n\t\t\t'sphere',\n\t\t\t'empty',\n\t\t\t'sound',\n\t\t\t'floor',\n\t\t\t'sky',\n\t\t\t'panorama',\n\t\t\t'image',\n\t\t\t'video',\n\t\t\t'text'\n\t\t],\n\n\t\t//todo: use a weak map or set instead\n\t\tvrObjects = [],\n\n\t\tlastTick = 0,\n\t\tanimationCallbacks = [];\n\n\tfunction isFullscreen() {\n\t\treturn !!(document.fullscreenElement ||\n\t\t\tdocument.mozFullScreenElement ||\n\t\t\tdocument.webkitFullscreenElement ||\n\t\t\tdocument.msFullscreenElement);\n\t}\n\n\tfunction fullScreenError() {\n\t\tvrMode = false;\n\t\tif (vrEffect) {\n\t\t\tvrEffect.exit();\n\t\t}\n\t}\n\n\tfunction raycast() {\n\t\tvar i,\n\t\t\tintersect,\n\t\t\tobject,\n\t\t\tintersects,\n\t\t\tvrObject;\n\n\t\traycaster.ray.origin.copy( camera.position );\n\t\traycaster.ray.direction.set(0, 0, 0.5).unproject(camera).sub(camera.position).normalize();\n\n\t\tintersects = raycaster.intersectObjects( scene.children );\n\t\tfor (i = 0; i < intersects.length; i++) {\n\t\t\tintersect = intersects[i];\n\t\t\tif (intersect.object instanceof THREE.Mesh) {\n\t\t\t\tobject = intersect.object;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (target !== object) {\n\t\t\tif (target) {\n\t\t\t\tvrObject = VRObject.findObject(target);\n\t\t\t\tvrObject.emit('lookaway');\n\t\t\t\tVR.emit('lookaway', vrObject);\n\t\t\t}\n\t\t\ttarget = object;\n\t\t\tif (target) {\n\t\t\t\tvrObject = VRObject.findObject(target);\n\t\t\t\tvrObject.emit('lookat', intersect);\n\t\t\t\tVR.emit('lookat', vrObject, intersect);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction render() {\n\t\tvar now = Date.now() / 1000,\n\t\t\tdelta = Math.min(1, now - lastTick);\n\n\t\tvrControls.update();\n\n\t\tanimationCallbacks.forEach(function (cb) {\n\t\t\tcb(delta, now);\n\t\t});\n\n\t\tscene.updateMatrixWorld();\n\n\t\tvrObjects.forEach(function (object) {\n\t\t\tobject.update(now);\n\t\t});\n\n\t\traycast();\n\n\t\tvrEffect.render(scene, camera);\n\n\t\tlastTick = now;\n\t}\n\n\tfunction renderLoop() {\n\t\tif (going) {\n\t\t\trender();\n\t\t\trequestAnimationFrame(renderLoop);\n\t\t}\n\t}\n\n\tfunction stop() {\n\t\tgoing = false;\n\t}\n\n\tfunction start() {\n\t\tif (!going) {\n\t\t\tgoing = true;\n\t\t\trenderLoop();\n\t\t}\n\t}\n\n\t/*\n\tMute any sounds when this browser tab is in the background or minimized.\n\t*/\n\tfunction visibilityChange() {\n\t\tif (document.hidden || document.mozHidden || document.msHidden || document.webkitHidden) {\n\t\t\taudioListener.volume(0);\n\t\t} else {\n\t\t\taudioListener.volume(1);\n\t\t}\n\t}\n\n\tfunction resize(width, height) {\n\t\twidth = typeof width === 'number' && width || window.innerWidth;\n\t\theight = typeof height === 'number' && height || window.innerHeight;\n\n\t\tcamera.aspect = width / height;\n\t\tcamera.updateProjectionMatrix();\n\t\trenderer.setSize(width, height);\n\t}\n\n\tfunction initShake() {\n\t\tvar lastTime = 0,\n\t\t\tlastX,\n\t\t\tlastY,\n\t\t\tlastZ,\n\t\t\tthreshold = 15;\n\n\t\twindow.addEventListener('devicemotion', function (evt) {\n\t\t\tvar current = evt.accelerationIncludingGravity,\n\t\t\t\ttime,\n\t\t\t\tdiff,\n\t\t\t\tdeltaX = 0,\n\t\t\t\tdeltaY = 0,\n\t\t\t\tdeltaZ = 0,\n\t\t\t\tdist;\n\n\t\t\tif (lastX !== undefined) {\n\t\t\t\tdeltaX = Math.abs(lastX - current.x);\n\t\t\t\tdeltaY = Math.abs(lastY - current.y);\n\t\t\t\tdeltaZ = Math.abs(lastZ - current.z);\n\n\t\t\t\t// if (deltaX > threshold &&\n\t\t\t\t// \t\t(deltaY > threshold || deltaZ > threshold)\n\t\t\t\t// \t) {\n\t\t\t\tdist = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);\n\t\t\t\tif (dist > threshold) {\n\n\t\t\t\t\ttime = Date.now();\n\t\t\t\t\tdiff = time - lastTime;\n\t\t\t\t\tif (diff > 1000) {\n\t\t\t\t\t\tif (navigator.vibrate) {\n\t\t\t\t\t\t\tnavigator.vibrate(100);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlastTime = Date.now();\n\n\t\t\t\t\t\tVR.emit('shake');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlastX = current.x;\n\t\t\tlastY = current.y;\n\t\t\tlastZ = current.z;\n\n\t\t\torientationPossible = true;\n\t\t}, false);\n\t}\n\n\tfunction initScene() {\n\t\tfunction attachCanvas() {\n\t\t\tdocument.body.insertBefore(renderer.domElement, document.body.firstChild || null);\n\t\t\tresize();\n\t\t}\n\n\t\tif (renderer) {\n\t\t\treturn;\n\t\t}\n\n\t\t//create renderer and place in document\n\t\trenderer = new THREE.WebGLRenderer();\n\t\trenderer.domElement.addEventListener('webglcontextlost', function contextLost(event) {\n\t\t\tconsole.log('lost context', event);\n\t\t});\n\t\t// renderer.shadowMapEnabled = true;\n\t\t// renderer.shadowMapSoft = true;\n\n\t\t//need a scene to put all our objects in\n\t\tscene = new THREE.Scene();\n\n\t\tbodyWrapper = new VRObject(scene, __webpack_require__(13), null, {\n\t\t\tname: 'body'\n\t\t}).moveTo(0, 1.5, 4);\n\t\tbody = bodyWrapper.object;\n\n\t\tcameraWrapper = new VRObject(body, function (parent) {\n\t\t\t//need a camera with which to look at stuff\n\t\t\tcamera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, NEAR, FAR);\n\t\t\tparent.add(camera);\n\n\t\t\treturn camera;\n\t\t})\n\t\t// set camera position so that OrbitControls works properly.\n\t\t\t.moveTo(0, 0.0001, 0.0001);\n\n\t\taudioListener = new THREE.AudioListener();\n\t\taudioListener.name = 'audio-listener';\n\t\tcamera.add(audioListener);\n\n\t\t//VRControls point the camera wherever we're looking\n\t\tvrControls = new THREE.VRControls(camera);\n\t\tvrControls.freeze = !orientationEnabled;\n\n\t\t//render left and right eye\n\t\tvrEffect = new THREE.VRStereoEffect(renderer);\n\t\tvrEffect.near = NEAR;\n\t\tvrEffect.far = FAR;\n\t\tvrEffect.addEventListener('fullscreenchange', function (evt) {\n\t\t\tvar screen;\n\t\t\tif (isFullscreen()) {\n\t\t\t\tif (vrMode) {\n\t\t\t\t\t//no mouse control\n\t\t\t\t\tmouseControls.enabled = false;\n\n\t\t\t\t\tvrControls.freeze = false;\n\t\t\t\t\tvrControls.reset();\n\n\t\t\t\t\tscreen = window.screen;\n\t\t\t\t\tif (screen.lockOrientation) {\n\t\t\t\t\t\tscreen.lockOrientation('landscape-primary');\n\t\t\t\t\t} else if (screen.mozLockOrientation) {\n\t\t\t\t\t\tscreen.mozLockOrientation('landscape-primary');\n\t\t\t\t\t} else if (screen.orientation && screen.orientation.lock) {\n\t\t\t\t\t\tscreen.orientation.lock('landscape-primary');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tVR.exitVR();\n\t\t\t}\n\n\t\t\tcamera.position.set(0, 0.0001, 0.0001);\n\t\t\tcamera.rotation.set(0, 0, 0);\n\n\t\t\tVR.emit('fullscreenchange', evt);\n\t\t});\n\n\t\t//report on HMD\n\t\tvrControls.addEventListener('devicechange', function () {\n\t\t\torientationPossible = true;\n\t\t\tif (orientationEnabled === undefined) {\n\t\t\t\torientationEnabled = vrControls.mode() === 'deviceorientation';\n\t\t\t}\n\n\t\t\tvrControls.freeze = !orientationEnabled && !vrMode;\n\n\t\t\tVR.emit('devicechange', vrControls.mode(), vrEffect.hmd());\n\t\t});\n\n\t\t//mouse control in case got no orientation device\n\t\tmouseControls = new THREE.OrbitControls(camera);\n\t\tmouseControls.target0.set(0, 0.0001, 0.000);\n\t\tmouseControls.target.copy(mouseControls.target0);\n\t\tmouseControls.update();\n\n\t\t//todo: remove any default lights once other lights are added\n\t\tvar dLight = new THREE.DirectionalLight(0xffffff, 0.8);\n\t\tdLight.name = 'directional-light';\n\t\tdLight.position.set(20, 100, 100);\n\n\t\tdLight.castShadow = true;\n\t\tdLight.shadowCameraVisible = true;\n\n\t\tdLight.shadowMapWidth = 2048;\n\t\tdLight.shadowMapHeight = 2048;\n\n\t\tdLight.shadowCameraLeft = -10;\n\t\tdLight.shadowCameraRight = 10;\n\t\tdLight.shadowCameraTop = 10;\n\t\tdLight.shadowCameraBottom = -10;\n\n\t\tdLight.shadowCameraFar = 150;\n\t\tdLight.shadowCameraNear = 100;\n\t\tdLight.shadowDarkness = 1;\n\n\t\tscene.add(dLight);\n\n\t\tscene.add(new THREE.AmbientLight(0x444444));\n\n\t\tif (VR) {\n\t\t\tVR.camera = cameraWrapper;\n\t\t\tVR.body = bodyWrapper;\n\t\t\tVR.scene = scene;\n\t\t\tVR.canvas = renderer.domElement;\n\t\t\tVR.zeroSensor = vrControls.zeroSensor;\n\t\t}\n\n\t\traycaster = new THREE.Raycaster();\n\n\t\tif (document.body) {\n\t\t\tattachCanvas();\n\t\t} else {\n\t\t\twindow.addEventListener('load', attachCanvas, false);\n\t\t}\n\n\t\tVR.canvas.addEventListener('mozfullscreenerror', fullScreenError, false);\n\t\tVR.canvas.addEventListener('webkitfullscreenerror', fullScreenError, false);\n\t\tVR.canvas.addEventListener('fullscreenerror', fullScreenError, false);\n\t}\n\n\tfunction initRequirements() {\n\t\t//load external requirements\n\t\tTHREE = __webpack_require__(32);\n\t\t__webpack_require__(15);\n\t\t__webpack_require__(16);\n\n\t\t//if (typeof __DEV__ !== 'undefined' && __DEV__) {\n\t\t\t__webpack_require__(17);\n\t\t//}\n\n\t\tTHREE.ImageUtils.crossOrigin = '';\n\n\t\teventEmitter = __webpack_require__(20);\n\n\t\t//my VR stuff. todo: move these to a separate repo or two for easy packaging\n\t\t__webpack_require__(18);\n\t\t__webpack_require__(19);\n\t}\n\n\tfunction initialize() {\n\t\t//todo: set up button/info elements\n\n\t\tinitScene();\n\n\t\tinitShake();\n\n\t\tresize();\n\n\t\tdocument.addEventListener('visibilitychange', visibilityChange);\n\t\tdocument.addEventListener('mozvisibilitychange', visibilityChange);\n\t\tdocument.addEventListener('msvisibilitychange', visibilityChange);\n\t\tdocument.addEventListener('webkitvisibilitychange', visibilityChange);\n\t}\n\n\tinitRequirements();\n\n\tmodule.exports = VR = {\n\t\tinit: initialize,\n\t\trender: render,\n\t\tstart: start,\n\t\tstop: stop,\n\t\tresize: resize,\n\n\t\tTHREE: THREE,\n\n\t\tmaterials: materials,\n\n\t\tanimate: function (callback) {\n\t\t\tvar i;\n\t\t\tif (typeof callback === 'function') {\n\t\t\t\ti = animationCallbacks.indexOf(callback);\n\t\t\t\tif (i < 0) {\n\t\t\t\t\tanimationCallbacks.push(callback);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tend: function (callback) {\n\t\t\tvar i;\n\n\t\t\tif (!callback) {\n\t\t\t\tanimationCallbacks.length = 0;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof callback === 'function') {\n\t\t\t\ti = animationCallbacks.indexOf(callback);\n\t\t\t\tif (i >= 0) {\n\t\t\t\t\tanimationCallbacks.splice(i, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\trequestVR: function () {\n\t\t\t//todo: check if it's possible\n\t\t\tif (vrMode || !vrEffect) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvrMode = true;\n\n\t\t\t//full screen and render two eyes\n\t\t\t//always full screen\n\t\t\tvrEffect.requestFullScreen();\n\t\t},\n\n\t\texitVR: function () {\n\t\t\tvrMode = false;\n\t\t\tif (isFullscreen()) {\n\t\t\t\texitFullscreen();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tmouseControls.enabled = true;\n\t\t\tvrControls.freeze = !orientationEnabled;\n\t\t\tcamera.rotation.set(0, 0, 0);\n\t\t},\n\n\t\tvrMode: function () {\n\t\t\treturn vrMode && isFullscreen();\n\t\t},\n\n\t\torientationEnabled: function () {\n\t\t\treturn !!orientationEnabled;\n\t\t},\n\t\tenableOrientation: function () {\n\t\t\torientationEnabled = true;\n\t\t\tif (!vrMode) {\n\t\t\t\tvrControls.freeze = false;\n\t\t\t}\n\t\t},\n\t\tdisableOrientation: function () {\n\t\t\torientationEnabled = false;\n\t\t\tcamera.rotation.set(0, 0, 0);\n\t\t\tvrControls.freeze = !vrMode;\n\t\t},\n\n\t\tisFullscreen: isFullscreen,\n\t\trequestFullscreen: requestFullscreen,\n\t\texitFullscreen: function () {\n\t\t\tif (isFullscreen()) {\n\t\t\t\texitFullscreen();\n\t\t\t}\n\t\t},\n\n\t\tcontrolMode: function () {\n\t\t\treturn vrControls && vrControls.mode();\n\t\t},\n\n\t\tzeroSensor: nop,\n\n\t\tvibrate: navigator.vibrate ? navigator.vibrate.bind(navigator) : nop,\n\n\t\t// Utility\n\t\ttimes: function (n, callback) {\n\t\t\tvar i;\n\n\t\t\tfor (i = 0; i < n; i++) {\n\t\t\t\tcallback(i);\n\t\t\t}\n\t\t},\n\n\t\tcamera: cameraWrapper,\n\t\tbody: bodyWrapper,\n\t\tscene: scene,\n\t\tcanvas: renderer && renderer.domElement || null\n\t};\n\n\tobjectMethods.forEach(function (method) {\n\t\tvar creator = __webpack_require__(12)(\"./\" + method),\n\t\t\tkey;\n\n\t\tVR[method] = function (options) {\n\t\t\tvar obj = new VRObject(scene, creator, body, options);\n\t\t\tvrObjects.push(obj);\n\t\t\treturn obj;\n\t\t};\n\n\t\tVRObject.prototype[method] = function (options) {\n\t\t\tvar obj = new VRObject(this.object, creator, body, options);\n\t\t\tvrObjects.push(obj);\n\t\t\treturn obj;\n\t\t};\n\n\t\tfor (key in creator) {\n\t\t\tif (creator.hasOwnProperty(key) && typeof creator[key] === 'function') {\n\t\t\t\tVR[method][key] = creator[key];\n\t\t\t\tVRObject.prototype[method][key] = creator[key];\n\t\t\t}\n\t\t}\n\t});\n\n\teventEmitter(VR);\n\n\tObject.defineProperty(VR, 'target', {\n\t\tget: function () {\n\t\t\treturn target;\n\t\t}\n\t});\n}());\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/vr.js\n ** module id = 1\n ** module chunks = 0\n **/\n//# sourceURL=webpack:///./src/vr.js?"); /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { - eval("// style-loader: Adds some css to the DOM by adding a