├── .gitignore ├── bundler ├── webpack.common.js ├── webpack.dev.js └── webpack.prod.js ├── package-lock.json ├── package.json ├── readme.md ├── src ├── .index.html.swp ├── index.html ├── script.js ├── style.css └── world │ ├── car.js │ └── generateCode.js └── static ├── .gitkeep ├── draco ├── README.md ├── draco_decoder.js ├── draco_decoder.wasm ├── draco_encoder.js ├── draco_wasm_wrapper.js └── gltf │ ├── draco_decoder.js │ ├── draco_decoder.wasm │ ├── draco_encoder.js │ └── draco_wasm_wrapper.js ├── models ├── cybertruck │ ├── chassis.gltf │ ├── tesla-cybertruck.blend │ └── wheel.gltf └── mclaren │ ├── car.gltf │ ├── chassis.gltf │ ├── draco │ ├── chassis.gltf │ └── wheel.gltf │ └── wheel.gltf └── textures └── environmentMaps ├── 0 ├── nx.jpg ├── ny.jpg ├── nz.jpg ├── px.jpg ├── py.jpg └── pz.jpg ├── 1 ├── nx.jpg ├── ny.jpg ├── nz.jpg ├── px.jpg ├── py.jpg └── pz.jpg ├── 2 ├── nx.jpg ├── ny.jpg ├── nz.jpg ├── px.jpg ├── py.jpg └── pz.jpg └── 3 ├── nx.jpg ├── ny.jpg ├── nz.jpg ├── px.jpg ├── py.jpg └── pz.jpg /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /bundler/webpack.common.js: -------------------------------------------------------------------------------- 1 | const CopyWebpackPlugin = require('copy-webpack-plugin') 2 | const HtmlWebpackPlugin = require('html-webpack-plugin') 3 | const MiniCSSExtractPlugin = require('mini-css-extract-plugin') 4 | const path = require('path') 5 | 6 | module.exports = { 7 | entry: path.resolve(__dirname, '../src/script.js'), 8 | output: 9 | { 10 | filename: 'bundle.[contenthash].js', 11 | path: path.resolve(__dirname, '../dist') 12 | }, 13 | devtool: 'source-map', 14 | plugins: 15 | [ 16 | new CopyWebpackPlugin({ 17 | patterns: [ 18 | { from: path.resolve(__dirname, '../static') } 19 | ] 20 | }), 21 | new HtmlWebpackPlugin({ 22 | template: path.resolve(__dirname, '../src/index.html'), 23 | minify: true 24 | }), 25 | new MiniCSSExtractPlugin() 26 | ], 27 | module: 28 | { 29 | rules: 30 | [ 31 | // HTML 32 | { 33 | test: /\.(html)$/, 34 | use: ['html-loader'] 35 | }, 36 | 37 | // JS 38 | { 39 | test: /\.js$/, 40 | exclude: /node_modules/, 41 | use: 42 | [ 43 | 'babel-loader' 44 | ] 45 | }, 46 | 47 | // CSS 48 | { 49 | test: /\.css$/, 50 | use: 51 | [ 52 | MiniCSSExtractPlugin.loader, 53 | 'css-loader' 54 | ] 55 | }, 56 | 57 | // Images 58 | { 59 | test: /\.(jpg|png|gif|svg)$/, 60 | use: 61 | [ 62 | { 63 | loader: 'file-loader', 64 | options: 65 | { 66 | outputPath: 'assets/images/' 67 | } 68 | } 69 | ] 70 | }, 71 | 72 | // Fonts 73 | { 74 | test: /\.(ttf|eot|woff|woff2)$/, 75 | use: 76 | [ 77 | { 78 | loader: 'file-loader', 79 | options: 80 | { 81 | outputPath: 'assets/fonts/' 82 | } 83 | } 84 | ] 85 | } 86 | ] 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /bundler/webpack.dev.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge') 2 | const commonConfiguration = require('./webpack.common.js') 3 | const ip = require('internal-ip') 4 | const portFinderSync = require('portfinder-sync') 5 | 6 | const infoColor = (_message) => 7 | { 8 | return `\u001b[1m\u001b[34m${_message}\u001b[39m\u001b[22m` 9 | } 10 | 11 | module.exports = merge( 12 | commonConfiguration, 13 | { 14 | mode: 'development', 15 | devServer: 16 | { 17 | host: '0.0.0.0', 18 | port: portFinderSync.getPort(8080), 19 | contentBase: './dist', 20 | watchContentBase: true, 21 | open: true, 22 | https: false, 23 | useLocalIp: true, 24 | disableHostCheck: true, 25 | overlay: true, 26 | noInfo: true, 27 | after: function(app, server, compiler) 28 | { 29 | const port = server.options.port 30 | const https = server.options.https ? 's' : '' 31 | const localIp = ip.v4.sync() 32 | const domain1 = `http${https}://${localIp}:${port}` 33 | const domain2 = `http${https}://localhost:${port}` 34 | 35 | console.log(`Project running at:\n - ${infoColor(domain1)}\n - ${infoColor(domain2)}`) 36 | } 37 | } 38 | } 39 | ) 40 | -------------------------------------------------------------------------------- /bundler/webpack.prod.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge') 2 | const commonConfiguration = require('./webpack.common.js') 3 | const { CleanWebpackPlugin } = require('clean-webpack-plugin') 4 | 5 | module.exports = merge( 6 | commonConfiguration, 7 | { 8 | mode: 'production', 9 | plugins: 10 | [ 11 | new CleanWebpackPlugin() 12 | ] 13 | } 14 | ) 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "build": "webpack --config ./bundler/webpack.prod.js", 4 | "start": "webpack serve --config ./bundler/webpack.dev.js" 5 | }, 6 | "dependencies": { 7 | "@babel/core": "^7.12.10", 8 | "@babel/preset-env": "^7.12.11", 9 | "babel-loader": "^8.2.2", 10 | "cannon": "^0.6.2", 11 | "cannon-es": "^0.18.0", 12 | "cannon-es-debugger": "^0.1.4", 13 | "clean-webpack-plugin": "^3.0.0", 14 | "copy-to-clipboard": "^3.3.1", 15 | "copy-webpack-plugin": "^7.0.0", 16 | "css-loader": "^5.0.1", 17 | "file-loader": "^6.2.0", 18 | "file-saver": "^2.0.5", 19 | "guify": "^0.12.0", 20 | "html-loader": "^1.3.2", 21 | "html-webpack-plugin": "^5.0.0-alpha.7", 22 | "jszip": "^3.7.0", 23 | "mini-css-extract-plugin": "^1.3.4", 24 | "portfinder-sync": "0.0.2", 25 | "raw-loader": "^4.0.2", 26 | "stats.js": "^0.17.0", 27 | "stringify-object": "^3.3.0", 28 | "style-loader": "^2.0.0", 29 | "three": "^0.124.0", 30 | "three-gltf-exporter": "^0.0.1", 31 | "webpack": "^5.14.0", 32 | "webpack-cli": "^4.3.1", 33 | "webpack-dev-server": "^3.11.2", 34 | "webpack-merge": "^5.7.3" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Raycast Vehicle Engine 2 | 3 | [![rv-engine-gif](https://user-images.githubusercontent.com/52719271/128848701-ccee33e9-4958-4c59-b8ac-92b3bd3a1e45.gif)](https://rv-engine.vercel.app/) 4 | 5 | Simply upload your favourite car's chassis model and car's wheel model and the RV Engine would automatically create a car with the same look and feel. It would also be able to control the car's movement and rotation. Add physics and everything else you want to the car and you're good to go. 6 | After that you can simply download it as a zip file. Follow the same setup procedure, and you have a new raycast vehicle generated. 7 | 8 | ## Features 9 | - Vehicle physics 10 | - Change Vehicle Mass, Suspension Strength, Suspension Damping, etc. 11 | - Change the position of each wheel, set the size of each wheel and have all the controls to yourself. 12 | - Change the max speed of the car, movement controls etc directly from the GUI. 13 | - Position the chassis from GUI, see helper to view the chassis in the physics world. Same goes for all of the wheels. 14 | - Generate code, simply either copy Car.JS code or Download the ZIP file that has everything sitting ready for you. All you need to do is install it using npm once unzipped. 15 | 16 | ## Setup 17 | Download [Node.js](https://nodejs.org/en/download/). 18 | Run this followed commands: 19 | 20 | ``` bash 21 | # Install dependencies (only the first time) 22 | npm install 23 | 24 | # Run the local server at localhost:8080 25 | npm run dev 26 | 27 | # Build for production in the dist/ directory 28 | npm run build 29 | ``` 30 | 31 | ## Built With 32 | - [ThreeJS](https://threejs.org/) - JavaScript 3D library 33 | - [Webpack](https://webpack.js.org/) - Module bundler 34 | - [Babel](https://babeljs.io/) - ES6 to ES5 transpiler 35 | - [Cannon-ES](https://pmndrs.github.io/cannon-es/) - 3D physics engine 36 | - [Guify](https://github.com/colejd/guify) - GUI framework 37 | - [JSZip](https://stuk.github.io/jszip/) - JSZip is a javascript library for creating, reading and editing .zip files, with a lovely and simple API. 38 | - [Stats.JS](https://github.com/mrdoob/stats.js/) - JavaScript Performance Monitor 39 | - [File Saver](https://www.npmjs.com/package/file-saver) - Save files to disk 40 | 41 | ## What's next? 42 | - [ ] Add more physics to the car 43 | - [ ] Add more wheels to the car 44 | - [ ] Add more features to the car 45 | - [ ] Add more car models 46 | - [ ] Add more physics models 47 | - [ ] Add more wheel models 48 | 49 | ### Written by [Jaagrav](https://github.com/Jaagrav) 50 | -------------------------------------------------------------------------------- /src/.index.html.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jaagrav/raycast-vehicle-engine/2283abb336ae1134e5508db639bc6de773401d79/src/.index.html.swp -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Raycast Vehicle Engine 7 | 8 | 9 | 10 |
0% Loading...
11 | 12 | 17 | 18 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/script.js: -------------------------------------------------------------------------------- 1 | import './style.css' 2 | import * as THREE from 'three' 3 | import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js' 4 | import { Reflector } from 'three/examples/jsm/objects/Reflector.js'; 5 | import * as CANNON from 'cannon-es' 6 | import cannonDebugger from 'cannon-es-debugger' 7 | import Guify from 'guify' 8 | import Stats from 'stats.js'; 9 | import {Car} from './world/car'; 10 | 11 | const loader = document.querySelector('.loader'); 12 | 13 | var stats = new Stats(); 14 | stats.showPanel( 0 ); // 0: fps, 1: ms, 2: mb, 3+: custom 15 | document.body.appendChild( stats.dom ); 16 | 17 | /** 18 | * Base 19 | */ 20 | // Canvas 21 | const gui = new Guify({align: 'right', theme: 'dark', width: '400px', barMode: 'none'}) 22 | gui.Register({type: 'folder', label: 'Upload', open: true}) 23 | gui.Register({type: 'folder', label: 'Vehicle', open: true}) 24 | gui.Register({type: 'folder', label: 'Chassis', open: true}) 25 | gui.Register({type: 'folder', label: 'Wheels', open: true}) 26 | gui.Register({type: 'folder', label: 'Generate Code', open: true}) 27 | 28 | gui.Register({folder: 'Chassis', type: 'folder', label: 'Chassis Helper', open: true}) 29 | gui.Register({folder: 'Chassis', type: 'folder', label: 'Chassis Model', open: true}) 30 | gui.Register({folder: 'Chassis Helper', type: 'folder', label: 'Chassis Helper Dimension', open: true}) 31 | gui.Register({folder: 'Chassis Model', type: 'folder', label: 'Chassis Model Position', open: true}) 32 | gui.Register({folder: 'Wheels', type: 'folder', label: 'Wheels Helper', open: true}) 33 | gui.Register({folder: 'Wheels Helper', type: 'folder', label: 'Wheel Helper Position', open: false}) 34 | 35 | const loadingManager = new THREE.LoadingManager(); 36 | const canvas = document.querySelector('canvas.webgl') 37 | const scene = new THREE.Scene() 38 | const world = new CANNON.World({ 39 | gravity: new CANNON.Vec3(0, -9.82, 0), // m/s² 40 | }) 41 | world.broadphase = new CANNON.SAPBroadphase(world); 42 | // cannonDebugger(scene, world.bodies, {color: 0x00ff00}) 43 | 44 | const car = new Car(scene, world, gui, loadingManager); 45 | loadingManager.onProgress = (url, itemsLoaded, itemsTotal) => { 46 | loader.textContent = `${Math.round(itemsLoaded / itemsTotal * 100)}% Loading...`; 47 | if(itemsLoaded === itemsTotal) { 48 | setTimeout(() => { 49 | loader.style.opacity = '0'; 50 | }, 2000); 51 | } 52 | } 53 | loadingManager.onLoad = () => { 54 | car.init(); 55 | } 56 | 57 | const bodyMaterial = new CANNON.Material(); 58 | const groundMaterial = new CANNON.Material(); 59 | const bodyGroundContactMaterial = new CANNON.ContactMaterial( 60 | bodyMaterial, 61 | groundMaterial, 62 | { 63 | friction: 0.1, 64 | restitution: 0.3 65 | } 66 | ) 67 | world.addContactMaterial(bodyGroundContactMaterial) 68 | 69 | /** 70 | * Lights 71 | */ 72 | const ambientLight = new THREE.AmbientLight(0xffffff, 0.4) 73 | const spotLight = new THREE.SpotLight( 0x29dfff, 2, 0, 0.9, 1, 0 ); 74 | spotLight.position.set( 7, 1.291, -6 ); 75 | const spotLight2 = new THREE.SpotLight( 0x943dff, 2, 0, 0.9, 1, 0 ); 76 | spotLight2.position.set( -7, 1.291, -6 ); 77 | const spotLight3 = new THREE.SpotLight( 0xd5f8ff, 2, 0, 0.9, 1, 0 ); 78 | spotLight3.position.set( 0, 1.291, 7 ); 79 | scene.add(spotLight, spotLight2, spotLight3); 80 | 81 | /** 82 | * Cube Texture Loader 83 | */ 84 | const cubeTextureLoader = new THREE.CubeTextureLoader() 85 | const cubeEnvironmentMapTexture = cubeTextureLoader.load([ 86 | "/textures/environmentMaps/2/px.jpg", 87 | "/textures/environmentMaps/2/nx.jpg", 88 | "/textures/environmentMaps/2/py.jpg", 89 | "/textures/environmentMaps/2/ny.jpg", 90 | "/textures/environmentMaps/2/pz.jpg", 91 | "/textures/environmentMaps/2/nz.jpg", 92 | ]) 93 | // scene.background = cubeEnvironmentMapTexture 94 | scene.environment = cubeEnvironmentMapTexture 95 | 96 | /** 97 | * Sizes 98 | */ 99 | const sizes = { 100 | width: window.innerWidth, 101 | height: window.innerHeight 102 | } 103 | 104 | window.addEventListener('resize', () => 105 | { 106 | // Update sizes 107 | sizes.width = window.innerWidth 108 | sizes.height = window.innerHeight 109 | 110 | // Update camera 111 | camera.aspect = sizes.width / sizes.height 112 | camera.updateProjectionMatrix() 113 | 114 | // Update renderer 115 | renderer.setSize(sizes.width, sizes.height) 116 | renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)) 117 | }) 118 | 119 | /** 120 | * Floor 121 | */ 122 | const floorGeo = new THREE.PlaneBufferGeometry(100, 100); 123 | const floorMirror = new Reflector( floorGeo, { 124 | clipBias: 0.003, 125 | textureWidth: window.innerWidth * window.devicePixelRatio, 126 | textureHeight: window.innerHeight * window.devicePixelRatio, 127 | color: 0xffffff 128 | }); 129 | const floorMesh = new THREE.Mesh( 130 | floorGeo, 131 | new THREE.MeshStandardMaterial({ 132 | color: 0xffffff, 133 | roughness: 0.5, 134 | metalness: 0, 135 | emissive: 0xffffff, 136 | emissiveIntensity: -0.36, 137 | transparent: true, 138 | opacity: 0.7 139 | }) 140 | ) 141 | floorMirror.rotation.x = -Math.PI * 0.5; 142 | floorMesh.rotation.x = -Math.PI * 0.5; 143 | floorMesh.position.y = 0.001; 144 | scene.add(floorMirror, floorMesh) 145 | 146 | const floorS = new CANNON.Plane(); 147 | const floorB = new CANNON.Body(); 148 | floorB.mass = 0; 149 | 150 | floorB.addShape(floorS); 151 | world.addBody(floorB); 152 | 153 | floorB.quaternion.setFromAxisAngle( 154 | new CANNON.Vec3(-1, 0, 0), 155 | Math.PI * 0.5 156 | ); 157 | 158 | /** 159 | * Camera 160 | */ 161 | // Base camera 162 | const camera = new THREE.PerspectiveCamera(50, sizes.width / sizes.height, 0.1, 10000) 163 | camera.position.set(0, 4, 6) 164 | scene.add(camera) 165 | 166 | // Controls 167 | const controls = new OrbitControls(camera, canvas) 168 | controls.enableDamping = true 169 | 170 | /** 171 | * Renderer 172 | */ 173 | const renderer = new THREE.WebGLRenderer({ 174 | canvas: canvas, 175 | antialias: true, 176 | }) 177 | renderer.setSize(sizes.width, sizes.height) 178 | renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)) 179 | 180 | /** 181 | * Animate 182 | */ 183 | const timeStep = 1 / 60 // seconds 184 | let lastCallTime 185 | 186 | const tick = () => 187 | { 188 | stats.begin(); 189 | // Update controls 190 | controls.update() 191 | 192 | const time = performance.now() / 1000 // seconds 193 | if (!lastCallTime) { 194 | world.step(timeStep) 195 | } else { 196 | const dt = time - lastCallTime 197 | world.step(timeStep, dt) 198 | } 199 | lastCallTime = time 200 | 201 | // Render 202 | renderer.render(scene, camera) 203 | stats.end(); 204 | // Call tick again on the next frame 205 | window.requestAnimationFrame(tick) 206 | } 207 | 208 | tick() 209 | -------------------------------------------------------------------------------- /src/style.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=Abel&display=swap'); 2 | 3 | * 4 | { 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | html, 10 | body 11 | { 12 | overflow: hidden; 13 | } 14 | 15 | .webgl 16 | { 17 | position: fixed; 18 | top: 0; 19 | left: 0; 20 | outline: none; 21 | } 22 | 23 | .loader { 24 | position: fixed; 25 | margin: auto; 26 | top: 0; 27 | left: 0; 28 | right: 0; 29 | bottom: 0; 30 | padding: 24px; 31 | height: fit-content; 32 | width: fit-content; 33 | font-family: 'Abel', sans-serif; 34 | font-size: 48px; 35 | color: #fff; 36 | background: #ffffff42; 37 | border-radius: 24px; 38 | backdrop-filter: blur(12px); 39 | pointer-events: none; 40 | transition: .3s ease-in-out; 41 | } 42 | 43 | .guify-panel_39NJay { 44 | max-height: 100vh; 45 | overflow: auto; 46 | } 47 | 48 | ::-webkit-scrollbar { 49 | background: #363636; 50 | width: 15.5px; 51 | } 52 | 53 | ::-webkit-scrollbar-thumb { 54 | background: #707070; 55 | } 56 | -------------------------------------------------------------------------------- /src/world/car.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three'; 2 | import * as CANNON from 'cannon-es'; 3 | 4 | import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; 5 | import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js'; 6 | 7 | import copy from "copy-to-clipboard"; 8 | import GenerateCode from "./generateCode"; 9 | 10 | export class Car { 11 | constructor(scene, world, gui, loadingManager) { 12 | this.scene = scene; 13 | this.world = world; 14 | this.gui = gui; 15 | this.loadingManager = loadingManager; 16 | 17 | this.car = {}; 18 | this.car.helpChassisGeo = {}; 19 | this.car.helpChassisMat = {}; 20 | this.car.helpChassis = {}; 21 | this.chassis = {}; 22 | this.chassisModel = {}; 23 | this.wheelModel = {}; 24 | this.wheels = []; 25 | this.chassisDimension = {x: 1.96, y: 1, z: 4.47}; 26 | this.chassisModelPos = {x: 0, y: -0.59, z: 0}; 27 | this.wheelScale = {frontWheel: 0.67, hindWheel: 0.67}; 28 | this.controlOptions = { 29 | maxSteerVal: 0.5, 30 | maxForce: 750, 31 | brakeForce: 36, 32 | slowDownCar: 19.6, 33 | primaryKeys: { 34 | forward: 'w', 35 | backward: 's', 36 | left: 'a', 37 | right: 'd', 38 | reset: 'r', 39 | brake: ' ' 40 | }, 41 | secondaryKeys: { 42 | forward: 'arrowup', 43 | backward: 'arrowdown', 44 | left: 'arrowleft', 45 | right: 'arrowright', 46 | reset: 'r', 47 | brake: ' ' 48 | } 49 | }; 50 | 51 | this.loadModels(); 52 | } 53 | init() { 54 | this.setChassis(); 55 | this.setWheels(); 56 | this.controls(); 57 | this.update(); 58 | this.guiRegisterer(); 59 | this.loadViaModelUploader(); 60 | } 61 | loadModels() { 62 | const gltfLoader = new GLTFLoader(this.loadingManager); 63 | const dracoLoader = new DRACOLoader(); 64 | 65 | dracoLoader.setDecoderConfig({ type: 'js' }) 66 | dracoLoader.setDecoderPath('draco/'); 67 | 68 | gltfLoader.setDRACOLoader(dracoLoader); 69 | 70 | const demo_car = 'mclaren'; 71 | 72 | gltfLoader.load(`./models/${demo_car}/draco/chassis.gltf`, gltf => { 73 | this.chassisModel = gltf; 74 | this.chassis = gltf.scene; 75 | this.chassis.helpChassisGeo = new THREE.BoxBufferGeometry(1, 1, 1); 76 | this.chassis.helpChassisMat = new THREE.MeshBasicMaterial({color: 0xff0000, wireframe: true}); 77 | this.chassis.helpChassis = new THREE.Mesh(this.chassis.helpChassisGeo, this.chassis.helpChassisMat); 78 | this.scene.add(this.chassis, this.chassis.helpChassis); 79 | }) 80 | this.wheels = []; 81 | for(let i = 0 ; i < 4 ; i++) { 82 | gltfLoader.load(`./models/${demo_car}/draco/wheel.gltf`, gltf => { 83 | this.wheelModel = gltf; 84 | const model = gltf.scene; 85 | this.wheels[i] = model; 86 | if(i === 1 || i === 3) 87 | this.wheels[i].scale.set(-1 * this.wheelScale.frontWheel, 1 * this.wheelScale.frontWheel, -1 * this.wheelScale.frontWheel); 88 | else 89 | this.wheels[i].scale.set(1 * this.wheelScale.frontWheel, 1 * this.wheelScale.frontWheel, 1 * this.wheelScale.frontWheel); 90 | this.scene.add(this.wheels[i]); 91 | }) 92 | } 93 | } 94 | loadViaModelUploader() { 95 | const obj = this; 96 | const addChassisViaUpload = (e) => { 97 | const gltfLoader = new GLTFLoader(); 98 | gltfLoader.parse( e, '', function( gltf ){ 99 | obj.chassisModel = gltf; 100 | console.log(gltf); 101 | obj.scene.remove(obj.chassis); 102 | const temp = obj.chassis; 103 | obj.chassis = gltf.scene; 104 | obj.scene.add(obj.chassis); 105 | obj.chassis = {...temp, ...gltf.scene}; 106 | }); 107 | } 108 | const addWheelViaUpload = (e) => { 109 | const gltfLoader = new GLTFLoader(); 110 | for(let i = 0 ; i < 4 ; i++) { 111 | gltfLoader.parse( e, '', function( gltf ){ 112 | obj.wheelModel = gltf; 113 | obj.scene.remove(obj.wheels[i]); 114 | const temp = obj.wheels[i]; 115 | obj.wheels[i] = gltf.scene; 116 | if(i === 1 || i === 3) 117 | obj.wheels[i].scale.set(-1 * obj.wheelScale.frontWheel, 1 * obj.wheelScale.frontWheel, -1 * obj.wheelScale.frontWheel); 118 | else 119 | obj.wheels[i].scale.set(1 * obj.wheelScale.frontWheel, 1 * obj.wheelScale.frontWheel, 1 * obj.wheelScale.frontWheel); 120 | obj.scene.add(obj.wheels[i]); 121 | obj.wheels[i] = {...temp, ...gltf.scene}; 122 | }) 123 | } 124 | }; 125 | obj.gui.Register({folder: 'Upload', type: 'file', label: 'Upload Chassis Model (GLTF Only)', fileReadFunc: "readAsArrayBuffer", onChange: addChassisViaUpload}); 126 | obj.gui.Register({folder: 'Upload', type: 'file', label: 'Upload Wheel Model (GLTF Only)', fileReadFunc: "readAsArrayBuffer", onChange: addWheelViaUpload}); 127 | } 128 | setChassis() { 129 | //Setting up the chassis 130 | const chassisShape = new CANNON.Box(new CANNON.Vec3(this.chassisDimension.x * 0.5, this.chassisDimension.y * 0.5, this.chassisDimension.z * 0.5)); 131 | const chassisBody = new CANNON.Body({mass: 250, material: new CANNON.Material({friction: 0})}); 132 | chassisBody.addShape(chassisShape); 133 | 134 | this.chassis.helpChassis.visible = false; 135 | this.chassis.helpChassis.scale.set(this.chassisDimension.x, this.chassisDimension.y, this.chassisDimension.z); 136 | 137 | this.car = new CANNON.RaycastVehicle({ 138 | chassisBody, 139 | indexRightAxis: 0, 140 | indexUpAxis: 1, 141 | indexForwardAxis: 2 142 | }); 143 | this.car.addToWorld(this.world); 144 | } 145 | setWheels() { 146 | const options = { 147 | radius: 0.34, 148 | directionLocal: new CANNON.Vec3(0, -1, 0), 149 | suspensionStiffness: 55, 150 | suspensionRestLength: 0.5, 151 | frictionSlip: 30, 152 | dampingRelaxation: 2.3, 153 | dampingCompression: 4.3, 154 | maxSuspensionForce: 10000, 155 | rollInfluence: 0.01, 156 | axleLocal: new CANNON.Vec3(-1, 0, 0), 157 | chassisConnectionPointLocal: new CANNON.Vec3(0, 0, 0), 158 | maxSuspensionTravel: 1, 159 | customSlidingRotationalSpeed: 30, 160 | }; 161 | const setWheelChassisConnectionPoint = (index, position) => { 162 | this.car.wheelInfos[index].chassisConnectionPointLocal.copy(position); 163 | } 164 | 165 | this.car.wheelInfos = []; 166 | this.car.addWheel(options); 167 | this.car.addWheel(options); 168 | this.car.addWheel(options); 169 | this.car.addWheel(options); 170 | setWheelChassisConnectionPoint(0, new CANNON.Vec3(0.75, 0.1, -1.32)); 171 | setWheelChassisConnectionPoint(1, new CANNON.Vec3(-0.78, 0.1, -1.32)); 172 | setWheelChassisConnectionPoint(2, new CANNON.Vec3(0.75, 0.1, 1.25)); 173 | setWheelChassisConnectionPoint(3, new CANNON.Vec3(-0.78, 0.1, 1.25)); 174 | 175 | this.car.wheelInfos.forEach( function(wheel, index){ 176 | const cylinderShape = new CANNON.Cylinder(wheel.radius, wheel.radius, wheel.radius / 2, 20) 177 | const wheelBody = new CANNON.Body({ 178 | mass: 1, 179 | material: new CANNON.Material({friction: 0}), 180 | }) 181 | const quaternion = new CANNON.Quaternion().setFromEuler(-Math.PI / 2, 0, 0) 182 | wheelBody.addShape(cylinderShape, new CANNON.Vec3(), quaternion) 183 | this.wheels[index].wheelBody = wheelBody; 184 | this.wheels[index].helpWheelsGeo = new THREE.CylinderGeometry(wheel.radius, wheel.radius, wheel.radius / 2, 20); 185 | this.wheels[index].helpWheelsGeo.rotateZ(Math.PI / 2); 186 | this.wheels[index].helpWheelsMat = new THREE.MeshBasicMaterial({color: 0x00ffff, wireframe: true}); 187 | this.wheels[index].helpWheels = new THREE.Mesh(this.wheels[index].helpWheelsGeo, this.wheels[index].helpWheelsMat); 188 | this.wheels[index].helpWheels.visible = false; 189 | this.scene.add(this.wheels[index].helpWheels); 190 | }.bind(this)); 191 | } 192 | 193 | controls() { 194 | const keysPressed = []; 195 | 196 | window.addEventListener('keydown', (e) => { 197 | // e.preventDefault(); 198 | if(!keysPressed.includes(e.key.toLowerCase())) keysPressed.push(e.key.toLowerCase()); 199 | hindMovement(); 200 | }); 201 | window.addEventListener('keyup', (e) => { 202 | // e.preventDefault(); 203 | keysPressed.splice(keysPressed.indexOf(e.key.toLowerCase()), 1); 204 | hindMovement(); 205 | }); 206 | 207 | const hindMovement = () => { 208 | const {primaryKeys, secondaryKeys} = this.controlOptions; 209 | 210 | if(keysPressed.includes(primaryKeys.reset) || keysPressed.includes(secondaryKeys.reset)) resetCar(); 211 | 212 | if(!keysPressed.includes(primaryKeys.brake) && !keysPressed.includes(secondaryKeys.brake)){ 213 | this.car.setBrake(0, 0); 214 | this.car.setBrake(0, 1); 215 | this.car.setBrake(0, 2); 216 | this.car.setBrake(0, 3); 217 | 218 | if(keysPressed.includes(primaryKeys.left) || keysPressed.includes(secondaryKeys.left)) { 219 | this.car.setSteeringValue(this.controlOptions.maxSteerVal * 1, 2); 220 | this.car.setSteeringValue(this.controlOptions.maxSteerVal * 1, 3); 221 | } 222 | else if(keysPressed.includes(primaryKeys.right) || keysPressed.includes(secondaryKeys.right)) { 223 | this.car.setSteeringValue(this.controlOptions.maxSteerVal * -1, 2); 224 | this.car.setSteeringValue(this.controlOptions.maxSteerVal * -1, 3); 225 | } 226 | else stopSteer(); 227 | 228 | if(keysPressed.includes(primaryKeys.forward) || keysPressed.includes(secondaryKeys.forward)) { 229 | this.car.applyEngineForce(this.controlOptions.maxForce * -1, 0); 230 | this.car.applyEngineForce(this.controlOptions.maxForce * -1, 1); 231 | this.car.applyEngineForce(this.controlOptions.maxForce * -1, 2); 232 | this.car.applyEngineForce(this.controlOptions.maxForce * -1, 3); 233 | } 234 | else if(keysPressed.includes(primaryKeys.backward) || keysPressed.includes(secondaryKeys.backward)) { 235 | this.car.applyEngineForce(this.controlOptions.maxForce * 1, 0); 236 | this.car.applyEngineForce(this.controlOptions.maxForce * 1, 1); 237 | this.car.applyEngineForce(this.controlOptions.maxForce * 1, 2); 238 | this.car.applyEngineForce(this.controlOptions.maxForce * 1, 3); 239 | } 240 | else stopCar(); 241 | } 242 | else 243 | brake(); 244 | } 245 | 246 | const resetCar = () => { 247 | this.car.chassisBody.position.set(0, 4, 0); 248 | this.car.chassisBody.quaternion.set(0, 0, 0, 1); 249 | this.car.chassisBody.angularVelocity.set(0, 0, 0); 250 | this.car.chassisBody.velocity.set(0, 0, 0); 251 | } 252 | 253 | const brake = () => { 254 | this.car.setBrake(this.controlOptions.brakeForce, 0); 255 | this.car.setBrake(this.controlOptions.brakeForce, 1); 256 | this.car.setBrake(this.controlOptions.brakeForce, 2); 257 | this.car.setBrake(this.controlOptions.brakeForce, 3); 258 | } 259 | 260 | const stopCar = () => { 261 | this.car.setBrake(this.controlOptions.slowDownCar, 0); 262 | this.car.setBrake(this.controlOptions.slowDownCar, 1); 263 | this.car.setBrake(this.controlOptions.slowDownCar, 2); 264 | this.car.setBrake(this.controlOptions.slowDownCar, 3); 265 | } 266 | 267 | const stopSteer = () => { 268 | this.car.setSteeringValue(0, 2); 269 | this.car.setSteeringValue(0, 3); 270 | } 271 | } 272 | 273 | guiRegisterer() { 274 | const controllableKeysArray = [' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'arrowup', 'arrowdown', 'arrowleft', 'arrowright', 'control', 'alt', 'shift', 'meta', 'tab'] 275 | const vehicleOptions = { 276 | suspensionStiffness: 55, 277 | suspensionRestLength: 0.5, 278 | frictionSlip: 30, 279 | dampingRelaxation: 2.3, 280 | dampingCompression: 4.3, 281 | maxSuspensionForce: 10000, 282 | maxSuspensionTravel: 1, 283 | rollInfluence: 0.01, 284 | }; 285 | const resetCar = () => { 286 | this.car.chassisBody.position.set(0, 4, 0); 287 | this.car.chassisBody.quaternion.set(0, 0, 0, 1); 288 | this.car.chassisBody.angularVelocity.set(0, 0, 0); 289 | this.car.chassisBody.velocity.set(0, 0, 0); 290 | } 291 | const stopCar = () => { 292 | this.car.setBrake(1000, 0); 293 | this.car.setBrake(1000, 1); 294 | setTimeout(() => { 295 | this.car.setBrake(0, 0); 296 | this.car.setBrake(0, 1); 297 | }, 100); 298 | this.car.applyEngineForce(0, 0); 299 | this.car.applyEngineForce(0, 1); 300 | this.car.applyEngineForce(0, 2); 301 | this.car.applyEngineForce(0, 3); 302 | this.car.chassisBody.angularVelocity.set(0, 0, 0); 303 | this.car.chassisBody.velocity.set(0, 0, 0); 304 | } 305 | const updateGuiChanges = () => { 306 | this.car.chassisBody.shapes = []; 307 | this.car.chassisBody.addShape(new CANNON.Box(new CANNON.Vec3(this.chassisDimension.x * 0.5, this.chassisDimension.y * 0.5, this.chassisDimension.z * 0.5))); 308 | this.chassis.helpChassis.scale.set(this.chassisDimension.x, this.chassisDimension.y, this.chassisDimension.z); 309 | } 310 | const updateWheelOptions = () => { 311 | for(let i = 0 ; i < this.car.wheelInfos.length; i++) { 312 | this.car.wheelInfos[i] = {...this.car.wheelInfos[i], ...vehicleOptions}; 313 | } 314 | } 315 | resetCar(); 316 | 317 | this.gui.Register({folder: 'Chassis Helper Dimension', object: this.chassisDimension, property: 'x', type: 'range', label: 'x', min: 0, max: 10, step: 0.01, onChange: updateGuiChanges}) 318 | this.gui.Register({folder: 'Chassis Helper Dimension', object: this.chassisDimension, property: 'y', type: 'range', label: 'y', min: 0, max: 10, step: 0.01, onChange: updateGuiChanges}) 319 | this.gui.Register({folder: 'Chassis Helper Dimension', object: this.chassisDimension, property: 'z', type: 'range', label: 'z', min: 0, max: 10, step: 0.01, onChange: updateGuiChanges}) 320 | this.gui.Register({folder: 'Chassis Helper', type: 'checkbox', label: 'Show Chassis Helper', object: this.chassis.helpChassis, property:'visible'}) 321 | this.gui.Register({folder: 'Chassis Helper', type: 'button', label: 'Reset Position', action: resetCar}) 322 | this.gui.Register({folder: 'Chassis Helper', type: 'button', label: 'Stop Car', action: stopCar}) 323 | this.gui.Register({folder: 'Chassis Model Position', object: this.chassisModelPos, property: 'x', type: 'range', label: 'x', min: -10, max: 10, step: 0.01,}) 324 | this.gui.Register({folder: 'Chassis Model Position', object: this.chassisModelPos, property: 'y', type: 'range', label: 'y', min: -10, max: 10, step: 0.01,}) 325 | this.gui.Register({folder: 'Chassis Model Position', object: this.chassisModelPos, property: 'z', type: 'range', label: 'z', min: -10, max: 10, step: 0.01,}) 326 | 327 | this.gui.Register({folder: 'Wheels', object: this.wheelScale, type: 'range', label: 'Front Wheels Scale', property: 'frontWheel', min: 0, max: 5, step: 0.01, onChange: () => { 328 | for(let i = 2 ; i < 4 ; i++) { 329 | const scaleSide = i === 3 ? -1 : 1; 330 | this.wheels[i].scale.set(scaleSide * this.wheelScale.frontWheel, 1 * this.wheelScale.frontWheel, scaleSide * this.wheelScale.frontWheel) 331 | } 332 | }}) 333 | this.gui.Register({folder: 'Wheels', object: this.wheelScale, type: 'range', label: 'Hind Wheels Scale', property: 'hindWheel', min: 0, max: 5, step: 0.01, onChange: () => { 334 | for(let i = 0 ; i < 2 ; i++) { 335 | const scaleSide = i === 1 ? -1 : 1; 336 | this.wheels[i].scale.set(scaleSide * this.wheelScale.hindWheel, 1 * this.wheelScale.hindWheel, scaleSide * this.wheelScale.hindWheel) 337 | } 338 | }}) 339 | 340 | this.gui.Register({folder: 'Wheels Helper', type: 'checkbox', label: 'Show Wheels Helper', object: this.wheels[0].helpWheels, property:'visible', onChange: () => { 341 | for (let i = 0 ; i < 4 ; i++) 342 | this.wheels[i].helpWheels.visible = this.wheels[0].helpWheels.visible; 343 | 344 | }}); 345 | 346 | this.gui.Register({folder: 'Wheels Helper', object: this.car.wheelInfos[2], property: 'radius', type: 'range', label: 'Front Wheels Radius', min: 0.1, max: 5, step: 0.01, onChange: () => { 347 | this.car.wheelInfos[2].radius = this.car.wheelInfos[2].radius; 348 | this.car.wheelInfos[3].radius = this.car.wheelInfos[2].radius; 349 | const cylinderGeometry = new THREE.CylinderGeometry(this.car.wheelInfos[2].radius, this.car.wheelInfos[2].radius, this.car.wheelInfos[2].radius / 2, 20); 350 | cylinderGeometry.rotateZ(Math.PI / 2); 351 | this.wheels[2].helpWheels.geometry = cylinderGeometry; 352 | this.wheels[3].helpWheels.geometry = cylinderGeometry; 353 | }}); 354 | 355 | this.gui.Register({folder: 'Wheels Helper', object: this.car.wheelInfos[0], property: 'radius', type: 'range', label: 'Hind Wheels Radius', min: 0.1, max: 5, step: 0.01, onChange: () => { 356 | this.car.wheelInfos[0].radius = this.car.wheelInfos[0].radius; 357 | this.car.wheelInfos[1].radius = this.car.wheelInfos[0].radius; 358 | const cylinderGeometry = new THREE.CylinderGeometry(this.car.wheelInfos[0].radius, this.car.wheelInfos[0].radius, this.car.wheelInfos[0].radius / 2, 20); 359 | cylinderGeometry.rotateZ(Math.PI / 2); 360 | this.wheels[0].helpWheels.geometry = cylinderGeometry; 361 | this.wheels[1].helpWheels.geometry = cylinderGeometry; 362 | }}); 363 | 364 | this.gui.Register({folder: 'Wheel Helper Position', type: 'folder', label: 'Left Front Wheel', open: true}); 365 | this.gui.Register({folder: 'Left Front Wheel', object: this.car.wheelInfos[2].chassisConnectionPointLocal, property: 'x', type: 'range', label: 'x', min: -10, max: 10, step: 0.01}); 366 | this.gui.Register({folder: 'Left Front Wheel', object: this.car.wheelInfos[2].chassisConnectionPointLocal, property: 'y', type: 'range', label: 'y', min: -10, max: 10, step: 0.01}); 367 | this.gui.Register({folder: 'Left Front Wheel', object: this.car.wheelInfos[2].chassisConnectionPointLocal, property: 'z', type: 'range', label: 'z', min: -10, max: 10, step: 0.01}); 368 | 369 | this.gui.Register({folder: 'Wheel Helper Position', type: 'folder', label: 'Right Front Wheel', open: true}); 370 | this.gui.Register({folder: 'Right Front Wheel', object: this.car.wheelInfos[3].chassisConnectionPointLocal, property: 'x', type: 'range', label: 'x', min: -10, max: 10, step: 0.01}); 371 | this.gui.Register({folder: 'Right Front Wheel', object: this.car.wheelInfos[3].chassisConnectionPointLocal, property: 'y', type: 'range', label: 'y', min: -10, max: 10, step: 0.01}); 372 | this.gui.Register({folder: 'Right Front Wheel', object: this.car.wheelInfos[3].chassisConnectionPointLocal, property: 'z', type: 'range', label: 'z', min: -10, max: 10, step: 0.01}); 373 | 374 | this.gui.Register({folder: 'Wheel Helper Position', type: 'folder', label: 'Left Hind Wheel', open: true}); 375 | this.gui.Register({folder: 'Left Hind Wheel', object: this.car.wheelInfos[0].chassisConnectionPointLocal, property: 'x', type: 'range', label: 'x', min: -10, max: 10, step: 0.01}); 376 | this.gui.Register({folder: 'Left Hind Wheel', object: this.car.wheelInfos[0].chassisConnectionPointLocal, property: 'y', type: 'range', label: 'y', min: -10, max: 10, step: 0.01}); 377 | this.gui.Register({folder: 'Left Hind Wheel', object: this.car.wheelInfos[0].chassisConnectionPointLocal, property: 'z', type: 'range', label: 'z', min: -10, max: 10, step: 0.01}); 378 | 379 | this.gui.Register({folder: 'Wheel Helper Position', type: 'folder', label: 'Right Hind Wheel', open: true}); 380 | this.gui.Register({folder: 'Right Hind Wheel', object: this.car.wheelInfos[1].chassisConnectionPointLocal, property: 'x', type: 'range', label: 'x', min: -10, max: 10, step: 0.01}); 381 | this.gui.Register({folder: 'Right Hind Wheel', object: this.car.wheelInfos[1].chassisConnectionPointLocal, property: 'y', type: 'range', label: 'y', min: -10, max: 10, step: 0.01}); 382 | this.gui.Register({folder: 'Right Hind Wheel', object: this.car.wheelInfos[1].chassisConnectionPointLocal, property: 'z', type: 'range', label: 'z', min: -10, max: 10, step: 0.01}); 383 | 384 | this.gui.Register({folder: 'Vehicle', object: this.car.chassisBody, property: 'mass', type: 'range', label: 'Mass', min: 1, max: 1000, step: 1}); 385 | 386 | this.gui.Register({folder: 'Vehicle', object: vehicleOptions, property:'suspensionStiffness', type: 'range', label:'Suspension Stiffness', min: 0, max: 100, step: 1, onChange: updateWheelOptions}); 387 | this.gui.Register({folder: 'Vehicle', object: vehicleOptions, property:'suspensionRestLength', type: 'range', label:'Suspension Rest Height', min: -10, max: 10, step: 0.1, onChange: updateWheelOptions}); 388 | this.gui.Register({folder: 'Vehicle', object: vehicleOptions, property:'frictionSlip', type: 'range', label:'Friction Slip', min: 0, max: 50, step: 1, onChange: updateWheelOptions}); 389 | this.gui.Register({folder: 'Vehicle', object: vehicleOptions, property:'dampingRelaxation', type: 'range', label:'Damping Relaxation', min: -10, max: 10, step: 0.1, onChange: updateWheelOptions}); 390 | this.gui.Register({folder: 'Vehicle', object: vehicleOptions, property:'dampingCompression', type: 'range', label:'Damping Compression', min: -10, max: 10, step: 0.1, onChange: updateWheelOptions}); 391 | this.gui.Register({folder: 'Vehicle', object: vehicleOptions, property:'maxSuspensionForce', type: 'range', label:'Max Suspension Force', min: -10000, max: 10000, step: 10, onChange: updateWheelOptions}); 392 | this.gui.Register({folder: 'Vehicle', object: vehicleOptions, property:'maxSuspensionTravel', type: 'range', label:'Max Suspension Travel', min: -10, max: 10, step: 1, onChange: updateWheelOptions}); 393 | this.gui.Register({folder: 'Vehicle', object: vehicleOptions, property:'rollInfluence', type: 'range', label:'Roll Influence', min: 0, max: 10, step: 0.1, onChange: updateWheelOptions}); 394 | 395 | this.gui.Register({folder: 'Vehicle', type: 'folder', label: 'Controls', open: true}); 396 | this.gui.Register({folder: 'Controls', object: this.controlOptions, property:'maxSteerVal', type: 'range', label:'Max Steer Value', min: 0, max: 1, step: 0.01}); 397 | this.gui.Register({folder: 'Controls', object: this.controlOptions, property:'maxForce', type: 'range', label:'Max Force', min: 1, max: 10000, step: 10}); 398 | this.gui.Register({folder: 'Controls', object: this.controlOptions, property:'brakeForce', type: 'range', label:'Brake Force', min: 1, max: 100, step: 0.1}); 399 | this.gui.Register({folder: 'Controls', object: this.controlOptions, property:'slowDownCar', type: 'range', label:'Slow Car Force', min: 1, max: 100, step: 0.1}); 400 | 401 | this.gui.Register({folder: 'Controls', type: 'folder', label: 'Primary Keys Controls', open: true}); 402 | this.gui.Register({folder: 'Primary Keys Controls', object: this.controlOptions.primaryKeys, property: 'forward', type: 'select', label: 'Move Forward', options: controllableKeysArray}) 403 | this.gui.Register({folder: 'Primary Keys Controls', object: this.controlOptions.primaryKeys, property: 'backward', type: 'select', label: 'Move Backward', options: controllableKeysArray}) 404 | this.gui.Register({folder: 'Primary Keys Controls', object: this.controlOptions.primaryKeys, property: 'left', type: 'select', label: 'Turn Left', options: controllableKeysArray}) 405 | this.gui.Register({folder: 'Primary Keys Controls', object: this.controlOptions.primaryKeys, property: 'right', type: 'select', label: 'Turn Right', options: controllableKeysArray}) 406 | this.gui.Register({folder: 'Primary Keys Controls', object: this.controlOptions.primaryKeys, property: 'brake', type: 'select', label: 'Apply Brakes', options: controllableKeysArray}) 407 | this.gui.Register({folder: 'Primary Keys Controls', object: this.controlOptions.primaryKeys, property: 'reset', type: 'select', label: 'Reset Car Position', options: controllableKeysArray}) 408 | 409 | this.gui.Register({folder: 'Controls', type: 'folder', label: 'Secondary Keys Controls', open: true}); 410 | this.gui.Register({folder: 'Secondary Keys Controls', object: this.controlOptions.secondaryKeys, property: 'forward', type: 'select', label: 'Move Forward', options: controllableKeysArray}) 411 | this.gui.Register({folder: 'Secondary Keys Controls', object: this.controlOptions.secondaryKeys, property: 'backward', type: 'select', label: 'Move Backward', options: controllableKeysArray}) 412 | this.gui.Register({folder: 'Secondary Keys Controls', object: this.controlOptions.secondaryKeys, property: 'left', type: 'select', label: 'Turn Left', options: controllableKeysArray}) 413 | this.gui.Register({folder: 'Secondary Keys Controls', object: this.controlOptions.secondaryKeys, property: 'right', type: 'select', label: 'Turn Right', options: controllableKeysArray}) 414 | this.gui.Register({folder: 'Secondary Keys Controls', object: this.controlOptions.secondaryKeys, property: 'brake', type: 'select', label: 'Apply Brakes', options: controllableKeysArray}) 415 | this.gui.Register({folder: 'Secondary Keys Controls', object: this.controlOptions.secondaryKeys, property: 'reset', type: 'select', label: 'Reset Car Position', options: controllableKeysArray}) 416 | 417 | this.gui.Register({folder: 'Generate Code', type: 'button', label: 'Copy to clipboard', action: () => { 418 | const generateCode = new GenerateCode(this); 419 | copy(generateCode.generateCAR()); 420 | }}) 421 | this.gui.Register({folder: 'Generate Code', type: 'button', label: 'Save as ZIP', action: () => { 422 | const generateCode = new GenerateCode(this); 423 | generateCode.generateCode(); 424 | }}) 425 | } 426 | 427 | update() { 428 | const updateWorld = () => { 429 | if(this.car && this.chassis && this.wheels[0]){ 430 | this.chassis.position.set( 431 | this.car.chassisBody.position.x + this.chassisModelPos.x, 432 | this.car.chassisBody.position.y + this.chassisModelPos.y, 433 | this.car.chassisBody.position.z + this.chassisModelPos.z 434 | ); 435 | this.chassis.quaternion.copy(this.car.chassisBody.quaternion); 436 | this.chassis.helpChassis.position.copy(this.car.chassisBody.position); 437 | this.chassis.helpChassis.quaternion.copy(this.car.chassisBody.quaternion); 438 | for(let i = 0 ; i < 4 ; i++) { 439 | if(this.wheels[i].helpWheels && this.car.wheelInfos[i]) { 440 | this.car.updateWheelTransform(i); 441 | this.wheels[i].position.copy(this.car.wheelInfos[i].worldTransform.position); 442 | this.wheels[i].quaternion.copy(this.car.wheelInfos[i].worldTransform.quaternion); 443 | this.wheels[i].helpWheels.position.copy(this.car.wheelInfos[i].worldTransform.position); 444 | this.wheels[i].helpWheels.quaternion.copy(this.car.wheelInfos[i].worldTransform.quaternion); 445 | } 446 | } 447 | } 448 | } 449 | this.world.addEventListener('postStep', updateWorld); 450 | } 451 | } 452 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jaagrav/raycast-vehicle-engine/2283abb336ae1134e5508db639bc6de773401d79/static/.gitkeep -------------------------------------------------------------------------------- /static/draco/README.md: -------------------------------------------------------------------------------- 1 | # Draco 3D Data Compression 2 | 3 | Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics. 4 | 5 | [Website](https://google.github.io/draco/) | [GitHub](https://github.com/google/draco) 6 | 7 | ## Contents 8 | 9 | This folder contains three utilities: 10 | 11 | * `draco_decoder.js` — Emscripten-compiled decoder, compatible with any modern browser. 12 | * `draco_decoder.wasm` — WebAssembly decoder, compatible with newer browsers and devices. 13 | * `draco_wasm_wrapper.js` — JavaScript wrapper for the WASM decoder. 14 | 15 | Each file is provided in two variations: 16 | 17 | * **Default:** Latest stable builds, tracking the project's [master branch](https://github.com/google/draco). 18 | * **glTF:** Builds targeted by the [glTF mesh compression extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression), tracking the [corresponding Draco branch](https://github.com/google/draco/tree/gltf_2.0_draco_extension). 19 | 20 | Either variation may be used with `THREE.DRACOLoader`: 21 | 22 | ```js 23 | var dracoLoader = new THREE.DRACOLoader(); 24 | dracoLoader.setDecoderPath('path/to/decoders/'); 25 | dracoLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support. 26 | ``` 27 | 28 | Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder). 29 | 30 | ## License 31 | 32 | [Apache License 2.0](https://github.com/google/draco/blob/master/LICENSE) 33 | -------------------------------------------------------------------------------- /static/draco/draco_decoder.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Jaagrav/raycast-vehicle-engine/2283abb336ae1134e5508db639bc6de773401d79/static/draco/draco_decoder.wasm -------------------------------------------------------------------------------- /static/draco/draco_wasm_wrapper.js: -------------------------------------------------------------------------------- 1 | var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(f){var m=0;return function(){return m=d);)++b;if(16k?d+=String.fromCharCode(k):(k-=65536,d+=String.fromCharCode(55296|k>>10,56320|k&1023))}}else d+=String.fromCharCode(k)}return d}function X(a,c){return a?h(ca,a,c):""}function e(a,c){0=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++b)&1023);127>=d?++c:c=2047>=d?c+2:65535>=d?c+3:c+4}c=Array(c+1);b=0;d=c.length;if(0=e){var f=a.charCodeAt(++k);e=65536+((e&1023)<<10)|f&1023}if(127>=e){if(b>=d)break;c[b++]=e}else{if(2047>=e){if(b+1>=d)break;c[b++]=192|e>>6}else{if(65535>=e){if(b+2>=d)break;c[b++]=224|e>>12}else{if(b+3>=d)break;c[b++]=240|e>>18;c[b++]=128|e>>12&63}c[b++]=128|e>>6&63}c[b++]=128| 18 | e&63}}c[b]=0}a=n.alloc(c,T);n.copy(c,T,a)}return a}function x(){throw"cannot construct a Status, no constructor in IDL";}function A(){this.ptr=Oa();u(A)[this.ptr]=this}function B(){this.ptr=Pa();u(B)[this.ptr]=this}function C(){this.ptr=Qa();u(C)[this.ptr]=this}function D(){this.ptr=Ra();u(D)[this.ptr]=this}function E(){this.ptr=Sa();u(E)[this.ptr]=this}function q(){this.ptr=Ta();u(q)[this.ptr]=this}function J(){this.ptr=Ua();u(J)[this.ptr]=this}function w(){this.ptr=Va();u(w)[this.ptr]=this}function F(){this.ptr= 19 | Wa();u(F)[this.ptr]=this}function r(){this.ptr=Xa();u(r)[this.ptr]=this}function G(){this.ptr=Ya();u(G)[this.ptr]=this}function H(){this.ptr=Za();u(H)[this.ptr]=this}function O(){this.ptr=$a();u(O)[this.ptr]=this}function K(){this.ptr=ab();u(K)[this.ptr]=this}function g(){this.ptr=bb();u(g)[this.ptr]=this}function y(){this.ptr=cb();u(y)[this.ptr]=this}function Q(){throw"cannot construct a VoidPtr, no constructor in IDL";}function I(){this.ptr=db();u(I)[this.ptr]=this}function L(){this.ptr=eb();u(L)[this.ptr]= 20 | this}m=m||{};var a="undefined"!==typeof m?m:{},Ga=!1,Ha=!1;a.onRuntimeInitialized=function(){Ga=!0;if(Ha&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ha=!0;if(Ga&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3=a[1]?!0:0!=a[0]||10>2]},getStr:function(){return X(R.get())}, 26 | get64:function(){var a=R.get();R.get();return a},getZero:function(){R.get()}},Ka={__cxa_allocate_exception:function(a){return ib(a)},__cxa_throw:function(a,c,b){"uncaught_exception"in ta?ta.uncaught_exceptions++:ta.uncaught_exceptions=1;throw a;},abort:function(){z()},emscripten_get_sbrk_ptr:function(){return 18416},emscripten_memcpy_big:function(a,c,b){ca.set(ca.subarray(c,c+b),a)},emscripten_resize_heap:function(a){if(2147418112= 27 | c?e(2*c,65536):Math.min(e((3*c+2147483648)/4,65536),2147418112);a:{try{ia.grow(c-ka.byteLength+65535>>16);l(ia.buffer);var b=1;break a}catch(d){}b=void 0}return b?!0:!1},environ_get:function(a,c){var b=0;ba().forEach(function(d,e){var f=c+b;e=P[a+4*e>>2]=f;for(f=0;f>0]=d.charCodeAt(f);T[e>>0]=0;b+=d.length+1});return 0},environ_sizes_get:function(a,c){var b=ba();P[a>>2]=b.length;var d=0;b.forEach(function(a){d+=a.length+1});P[c>>2]=d;return 0},fd_close:function(a){return 0},fd_seek:function(a, 28 | c,b,d,e){return 0},fd_write:function(a,c,b,d){try{for(var e=0,f=0;f>2],k=P[c+(8*f+4)>>2],h=0;h>2]=e;return 0}catch(ua){return"undefined"!==typeof FS&&ua instanceof FS.ErrnoError||z(ua),ua.errno}},memory:ia,setTempRet0:function(a){},table:gb},La=function(){function e(c,b){a.asm=c.exports;aa--;a.monitorRunDependencies&&a.monitorRunDependencies(aa);0==aa&&(null!==sa&&(clearInterval(sa),sa=null),ja&&(c=ja,ja=null,c()))}function c(a){e(a.instance)} 29 | function b(a){return Ma().then(function(a){return WebAssembly.instantiate(a,d)}).then(a,function(a){Y("failed to asynchronously prepare wasm: "+a);z(a)})}var d={env:Ka,wasi_unstable:Ka};aa++;a.monitorRunDependencies&&a.monitorRunDependencies(aa);if(a.instantiateWasm)try{return a.instantiateWasm(d,e)}catch(Na){return Y("Module.instantiateWasm callback failed with error: "+Na),!1}(function(){if(da||"function"!==typeof WebAssembly.instantiateStreaming||va(U)||"function"!==typeof fetch)return b(c);fetch(U, 30 | {credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,d).then(c,function(a){Y("wasm streaming compile failed: "+a);Y("falling back to ArrayBuffer instantiation");b(c)})})})();return{}}();a.asm=La;var hb=a.___wasm_call_ctors=function(){return a.asm.__wasm_call_ctors.apply(null,arguments)},jb=a._emscripten_bind_Status_code_0=function(){return a.asm.emscripten_bind_Status_code_0.apply(null,arguments)},kb=a._emscripten_bind_Status_ok_0=function(){return a.asm.emscripten_bind_Status_ok_0.apply(null, 31 | arguments)},lb=a._emscripten_bind_Status_error_msg_0=function(){return a.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},mb=a._emscripten_bind_Status___destroy___0=function(){return a.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Oa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},nb=a._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null, 32 | arguments)},ob=a._emscripten_bind_DracoUInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},pb=a._emscripten_bind_DracoUInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Pa=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},qb=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null, 33 | arguments)},rb=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},sb=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Qa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},tb=a._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null, 34 | arguments)},ub=a._emscripten_bind_DracoUInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},vb=a._emscripten_bind_DracoUInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Ra=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},wb=a._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null, 35 | arguments)},xb=a._emscripten_bind_DracoUInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},yb=a._emscripten_bind_DracoUInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},Sa=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},zb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1= 36 | function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ab=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},Bb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Ta=a._emscripten_bind_PointAttribute_PointAttribute_0= 37 | function(){return a.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Cb=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Db=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Eb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null, 38 | arguments)},Fb=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},Gb=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Hb=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Ib=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null, 39 | arguments)},Jb=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},Kb=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},Lb=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},Ua=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0= 40 | function(){return a.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},Mb=a._emscripten_bind_AttributeTransformData_transform_type_0=function(){return a.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},Nb=a._emscripten_bind_AttributeTransformData___destroy___0=function(){return a.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},Va=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0= 41 | function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},Ob=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},Pb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)}, 42 | Qb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},Rb=a._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},Sb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)}, 43 | Wa=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return a.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},Tb=a._emscripten_bind_DracoInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},Ub=a._emscripten_bind_DracoInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Vb=a._emscripten_bind_DracoInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null, 44 | arguments)},Xa=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Wb=a._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},Xb=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Yb=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3= 45 | function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},Zb=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},$b=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},ac=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null, 46 | arguments)},bc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},cc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Ya=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return a.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt16Array_GetValue_1= 47 | function(){return a.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ec=a._emscripten_bind_DracoInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},fc=a._emscripten_bind_DracoInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Za=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null, 48 | arguments)},gc=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},hc=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},ic=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},$a=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null, 49 | arguments)},jc=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ab=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return a.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},kc=a._emscripten_bind_DecoderBuffer_Init_2=function(){return a.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},lc=a._emscripten_bind_DecoderBuffer___destroy___0=function(){return a.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null, 50 | arguments)},bb=a._emscripten_bind_Decoder_Decoder_0=function(){return a.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},mc=a._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return a.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},nc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},oc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null, 51 | arguments)},pc=a._emscripten_bind_Decoder_GetAttributeId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},sc=a._emscripten_bind_Decoder_GetAttribute_2= 52 | function(){return a.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},uc=a._emscripten_bind_Decoder_GetMetadata_1=function(){return a.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null, 53 | arguments)},wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return a.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3= 54 | function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},Ac=a._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null, 55 | arguments)},Dc=a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)}, 56 | Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},Jc= 57 | a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return a.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return a.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},Lc=a._emscripten_bind_Decoder___destroy___0=function(){return a.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},cb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm.emscripten_bind_Mesh_Mesh_0.apply(null, 58 | arguments)},Mc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},Nc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},Oc=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Pc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)}, 59 | Qc=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},db=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Rc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Sc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoInt32Array_size_0.apply(null, 60 | arguments)},Tc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},eb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},Uc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Vc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm.emscripten_enum_draco_StatusCode_OK.apply(null, 61 | arguments)},Wc=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Xc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION= 62 | function(){return a.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},ad=a._emscripten_enum_draco_DataType_DT_INVALID=function(){return a.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},bd=a._emscripten_enum_draco_DataType_DT_INT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null, 63 | arguments)},cd=a._emscripten_enum_draco_DataType_DT_UINT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},dd=a._emscripten_enum_draco_DataType_DT_INT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},ed=a._emscripten_enum_draco_DataType_DT_UINT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},fd=a._emscripten_enum_draco_DataType_DT_INT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null, 64 | arguments)},gd=a._emscripten_enum_draco_DataType_DT_UINT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},hd=a._emscripten_enum_draco_DataType_DT_INT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},id=a._emscripten_enum_draco_DataType_DT_UINT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},jd=a._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null, 65 | arguments)},kd=a._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},ld=a._emscripten_enum_draco_DataType_DT_BOOL=function(){return a.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},md=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return a.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},nd=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null, 66 | arguments)},od=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},pd=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null, 67 | arguments)},rd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},sd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},td=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null, 68 | arguments)},ud=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},vd=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},wd=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},xd=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR= 69 | function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},yd=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},zd=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};a._setThrew=function(){return a.asm.setThrew.apply(null,arguments)};var ta=a.__ZSt18uncaught_exceptionv= 70 | function(){return a.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};a._free=function(){return a.asm.free.apply(null,arguments)};var ib=a._malloc=function(){return a.asm.malloc.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.__growWasmMemory=function(){return a.asm.__growWasmMemory.apply(null,arguments)}; 71 | a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)}; 72 | a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_iidiiii=function(){return a.asm.dynCall_iidiiii.apply(null,arguments)};a.dynCall_jiji=function(){return a.asm.dynCall_jiji.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.asm=La;var fa;a.then=function(e){if(fa)e(a); 73 | else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();e(a)}}return a};ja=function c(){fa||ma();fa||(ja=c)};a.run=ma;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0=n.size?(t(0>=1;break;case 4:d>>=2;break;case 8:d>>=3}for(var c=0;c=d);)++b;if(16k?d+=String.fromCharCode(k):(k-=65536,d+=String.fromCharCode(55296|k>>10,56320|k&1023))}}else d+=String.fromCharCode(k)}return d}function X(a,c){return a?h(ca,a,c):""}function e(a,c){0=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++b)&1023);127>=d?++c:c=2047>=d?c+2:65535>=d?c+3:c+4}c=Array(c+1);b=0;d=c.length;if(0=e){var f=a.charCodeAt(++k);e=65536+((e&1023)<<10)|f&1023}if(127>=e){if(b>=d)break;c[b++]=e}else{if(2047>=e){if(b+1>=d)break;c[b++]=192|e>>6}else{if(65535>=e){if(b+2>=d)break;c[b++]=224|e>>12}else{if(b+3>=d)break;c[b++]=240|e>>18;c[b++]=128|e>>12&63}c[b++]=128|e>>6&63}c[b++]=128| 18 | e&63}}c[b]=0}a=n.alloc(c,T);n.copy(c,T,a)}return a}function x(){throw"cannot construct a Status, no constructor in IDL";}function A(){this.ptr=Oa();u(A)[this.ptr]=this}function B(){this.ptr=Pa();u(B)[this.ptr]=this}function C(){this.ptr=Qa();u(C)[this.ptr]=this}function D(){this.ptr=Ra();u(D)[this.ptr]=this}function E(){this.ptr=Sa();u(E)[this.ptr]=this}function q(){this.ptr=Ta();u(q)[this.ptr]=this}function J(){this.ptr=Ua();u(J)[this.ptr]=this}function w(){this.ptr=Va();u(w)[this.ptr]=this}function F(){this.ptr= 19 | Wa();u(F)[this.ptr]=this}function r(){this.ptr=Xa();u(r)[this.ptr]=this}function G(){this.ptr=Ya();u(G)[this.ptr]=this}function H(){this.ptr=Za();u(H)[this.ptr]=this}function O(){this.ptr=$a();u(O)[this.ptr]=this}function K(){this.ptr=ab();u(K)[this.ptr]=this}function g(){this.ptr=bb();u(g)[this.ptr]=this}function y(){this.ptr=cb();u(y)[this.ptr]=this}function Q(){throw"cannot construct a VoidPtr, no constructor in IDL";}function I(){this.ptr=db();u(I)[this.ptr]=this}function L(){this.ptr=eb();u(L)[this.ptr]= 20 | this}m=m||{};var a="undefined"!==typeof m?m:{},Ga=!1,Ha=!1;a.onRuntimeInitialized=function(){Ga=!0;if(Ha&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ha=!0;if(Ga&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3=a[1]?!0:0!=a[0]||10>2]},getStr:function(){return X(R.get())}, 26 | get64:function(){var a=R.get();R.get();return a},getZero:function(){R.get()}},Ka={__cxa_allocate_exception:function(a){return ib(a)},__cxa_throw:function(a,c,b){"uncaught_exception"in ta?ta.uncaught_exceptions++:ta.uncaught_exceptions=1;throw a;},abort:function(){z()},emscripten_get_sbrk_ptr:function(){return 13664},emscripten_memcpy_big:function(a,c,b){ca.set(ca.subarray(c,c+b),a)},emscripten_resize_heap:function(a){if(2147418112= 27 | c?e(2*c,65536):Math.min(e((3*c+2147483648)/4,65536),2147418112);a:{try{ia.grow(c-ka.byteLength+65535>>16);l(ia.buffer);var b=1;break a}catch(d){}b=void 0}return b?!0:!1},environ_get:function(a,c){var b=0;ba().forEach(function(d,e){var f=c+b;e=P[a+4*e>>2]=f;for(f=0;f>0]=d.charCodeAt(f);T[e>>0]=0;b+=d.length+1});return 0},environ_sizes_get:function(a,c){var b=ba();P[a>>2]=b.length;var d=0;b.forEach(function(a){d+=a.length+1});P[c>>2]=d;return 0},fd_close:function(a){return 0},fd_seek:function(a, 28 | c,b,d,e){return 0},fd_write:function(a,c,b,d){try{for(var e=0,f=0;f>2],k=P[c+(8*f+4)>>2],h=0;h>2]=e;return 0}catch(ua){return"undefined"!==typeof FS&&ua instanceof FS.ErrnoError||z(ua),ua.errno}},memory:ia,setTempRet0:function(a){},table:gb},La=function(){function e(c,b){a.asm=c.exports;aa--;a.monitorRunDependencies&&a.monitorRunDependencies(aa);0==aa&&(null!==sa&&(clearInterval(sa),sa=null),ja&&(c=ja,ja=null,c()))}function c(a){e(a.instance)} 29 | function b(a){return Ma().then(function(a){return WebAssembly.instantiate(a,d)}).then(a,function(a){Y("failed to asynchronously prepare wasm: "+a);z(a)})}var d={env:Ka,wasi_unstable:Ka};aa++;a.monitorRunDependencies&&a.monitorRunDependencies(aa);if(a.instantiateWasm)try{return a.instantiateWasm(d,e)}catch(Na){return Y("Module.instantiateWasm callback failed with error: "+Na),!1}(function(){if(da||"function"!==typeof WebAssembly.instantiateStreaming||va(U)||"function"!==typeof fetch)return b(c);fetch(U, 30 | {credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,d).then(c,function(a){Y("wasm streaming compile failed: "+a);Y("falling back to ArrayBuffer instantiation");b(c)})})})();return{}}();a.asm=La;var hb=a.___wasm_call_ctors=function(){return a.asm.__wasm_call_ctors.apply(null,arguments)},jb=a._emscripten_bind_Status_code_0=function(){return a.asm.emscripten_bind_Status_code_0.apply(null,arguments)},kb=a._emscripten_bind_Status_ok_0=function(){return a.asm.emscripten_bind_Status_ok_0.apply(null, 31 | arguments)},lb=a._emscripten_bind_Status_error_msg_0=function(){return a.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},mb=a._emscripten_bind_Status___destroy___0=function(){return a.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Oa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},nb=a._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null, 32 | arguments)},ob=a._emscripten_bind_DracoUInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},pb=a._emscripten_bind_DracoUInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Pa=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},qb=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null, 33 | arguments)},rb=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},sb=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Qa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},tb=a._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null, 34 | arguments)},ub=a._emscripten_bind_DracoUInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},vb=a._emscripten_bind_DracoUInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Ra=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},wb=a._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null, 35 | arguments)},xb=a._emscripten_bind_DracoUInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},yb=a._emscripten_bind_DracoUInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},Sa=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},zb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1= 36 | function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ab=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},Bb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Ta=a._emscripten_bind_PointAttribute_PointAttribute_0= 37 | function(){return a.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Cb=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Db=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Eb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null, 38 | arguments)},Fb=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},Gb=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Hb=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Ib=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null, 39 | arguments)},Jb=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},Kb=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},Lb=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},Ua=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0= 40 | function(){return a.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},Mb=a._emscripten_bind_AttributeTransformData_transform_type_0=function(){return a.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},Nb=a._emscripten_bind_AttributeTransformData___destroy___0=function(){return a.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},Va=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0= 41 | function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},Ob=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},Pb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)}, 42 | Qb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},Rb=a._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},Sb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)}, 43 | Wa=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return a.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},Tb=a._emscripten_bind_DracoInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},Ub=a._emscripten_bind_DracoInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Vb=a._emscripten_bind_DracoInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null, 44 | arguments)},Xa=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Wb=a._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},Xb=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Yb=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3= 45 | function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},Zb=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},$b=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},ac=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null, 46 | arguments)},bc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},cc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Ya=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return a.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt16Array_GetValue_1= 47 | function(){return a.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ec=a._emscripten_bind_DracoInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},fc=a._emscripten_bind_DracoInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Za=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null, 48 | arguments)},gc=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},hc=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},ic=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},$a=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null, 49 | arguments)},jc=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ab=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return a.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},kc=a._emscripten_bind_DecoderBuffer_Init_2=function(){return a.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},lc=a._emscripten_bind_DecoderBuffer___destroy___0=function(){return a.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null, 50 | arguments)},bb=a._emscripten_bind_Decoder_Decoder_0=function(){return a.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},mc=a._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return a.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},nc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},oc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null, 51 | arguments)},pc=a._emscripten_bind_Decoder_GetAttributeId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},sc=a._emscripten_bind_Decoder_GetAttribute_2= 52 | function(){return a.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},uc=a._emscripten_bind_Decoder_GetMetadata_1=function(){return a.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null, 53 | arguments)},wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return a.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3= 54 | function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},Ac=a._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null, 55 | arguments)},Dc=a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)}, 56 | Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},Jc= 57 | a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return a.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return a.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},Lc=a._emscripten_bind_Decoder___destroy___0=function(){return a.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},cb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm.emscripten_bind_Mesh_Mesh_0.apply(null, 58 | arguments)},Mc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},Nc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},Oc=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Pc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)}, 59 | Qc=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},db=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Rc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Sc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoInt32Array_size_0.apply(null, 60 | arguments)},Tc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},eb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},Uc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Vc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm.emscripten_enum_draco_StatusCode_OK.apply(null, 61 | arguments)},Wc=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Xc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION= 62 | function(){return a.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},ad=a._emscripten_enum_draco_DataType_DT_INVALID=function(){return a.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},bd=a._emscripten_enum_draco_DataType_DT_INT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null, 63 | arguments)},cd=a._emscripten_enum_draco_DataType_DT_UINT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},dd=a._emscripten_enum_draco_DataType_DT_INT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},ed=a._emscripten_enum_draco_DataType_DT_UINT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},fd=a._emscripten_enum_draco_DataType_DT_INT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null, 64 | arguments)},gd=a._emscripten_enum_draco_DataType_DT_UINT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},hd=a._emscripten_enum_draco_DataType_DT_INT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},id=a._emscripten_enum_draco_DataType_DT_UINT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},jd=a._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null, 65 | arguments)},kd=a._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},ld=a._emscripten_enum_draco_DataType_DT_BOOL=function(){return a.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},md=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return a.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},nd=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null, 66 | arguments)},od=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},pd=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null, 67 | arguments)},rd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},sd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},td=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null, 68 | arguments)},ud=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},vd=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},wd=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},xd=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR= 69 | function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},yd=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},zd=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};a._setThrew=function(){return a.asm.setThrew.apply(null,arguments)};var ta=a.__ZSt18uncaught_exceptionv= 70 | function(){return a.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};a._free=function(){return a.asm.free.apply(null,arguments)};var ib=a._malloc=function(){return a.asm.malloc.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.__growWasmMemory=function(){return a.asm.__growWasmMemory.apply(null,arguments)}; 71 | a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)}; 72 | a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_iidiiii=function(){return a.asm.dynCall_iidiiii.apply(null,arguments)};a.dynCall_jiji=function(){return a.asm.dynCall_jiji.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.asm=La;var fa;a.then=function(e){if(fa)e(a); 73 | else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();e(a)}}return a};ja=function c(){fa||ma();fa||(ja=c)};a.run=ma;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0=n.size?(t(0>=1;break;case 4:d>>=2;break;case 8:d>>=3}for(var c=0;c