├── .gitignore ├── 8thWall ├── README.md ├── config │ ├── webpack.config.dev.js │ └── webpack.config.prod.js ├── package-lock.json ├── package.json ├── src │ └── js │ │ ├── arscene.js │ │ ├── index.js │ │ ├── interaction.js │ │ └── shared.js ├── static │ ├── css │ │ └── main.css │ ├── images │ │ ├── Sandbox_striped.jpg │ │ ├── albedo_NE.jpg │ │ ├── albedo_NW.jpg │ │ ├── albedo_SE.jpg │ │ ├── albedo_SW.jpg │ │ └── alphaMask.jpg │ ├── index.html │ └── models │ │ ├── duneBuggy.glb │ │ ├── frame_outerOccluder.obj │ │ ├── sandbox.obj │ │ ├── terrain_NE.obj │ │ ├── terrain_NW.obj │ │ ├── terrain_SE.obj │ │ └── terrain_SW.obj └── webpack.config.js ├── README.md ├── lensStudio ├── AdditionalFiles │ ├── duneBuggy 2 │ │ └── Materials │ │ │ └── folder.lock │ ├── frame_outerOccluder │ │ └── Materials │ │ │ ├── Material.lsmat │ │ │ └── folder.lock │ ├── sandbox │ │ └── Materials │ │ │ ├── Material.lsmat │ │ │ └── folder.lock │ ├── terrain_NE │ │ └── Materials │ │ │ ├── Material.lsmat │ │ │ └── folder.lock │ ├── terrain_NW │ │ └── Materials │ │ │ ├── Material.lsmat │ │ │ └── folder.lock │ ├── terrain_SE │ │ └── Materials │ │ │ ├── Material.lsmat │ │ │ └── folder.lock │ ├── terrain_SW │ │ └── Materials │ │ │ ├── Material.lsmat │ │ │ └── folder.lock │ └── unitCube │ │ └── Materials │ │ └── folder.lock ├── Public │ ├── Log_To_Screen │ │ ├── LetterMeshes │ │ │ ├── Meshes │ │ │ │ ├── 0.mesh │ │ │ │ ├── 1.mesh │ │ │ │ ├── 2.mesh │ │ │ │ ├── 3.mesh │ │ │ │ ├── 4.mesh │ │ │ │ ├── 5.mesh │ │ │ │ ├── 6.mesh │ │ │ │ ├── 7.mesh │ │ │ │ ├── 8.mesh │ │ │ │ ├── 9.mesh │ │ │ │ ├── A_upper.mesh │ │ │ │ ├── B_upper.mesh │ │ │ │ ├── C_upper.mesh │ │ │ │ ├── D_upper.mesh │ │ │ │ ├── E_upper.mesh │ │ │ │ ├── F_upper.mesh │ │ │ │ ├── G_upper.mesh │ │ │ │ ├── H_upper.mesh │ │ │ │ ├── I_upper.mesh │ │ │ │ ├── J_upper.mesh │ │ │ │ ├── K_upper.mesh │ │ │ │ ├── L_upper.mesh │ │ │ │ ├── M_upper.mesh │ │ │ │ ├── N_upper.mesh │ │ │ │ ├── O_upper.mesh │ │ │ │ ├── P_upper.mesh │ │ │ │ ├── Q_upper.mesh │ │ │ │ ├── R_upper.mesh │ │ │ │ ├── S_upper.mesh │ │ │ │ ├── T_upper.mesh │ │ │ │ ├── U_upper.mesh │ │ │ │ ├── V_upper.mesh │ │ │ │ ├── W_upper.mesh │ │ │ │ ├── X_upper.mesh │ │ │ │ ├── Y_upper.mesh │ │ │ │ ├── Z_upper.mesh │ │ │ │ ├── _chr_10.mesh │ │ │ │ ├── _chr_11.mesh │ │ │ │ ├── _chr_12.mesh │ │ │ │ ├── _chr_123.mesh │ │ │ │ ├── _chr_124.mesh │ │ │ │ ├── _chr_125.mesh │ │ │ │ ├── _chr_126.mesh │ │ │ │ ├── _chr_13.mesh │ │ │ │ ├── _chr_32.mesh │ │ │ │ ├── _chr_33.mesh │ │ │ │ ├── _chr_34.mesh │ │ │ │ ├── _chr_35.mesh │ │ │ │ ├── _chr_36.mesh │ │ │ │ ├── _chr_37.mesh │ │ │ │ ├── _chr_38.mesh │ │ │ │ ├── _chr_39.mesh │ │ │ │ ├── _chr_40.mesh │ │ │ │ ├── _chr_41.mesh │ │ │ │ ├── _chr_42.mesh │ │ │ │ ├── _chr_43.mesh │ │ │ │ ├── _chr_44.mesh │ │ │ │ ├── _chr_45.mesh │ │ │ │ ├── _chr_46.mesh │ │ │ │ ├── _chr_47.mesh │ │ │ │ ├── _chr_58.mesh │ │ │ │ ├── _chr_59.mesh │ │ │ │ ├── _chr_60.mesh │ │ │ │ ├── _chr_61.mesh │ │ │ │ ├── _chr_62.mesh │ │ │ │ ├── _chr_63.mesh │ │ │ │ ├── _chr_64.mesh │ │ │ │ ├── _chr_9.mesh │ │ │ │ ├── _chr_91.mesh │ │ │ │ ├── _chr_92.mesh │ │ │ │ ├── _chr_93.mesh │ │ │ │ ├── _chr_94.mesh │ │ │ │ ├── _chr_95.mesh │ │ │ │ ├── _chr_96.mesh │ │ │ │ └── folder.lock │ │ │ └── folder.lock │ │ ├── TextLogger.js │ │ ├── TextLoggerInput.js │ │ ├── folder.lock │ │ ├── font_mat.lsmat │ │ └── font_sheet.png │ ├── Materials │ │ ├── Darken.lsmat │ │ ├── ManipulateMeshInvisible.lsmat │ │ ├── Occluder.lsmat │ │ ├── SandBox_Unlit.lsmat │ │ ├── TerrainDiffuse.lsmat │ │ ├── TerrainDiffuse_NE.lsmat │ │ ├── TerrainDiffuse_NW.lsmat │ │ ├── TerrainDiffuse_SE.lsmat │ │ ├── TerrainDiffuse_SW.lsmat │ │ ├── VertexColor.lsmat │ │ ├── folder.lock │ │ ├── ground_grid.lsmat │ │ └── touch_collision.lsmat │ ├── Meshes │ │ ├── duneBuggy 2.glb │ │ ├── duneBuggy.glb │ │ ├── folder.lock │ │ ├── frame_outerOccluder.obj │ │ ├── ground_grid_mesh.mesh │ │ ├── manipulatemesh 2.obj │ │ ├── sandbox.obj │ │ ├── terrain_NE.obj │ │ ├── terrain_NW.obj │ │ ├── terrain_SE.obj │ │ ├── terrain_SW.obj │ │ ├── touch_collision_cube.mesh │ │ └── unitCube.obj │ ├── Scripts │ │ ├── DuneBuggy.js │ │ ├── GroundGrid.js │ │ ├── WorldObjectController.js │ │ ├── folder.lock │ │ ├── hints.js │ │ └── shared.js │ ├── Textures │ │ ├── Base 2.png │ │ ├── Base 3.png │ │ ├── Base.png │ │ ├── MaterialParams.png │ │ ├── Normal.png │ │ ├── Sandbox.jpg │ │ ├── Sandbox_striped.jpg │ │ ├── albedo_NE.jpg │ │ ├── albedo_NW.jpg │ │ ├── albedo_SE.jpg │ │ ├── albedo_SW.jpg │ │ ├── alphaMask.jpg │ │ ├── folder.lock │ │ ├── ground_grid.png │ │ ├── ground_grid_mask.png │ │ └── icon-white.png │ └── folder.lock ├── README.md ├── _lensStudio.lsproj ├── icon.png ├── lensStudio.lsproj └── project.data ├── package-lock.json ├── package.json ├── rollup.config.js ├── shared ├── README.md ├── Terrain_Displacement.png ├── duneBuggy.js ├── dynamicTerrain.js ├── heightProcessor.js ├── shared_lensStudio.js ├── shared_sparkAR.js ├── shared_web.js ├── terrainHeights128.js ├── terrainHeights256.js └── terrainHeights512.js ├── sparkAR ├── IG_Effect_Icon_Template.jpg ├── README.md ├── objects │ ├── duneBuggy_backWheel │ │ └── duneBuggy_backWheel.gltf │ ├── duneBuggy_frame │ │ └── duneBuggy_frame.gltf │ ├── duneBuggy_frontWheel │ │ └── duneBuggy_frontWheel.gltf │ ├── frame_outerOccluder(1) │ │ ├── frame_outerOccluder.mtl │ │ └── frame_outerOccluder.obj │ ├── sandbox(2) │ │ ├── sandbox.mtl │ │ └── sandbox.obj │ ├── terrain_NE(6) │ │ ├── terrain_NE.mtl │ │ └── terrain_NE.obj │ ├── terrain_NE │ │ └── old │ │ │ └── terrain_NE.obj │ ├── terrain_NW(1) │ │ ├── terrain_NW.mtl │ │ └── terrain_NW.obj │ ├── terrain_SE(1) │ │ ├── terrain_SE.mtl │ │ └── terrain_SE.obj │ ├── terrain_SW(1) │ │ ├── terrain_SW.mtl │ │ └── terrain_SW.obj │ └── unitCube │ │ └── unitCube.obj ├── scripts │ ├── main.js │ ├── script.js │ ├── shared.js │ ├── tsconfig.json │ └── watch.js ├── sparkAR.arproj └── textures │ ├── Sandbox_striped.jpg │ ├── icon-white.png │ └── jpg │ ├── albedo_NE.jpg │ ├── albedo_NW.jpg │ ├── albedo_SE.jpg │ └── albedo_SW.jpg └── web ├── README.md ├── config ├── webpack.config.dev.js └── webpack.config.prod.js ├── package-lock.json ├── package.json ├── src └── js │ ├── arscene.js │ ├── index.js │ ├── interaction.js │ ├── shared.js │ └── tiltShiftVignetteShader.js ├── static ├── css │ └── main.css ├── images │ ├── FB_QRCode.png │ ├── Insta_QRCode.png │ ├── WebAR_QRCode.png │ ├── albedo_NE.jpg │ ├── albedo_NW.jpg │ ├── albedo_SE.jpg │ ├── albedo_SW.jpg │ ├── alphaMask.jpg │ ├── duneBuggyLogo.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ ├── finger_01.png │ ├── finger_02.png │ ├── keys_01.png │ ├── keys_02.png │ ├── og.jpg │ └── snapcode.png ├── index.html ├── js │ └── ringsSVG.js └── models │ ├── duneBuggy.glb │ ├── terrain_NE.obj │ ├── terrain_NW.obj │ ├── terrain_SE.obj │ └── terrain_SW.obj └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /node_modules 3 | /web/node_modules 4 | /web/dist 5 | /8thWall/node_modules 6 | /8thWall/dist 7 | /sparkAR/export -------------------------------------------------------------------------------- /8thWall/README.md: -------------------------------------------------------------------------------- 1 | # Dune Buggy AR - WebAR 2 | This is the WebAR version of the Dune Buggy that is built on top of 8thWall and AFrame. In order to build your own version you'll need to create an 8thWall account and update the app key in `static/index.html` 3 | 4 | # Project setup 5 | 6 | `npm install` will install the required dependencies 7 | 8 | `npm run watch` will run a dev server on port 9000. 9 | 10 | `npm run build` will create a distribution directory "dist" 11 | -------------------------------------------------------------------------------- /8thWall/config/webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const appDir = path.resolve(__dirname, '..', 'src'); 3 | const staticDir = path.resolve(__dirname, '..', 'static'); 4 | 5 | console.log("DEV!"); 6 | module.exports = { 7 | mode: 'development', 8 | context: appDir, 9 | devtool: 'source-map', 10 | entry: './js/index.js', // './src/index.js', 11 | output: { 12 | filename: 'js/[name].js', 13 | publicPath: '/', 14 | sourceMapFilename: '[name].map' 15 | }, 16 | devServer: { 17 | contentBase: [appDir, staticDir], 18 | historyApiFallback: true, 19 | port: 9000, 20 | https: true 21 | } 22 | }; -------------------------------------------------------------------------------- /8thWall/config/webpack.config.prod.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const appDir = path.resolve(__dirname, '..', 'src'); 3 | const staticDir = path.resolve(__dirname, '..', 'static'); 4 | const distDir = path.resolve(__dirname, '..', 'dist'); 5 | const CopyPlugin = require('copy-webpack-plugin'); 6 | 7 | module.exports = { 8 | mode: 'production', 9 | context: appDir, 10 | entry: path.resolve(__dirname, '../src', 'js/index.js'), 11 | output: { 12 | filename: 'js/[name].js', 13 | path: distDir, 14 | publicPath: '/' 15 | }, 16 | module: { 17 | rules: [ 18 | { 19 | test: /\.js$/, 20 | include: [ 21 | path.resolve(__dirname, '../src') 22 | ], 23 | use: [ 24 | { 25 | loader: 'babel-loader', 26 | 'options': { 27 | sourceMap: true, 28 | presets: [['@babel/preset-env', { 29 | modules: false, 30 | useBuiltIns: 'entry' 31 | }]], 32 | plugins: [], 33 | babelrc: false 34 | } 35 | }, 36 | ], 37 | } 38 | ] 39 | }, 40 | plugins: [ 41 | new CopyPlugin([ 42 | { 43 | from: '**/*', 44 | to: distDir, 45 | context: staticDir, 46 | }, 47 | ]), 48 | ] 49 | }; -------------------------------------------------------------------------------- /8thWall/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dunebuggy-web", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "webpack-dev-server --colors --host=0.0.0.0 --env.development", 8 | "build": "rimraf ./dist && webpack --colors --verbose --env.production" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "rimraf": "^3.0.0", 14 | "three": "^0.109.0" 15 | }, 16 | "devDependencies": { 17 | "@babel/core": "^7.6.4", 18 | "@babel/preset-env": "^7.6.3", 19 | "babel-loader": "^8.0.6", 20 | "copy-webpack-plugin": "^5.0.4", 21 | "webpack": "^4.41.0", 22 | "webpack-cli": "^3.3.9", 23 | "webpack-dev-server": "^3.8.1" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /8thWall/src/js/arscene.js: -------------------------------------------------------------------------------- 1 | import { DynamicTerrain, DuneBuggy } from "./shared.js"; 2 | 3 | 'use strict'; 4 | 5 | function ARScene (camera) { 6 | 7 | this.scene = new THREE.Group();//new Scene(); 8 | this.scene.position.y = -15; 9 | this.camera = camera; 10 | this.masterGroup = new THREE.Group(); 11 | this.masterGroup.position.y = -15; 12 | 13 | var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.75 ); 14 | // directionalLight.position.set(50,50,-50); 15 | directionalLight.position.set(-15,25,-15); 16 | directionalLight.position.set(-15,25,-15); 17 | directionalLight.castShadow = true; 18 | directionalLight.shadow.mapSize.width = 512; // default 19 | directionalLight.shadow.mapSize.height = 512; // default 20 | directionalLight.shadow.camera.near = 0.5; // default 21 | directionalLight.shadow.camera.far = 100; // default 22 | directionalLight.shadow.camera.left = directionalLight.shadow.camera.bottom = -3.2; // default 23 | directionalLight.shadow.camera.right = directionalLight.shadow.camera.top = 3.2; // default 24 | this.directionalLight = directionalLight; 25 | 26 | var ambientLight = new THREE.AmbientLight( 0xffffff, 0.75 ); 27 | this.masterGroup.add( ambientLight ); 28 | 29 | this.masterGroup.add( directionalLight ); 30 | directionalLight.target = this.masterGroup; 31 | 32 | this.terrain = new DynamicTerrain(Math.round(25*1.75), 50); 33 | 34 | 35 | this.duneBuggy = new DuneBuggy(); 36 | this.duneBuggy.rotate(Math.PI); // default start direction 37 | 38 | this.buggyScale = 0.5; 39 | 40 | this.scene.add(this.masterGroup); 41 | this.terrainContainer = new THREE.Group(); 42 | this.terrainContainer.scale.y = 1.1333333; 43 | this.terrainContainer.renderOrder = 2; 44 | this.masterGroup.add(this.terrainContainer); 45 | 46 | this.currTime = new Date().getTime(); 47 | 48 | this.terrain.setPosition(50,50); 49 | this.autoDrive = false; 50 | this.accelerate = 1; 51 | this.dragVector = [0,0]; 52 | this.touching = false; 53 | } 54 | 55 | function addBuggy (buggy) { 56 | console.log('BUGGY!', buggy); 57 | this.buggy_frame = buggy.children.find((child) => { 58 | return child.name === 'Frame'; 59 | }); 60 | 61 | this.buggy_frontLeftWheel = buggy.children.find((child) => { 62 | return child.name === 'FrontLeftWheel'; 63 | }); 64 | this.buggy_frontRightWheel = this.buggy_frontLeftWheel.clone(); 65 | this.buggy_backLeftWheel = this.buggy_frontLeftWheel.clone(); 66 | this.buggy_backRightWheel = this.buggy_frontLeftWheel.clone(); 67 | 68 | this.buggy = new THREE.Group(); 69 | this.buggy.scale.set(this.buggyScale, this.buggyScale, this.buggyScale); 70 | this.buggy.renderOrder = 2; 71 | this.masterGroup.add(this.buggy); 72 | this.buggySpin = new THREE.Group(); 73 | this.buggySpin.add(this.buggy_frame); 74 | this.buggy.add(this.buggySpin); 75 | this.buggy.add(this.buggy_frontLeftWheel); 76 | this.buggy.add(this.buggy_frontRightWheel); 77 | this.buggy.add(this.buggy_backLeftWheel); 78 | this.buggy.add(this.buggy_backRightWheel); 79 | this.buggy_frame.castShadow = true; 80 | this.buggy_frontLeftWheel.castShadow = true; 81 | this.buggy_frontRightWheel.castShadow = true; 82 | this.buggy_backLeftWheel.castShadow = true; 83 | this.buggy_backRightWheel.castShadow = true; 84 | this.buggy_frontLeftWheel.position.y = this.duneBuggy.frontWheelX; 85 | this.buggy_frontRightWheel.position.y = this.duneBuggy.frontWheelX; 86 | this.buggy_frontLeftWheel.position.x = -this.duneBuggy.frontWheelSpace; 87 | this.buggy_frontRightWheel.position.x = this.duneBuggy.frontWheelSpace; 88 | this.buggy_backLeftWheel.position.y = this.duneBuggy.backWheelX; 89 | this.buggy_backRightWheel.position.y = this.duneBuggy.backWheelX; 90 | 91 | } 92 | 93 | function setupObj (obj, textureURL) { 94 | obj.material = new THREE.MeshLambertMaterial({ 95 | map: new THREE.TextureLoader().load( textureURL ), 96 | alphaMap: new THREE.TextureLoader().load( 'images/alphaMask.jpg', function(texture){ 97 | texture.wrapS = texture.wrapT = THREE.ClampToEdgeWrapping; 98 | texture.magFilter = THREE.NearestFilter; 99 | texture.repeat = new THREE.Vector2(2.5, 2.5); 100 | } ), 101 | alphaTest: 0.5 102 | }) 103 | obj.material.transparent = true; 104 | // materials only use on set of UV offsets so I'm manually adding 105 | // UV2 and a uniform to adjust UV2 106 | obj.material.onBeforeCompile = function ( shader ) { 107 | // // i binded the function scope to the material so "this" is the material 108 | // // lets save the shader as variable so we can mod values later 109 | this.shader = shader; 110 | 111 | shader.uniforms.uv2Offset = { value: new THREE.Vector2(0,0) }; 112 | shader.vertexShader = 'uniform vec2 uv2Offset;\n' + shader.vertexShader; 113 | 114 | shader.vertexShader = shader.vertexShader.replace('#include ', 'varying vec2 vUv2; \n'); 115 | shader.vertexShader = shader.vertexShader.replace('#include ', 'vUv2 = (uv*0.5)+uv2Offset; \n'); 116 | shader.vertexShader = shader.vertexShader.replace('#include ', '#include \n'); 117 | 118 | shader.fragmentShader = shader.fragmentShader.replace('#include ','varying vec2 vUv2; \n'); 119 | shader.fragmentShader = shader.fragmentShader.replace('#include ', 'diffuseColor.a *= texture2D( alphaMap, vUv2 ).g; \n'); 120 | }.bind(obj.material); 121 | 122 | obj.receiveShadow = true; 123 | obj.renderOrder = 3; 124 | this.terrainContainer.add(obj); 125 | } 126 | 127 | function addTerrain (terrain_id, terrain) { 128 | 129 | switch (terrain_id) { 130 | case 'ne': 131 | this.terrain_NE = terrain.children[0]; 132 | setupObj.call(this, this.terrain_NE, 'images/albedo_NE.jpg'); 133 | break; 134 | case 'nw': 135 | this.terrain_NW = terrain.children[0]; 136 | setupObj.call(this, this.terrain_NW, 'images/albedo_NW.jpg'); 137 | break; 138 | case 'se': 139 | this.terrain_SE = terrain.children[0]; 140 | setupObj.call(this, this.terrain_SE, 'images/albedo_SE.jpg'); 141 | break; 142 | case 'sw': 143 | this.terrain_SW = terrain.children[0]; 144 | setupObj.call(this, this.terrain_SW, 'images/albedo_SW.jpg'); 145 | break; 146 | } 147 | 148 | if (this.terrain_NE, this.terrain_NW, this.terrain_SE, this.terrain_SW) { 149 | console.log('ANIMATE!!!'); 150 | this.index.el.renderer.render(this.index.el.sceneEl.object3D, this.camera) 151 | // this.animate(); 152 | } 153 | } 154 | 155 | function clamp(min, max, val){ 156 | return Math.min(max, Math.max(min, val)); 157 | } 158 | 159 | const camPos = new THREE.Vector3(); 160 | const masterPos = new THREE.Vector3(); 161 | const CamUpVector = new THREE.Vector3(); 162 | const YAxisPlane = new THREE.Vector3(); 163 | const CamToScene_ForwardVec = new THREE.Vector3(); 164 | const CamToScene_SideVec = new THREE.Vector3(); 165 | const CamToScene_UpVec = new THREE.Vector3(); 166 | 167 | function getCameraRotation () { 168 | camPos.setFromMatrixPosition(this.camera.matrixWorld); 169 | masterPos.setFromMatrixPosition(this.masterGroup.matrixWorld); 170 | 171 | CamUpVector.set(0,1,0).applyMatrix4(this.camera.matrixWorld).sub(camPos); 172 | YAxisPlane.set(0,1,0).applyMatrix4(this.scene.matrixWorld).sub(masterPos); 173 | 174 | CamToScene_ForwardVec.setFromMatrixPosition(this.buggy_frame.matrixWorld).sub(camPos); 175 | CamToScene_SideVec.crossVectors(CamToScene_ForwardVec, YAxisPlane); 176 | CamToScene_UpVec.crossVectors(CamToScene_ForwardVec, CamToScene_SideVec); 177 | 178 | let CamSceneRotationPtX = CamUpVector.dot(CamToScene_SideVec); 179 | let CamSceneRotationPtY = CamUpVector.dot(CamToScene_UpVec); 180 | 181 | return Math.atan(CamSceneRotationPtX / Math.abs(CamSceneRotationPtY)); 182 | } 183 | 184 | function moveTerrain(x, y){ 185 | // terrain peices need to wrap around when panning 186 | var X1 = (x>25)?-100:0; 187 | var X2 = (x<-25)?100:0; 188 | var Y1 = (y>25)?-100:0; 189 | var Y2 = (y<-25)?100:0; 190 | 191 | // move the terrain container and peices 192 | this.terrainContainer.position.set(x,0,y); 193 | this.terrain_NE.position.set(X1,0,Y1); 194 | this.terrain_NW.position.set(X2,0,Y1); 195 | this.terrain_SE.position.set(X1,0,Y2); 196 | this.terrain_SW.position.set(X2,0,Y2); 197 | 198 | // update the uv offset for the alpha texture 199 | var divider = 100; 200 | if(this.terrain_NE.material.shader) 201 | this.terrain_NE.material.shader.uniforms.uv2Offset.value.set(0.5+((X1+x)/divider), 0.5+((Y1+y)/divider)); 202 | if(this.terrain_NW.material.shader) 203 | this.terrain_NW.material.shader.uniforms.uv2Offset.value.set(((X2+x)/divider), 0.5+((Y1+y)/divider)); 204 | if(this.terrain_SE.material.shader) 205 | this.terrain_SE.material.shader.uniforms.uv2Offset.value.set(0.5+((X1+x)/divider), ((Y2+y)/divider)); 206 | if(this.terrain_SW.material.shader) 207 | this.terrain_SW.material.shader.uniforms.uv2Offset.value.set(((X2+x)/divider), ((Y2+y)/divider)); 208 | } 209 | 210 | var frameIndex = 0; 211 | function animate() { 212 | requestAnimationFrame( animate.bind(this) ); 213 | 214 | // get elapsed time 215 | var _currTime = Date.now(); 216 | var _elapsedTime = _currTime-this.currTime; 217 | this.currTime = _currTime; 218 | 219 | ////////// Update terrain and dune buggy ////////// 220 | this.terrain.move( 221 | this.duneBuggy.vectorXY[0]*this.duneBuggy.speedXY*_elapsedTime/1000, 222 | -this.duneBuggy.vectorXY[1]*this.duneBuggy.speedXY*_elapsedTime/1000 223 | ); 224 | moveTerrain.call(this, -(wrapVal(this.terrain.currentPosition[0], 100)-50), (wrapVal(this.terrain.currentPosition[1], 100)-50) ); 225 | 226 | if(this.autoDrive){ 227 | this.duneBuggy.accelerationXY_Mult = 1; 228 | this.duneBuggy.rotate(((Math.sin(3+this.currTime/8000)+Math.sin(this.currTime/800))*0.65)*_elapsedTime/1000); 229 | } else { 230 | this.duneBuggy.accelerationXY_Mult = 1; // ((this.touching)?1:0)+(this.interaction.arrows.up?1:0)-(this.interaction.arrows.down?1:0); 231 | let rot = getCameraRotation.call(this); 232 | 233 | let rotValue = Math.min(1, rot*1.75 )*15; 234 | if (!isNaN(rotValue)){ 235 | this.duneBuggy.rotate( -rotValue * _elapsedTime/1000 ); 236 | } 237 | } 238 | 239 | // next set wheelHeights 240 | this.duneBuggy.update( 241 | _elapsedTime/1000, 242 | this.terrain.getPt(this.terrain.currentPosition[0]+this.duneBuggy.wheelPositions[0][0]*this.buggyScale, this.terrain.currentPosition[1]-this.duneBuggy.wheelPositions[0][1]*this.buggyScale).z, 243 | this.terrain.getPt(this.terrain.currentPosition[0]+this.duneBuggy.wheelPositions[1][0]*this.buggyScale, this.terrain.currentPosition[1]-this.duneBuggy.wheelPositions[1][1]*this.buggyScale).z, 244 | this.terrain.getPt(this.terrain.currentPosition[0]+this.duneBuggy.wheelPositions[2][0]*this.buggyScale, this.terrain.currentPosition[1]-this.duneBuggy.wheelPositions[2][1]*this.buggyScale).z, 245 | this.terrain.getPt(this.terrain.currentPosition[0]+this.duneBuggy.wheelPositions[3][0]*this.buggyScale, this.terrain.currentPosition[1]-this.duneBuggy.wheelPositions[3][1]*this.buggyScale).z 246 | ); 247 | 248 | ////////// Update Dune Buggy transforms ////////// 249 | 250 | this.buggySpin.rotation.y = Math.PI-this.duneBuggy.rotation; 251 | this.buggy_frame.rotation.x = this.duneBuggy.tilt; // tilt 252 | this.buggy_frame.rotation.z = this.duneBuggy.roll; // roll 253 | this.buggy_frame.position.y = this.duneBuggy.midHeight/this.buggyScale; 254 | 255 | this.buggy_frontLeftWheel.position.set(this.duneBuggy.wheelPositions[0][0], this.duneBuggy.wheelPositions[0][2]/this.buggyScale, this.duneBuggy.wheelPositions[0][1]); 256 | this.buggy_frontRightWheel.position.set(this.duneBuggy.wheelPositions[1][0], this.duneBuggy.wheelPositions[1][2]/this.buggyScale, this.duneBuggy.wheelPositions[1][1]); 257 | this.buggy_backLeftWheel.position.set(this.duneBuggy.wheelPositions[2][0], this.duneBuggy.wheelPositions[2][2]/this.buggyScale, this.duneBuggy.wheelPositions[2][1]); 258 | this.buggy_backRightWheel.position.set(this.duneBuggy.wheelPositions[3][0], this.duneBuggy.wheelPositions[3][2]/this.buggyScale, this.duneBuggy.wheelPositions[3][1]); 259 | 260 | this.buggy_frontLeftWheel.rotation.y = Math.PI-this.duneBuggy.rotation; 261 | this.buggy_frontRightWheel.rotation.y = Math.PI-this.duneBuggy.rotation; 262 | this.buggy_backLeftWheel.rotation.y = Math.PI-this.duneBuggy.rotation; 263 | this.buggy_backRightWheel.rotation.y = Math.PI-this.duneBuggy.rotation; 264 | 265 | 266 | // update light position to follow the dune buggy 267 | // this keeps the shadow from clipping 268 | this.directionalLight.position.y = 50+this.buggy_frame.position.y; 269 | this.directionalLight.target.y = this.buggy_frame.position.y; 270 | var masterScale = (this.masterGroup.parent.scale.x/0.1); 271 | this.directionalLight.shadow.camera.zoom = 1/masterScale; 272 | this.directionalLight.shadow.camera.updateProjectionMatrix(); 273 | } 274 | 275 | ARScene.prototype.animate = animate; 276 | ARScene.prototype.addBuggy = addBuggy; 277 | ARScene.prototype.addTerrain = addTerrain; 278 | 279 | export { ARScene }; 280 | 281 | 282 | //////////////////// HELPER FUNCTIONS //////////////////// 283 | // (I put these at the bottom to keep them out of the way) 284 | 285 | // this is basically Modulo, but it works with negative numbers 286 | function wrapVal(val, range){ 287 | if(val >=0){ 288 | return val%range; 289 | } else { 290 | return range-(Math.abs(val)%range) 291 | } 292 | } -------------------------------------------------------------------------------- /8thWall/src/js/interaction.js: -------------------------------------------------------------------------------- 1 | var Interaction = (function(){ 2 | 3 | 'use strict'; 4 | /* jshint validthis: true */ 5 | 6 | function Interaction(props){ 7 | console.log('Interaction'); 8 | this.element = (props.element)?props.element:document.body; 9 | 10 | this.onTap = (props.onTap)?props.onTap:function(){}; 11 | this.onSwipeUp = (props.onSwipeUp)?props.onSwipeUp:function(){}; 12 | this.onSwipeDown = (props.onSwipeDown)?props.onSwipeDown:function(){}; 13 | this.onSwipeLeft = (props.onSwipeLeft)?props.onSwipeLeft:function(){}; 14 | this.onSwipeRight = (props.onSwipeRight)?props.onSwipeRight:function(){}; 15 | this.onDrag = (props.onDrag)?props.onDrag:function(){}; 16 | this.onDown = (props.onDown)?props.onDown:function(){}; 17 | this.onMove = (props.onMove)?props.onMove:function(){}; 18 | this.onUp = (props.onUp)?props.onUp:function(){}; 19 | this.onMouseWheel = (props.onMouseWheel)?props.onMouseWheel:null; 20 | 21 | this.dragState = { 22 | x:0, 23 | y:0, 24 | startX:0, 25 | startY:0, 26 | startTime:0 27 | } 28 | 29 | // add functions to this, binded to scope 30 | this.onMouseDown = onMouseDown.bind(this); 31 | this.onMouseMove = onMouseMove.bind(this); 32 | this.onMouseUp = onMouseUp.bind(this); 33 | 34 | this.onTouchStart = onTouchStart.bind(this); 35 | this.onTouchMove = onTouchMove.bind(this); 36 | this.onTouchEnd = onTouchEnd.bind(this); 37 | 38 | this.down = down.bind(this); 39 | this.move = move.bind(this); 40 | this.keyDown = keyDown.bind(this); 41 | this.keyUp = keyUp.bind(this); 42 | this.up = up.bind(this); 43 | 44 | this.arrows = { 45 | up: false, 46 | down: false, 47 | left: false, 48 | right: false 49 | } 50 | 51 | // add new listeners 52 | addListeners.call(this); 53 | } 54 | 55 | Interaction.prototype.destroy = function(){ 56 | // add new listeners 57 | removeListeners.call(this); 58 | 59 | this.element = null; 60 | 61 | this.onStart = null; 62 | this.onDrag = null; 63 | this.onEnd = null; 64 | 65 | this.onMouseDown = null; 66 | this.onMouseMove = null; 67 | this.onMouseUp = null; 68 | this.onTouchStart = null; 69 | this.onTouchMove = null; 70 | this.onTouchEnd = null; 71 | this.down = null; 72 | this.move = null; 73 | this.up = null; 74 | }; 75 | 76 | function addListeners(){ 77 | this.element.addEventListener('mousedown', this.onMouseDown); 78 | this.element.addEventListener('touchstart', this.onTouchStart); 79 | this.element.addEventListener('keydown', this.keyDown); 80 | this.element.addEventListener('keyup', this.keyUp); 81 | 82 | if(this.onMouseWheel)this.element.addEventListener('wheel', this.onMouseWheel) 83 | } 84 | 85 | function removeListeners(){ 86 | this.element.removeEventListener('mousedown', this.onMouseDown); 87 | this.element.removeEventListener('touchstart', this.onTouchStart); 88 | this.element.removeEventListener('keydown', this.keyDown); 89 | this.element.removeEventListener('keyup', this.keyUp); 90 | 91 | // are drag listeners still in place? remove them 92 | if(this.mousedrag)removeMouseDrag.call(this); 93 | if(this.touchdrag)removeTouchDrag.call(this); 94 | if(this.onMouseWheel)this.element.removeEventListener('wheel', this.onMouseWheel) 95 | } 96 | 97 | /* -------------------- MOUSE LISTENERS -------------------- */ 98 | 99 | function onMouseDown(e){ 100 | 101 | e.preventDefault(); 102 | 103 | if(this.dragging)return; 104 | 105 | this.down(e.pageX, e.pageY); 106 | 107 | 108 | addMouseDrag.call(this); 109 | } 110 | 111 | function addMouseDrag(){ 112 | 113 | this.mousedrag = true; 114 | 115 | 116 | document.body.addEventListener('mousemove', this.onMouseMove); 117 | document.body.addEventListener('mouseup', this.onMouseUp); 118 | document.body.addEventListener('mouseleave', this.onMouseUp); 119 | // $(document.body).on('mouseleave', this.onMouseUp); 120 | } 121 | 122 | function removeMouseDrag(){ 123 | 124 | this.mousedrag = false; 125 | document.body.removeEventListener('mousemove', this.onMouseMove); 126 | document.body.removeEventListener('mouseup', this.onMouseUp); 127 | document.body.removeEventListener('mouseleave', this.onMouseUp); 128 | // $(document.body).off('mouseleave', this.onMouseUp); 129 | } 130 | 131 | function onMouseMove(e){ 132 | e.preventDefault(); 133 | 134 | this.move(e.pageX, e.pageY); 135 | 136 | } 137 | 138 | function onMouseUp(e){ 139 | e.preventDefault(); 140 | 141 | this.up(e.pageX, e.pageY); 142 | 143 | removeMouseDrag.call(this); 144 | } 145 | 146 | 147 | /* -------------------- TOUCH LISTENERS -------------------- */ 148 | 149 | function onTouchStart(e){ 150 | 151 | e.preventDefault(); 152 | if(this.dragging)return; 153 | 154 | var touch = e.touches[0]; 155 | this.down(touch.pageX, touch.pageY); 156 | 157 | addTouchDrag.call(this); 158 | 159 | // e.preventDefault(); 160 | } 161 | 162 | function addTouchDrag(e){ 163 | this.touchdrag = true; 164 | document.body.addEventListener('touchmove', this.onTouchMove, {passive:false}); 165 | document.body.addEventListener('touchend', this.onTouchEnd); 166 | } 167 | 168 | function removeTouchDrag(){ 169 | this.touchdrag = false; 170 | document.body.removeEventListener('touchmove', this.onTouchMove, {passive:false}); 171 | document.body.removeEventListener('touchend', this.onTouchEnd); 172 | } 173 | 174 | function onTouchMove(e){ 175 | e.preventDefault(); 176 | var touch = e.touches[0]; 177 | this.move(touch.pageX, touch.pageY); 178 | // e.preventDefault(); 179 | 180 | } 181 | 182 | function onTouchEnd(e){ 183 | e.preventDefault(); 184 | var touch = e.changedTouches[0]; 185 | this.up(touch.pageX, touch.pageY); 186 | 187 | removeTouchDrag.call(this); 188 | // e.preventDefault(); 189 | } 190 | 191 | /* -------------------- DRAG FUNCTIONALITY -------------------- */ 192 | 193 | function down(x, y){ 194 | this.moved = false; 195 | this.dragging = true; 196 | 197 | this.dragState.x = this.dragState.startX = x; 198 | this.dragState.y = this.dragState.startY = y; 199 | 200 | this.dragState.maxMove = 0; 201 | this.dragState.startTime = Date.now(); 202 | this.dragState.currTime = this.dragState.startTime; 203 | this.dragState.deltaTime = 0; 204 | // if(this.onStart)this.onStart(x,y); 205 | this.onDown(x,y); 206 | 207 | } 208 | 209 | function move(x, y){ 210 | this.moved = true; 211 | 212 | this.onDrag(x,y,x-this.dragState.x,y-this.dragState.y); 213 | 214 | var now = Date.now(); 215 | this.dragState.deltaTime = now-this.dragState.currTime; 216 | this.dragState.currTime = now; 217 | 218 | this.dragState.maxMove = Math.max(this.dragState.maxMove, Math.pow(this.dragState.startX-x, 2)+Math.pow(this.dragState.startY-y, 2)); 219 | 220 | this.dragState.x = x; 221 | this.dragState.y = y; 222 | } 223 | 224 | function up(x, y){ 225 | this.dragging = false; 226 | // if(this.onEnd)this.onEnd(x,y); 227 | this.onUp(x, y, {distance:this.dragState.maxMove, duration:Date.now()-this.dragState.startTime}); 228 | } 229 | 230 | /* -------------------- KEYBOARD FUNCTIONALITY -------------------- */ 231 | 232 | function keyDown(e){ 233 | e = e || window.event; 234 | 235 | if (e.keyCode == '38') { // up 236 | this.arrows.up = true; 237 | } else if (e.keyCode == '40') { // down 238 | this.arrows.down = true; 239 | } else if (e.keyCode == '37') { // left 240 | this.arrows.left = true; 241 | } else if (e.keyCode == '39') { // arrow 242 | this.arrows.right = true; 243 | } 244 | } 245 | 246 | function keyUp(e){ 247 | e = e || window.event; 248 | 249 | if (e.keyCode == '38') { // up 250 | this.arrows.up = false; 251 | } else if (e.keyCode == '40') { // down 252 | this.arrows.down = false; 253 | } else if (e.keyCode == '37') { // left 254 | this.arrows.left = false; 255 | } else if (e.keyCode == '39') { // arrow 256 | this.arrows.right = false; 257 | } 258 | } 259 | 260 | 261 | 262 | Interaction.prototype.addListeners = addListeners; 263 | Interaction.prototype.removeListeners = removeListeners; 264 | 265 | return Interaction; 266 | })(); 267 | 268 | export { Interaction }; -------------------------------------------------------------------------------- /8thWall/static/css/main.css: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * apply a natural box layout model to all elements 4 | * http://www.paulirish.com/2012/box-sizing-border-box-ftw/ 5 | */ 6 | * { 7 | box-sizing: border-box; 8 | } 9 | 10 | body { 11 | -ms-content-zooming: none; /* Disables zooming */ 12 | color: #FFFFFF; 13 | background: #000; 14 | font-family: sans-serif; 15 | font-weight: 400; 16 | letter-spacing: 1px; 17 | font-size: 10px; 18 | line-height: 1.5em; 19 | height: 100%; 20 | overflow: hidden; 21 | margin: 0px; 22 | padding: 0px; 23 | } 24 | 25 | @-ms-viewport { 26 | width: device-width; 27 | } -------------------------------------------------------------------------------- /8thWall/static/images/Sandbox_striped.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/8thWall/static/images/Sandbox_striped.jpg -------------------------------------------------------------------------------- /8thWall/static/images/albedo_NE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/8thWall/static/images/albedo_NE.jpg -------------------------------------------------------------------------------- /8thWall/static/images/albedo_NW.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/8thWall/static/images/albedo_NW.jpg -------------------------------------------------------------------------------- /8thWall/static/images/albedo_SE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/8thWall/static/images/albedo_SE.jpg -------------------------------------------------------------------------------- /8thWall/static/images/albedo_SW.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/8thWall/static/images/albedo_SW.jpg -------------------------------------------------------------------------------- /8thWall/static/images/alphaMask.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/8thWall/static/images/alphaMask.jpg -------------------------------------------------------------------------------- /8thWall/static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Dune Buggy AR 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 40 | 41 | 42 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /8thWall/static/models/duneBuggy.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/8thWall/static/models/duneBuggy.glb -------------------------------------------------------------------------------- /8thWall/static/models/frame_outerOccluder.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.80 (sub 75) OBJ File: 'frame.blend' 2 | # www.blender.org 3 | mtllib frame_outerOccluder.mtl 4 | o Cube.001 5 | v -14.179630 0.000000 -14.179630 6 | v -14.179630 0.000000 14.179630 7 | v 14.179630 0.000000 -14.179630 8 | v 14.179630 0.000000 14.179630 9 | v -18.433521 0.000000 -18.433521 10 | v -18.433521 0.000000 18.433521 11 | v 18.433521 0.000000 -18.433521 12 | v 18.433521 0.000000 18.433521 13 | v -18.433521 -49.538773 -18.433521 14 | v -18.433521 -49.538773 18.433521 15 | v 18.433521 -49.538773 -18.433521 16 | v 18.433521 -49.538773 18.433521 17 | vt 0.000000 0.000000 18 | vt 0.000000 0.000000 19 | vt 0.000000 0.000000 20 | vt 0.000000 0.000000 21 | vt 0.000000 0.000000 22 | vt 0.000000 0.000000 23 | vt 0.000000 0.000000 24 | vt 0.000000 0.000000 25 | vt 0.000000 0.000000 26 | vt 0.000000 0.000000 27 | vt 0.000000 0.000000 28 | vt 0.000000 0.000000 29 | vn 0.0000 1.0000 0.0000 30 | vn 0.0000 0.0000 1.0000 31 | vn -1.0000 0.0000 0.0000 32 | vn 1.0000 0.0000 0.0000 33 | vn 0.0000 0.0000 -1.0000 34 | vn 0.0000 -1.0000 0.0000 35 | usemtl Material 36 | s off 37 | f 4/1/1 2/2/1 6/3/1 8/4/1 38 | f 2/2/1 1/5/1 5/6/1 6/3/1 39 | f 3/7/1 4/1/1 8/4/1 7/8/1 40 | f 1/5/1 3/7/1 7/8/1 5/6/1 41 | f 8/4/2 6/3/2 10/9/2 12/10/2 42 | f 6/3/3 5/6/3 9/11/3 10/9/3 43 | f 7/8/4 8/4/4 12/10/4 11/12/4 44 | f 5/6/5 7/8/5 11/12/5 9/11/5 45 | f 9/11/6 11/12/6 12/10/6 10/9/6 46 | -------------------------------------------------------------------------------- /8thWall/webpack.config.js: -------------------------------------------------------------------------------- 1 | function buildConfig (env) { 2 | 3 | let file; 4 | if (env.development) { 5 | file = 'dev'; 6 | } else if (env.production) { 7 | file = 'prod'; 8 | } else { 9 | throw new Error('You must set environment to either development or production in webpack call. e.g. webpack --env.production'); 10 | } 11 | 12 | return require('./config/webpack.config.' + file + '.js'); 13 | } 14 | 15 | module.exports = env => buildConfig(env); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![alt text][logo] 2 | 3 | [logo]: https://github.com/Oblioio/DuneBuggyAR/raw/master/web/static/images/og.jpg "Dune Buggy AR Logo" 4 | 5 | # DuneBuggyAR 6 | 7 | A cross platform digital AR Toy. This project started as a quick demo for Lens Studio and experienced massive scope creep as we kept porting to other platforms. WARNING: some of the projects are a thrown together in a messy way. If we were to do it again we would change a ton of stuff. With that said. It's free! Take it, extend it, make a commercial project... whatever you feel like doing. If along the way you clean up our project structures please submit a pull request and we'll update the repo for everyone to enjoy. 8 | 9 | # Project setup 10 | 11 | `npm install` will install the required dependencies 12 | 13 | `npm run watch` will compile all of the shared code within the `shared` folder and will write `shared.js` within each separate project folder. 14 | 15 | Each individual project may have their own sets of dependencies which can be install inside of their subdirectory. 16 | -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/duneBuggy 2/Materials/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/duneBuggy 2/Materials/folder.lock -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/frame_outerOccluder/Materials/Material.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/frame_outerOccluder/Materials/Material.lsmat -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/frame_outerOccluder/Materials/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/frame_outerOccluder/Materials/folder.lock -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/sandbox/Materials/Material.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/sandbox/Materials/Material.lsmat -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/sandbox/Materials/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/sandbox/Materials/folder.lock -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/terrain_NE/Materials/Material.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/terrain_NE/Materials/Material.lsmat -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/terrain_NE/Materials/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/terrain_NE/Materials/folder.lock -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/terrain_NW/Materials/Material.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/terrain_NW/Materials/Material.lsmat -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/terrain_NW/Materials/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/terrain_NW/Materials/folder.lock -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/terrain_SE/Materials/Material.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/terrain_SE/Materials/Material.lsmat -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/terrain_SE/Materials/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/terrain_SE/Materials/folder.lock -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/terrain_SW/Materials/Material.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/terrain_SW/Materials/Material.lsmat -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/terrain_SW/Materials/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/terrain_SW/Materials/folder.lock -------------------------------------------------------------------------------- /lensStudio/AdditionalFiles/unitCube/Materials/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/AdditionalFiles/unitCube/Materials/folder.lock -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/0.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/0.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/1.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/1.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/2.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/2.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/3.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/3.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/4.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/4.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/5.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/5.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/6.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/6.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/7.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/7.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/8.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/8.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/9.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/9.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/A_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/A_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/B_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/B_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/C_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/C_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/D_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/D_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/E_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/E_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/F_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/F_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/G_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/G_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/H_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/H_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/I_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/I_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/J_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/J_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/K_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/K_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/L_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/L_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/M_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/M_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/N_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/N_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/O_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/O_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/P_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/P_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/Q_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/Q_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/R_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/R_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/S_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/S_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/T_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/T_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/U_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/U_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/V_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/V_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/W_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/W_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/X_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/X_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/Y_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/Y_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/Z_upper.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/Z_upper.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_10.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_10.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_11.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_11.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_12.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_12.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_123.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_123.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_124.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_124.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_125.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_125.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_126.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_126.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_13.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_13.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_32.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_32.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_33.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_33.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_34.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_34.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_35.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_35.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_36.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_36.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_37.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_37.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_38.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_38.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_39.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_39.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_40.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_40.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_41.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_41.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_42.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_42.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_43.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_43.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_44.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_44.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_45.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_45.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_46.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_46.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_47.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_47.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_58.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_58.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_59.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_59.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_60.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_60.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_61.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_61.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_62.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_62.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_63.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_63.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_64.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_64.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_9.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_9.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_91.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_91.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_92.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_92.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_93.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_93.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_94.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_94.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_95.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_95.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_96.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/_chr_96.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/Meshes/folder.lock -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/LetterMeshes/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/LetterMeshes/folder.lock -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/TextLogger.js: -------------------------------------------------------------------------------- 1 | // ----- USAGE ----- 2 | // To log text to the screen, use: 3 | // global.logToScreen(text); 4 | // or: 5 | // global.textLogger.addLog(text); 6 | // 7 | // To clear the text log, use: 8 | // global.textLogger.clear(); 9 | // 10 | // To change the log limit, use: 11 | // global.textLogger.setLogLimit(limit); 12 | // 13 | // To change the text color, use: 14 | // global.textLogger.setTextColor(colorRGBA); 15 | // 16 | // To enable or disable logging, use: 17 | // global.textLogger.setLoggingEnabled(limit); 18 | // ----------------- 19 | 20 | var TEXT_LOG_POS_HEIGHT_MOD = .6; 21 | var TEXT_LOG_CHAR_SCALE = 1.0 / 200.0; 22 | var TEXT_LOG_CAM_DIST = 1.0; 23 | 24 | if(global.textLogger == null){ 25 | 26 | var newObject = function(name) { 27 | return global.scene.createSceneObject(name); 28 | } 29 | 30 | global.wordWrap = function (str, intWidth, strBreak, cut) { 31 | intWidth = arguments.length >= 2 ? +intWidth : 75 32 | strBreak = arguments.length >= 3 ? '' + strBreak : '\n' 33 | cut = arguments.length >= 4 ? !!cut : false 34 | var i, j, line 35 | str += '' 36 | if (intWidth < 1) { return str } 37 | var reLineBreaks = /\r\n|\n|\r/ 38 | var reBeginningUntilFirstWhitespace = /^\S*/ 39 | var reLastCharsWithOptionalTrailingWhitespace = /\S*(\s)?$/ 40 | var lines = str.split(reLineBreaks) 41 | var l = lines.length 42 | var match 43 | for (i = 0; i < l; lines[i++] += line) { 44 | line = lines[i] 45 | lines[i] = '' 46 | while (line.length > intWidth) { 47 | var slice = line.slice(0, intWidth + 1) 48 | var ltrim = 0 49 | var rtrim = 0 50 | match = slice.match(reLastCharsWithOptionalTrailingWhitespace) 51 | if (match[1]) { 52 | j = intWidth 53 | ltrim = 1 54 | } else { 55 | j = slice.length - match[0].length 56 | if (j) { rtrim = 1 } 57 | if (!j && cut && intWidth){ j=intWidth } 58 | if (!j) { 59 | var charsUntilNextWhitespace = (line.slice(intWidth).match(reBeginningUntilFirstWhitespace) || [''])[0] 60 | j = slice.length + charsUntilNextWhitespace.length 61 | } 62 | } 63 | lines[i] += line.slice(0, j - rtrim) 64 | line = line.slice(j + ltrim) 65 | lines[i] += line.length ? strBreak : '' 66 | } 67 | } 68 | return lines.join('\n') 69 | } 70 | 71 | global.letterMeshCreator = (function(){ 72 | 73 | var _textMaterial = script.textMaterial; 74 | 75 | var _disabledRootPool = []; 76 | var _disabledLetterPool = []; 77 | 78 | var getAvailableRootObject = function(name){ 79 | if(_disabledRootPool.length > 0){ 80 | var obj = _disabledRootPool.pop(); 81 | obj.enabled = true; 82 | return obj; 83 | } 84 | 85 | var obj = newObject(name); 86 | return obj; 87 | } 88 | 89 | var removeRootObject = function(obj){ 90 | obj.enabled = false; 91 | obj.setParent(script.getSceneObject()); 92 | _disabledRootPool.push(obj); 93 | } 94 | 95 | var getAvailableLetterObject = function(){ 96 | if(_disabledLetterPool.length > 0){ 97 | var obj = _disabledLetterPool.pop(); 98 | obj.enabled = true; 99 | return obj; 100 | } 101 | 102 | var obj = newObject("letter"); 103 | obj.getTransform().setLocalScale(vec3.one().uniformScale(10)) 104 | 105 | var mesh = obj.createComponent("Component.MeshVisual"); 106 | mesh.addMaterial(_textMaterial); 107 | 108 | return obj; 109 | } 110 | 111 | var removeLetterObject = function(obj){ 112 | obj.enabled = false; 113 | obj.setParent(script.getSceneObject()); 114 | _disabledLetterPool.push(obj); 115 | } 116 | 117 | var recursiveRemove = function(obj){ 118 | while(obj.getChildrenCount() > 0){ 119 | recursiveRemove(obj.getChild(0)); 120 | } 121 | removeLetterObject(obj); 122 | } 123 | 124 | var removeTextObj = function(obj){ 125 | while(obj.getChildrenCount() > 0){ 126 | recursiveRemove(obj.getChild(0)); 127 | } 128 | removeRootObject(obj); 129 | } 130 | 131 | var makeLetterObj = function(letter, parent) { 132 | var cubeObj = getAvailableLetterObject(); 133 | 134 | if(parent != null){ 135 | cubeObj.setParent(parent); 136 | } 137 | 138 | var meshVisual = cubeObj.getFirstComponent("Component.MeshVisual"); 139 | 140 | var renderMesh = script.getCharMesh(letter); 141 | if(!!renderMesh){ 142 | meshVisual.enabled = true; 143 | meshVisual.mesh = renderMesh; 144 | } 145 | else{ 146 | meshVisual.enabled = false; 147 | } 148 | 149 | return cubeObj; 150 | } 151 | 152 | var makeTextObj = function(text, pos, parent, maxWidth){ 153 | var rootObj = getAvailableRootObject("text_"+text); 154 | 155 | if(parent != null){ 156 | rootObj.setParent(parent); 157 | } 158 | 159 | var letterOffset = new vec2(6, 12); 160 | var spaceOffset = letterOffset.x; 161 | // var pos = new vec3(0,0); 162 | 163 | var charsWidth = maxWidth / letterOffset.x; 164 | 165 | text = global.wordWrap(text, charsWidth); 166 | 167 | for(var i = 0; i < text.length; i++){ 168 | var chr = text.charAt(i); 169 | if(chr == '\n'){ 170 | pos.x = 0; 171 | pos.y -= letterOffset.y; 172 | } 173 | else if(chr == ' '){ 174 | pos.x += spaceOffset; 175 | } 176 | else{ 177 | var letter = makeLetterObj(chr, rootObj); 178 | letter.getTransform().setLocalPosition(pos); 179 | pos.x += letterOffset.x; 180 | } 181 | } 182 | return [rootObj, pos]; 183 | } 184 | 185 | var setTextColor = function(color){ 186 | _textMaterial.mainPass.baseColor = color; 187 | } 188 | 189 | return { 190 | makeLetterObj : makeLetterObj, 191 | makeTextObj : makeTextObj, 192 | removeTextObj : removeTextObj, 193 | setTextColor : setTextColor, 194 | }; 195 | }()); 196 | 197 | global.textLogger = (function(){ 198 | 199 | var _camera = script.camera; 200 | 201 | var _root = newObject("textLog"); 202 | var _holderRoot = newObject("textHolder"); 203 | 204 | var _pos = new vec3(0,0,0); 205 | var _maxWidth = null; 206 | 207 | var _lastFovOnResize = -1; 208 | 209 | var _logLimit = script.logLimit; 210 | var _logs = []; 211 | 212 | var _loggingEnabled = script.loggingEnabled; 213 | 214 | var init = function() { 215 | if(_camera == null){ 216 | _camera = findComponentRecursive("Component.Camera", null); 217 | } 218 | _root.setParent(_camera.getSceneObject()); 219 | 220 | resizeRootObject(); 221 | 222 | _holderRoot.setParent(_root); 223 | _holderRoot.getTransform().setLocalPosition(new vec3(0,0,0)); 224 | _holderRoot.getTransform().setLocalScale(new vec3(1,1,1)); 225 | 226 | script.createEvent("UpdateEvent").bind(onUpdate); 227 | 228 | setTextColor(script.textColor); 229 | }; 230 | 231 | var findComponentRecursive = function(componentType, obj){ 232 | if(obj == null){ 233 | for(var i=0;i 0){ 242 | return obj.getFirstComponent(componentType); 243 | } 244 | for(var i=0;i 0){ 276 | var logs = []; 277 | for(var i=0;i" + text + "\n", _pos, _holderRoot, _maxWidth); 305 | _pos = ret[1]; 306 | _pos.x = 0; 307 | 308 | setHolderYPos(-_pos.y); 309 | 310 | var config = { 311 | 'text': text, 312 | 'sceneObject': ret[0], 313 | }; 314 | _logs.push(config); 315 | 316 | removeExcessLogs(); 317 | }; 318 | 319 | var getLogConfig = function(index){ 320 | return _logs[index]; 321 | } 322 | 323 | var getLogText = function(index){ 324 | return getLogConfig(index).text; 325 | } 326 | 327 | var getLogObject = function(index){ 328 | return getLogConfig(index).sceneObject; 329 | } 330 | 331 | var removeLog = function(index){ 332 | var obj = getLogObject(index); 333 | global.letterMeshCreator.removeTextObj(obj); 334 | _logs.splice(index,1) 335 | } 336 | 337 | var getLogCount = function(){ 338 | return _logs.length; 339 | } 340 | 341 | var clear = function(){ 342 | while(getLogCount() > 0){ 343 | removeLog(0); 344 | } 345 | _pos.x = 0; 346 | _pos.y = 0; 347 | setHolderYPos(0); 348 | }; 349 | 350 | var removeExcessLogs = function(){ 351 | if(_logLimit >= 0){ 352 | for(var i=getLogCount(); i>_logLimit; i--){ 353 | removeLog(0); 354 | } 355 | } 356 | }; 357 | 358 | var setLogLimit = function(limit){ 359 | if(limit !== _logLimit){ 360 | _logLimit = limit; 361 | removeExcessLogs(); 362 | } 363 | }; 364 | 365 | var setTextColor = function(color){ 366 | global.letterMeshCreator.setTextColor(color); 367 | } 368 | 369 | var setLoggingEnabled = function(enabled){ 370 | _loggingEnabled = enabled; 371 | } 372 | 373 | var onUpdate = function() { 374 | if(_lastFovOnResize != _camera.fov) { 375 | resizeRootObject(); 376 | } 377 | }; 378 | 379 | init(); 380 | 381 | return { 382 | addLog : addLog, 383 | clear : clear, 384 | setLogLimit : setLogLimit, 385 | setTextColor : setTextColor, 386 | setLoggingEnabled : setLoggingEnabled, 387 | }; 388 | }()); 389 | 390 | global.logToScreen = global.textLogger.addLog; 391 | } 392 | 393 | 394 | 395 | -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/TextLoggerInput.js: -------------------------------------------------------------------------------- 1 | //@ui {"widget":"group_start", "label":"TextLogger"} 2 | 3 | //@input bool loggingEnabled = true {"hint":"Turn this off to easily stop logs from being displayed"} 4 | //@input vec4 textColor = {0,1,0,1} {"widget":"color"} 5 | //@input int logLimit = 4 {"hint":"The max number of logs that can appear onscreen at a time"} 6 | //@input Asset.Material textMaterial {"hint":"The material used for displaying text."} 7 | //@input Component.Camera camera {"label":"Camera(optional)", "hint":"The camera used for text placement. If left blank, the first camera found in a hierarchy search will be used."} 8 | 9 | //@ui {"widget":"group_start", "label":"Mesh Assets"} 10 | //@input Asset.RenderMesh mesh_A_upper 11 | //@input Asset.RenderMesh mesh_B_upper 12 | //@input Asset.RenderMesh mesh_C_upper 13 | //@input Asset.RenderMesh mesh_D_upper 14 | //@input Asset.RenderMesh mesh_E_upper 15 | //@input Asset.RenderMesh mesh_F_upper 16 | //@input Asset.RenderMesh mesh_G_upper 17 | //@input Asset.RenderMesh mesh_H_upper 18 | //@input Asset.RenderMesh mesh_I_upper 19 | //@input Asset.RenderMesh mesh_J_upper 20 | //@input Asset.RenderMesh mesh_K_upper 21 | //@input Asset.RenderMesh mesh_L_upper 22 | //@input Asset.RenderMesh mesh_M_upper 23 | //@input Asset.RenderMesh mesh_N_upper 24 | //@input Asset.RenderMesh mesh_O_upper 25 | //@input Asset.RenderMesh mesh_P_upper 26 | //@input Asset.RenderMesh mesh_Q_upper 27 | //@input Asset.RenderMesh mesh_R_upper 28 | //@input Asset.RenderMesh mesh_S_upper 29 | //@input Asset.RenderMesh mesh_T_upper 30 | //@input Asset.RenderMesh mesh_U_upper 31 | //@input Asset.RenderMesh mesh_V_upper 32 | //@input Asset.RenderMesh mesh_W_upper 33 | //@input Asset.RenderMesh mesh_X_upper 34 | //@input Asset.RenderMesh mesh_Y_upper 35 | //@input Asset.RenderMesh mesh_Z_upper 36 | //@input Asset.RenderMesh mesh_0 37 | //@input Asset.RenderMesh mesh_1 38 | //@input Asset.RenderMesh mesh_2 39 | //@input Asset.RenderMesh mesh_3 40 | //@input Asset.RenderMesh mesh_4 41 | //@input Asset.RenderMesh mesh_5 42 | //@input Asset.RenderMesh mesh_6 43 | //@input Asset.RenderMesh mesh_7 44 | //@input Asset.RenderMesh mesh_8 45 | //@input Asset.RenderMesh mesh_9 46 | //@input Asset.RenderMesh mesh__chr_33 47 | //@input Asset.RenderMesh mesh__chr_34 48 | //@input Asset.RenderMesh mesh__chr_35 49 | //@input Asset.RenderMesh mesh__chr_36 50 | //@input Asset.RenderMesh mesh__chr_37 51 | //@input Asset.RenderMesh mesh__chr_38 52 | //@input Asset.RenderMesh mesh__chr_39 53 | //@input Asset.RenderMesh mesh__chr_40 54 | //@input Asset.RenderMesh mesh__chr_41 55 | //@input Asset.RenderMesh mesh__chr_42 56 | //@input Asset.RenderMesh mesh__chr_43 57 | //@input Asset.RenderMesh mesh__chr_44 58 | //@input Asset.RenderMesh mesh__chr_45 59 | //@input Asset.RenderMesh mesh__chr_46 60 | //@input Asset.RenderMesh mesh__chr_47 61 | //@input Asset.RenderMesh mesh__chr_58 62 | //@input Asset.RenderMesh mesh__chr_59 63 | //@input Asset.RenderMesh mesh__chr_60 64 | //@input Asset.RenderMesh mesh__chr_61 65 | //@input Asset.RenderMesh mesh__chr_62 66 | //@input Asset.RenderMesh mesh__chr_63 67 | //@input Asset.RenderMesh mesh__chr_64 68 | //@input Asset.RenderMesh mesh__chr_91 69 | //@input Asset.RenderMesh mesh__chr_92 70 | //@input Asset.RenderMesh mesh__chr_93 71 | //@input Asset.RenderMesh mesh__chr_94 72 | //@input Asset.RenderMesh mesh__chr_95 73 | //@input Asset.RenderMesh mesh__chr_96 74 | //@input Asset.RenderMesh mesh__chr_123 75 | //@input Asset.RenderMesh mesh__chr_124 76 | //@input Asset.RenderMesh mesh__chr_125 77 | //@input Asset.RenderMesh mesh__chr_126 78 | //@input Asset.RenderMesh mesh__chr_9 79 | //@input Asset.RenderMesh mesh__chr_10 80 | //@input Asset.RenderMesh mesh__chr_11 81 | //@input Asset.RenderMesh mesh__chr_12 82 | //@input Asset.RenderMesh mesh__chr_13 83 | //@input Asset.RenderMesh mesh__chr_32 84 | //@ui {"widget":"group_end"} 85 | //@ui {"widget":"group_end"} 86 | 87 | 88 | script._charLookup = { 89 | 'A': { mesh:script.mesh_A_upper, size: [0.634765625, 1.259765625]}, 90 | 'B': { mesh:script.mesh_B_upper, size: [0.634765625, 1.259765625]}, 91 | 'C': { mesh:script.mesh_C_upper, size: [0.634765625, 1.259765625]}, 92 | 'D': { mesh:script.mesh_D_upper, size: [0.634765625, 1.259765625]}, 93 | 'E': { mesh:script.mesh_E_upper, size: [0.634765625, 1.259765625]}, 94 | 'F': { mesh:script.mesh_F_upper, size: [0.634765625, 1.259765625]}, 95 | 'G': { mesh:script.mesh_G_upper, size: [0.634765625, 1.259765625]}, 96 | 'H': { mesh:script.mesh_H_upper, size: [0.634765625, 1.259765625]}, 97 | 'I': { mesh:script.mesh_I_upper, size: [0.634765625, 1.259765625]}, 98 | 'J': { mesh:script.mesh_J_upper, size: [0.634765625, 1.259765625]}, 99 | 'K': { mesh:script.mesh_K_upper, size: [0.634765625, 1.259765625]}, 100 | 'L': { mesh:script.mesh_L_upper, size: [0.634765625, 1.259765625]}, 101 | 'M': { mesh:script.mesh_M_upper, size: [0.634765625, 1.259765625]}, 102 | 'N': { mesh:script.mesh_N_upper, size: [0.634765625, 1.259765625]}, 103 | 'O': { mesh:script.mesh_O_upper, size: [0.634765625, 1.259765625]}, 104 | 'P': { mesh:script.mesh_P_upper, size: [0.634765625, 1.259765625]}, 105 | 'Q': { mesh:script.mesh_Q_upper, size: [0.634765625, 1.259765625]}, 106 | 'R': { mesh:script.mesh_R_upper, size: [0.634765625, 1.259765625]}, 107 | 'S': { mesh:script.mesh_S_upper, size: [0.634765625, 1.259765625]}, 108 | 'T': { mesh:script.mesh_T_upper, size: [0.634765625, 1.259765625]}, 109 | 'U': { mesh:script.mesh_U_upper, size: [0.634765625, 1.259765625]}, 110 | 'V': { mesh:script.mesh_V_upper, size: [0.634765625, 1.259765625]}, 111 | 'W': { mesh:script.mesh_W_upper, size: [0.634765625, 1.259765625]}, 112 | 'X': { mesh:script.mesh_X_upper, size: [0.634765625, 1.259765625]}, 113 | 'Y': { mesh:script.mesh_Y_upper, size: [0.634765625, 1.259765625]}, 114 | 'Z': { mesh:script.mesh_Z_upper, size: [0.634765625, 1.259765625]}, 115 | '0': { mesh:script.mesh_0, size: [0.634765625, 1.259765625]}, 116 | '1': { mesh:script.mesh_1, size: [0.634765625, 1.259765625]}, 117 | '2': { mesh:script.mesh_2, size: [0.634765625, 1.259765625]}, 118 | '3': { mesh:script.mesh_3, size: [0.634765625, 1.259765625]}, 119 | '4': { mesh:script.mesh_4, size: [0.634765625, 1.259765625]}, 120 | '5': { mesh:script.mesh_5, size: [0.634765625, 1.259765625]}, 121 | '6': { mesh:script.mesh_6, size: [0.634765625, 1.259765625]}, 122 | '7': { mesh:script.mesh_7, size: [0.634765625, 1.259765625]}, 123 | '8': { mesh:script.mesh_8, size: [0.634765625, 1.259765625]}, 124 | '9': { mesh:script.mesh_9, size: [0.634765625, 1.259765625]}, 125 | '!': { mesh:script.mesh__chr_33, size: [0.634765625, 1.259765625]}, 126 | '"': { mesh:script.mesh__chr_34, size: [0.634765625, 1.259765625]}, 127 | '#': { mesh:script.mesh__chr_35, size: [0.634765625, 1.259765625]}, 128 | '$': { mesh:script.mesh__chr_36, size: [0.634765625, 1.259765625]}, 129 | '%': { mesh:script.mesh__chr_37, size: [0.634765625, 1.259765625]}, 130 | '&': { mesh:script.mesh__chr_38, size: [0.634765625, 1.259765625]}, 131 | "'": { mesh:script.mesh__chr_39, size: [0.634765625, 1.259765625]}, 132 | '(': { mesh:script.mesh__chr_40, size: [0.634765625, 1.259765625]}, 133 | ')': { mesh:script.mesh__chr_41, size: [0.634765625, 1.259765625]}, 134 | '*': { mesh:script.mesh__chr_42, size: [0.634765625, 1.259765625]}, 135 | '+': { mesh:script.mesh__chr_43, size: [0.634765625, 1.259765625]}, 136 | ',': { mesh:script.mesh__chr_44, size: [0.634765625, 1.259765625]}, 137 | '-': { mesh:script.mesh__chr_45, size: [0.634765625, 1.259765625]}, 138 | '.': { mesh:script.mesh__chr_46, size: [0.634765625, 1.259765625]}, 139 | '/': { mesh:script.mesh__chr_47, size: [0.634765625, 1.259765625]}, 140 | ':': { mesh:script.mesh__chr_58, size: [0.634765625, 1.259765625]}, 141 | ';': { mesh:script.mesh__chr_59, size: [0.634765625, 1.259765625]}, 142 | '<': { mesh:script.mesh__chr_60, size: [0.634765625, 1.259765625]}, 143 | '=': { mesh:script.mesh__chr_61, size: [0.634765625, 1.259765625]}, 144 | '>': { mesh:script.mesh__chr_62, size: [0.634765625, 1.259765625]}, 145 | '?': { mesh:script.mesh__chr_63, size: [0.634765625, 1.259765625]}, 146 | '@': { mesh:script.mesh__chr_64, size: [0.634765625, 1.259765625]}, 147 | '[': { mesh:script.mesh__chr_91, size: [0.634765625, 1.259765625]}, 148 | '\\': { mesh:script.mesh__chr_92, size: [0.634765625, 1.259765625]}, 149 | ']': { mesh:script.mesh__chr_93, size: [0.634765625, 1.259765625]}, 150 | '^': { mesh:script.mesh__chr_94, size: [0.634765625, 1.259765625]}, 151 | '_': { mesh:script.mesh__chr_95, size: [0.634765625, 1.259765625]}, 152 | '`': { mesh:script.mesh__chr_96, size: [0.634765625, 1.259765625]}, 153 | '{': { mesh:script.mesh__chr_123, size: [0.634765625, 1.259765625]}, 154 | '|': { mesh:script.mesh__chr_124, size: [0.634765625, 1.259765625]}, 155 | '}': { mesh:script.mesh__chr_125, size: [0.634765625, 1.259765625]}, 156 | '~': { mesh:script.mesh__chr_126, size: [0.634765625, 1.259765625]}, 157 | '\t': { mesh:script.mesh__chr_9, size: [0.634765625, 1.259765625]}, 158 | '\n': { mesh:script.mesh__chr_10, size: [0.634765625, 1.259765625]}, 159 | '\x0b': { mesh:script.mesh__chr_11, size: [0.634765625, 1.259765625]}, 160 | '\x0c': { mesh:script.mesh__chr_12, size: [0.634765625, 1.259765625]}, 161 | '\r': { mesh:script.mesh__chr_13, size: [0.634765625, 1.259765625]}, 162 | ' ': { mesh:script.mesh__chr_32, size: [0.634765625, 1.259765625]}, 163 | 'a': { mesh:script.mesh_A_upper, size: [0.634765625, 1.259765625]}, 164 | 'b': { mesh:script.mesh_B_upper, size: [0.634765625, 1.259765625]}, 165 | 'c': { mesh:script.mesh_C_upper, size: [0.634765625, 1.259765625]}, 166 | 'd': { mesh:script.mesh_D_upper, size: [0.634765625, 1.259765625]}, 167 | 'e': { mesh:script.mesh_E_upper, size: [0.634765625, 1.259765625]}, 168 | 'f': { mesh:script.mesh_F_upper, size: [0.634765625, 1.259765625]}, 169 | 'g': { mesh:script.mesh_G_upper, size: [0.634765625, 1.259765625]}, 170 | 'h': { mesh:script.mesh_H_upper, size: [0.634765625, 1.259765625]}, 171 | 'i': { mesh:script.mesh_I_upper, size: [0.634765625, 1.259765625]}, 172 | 'j': { mesh:script.mesh_J_upper, size: [0.634765625, 1.259765625]}, 173 | 'k': { mesh:script.mesh_K_upper, size: [0.634765625, 1.259765625]}, 174 | 'l': { mesh:script.mesh_L_upper, size: [0.634765625, 1.259765625]}, 175 | 'm': { mesh:script.mesh_M_upper, size: [0.634765625, 1.259765625]}, 176 | 'n': { mesh:script.mesh_N_upper, size: [0.634765625, 1.259765625]}, 177 | 'o': { mesh:script.mesh_O_upper, size: [0.634765625, 1.259765625]}, 178 | 'p': { mesh:script.mesh_P_upper, size: [0.634765625, 1.259765625]}, 179 | 'q': { mesh:script.mesh_Q_upper, size: [0.634765625, 1.259765625]}, 180 | 'r': { mesh:script.mesh_R_upper, size: [0.634765625, 1.259765625]}, 181 | 's': { mesh:script.mesh_S_upper, size: [0.634765625, 1.259765625]}, 182 | 't': { mesh:script.mesh_T_upper, size: [0.634765625, 1.259765625]}, 183 | 'u': { mesh:script.mesh_U_upper, size: [0.634765625, 1.259765625]}, 184 | 'v': { mesh:script.mesh_V_upper, size: [0.634765625, 1.259765625]}, 185 | 'w': { mesh:script.mesh_W_upper, size: [0.634765625, 1.259765625]}, 186 | 'x': { mesh:script.mesh_X_upper, size: [0.634765625, 1.259765625]}, 187 | 'y': { mesh:script.mesh_Y_upper, size: [0.634765625, 1.259765625]}, 188 | 'z': { mesh:script.mesh_Z_upper, size: [0.634765625, 1.259765625]}, 189 | }; 190 | 191 | 192 | script.getCharConfig = function(char){ 193 | return script._charLookup[char]; 194 | } 195 | 196 | script.getCharMesh = function(char){ 197 | var config = script.getCharConfig(char); 198 | if(!config){ return null; } 199 | return config.mesh; 200 | } 201 | 202 | script.getCharSize = function(char){ 203 | var config = script.getCharConfig(char); 204 | if(!config){ return null; } 205 | return config.size; 206 | } 207 | -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/folder.lock -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/font_mat.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/font_mat.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Log_To_Screen/font_sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Log_To_Screen/font_sheet.png -------------------------------------------------------------------------------- /lensStudio/Public/Materials/Darken.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/Darken.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/ManipulateMeshInvisible.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/ManipulateMeshInvisible.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/Occluder.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/Occluder.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/SandBox_Unlit.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/SandBox_Unlit.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/TerrainDiffuse.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/TerrainDiffuse.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/TerrainDiffuse_NE.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/TerrainDiffuse_NE.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/TerrainDiffuse_NW.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/TerrainDiffuse_NW.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/TerrainDiffuse_SE.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/TerrainDiffuse_SE.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/TerrainDiffuse_SW.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/TerrainDiffuse_SW.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/VertexColor.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/VertexColor.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/folder.lock -------------------------------------------------------------------------------- /lensStudio/Public/Materials/ground_grid.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/ground_grid.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Materials/touch_collision.lsmat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Materials/touch_collision.lsmat -------------------------------------------------------------------------------- /lensStudio/Public/Meshes/duneBuggy 2.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Meshes/duneBuggy 2.glb -------------------------------------------------------------------------------- /lensStudio/Public/Meshes/duneBuggy.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Meshes/duneBuggy.glb -------------------------------------------------------------------------------- /lensStudio/Public/Meshes/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Meshes/folder.lock -------------------------------------------------------------------------------- /lensStudio/Public/Meshes/frame_outerOccluder.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.80 (sub 75) OBJ File: 'frame.blend' 2 | # www.blender.org 3 | mtllib frame_outerOccluder.mtl 4 | o Cube.001 5 | v -14.179630 0.000000 -14.179630 6 | v -14.179630 0.000000 14.179630 7 | v 14.179630 0.000000 -14.179630 8 | v 14.179630 0.000000 14.179630 9 | v -18.433521 0.000000 -18.433521 10 | v -18.433521 0.000000 18.433521 11 | v 18.433521 0.000000 -18.433521 12 | v 18.433521 0.000000 18.433521 13 | v -18.433521 -49.538773 -18.433521 14 | v -18.433521 -49.538773 18.433521 15 | v 18.433521 -49.538773 -18.433521 16 | v 18.433521 -49.538773 18.433521 17 | vt 0.000000 0.000000 18 | vt 0.000000 0.000000 19 | vt 0.000000 0.000000 20 | vt 0.000000 0.000000 21 | vt 0.000000 0.000000 22 | vt 0.000000 0.000000 23 | vt 0.000000 0.000000 24 | vt 0.000000 0.000000 25 | vt 0.000000 0.000000 26 | vt 0.000000 0.000000 27 | vt 0.000000 0.000000 28 | vt 0.000000 0.000000 29 | vn 0.0000 1.0000 0.0000 30 | vn 0.0000 0.0000 1.0000 31 | vn -1.0000 0.0000 0.0000 32 | vn 1.0000 0.0000 0.0000 33 | vn 0.0000 0.0000 -1.0000 34 | vn 0.0000 -1.0000 0.0000 35 | usemtl Material 36 | s off 37 | f 4/1/1 2/2/1 6/3/1 8/4/1 38 | f 2/2/1 1/5/1 5/6/1 6/3/1 39 | f 3/7/1 4/1/1 8/4/1 7/8/1 40 | f 1/5/1 3/7/1 7/8/1 5/6/1 41 | f 8/4/2 6/3/2 10/9/2 12/10/2 42 | f 6/3/3 5/6/3 9/11/3 10/9/3 43 | f 7/8/4 8/4/4 12/10/4 11/12/4 44 | f 5/6/5 7/8/5 11/12/5 9/11/5 45 | f 9/11/6 11/12/6 12/10/6 10/9/6 46 | -------------------------------------------------------------------------------- /lensStudio/Public/Meshes/ground_grid_mesh.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Meshes/ground_grid_mesh.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Meshes/manipulatemesh 2.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.80 (sub 75) OBJ File: 'frame.blend' 2 | # www.blender.org 3 | mtllib manipulatemesh 2.mtl 4 | o ManipulateMesh_Cube.006 5 | v -36.867043 12.594621 -36.867043 6 | v -36.867043 12.594621 36.867043 7 | v 36.867043 12.594621 -36.867043 8 | v 36.867043 12.594621 36.867043 9 | vt 0.000000 0.000000 10 | vt 0.000000 0.000000 11 | vt 0.000000 0.000000 12 | vt 0.000000 0.000000 13 | vn 0.0000 1.0000 0.0000 14 | usemtl None 15 | s off 16 | f 1/1/1 2/2/1 4/3/1 3/4/1 17 | -------------------------------------------------------------------------------- /lensStudio/Public/Meshes/touch_collision_cube.mesh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Meshes/touch_collision_cube.mesh -------------------------------------------------------------------------------- /lensStudio/Public/Meshes/unitCube.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.80 (sub 75) OBJ File: '' 2 | # www.blender.org 3 | o Cube 4 | v 1.000000 0.500000 -0.500000 5 | v 1.000000 -0.500000 -0.500000 6 | v 1.000000 0.500000 0.500000 7 | v 1.000000 -0.500000 0.500000 8 | v 0.000000 0.500000 -0.500000 9 | v 0.000000 -0.500000 -0.500000 10 | v 0.000000 0.500000 0.500000 11 | v 0.000000 -0.500000 0.500000 12 | vt 0.375000 0.000000 13 | vt 0.625000 0.000000 14 | vt 0.625000 0.250000 15 | vt 0.375000 0.250000 16 | vt 0.375000 0.250000 17 | vt 0.625000 0.250000 18 | vt 0.625000 0.500000 19 | vt 0.375000 0.500000 20 | vt 0.625000 0.750000 21 | vt 0.375000 0.750000 22 | vt 0.625000 0.750000 23 | vt 0.625000 1.000000 24 | vt 0.375000 1.000000 25 | vt 0.125000 0.500000 26 | vt 0.375000 0.500000 27 | vt 0.375000 0.750000 28 | vt 0.125000 0.750000 29 | vt 0.625000 0.500000 30 | vt 0.875000 0.500000 31 | vt 0.875000 0.750000 32 | vn 0.0000 1.0000 0.0000 33 | vn 0.0000 0.0000 1.0000 34 | vn -1.0000 0.0000 0.0000 35 | vn 0.0000 -1.0000 0.0000 36 | vn 1.0000 0.0000 0.0000 37 | vn 0.0000 0.0000 -1.0000 38 | s off 39 | f 1/1/1 5/2/1 7/3/1 3/4/1 40 | f 4/5/2 3/6/2 7/7/2 8/8/2 41 | f 8/8/3 7/7/3 5/9/3 6/10/3 42 | f 6/10/4 2/11/4 4/12/4 8/13/4 43 | f 2/14/5 1/15/5 3/16/5 4/17/5 44 | f 6/18/6 5/19/6 1/20/6 2/11/6 45 | -------------------------------------------------------------------------------- /lensStudio/Public/Scripts/DuneBuggy.js: -------------------------------------------------------------------------------- 1 | //@input Asset.RenderMesh DuneBuggy_Frame 2 | //@input Asset.RenderMesh DuneBuggy_FL 3 | //@input Asset.RenderMesh DuneBuggy_FR 4 | //@input Asset.RenderMesh DuneBuggy_BL 5 | //@input Asset.RenderMesh DuneBuggy_BR 6 | //@input Asset.Material DuneBuggy_mat 7 | //@input Component.ScriptComponent sharedScript 8 | //@input SceneObject YAxisPlaneTracker 9 | //@input SceneObject YAxisUnit_Cam 10 | //@input SceneObject terrainContainer 11 | //@input SceneObject terrain_NE 12 | //@input SceneObject terrain_NW 13 | //@input SceneObject terrain_SE 14 | //@input SceneObject terrain_SW 15 | 16 | var DynamicTerrain = script.sharedScript.api.DynamicTerrain; 17 | var DuneBuggy = script.sharedScript.api.DuneBuggy; 18 | 19 | function init(){ 20 | // FIND THE MASTER GROUP OBJECT 21 | for(var i=0; i25)?-100:0; 132 | var X2 = (x<-25)?100:0; 133 | var Y1 = (y>25)?-100:0; 134 | var Y2 = (y<-25)?100:0; 135 | script.terrainContainer.getTransform().setLocalPosition(new vec3(x,0,y) ); 136 | script.terrain_NE.getTransform().setLocalPosition( new vec3(X1,0,Y1) ); 137 | script.terrain_NW.getTransform().setLocalPosition( new vec3(X2,0,Y1) ); 138 | script.terrain_SE.getTransform().setLocalPosition( new vec3(X1,0,Y2) ); 139 | script.terrain_SW.getTransform().setLocalPosition( new vec3(X2,0,Y2) ); 140 | 141 | var divider = 100; 142 | script.terrain_NE.getFirstComponent("Component.MeshVisual").mainPass.uv2Offset = new vec2(0.5+((X1+x)/divider), 0.5+((Y1+y)/divider)); 143 | script.terrain_NW.getFirstComponent("Component.MeshVisual").mainPass.uv2Offset = new vec2(((X2+x)/divider), 0.5+((Y1+y)/divider)); 144 | script.terrain_SE.getFirstComponent("Component.MeshVisual").mainPass.uv2Offset = new vec2(0.5+((X1+x)/divider), ((Y2+y)/divider)); 145 | script.terrain_SW.getFirstComponent("Component.MeshVisual").mainPass.uv2Offset = new vec2(((X2+x)/divider), ((Y2+y)/divider)); 146 | } 147 | 148 | 149 | function onUpdate(e){ 150 | var _elapsedTime = e.getDeltaTime()*1000; 151 | this.currTime += _elapsedTime; 152 | if(_elapsedTime == 0)return; 153 | 154 | ////////// Update terrain and dune buggy ////////// 155 | this.terrain.move( 156 | this.duneBuggy.vectorXY[0]*this.duneBuggy.speedXY*_elapsedTime/1000, 157 | -this.duneBuggy.vectorXY[1]*this.duneBuggy.speedXY*_elapsedTime/1000 158 | ); 159 | 160 | if(this.autoDrive){ 161 | this.duneBuggy.accelerationXY_Mult = 1; 162 | this.duneBuggy.rotate(((Math.sin(3+this.currTime/8000)+Math.sin(this.currTime/800))*0.65)*_elapsedTime/1000); 163 | } else { 164 | 165 | this.duneBuggy.accelerationXY_Mult = 1; 166 | 167 | var rotValue = Math.min(1, getCameraRotation.call(this)*1.75 )/20; 168 | if(rotValue) this.duneBuggy.rotate( rotValue ); 169 | 170 | 171 | } 172 | 173 | moveTerrain( -(wrapVal(this.terrain.currentPosition[0], 100)-50), (wrapVal(this.terrain.currentPosition[1], 100)-50) ); 174 | 175 | // this.terrainObj.mb.eraseVertices(0, this.terrainObj.mb.getVerticesCount()); 176 | // this.terrainObj.mb.appendVerticesInterleaved(this.terrain.returnPackedArray()); 177 | // this.terrainObj.mb.updateMesh() 178 | 179 | 180 | // next set wheelHeights 181 | this.duneBuggy.update( 182 | _elapsedTime/1000, 183 | this.terrain.getPt(this.terrain.currentPosition[0]+this.duneBuggy.wheelPositions[0][0]*this.buggyScale, this.terrain.currentPosition[1]-this.duneBuggy.wheelPositions[0][1]*this.buggyScale).z, 184 | this.terrain.getPt(this.terrain.currentPosition[0]+this.duneBuggy.wheelPositions[1][0]*this.buggyScale, this.terrain.currentPosition[1]-this.duneBuggy.wheelPositions[1][1]*this.buggyScale).z, 185 | this.terrain.getPt(this.terrain.currentPosition[0]+this.duneBuggy.wheelPositions[2][0]*this.buggyScale, this.terrain.currentPosition[1]-this.duneBuggy.wheelPositions[2][1]*this.buggyScale).z, 186 | this.terrain.getPt(this.terrain.currentPosition[0]+this.duneBuggy.wheelPositions[3][0]*this.buggyScale, this.terrain.currentPosition[1]-this.duneBuggy.wheelPositions[3][1]*this.buggyScale).z 187 | ); 188 | 189 | var buggyRotation = quat.fromEulerVec(new vec3(0, Math.PI-this.duneBuggy.rotation,0)); 190 | this.buggySpin.transform.setLocalRotation(buggyRotation); 191 | this.buggy_frame.transform.setLocalRotation(quat.fromEulerVec(new vec3(this.duneBuggy.tilt, 0, this.duneBuggy.roll))); 192 | this.buggy_frame.transform.setLocalPosition(new vec3(0, this.duneBuggy.midHeight/this.buggyScale, 0)); 193 | 194 | // this.buggy_frontLeftWheel.transform.setLocalPosition(new vec3(this.duneBuggy.wheelPositions[0][0], this.duneBuggy.wheelPositions[0][2]/this.buggyScale, this.duneBuggy.wheelPositions[0][1])); 195 | 196 | this.buggy_frontLeftWheel.transform.setLocalPosition(new vec3(this.duneBuggy.wheelPositions[0][0], this.duneBuggy.wheelPositions[0][2]/this.buggyScale, this.duneBuggy.wheelPositions[0][1])); 197 | this.buggy_frontRightWheel.transform.setLocalPosition(new vec3(this.duneBuggy.wheelPositions[1][0], this.duneBuggy.wheelPositions[1][2]/this.buggyScale, this.duneBuggy.wheelPositions[1][1])); 198 | this.buggy_backLeftWheel.transform.setLocalPosition(new vec3(this.duneBuggy.wheelPositions[2][0], this.duneBuggy.wheelPositions[2][2]/this.buggyScale, this.duneBuggy.wheelPositions[2][1])); 199 | this.buggy_backRightWheel.transform.setLocalPosition(new vec3(this.duneBuggy.wheelPositions[3][0], this.duneBuggy.wheelPositions[3][2]/this.buggyScale, this.duneBuggy.wheelPositions[3][1])); 200 | 201 | 202 | // this.buggy_frontLeftWheel.transform.setLocalPosition(new vec3(0, this.terrain.getPt(this.terrain.currentPosition[0], this.terrain.currentPosition[1]).z/this.buggyScale, 0)); 203 | 204 | // global.logToScreen(this.buggy_frontLeftWheel.transform.getLocalPosition().y); 205 | // global.logToScreen(this.duneBuggy.wheelPositions[1][2]/this.buggyScale); 206 | // global.logToScreen(this.duneBuggy.wheelPositions[2][2]/this.buggyScale); 207 | // global.logToScreen(this.duneBuggy.wheelPositions[3][2]/this.buggyScale); 208 | 209 | this.buggy_frontLeftWheel.transform.setLocalRotation(buggyRotation); 210 | this.buggy_frontRightWheel.transform.setLocalRotation(buggyRotation); 211 | this.buggy_backLeftWheel.transform.setLocalRotation(buggyRotation); 212 | this.buggy_backRightWheel.transform.setLocalRotation(buggyRotation); 213 | 214 | } 215 | 216 | init(); 217 | 218 | 219 | 220 | //////////////////// HELPER FUNCTIONS //////////////////// 221 | // (I put these at the bottom to keep them out of the way) 222 | 223 | // this is basically Modulo, but it works with negative numbers 224 | function wrapVal(val, range){ 225 | if(val >=0){ 226 | return val%range; 227 | } else { 228 | return range-(Math.abs(val)%range) 229 | } 230 | } 231 | -------------------------------------------------------------------------------- /lensStudio/Public/Scripts/GroundGrid.js: -------------------------------------------------------------------------------- 1 | // GroundGrid.js 2 | // Version: 0.0.4 3 | // Event: Lens Initialized 4 | // Description: Controls the visibility of the ground grid underneath the character 5 | 6 | //@input float fadeUpSpeed 7 | //@input float fadeDownSpeed 8 | 9 | // Bool used to determine if the user is touching the object 10 | var isTouching = false; 11 | 12 | // A reference to the Mesh Visual Component on the ground grid object 13 | var groundMeshVisual = script.getSceneObject().getFirstComponent("Component.MeshVisual"); 14 | 15 | function onLensTurnOn() 16 | { 17 | isTouching = false; 18 | } 19 | 20 | // Function that runs every frame 21 | function onFrameUpdated(eventData) 22 | { 23 | // Update Alpha for the ground grid material 24 | var curColor = groundMeshVisual.mainMaterial.mainPass.mainColor; 25 | 26 | // Determines if the user is touching/moving the object around to lerp the alpha for the grid up and down 27 | if(isTouching) 28 | { 29 | var lerpedColor = vec4.lerp( curColor, new vec4(1, 1, 1, 1), script.fadeUpSpeed ); 30 | groundMeshVisual.mainMaterial.mainPass.mainColor = lerpedColor; 31 | } 32 | else 33 | { 34 | var lerpedColor = vec4.lerp( curColor, new vec4(0, 0, 0, 1), script.fadeDownSpeed ); 35 | groundMeshVisual.mainMaterial.mainPass.mainColor = lerpedColor; 36 | } 37 | 38 | // This controls hiding the grid if the user is recording on their device within Snapchat 39 | if(global.scene.isRecording()) 40 | { 41 | groundMeshVisual.enabled = false; 42 | } 43 | else 44 | { 45 | groundMeshVisual.enabled = true; 46 | } 47 | } 48 | 49 | // Setup for events and callbacks 50 | function onTouchStarted(eventData) 51 | { 52 | isTouching = true; 53 | } 54 | 55 | function onTouchEnded(eventData) 56 | { 57 | isTouching = false; 58 | } 59 | 60 | if(groundMeshVisual) 61 | { 62 | var turnOnEvent = script.createEvent("TurnOnEvent"); 63 | turnOnEvent.bind(onLensTurnOn); 64 | 65 | var updateEvent = script.createEvent("UpdateEvent"); 66 | updateEvent.bind(onFrameUpdated); 67 | 68 | var touchStartEvent = script.createEvent("TouchStartEvent"); 69 | touchStartEvent.bind(onTouchStarted); 70 | 71 | var touchEndEvent = script.createEvent("TouchEndEvent"); 72 | touchEndEvent.bind(onTouchEnded); 73 | } -------------------------------------------------------------------------------- /lensStudio/Public/Scripts/WorldObjectController.js: -------------------------------------------------------------------------------- 1 | // WorldObjectController.js 2 | // Version: 0.0.4 3 | // Event: Lens Initialized 4 | // Description: Controls the touch, hiding, and showing functionality of the movable character 5 | 6 | //@input bool useGroundGrid 7 | //@input Asset.Material touchCollisionMaterial 8 | //@input SceneObject groundGrid 9 | //@input Component.WorldTracking worldTrackingComponent 10 | 11 | // Getting the original position of the object so when tracking get reset it goes back to the original position 12 | var originalPosition = script.getSceneObject().getTransform().getLocalPosition(); 13 | 14 | // If an object with a touch component is defined then this will allow the user to double tap through them to 15 | // perform a camera swap from back to front cam 16 | if(script.getSceneObject().getComponentCount("Component.TouchComponent") > 0) 17 | { 18 | script.getSceneObject().getFirstComponent("Component.TouchComponent").addTouchBlockingException("TouchTypeDoubleTap"); 19 | } 20 | 21 | // Hides the ground grid if the option is chosen to do so 22 | if(!script.useGroundGrid && script.groundGrid) 23 | { 24 | script.groundGrid.enabled = false; 25 | } 26 | 27 | // Hides the touchCollision object when lens is running by setting the alpha on its material to 0 28 | if(script.touchCollisionMaterial) 29 | { 30 | script.touchCollisionMaterial.mainPass.baseColor = new vec4(1,1,1,0); 31 | } 32 | 33 | // Event and callback setup 34 | function onSurfaceReset(eventData) 35 | { 36 | script.getSceneObject().getTransform().setLocalPosition(originalPosition); 37 | setTrackingTarget(); 38 | } 39 | var worldTrackingResetEvent = script.createEvent("WorldTrackingResetEvent"); 40 | worldTrackingResetEvent.bind(onSurfaceReset); 41 | 42 | function onFrontCamEvent(eventData) 43 | { 44 | for(var i = 0; i < script.getSceneObject().getChildrenCount(); i++) 45 | { 46 | var childObject = script.getSceneObject().getChild(i); 47 | if(childObject) 48 | { 49 | childObject.enabled = false; 50 | } 51 | } 52 | } 53 | var cameraFrontEvent = script.createEvent("CameraFrontEvent"); 54 | cameraFrontEvent.bind(onFrontCamEvent); 55 | 56 | function onBackCamEvent(eventData) 57 | { 58 | for(var i = 0; i < script.getSceneObject().getChildrenCount(); i++) 59 | { 60 | var childObject = script.getSceneObject().getChild(i); 61 | if(childObject) 62 | { 63 | childObject.enabled = true; 64 | } 65 | } 66 | if(!script.useGroundGrid && script.groundGrid) 67 | { 68 | script.groundGrid.enabled = false; 69 | } 70 | } 71 | var cameraBackEvent = script.createEvent("CameraBackEvent"); 72 | cameraBackEvent.bind(onBackCamEvent); 73 | 74 | function setTrackingTarget() 75 | { 76 | if(script.worldTrackingComponent) 77 | { 78 | script.worldTrackingComponent.surfaceTrackingTarget = script.getSceneObject(); 79 | } 80 | } 81 | setTrackingTarget(); -------------------------------------------------------------------------------- /lensStudio/Public/Scripts/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Scripts/folder.lock -------------------------------------------------------------------------------- /lensStudio/Public/Scripts/hints.js: -------------------------------------------------------------------------------- 1 | //@input SceneObject IconOverlay 2 | 3 | var frontHint = script.getSceneObject().createComponent( "Component.HintsComponent" ); 4 | script.createEvent("CameraFrontEvent").bind( setVisibilities.bind(this) ); 5 | script.createEvent("CameraBackEvent").bind( setVisibilities.bind(this) ); 6 | 7 | function setVisibilities(eventData){ 8 | var camType = global.scene.getCameraType(); 9 | if(camType == "front"){ 10 | frontHint.showHint("lens_hint_swap_camera", 3); 11 | script.IconOverlay.enabled = false; 12 | } else { 13 | frontHint.hideHint("lens_hint_swap_camera"); 14 | script.IconOverlay.enabled = true; 15 | } 16 | } -------------------------------------------------------------------------------- /lensStudio/Public/Textures/Base 2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/Base 2.png -------------------------------------------------------------------------------- /lensStudio/Public/Textures/Base 3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/Base 3.png -------------------------------------------------------------------------------- /lensStudio/Public/Textures/Base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/Base.png -------------------------------------------------------------------------------- /lensStudio/Public/Textures/MaterialParams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/MaterialParams.png -------------------------------------------------------------------------------- /lensStudio/Public/Textures/Normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/Normal.png -------------------------------------------------------------------------------- /lensStudio/Public/Textures/Sandbox.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/Sandbox.jpg -------------------------------------------------------------------------------- /lensStudio/Public/Textures/Sandbox_striped.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/Sandbox_striped.jpg -------------------------------------------------------------------------------- /lensStudio/Public/Textures/albedo_NE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/albedo_NE.jpg -------------------------------------------------------------------------------- /lensStudio/Public/Textures/albedo_NW.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/albedo_NW.jpg -------------------------------------------------------------------------------- /lensStudio/Public/Textures/albedo_SE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/albedo_SE.jpg -------------------------------------------------------------------------------- /lensStudio/Public/Textures/albedo_SW.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/albedo_SW.jpg -------------------------------------------------------------------------------- /lensStudio/Public/Textures/alphaMask.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/alphaMask.jpg -------------------------------------------------------------------------------- /lensStudio/Public/Textures/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/folder.lock -------------------------------------------------------------------------------- /lensStudio/Public/Textures/ground_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/ground_grid.png -------------------------------------------------------------------------------- /lensStudio/Public/Textures/ground_grid_mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/ground_grid_mask.png -------------------------------------------------------------------------------- /lensStudio/Public/Textures/icon-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/Textures/icon-white.png -------------------------------------------------------------------------------- /lensStudio/Public/folder.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/Public/folder.lock -------------------------------------------------------------------------------- /lensStudio/README.md: -------------------------------------------------------------------------------- 1 | # Dune Buggy AR - Lens Studio 2 | 3 | This folder contains the project files for the Lens Studio version. `Public/Scripts/shared.js` is created by running `npm run watch` in the repo's root directory 4 | 5 | -------------------------------------------------------------------------------- /lensStudio/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/icon.png -------------------------------------------------------------------------------- /lensStudio/project.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/lensStudio/project.data -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dunebuggyar", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@babel/code-frame": { 8 | "version": "7.5.5", 9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", 10 | "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", 11 | "requires": { 12 | "@babel/highlight": "^7.0.0" 13 | } 14 | }, 15 | "@babel/highlight": { 16 | "version": "7.5.0", 17 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", 18 | "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", 19 | "requires": { 20 | "chalk": "^2.0.0", 21 | "esutils": "^2.0.2", 22 | "js-tokens": "^4.0.0" 23 | } 24 | }, 25 | "@types/estree": { 26 | "version": "0.0.39", 27 | "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", 28 | "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" 29 | }, 30 | "@types/node": { 31 | "version": "12.7.8", 32 | "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.8.tgz", 33 | "integrity": "sha512-FMdVn84tJJdV+xe+53sYiZS4R5yn1mAIxfj+DVoNiQjTYz1+OYmjwEZr1ev9nU0axXwda0QDbYl06QHanRVH3A==" 34 | }, 35 | "acorn": { 36 | "version": "7.1.0", 37 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", 38 | "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" 39 | }, 40 | "ansi-styles": { 41 | "version": "3.2.1", 42 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 43 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 44 | "requires": { 45 | "color-convert": "^1.9.0" 46 | } 47 | }, 48 | "buffer-from": { 49 | "version": "1.1.1", 50 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", 51 | "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" 52 | }, 53 | "chalk": { 54 | "version": "2.4.2", 55 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 56 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 57 | "requires": { 58 | "ansi-styles": "^3.2.1", 59 | "escape-string-regexp": "^1.0.5", 60 | "supports-color": "^5.3.0" 61 | } 62 | }, 63 | "color-convert": { 64 | "version": "1.9.3", 65 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 66 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 67 | "requires": { 68 | "color-name": "1.1.3" 69 | } 70 | }, 71 | "color-name": { 72 | "version": "1.1.3", 73 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 74 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" 75 | }, 76 | "commander": { 77 | "version": "2.20.1", 78 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.1.tgz", 79 | "integrity": "sha512-cCuLsMhJeWQ/ZpsFTbE765kvVfoeSddc4nU3up4fV+fDBcfUXnbITJ+JzhkdjzOqhURjZgujxaioam4RM9yGUg==" 80 | }, 81 | "escape-string-regexp": { 82 | "version": "1.0.5", 83 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 84 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" 85 | }, 86 | "estree-walker": { 87 | "version": "0.6.1", 88 | "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", 89 | "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==" 90 | }, 91 | "esutils": { 92 | "version": "2.0.3", 93 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 94 | "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" 95 | }, 96 | "has-flag": { 97 | "version": "3.0.0", 98 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 99 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" 100 | }, 101 | "jest-worker": { 102 | "version": "24.9.0", 103 | "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz", 104 | "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==", 105 | "requires": { 106 | "merge-stream": "^2.0.0", 107 | "supports-color": "^6.1.0" 108 | }, 109 | "dependencies": { 110 | "supports-color": { 111 | "version": "6.1.0", 112 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", 113 | "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", 114 | "requires": { 115 | "has-flag": "^3.0.0" 116 | } 117 | } 118 | } 119 | }, 120 | "js-tokens": { 121 | "version": "4.0.0", 122 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 123 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 124 | }, 125 | "merge-stream": { 126 | "version": "2.0.0", 127 | "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", 128 | "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" 129 | }, 130 | "pngjs": { 131 | "version": "3.4.0", 132 | "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz", 133 | "integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==" 134 | }, 135 | "rollup": { 136 | "version": "1.22.0", 137 | "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.22.0.tgz", 138 | "integrity": "sha512-x4l4ZrV/Mr/x/jvFTmwROdEAhbZjx16yDRTVSKWh/i4oJDuW2dVEbECT853mybYCz7BAitU8ElGlhx7dNjw3qQ==", 139 | "requires": { 140 | "@types/estree": "*", 141 | "@types/node": "*", 142 | "acorn": "^7.1.0" 143 | } 144 | }, 145 | "rollup-plugin-terser": { 146 | "version": "5.1.2", 147 | "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.1.2.tgz", 148 | "integrity": "sha512-sWKBCOS+vUkRtHtEiJPAf+WnBqk/C402fBD9AVHxSIXMqjsY7MnYWKYEUqGixtr0c8+1DjzUEPlNgOYQPVrS1g==", 149 | "requires": { 150 | "@babel/code-frame": "^7.0.0", 151 | "jest-worker": "^24.6.0", 152 | "rollup-pluginutils": "^2.8.1", 153 | "serialize-javascript": "^1.7.0", 154 | "terser": "^4.1.0" 155 | } 156 | }, 157 | "rollup-pluginutils": { 158 | "version": "2.8.2", 159 | "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", 160 | "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", 161 | "requires": { 162 | "estree-walker": "^0.6.1" 163 | } 164 | }, 165 | "serialize-javascript": { 166 | "version": "1.9.1", 167 | "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.9.1.tgz", 168 | "integrity": "sha512-0Vb/54WJ6k5v8sSWN09S0ora+Hnr+cX40r9F170nT+mSkaxltoE/7R3OrIdBSUv1OoiobH1QoWQbCnAO+e8J1A==" 169 | }, 170 | "source-map": { 171 | "version": "0.6.1", 172 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 173 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" 174 | }, 175 | "source-map-support": { 176 | "version": "0.5.13", 177 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", 178 | "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", 179 | "requires": { 180 | "buffer-from": "^1.0.0", 181 | "source-map": "^0.6.0" 182 | } 183 | }, 184 | "supports-color": { 185 | "version": "5.5.0", 186 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 187 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 188 | "requires": { 189 | "has-flag": "^3.0.0" 190 | } 191 | }, 192 | "terser": { 193 | "version": "4.3.4", 194 | "resolved": "https://registry.npmjs.org/terser/-/terser-4.3.4.tgz", 195 | "integrity": "sha512-Kcrn3RiW8NtHBP0ssOAzwa2MsIRQ8lJWiBG/K7JgqPlomA3mtb2DEmp4/hrUA+Jujx+WZ02zqd7GYD+QRBB/2Q==", 196 | "requires": { 197 | "commander": "^2.20.0", 198 | "source-map": "~0.6.1", 199 | "source-map-support": "~0.5.12" 200 | } 201 | } 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dunebuggyar", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "rollup --config", 8 | "watch": "rollup --config --watch", 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "author": "", 12 | "license": "ISC", 13 | "dependencies": { 14 | "pngjs": "^3.4.0", 15 | "rollup": "^1.22.0", 16 | "rollup-plugin-terser": "^5.1.2" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import { terser } from "rollup-plugin-terser"; 2 | 3 | export default [ 4 | { 5 | input: 'shared/shared_web.js', 6 | output: [{ 7 | file: 'web/src/js/shared.js', 8 | format: 'esm' 9 | }, { 10 | file: '8thWall/src/js/shared.js', 11 | format: 'esm' 12 | }] 13 | }, 14 | { 15 | input: 'shared/shared_lensStudio.js', 16 | output: { 17 | file: 'lensStudio/Public/scripts/shared.js', 18 | format: 'umd' 19 | } 20 | }, 21 | { 22 | input: 'shared/shared_sparkAR.js', 23 | output: [{ 24 | name: 'sparkARShared', 25 | file: 'sparkAR/scripts/shared.js', 26 | format: 'iife' 27 | }], 28 | plugins: [ 29 | terser({ 30 | include: [/^.+\.min\.js$/, '*esm*'], 31 | exclude: [ 'some*' ] 32 | }) 33 | ] 34 | } 35 | ]; -------------------------------------------------------------------------------- /shared/README.md: -------------------------------------------------------------------------------- 1 | # Dune Buggy AR - Shared Code 2 | 3 | This folder contains code that is reused across all of the platforms. `shared_lensStudio.js` `shared_sparkAR.js` and `shared_web.js` are used by rollup to create the file that is written to each project folder. 4 | 5 | # Terrain Heights 6 | 7 | `node ./heightProcessor.js` will run a script that reads `Terrain_Displacement.png` and outputs terrainHeights at resolutions of 128, 256, and 512. What it's doing is reading the pixels of the height map and outputting a value of 0-255 in hex. Aka 00-FF. It puts all of the values into one long string that we can read into our javascript later. This was the best way that I could think of to get the height values into javascript with the smallest filesize. 8 | 9 | # DynamicTerrain.js 10 | 11 | This is a class that reads the heights that were created by heightProcessor.js and lets us look up height values within that. When a requested coordinate is between defined values it will interpolate the values. Originally this class was also used to create a dynamic mesh from the height data. This technique is no longer being used in the project though the code is still within the class. 12 | 13 | # DuneBuggy.js 14 | 15 | This is a simple class that controls the Dune Buggy's movement. 16 | 17 | -------------------------------------------------------------------------------- /shared/Terrain_Displacement.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/shared/Terrain_Displacement.png -------------------------------------------------------------------------------- /shared/duneBuggy.js: -------------------------------------------------------------------------------- 1 | 2 | function DuneBuggy() { 3 | this.frontWheelX = 2.6077; 4 | this.frontWheelSpace = 1.36649; 5 | var frontWheelRadius = 1.30245/4; 6 | this.backWheelX = -2.25336; 7 | this.backWheelSpace = 1.82944; 8 | var backWheelRadius = 1.56141/4; 9 | 10 | this.topSpeedXY = 40; 11 | this.speedXY = 0; 12 | this.vectorXY = [0, 1]; 13 | this.accelerationXY = 15; 14 | this.accelerationXY_Mult = 0; 15 | this.frictionXY = 0.98; // slow down if accelerationXY_Mult is 0 16 | 17 | this.onGround = [true, true]; 18 | 19 | var wheelPositions_orig = [ 20 | [-this.frontWheelSpace, this.frontWheelX], 21 | [this.frontWheelSpace, this.frontWheelX], 22 | [-this.backWheelSpace, this.backWheelX], 23 | [this.backWheelSpace, this.backWheelX] 24 | ] 25 | 26 | // same but with a height too 27 | 28 | this.velocityZ = [0,0,0,0]; 29 | this.positionsZ = [0,0,0,0]; 30 | this.prev_positionsZ = [0,0,0,0]; 31 | this.accelerationZ = -65; 32 | 33 | this.wheelPositions = [ 34 | [-this.frontWheelSpace, this.frontWheelX,0], 35 | [this.frontWheelSpace, this.frontWheelX,0], 36 | [-this.backWheelSpace, this.backWheelX,0], 37 | [this.backWheelSpace, this.backWheelX,0] 38 | ] 39 | 40 | var wheelDist = this.frontWheelX - this.backWheelX; 41 | 42 | this.rotation = 0; 43 | 44 | this.tilt = 0; 45 | this.roll = 0; 46 | this.midHeight = 0; 47 | 48 | this.wheelHeights = [0,0,0,0]; 49 | 50 | 51 | var first = true; 52 | 53 | var lerp = function(a,b,amt){ 54 | return a+((b-a)*amt); 55 | } 56 | // save the wheel heights, determine frame height, tilt, and roll 57 | this.update = function(elapsedTime, FL, FR, BL, BR){ 58 | if(first){ 59 | this.positionsZ[0] = FL+frontWheelRadius; 60 | this.positionsZ[1] = FR+frontWheelRadius; 61 | this.positionsZ[2] = BL+backWheelRadius; 62 | this.positionsZ[3] = BR+backWheelRadius; 63 | first = false; 64 | } 65 | ////////////// XY Axis Update ////////////////// 66 | 67 | // speed only changes if we are on the ground 68 | if(this.onGround[0] || this.onGround[1]){ 69 | // we apply friction if the car doesn't have any forward or backward accelerations 70 | if(this.accelerationXY_Mult == 0)this.speedXY *= this.frictionXY; 71 | // if the car is going a different way than it's acceleration 72 | // we exponentially slow it down. It was just a bit sluggish when 73 | // go from forwards to reverse and vise versa. 74 | if((this.speedXY)/Math.abs(this.speedXY) == -(this.accelerationXY_Mult/Math.abs(this.accelerationXY_Mult)))this.speedXY *= Math.pow(this.frictionXY, 3); 75 | // now apply acceleration 76 | this.speedXY = Math.min(this.topSpeedXY, Math.max(-this.topSpeedXY, this.speedXY+this.accelerationXY*this.accelerationXY_Mult*elapsedTime)) 77 | } 78 | 79 | 80 | ////////////// Z Axis Update ////////////////// 81 | // update velocities 82 | this.velocityZ[0] += this.accelerationZ*elapsedTime; 83 | this.velocityZ[1] += this.accelerationZ*elapsedTime; 84 | this.velocityZ[2] += this.accelerationZ*elapsedTime; 85 | this.velocityZ[3] += this.accelerationZ*elapsedTime; 86 | 87 | // save previous positions 88 | this.prev_positionsZ[0] = this.positionsZ[0]; 89 | this.prev_positionsZ[1] = this.positionsZ[1]; 90 | this.prev_positionsZ[2] = this.positionsZ[2]; 91 | this.prev_positionsZ[3] = this.positionsZ[3]; 92 | 93 | // update positions heights 94 | this.positionsZ[0] = Math.max(this.positionsZ[0] + this.velocityZ[0]*elapsedTime, FL+frontWheelRadius); 95 | this.positionsZ[1] = Math.max(this.positionsZ[1] + this.velocityZ[1]*elapsedTime, FR+frontWheelRadius); 96 | this.positionsZ[2] = Math.max(this.positionsZ[2] + this.velocityZ[2]*elapsedTime, BL+backWheelRadius); 97 | this.positionsZ[3] = Math.max(this.positionsZ[3] + this.velocityZ[3]*elapsedTime, BR+backWheelRadius); 98 | 99 | // this smooths out the positions a bit 100 | this.positionsZ[0] = lerp(this.positionsZ[0], (this.positionsZ[0]+this.positionsZ[1])/2, 0.5); 101 | this.positionsZ[0] = lerp(this.positionsZ[1], (this.positionsZ[0]+this.positionsZ[1])/2, 0.5); 102 | this.positionsZ[2] = lerp(this.positionsZ[2], (this.positionsZ[2]+this.positionsZ[3])/2, 0.5); 103 | this.positionsZ[3] = lerp(this.positionsZ[3], (this.positionsZ[2]+this.positionsZ[3])/2, 0.5); 104 | 105 | // save new velocityZ 106 | this.velocityZ[0] = Math.min((this.positionsZ[0]-this.prev_positionsZ[0])/elapsedTime, 30); 107 | this.velocityZ[1] = Math.min((this.positionsZ[1]-this.prev_positionsZ[1])/elapsedTime, 30); 108 | this.velocityZ[2] = Math.min((this.positionsZ[2]-this.prev_positionsZ[2])/elapsedTime, 30); 109 | this.velocityZ[3] = Math.min((this.positionsZ[3]-this.prev_positionsZ[3])/elapsedTime, 30); 110 | 111 | var shockLength = 0.75; 112 | this.wheelPositions[0][2] = Math.max(this.positionsZ[0]-shockLength, FL+frontWheelRadius); 113 | this.wheelPositions[1][2] = Math.max(this.positionsZ[1]-shockLength, FR+frontWheelRadius); 114 | this.wheelPositions[2][2] = Math.max(this.positionsZ[2]-shockLength, BL+backWheelRadius); 115 | this.wheelPositions[3][2] = Math.max(this.positionsZ[3]-shockLength, BR+backWheelRadius); 116 | 117 | this.onGround[0] = ( 118 | this.wheelPositions[0][2] == FL+frontWheelRadius || 119 | this.wheelPositions[1][2] == FR+frontWheelRadius 120 | )?true:false; 121 | 122 | this.onGround[1] = ( 123 | this.wheelPositions[2][2] == BL+backWheelRadius || 124 | this.wheelPositions[3][2] == BR+backWheelRadius 125 | )?true:false; 126 | 127 | var midFront = (this.positionsZ[0]+this.positionsZ[1])/2; 128 | var midBack = (this.positionsZ[2]+this.positionsZ[3])/2; 129 | 130 | this.midHeight = (this.positionsZ[0]+this.positionsZ[1]+this.positionsZ[2]+this.positionsZ[3])/4; 131 | this.tilt = Math.atan((midFront-midBack)/wheelDist); 132 | 133 | this.roll = (Math.atan((FL-FR)/(this.frontWheelSpace*2))+Math.atan((BL-BR)/(this.backWheelSpace*2)))/2; 134 | } 135 | 136 | // update zRotation, determine new wheel positions 137 | this.rotate = function(amt){ 138 | this.rotation += amt*Math.min(10, Math.abs(this.speedXY))/10; 139 | 140 | // update wheel x and y positions 141 | for(var i=0; i<4; i++){ 142 | this.wheelPositions[i][0] = (wheelPositions_orig[i][0]*Math.cos(this.rotation)) - (wheelPositions_orig[i][1]*Math.sin(this.rotation)) 143 | this.wheelPositions[i][1] = (wheelPositions_orig[i][0]*Math.sin(this.rotation)) + (wheelPositions_orig[i][1]*Math.cos(this.rotation)) 144 | } 145 | 146 | // allow the car to turn, but do not change vector direction unless we are touching the ground 147 | if(this.onGround[0]){ 148 | this.vectorXY[0] = -Math.sin(this.rotation); 149 | this.vectorXY[1] = Math.cos(this.rotation); 150 | } 151 | } 152 | 153 | } 154 | 155 | export {DuneBuggy} -------------------------------------------------------------------------------- /shared/dynamicTerrain.js: -------------------------------------------------------------------------------- 1 | import {TerrainHeights as terrainHeights} from './terrainHeights256.js'; 2 | 3 | var DynamicTerrain = (function(){ 4 | function DynamicTerrain(size, resolution) { 5 | this.size = size; 6 | this.halfSize = size/2; 7 | this.spacing = size/resolution; 8 | this.currentPosition = [0, 0]; 9 | this.numRows = resolution + 2; 10 | this.lastRow = this.numRows-1; 11 | this.xPos = []; 12 | this.yPos = []; 13 | this.ptInfo = []; 14 | this.offset = [0,0]; 15 | this.updateList = []; 16 | 17 | this.heightResolution = 256; 18 | 19 | // fill with zeros 20 | var currIndex = 0; 21 | for(var x = 0; x= wrapPt){ 67 | x = x%wrapPt; 68 | } else if (x<0){ 69 | x = wrapPt-(Math.abs(x)%wrapPt); 70 | } 71 | 72 | if(y >= wrapPt){ 73 | y = y%wrapPt; 74 | } else if (y<0){ 75 | y = wrapPt-(Math.abs(y)%wrapPt); 76 | } 77 | 78 | var modded = false; 79 | 80 | // console.log('setPosition 2',x,y); 81 | var dX = x-this.currentPosition[0]; 82 | var dY = y-this.currentPosition[1]; 83 | while(dX > 50){ 84 | modded = true; 85 | this.currentPosition[0] += 100; 86 | dX = x-this.currentPosition[0]; 87 | } 88 | while(dX < -50){ 89 | modded = true; 90 | this.currentPosition[0] -= 100; 91 | dX = x-this.currentPosition[0]; 92 | } 93 | while(dY > 50){ 94 | modded = true; 95 | this.currentPosition[1] += 100; 96 | dY = y-this.currentPosition[1]; 97 | } 98 | while(dY < -50){ 99 | modded = true; 100 | this.currentPosition[1] -= 100; 101 | dY = y-this.currentPosition[1]; 102 | } 103 | // // now lets check if we should correct the "currentPosition" to fit within 0-100" 104 | // if(this.currentPosition[0] >= 100){ 105 | // modded = true; 106 | // this.currentPosition[0] -= 100; 107 | // } else if(this.currentPosition[0] < 0) { 108 | // // } else { 109 | // modded = true; 110 | // this.currentPosition[0] += 100; 111 | // } 112 | 113 | // if(this.currentPosition[1] >= 100){ 114 | // modded = true; 115 | // this.currentPosition[1] -= 100; 116 | // } else if(this.currentPosition[1] < 0) { 117 | // // } else { 118 | // modded = true; 119 | // this.currentPosition[1] += 100; 120 | // } 121 | 122 | 123 | // if we modified the "currentPosition" lets update the point values to match 124 | if(modded){ 125 | for(var _x = 0; _x= this.spacing){ 174 | wrapNum = Math.min(this.numRows-1, Math.floor(this.offset[dimIndex]/this.spacing)) 175 | // console.log('wrap: '+'amt: '+amt+" wrapNum: "+wrapNum+" dim: "+((dimIndex == 0)?"H":"V")+" movement: "+this.spacing*wrapNum); 176 | for(var w=0; w= this.spacing)this.offset[dimIndex] -= this.spacing; 180 | } 181 | 182 | this.currentPosition[dimIndex] += amt; 183 | // this.currentPosition[dimIndex] = (this.currentPosition[dimIndex]+100)%100; 184 | 185 | // fill positions 186 | // first, always the edge 187 | var currPos = -this.halfSize; 188 | posArray[0] = currPos; 189 | 190 | // if(dimIndex == 1)console.log(this.offset[dimIndex]); 191 | // middle 192 | currPos += this.offset[dimIndex]; 193 | for(var i = 1; i= 0)? 249 | ind%(this.heightResolution*this.heightResolution): 250 | (this.heightResolution*this.heightResolution)-1-(Math.abs(ind)%(this.heightResolution*this.heightResolution)); 251 | 252 | if(verbose){ 253 | 254 | console.log("ind, _ind", ind, _ind); 255 | } 256 | return parseInt(terrainHeights.substr(_ind*2, 2), 16) 257 | } 258 | 259 | function lerp(a,b,amt){ 260 | return a+((b-a)*amt); 261 | } 262 | 263 | function getPt(x, y, verbose){ 264 | var _x = x*(this.heightResolution/100); 265 | var _y = y*(this.heightResolution/100); 266 | if(verbose)console.log("/////////// GET PT: _x, _y", _x, _y); 267 | var pt0 = this.getHeightAtIndex((Math.floor(_y)*this.heightResolution)+Math.floor(_x), verbose); 268 | var pt1 = this.getHeightAtIndex((Math.floor(_y)*this.heightResolution)+Math.ceil(_x), verbose); 269 | var pt2 = this.getHeightAtIndex((Math.ceil(_y)*this.heightResolution)+Math.floor(_x), verbose); 270 | var pt3 = this.getHeightAtIndex((Math.ceil(_y)*this.heightResolution)+Math.ceil(_x), verbose); 271 | 272 | var xMixer = (_x>=0)?(_x%1):1+(_x%1); 273 | var yMixer = (_y>=0)?(_y%1):1+(_y%1); 274 | 275 | if(verbose){ 276 | // console.log("_x, _y", _x, _y); 277 | console.log("getHeightAtIndex", pt0, pt1, pt2, pt3); 278 | console.log("_x%1, _y%1", _x%1, _y%1); 279 | console.log("xMixer, yMixer", xMixer ,yMixer); 280 | console.log("lerp", lerp(pt0, pt1, _x%1), lerp(pt2, pt3, _x%1), lerp(lerp(pt0, pt1, _x%1), lerp(pt2, pt3, _x%1), _y%1)); 281 | console.log("lerp_wMIXER", lerp(pt0, pt1, xMixer), lerp(pt2, pt3, xMixer), lerp(lerp(pt0, pt1, xMixer), lerp(pt2, pt3, xMixer), yMixer)); 282 | console.log(lerp(lerp(pt0, pt1, _x%1), lerp(pt2, pt3, _x%1), _y%1)) 283 | } 284 | // lerp(lerp(pt0, pt1, _x%1), lerp(pt2, pt3, _x%1), _y%1); 285 | 286 | return { 287 | u:(0.5/2048)+(2047/2048)*(x/100), 288 | v:1-((0.5/2048)+(2047/2048)*(y/100)), 289 | // z:pt0/15 290 | // z:lerp(lerp(pt0, pt1, _x%1), lerp(pt2, pt3, _x%1), _y%1)/15 291 | z:lerp(lerp(pt0, pt1, xMixer), lerp(pt2, pt3, xMixer), yMixer)/15 292 | }; 293 | // return { 294 | // z:noise.simplex2(y,x) 295 | // }; 296 | } 297 | 298 | function returnPtArray(){ 299 | var ptArr = []; 300 | for(var x = 0; x=0){ 210 | return val%range; 211 | } else { 212 | return range-(Math.abs(val)%range) 213 | } 214 | } 215 | 216 | 217 | // Debbuging visualizers 218 | // function rotationDebugger(){ 219 | // const sdfStar = Shaders.sdfStar(Reactive.pack2(0.5,0.5), 0.01, 0.001, 5); 220 | // const sdfRect = Shaders.sdfRectangle(Reactive.pack2(0.5,0.5), Reactive.pack2(0.1,0.1)); 221 | // Shaders.sdfRotation(sdfRect) 222 | // const step = Reactive.step(sdfRect,0); 223 | // const sdfMix = Shaders.sdfMix(sdfStar,0,step); 224 | // const material = Materials.get('overlays'); 225 | // material.setTexture(step, {textureSlotName: Shaders.DefaultMaterialTextures.DIFFUSE}); 226 | // } -------------------------------------------------------------------------------- /sparkAR/scripts/tsconfig.json: -------------------------------------------------------------------------------- 1 | {"compilerOptions":{"baseUrl":"C:/Users/jonat/AppData/Local/Temp/skylight-typedefs","allowJs":true,"checkJs":true,"outDir":"C:/Users/jonat/AppData/Local/Temp/skylight-typedefs/out-dir"},"include":["*.js"]} -------------------------------------------------------------------------------- /sparkAR/scripts/watch.js: -------------------------------------------------------------------------------- 1 | // this is just a super simple script to concatenate my "shared" script and my main SparkAR script 2 | 3 | const fs = require('fs'); 4 | 5 | function joinFiles(){ 6 | fs.writeFile('script.js', [ 7 | fs.readFileSync('shared.js', 'utf8'), 8 | fs.readFileSync('main.js', 'utf8') 9 | ].join('\n'), (err) => { 10 | // throws an error, you could also catch it here 11 | if (err) throw err; 12 | 13 | // success case, the file was saved 14 | console.log('script.js saved!'); 15 | }); 16 | } 17 | 18 | fs.watchFile('shared.js', (curr, prev) => {joinFiles()}); 19 | fs.watchFile('main.js', (curr, prev) => {joinFiles()}); 20 | 21 | joinFiles(); -------------------------------------------------------------------------------- /sparkAR/sparkAR.arproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/sparkAR/sparkAR.arproj -------------------------------------------------------------------------------- /sparkAR/textures/Sandbox_striped.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/sparkAR/textures/Sandbox_striped.jpg -------------------------------------------------------------------------------- /sparkAR/textures/icon-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/sparkAR/textures/icon-white.png -------------------------------------------------------------------------------- /sparkAR/textures/jpg/albedo_NE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/sparkAR/textures/jpg/albedo_NE.jpg -------------------------------------------------------------------------------- /sparkAR/textures/jpg/albedo_NW.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/sparkAR/textures/jpg/albedo_NW.jpg -------------------------------------------------------------------------------- /sparkAR/textures/jpg/albedo_SE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/sparkAR/textures/jpg/albedo_SE.jpg -------------------------------------------------------------------------------- /sparkAR/textures/jpg/albedo_SW.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/sparkAR/textures/jpg/albedo_SW.jpg -------------------------------------------------------------------------------- /web/README.md: -------------------------------------------------------------------------------- 1 | # Dune Buggy AR - WebGL 2 | This is the WebGL version of the Dune Buggy that is built with ThreeJS. It also acts as our main website for the project and links to each of the live versions. 3 | 4 | # Project setup 5 | 6 | `npm install` will install the required dependencies 7 | 8 | `npm run watch` will run a dev server on port 3000. 9 | 10 | `npm run build` will create a distribution directory "dist" 11 | -------------------------------------------------------------------------------- /web/config/webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const appDir = path.resolve(__dirname, '..', 'src'); 3 | const staticDir = path.resolve(__dirname, '..', 'static'); 4 | 5 | console.log("DEV!"); 6 | module.exports = { 7 | mode: 'development', 8 | context: appDir, 9 | devtool: 'source-map', 10 | entry: './js/index.js', // './src/index.js', 11 | output: { 12 | filename: 'js/[name].js', 13 | publicPath: '/', 14 | sourceMapFilename: '[name].map' 15 | }, 16 | devServer: { 17 | contentBase: [appDir, staticDir], 18 | historyApiFallback: true, 19 | port: 3000, 20 | https: true 21 | } 22 | }; -------------------------------------------------------------------------------- /web/config/webpack.config.prod.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const appDir = path.resolve(__dirname, '..', 'src'); 3 | const staticDir = path.resolve(__dirname, '..', 'static'); 4 | const distDir = path.resolve(__dirname, '..', 'dist'); 5 | const CopyPlugin = require('copy-webpack-plugin'); 6 | 7 | module.exports = { 8 | mode: 'production', 9 | context: appDir, 10 | entry: path.resolve(__dirname, '../src', 'js/index.js'), 11 | output: { 12 | filename: 'js/[name].js', 13 | path: distDir, 14 | publicPath: '/' 15 | }, 16 | module: { 17 | rules: [ 18 | { 19 | test: /\.js$/, 20 | include: [ 21 | path.resolve(__dirname, '../src') 22 | ], 23 | use: [ 24 | { 25 | loader: 'babel-loader', 26 | 'options': { 27 | sourceMap: true, 28 | presets: [['@babel/preset-env', { 29 | modules: false, 30 | useBuiltIns: 'entry' 31 | }]], 32 | plugins: [], 33 | babelrc: false 34 | } 35 | }, 36 | ], 37 | } 38 | ] 39 | }, 40 | plugins: [ 41 | new CopyPlugin([ 42 | { 43 | from: '**/*', 44 | to: distDir, 45 | context: staticDir, 46 | }, 47 | ]), 48 | ] 49 | }; -------------------------------------------------------------------------------- /web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "dunebuggy-web", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "webpack-dev-server --colors --host=0.0.0.0 --env.development", 8 | "build": "rimraf ./dist && webpack --colors --verbose --env.production" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "rimraf": "^3.0.0", 14 | "three": "^0.109.0" 15 | }, 16 | "devDependencies": { 17 | "@babel/core": "^7.6.4", 18 | "@babel/preset-env": "^7.6.3", 19 | "babel-loader": "^8.0.6", 20 | "copy-webpack-plugin": "^5.0.4", 21 | "webpack": "^4.41.0", 22 | "webpack-cli": "^3.3.9", 23 | "webpack-dev-server": "^3.8.1" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /web/src/js/index.js: -------------------------------------------------------------------------------- 1 | import { ARScene } from "./arscene.js"; 2 | 3 | 'use strict'; 4 | 5 | var arScene; 6 | var aboveFoldWrapper = document.getElementById('aboveTheFold'); 7 | var belowFoldWrapper = document.getElementById('belowTheFold'); 8 | var showInfo = false; 9 | var startTime = new Date().getTime(); 10 | 11 | function Main () { 12 | 13 | arScene = new ARScene(sceneLoaded); 14 | } 15 | 16 | function sceneLoaded(){ 17 | createOrangeLogo(function(){ 18 | // TweenLite.to("#duneBuggyLogoTitle", 0, {x:"-150%", y:"-4000%", scale:100}); 19 | 20 | var elapsed = new Date().getTime()-startTime; 21 | var waitTime = 1000; 22 | 23 | var introAnim = function(){ 24 | 25 | TweenLite.to("#prepreloader", 0.5, {opacity:0, onComplete:function(){ 26 | 27 | aboveFoldWrapper.style.display = "block"; 28 | belowFoldWrapper.style.display = "block"; 29 | document.getElementById("canvasContainer").appendChild(arScene.canvas); 30 | arScene.animate(); 31 | 32 | TweenLite.fromTo("#duneBuggyLogoTitle", 0.5, 33 | {x:"-125%", y:"-2200%", scale:60}, 34 | {x:"-50%", y:"-50%", scale:1.01, ease:Power0.easeOut, onComplete:function(){ 35 | TweenLite.to("#titleCard", .950, {y:"-100%", ease:Power4.easeInOut, delay:0.75}); 36 | }}) 37 | 38 | }}); 39 | } 40 | 41 | if(elapsed >= waitTime){ 42 | introAnim(); 43 | } else { 44 | setTimeout(introAnim, waitTime - elapsed) 45 | } 46 | 47 | 48 | }) 49 | } 50 | 51 | function createOrangeLogo(callback){ 52 | var canvas = document.createElement('canvas'); 53 | canvas.id = "duneBuggyLogoTitle"; 54 | canvas.width = 286; 55 | canvas.height = 375; 56 | var context = canvas.getContext('2d'); 57 | var imgObj = new Image(); 58 | imgObj.addEventListener('load', function(){ 59 | console.log('imageLoaded!'); 60 | context.fillStyle = 'rgb(246, 178, 47)'; 61 | context.fillRect(0, 0, canvas.width, canvas.height); 62 | context.globalCompositeOperation = "destination-atop"; 63 | context.drawImage(imgObj, 0, 0); 64 | 65 | document.getElementById("titleCard").appendChild(canvas); 66 | 67 | if(callback)callback(); 68 | }) 69 | imgObj.src = "images/duneBuggyLogo.png" 70 | 71 | } 72 | 73 | 74 | 75 | var portraitRatio = 800/10; 76 | 77 | function toggleInfo(){ 78 | showInfo = !showInfo; 79 | if(showInfo){ 80 | aboveFoldWrapper.classList.add("info") 81 | } else { 82 | aboveFoldWrapper.classList.remove("info") 83 | } 84 | } 85 | addClickListener(document.getElementById("AboutBtn"), toggleInfo); 86 | addClickListener(document.getElementById("aboutCloseIcon"), toggleInfo); 87 | 88 | 89 | function showPopUp(imgURL, linkURL){ 90 | document.getElementById("popUp").classList.add("show"); 91 | document.getElementById("darken").classList.add("show"); 92 | 93 | document.getElementById("QRImage").src = imgURL; 94 | document.getElementById("popUpLink").href = linkURL; 95 | 96 | // if(linkURL == "#"){ 97 | if(imgURL == "images/Insta_QRCode.png"){ 98 | // coming soon 99 | document.getElementById("popUpContent").style.display = "none"; 100 | document.getElementById("popUpComingSoon").style.display = "block"; 101 | } else { 102 | document.getElementById("popUpContent").style.display = "block"; 103 | document.getElementById("popUpComingSoon").style.display = "none"; 104 | } 105 | } 106 | function closePopUp(imgURL, linkURL){ 107 | document.getElementById("popUp").classList.remove("show"); 108 | document.getElementById("darken").classList.remove("show"); 109 | } 110 | addClickListener(document.getElementById("fbLink"), function(){ 111 | showPopUp("images/FB_QRCode.png", "https://www.facebook.com/fbcameraeffects/tryit/1307754219431648/") 112 | }); 113 | addClickListener(document.getElementById("instaLink"), function(){ 114 | showPopUp("images/Insta_QRCode.png", "https://www.instagram.com/a/r/?effect_id=644885626038284") 115 | }); 116 | addClickListener(document.getElementById("snapLink"), function(){ 117 | showPopUp("images/snapcode.png", "https://www.snapchat.com/unlock/?type=SNAPCODE&uuid=29afe3e6d2344edf8af81d0e6b52056b&metadata=01") 118 | }); 119 | addClickListener(document.getElementById("webARLink"), function(){ 120 | showPopUp("images/WebAR_QRCode.png", "https://dunebuggy.oblio.io/webAR/") 121 | }); 122 | addClickListener(document.getElementById("popUpCloseIcon"), closePopUp); 123 | addClickListener(document.getElementById("darken"), closePopUp); 124 | 125 | 126 | function startDriving(){ 127 | document.body.classList.add("driving"); 128 | arScene.autoDrive = false; 129 | TweenLite.to(arScene.camera.position, 0.75, {y: 70, z: 70, delay:0.5}) 130 | // camera.position 131 | } 132 | function stopDriving(){ 133 | document.body.classList.remove("driving"); 134 | arScene.autoDrive = true; 135 | TweenLite.to(arScene.camera.position, 0.75, {y: 100, z: 100}) 136 | } 137 | addClickListener(document.getElementById("driveHereBtn"), startDriving); 138 | addClickListener(document.getElementById("upperLeftContent"), stopDriving); 139 | 140 | 141 | function addClickListener(el, fn){ 142 | var initTouch = function (e) { 143 | el.removeEventListener('touchstart', initTouch); 144 | this.initTouchListener = null; 145 | el.removeEventListener('click', fn); 146 | el.addEventListener('touchstart', fn); 147 | fn(e); 148 | } 149 | el.addEventListener("touchstart", initTouch); 150 | el.addEventListener("click", fn); 151 | } 152 | 153 | function resize(){ 154 | var w = window.innerWidth; 155 | var h = window.innerHeight; 156 | 157 | var fontSize = Math.min(10, h/80); 158 | fontSize = Math.min(fontSize, w/56); 159 | aboveFoldWrapper.style.fontSize = fontSize+'px'; 160 | document.getElementById("upperLeftContent").style.fontSize = fontSize+'px'; 161 | 162 | var portraitSwitch = ((w)>840*(fontSize/10))?false:true; 163 | if(portraitSwitch){ 164 | document.body.classList.add("mobile") 165 | } else { 166 | document.body.classList.remove("mobile") 167 | } 168 | 169 | //size below the fold 170 | if(w > h){ 171 | fontSize = Math.min(10, w/110); 172 | document.getElementById("drivingInstructions").style.fontSize = fontSize+'px'; 173 | document.getElementById("inst_3").style.display = "flex"; 174 | document.getElementById("inst_4").style.display = "flex"; 175 | } else { 176 | fontSize = Math.min(10, w/42); 177 | document.getElementById("drivingInstructions").style.fontSize = fontSize+'px'; 178 | document.getElementById("inst_3").style.display = "none"; 179 | document.getElementById("inst_4").style.display = "none"; 180 | } 181 | } 182 | 183 | window.onresize = resize; 184 | resize(); 185 | 186 | window.main = new Main(); 187 | 188 | -------------------------------------------------------------------------------- /web/src/js/interaction.js: -------------------------------------------------------------------------------- 1 | var Interaction = (function(){ 2 | 3 | 'use strict'; 4 | /* jshint validthis: true */ 5 | 6 | function Interaction(props){ 7 | console.log('Interaction'); 8 | this.element = (props.element)?props.element:document.body; 9 | 10 | this.onTap = (props.onTap)?props.onTap:function(){}; 11 | this.onSwipeUp = (props.onSwipeUp)?props.onSwipeUp:function(){}; 12 | this.onSwipeDown = (props.onSwipeDown)?props.onSwipeDown:function(){}; 13 | this.onSwipeLeft = (props.onSwipeLeft)?props.onSwipeLeft:function(){}; 14 | this.onSwipeRight = (props.onSwipeRight)?props.onSwipeRight:function(){}; 15 | this.onDrag = (props.onDrag)?props.onDrag:function(){}; 16 | this.onDown = (props.onDown)?props.onDown:function(){}; 17 | this.onMove = (props.onMove)?props.onMove:function(){}; 18 | this.onUp = (props.onUp)?props.onUp:function(){}; 19 | this.onMouseWheel = (props.onMouseWheel)?props.onMouseWheel:null; 20 | 21 | this.dragState = { 22 | x:0, 23 | y:0, 24 | startX:0, 25 | startY:0, 26 | startTime:0 27 | } 28 | 29 | // add functions to this, binded to scope 30 | this.onMouseDown = onMouseDown.bind(this); 31 | this.onMouseMove = onMouseMove.bind(this); 32 | this.onMouseUp = onMouseUp.bind(this); 33 | 34 | this.onTouchStart = onTouchStart.bind(this); 35 | this.onTouchMove = onTouchMove.bind(this); 36 | this.onTouchEnd = onTouchEnd.bind(this); 37 | 38 | this.down = down.bind(this); 39 | this.move = move.bind(this); 40 | this.keyDown = keyDown.bind(this); 41 | this.keyUp = keyUp.bind(this); 42 | this.up = up.bind(this); 43 | 44 | this.arrows = { 45 | up: false, 46 | down: false, 47 | left: false, 48 | right: false 49 | } 50 | 51 | // add new listeners 52 | addListeners.call(this); 53 | } 54 | 55 | Interaction.prototype.destroy = function(){ 56 | // add new listeners 57 | removeListeners.call(this); 58 | 59 | this.element = null; 60 | 61 | this.onStart = null; 62 | this.onDrag = null; 63 | this.onEnd = null; 64 | 65 | this.onMouseDown = null; 66 | this.onMouseMove = null; 67 | this.onMouseUp = null; 68 | this.onTouchStart = null; 69 | this.onTouchMove = null; 70 | this.onTouchEnd = null; 71 | this.down = null; 72 | this.move = null; 73 | this.up = null; 74 | }; 75 | 76 | function addListeners(){ 77 | this.element.addEventListener('mousedown', this.onMouseDown); 78 | this.element.addEventListener('touchstart', this.onTouchStart); 79 | this.element.addEventListener('keydown', this.keyDown); 80 | this.element.addEventListener('keyup', this.keyUp); 81 | 82 | if(this.onMouseWheel)this.element.addEventListener('wheel', this.onMouseWheel) 83 | } 84 | 85 | function removeListeners(){ 86 | this.element.removeEventListener('mousedown', this.onMouseDown); 87 | this.element.removeEventListener('touchstart', this.onTouchStart); 88 | this.element.removeEventListener('keydown', this.keyDown); 89 | this.element.removeEventListener('keyup', this.keyUp); 90 | 91 | // are drag listeners still in place? remove them 92 | if(this.mousedrag)removeMouseDrag.call(this); 93 | if(this.touchdrag)removeTouchDrag.call(this); 94 | if(this.onMouseWheel)this.element.removeEventListener('wheel', this.onMouseWheel) 95 | } 96 | 97 | /* -------------------- MOUSE LISTENERS -------------------- */ 98 | 99 | function onMouseDown(e){ 100 | 101 | e.preventDefault(); 102 | 103 | if(this.dragging)return; 104 | 105 | this.down(e.pageX, e.pageY); 106 | 107 | 108 | addMouseDrag.call(this); 109 | } 110 | 111 | function addMouseDrag(){ 112 | 113 | this.mousedrag = true; 114 | 115 | 116 | document.body.addEventListener('mousemove', this.onMouseMove); 117 | document.body.addEventListener('mouseup', this.onMouseUp); 118 | document.body.addEventListener('mouseleave', this.onMouseUp); 119 | // $(document.body).on('mouseleave', this.onMouseUp); 120 | } 121 | 122 | function removeMouseDrag(){ 123 | 124 | this.mousedrag = false; 125 | document.body.removeEventListener('mousemove', this.onMouseMove); 126 | document.body.removeEventListener('mouseup', this.onMouseUp); 127 | document.body.removeEventListener('mouseleave', this.onMouseUp); 128 | // $(document.body).off('mouseleave', this.onMouseUp); 129 | } 130 | 131 | function onMouseMove(e){ 132 | e.preventDefault(); 133 | 134 | this.move(e.pageX, e.pageY); 135 | 136 | } 137 | 138 | function onMouseUp(e){ 139 | e.preventDefault(); 140 | 141 | this.up(e.pageX, e.pageY); 142 | 143 | removeMouseDrag.call(this); 144 | } 145 | 146 | 147 | /* -------------------- TOUCH LISTENERS -------------------- */ 148 | 149 | function onTouchStart(e){ 150 | 151 | e.preventDefault(); 152 | if(this.dragging)return; 153 | 154 | var touch = e.touches[0]; 155 | this.down(touch.pageX, touch.pageY); 156 | 157 | addTouchDrag.call(this); 158 | 159 | // e.preventDefault(); 160 | } 161 | 162 | function addTouchDrag(e){ 163 | this.touchdrag = true; 164 | document.body.addEventListener('touchmove', this.onTouchMove, {passive:false}); 165 | document.body.addEventListener('touchend', this.onTouchEnd); 166 | } 167 | 168 | function removeTouchDrag(){ 169 | this.touchdrag = false; 170 | document.body.removeEventListener('touchmove', this.onTouchMove, {passive:false}); 171 | document.body.removeEventListener('touchend', this.onTouchEnd); 172 | } 173 | 174 | function onTouchMove(e){ 175 | e.preventDefault(); 176 | var touch = e.touches[0]; 177 | this.move(touch.pageX, touch.pageY); 178 | // e.preventDefault(); 179 | 180 | } 181 | 182 | function onTouchEnd(e){ 183 | e.preventDefault(); 184 | var touch = e.changedTouches[0]; 185 | this.up(touch.pageX, touch.pageY); 186 | 187 | removeTouchDrag.call(this); 188 | // e.preventDefault(); 189 | } 190 | 191 | /* -------------------- DRAG FUNCTIONALITY -------------------- */ 192 | 193 | function down(x, y){ 194 | this.moved = false; 195 | this.dragging = true; 196 | 197 | this.dragState.x = this.dragState.startX = x; 198 | this.dragState.y = this.dragState.startY = y; 199 | 200 | this.dragState.maxMove = 0; 201 | this.dragState.startTime = Date.now(); 202 | this.dragState.currTime = this.dragState.startTime; 203 | this.dragState.deltaTime = 0; 204 | // if(this.onStart)this.onStart(x,y); 205 | this.onDown(x,y); 206 | 207 | } 208 | 209 | function move(x, y){ 210 | this.moved = true; 211 | 212 | this.onDrag(x,y,x-this.dragState.x,y-this.dragState.y); 213 | 214 | var now = Date.now(); 215 | this.dragState.deltaTime = now-this.dragState.currTime; 216 | this.dragState.currTime = now; 217 | 218 | this.dragState.maxMove = Math.max(this.dragState.maxMove, Math.pow(this.dragState.startX-x, 2)+Math.pow(this.dragState.startY-y, 2)); 219 | 220 | this.dragState.x = x; 221 | this.dragState.y = y; 222 | } 223 | 224 | function up(x, y){ 225 | this.dragging = false; 226 | // if(this.onEnd)this.onEnd(x,y); 227 | this.onUp(x, y, {distance:this.dragState.maxMove, duration:Date.now()-this.dragState.startTime}); 228 | } 229 | 230 | /* -------------------- KEYBOARD FUNCTIONALITY -------------------- */ 231 | 232 | function keyDown(e){ 233 | e = e || window.event; 234 | 235 | if (e.keyCode == '38') { // up 236 | this.arrows.up = true; 237 | } else if (e.keyCode == '40') { // down 238 | this.arrows.down = true; 239 | } else if (e.keyCode == '37') { // left 240 | this.arrows.left = true; 241 | } else if (e.keyCode == '39') { // arrow 242 | this.arrows.right = true; 243 | } 244 | } 245 | 246 | function keyUp(e){ 247 | e = e || window.event; 248 | 249 | if (e.keyCode == '38') { // up 250 | this.arrows.up = false; 251 | } else if (e.keyCode == '40') { // down 252 | this.arrows.down = false; 253 | } else if (e.keyCode == '37') { // left 254 | this.arrows.left = false; 255 | } else if (e.keyCode == '39') { // arrow 256 | this.arrows.right = false; 257 | } 258 | } 259 | 260 | 261 | 262 | Interaction.prototype.addListeners = addListeners; 263 | Interaction.prototype.removeListeners = removeListeners; 264 | 265 | return Interaction; 266 | })(); 267 | 268 | export { Interaction }; -------------------------------------------------------------------------------- /web/src/js/tiltShiftVignetteShader.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author alteredq / http://alteredqualia.com/ 3 | * 4 | * Simple fake tilt-shift effect, modulating two pass Gaussian blur (see above) by vertical position 5 | * 6 | * - 9 samples per pass 7 | * - standard deviation 2.7 8 | * - "h" and "v" parameters should be set to "1 / width" and "1 / height" 9 | * - "r" parameter control where "focused" horizontal line lies 10 | * 11 | * * 12 | * Vignette shader 13 | * based on PaintEffect postprocess from ro.me 14 | * http://code.google.com/p/3-dreams-of-black/source/browse/deploy/js/effects/PaintEffect.js 15 | * 16 | * 17 | * OBLIO - (we just combined alteredq's 2 shaders into one for efficiency) 18 | * 19 | */ 20 | 21 | 22 | 23 | var TiltShiftVignetteShader = { 24 | 25 | uniforms: { 26 | 27 | "tDiffuse": { value: null }, 28 | "v": { value: 1.0 / 512.0 }, 29 | "r": { value: 0.35 }, 30 | "offset": { value: 1.0 }, 31 | "darkness": { value: 1.0 } 32 | 33 | }, 34 | 35 | vertexShader: [ 36 | 37 | "varying vec2 vUv;", 38 | 39 | "void main() {", 40 | 41 | " vUv = uv;", 42 | " gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", 43 | 44 | "}" 45 | 46 | ].join( "\n" ), 47 | 48 | fragmentShader: [ 49 | 50 | "uniform sampler2D tDiffuse;", 51 | "uniform float v;", 52 | "uniform float r;", 53 | "uniform float offset;", 54 | "uniform float darkness;", 55 | 56 | "varying vec2 vUv;", 57 | 58 | "void main() {", 59 | 60 | " vec4 sum = vec4( 0.0 );", 61 | 62 | " float vv = v * abs( r - vUv.y );", 63 | 64 | " sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;", 65 | " sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;", 66 | " sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;", 67 | " sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;", 68 | " sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", 69 | " sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;", 70 | " sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;", 71 | " sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;", 72 | " sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;", 73 | 74 | " vec2 uv = pow( ( vUv - vec2( 0.5 ) ) * vec2( offset ), vec2(2.0) );", 75 | " gl_FragColor = vec4( mix( sum.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), sum.a );", 76 | 77 | "}" 78 | 79 | ].join( "\n" ) 80 | 81 | }; 82 | 83 | export { TiltShiftVignetteShader }; 84 | -------------------------------------------------------------------------------- /web/static/css/main.css: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * apply a natural box layout model to all elements 4 | * http://www.paulirish.com/2012/box-sizing-border-box-ftw/ 5 | */ 6 | * { 7 | box-sizing: border-box; 8 | } 9 | 10 | body { 11 | -ms-content-zooming: none; /* Disables zooming */ 12 | color: #FFFFFF; 13 | background: #f6b22f; 14 | font-family: 'Barlow Condensed', sans-serif; 15 | font-weight: 800; 16 | font-style: italic; 17 | letter-spacing: 1px; 18 | font-size: 10px; 19 | line-height: 1.5em; 20 | height: 100%; 21 | margin: 0px; 22 | padding: 0px; 23 | 24 | -webkit-touch-callout: none; /* iOS Safari */ 25 | -webkit-user-select: none; /* Safari */ 26 | -khtml-user-select: none; /* Konqueror HTML */ 27 | -moz-user-select: none; /* Old versions of Firefox */ 28 | -ms-user-select: none; /* Internet Explorer/Edge */ 29 | user-select: none; /* Non-prefixed version, currently 30 | supported by Chrome, Opera and Firefox */ 31 | } 32 | 33 | body.fixed { 34 | overflow: hidden; 35 | } 36 | 37 | a { 38 | color:#FFF; 39 | font-family: 'Barlow Condensed', sans-serif; 40 | font-weight: 800; 41 | font-style: italic; 42 | } 43 | 44 | #canvasContainer { 45 | position: fixed; 46 | top: 0; 47 | left: 0; 48 | } 49 | 50 | #prepreloader { 51 | pointer-events: none; 52 | position: fixed; 53 | width: 100%; 54 | height: 100%; 55 | background: rgba(25,25,25,0); 56 | top: 0; 57 | left: 0; 58 | opacity: 0; 59 | transition: background .5s ease-in-out; 60 | /* transform: translateZ(2px) */ 61 | } 62 | 63 | #prepreloader svg { 64 | position: absolute; 65 | visibility: visible; 66 | display: block; 67 | top: 50%; 68 | left: 50%; 69 | transform: translate3d(-50%,-50%,10px); 70 | z-index: 1 71 | } 72 | 73 | #prepreloader.pointer svg { 74 | cursor: pointer 75 | } 76 | 77 | #prepreloader.loading { 78 | opacity: 1 79 | } 80 | 81 | .rings .ring { 82 | stroke: #fff; 83 | fill: transparent 84 | } 85 | 86 | .rings #loader { 87 | fill: #fff 88 | } 89 | 90 | #aboveTheFold { 91 | position: absolute; 92 | left:0px; 93 | top:0%; 94 | width: 100%; 95 | height: 100%; 96 | 97 | font-size: 10px; 98 | display: none; 99 | transform: translateZ(2px); 100 | transition: top 750ms cubic-bezier(0.770, 0.000, 0.175, 1.000); 101 | overflow: hidden; 102 | } 103 | 104 | .driving #aboveTheFold { 105 | top: -100%; 106 | } 107 | 108 | #titleCard { 109 | position: absolute; 110 | left:0px; 111 | top:0%; 112 | width: 100%; 113 | height: 100%; 114 | background: #fff; 115 | z-index: 15; 116 | } 117 | 118 | #duneBuggyLogoTitle { 119 | position: absolute; 120 | height: 50%; 121 | left:50%; 122 | top:50%; 123 | } 124 | 125 | #darken { 126 | position: absolute; 127 | top:0%; 128 | left:0%; 129 | width: 100%; 130 | height: 100%; 131 | background: #000; 132 | z-index: 1; 133 | pointer-events: none; 134 | opacity: 0; 135 | transition: opacity 500ms; 136 | } 137 | #darken.show { 138 | opacity: 0.5; 139 | pointer-events: visible; 140 | } 141 | 142 | #popUp { 143 | position: absolute; 144 | top:150%; 145 | left:50%; 146 | transform: translate(-50%, -50%); 147 | padding: 2em; 148 | width: 50em; 149 | background: #000; 150 | text-align: center; 151 | z-index: 11; 152 | 153 | transition: top 500ms cubic-bezier(0.770, 0.000, 0.175, 1.000); 154 | } 155 | 156 | 157 | #popUp.show { 158 | top:50%; 159 | } 160 | 161 | #popUpCloseIcon { 162 | position: absolute; 163 | top: 1.5em; 164 | left: 1.5em; 165 | } 166 | 167 | #popUpCloseIcon svg { 168 | height: 3em; 169 | } 170 | 171 | #popUp p { 172 | text-transform: uppercase; 173 | font-size: 2em; 174 | font-weight: 500; 175 | font-style: normal; 176 | margin-top: 0em; 177 | margin-bottom: 1em; 178 | line-height: 1em; 179 | } 180 | 181 | #popUp a > p { 182 | display: block; 183 | font-size: 3em; 184 | line-height: 1.5em; 185 | margin-top: 0.5em; 186 | margin-bottom: 0; 187 | } 188 | 189 | #QRImage { 190 | display: block; 191 | width: 40em; 192 | height: 40em; 193 | margin: 0 auto; 194 | } 195 | 196 | #popUpComingSoon h1 { 197 | font-size: 2em; 198 | font-style: normal; 199 | } 200 | #popUpComingSoon a { 201 | font-size: 2em; 202 | } 203 | 204 | #rightContent { 205 | position: absolute; 206 | right: 10em; 207 | bottom: 50%; 208 | transform: translate(0, 50%); 209 | } 210 | 211 | .mobile #rightContent { 212 | bottom: 5em; 213 | right: 5em; 214 | transform: initial; 215 | } 216 | 217 | p.rightCopy { 218 | text-transform: uppercase; 219 | font-size: 2em; 220 | font-weight: 500; 221 | font-style: normal; 222 | margin: 0; 223 | } 224 | 225 | .rightLinks { 226 | list-style: none; 227 | padding: 0; 228 | } 229 | 230 | .rightLinks li { 231 | margin: 0; 232 | } 233 | 234 | .rightLinks li a { 235 | font-size: 2em; 236 | line-height: 1.5em; 237 | } 238 | 239 | #AR { 240 | position: relative; 241 | display: block; 242 | } 243 | 244 | #ARIcon { 245 | position: absolute; 246 | width: 5em; 247 | left: -7.5em; 248 | top: 0 249 | } 250 | 251 | #ORDivider { 252 | margin: 2em 0; 253 | } 254 | 255 | #DriveHere { 256 | position: relative; 257 | display: block; 258 | } 259 | 260 | #driveIcon { 261 | position: absolute; 262 | width: 4.5em; 263 | left: -7em; 264 | top: 0 265 | } 266 | 267 | 268 | #leftContent { 269 | position: absolute; 270 | left: 10em; 271 | width: 40%; 272 | top:5em; 273 | height: calc( 100% - 10em ); 274 | } 275 | 276 | .mobile #leftContent { 277 | left: 5em; 278 | } 279 | 280 | #duneBuggyLogo { 281 | max-height: 37.5em; 282 | max-width: 100%; 283 | } 284 | 285 | #AboutBtn { 286 | position: absolute; 287 | display: none; 288 | bottom: 0%; 289 | left:0%; 290 | padding: 0.5em; 291 | font-size: 3em; 292 | line-height: 1em; 293 | } 294 | 295 | .mobile #AboutBtn { 296 | display: block; 297 | } 298 | 299 | #AboutContent { 300 | position: absolute; 301 | bottom: 0%; 302 | left:0%; 303 | width: 100%; 304 | 305 | font-size: 2em; 306 | line-height: 1em; 307 | 308 | font-weight: 400; 309 | font-style: normal; 310 | } 311 | 312 | #aboutCloseIcon { 313 | display: none; 314 | } 315 | 316 | #aboutCloseIcon svg { 317 | height: 1.5em; 318 | } 319 | 320 | .mobile #aboutCloseIcon { 321 | display: block; 322 | } 323 | 324 | .mobile #AboutContent { 325 | transform: translate(0, calc( 100% + 5em ) ); 326 | background: #000; 327 | width: 250%; 328 | left: -2.5em; 329 | z-index: 10; 330 | padding: 2em 2.5em 3em 2.5em; 331 | 332 | transition: transform 500ms cubic-bezier(0.645, 0.045, 0.355, 1.000); 333 | } 334 | 335 | .mobile .info #AboutContent { 336 | transform: translate(0, 2.5em ); 337 | } 338 | 339 | #AboutContent p{ 340 | width: 24em; 341 | max-width: 100%; 342 | } 343 | 344 | #AboutContent a{ 345 | } 346 | 347 | #belowTheFold { 348 | position: absolute; 349 | left:0px; 350 | top:100%; 351 | width: 100%; 352 | height: 100%; 353 | 354 | font-size: 10px; 355 | display: none; 356 | transform: translateZ(2px); 357 | transition: top 750ms cubic-bezier(0.770, 0.000, 0.175, 1.000); 358 | overflow: hidden; 359 | } 360 | 361 | .driving #belowTheFold{ 362 | top:0%; 363 | } 364 | 365 | #upperLeftContent { 366 | position: absolute; 367 | left: 10em; 368 | top: 2em; 369 | } 370 | 371 | .mobile #upperLeftContent { 372 | left: 5em; 373 | } 374 | 375 | #backArrow { 376 | margin-left: 5em; 377 | width: 3em; 378 | display: block; 379 | } 380 | 381 | #duneBuggyLogoBackButton { 382 | width: 13em; 383 | } 384 | 385 | #drivingInstructions { 386 | position: absolute; 387 | bottom: 0%; 388 | left: 0%; 389 | width: 100%; 390 | 391 | background: rgba(0,0,0,0.6); 392 | display: flex; 393 | justify-content: center; 394 | 395 | padding: 2em 0.5em; 396 | list-style: none; 397 | margin: 0 auto; 398 | text-align: center; 399 | } 400 | 401 | #drivingInstructions li{ 402 | position: relative; 403 | display: flex; 404 | align-items: center; 405 | height: 9em; 406 | /* overflow: hidden; */ 407 | margin: 0 2em; 408 | } 409 | 410 | #drivingInstructions #inst_1 img{ 411 | width:6.9em; 412 | } 413 | #drivingInstructions #inst_2 img { 414 | width:8.3em; 415 | } 416 | #drivingInstructions #inst_3 img { 417 | width:11.8em; 418 | } 419 | #drivingInstructions #inst_4 img { 420 | width:11.9em; 421 | } 422 | 423 | #drivingInstructions li img { 424 | display: inline-block; 425 | } 426 | 427 | #drivingInstructions li p { 428 | display: inline-block; 429 | margin: 0 0 0 1em; 430 | /* padding: 0; */ 431 | /* position: relative; */ 432 | /* top: 50%; */ 433 | /* transform: translate(0%, -50%); */ 434 | font-style: normal; 435 | font-weight: 400; 436 | font-size: 1.5em; 437 | line-height: 1em; 438 | text-align: left; 439 | } 440 | 441 | 442 | @-ms-viewport { 443 | width: device-width; 444 | } -------------------------------------------------------------------------------- /web/static/images/FB_QRCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/FB_QRCode.png -------------------------------------------------------------------------------- /web/static/images/Insta_QRCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/Insta_QRCode.png -------------------------------------------------------------------------------- /web/static/images/WebAR_QRCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/WebAR_QRCode.png -------------------------------------------------------------------------------- /web/static/images/albedo_NE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/albedo_NE.jpg -------------------------------------------------------------------------------- /web/static/images/albedo_NW.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/albedo_NW.jpg -------------------------------------------------------------------------------- /web/static/images/albedo_SE.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/albedo_SE.jpg -------------------------------------------------------------------------------- /web/static/images/albedo_SW.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/albedo_SW.jpg -------------------------------------------------------------------------------- /web/static/images/alphaMask.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/alphaMask.jpg -------------------------------------------------------------------------------- /web/static/images/duneBuggyLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/duneBuggyLogo.png -------------------------------------------------------------------------------- /web/static/images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/favicon-16x16.png -------------------------------------------------------------------------------- /web/static/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/favicon-32x32.png -------------------------------------------------------------------------------- /web/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/favicon.ico -------------------------------------------------------------------------------- /web/static/images/finger_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/finger_01.png -------------------------------------------------------------------------------- /web/static/images/finger_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/finger_02.png -------------------------------------------------------------------------------- /web/static/images/keys_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/keys_01.png -------------------------------------------------------------------------------- /web/static/images/keys_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/keys_02.png -------------------------------------------------------------------------------- /web/static/images/og.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/og.jpg -------------------------------------------------------------------------------- /web/static/images/snapcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/images/snapcode.png -------------------------------------------------------------------------------- /web/static/js/ringsSVG.js: -------------------------------------------------------------------------------- 1 | (function (window) { 2 | 3 | var duration = 0.5; 4 | var delay = 0.05; 5 | 6 | var RingsSVG = function (data) { 7 | this.ratio = 31/87; // ratio of outer edge to inner donut hole radius 8 | this.strokeWidthRatio = 0.075; // width of stroke as percentage of donut width 9 | 10 | this.numrings = data.numrings || 9; 11 | if (this.numrings === 1) { 12 | this.strokeWidthRatio = 1; 13 | } 14 | 15 | this.loader = data.loader; 16 | 17 | this.wrapper = data.wrapper || document.body; 18 | this.maxRadius = data.maxRadius || this.wrapper.offsetWidth / 2 - 1; 19 | this.rings = []; 20 | this.isLoading = false; 21 | 22 | this.radius = data.radius || this.maxRadius; 23 | this.innerRadius = this.radius * this.ratio; 24 | 25 | this.strokeWidth = this.strokeWidthRatio * (this.radius - this.innerRadius); 26 | // this.maxStrokeWidth = this.strokeWidthRatio * (this.maxRadius - this.maxRadius * this.ratio); 27 | this.rdiff = ((this.radius - this.innerRadius) - (this.numrings - 1) * this.strokeWidth) / Math.max(1, this.numrings - 2); 28 | this.id = Math.round(Date.now() + Math.random() * Date.now()); // use Date.now to make a uid so I don't end up with multiple elements with the same id 29 | this.svg = makeRings.call(this); 30 | 31 | this.bg = data.bg; 32 | if (this.bg) { 33 | this.wrapper.appendChild(this.bg); 34 | } 35 | 36 | this.wrapper.appendChild(this.svg); 37 | }; 38 | 39 | function updateMaskUrl () { 40 | this.ringWrapper.setAttribute('mask', 'url(' + window.location.href + '#logomask' + this.id + ')'); 41 | } 42 | 43 | function makeRings () { 44 | this.svg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); 45 | this.svg.setAttribute('class', 'rings'); 46 | 47 | var ring; 48 | var svgNS = this.svg.namespaceURI; 49 | 50 | this.ringWrapper = document.createElementNS(svgNS, 'g'); 51 | 52 | if (this.loader) { 53 | this.loader = document.createElementNS(svgNS, 'path'); 54 | this.angle = 0; 55 | 56 | this.loader.id = 'loader'; 57 | this.ringWrapper.appendChild(this.loader); 58 | } 59 | 60 | for (var i = 0; i < this.numrings; i++) { 61 | ring = document.createElementNS(svgNS, 'circle'); 62 | ring.setAttribute('class', 'ring'); 63 | this.ringWrapper.appendChild(ring); 64 | this.rings.push(ring); 65 | } 66 | 67 | this.svg.appendChild(this.ringWrapper); 68 | 69 | resizeRings.call(this); 70 | 71 | return this.svg; 72 | } 73 | 74 | function resizeRings () { 75 | this.innerRadius = this.radius * this.ratio; 76 | this.strokeWidth = this.strokeWidthRatio * (this.radius - this.innerRadius); 77 | var r = this.radius - this.strokeWidth * 0.5; 78 | var svgsize = (this.radius * 1.5) * 2; // this.maxRadius * 2 + 2; 79 | this.svg.setAttribute('width', svgsize); 80 | this.svg.setAttribute('height', svgsize); 81 | 82 | for (var i = 0; i < this.rings.length; i++) { 83 | if (r < 0) { 84 | continue; 85 | } 86 | let ring = this.rings[i]; 87 | ring.setAttribute('cx', svgsize * 0.5); 88 | ring.setAttribute('cy', svgsize * 0.5); 89 | ring.setAttribute('r', r); 90 | ring.setAttribute('data-r', r); 91 | ring.setAttribute('class', 'ring'); 92 | 93 | ring.style.strokeWidth = this.strokeWidth + 'px'; 94 | this.rdiff = ((this.radius - this.innerRadius) - (this.numrings - 1) * this.strokeWidth) / Math.max(1, this.numrings - 2); 95 | 96 | r -= this.strokeWidth + this.rdiff; 97 | } 98 | } 99 | 100 | function loaderBGGoOut (callback) { 101 | TweenLite.fromTo(document.getElementById('loader_bg'), 0.5, { scale: 1 }, {scale: 0, ease: Power3.easeOut, delay: duration, onComplete: function () { 102 | callback() 103 | }}); 104 | } 105 | 106 | function loading () { 107 | if (!this.isLoading) { 108 | return; 109 | } 110 | 111 | var loading = true; 112 | var tl = new TimelineLite({ 113 | onComplete: function () { 114 | if (loading === false) { 115 | TweenLite.set(this.svg, {alpha: 0}); 116 | return; 117 | } 118 | 119 | if (this.isLoading) { 120 | tl.play(0) 121 | } else { 122 | loading = false; 123 | loaderBGGoOut.call(this, this.isOut); 124 | tl.play(0) 125 | } 126 | }.bind(this) 127 | }); 128 | var radius_multiplier = this.maxRadius - this.radius; 129 | 130 | for (var i = 0; i < this.rings.length; i++) { 131 | let ring = this.rings[i]; 132 | let base_r = Number(ring.getAttribute('data-r')); 133 | tl.to({t: 0}, duration * 0.5, 134 | { 135 | t: 1, 136 | ease: Power3.easeIn, 137 | onUpdateParams: ['{self}', ring, base_r], 138 | onUpdate: function (tween, ring, base_r) { 139 | let r = base_r + tween.target.t * radius_multiplier; 140 | ring.setAttribute('r', r); 141 | } 142 | }, 143 | i * delay 144 | ); 145 | tl.to({t: 1}, duration * 0.5, 146 | { 147 | t: 0, 148 | ease: Power3.easeOut, 149 | onUpdateParams: ['{self}', ring, base_r], 150 | onUpdate: function (tween, ring, base_r) { 151 | // let t = tween.target.t - (1 - tween.target.t) * base_r; 152 | let t = tween.target.t; 153 | let r = (base_r + t * radius_multiplier); 154 | 155 | if (!loading) { 156 | ring.style.strokeWidth = Math.max(0.1, t * this.strokeWidth); 157 | tl.timeScale(1 + (1 - t) * 4); 158 | r *= t; 159 | } 160 | ring.setAttribute('r', r); 161 | }.bind(this) 162 | }, 163 | i * delay + duration * 0.5 164 | ); 165 | } 166 | } 167 | 168 | function resizeBG () { 169 | let w = window.innerWidth, 170 | h = window.innerHeight, 171 | size = Math.ceil(Math.sqrt(w * w + h * h)); 172 | 173 | this.bg.style.left = this.bg.style.top = 'calc(50% - ' + (size * 0.5) + 'px)'; 174 | this.bg.style.width = this.bg.style.height = size + 'px'; 175 | } 176 | 177 | function resize (size, instant, callback, duration) { 178 | resizeRings.call(this); 179 | if (this.bg) { 180 | resizeBG.call(this); 181 | } 182 | 183 | if (this.isLoading || size === this.radius) { 184 | if (callback) { 185 | callback(); 186 | } 187 | return; 188 | } 189 | 190 | if (!size) { 191 | size = this.wrapper.offsetWidth / 2 - 1; 192 | } 193 | 194 | } 195 | 196 | RingsSVG.prototype.setProgress = function (angle) { 197 | var half = this.svg.getAttribute('width') / 2; 198 | angle = Math.min(angle, 359.9); 199 | 200 | var r = ( angle * Math.PI / 180 ), 201 | x = half + Math.sin( r ) * half, 202 | y = half + Math.cos( r ) * - half, 203 | mid = ( angle > 180 ) ? 1 : 0, 204 | anim = 'M ' + half + ' ' + half + ' v -' + half + ' A ' + half + ' ' + half + ' 1 ' + mid + ' 1 ' + x + ' ' + y + ' z'; 205 | 206 | this.loader.setAttribute( 'd', anim ); 207 | }; 208 | 209 | RingsSVG.prototype.stopLoading = function () { 210 | console.log('RINGS STOP LOADING'); 211 | return new Promise(function (resolve, reject) { 212 | this.isLoading = false; 213 | this.isOut = resolve; 214 | }.bind(this)); 215 | }; 216 | 217 | RingsSVG.prototype.startLoading = function () { 218 | if (!this.isLoading) { 219 | this.isLoading = true; 220 | loading.call(this); 221 | console.log('START LOADING!!!'); 222 | TweenLite.fromTo(this.svg, 0.75, {alpha: 0}, {alpha: 1, ease: Power3.easeInOut}); 223 | TweenLite.set('#loader_bg', {scale: 1}); 224 | } 225 | }; 226 | 227 | RingsSVG.prototype.loaderBGGoOut = loaderBGGoOut; 228 | RingsSVG.prototype.resize = resize; 229 | 230 | window.oblio = window.oblio || {}; 231 | oblio.app = oblio.app || {}; 232 | oblio.app.RingsSVG = RingsSVG; 233 | 234 | }(window)); -------------------------------------------------------------------------------- /web/static/models/duneBuggy.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Oblioio/DuneBuggyAR/5d9d38a5354b48f48052454d7ec76c5eee973bf4/web/static/models/duneBuggy.glb -------------------------------------------------------------------------------- /web/webpack.config.js: -------------------------------------------------------------------------------- 1 | function buildConfig (env) { 2 | 3 | let file; 4 | if (env.development) { 5 | file = 'dev'; 6 | } else if (env.production) { 7 | file = 'prod'; 8 | } else { 9 | throw new Error('You must set environment to either development or production in webpack call. e.g. webpack --env.production'); 10 | } 11 | 12 | return require('./config/webpack.config.' + file + '.js'); 13 | } 14 | 15 | module.exports = env => buildConfig(env); --------------------------------------------------------------------------------