1 line
109 KiB
Plaintext
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","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","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","threeRenderer","antialias","setClearColor","setPixelRatio","devicePixelRatio","shadowMap","Config","getMaxAnisotropy","updateSize","setSize","offsetWidth","offsetHeight","render","Camera","renderer","height","threeCamera","Light","init","visible","castShadow","mapSize","directionalLightHelper","lightName","Controls","orbitControls","threeControls","Material","basic","side","standard","shading","roughness","metalness","wire","rS","bS","glS","tS","Geometry","geo","widthSegments","heightSegments","rotation","receiveShadow","Stats","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","arguments","clearTimeout","setTimeout","apply","xhr","lengthComputable","percentComplete","loaded","total","log","round","error","replace","setHex","needsUpdate","geometry","vertexColors","verticesNeedUpdate","normalsNeedUpdate","colorsNeedUpdate","materialKey","textures","key","Texture","loader","promiseArray","setPath","forEach","imageFile","push","Promise","resolve","reject","load","anisotropy","modelOBJ","logProgress","Error","all","then","i","reason","MeshHelper","wireLine","depthTest","opacity","transparent","edges","edgesLine","Model","manager","obj","traverse","child","map","UV","logError","ALIAS","Keyboard","keyCodes","onKeyChange","onBlur","prop","keyDesc","split","pressed","indexOf","toUpperCase","charCodeAt","aliases","aliasKeys","shiftKey","ctrlKey","altKey","metaKey","Interaction","timeout","keyboard","throttle","onMouseLeave","onMouseOver","repeat","eventMatches","DatGUI","main","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","clock","place","make","stats","setUp","onProgress","item","onLoad","querySelector","display","requestAnimationFrame","bind","Detector","getElementById"],"mappings":"2EAAAA,EAAOC,QAAU,SAASC,GACZA,EAAMC,MAalB,SAASC,EAAkBC,GAEzBC,KAAKD,OAASA,EAIdC,KAAKC,OAAS,IAAIL,EAAMM,QAGxBF,KAAKG,YAAc,EACnBH,KAAKI,YAAcC,IAGnBL,KAAKM,QAAU,EACfN,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E) {\n var MOUSE = THREE.MOUSE\n if (!MOUSE)\n MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };\n\n /**\n * @author qiao / https://github.com/qiao\n * @author mrdoob / http://mrdoob.com\n * @author alteredq / http://alteredqualia.com/\n * @author WestLangley / http://github.com/WestLangley\n * @author erich666 / http://erichaines.com\n */\n /*global THREE, console */\n\n function OrbitConstraint ( object ) {\n\n this.object = object;\n\n // \"target\" sets the location of focus, where the object orbits around\n // and where it pans with respect to.\n this.target = new THREE.Vector3();\n\n // Limits to how far you can dolly in and out ( PerspectiveCamera only )\n this.minDistance = 0;\n this.maxDistance = Infinity;\n\n // Limits to how far you can zoom in and out ( OrthographicCamera only )\n this.minZoom = 0;\n this.maxZoom = Infinity;\n\n // How far you can orbit vertically, upper and lower limits.\n // Range is 0 to Math.PI radians.\n this.minPolarAngle = 0; // radians\n this.maxPolarAngle = Math.PI; // radians\n\n // How far you can orbit horizontally, upper and lower limits.\n // If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ].\n this.minAzimuthAngle = - Infinity; // radians\n this.maxAzimuthAngle = Infinity; // radians\n\n // Set to true to enable damping (inertia)\n // If damping is enabled, you must call controls.update() in your animation loop\n this.enableDamping = false;\n this.dampingFactor = 0.25;\n\n ////////////\n // internals\n\n var scope = this;\n\n var EPS = 0.000001;\n\n // Current position in spherical coordinate system.\n var theta;\n var phi;\n\n // Pending changes\n var phiDelta = 0;\n var thetaDelta = 0;\n var scale = 1;\n var panOffset = new THREE.Vector3();\n var zoomChanged = false;\n\n // API\n\n this.getPolarAngle = function () {\n\n return phi;\n\n };\n\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';\r\n\r\n// This object contains the state of the app\r\nexport default {\r\n isDev: false,\r\n isShowingStats: true,\r\n isLoaded: false,\r\n isTweening: false,\r\n isRotating: true,\r\n isMouseMoving: false,\r\n isMouseOver: false,\r\n maxAnisotropy: 1,\r\n dpr: 1,\r\n easing: TWEEN.Easing.Quadratic.InOut,\r\n duration: 500,\r\n model: {\r\n path: './assets/models/Teapot.json',\r\n scale: 20\r\n },\r\n texture: {\r\n path: './assets/textures/',\r\n imageFiles: [\r\n {name: 'UV', image: 'UV_Grid_Sm.jpg'}\r\n ]\r\n },\r\n mesh: {\r\n enableHelper: false,\r\n wireframe: false,\r\n translucent: false,\r\n material: {\r\n color: 0xffffff,\r\n emissive: 0xffffff\r\n }\r\n },\r\n fog: {\r\n color: 0xffffff,\r\n near: 0.0008\r\n },\r\n camera: {\r\n fov: 40,\r\n near: 2,\r\n far: 1000,\r\n aspect: 1,\r\n posX: 0,\r\n posY: 30,\r\n posZ: 40\r\n },\r\n controls: {\r\n autoRotate: true,\r\n autoRotateSpeed: -0.5,\r\n rotateSpeed: 0.5,\r\n zoomSpeed: 0.8,\r\n minDistance: 200,\r\n maxDistance: 600,\r\n minPolarAngle: Math.PI / 5,\r\n maxPolarAngle: Math.PI / 2,\r\n minAzimuthAngle: -Infinity,\r\n maxAzimuthAngle: Infinity,\r\n enableDamping: true,\r\n dampingFactor: 0.5,\r\n enableZoom: true,\r\n target: {\r\n x: 0,\r\n y: 0,\r\n z: 0\r\n }\r\n },\r\n ambientLight: {\r\n enabled: true,\r\n color: 0x141414\r\n },\r\n directionalLight: {\r\n enabled: true,\r\n color: 0xf0f0f0,\r\n intensity: 0.4,\r\n x: -75,\r\n y: 280,\r\n z: 150\r\n },\r\n shadow: {\r\n enabled: true,\r\n helperEnabled: true,\r\n bias: 0,\r\n mapWidth: 2048,\r\n mapHeight: 2048,\r\n near: 250,\r\n far: 400,\r\n top: 100,\r\n right: 100,\r\n bottom: -100,\r\n left: -100\r\n },\r\n pointLight: {\r\n enabled: true,\r\n color: 0xffffff,\r\n intensity: 0.34,\r\n distance: 115,\r\n x: 0,\r\n y: 0,\r\n z: 0\r\n },\r\n hemiLight: {\r\n enabled: true,\r\n color: 0xc8c8c8,\r\n groundColor: 0xffffff,\r\n intensity: 0.55,\r\n x: 0,\r\n y: 0,\r\n z: 0\r\n }\r\n};\r\n","/**\r\n * @author alteredq / http://alteredqualia.com/\r\n * @author mr.doob / http://mrdoob.com/\r\n */\r\n\r\nexport default {\r\n canvas: !!window.CanvasRenderingContext2D,\r\n webgl: (function() {\r\n try {\r\n var canvas = document.createElement('canvas');\r\n\r\n return !!(window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl')));\r\n } catch(e) {\r\n return false;\r\n }\r\n })(),\r\n\r\n workers: !!window.Worker,\r\n fileapi: window.File && window.FileReader && window.FileList && window.Blob,\r\n\r\n getWebGLErrorMessage: function() {\r\n var element = document.createElement('div');\r\n element.id = 'webgl-error-message';\r\n element.style.fontFamily = 'monospace';\r\n element.style.fontSize = '13px';\r\n element.style.fontWeight = 'normal';\r\n element.style.textAlign = 'center';\r\n element.style.background = '#fff';\r\n element.style.color = '#000';\r\n element.style.padding = '1.5em';\r\n element.style.width = '400px';\r\n element.style.margin = '5em auto 0';\r\n\r\n if(!this.webgl) {\r\n element.innerHTML = window.WebGLRenderingContext ? [\r\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 />',\r\n 'Find out how to get it <a href=\"http://get.webgl.org/\" style=\"color:#000000\">here</a>.'\r\n ].join('\\n') : [\r\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/>',\r\n 'Find out how to get it <a href=\"http://get.webgl.org/\" style=\"color:#000000\">here</a>.'\r\n ].join('\\n');\r\n }\r\n\r\n return element;\r\n },\r\n\r\n addGetWebGLMessage: function(parameters) {\r\n var parent, id, element;\r\n\r\n parameters = parameters || {};\r\n\r\n parent = parameters.parent !== undefined ? parameters.parent : document.body;\r\n id = parameters.id !== undefined ? parameters.id : 'oldie';\r\n\r\n element = this.getWebGLErrorMessage();\r\n element.id = id;\r\n\r\n parent.appendChild(element);\r\n }\r\n};\r\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';\r\n\r\nimport Config from '../../data/config';\r\n\r\n// Class that creates and updates the main camera\r\nexport default class Camera {\r\n constructor(renderer) {\r\n const width = renderer.domElement.width;\r\n const height = renderer.domElement.height;\r\n\r\n // Create and position a Perspective Camera\r\n this.threeCamera = new THREE.PerspectiveCamera(Config.camera.fov, width / height, Config.camera.near, Config.camera.far);\r\n this.threeCamera.position.set(Config.camera.posX, Config.camera.posY, Config.camera.posZ);\r\n\r\n // Initial sizing\r\n this.updateSize(renderer);\r\n \r\n // Listeners\r\n window.addEventListener('resize', () => this.updateSize(renderer), false);\r\n }\r\n\r\n updateSize(renderer) {\r\n // Update camera aspect ratio with window aspect ratio\r\n this.threeCamera.aspect = renderer.domElement.width / renderer.domElement.height;\r\n\r\n // Always call updateProjectionMatrix on camera change\r\n this.threeCamera.updateProjectionMatrix();\r\n }\r\n}\r\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\r\nlet rS, bS, glS, tS;\r\n\r\nexport default class Stats {\r\n constructor(renderer) {\r\n this.renderer = renderer;\r\n }\r\n\r\n setUp() {\r\n bS = new BrowserStats();\r\n glS = new glStats();\r\n tS = new threeStats(this.renderer.threeRenderer);\r\n\r\n rS = new rStats({\r\n CSSPath: './css/',\r\n userTimingAPI: true,\r\n values: {\r\n frame: { caption: 'Total frame time (ms)', over: 16, average: true, avgMs: 100 },\r\n fps: { caption: 'Framerate (FPS)', below: 30 },\r\n calls: { caption: 'Calls (three.js)', over: 3000 },\r\n raf: { caption: 'Time since last rAF (ms)', average: true, avgMs: 100 },\r\n rstats: { caption: 'rStats update (ms)', average: true, avgMs: 100 },\r\n texture: { caption: 'GenTex', average: true, avgMs: 100 }\r\n },\r\n groups: [\r\n { caption: 'Framerate', values: ['fps', 'raf'] },\r\n { caption: 'Frame Budget', values: ['frame', 'texture', 'setup', 'render'] }\r\n ],\r\n fractions: [\r\n { base: 'frame', steps: ['texture', 'setup', 'render'] }\r\n ],\r\n plugins: [bS, tS, glS]\r\n });\r\n };\r\n\r\n static start() {\r\n rS('frame').start();\r\n glS.start();\r\n\r\n rS('rAF').tick();\r\n rS('FPS').frame();\r\n\r\n rS('render').start();\r\n };\r\n\r\n static end() {\r\n rS('render').end(); // render finished\r\n rS('frame').end(); // frame finished\r\n\r\n // Local rStats update\r\n rS('rStats').start();\r\n rS().update();\r\n rS('rStats').end();\r\n };\r\n}\r\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';\r\n\r\nimport Material from '../helpers/material';\r\nimport MeshHelper from '../helpers/meshHelper';\r\nimport Helpers from '../../utils/helpers';\r\nimport Config from '../../data/config';\r\n\r\n// Loads in a single object from the config file\r\nexport default class Model {\r\n constructor(scene, manager, textures) {\r\n this.scene = scene;\r\n this.textures = textures;\r\n\r\n // Manager is passed in to loader to determine when loading done in main\r\n this.loader = new THREE.ObjectLoader(manager);\r\n this.obj = null;\r\n }\r\n\r\n load() {\r\n // Load model with ObjectLoader\r\n this.loader.load(\r\n Config.model.path,\r\n obj => {\r\n obj.traverse(child => {\r\n if(child instanceof THREE.Mesh) {\r\n // Create material for mesh and set its map to texture by name from preloaded textures\r\n const material = new Material(0xffffff).standard;\r\n material.map = this.textures.UV;\r\n child.material = material;\r\n\r\n // Set to cast and receive shadow if enabled\r\n if(Config.shadow.enabled) {\r\n child.receiveShadow = true;\r\n child.castShadow = true;\r\n }\r\n }\r\n });\r\n\r\n // Add mesh helper if Dev\r\n if(Config.isDev && Config.mesh.enableHelper) {\r\n new MeshHelper(this.scene, obj);\r\n }\r\n\r\n // Set prop to obj so it can be accessed from outside the class\r\n this.obj = obj;\r\n\r\n obj.scale.multiplyScalar(Config.model.scale);\r\n this.scene.add(obj);\r\n },\r\n Helpers.logProgress(),\r\n Helpers.logError()\r\n );\r\n }\r\n}\r\n","const ALIAS = {\r\n 'left'\t\t: 37,\r\n 'up'\t\t : 38,\r\n 'right'\t\t: 39,\r\n 'down'\t\t: 40,\r\n 'space'\t\t: 32,\r\n 'tab'\t\t : 9,\r\n 'escape'\t: 27\r\n};\r\n\r\nexport default class Keyboard {\r\n constructor(domElement) {\r\n this.domElement = domElement || document;\r\n this.keyCodes = {};\r\n\r\n // bind keyEvents\r\n this.domElement.addEventListener('keydown', (event) => this.onKeyChange(event), false);\r\n this.domElement.addEventListener('keyup', (event) => this.onKeyChange(event), false);\r\n\r\n // bind window blur\r\n window.addEventListener('blur', () => this.onBlur, false);\r\n }\r\n\r\n destroy() {\r\n this.domElement.removeEventListener('keydown', (event) => this.onKeyChange(event), false);\r\n this.domElement.removeEventListener('keyup', (event) => this.onKeyChange(event), false);\r\n\r\n // unbind window blur event\r\n window.removeEventListener('blur', () => this.onBlur, false);\r\n }\r\n\r\n onBlur() {\r\n for(const prop in this.keyCodes)\r\n this.keyCodes[prop] = false;\r\n }\r\n\r\n onKeyChange(event) {\r\n // log to debug\r\n //console.log('onKeyChange', event, event.keyCode, event.shiftKey, event.ctrlKey, event.altKey, event.metaKey)\r\n\r\n // update this.keyCodes\r\n const keyCode = event.keyCode;\r\n this.keyCodes[keyCode] = event.type === 'keydown';\r\n }\r\n\r\n pressed(keyDesc) {\r\n const keys = keyDesc.split('+');\r\n for(let i = 0; i < keys.length; i++) {\r\n const key = keys[i];\r\n let pressed = false;\r\n if(Object.keys(ALIAS).indexOf(key) != -1) {\r\n pressed = this.keyCodes[ALIAS[key]];\r\n } else {\r\n pressed = this.keyCodes[key.toUpperCase().charCodeAt(0)];\r\n }\r\n if(!pressed)\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n eventMatches(event, keyDesc) {\r\n const aliases = ALIAS;\r\n const aliasKeys = Object.keys(aliases);\r\n const keys = keyDesc.split('+');\r\n // log to debug\r\n // console.log('eventMatches', event, event.keyCode, event.shiftKey, event.ctrlKey, event.altKey, event.metaKey)\r\n for(let i = 0; i < keys.length; i++) {\r\n const key = keys[i];\r\n let pressed = false;\r\n if(key === 'shift') {\r\n pressed = event.shiftKey ? true : false;\r\n } else if(key === 'ctrl') {\r\n pressed = event.ctrlKey ? true : false;\r\n } else if(key === 'alt') {\r\n pressed = event.altKey ? true : false;\r\n } else if(key === 'meta') {\r\n pressed = event.metaKey ? true : false;\r\n } else if(aliasKeys.indexOf(key) !== -1) {\r\n pressed = event.keyCode === aliases[key];\r\n } else if(event.keyCode === key.toUpperCase().charCodeAt(0)) {\r\n pressed = true;\r\n }\r\n if(!pressed)\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n}\r\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';\r\nimport Detector from './utils/detector';\r\nimport Main from './app/main';\r\n\r\n// Styles\r\nimport './../css/app.scss';\r\n\r\n// Check environment and set the Config helper\r\nif(__ENV__ === 'dev') {\r\n console.log('----- RUNNING IN DEV ENVIRONMENT! -----');\r\n\r\n Config.isDev = true;\r\n}\r\n\r\nfunction init() {\r\n // Check for webGL capabilities\r\n if(!Detector.webgl) {\r\n Detector.addGetWebGLMessage();\r\n } else {\r\n const container = document.getElementById('appContainer');\r\n new Main(container);\r\n }\r\n}\r\n\r\ninit();\r\n"],"sourceRoot":""} |