ThreeJS-Webpack-ES6-Boilerp.../build/js/0.app.js.map

1 line
109 KiB
Plaintext

{"version":3,"sources":["webpack:///./src/js/utils/orbitControls.js","webpack:///./src/js/data/config.js","webpack:///./src/js/utils/detector.js","webpack:///./src/js/app/components/renderer.js","webpack:///./src/js/app/components/camera.js","webpack:///./src/js/app/components/light.js","webpack:///./src/js/app/components/controls.js","webpack:///./src/js/app/helpers/material.js","webpack:///./src/js/app/helpers/stats.js","webpack:///./src/js/app/helpers/geometry.js","webpack:///./src/js/utils/helpers.js","webpack:///./src/js/app/model/texture.js","webpack:///./src/js/app/helpers/meshHelper.js","webpack:///./src/js/app/model/model.js","webpack:///./src/js/utils/keyboard.js","webpack:///./src/js/app/managers/interaction.js","webpack:///./src/js/app/managers/datGUI.js","webpack:///./src/js/app/main.js","webpack:///./src/js/app.js"],"names":["module","exports","THREE","MOUSE","OrbitConstraint","object","this","target","Vector3","minDistance","maxDistance","Infinity","minZoom","maxZoom","minPolarAngle","maxPolarAngle","Math","PI","minAzimuthAngle","maxAzimuthAngle","enableDamping","dampingFactor","theta","phi","v","offset","quat","quatInverse","lastPosition","lastQuaternion","scope","EPS","phiDelta","thetaDelta","scale","panOffset","zoomChanged","getPolarAngle","getAzimuthalAngle","rotateLeft","angle","rotateUp","panLeft","distance","te","matrix","elements","set","multiplyScalar","add","panUp","pan","deltaX","deltaY","screenWidth","screenHeight","PerspectiveCamera","targetDistance","position","clone","sub","length","tan","fov","OrthographicCamera","right","left","top","bottom","console","warn","dollyIn","dollyScale","zoom","max","min","updateProjectionMatrix","dollyOut","update","Quaternion","setFromUnitVectors","up","inverse","copy","applyQuaternion","atan2","x","z","sqrt","y","radius","sin","cos","lookAt","distanceToSquared","dot","quaternion","OrbitControls","domElement","constraint","undefined","document","Object","defineProperty","get","enabled","center","enableZoom","zoomSpeed","enableRotate","rotateSpeed","enablePan","keyPanSpeed","autoRotate","autoRotateSpeed","enableKeys","keys","LEFT","UP","RIGHT","BOTTOM","mouseButtons","ORBIT","ZOOM","MIDDLE","PAN","rotateStart","Vector2","rotateEnd","rotateDelta","panStart","panEnd","panDelta","dollyStart","dollyEnd","dollyDelta","STATE","NONE","ROTATE","DOLLY","TOUCH_ROTATE","TOUCH_DOLLY","TOUCH_PAN","state","target0","position0","zoom0","changeEvent","type","startEvent","endEvent","element","body","clientWidth","clientHeight","getZoomScale","pow","onMouseDown","event","preventDefault","button","clientX","clientY","addEventListener","onMouseMove","onMouseUp","dispatchEvent","subVectors","removeEventListener","onMouseWheel","stopPropagation","delta","wheelDelta","detail","onKeyDown","keyCode","touchstart","touches","pageX","pageY","dx","dy","touchmove","touchend","contextmenu","reset","dispose","window","prototype","create","EventDispatcher","constructor","defineProperties","value","noZoom","noRotate","noPan","noKeys","staticMoving","dynamicDampingFactor","config","isDev","isShowingStats","isLoaded","isTweening","isRotating","isMouseMoving","isMouseOver","maxAnisotropy","dpr","easing","TWEEN","Easing","Quadratic","InOut","duration","model","path","texture","imageFiles","name","image","mesh","enableHelper","wireframe","translucent","material","color","emissive","fog","near","camera","far","aspect","posX","posY","posZ","controls","ambientLight","directionalLight","intensity","shadow","helperEnabled","bias","mapWidth","mapHeight","pointLight","hemiLight","groundColor","detector","canvas","CanvasRenderingContext2D","webgl","createElement","WebGLRenderingContext","getContext","e","workers","Worker","fileapi","File","FileReader","FileList","Blob","getWebGLErrorMessage","id","style","fontFamily","fontSize","fontWeight","textAlign","background","padding","width","margin","innerHTML","join","addGetWebGLMessage","parameters","parent","appendChild","Renderer","scene","container","_this","_classCallCheck","threeRenderer","antialias","setClearColor","setPixelRatio","devicePixelRatio","shadowMap","Config","getMaxAnisotropy","updateSize","setSize","offsetWidth","offsetHeight","render","Camera","renderer","camera_classCallCheck","height","threeCamera","Light","light_classCallCheck","init","visible","castShadow","mapSize","directionalLightHelper","lightName","Controls","controls_classCallCheck","orbitControls","threeControls","Material","material_classCallCheck","basic","side","standard","shading","roughness","metalness","wire","rS","bS","glS","tS","Geometry","geometry_classCallCheck","geo","widthSegments","arguments","heightSegments","rotation","_mesh$position","_mesh$rotation","apply","_toConsumableArray","receiveShadow","Stats","stats_classCallCheck","start","tick","frame","end","BrowserStats","glStats","threeStats","rStats","CSSPath","userTimingAPI","values","caption","over","average","avgMs","fps","below","calls","raf","rstats","groups","fractions","base","steps","plugins","Helpers","fn","threshhold","last","deferTimer","context","now","Date","args","clearTimeout","setTimeout","xhr","lengthComputable","percentComplete","loaded","total","log","round","error","replace","setHex","needsUpdate","geometry","vertexColors","verticesNeedUpdate","normalsNeedUpdate","colorsNeedUpdate","materialKey","textures","key","Texture","texture_classCallCheck","loader","promiseArray","setPath","forEach","imageFile","push","Promise","resolve","reject","load","anisotropy","modelOBJ","logProgress","Error","all","then","i","reason","MeshHelper","meshHelper_classCallCheck","wireLine","depthTest","opacity","transparent","edges","edgesLine","Model","manager","model_classCallCheck","obj","traverse","child","map","UV","logError","ALIAS","down","space","tab","escape","Keyboard","keyboard_classCallCheck","keyCodes","onKeyChange","onBlur","_this2","prop","keyDesc","split","pressed","indexOf","toUpperCase","charCodeAt","aliases","aliasKeys","shiftKey","ctrlKey","altKey","metaKey","Interaction","interaction_classCallCheck","timeout","keyboard","throttle","onMouseLeave","onMouseOver","repeat","eventMatches","DatGUI","main","datGUI_classCallCheck","gui","dat","GUI","light","cameraFolder","addFolder","cameraFOVGui","onChange","onFinishChange","cameraAspectGui","addColor","cameraFogNearGui","density","controlsFolder","controlsAutoRotateSpeedGui","meshFolder","ambientLightFolder","directionalLightFolder","directionalLightIntensityGui","directionalLightPositionXGui","directionalLightPositionYGui","directionalLightPositionZGui","shadowFolder","shadowNearGui","shadowFarGui","shadowTopGui","shadowRightGui","shadowBottomGui","shadowLeftGui","shadowBiasGui","pointLightFolder","pointLightIntensityGui","pointLightDistanceGui","pointLightPositionXGui","pointLightPositionYGui","pointLightPositionZGui","hemiLightFolder","hemiLightIntensityGui","hemiLightPositionXGui","hemiLightPositionYGui","hemiLightPositionZGui","Main","main_classCallCheck","clock","place","make","stats","setUp","onProgress","item","concat","onLoad","querySelector","display","requestAnimationFrame","bind","Detector","getElementById"],"mappings":"2EAAAA,EAAOC,QAAU,SAASC,GACxB,IAAIC,EAAQD,EAAMC,MAalB,SAASC,EAAkBC,GAEzBC,KAAKD,OAASA,EAIdC,KAAKC,OAAS,IAAIL,EAAMM,QAGxBF,KAAKG,YAAc,EACnBH,KAAKI,YAAcC,IAGnBL,KAAKM,QAAU,EACfN,KAAKO,QAAUF,IAIfL,KAAKQ,cAAgB,EACrBR,KAAKS,cAAgBC,KAAKC,GAI1BX,KAAKY,iBAAoBP,IACzBL,KAAKa,gBAAkBR,IAIvBL,KAAKc,eAAgB,EACrBd,KAAKe,cAAgB,IAKrB,IAKIC,EACAC,EAsCEC,EAmBAA,EA2FAC,EAGAC,EACAC,EAEAC,EACAC,EAjKFC,EAAQxB,KAERyB,EAAM,KAONC,EAAW,EACXC,EAAa,EACbC,EAAQ,EACRC,EAAY,IAAIjC,EAAMM,QACtB4B,GAAc,EAIlB9B,KAAK+B,cAAgB,WAEnB,OAAOd,GAITjB,KAAKgC,kBAAoB,WAEvB,OAAOhB,GAIThB,KAAKiC,WAAa,SAAWC,GAE3BP,GAAcO,GAIhBlC,KAAKmC,SAAW,SAAWD,GAEzBR,GAAYQ,GAKdlC,KAAKoC,SAEClB,EAAI,IAAItB,EAAMM,QAEX,SAAmBmC,GAExB,IAAIC,EAAKtC,KAAKD,OAAOwC,OAAOC,SAG5BtB,EAAEuB,IAAKH,EAAI,GAAKA,EAAI,GAAKA,EAAI,IAC7BpB,EAAEwB,gBAAkBL,GAEpBR,EAAUc,IAAKzB,KAOnBlB,KAAK4C,OAEC1B,EAAI,IAAItB,EAAMM,QAEX,SAAiBmC,GAEtB,IAAIC,EAAKtC,KAAKD,OAAOwC,OAAOC,SAG5BtB,EAAEuB,IAAKH,EAAI,GAAKA,EAAI,GAAKA,EAAI,IAC7BpB,EAAEwB,eAAgBL,GAElBR,EAAUc,IAAKzB,KAQnBlB,KAAK6C,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LEFT: 0, MIDDLE: 1, RIGHT: 2 };\n\n /**\n * @author qiao / https://github.com/qiao\n * @author mrdoob / http://mrdoob.com\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n * @author erich666 / http://erichaines.com\n */\n /*global THREE, console */\n\n function OrbitConstraint ( object ) {\n\n this.object = object;\n\n // \"target\" sets the location of focus, where the object orbits around\n // and where it pans with respect to.\n this.target = new THREE.Vector3();\n\n // Limits to how far you can dolly in and out ( PerspectiveCamera only )\n this.minDistance = 0;\n this.maxDistance = Infinity;\n\n // Limits to how far you can zoom in and out ( OrthographicCamera only )\n this.minZoom = 0;\n this.maxZoom = Infinity;\n\n // How far you can orbit vertically, upper and lower limits.\n // Range is 0 to Math.PI radians.\n this.minPolarAngle = 0; // radians\n this.maxPolarAngle = Math.PI; // radians\n\n // How far you can orbit horizontally, upper and lower limits.\n // If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].\n this.minAzimuthAngle = - Infinity; // radians\n this.maxAzimuthAngle = Infinity; // radians\n\n // Set to true to enable damping (inertia)\n // If damping is enabled, you must call controls.update() in your animation loop\n this.enableDamping = false;\n this.dampingFactor = 0.25;\n\n ////////////\n // internals\n\n var scope = this;\n\n var EPS = 0.000001;\n\n // Current position in spherical coordinate system.\n var theta;\n var phi;\n\n // Pending changes\n var phiDelta = 0;\n var thetaDelta = 0;\n var scale = 1;\n var panOffset = new THREE.Vector3();\n var zoomChanged = false;\n\n // API\n\n this.getPolarAngle = function () {\n\n return phi;\n\n };\n\n this.getAzimuthalAngle = function () {\n\n return theta;\n\n };\n\n this.rotateLeft = function ( angle ) {\n\n thetaDelta -= angle;\n\n };\n\n this.rotateUp = function ( angle ) {\n\n phiDelta -= angle;\n\n };\n\n // pass in distance in world space to move left\n this.panLeft = function() {\n\n var v = new THREE.Vector3();\n\n return function panLeft ( distance ) {\n\n var te = this.object.matrix.elements;\n\n // get X column of matrix\n v.set( te[ 0 ], te[ 1 ], te[ 2 ] );\n v.multiplyScalar( - distance );\n\n panOffset.add( v );\n\n };\n\n }();\n\n // pass in distance in world space to move up\n this.panUp = function() {\n\n var v = new THREE.Vector3();\n\n return function panUp ( distance ) {\n\n var te = this.object.matrix.elements;\n\n // get Y column of matrix\n v.set( te[ 4 ], te[ 5 ], te[ 6 ] );\n v.multiplyScalar( distance );\n\n panOffset.add( v );\n\n };\n\n }();\n\n // pass in x,y of change desired in pixel space,\n // right and down are positive\n this.pan = function ( deltaX, deltaY, screenWidth, screenHeight ) {\n\n if ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n // perspective\n var position = scope.object.position;\n var offset = position.clone().sub( scope.target );\n var targetDistance = offset.length();\n\n // half of the fov is center to top of screen\n targetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 );\n\n // we actually don't use screenWidth, since perspective camera is fixed to screen height\n scope.panLeft( 2 * deltaX * targetDistance / screenHeight );\n scope.panUp( 2 * deltaY * targetDistance / screenHeight );\n\n } else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n // orthographic\n scope.panLeft( deltaX * ( scope.object.right - scope.object.left ) / screenWidth );\n scope.panUp( deltaY * ( scope.object.top - scope.object.bottom ) / screenHeight );\n\n } else {\n\n // camera neither orthographic or perspective\n console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n\n }\n\n };\n\n this.dollyIn = function ( dollyScale ) {\n\n if ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n scale /= dollyScale;\n\n } else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n scope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom * dollyScale ) );\n scope.object.updateProjectionMatrix();\n zoomChanged = true;\n\n } else {\n\n console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\n }\n\n };\n\n this.dollyOut = function ( dollyScale ) {\n\n if ( scope.object instanceof THREE.PerspectiveCamera ) {\n\n scale *= dollyScale;\n\n } else if ( scope.object instanceof THREE.OrthographicCamera ) {\n\n scope.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / dollyScale ) );\n scope.object.updateProjectionMatrix();\n zoomChanged = true;\n\n } else {\n\n console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\n }\n\n };\n\n this.update = function() {\n\n var offset = new THREE.Vector3();\n\n // so camera.up is the orbit axis\n var quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) );\n var quatInverse = quat.clone().inverse();\n\n var lastPosition = new THREE.Vector3();\n var lastQuaternion = new THREE.Quaternion();\n\n return function () {\n\n var position = this.object.position;\n\n offset.copy( position ).sub( this.target );\n\n // rotate offset to \"y-axis-is-up\" space\n offset.applyQuaternion( quat );\n\n // angle from z-axis around y-axis\n\n theta = Math.atan2( offset.x, offset.z );\n\n // angle from y-axis\n\n phi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y );\n\n theta += thetaDelta;\n phi += phiDelta;\n\n // restrict theta to be between desired limits\n theta = Math.max( this.minAzimuthAngle, Math.min( this.maxAzimuthAngle, theta ) );\n\n // restrict phi to be between desired limits\n phi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );\n\n // restrict phi to be betwee EPS and PI-EPS\n phi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) );\n\n var radius = offset.length() * scale;\n\n // restrict radius to be between desired limits\n radius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) );\n\n // move target to panned location\n this.target.add( panOffset );\n\n offset.x = radius * Math.sin( phi ) * Math.sin( theta );\n offset.y = radius * Math.cos( phi );\n offset.z = radius * Math.sin( phi ) * Math.cos( theta );\n\n // rotate offset back to \"camera-up-vector-is-up\" space\n offset.applyQuaternion( quatInverse );\n\n position.copy( this.target ).add( offset );\n\n this.object.lookAt( this.target );\n\n if ( this.enableDamping === true ) {\n\n thetaDelta *= ( 1 - this.dampingFactor );\n phiDelta *= ( 1 - this.dampingFactor );\n\n } else {\n\n thetaDelta = 0;\n phiDelta = 0;\n\n }\n\n scale = 1;\n panOffset.set( 0, 0, 0 );\n\n // update condition is:\n // min(camera displacement, camera rotation in radians)^2 > EPS\n // using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n if ( zoomChanged ||\n lastPosition.distanceToSquared( this.object.position ) > EPS ||\n 8 * ( 1 - lastQuaternion.dot( this.object.quaternion ) ) > EPS ) {\n\n lastPosition.copy( this.object.position );\n lastQuaternion.copy( this.object.quaternion );\n zoomChanged = false;\n\n return true;\n\n }\n\n return false;\n\n };\n\n }();\n\n };\n\n\n // This set of controls performs orbiting, dollying (zooming), and panning. It maintains\n // the \"up\" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is\n // supported.\n //\n // Orbit - left mouse / touch: one finger move\n // Zoom - middle mouse, or mousewheel / touch: two finger spread or squish\n // Pan - right mouse, or arrow keys / touch: three finter swipe\n\n function OrbitControls ( object, domElement ) {\n\n var constraint = new OrbitConstraint( object );\n\n this.domElement = ( domElement !== undefined ) ? domElement : document;\n\n // API\n\n Object.defineProperty( this, 'constraint', {\n\n get: function() {\n\n return constraint;\n\n }\n\n } );\n\n this.getPolarAngle = function () {\n\n return constraint.getPolarAngle();\n\n };\n\n this.getAzimuthalAngle = function () {\n\n return constraint.getAzimuthalAngle();\n\n };\n\n // Set to false to disable this control\n this.enabled = true;\n\n // center is old, deprecated; use \"target\" instead\n this.center = this.target;\n\n // This option actually enables dollying in and out; left as \"zoom\" for\n // backwards compatibility.\n // Set to false to disable zooming\n this.enableZoom = true;\n this.zoomSpeed = 1.0;\n\n // Set to false to disable rotating\n this.enableRotate = true;\n this.rotateSpeed = 1.0;\n\n // Set to false to disable panning\n this.enablePan = true;\n this.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\n // Set to true to automatically rotate around the target\n // If auto-rotate is enabled, you must call controls.update() in your animation loop\n this.autoRotate = false;\n this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60\n\n // Set to false to disable use of the keys\n this.enableKeys = true;\n\n // The four arrow keys\n this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 };\n\n // Mouse buttons\n this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT };\n\n ////////////\n // internals\n\n var scope = this;\n\n var rotateStart = new THREE.Vector2();\n var rotateEnd = new THREE.Vector2();\n var rotateDelta = new THREE.Vector2();\n\n var panStart = new THREE.Vector2();\n var panEnd = new THREE.Vector2();\n var panDelta = new THREE.Vector2();\n\n var dollyStart = new THREE.Vector2();\n var dollyEnd = new THREE.Vector2();\n var dollyDelta = new THREE.Vector2();\n\n var STATE = { NONE : - 1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 };\n\n var state = STATE.NONE;\n\n // for reset\n\n this.target0 = this.target.clone();\n this.position0 = this.object.position.clone();\n this.zoom0 = this.object.zoom;\n\n // events\n\n var changeEvent = { type: 'change' };\n var startEvent = { type: 'start' };\n var endEvent = { type: 'end' };\n\n // pass in x,y of change desired in pixel space,\n // right and down are positive\n function pan( deltaX, deltaY ) {\n\n var element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n constraint.pan( deltaX, deltaY, element.clientWidth, element.clientHeight );\n\n }\n\n this.update = function () {\n\n if ( this.autoRotate && state === STATE.NONE ) {\n\n constraint.rotateLeft( getAutoRotationAngle() );\n\n }\n\n if ( constraint.update() === true ) {\n\n this.dispatchEvent( changeEvent );\n\n }\n\n };\n\n this.reset = function () {\n\n state = STATE.NONE;\n\n this.target.copy( this.target0 );\n this.object.position.copy( this.position0 );\n this.object.zoom = this.zoom0;\n\n this.object.updateProjectionMatrix();\n this.dispatchEvent( changeEvent );\n\n this.update();\n\n };\n\n function getAutoRotationAngle() {\n\n return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed;\n\n }\n\n function getZoomScale() {\n\n return Math.pow( 0.95, scope.zoomSpeed );\n\n }\n\n function onMouseDown( event ) {\n\n if ( scope.enabled === false ) return;\n\n event.preventDefault();\n\n if ( event.button === scope.mouseButtons.ORBIT ) {\n\n if ( scope.enableRotate === false ) return;\n\n state = STATE.ROTATE;\n\n rotateStart.set( event.clientX, event.clientY );\n\n } else if ( event.button === scope.mouseButtons.ZOOM ) {\n\n if ( scope.enableZoom === false ) return;\n\n state = STATE.DOLLY;\n\n dollyStart.set( event.clientX, event.clientY );\n\n } else if ( event.button === scope.mouseButtons.PAN ) {\n\n if ( scope.enablePan === false ) return;\n\n state = STATE.PAN;\n\n panStart.set( event.clientX, event.clientY );\n\n }\n\n if ( state !== STATE.NONE ) {\n\n document.addEventListener( 'mousemove', onMouseMove, false );\n document.addEventListener( 'mouseup', onMouseUp, false );\n scope.dispatchEvent( startEvent );\n\n }\n\n }\n\n function onMouseMove( event ) {\n\n if ( scope.enabled === false ) return;\n\n event.preventDefault();\n\n var element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n if ( state === STATE.ROTATE ) {\n\n if ( scope.enableRotate === false ) return;\n\n rotateEnd.set( event.clientX, event.clientY );\n rotateDelta.subVectors( rotateEnd, rotateStart );\n\n // rotating across whole screen goes 360 degrees around\n constraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n\n // rotating up and down along whole screen attempts to go 360, but limited to 180\n constraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n rotateStart.copy( rotateEnd );\n\n } else if ( state === STATE.DOLLY ) {\n\n if ( scope.enableZoom === false ) return;\n\n dollyEnd.set( event.clientX, event.clientY );\n dollyDelta.subVectors( dollyEnd, dollyStart );\n\n if ( dollyDelta.y > 0 ) {\n\n constraint.dollyIn( getZoomScale() );\n\n } else if ( dollyDelta.y < 0 ) {\n\n constraint.dollyOut( getZoomScale() );\n\n }\n\n dollyStart.copy( dollyEnd );\n\n } else if ( state === STATE.PAN ) {\n\n if ( scope.enablePan === false ) return;\n\n panEnd.set( event.clientX, event.clientY );\n panDelta.subVectors( panEnd, panStart );\n\n pan( panDelta.x, panDelta.y );\n\n panStart.copy( panEnd );\n\n }\n\n if ( state !== STATE.NONE ) scope.update();\n\n }\n\n function onMouseUp( /* event */ ) {\n\n if ( scope.enabled === false ) return;\n\n document.removeEventListener( 'mousemove', onMouseMove, false );\n document.removeEventListener( 'mouseup', onMouseUp, false );\n scope.dispatchEvent( endEvent );\n state = STATE.NONE;\n\n }\n\n function onMouseWheel( event ) {\n\n if ( scope.enabled === false || scope.enableZoom === false || state !== STATE.NONE ) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n var delta = 0;\n\n if ( event.wheelDelta !== undefined ) {\n\n // WebKit / Opera / Explorer 9\n\n delta = event.wheelDelta;\n\n } else if ( event.detail !== undefined ) {\n\n // Firefox\n\n delta = - event.detail;\n\n }\n\n if ( delta > 0 ) {\n\n constraint.dollyOut( getZoomScale() );\n\n } else if ( delta < 0 ) {\n\n constraint.dollyIn( getZoomScale() );\n\n }\n\n scope.update();\n scope.dispatchEvent( startEvent );\n scope.dispatchEvent( endEvent );\n\n }\n\n function onKeyDown( event ) {\n\n if ( scope.enabled === false || scope.enableKeys === false || scope.enablePan === false ) return;\n\n switch ( event.keyCode ) {\n\n case scope.keys.UP:\n pan( 0, scope.keyPanSpeed );\n scope.update();\n break;\n\n case scope.keys.BOTTOM:\n pan( 0, - scope.keyPanSpeed );\n scope.update();\n break;\n\n case scope.keys.LEFT:\n pan( scope.keyPanSpeed, 0 );\n scope.update();\n break;\n\n case scope.keys.RIGHT:\n pan( - scope.keyPanSpeed, 0 );\n scope.update();\n break;\n\n }\n\n }\n\n function touchstart( event ) {\n\n if ( scope.enabled === false ) return;\n\n switch ( event.touches.length ) {\n\n case 1:\t// one-fingered touch: rotate\n\n if ( scope.enableRotate === false ) return;\n\n state = STATE.TOUCH_ROTATE;\n\n rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n break;\n\n case 2:\t// two-fingered touch: dolly\n\n if ( scope.enableZoom === false ) return;\n\n state = STATE.TOUCH_DOLLY;\n\n var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n var distance = Math.sqrt( dx * dx + dy * dy );\n dollyStart.set( 0, distance );\n break;\n\n case 3: // three-fingered touch: pan\n\n if ( scope.enablePan === false ) return;\n\n state = STATE.TOUCH_PAN;\n\n panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n break;\n\n default:\n\n state = STATE.NONE;\n\n }\n\n if ( state !== STATE.NONE ) scope.dispatchEvent( startEvent );\n\n }\n\n function touchmove( event ) {\n\n if ( scope.enabled === false ) return;\n\n event.preventDefault();\n event.stopPropagation();\n\n var element = scope.domElement === document ? scope.domElement.body : scope.domElement;\n\n switch ( event.touches.length ) {\n\n case 1: // one-fingered touch: rotate\n\n if ( scope.enableRotate === false ) return;\n if ( state !== STATE.TOUCH_ROTATE ) return;\n\n rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n rotateDelta.subVectors( rotateEnd, rotateStart );\n\n // rotating across whole screen goes 360 degrees around\n constraint.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );\n // rotating up and down along whole screen attempts to go 360, but limited to 180\n constraint.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );\n\n rotateStart.copy( rotateEnd );\n\n scope.update();\n break;\n\n case 2: // two-fingered touch: dolly\n\n if ( scope.enableZoom === false ) return;\n if ( state !== STATE.TOUCH_DOLLY ) return;\n\n var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;\n var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;\n var distance = Math.sqrt( dx * dx + dy * dy );\n\n dollyEnd.set( 0, distance );\n dollyDelta.subVectors( dollyEnd, dollyStart );\n\n if ( dollyDelta.y > 0 ) {\n\n constraint.dollyOut( getZoomScale() );\n\n } else if ( dollyDelta.y < 0 ) {\n\n constraint.dollyIn( getZoomScale() );\n\n }\n\n dollyStart.copy( dollyEnd );\n\n scope.update();\n break;\n\n case 3: // three-fingered touch: pan\n\n if ( scope.enablePan === false ) return;\n if ( state !== STATE.TOUCH_PAN ) return;\n\n panEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );\n panDelta.subVectors( panEnd, panStart );\n\n pan( panDelta.x, panDelta.y );\n\n panStart.copy( panEnd );\n\n scope.update();\n break;\n\n default:\n\n state = STATE.NONE;\n\n }\n\n }\n\n function touchend( /* event */ ) {\n\n if ( scope.enabled === false ) return;\n\n scope.dispatchEvent( endEvent );\n state = STATE.NONE;\n\n }\n\n function contextmenu( event ) {\n\n event.preventDefault();\n\n }\n\n this.dispose = function() {\n\n this.domElement.removeEventListener( 'contextmenu', contextmenu, false );\n this.domElement.removeEventListener( 'mousedown', onMouseDown, false );\n this.domElement.removeEventListener( 'mousewheel', onMouseWheel, false );\n this.domElement.removeEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox\n\n this.domElement.removeEventListener( 'touchstart', touchstart, false );\n this.domElement.removeEventListener( 'touchend', touchend, false );\n this.domElement.removeEventListener( 'touchmove', touchmove, false );\n\n document.removeEventListener( 'mousemove', onMouseMove, false );\n document.removeEventListener( 'mouseup', onMouseUp, false );\n\n window.removeEventListener( 'keydown', onKeyDown, false );\n\n }\n\n this.domElement.addEventListener( 'contextmenu', contextmenu, false );\n\n this.domElement.addEventListener( 'mousedown', onMouseDown, false );\n this.domElement.addEventListener( 'mousewheel', onMouseWheel, false );\n this.domElement.addEventListener( 'MozMousePixelScroll', onMouseWheel, false ); // firefox\n\n this.domElement.addEventListener( 'touchstart', touchstart, false );\n this.domElement.addEventListener( 'touchend', touchend, false );\n this.domElement.addEventListener( 'touchmove', touchmove, false );\n\n window.addEventListener( 'keydown', onKeyDown, false );\n\n // force an update at start\n this.update();\n\n };\n\n OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );\n OrbitControls.prototype.constructor = OrbitControls;\n\n Object.defineProperties( OrbitControls.prototype, {\n\n object: {\n\n get: function () {\n\n return this.constraint.object;\n\n }\n\n },\n\n target: {\n\n get: function () {\n\n return this.constraint.target;\n\n },\n\n set: function ( value ) {\n\n console.warn( 'THREE.OrbitControls: target is now immutable. Use target.set() instead.' );\n this.constraint.target.copy( value );\n\n }\n\n },\n\n minDistance : {\n\n get: function () {\n\n return this.constraint.minDistance;\n\n },\n\n set: function ( value ) {\n\n this.constraint.minDistance = value;\n\n }\n\n },\n\n maxDistance : {\n\n get: function () {\n\n return this.constraint.maxDistance;\n\n },\n\n set: function ( value ) {\n\n this.constraint.maxDistance = value;\n\n }\n\n },\n\n minZoom : {\n\n get: function () {\n\n return this.constraint.minZoom;\n\n },\n\n set: function ( value ) {\n\n this.constraint.minZoom = value;\n\n }\n\n },\n\n maxZoom : {\n\n get: function () {\n\n return this.constraint.maxZoom;\n\n },\n\n set: function ( value ) {\n\n this.constraint.maxZoom = value;\n\n }\n\n },\n\n minPolarAngle : {\n\n get: function () {\n\n return this.constraint.minPolarAngle;\n\n },\n\n set: function ( value ) {\n\n this.constraint.minPolarAngle = value;\n\n }\n\n },\n\n maxPolarAngle : {\n\n get: function () {\n\n return this.constraint.maxPolarAngle;\n\n },\n\n set: function ( value ) {\n\n this.constraint.maxPolarAngle = value;\n\n }\n\n },\n\n minAzimuthAngle : {\n\n get: function () {\n\n return this.constraint.minAzimuthAngle;\n\n },\n\n set: function ( value ) {\n\n this.constraint.minAzimuthAngle = value;\n\n }\n\n },\n\n maxAzimuthAngle : {\n\n get: function () {\n\n return this.constraint.maxAzimuthAngle;\n\n },\n\n set: function ( value ) {\n\n this.constraint.maxAzimuthAngle = value;\n\n }\n\n },\n\n enableDamping : {\n\n get: function () {\n\n return this.constraint.enableDamping;\n\n },\n\n set: function ( value ) {\n\n this.constraint.enableDamping = value;\n\n }\n\n },\n\n dampingFactor : {\n\n get: function () {\n\n return this.constraint.dampingFactor;\n\n },\n\n set: function ( value ) {\n\n this.constraint.dampingFactor = value;\n\n }\n\n },\n\n // backward compatibility\n\n noZoom: {\n\n get: function () {\n\n console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n return ! this.enableZoom;\n\n },\n\n set: function ( value ) {\n\n console.warn( 'THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.' );\n this.enableZoom = ! value;\n\n }\n\n },\n\n noRotate: {\n\n get: function () {\n\n console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n return ! this.enableRotate;\n\n },\n\n set: function ( value ) {\n\n console.warn( 'THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.' );\n this.enableRotate = ! value;\n\n }\n\n },\n\n noPan: {\n\n get: function () {\n\n console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n return ! this.enablePan;\n\n },\n\n set: function ( value ) {\n\n console.warn( 'THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.' );\n this.enablePan = ! value;\n\n }\n\n },\n\n noKeys: {\n\n get: function () {\n\n console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n return ! this.enableKeys;\n\n },\n\n set: function ( value ) {\n\n console.warn( 'THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.' );\n this.enableKeys = ! value;\n\n }\n\n },\n\n staticMoving : {\n\n get: function () {\n\n console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n return ! this.constraint.enableDamping;\n\n },\n\n set: function ( value ) {\n\n console.warn( 'THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.' );\n this.constraint.enableDamping = ! value;\n\n }\n\n },\n\n dynamicDampingFactor : {\n\n get: function () {\n\n console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n return this.constraint.dampingFactor;\n\n },\n\n set: function ( value ) {\n\n console.warn( 'THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.' );\n this.constraint.dampingFactor = value;\n\n }\n\n }\n\n } );\n\n return OrbitControls;\n}\n","import TWEEN from 'tween.js';\n\n// This object contains the state of the app\nexport default {\n isDev: false,\n isShowingStats: true,\n isLoaded: false,\n isTweening: false,\n isRotating: true,\n isMouseMoving: false,\n isMouseOver: false,\n maxAnisotropy: 1,\n dpr: 1,\n easing: TWEEN.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: [\n {name: 'UV', image: 'UV_Grid_Sm.jpg'}\n ]\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: true,\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 * @author alteredq / http://alteredqualia.com/\n * @author mr.doob / http://mrdoob.com/\n */\n\nexport 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() {\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 ? [\n 'Your graphics card does not seem to support <a href=\"http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation\" style=\"color:#000000\">WebGL</a>.<br />',\n 'Find out how to get it <a href=\"http://get.webgl.org/\" style=\"color:#000000\">here</a>.'\n ].join('\\n') : [\n 'Your browser does not seem to support <a href=\"http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation\" style=\"color:#000000\">WebGL</a>.<br/>',\n 'Find out how to get it <a href=\"http://get.webgl.org/\" style=\"color:#000000\">here</a>.'\n ].join('\\n');\n }\n\n return element;\n },\n\n addGetWebGLMessage: function(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","import * as THREE from 'three';\n\nimport Config from '../../data/config';\n\n// Main webGL renderer class\nexport default class Renderer {\n constructor(scene, container) {\n // Properties\n this.scene = scene;\n this.container = container;\n\n // Create WebGL renderer and set its antialias\n this.threeRenderer = new THREE.WebGLRenderer({antialias: true});\n\n // Set clear color to fog to enable fog or to hex color for no fog\n this.threeRenderer.setClearColor(scene.fog.color);\n this.threeRenderer.setPixelRatio(window.devicePixelRatio); // For retina\n\n // Appends canvas\n container.appendChild(this.threeRenderer.domElement);\n\n // Shadow map options\n this.threeRenderer.shadowMap.enabled = true;\n this.threeRenderer.shadowMap.type = THREE.PCFSoftShadowMap;\n\n // Get anisotropy for textures\n Config.maxAnisotropy = this.threeRenderer.getMaxAnisotropy();\n\n // Initial size update set to canvas container\n this.updateSize();\n\n // Listeners\n document.addEventListener('DOMContentLoaded', () => this.updateSize(), false);\n window.addEventListener('resize', () => this.updateSize(), false);\n }\n\n updateSize() {\n this.threeRenderer.setSize(this.container.offsetWidth, this.container.offsetHeight);\n }\n\n render(scene, camera) {\n // Renders scene to canvas target\n this.threeRenderer.render(scene, camera);\n }\n}\n","import * as THREE from 'three';\n\nimport Config from '../../data/config';\n\n// Class that creates and updates the main camera\nexport default class Camera {\n constructor(renderer) {\n const width = renderer.domElement.width;\n const height = renderer.domElement.height;\n\n // Create and position a Perspective Camera\n this.threeCamera = new THREE.PerspectiveCamera(Config.camera.fov, width / height, Config.camera.near, Config.camera.far);\n this.threeCamera.position.set(Config.camera.posX, Config.camera.posY, Config.camera.posZ);\n\n // Initial sizing\n this.updateSize(renderer);\n \n // Listeners\n window.addEventListener('resize', () => this.updateSize(renderer), false);\n }\n\n updateSize(renderer) {\n // Update camera aspect ratio with window aspect ratio\n this.threeCamera.aspect = renderer.domElement.width / renderer.domElement.height;\n\n // Always call updateProjectionMatrix on camera change\n this.threeCamera.updateProjectionMatrix();\n }\n}\n","import * as THREE from 'three';\n\nimport Config from '../../data/config';\n\n// Sets up and places all lights in scene\nexport default class Light {\n constructor(scene) {\n this.scene = scene;\n\n this.init();\n }\n\n init() {\n // Ambient\n this.ambientLight = new THREE.AmbientLight(Config.ambientLight.color);\n this.ambientLight.visible = Config.ambientLight.enabled;\n\n // Point light\n this.pointLight = new THREE.PointLight(Config.pointLight.color, Config.pointLight.intensity, Config.pointLight.distance);\n this.pointLight.position.set(Config.pointLight.x, Config.pointLight.y, Config.pointLight.z);\n this.pointLight.visible = Config.pointLight.enabled;\n\n // Directional light\n this.directionalLight = new THREE.DirectionalLight(Config.directionalLight.color, Config.directionalLight.intensity);\n this.directionalLight.position.set(Config.directionalLight.x, Config.directionalLight.y, Config.directionalLight.z);\n this.directionalLight.visible = Config.directionalLight.enabled;\n\n // Shadow map\n this.directionalLight.castShadow = Config.shadow.enabled;\n this.directionalLight.shadow.bias = Config.shadow.bias;\n this.directionalLight.shadow.camera.near = Config.shadow.near;\n this.directionalLight.shadow.camera.far = Config.shadow.far;\n this.directionalLight.shadow.camera.left = Config.shadow.left;\n this.directionalLight.shadow.camera.right = Config.shadow.right;\n this.directionalLight.shadow.camera.top = Config.shadow.top;\n this.directionalLight.shadow.camera.bottom = Config.shadow.bottom;\n this.directionalLight.shadow.mapSize.width = Config.shadow.mapWidth;\n this.directionalLight.shadow.mapSize.height = Config.shadow.mapHeight;\n\n // Shadow camera helper\n this.directionalLightHelper = new THREE.CameraHelper(this.directionalLight.shadow.camera);\n this.directionalLightHelper.visible = Config.shadow.helperEnabled;\n\n // Hemisphere light\n this.hemiLight = new THREE.HemisphereLight(Config.hemiLight.color, Config.hemiLight.groundColor, Config.hemiLight.intensity);\n this.hemiLight.position.set(Config.hemiLight.x, Config.hemiLight.y, Config.hemiLight.z);\n this.hemiLight.visible = Config.hemiLight.enabled;\n }\n\n place(lightName) {\n switch(lightName) {\n case 'ambient':\n this.scene.add(this.ambientLight);\n break;\n\n case 'directional':\n this.scene.add(this.directionalLight);\n this.scene.add(this.directionalLightHelper);\n break;\n\n case 'point':\n this.scene.add(this.pointLight);\n break;\n\n case 'hemi':\n this.scene.add(this.hemiLight);\n break;\n }\n }\n}\n","import * as THREE from 'three';\n\nimport OrbitControls from '../../utils/orbitControls';\nimport Config from '../../data/config';\n\n// Controls based on orbit controls\nexport default class Controls {\n constructor(camera, container) {\n // Orbit controls first needs to pass in THREE to constructor\n const orbitControls = new OrbitControls(THREE);\n this.threeControls = new orbitControls(camera, container);\n\n this.init();\n }\n\n init() {\n this.threeControls.target.set(Config.controls.target.x, Config.controls.target.y, Config.controls.target.z);\n this.threeControls.autoRotate = Config.controls.autoRotate;\n this.threeControls.autoRotateSpeed = Config.controls.autoRotateSpeed;\n this.threeControls.rotateSpeed = Config.controls.rotateSpeed;\n this.threeControls.zoomSpeed = Config.controls.zoomSpeed;\n this.threeControls.minDistance = Config.controls.minDistance;\n this.threeControls.maxDistance = Config.controls.maxDistance;\n this.threeControls.minPolarAngle = Config.controls.minPolarAngle;\n this.threeControls.maxPolarAngle = Config.controls.maxPolarAngle;\n this.threeControls.enableDamping = Config.controls.enableDamping;\n this.threeControls.enableZoom = Config.controls.enableZoom;\n this.threeControls.dampingFactor = Config.controls.dampingFactor;\n }\n}\n","import * as THREE from 'three';\n\nimport Config from '../../data/config';\n\n// USe this class as a helper to set up some default materials\nexport default class Material {\n constructor(color) {\n this.basic = new THREE.MeshBasicMaterial({\n color,\n side: THREE.DoubleSide\n });\n\n this.standard = new THREE.MeshStandardMaterial({\n color,\n shading: THREE.FlatShading,\n roughness: 1,\n metalness: 0,\n side: THREE.DoubleSide\n });\n\n this.wire = new THREE.MeshBasicMaterial({wireframe: true});\n }\n}\n\n","// Local vars for rStats\nlet rS, bS, glS, tS;\n\nexport default class Stats {\n constructor(renderer) {\n this.renderer = renderer;\n }\n\n setUp() {\n bS = new BrowserStats();\n glS = new glStats();\n tS = new threeStats(this.renderer.threeRenderer);\n\n rS = new rStats({\n CSSPath: './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: [\n { caption: 'Framerate', values: ['fps', 'raf'] },\n { caption: 'Frame Budget', values: ['frame', 'texture', 'setup', 'render'] }\n ],\n fractions: [\n { base: 'frame', steps: ['texture', 'setup', 'render'] }\n ],\n plugins: [bS, tS, glS]\n });\n };\n\n static start() {\n rS('frame').start();\n glS.start();\n\n rS('rAF').tick();\n rS('FPS').frame();\n\n rS('render').start();\n };\n\n static end() {\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","import * as THREE from 'three';\n\nimport Material from './material';\n\nimport Config from '../../data/config';\n\n// This helper class can be used to create and then place geometry in the scene\nexport default class Geometry {\n constructor(scene) {\n this.scene = scene;\n this.geo = null;\n }\n\n make(type) {\n if(type === 'plane') {\n return (width, height, widthSegments = 1, heightSegments = 1) => {\n this.geo = new THREE.PlaneGeometry(width, height, widthSegments, heightSegments);\n };\n }\n\n if(type === 'sphere') {\n return (radius, widthSegments = 32, heightSegments = 32) => {\n this.geo = new THREE.SphereGeometry(radius, widthSegments, heightSegments);\n };\n }\n }\n\n place(position, rotation) {\n const material = new Material(0xeeeeee).standard;\n const mesh = new THREE.Mesh(this.geo, material);\n\n // Use ES6 spread to set position and rotation from passed in array\n mesh.position.set(...position);\n mesh.rotation.set(...rotation);\n\n if(Config.shadow.enabled) {\n mesh.receiveShadow = true;\n }\n\n this.scene.add(mesh);\n }\n}\n","// Provides simple static functions that are used multiple times in the app\nexport default class Helpers {\n static throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n let last, deferTimer;\n\n return function() {\n const context = scope || this;\n\n const now = +new Date,\n args = arguments;\n\n if(last && now < last + threshhold) {\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function() {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n }\n else {\n last = now;\n fn.apply(context, args);\n }\n };\n }\n\n static logProgress() {\n return function(xhr) {\n if(xhr.lengthComputable) {\n const percentComplete = xhr.loaded / xhr.total * 100;\n\n console.log(Math.round(percentComplete, 2) + '% downloaded');\n }\n }\n }\n\n static logError() {\n return function(xhr) {\n console.error(xhr);\n }\n }\n\n static handleColorChange(color) {\n return (value) => {\n if(typeof value === 'string') {\n value = value.replace('#', '0x');\n }\n\n color.setHex(value);\n };\n }\n\n static update(mesh) {\n this.needsUpdate(mesh.material, mesh.geometry);\n }\n\n static needsUpdate(material, geometry) {\n return function() {\n material.shading = +material.shading; //Ensure number\n material.vertexColors = +material.vertexColors; //Ensure number\n material.side = +material.side; //Ensure number\n material.needsUpdate = true;\n geometry.verticesNeedUpdate = true;\n geometry.normalsNeedUpdate = true;\n geometry.colorsNeedUpdate = true;\n };\n }\n\n static updateTexture(material, materialKey, textures) {\n return function(key) {\n material[materialKey] = textures[key];\n material.needsUpdate = true;\n };\n }\n}\n","import * as THREE from 'three';\n// Promise polyfill for IE\nimport { Promise } from 'es6-promise';\n\nimport Helpers from '../../utils/helpers';\nimport Config from '../../data/config';\n\n// This class preloads all textures in the imageFiles array in the Config via ES6 Promises.\n// Once all textures are done loading the model itself will be loaded after the Promise .then() callback.\n// Using promises to preload textures prevents issues when applying textures to materials\n// before the textures have loaded.\nexport default class Texture {\n constructor() {\n // Prop that will contain all loaded textures\n this.textures = {};\n }\n\n load() {\n const loader = new THREE.TextureLoader();\n const maxAnisotropy = Config.maxAnisotropy;\n const imageFiles = Config.texture.imageFiles;\n const promiseArray = [];\n\n loader.setPath(Config.texture.path);\n\n imageFiles.forEach(imageFile => {\n // Add an individual Promise for each image in array\n promiseArray.push(new Promise((resolve, reject) => {\n // Each Promise will attempt to load the image file\n loader.load(imageFile.image,\n // This gets called on load with the loaded texture\n texture => {\n texture.anisotropy = maxAnisotropy;\n\n // Resolve Promise with object of texture if it is instance of THREE.Texture\n const modelOBJ = {};\n modelOBJ[imageFile.name] = texture;\n if(modelOBJ[imageFile.name] instanceof THREE.Texture)\n resolve(modelOBJ);\n },\n Helpers.logProgress(),\n xhr => reject(new Error(xhr + 'An error occurred loading while loading ' + imageFile.image))\n )\n }));\n });\n\n // Iterate through all Promises in array and return another Promise when all have resolved or console log reason when any reject\n return Promise.all(promiseArray).then(textures => {\n // Set the textures prop object to have name be the resolved texture\n for(let i = 0; i < textures.length; i++) {\n this.textures[Object.keys(textures[i])[0]] = textures[i][Object.keys(textures[i])[0]];\n }\n }, reason => console.log(reason));\n }\n}\n","import * as THREE from 'three';\n\n// Simple mesh helper that shows edges, wireframes, and face and vertex normals\nexport default class MeshHelper {\n constructor(scene, mesh) {\n const wireframe = new THREE.WireframeGeometry(mesh.geometry);\n const wireLine = new THREE.LineSegments(wireframe);\n wireLine.material.depthTest = false;\n wireLine.material.opacity = 0.25;\n wireLine.material.transparent = true;\n mesh.add(wireLine);\n\n const edges = new THREE.EdgesGeometry(mesh.geometry);\n const edgesLine = new THREE.LineSegments(edges);\n edgesLine.material.depthTest = false;\n edgesLine.material.opacity = 0.25;\n edgesLine.material.transparent = true;\n mesh.add(edgesLine);\n\n scene.add(new THREE.BoxHelper(mesh));\n scene.add(new THREE.FaceNormalsHelper(mesh, 2));\n scene.add(new THREE.VertexNormalsHelper(mesh, 2));\n }\n}\n","import * as THREE from 'three';\n\nimport Material from '../helpers/material';\nimport MeshHelper from '../helpers/meshHelper';\nimport Helpers from '../../utils/helpers';\nimport Config from '../../data/config';\n\n// Loads in a single object from the config file\nexport default class Model {\n constructor(scene, manager, textures) {\n this.scene = scene;\n this.textures = textures;\n\n // Manager is passed in to loader to determine when loading done in main\n this.loader = new THREE.ObjectLoader(manager);\n this.obj = null;\n }\n\n load() {\n // Load model with ObjectLoader\n this.loader.load(\n Config.model.path,\n obj => {\n obj.traverse(child => {\n if(child instanceof THREE.Mesh) {\n // Create material for mesh and set its map to texture by name from preloaded textures\n const material = new Material(0xffffff).standard;\n material.map = this.textures.UV;\n child.material = material;\n\n // Set to cast and receive shadow if enabled\n if(Config.shadow.enabled) {\n child.receiveShadow = true;\n child.castShadow = true;\n }\n }\n });\n\n // Add mesh helper if Dev\n if(Config.isDev && Config.mesh.enableHelper) {\n new MeshHelper(this.scene, obj);\n }\n\n // Set prop to obj so it can be accessed from outside the class\n this.obj = obj;\n\n obj.scale.multiplyScalar(Config.model.scale);\n this.scene.add(obj);\n },\n Helpers.logProgress(),\n Helpers.logError()\n );\n }\n}\n","const ALIAS = {\n 'left'\t\t: 37,\n 'up'\t\t : 38,\n 'right'\t\t: 39,\n 'down'\t\t: 40,\n 'space'\t\t: 32,\n 'tab'\t\t : 9,\n 'escape'\t: 27\n};\n\nexport default class Keyboard {\n constructor(domElement) {\n this.domElement = domElement || document;\n this.keyCodes = {};\n\n // bind keyEvents\n this.domElement.addEventListener('keydown', (event) => this.onKeyChange(event), false);\n this.domElement.addEventListener('keyup', (event) => this.onKeyChange(event), false);\n\n // bind window blur\n window.addEventListener('blur', () => this.onBlur, false);\n }\n\n destroy() {\n this.domElement.removeEventListener('keydown', (event) => this.onKeyChange(event), false);\n this.domElement.removeEventListener('keyup', (event) => this.onKeyChange(event), false);\n\n // unbind window blur event\n window.removeEventListener('blur', () => this.onBlur, false);\n }\n\n onBlur() {\n for(const prop in this.keyCodes)\n this.keyCodes[prop] = false;\n }\n\n onKeyChange(event) {\n // log to debug\n //console.log('onKeyChange', event, event.keyCode, event.shiftKey, event.ctrlKey, event.altKey, event.metaKey)\n\n // update this.keyCodes\n const keyCode = event.keyCode;\n this.keyCodes[keyCode] = event.type === 'keydown';\n }\n\n pressed(keyDesc) {\n const keys = keyDesc.split('+');\n for(let i = 0; i < keys.length; i++) {\n const key = keys[i];\n let pressed = false;\n if(Object.keys(ALIAS).indexOf(key) != -1) {\n pressed = this.keyCodes[ALIAS[key]];\n } else {\n pressed = this.keyCodes[key.toUpperCase().charCodeAt(0)];\n }\n if(!pressed)\n return false;\n }\n\n return true;\n }\n\n eventMatches(event, keyDesc) {\n const aliases = ALIAS;\n const aliasKeys = Object.keys(aliases);\n const keys = keyDesc.split('+');\n // log to debug\n // console.log('eventMatches', event, event.keyCode, event.shiftKey, event.ctrlKey, event.altKey, event.metaKey)\n for(let i = 0; i < keys.length; i++) {\n const key = keys[i];\n let pressed = false;\n if(key === 'shift') {\n pressed = event.shiftKey ? true : false;\n } else if(key === 'ctrl') {\n pressed = event.ctrlKey ? true : false;\n } else if(key === 'alt') {\n pressed = event.altKey ? true : false;\n } else if(key === 'meta') {\n pressed = event.metaKey ? true : false;\n } else if(aliasKeys.indexOf(key) !== -1) {\n pressed = event.keyCode === aliases[key];\n } else if(event.keyCode === key.toUpperCase().charCodeAt(0)) {\n pressed = true;\n }\n if(!pressed)\n return false;\n }\n\n return true;\n }\n}\n","import Keyboard from '../../utils/keyboard';\nimport Helpers from '../../utils/helpers';\nimport Config from '../../data/config';\n\n// Manages all input interactions\nexport default class Interaction {\n constructor(renderer, scene, camera, controls) {\n // Properties\n this.renderer = renderer;\n this.scene = scene;\n this.camera = camera;\n this.controls = controls;\n\n this.timeout = null;\n\n // Instantiate keyboard helper\n this.keyboard = new Keyboard();\n\n // Listeners\n // Mouse events\n this.renderer.domElement.addEventListener('mousemove', (event) => Helpers.throttle(this.onMouseMove(event), 250), false);\n this.renderer.domElement.addEventListener('mouseleave', (event) => this.onMouseLeave(event), false);\n this.renderer.domElement.addEventListener('mouseover', (event) => this.onMouseOver(event), false);\n\n // Keyboard events\n this.keyboard.domElement.addEventListener('keydown', (event) => {\n // Only once\n if(event.repeat) {\n return;\n }\n\n if(this.keyboard.eventMatches(event, 'escape')) {\n console.log('Escape pressed');\n }\n });\n }\n\n onMouseOver(event) {\n event.preventDefault();\n\n Config.isMouseOver = true;\n }\n\n onMouseLeave(event) {\n event.preventDefault();\n\n Config.isMouseOver = false;\n }\n\n onMouseMove(event) {\n event.preventDefault();\n\n clearTimeout(this.timeout);\n\n this.timeout = setTimeout(function() {\n Config.isMouseMoving = false;\n }, 200);\n\n Config.isMouseMoving = true;\n }\n}\n","import Config from '../../data/config';\n\n// Manages all dat.GUI interactions\nexport default class DatGUI {\n constructor(main, mesh) {\n const gui = new dat.GUI();\n\n this.camera = main.camera.threeCamera;\n this.controls = main.controls.threeControls;\n this.light = main.light;\n\n /* Global */\n //gui.close();\n\n /* Camera */\n const cameraFolder = gui.addFolder('Camera');\n const cameraFOVGui = cameraFolder.add(Config.camera, 'fov', 0, 180).name('Camera FOV');\n cameraFOVGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.camera.fov = value;\n });\n cameraFOVGui.onFinishChange(() => {\n this.camera.updateProjectionMatrix();\n\n this.controls.enableRotate = true;\n });\n const cameraAspectGui = cameraFolder.add(Config.camera, 'aspect', 0, 4).name('Camera Aspect');\n cameraAspectGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.camera.aspect = value;\n });\n cameraAspectGui.onFinishChange(() => {\n this.camera.updateProjectionMatrix();\n\n this.controls.enableRotate = true;\n });\n const cameraFogColorGui = cameraFolder.addColor(Config.fog, 'color').name('Fog Color');\n cameraFogColorGui.onChange((value) => {\n main.scene.fog.color.setHex(value);\n });\n const cameraFogNearGui = cameraFolder.add(Config.fog, 'near', 0.000, 0.010).name('Fog Near');\n cameraFogNearGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n main.scene.fog.density = value;\n });\n cameraFogNearGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n\n\n /* Controls */\n const controlsFolder = gui.addFolder('Controls');\n controlsFolder.add(Config.controls, 'autoRotate').name('Auto Rotate').onChange((value) => {\n this.controls.autoRotate = value;\n });\n const controlsAutoRotateSpeedGui = controlsFolder.add(Config.controls, 'autoRotateSpeed', -1, 1).name('Rotation Speed');\n controlsAutoRotateSpeedGui.onChange((value) => {\n this.controls.enableRotate = false;\n this.controls.autoRotateSpeed = value;\n });\n controlsAutoRotateSpeedGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n\n\n /* Mesh */\n const meshFolder = gui.addFolder('Mesh');\n meshFolder.add(Config.mesh, 'translucent', true).name('Translucent').onChange((value) => {\n if(value) {\n mesh.material.transparent = true;\n mesh.material.opacity = 0.5;\n } else {\n mesh.material.opacity = 1.0;\n }\n });\n meshFolder.add(Config.mesh, 'wireframe', true).name('Wireframe').onChange((value) => {\n mesh.material.wireframe = value;\n });\n\n\n /* Lights */\n // Ambient Light\n const ambientLightFolder = gui.addFolder('Ambient Light');\n ambientLightFolder.add(Config.ambientLight, 'enabled').name('Enabled').onChange((value) => {\n this.light.ambientLight.visible = value;\n });\n ambientLightFolder.addColor(Config.ambientLight, 'color').name('Color').onChange((value) => {\n this.light.ambientLight.color.setHex(value);\n });\n\n\n // Directional Light\n const directionalLightFolder = gui.addFolder('Directional Light');\n directionalLightFolder.add(Config.directionalLight, 'enabled').name('Enabled').onChange((value) => {\n this.light.directionalLight.visible = value;\n });\n directionalLightFolder.addColor(Config.directionalLight, 'color').name('Color').onChange((value) => {\n this.light.directionalLight.color.setHex(value);\n });\n const directionalLightIntensityGui = directionalLightFolder.add(Config.directionalLight, 'intensity', 0, 2).name('Intensity');\n directionalLightIntensityGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.intensity = value;\n });\n directionalLightIntensityGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n const directionalLightPositionXGui = directionalLightFolder.add(Config.directionalLight, 'x', -1000, 1000).name('Position X');\n directionalLightPositionXGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.position.x = value;\n });\n directionalLightPositionXGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n const directionalLightPositionYGui = directionalLightFolder.add(Config.directionalLight, 'y', -1000, 1000).name('Position Y');\n directionalLightPositionYGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.position.y = value;\n });\n directionalLightPositionYGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n const directionalLightPositionZGui = directionalLightFolder.add(Config.directionalLight, 'z', -1000, 1000).name('Position Z');\n directionalLightPositionZGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.position.z = value;\n });\n directionalLightPositionZGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n\n // Shadow Map\n const shadowFolder = gui.addFolder('Shadow Map');\n shadowFolder.add(Config.shadow, 'enabled').name('Enabled').onChange((value) => {\n this.light.directionalLight.castShadow = value;\n });\n shadowFolder.add(Config.shadow, 'helperEnabled').name('Helper Enabled').onChange((value) => {\n this.light.directionalLightHelper.visible = value;\n });\n const shadowNearGui = shadowFolder.add(Config.shadow, 'near', 0, 400).name('Near');\n shadowNearGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.shadow.camera.near = value;\n });\n shadowNearGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n this.light.directionalLight.shadow.map.dispose();\n this.light.directionalLight.shadow.map = null;\n this.light.directionalLightHelper.update();\n });\n const shadowFarGui = shadowFolder.add(Config.shadow, 'far', 0, 1200).name('Far');\n shadowFarGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.shadow.camera.far = value;\n });\n shadowFarGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n this.light.directionalLight.shadow.map.dispose();\n this.light.directionalLight.shadow.map = null;\n this.light.directionalLightHelper.update();\n });\n const shadowTopGui = shadowFolder.add(Config.shadow, 'top', -400, 400).name('Top');\n shadowTopGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.shadow.camera.top = value;\n });\n shadowTopGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n this.light.directionalLight.shadow.map.dispose();\n this.light.directionalLight.shadow.map = null;\n this.light.directionalLightHelper.update();\n });\n const shadowRightGui = shadowFolder.add(Config.shadow, 'right', -400, 400).name('Right');\n shadowRightGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.shadow.camera.right = value;\n });\n shadowRightGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n this.light.directionalLight.shadow.map.dispose();\n this.light.directionalLight.shadow.map = null;\n this.light.directionalLightHelper.update();\n });\n const shadowBottomGui = shadowFolder.add(Config.shadow, 'bottom', -400, 400).name('Bottom');\n shadowBottomGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.shadow.camera.bottom = value;\n });\n shadowBottomGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n this.light.directionalLight.shadow.map.dispose();\n this.light.directionalLight.shadow.map = null;\n this.light.directionalLightHelper.update();\n });\n const shadowLeftGui = shadowFolder.add(Config.shadow, 'left', -400, 400).name('Left');\n shadowLeftGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.shadow.camera.left = value;\n });\n shadowLeftGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n this.light.directionalLight.shadow.map.dispose();\n this.light.directionalLight.shadow.map = null;\n this.light.directionalLightHelper.update();\n });\n const shadowBiasGui = shadowFolder.add(Config.shadow, 'bias', -0.000010, 1).name('Bias');\n shadowBiasGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.directionalLight.shadow.bias = value;\n });\n shadowBiasGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n this.light.directionalLight.shadow.map.dispose();\n this.light.directionalLight.shadow.map = null;\n this.light.directionalLightHelper.update();\n });\n\n\n // Point Light\n const pointLightFolder = gui.addFolder('Point Light');\n pointLightFolder.add(Config.pointLight, 'enabled').name('Enabled').onChange((value) => {\n this.light.pointLight.visible = value;\n });\n pointLightFolder.addColor(Config.pointLight, 'color').name('Color').onChange((value) => {\n this.light.pointLight.color.setHex(value);\n });\n const pointLightIntensityGui = pointLightFolder.add(Config.pointLight, 'intensity', 0, 2).name('Intensity');\n pointLightIntensityGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.pointLight.intensity = value;\n });\n pointLightIntensityGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n const pointLightDistanceGui = pointLightFolder.add(Config.pointLight, 'distance', 0, 1000).name('Distance');\n pointLightDistanceGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.pointLight.distance = value;\n });\n pointLightDistanceGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n const pointLightPositionXGui = pointLightFolder.add(Config.pointLight, 'x', -1000, 1000).name('Position X');\n pointLightPositionXGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.pointLight.position.x = value;\n });\n pointLightPositionXGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n const pointLightPositionYGui = pointLightFolder.add(Config.pointLight, 'y', -1000, 1000).name('Position Y');\n pointLightPositionYGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.pointLight.position.y = value;\n });\n pointLightPositionYGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n const pointLightPositionZGui = pointLightFolder.add(Config.pointLight, 'z', -1000, 1000).name('Position Z');\n pointLightPositionZGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.pointLight.position.z = value;\n });\n pointLightPositionZGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n\n\n // Hemi Light\n const hemiLightFolder = gui.addFolder('Hemi Light');\n hemiLightFolder.add(Config.hemiLight, 'enabled').name('Enabled').onChange((value) => {\n this.light.hemiLight.visible = value;\n });\n hemiLightFolder.addColor(Config.hemiLight, 'color').name('Color').onChange((value) => {\n this.light.hemiLight.color.setHex(value);\n });\n hemiLightFolder.addColor(Config.hemiLight, 'groundColor').name('ground Color').onChange((value) => {\n this.light.hemiLight.groundColor.setHex(value);\n });\n const hemiLightIntensityGui = hemiLightFolder.add(Config.hemiLight, 'intensity', 0, 2).name('Intensity');\n hemiLightIntensityGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.hemiLight.intensity = value;\n });\n hemiLightIntensityGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n const hemiLightPositionXGui = hemiLightFolder.add(Config.hemiLight, 'x', -1000, 1000).name('Position X');\n hemiLightPositionXGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.hemiLight.position.x = value;\n });\n hemiLightPositionXGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n const hemiLightPositionYGui = hemiLightFolder.add(Config.hemiLight, 'y', -500, 1000).name('Position Y');\n hemiLightPositionYGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.hemiLight.position.y = value;\n });\n hemiLightPositionYGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n const hemiLightPositionZGui = hemiLightFolder.add(Config.hemiLight, 'z', -1000, 1000).name('Position Z');\n hemiLightPositionZGui.onChange((value) => {\n this.controls.enableRotate = false;\n\n this.light.hemiLight.position.z = value;\n });\n hemiLightPositionZGui.onFinishChange(() => {\n this.controls.enableRotate = true;\n });\n }\n}\n","// Global imports -\nimport * as THREE from 'three';\nimport TWEEN from 'tween.js';\n\n// Local imports -\n// Components\nimport Renderer from './components/renderer';\nimport Camera from './components/camera';\nimport Light from './components/light';\nimport Controls from './components/controls';\n\n// Helpers\nimport Geometry from './helpers/geometry';\nimport Stats from './helpers/stats';\n\n// Model\nimport Texture from './model/texture';\nimport Model from './model/model';\n\n// Managers\nimport Interaction from './managers/interaction';\nimport DatGUI from './managers/datGUI';\n\n// data\nimport Config from './../data/config';\n// -- End of imports\n\n// This class instantiates and ties all of the components together, starts the loading process and renders the main loop\nexport default class Main {\n constructor(container) {\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(Config.fog.color, Config.fog.near);\n\n // Get Device Pixel Ratio first for retina\n if(window.devicePixelRatio) {\n Config.dpr = window.devicePixelRatio;\n }\n\n // Main renderer constructor\n this.renderer = new Renderer(this.scene, container);\n\n // Components instantiations\n this.camera = new Camera(this.renderer.threeRenderer);\n this.controls = new Controls(this.camera.threeCamera, container);\n this.light = new Light(this.scene);\n\n // Create and place lights in scene\n const lights = ['ambient', 'directional', 'point', 'hemi'];\n lights.forEach((light) => this.light.place(light));\n\n // Create and place geo in scene\n this.geometry = new Geometry(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(Config.isDev && Config.isShowingStats) {\n this.stats = new Stats(this.renderer);\n this.stats.setUp();\n }\n\n // Instantiate texture class\n this.texture = new Texture();\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(() => {\n this.manager = new THREE.LoadingManager();\n\n // Textures loaded, load model\n this.model = new Model(this.scene, this.manager, this.texture.textures);\n this.model.load();\n\n // onProgress callback\n this.manager.onProgress = (item, loaded, total) => {\n console.log(`${item}: ${loaded} ${total}`);\n };\n\n // All loaders done now\n this.manager.onLoad = () => {\n // Set up interaction manager with the app now that the model is finished loading\n new Interaction(this.renderer.threeRenderer, this.scene, this.camera.threeCamera, this.controls.threeControls);\n\n // Add dat.GUI controls if dev\n if(Config.isDev) {\n new DatGUI(this, this.model.obj);\n }\n\n // Everything is now fully loaded\n Config.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 render() {\n // Render rStats if Dev\n if(Config.isDev && Config.isShowingStats) {\n Stats.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(Config.isDev && Config.isShowingStats) {\n Stats.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 frame updates here\n TWEEN.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","import Config from './data/config';\nimport Detector from './utils/detector';\nimport Main from './app/main';\n\n// Styles\nimport './../css/app.scss';\n\n// Check environment and set the Config helper\nif(__ENV__ === 'dev') {\n console.log('----- RUNNING IN DEV ENVIRONMENT! -----');\n\n Config.isDev = true;\n}\n\nfunction init() {\n // Check for webGL capabilities\n if(!Detector.webgl) {\n Detector.addGetWebGLMessage();\n } else {\n const container = document.getElementById('appContainer');\n new Main(container);\n }\n}\n\ninit();\n"],"sourceRoot":""}