├── dist ├── .gitkeep ├── draco │ ├── draco_decoder.wasm │ ├── gltf │ │ ├── draco_decoder.wasm │ │ └── draco_wasm_wrapper.js │ ├── README.md │ └── draco_wasm_wrapper.js ├── icons │ └── circle-of-two-clockwise-arrows-rotation.png ├── files │ └── ic_code_black_24dp.svg ├── assets │ └── images │ │ └── c023de65004745c7.svg ├── bundle.016c695988fcc69c.js.LICENSE.txt ├── index.html ├── main.css └── main.css.map ├── static ├── .gitkeep ├── .DS_Store ├── draco │ ├── draco_decoder.wasm │ ├── gltf │ │ └── draco_decoder.wasm │ └── README.md ├── icons │ └── circle-of-two-clockwise-arrows-rotation.png └── files │ └── ic_code_black_24dp.svg ├── .DS_Store ├── src ├── script.js ├── Experience │ ├── sources.js │ ├── Utils │ │ ├── Debug.js │ │ ├── Sizes.js │ │ ├── Time.js │ │ ├── Resources.js │ │ └── EventEmitter.js │ ├── World │ │ ├── World.js │ │ ├── SimpleCar.js │ │ ├── SimpleCarPhysics.js │ │ ├── Floor.js │ │ ├── SimpleCarModel.js │ │ ├── RampAndPlatform.js │ │ ├── Environment.js │ │ └── SimpleCarController.js │ ├── Renderer.js │ ├── Camera.js │ ├── PhysicsWorld.js │ └── Experience.js ├── index.html └── style.css ├── bundler ├── webpack.prod.js ├── webpack.dev.js └── webpack.common.js ├── .gitignore ├── package.json ├── readme.md └── LICENSE /dist/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cconsta1/threejs_car_demo/HEAD/.DS_Store -------------------------------------------------------------------------------- /static/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cconsta1/threejs_car_demo/HEAD/static/.DS_Store -------------------------------------------------------------------------------- /dist/draco/draco_decoder.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cconsta1/threejs_car_demo/HEAD/dist/draco/draco_decoder.wasm -------------------------------------------------------------------------------- /static/draco/draco_decoder.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cconsta1/threejs_car_demo/HEAD/static/draco/draco_decoder.wasm -------------------------------------------------------------------------------- /dist/draco/gltf/draco_decoder.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cconsta1/threejs_car_demo/HEAD/dist/draco/gltf/draco_decoder.wasm -------------------------------------------------------------------------------- /static/draco/gltf/draco_decoder.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cconsta1/threejs_car_demo/HEAD/static/draco/gltf/draco_decoder.wasm -------------------------------------------------------------------------------- /dist/icons/circle-of-two-clockwise-arrows-rotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cconsta1/threejs_car_demo/HEAD/dist/icons/circle-of-two-clockwise-arrows-rotation.png -------------------------------------------------------------------------------- /static/icons/circle-of-two-clockwise-arrows-rotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cconsta1/threejs_car_demo/HEAD/static/icons/circle-of-two-clockwise-arrows-rotation.png -------------------------------------------------------------------------------- /src/script.js: -------------------------------------------------------------------------------- 1 | import './style.css' 2 | import Experience from './Experience/Experience.js' 3 | 4 | const experience = new Experience(document.querySelector('canvas.webgl')) 5 | -------------------------------------------------------------------------------- /src/Experience/sources.js: -------------------------------------------------------------------------------- 1 | export default [ 2 | // We don't need these resource files anymore since we're using a simple car model 3 | // The simple car model is created procedurally with Three.js primitives 4 | ] -------------------------------------------------------------------------------- /src/Experience/Utils/Debug.js: -------------------------------------------------------------------------------- 1 | import * as dat from 'lil-gui' 2 | 3 | export default class Debug { 4 | constructor() { 5 | this.active = window.location.hash === '#debug' 6 | 7 | if (this.active) { 8 | this.gui = new dat.GUI() 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /dist/files/ic_code_black_24dp.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /static/files/ic_code_black_24dp.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /dist/assets/images/c023de65004745c7.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /dist/bundle.016c695988fcc69c.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright 2010-2022 Three.js Authors 4 | * SPDX-License-Identifier: MIT 5 | */ 6 | 7 | /** 8 | * lil-gui 9 | * https://lil-gui.georgealways.com 10 | * @version 0.16.1 11 | * @author George Michael Brower 12 | * @license MIT 13 | */ 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | Three.js-Cannon-es.js-Demo
-------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | # /.pnp 6 | # .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | #/build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | 25 | #media 26 | # /public/img 27 | # src/public/img 28 | # /public/render3d/model_lib 29 | # src/public/render3d/model_lib 30 | # /pdf-icons/ 31 | 32 | #assets for pdf 33 | # /public/assets 34 | 35 | #vsCode 36 | .vscode/* 37 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Three.js-Cannon-es.js-Demo 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/Experience/Utils/Sizes.js: -------------------------------------------------------------------------------- 1 | import EventEmitter from "./EventEmitter.js" 2 | 3 | export default class Sizes extends EventEmitter { 4 | constructor() { 5 | super() 6 | 7 | // Setup 8 | this.width = window.innerWidth 9 | this.height = window.innerHeight 10 | this.pixelRatio = Math.min(window.devicePixelRatio, 2) 11 | 12 | 13 | // Listeners 14 | window.addEventListener('resize', () => { 15 | this.width = window.innerWidth 16 | this.height = window.innerHeight 17 | this.pixelRatio = Math.min(window.devicePixelRatio, 2) 18 | 19 | this.trigger('resize') 20 | }) 21 | } 22 | } -------------------------------------------------------------------------------- /src/Experience/Utils/Time.js: -------------------------------------------------------------------------------- 1 | import EventEmitter from "./EventEmitter.js" 2 | 3 | export default class Time extends EventEmitter { 4 | constructor() { 5 | super() 6 | 7 | // Setup 8 | this.start = Date.now() 9 | this.current = this.start 10 | this.elapsed = 0 11 | this.delta = 16 12 | 13 | // RAF 14 | window.requestAnimationFrame(() => { 15 | this.tick() 16 | }) 17 | } 18 | 19 | tick() { 20 | const currentTime = Date.now() 21 | this.delta = currentTime - this.current 22 | this.current = currentTime 23 | this.elapsed = this.current - this.start 24 | 25 | this.trigger('tick') 26 | 27 | window.requestAnimationFrame(() => { 28 | this.tick() 29 | }) 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/Experience/World/World.js: -------------------------------------------------------------------------------- 1 | import Experience from "../Experience.js"; 2 | import Environment from "./Environment.js"; 3 | import Floor from "./Floor.js"; 4 | import SimpleCar from "./SimpleCar.js"; 5 | import SimpleCarController from "./SimpleCarController.js"; 6 | import RampAndPlatform from "./RampAndPlatform.js"; // Add this import 7 | 8 | export default class World { 9 | constructor() { 10 | this.experience = new Experience() 11 | this.scene = this.experience.scene 12 | 13 | // Setup immediately - no need to wait for resources 14 | this.floor = new Floor() 15 | this.simpleCar = new SimpleCar() 16 | this.simpleCarController = new SimpleCarController() 17 | this.rampAndPlatform = new RampAndPlatform() // Add this line 18 | this.environment = new Environment() 19 | } 20 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "repository": "#", 3 | "license": "UNLICENSED", 4 | "scripts": { 5 | "build": "webpack --config ./bundler/webpack.prod.js", 6 | "dev": "webpack serve --config ./bundler/webpack.dev.js" 7 | }, 8 | "dependencies": { 9 | "@babel/core": "^7.17.10", 10 | "@babel/preset-env": "^7.17.10", 11 | "babel-loader": "^8.2.5", 12 | "cannon-es": "^0.19.0", 13 | "cannon-es-debugger": "^1.0.0", 14 | "clean-webpack-plugin": "^4.0.0", 15 | "copy-webpack-plugin": "^10.2.4", 16 | "css-loader": "^6.7.1", 17 | "file-loader": "^6.2.0", 18 | "html-loader": "^3.1.0", 19 | "html-webpack-plugin": "^5.5.0", 20 | "lil-gui": "^0.16.1", 21 | "mini-css-extract-plugin": "^2.6.0", 22 | "portfinder-sync": "0.0.2", 23 | "raw-loader": "^4.0.2", 24 | "style-loader": "^3.3.1", 25 | "three": "^0.140.0", 26 | "webpack": "^5.72.0", 27 | "webpack-dev-server": "^4.8.1", 28 | "webpack-merge": "^5.8.0" 29 | }, 30 | "devDependencies": { 31 | "webpack-cli": "^5.1.4" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Three.js and Cannon-es demo car 2 | 3 | This is a demo site that adds physics to a GLTF car. 4 | 5 | "Vintage Racing Car" [link](https://skfb.ly/o8wJy) by Mateusz Woliński 6 | is licensed under Creative Commons Attribution 7 | [link](http://creativecommons.org/licenses/by/4.0/). 8 | 9 | The texture used is by Joao Paolo [link](https://3dtextures.me/). 10 | 11 | The project was built using template's borrowed by [Bruno Simon's](https://github.com/brunosimon) 12 | [threejs-journey](https://threejs-journey.com/) class. 13 | 14 | The project uses the [Cannon-es](https://pmndrs.github.io/cannon-es/docs/index.html) 15 | and [three.js](https://threejs.org/) libraries. For any questions, suggestions, etc, 16 | you can email me at [email](chrysovalantis.constantinou@gmail.com). 17 | 18 | ## Setup 19 | Download [Node.js](https://nodejs.org/en/download/). 20 | Run the following commands: 21 | 22 | ``` bash 23 | # Install dependencies (only the first time) 24 | npm install 25 | 26 | # Run the local server at localhost:8080 27 | npm run dev 28 | 29 | # Build for production in the dist/ directory 30 | npm run build 31 | ``` 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Chrysovalantis Constantinou 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/Experience/Renderer.js: -------------------------------------------------------------------------------- 1 | import * as THREE from "three" 2 | import Experience from "./Experience.js" 3 | 4 | export default class Renderer { 5 | constructor() { 6 | this.experience = new Experience() 7 | this.canvas = this.experience.canvas 8 | this.sizes = this.experience.sizes 9 | this.scene = this.experience.scene 10 | this.camera = this.experience.camera 11 | 12 | this.setInstance() 13 | } 14 | 15 | setInstance() { 16 | this.instance = new THREE.WebGLRenderer({ 17 | canvas: this.canvas, 18 | antialias: true, 19 | physicallyCorrectLights: true, 20 | shadowMap: { 21 | enabled: true, 22 | type: THREE.PCFSoftShadowMap 23 | }, 24 | toneMapping: THREE.CineonToneMapping 25 | }) 26 | 27 | this.instance.setSize(this.sizes.width, this.sizes.height) 28 | this.instance.setPixelRatio(this.sizes.devicePixelRatio) 29 | this.instance.setClearColor('#211d20') 30 | } 31 | 32 | resize() { 33 | this.instance.setSize(this.sizes.width, this.sizes.height) 34 | this.instance.setPixelRatio(this.sizes.devicePixelRatio) 35 | } 36 | 37 | update() { 38 | this.instance.render(this.scene, this.camera.instance) 39 | } 40 | } -------------------------------------------------------------------------------- /dist/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/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 | -------------------------------------------------------------------------------- /src/Experience/Camera.js: -------------------------------------------------------------------------------- 1 | import * as THREE from "three" 2 | import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls.js' 3 | import Experience from "./Experience.js" 4 | 5 | export default class Camera { 6 | constructor() { 7 | this.experience = new Experience() 8 | this.sizes = this.experience.sizes 9 | this.scene = this.experience.scene 10 | this.canvas = this.experience.canvas 11 | 12 | // Add testing mode flag 13 | this.testingMode = false // Set to true for orbit controls, false for chase camera 14 | 15 | this.setInstance() 16 | 17 | // Enable orbit controls during testing 18 | if (this.testingMode) { 19 | this.setOrbitControls() 20 | } 21 | } 22 | 23 | setInstance() { 24 | this.instance = new THREE.PerspectiveCamera( 25 | 35, 26 | this.sizes.width / this.sizes.height, 27 | 0.1, 28 | 1000 29 | ) 30 | 31 | this.instance.position.set(5, 10, 15) // Better initial position for viewing the car 32 | this.instance.lookAt(new THREE.Vector3(5, 0, 0)) // Look at approximate car position 33 | this.scene.add(this.instance) 34 | } 35 | 36 | setOrbitControls() { 37 | this.controls = new OrbitControls( 38 | this.instance, 39 | this.canvas 40 | ) 41 | 42 | this.controls.enableDamping = true 43 | this.controls.target.set(5, 5, 0) // Target the car's initial position 44 | } 45 | 46 | resize() { 47 | this.instance.aspect = this.sizes.width / this.sizes.height 48 | this.instance.updateProjectionMatrix() 49 | } 50 | 51 | update() { 52 | // Only update controls if they exist 53 | if (this.testingMode && this.controls) { 54 | this.controls.update() 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /src/Experience/PhysicsWorld.js: -------------------------------------------------------------------------------- 1 | import * as CANNON from 'cannon-es' 2 | import CannonDebugger from 'cannon-es-debugger' 3 | import Experience from './Experience.js' 4 | 5 | export default class PhysicsWorld { 6 | constructor() { 7 | this.experience = new Experience() 8 | this.scene = this.experience.scene 9 | this.setWorldPhysics() 10 | } 11 | 12 | setWorldPhysics() { 13 | this.instance = new CANNON.World() 14 | this.instance.gravity.set(0, -9.82, 0) 15 | this.instance.broadphase = new CANNON.SAPBroadphase(this.instance) 16 | this.instance.solver.iterations = 10 17 | 18 | // Default material 19 | const defaultMaterial = new CANNON.Material('default') 20 | const defaultContactMaterial = new CANNON.ContactMaterial(defaultMaterial, defaultMaterial, { 21 | friction: 0.4, 22 | restitution: 0.0 23 | }) 24 | this.instance.addContactMaterial(defaultContactMaterial) 25 | this.instance.defaultContactMaterial = defaultContactMaterial 26 | 27 | // DEBUGGER ENABLED - Comment out the block below to disable physics visualization 28 | this.cannonDebugger = new CannonDebugger(this.scene, this.instance, { 29 | // Optional debugger settings 30 | color: 0x00ff00, // Default color 31 | scale: 1, // Scale of the debug shapes 32 | }) 33 | 34 | /* 35 | TO DISABLE DEBUGGER: 36 | Set this.cannonDebugger = null 37 | 38 | TO ENABLE DEBUGGER: 39 | Uncomment the block above 40 | */ 41 | } 42 | 43 | update() { 44 | this.instance.fixedStep() 45 | 46 | // DEBUGGER UPDATE - Comment out this line to disable physics visualization 47 | if (this.cannonDebugger) { 48 | this.cannonDebugger.update() 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /bundler/webpack.dev.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | const { merge } = require('webpack-merge') 3 | const commonConfiguration = require('./webpack.common.js') 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 | stats: 'errors-warnings', 15 | mode: 'development', 16 | infrastructureLogging: 17 | { 18 | level: 'warn', 19 | }, 20 | devServer: 21 | { 22 | host: 'local-ip', 23 | port: portFinderSync.getPort(8080), 24 | open: true, 25 | https: false, 26 | allowedHosts: 'all', 27 | hot: false, 28 | watchFiles: ['src/**', 'static/**'], 29 | static: 30 | { 31 | watch: true, 32 | directory: path.join(__dirname, '../static') 33 | }, 34 | client: 35 | { 36 | logging: 'none', 37 | overlay: true, 38 | progress: false 39 | }, 40 | setupMiddlewares: function (middlewares, devServer) 41 | { 42 | console.log('------------------------------------------------------------') 43 | console.log(devServer.options.host) 44 | const port = devServer.options.port 45 | const https = devServer.options.https ? 's' : '' 46 | const domain1 = `http${https}://${devServer.options.host}:${port}` 47 | const domain2 = `http${https}://localhost:${port}` 48 | 49 | console.log(`Project running at:\n - ${infoColor(domain1)}\n - ${infoColor(domain2)}`) 50 | 51 | return middlewares 52 | } 53 | } 54 | } 55 | ) 56 | -------------------------------------------------------------------------------- /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 | hashFunction: 'xxhash64', 11 | filename: 'bundle.[contenthash].js', 12 | path: path.resolve(__dirname, '../dist') 13 | }, 14 | devtool: 'source-map', 15 | plugins: 16 | [ 17 | new CopyWebpackPlugin({ 18 | patterns: [ 19 | { from: path.resolve(__dirname, '../static') } 20 | ] 21 | }), 22 | new HtmlWebpackPlugin({ 23 | template: path.resolve(__dirname, '../src/index.html'), 24 | minify: true 25 | }), 26 | new MiniCSSExtractPlugin() 27 | ], 28 | module: 29 | { 30 | rules: 31 | [ 32 | // HTML 33 | { 34 | test: /\.(html)$/, 35 | use: 36 | [ 37 | 'html-loader' 38 | ] 39 | }, 40 | 41 | // JS 42 | { 43 | test: /\.js$/, 44 | exclude: /node_modules/, 45 | use: 46 | [ 47 | 'babel-loader' 48 | ] 49 | }, 50 | 51 | // CSS 52 | { 53 | test: /\.css$/, 54 | use: 55 | [ 56 | MiniCSSExtractPlugin.loader, 57 | 'css-loader' 58 | ] 59 | }, 60 | 61 | // Images 62 | { 63 | test: /\.(jpg|png|gif|svg)$/, 64 | type: 'asset/resource', 65 | generator: 66 | { 67 | filename: 'assets/images/[hash][ext]' 68 | } 69 | }, 70 | 71 | // Fonts 72 | { 73 | test: /\.(ttf|eot|woff|woff2)$/, 74 | type: 'asset/resource', 75 | generator: 76 | { 77 | filename: 'assets/fonts/[hash][ext]' 78 | } 79 | } 80 | ] 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/Experience/Utils/Resources.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js' 3 | import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js' 4 | import EventEmitter from "./EventEmitter.js" 5 | 6 | export default class Resources extends EventEmitter { 7 | constructor(sources) { 8 | super() 9 | 10 | this.sources = sources 11 | 12 | // Setup 13 | this.items = {} 14 | this.toLoad = this.sources.length 15 | 16 | // console.log('Resources to load:', this.toLoad) 17 | 18 | this.loaded = 0 19 | 20 | // Create a loading manager 21 | this.loadingManager = new THREE.LoadingManager(() => { 22 | const loadingScreen = document.getElementById('loading-screen') 23 | loadingScreen.classList.add('fade-out') 24 | loadingScreen.addEventListener('transitionend', this.onTransitionEnd) 25 | }) 26 | 27 | this.setLoaders() 28 | this.startLoading() 29 | } 30 | 31 | onTransitionEnd(event) { 32 | event.target.remove() 33 | } 34 | 35 | setLoaders() { 36 | this.loaders = {} 37 | this.loaders.dracoLoader = new DRACOLoader() 38 | this.loaders.dracoLoader.setDecoderPath('/draco/') 39 | this.loaders.gltfLoader = new GLTFLoader(this.loadingManager) 40 | this.loaders.gltfLoader.setDRACOLoader(this.dracoLoader) 41 | this.loaders.textureLoader = new THREE.TextureLoader(this.loadingManager) 42 | } 43 | 44 | startLoading() { 45 | // Load each item 46 | for (const source of this.sources) { 47 | if (source.type === 'gltfModel') { 48 | this.loaders.gltfLoader.load( 49 | source.path, 50 | (gltf) => { 51 | this.sourceLoaded(source, gltf) 52 | } 53 | ) 54 | } else if (source.type === 'texture') { 55 | this.loaders.textureLoader.load( 56 | source.path, 57 | (texture) => { 58 | this.sourceLoaded(source, texture) 59 | } 60 | ) 61 | } 62 | } 63 | } 64 | 65 | sourceLoaded(source, file){ 66 | this.items[source.name] = file 67 | 68 | this.loaded++ 69 | 70 | if (this.loaded === this.toLoad) { 71 | this.trigger('ready') 72 | } 73 | 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /src/Experience/Experience.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import Sizes from "./Utils/Sizes.js" 3 | import Time from "./Utils/Time.js" 4 | import Camera from "./Camera.js" 5 | import Renderer from './Renderer.js' 6 | import World from './World/World.js' 7 | import Debug from './Utils/Debug.js' 8 | import PhysicsWorld from './PhysicsWorld.js' 9 | 10 | let instance = null 11 | 12 | export default class Experience { 13 | constructor(canvas) { 14 | // Singleton 15 | if (instance) { 16 | return instance 17 | } 18 | 19 | instance = this 20 | 21 | // Options 22 | this.canvas = canvas 23 | 24 | // Setup 25 | this.debug = new Debug() 26 | this.sizes = new Sizes() 27 | this.time = new Time() 28 | this.scene = new THREE.Scene() 29 | this.worldPhysics = new PhysicsWorld() 30 | this.camera = new Camera() 31 | this.renderer = new Renderer() 32 | 33 | // Handle loading screen manually 34 | const loadingScreen = document.getElementById('loading-screen') 35 | setTimeout(() => { 36 | loadingScreen.classList.add('fade-out') 37 | loadingScreen.addEventListener('transitionend', (event) => { 38 | event.target.remove() 39 | }) 40 | }, 500) 41 | 42 | this.world = new World() 43 | 44 | // Access simpleCar directly from world 45 | if (this.world.simpleCar) { 46 | this.simpleCar = this.world.simpleCar 47 | } 48 | 49 | // Sizes resize event 50 | this.sizes.on('resize', () => { 51 | this.resize() 52 | }) 53 | 54 | // Time tick event 55 | this.time.on('tick', () => { 56 | this.update() 57 | }) 58 | } 59 | 60 | resize() { 61 | this.camera.resize() 62 | this.renderer.resize() 63 | } 64 | 65 | // Only modify the update method 66 | 67 | update() { 68 | this.camera.update() // Add this line to update the orbit controls 69 | this.renderer.update() 70 | this.worldPhysics.update() 71 | 72 | if (this.simpleCar) { 73 | this.simpleCar.update() 74 | } 75 | } 76 | 77 | destroy() { 78 | this.sizes.off('resize') 79 | this.time.off('tick') 80 | 81 | this.scene.traverse((child) => { 82 | if (child instanceof THREE.Mesh) { 83 | child.geometry.dispose() 84 | 85 | for (const key in child.material) { 86 | const value = child.material[key] 87 | 88 | if (value && typeof value.dispose === 'function') { 89 | value.dispose() 90 | } 91 | } 92 | } 93 | }) 94 | 95 | this.camera.controls.dispose() 96 | this.renderer.instance.dispose() 97 | 98 | if (this.debug.active) { 99 | this.debug.gui.destroy() 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /src/Experience/World/SimpleCar.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import Experience from '../Experience.js' 3 | import SimpleCarModel from './SimpleCarModel.js' 4 | import SimpleCarPhysics from './SimpleCarPhysics.js' 5 | 6 | let instance = null 7 | 8 | export default class SimpleCar { 9 | constructor() { 10 | // Singleton 11 | if (instance) { 12 | return instance 13 | } 14 | 15 | instance = this 16 | 17 | this.experience = new Experience() 18 | this.scene = this.experience.scene 19 | 20 | this.simpleCarModel = new SimpleCarModel() 21 | this.simpleCarPhysics = new SimpleCarPhysics() 22 | 23 | this.vehicle = this.simpleCarPhysics.vehicle 24 | 25 | this.time = this.experience.time 26 | 27 | this.frontWheelMesh1 = this.simpleCarModel.frontWheelMesh1 28 | this.frontWheelMesh2 = this.simpleCarModel.frontWheelMesh2 29 | this.rearWheelMesh1 = this.simpleCarModel.rearWheelMesh1 30 | this.rearWheelMesh2 = this.simpleCarModel.rearWheelMesh2 31 | this.chassisMesh = this.simpleCarModel.chassisMesh 32 | 33 | this.initChaseCamera() 34 | } 35 | 36 | initChaseCamera() { 37 | this.chaseCamera = new THREE.Object3D() 38 | this.chaseCameraPivot = new THREE.Object3D() 39 | this.view = new THREE.Vector3() 40 | 41 | this.chaseCamera.position.set(0, 5, -8) // Adjusted position for better view 42 | this.chaseCameraPivot.position.set(0, 0, 0) 43 | this.chaseCamera.add(this.chaseCameraPivot) 44 | this.scene.add(this.chaseCamera) 45 | 46 | if (this.chassisMesh) { 47 | this.chassisMesh.add(this.chaseCamera) 48 | } 49 | } 50 | 51 | // Only modify the updateChaseCamera method 52 | 53 | updateChaseCamera() { 54 | // Skip chase camera updates if in testing mode 55 | if (this.experience.camera.testingMode) { 56 | return 57 | } 58 | 59 | this.chaseCameraPivot.getWorldPosition(this.view) 60 | 61 | if (this.view.y < 1) { 62 | this.view.y = 1 63 | } 64 | 65 | this.experience.camera.instance.position.lerp(this.view, 0.3) 66 | this.experience.camera.instance.lookAt(this.chassisMesh.position) 67 | } 68 | 69 | 70 | update() { 71 | if (this.chassisMesh) { 72 | this.simpleCarModel.updateMeshPosition(this.chassisMesh, this.vehicle.chassisBody) 73 | } 74 | 75 | if (this.frontWheelMesh1) { 76 | this.simpleCarModel.updateMeshPosition(this.frontWheelMesh1, this.vehicle.wheelBodies[2]) 77 | } 78 | 79 | if (this.frontWheelMesh2) { 80 | this.simpleCarModel.updateMeshPosition(this.frontWheelMesh2, this.vehicle.wheelBodies[3]) 81 | } 82 | 83 | if (this.rearWheelMesh1) { 84 | this.simpleCarModel.updateMeshPosition(this.rearWheelMesh1, this.vehicle.wheelBodies[0]) 85 | } 86 | 87 | if (this.rearWheelMesh2) { 88 | this.simpleCarModel.updateMeshPosition(this.rearWheelMesh2, this.vehicle.wheelBodies[1]) 89 | } 90 | 91 | this.updateChaseCamera() 92 | 93 | // Update the physics 94 | //this.simpleCarPhysics.update() 95 | } 96 | } -------------------------------------------------------------------------------- /src/Experience/World/SimpleCarPhysics.js: -------------------------------------------------------------------------------- 1 | import * as CANNON from 'cannon-es' 2 | import Experience from '../Experience.js' 3 | import SimpleCar from './SimpleCar.js' 4 | import * as THREE from 'three' 5 | 6 | export default class SimpleCarPhysics { 7 | constructor() { 8 | this.simpleCar = new SimpleCar() // Get the singleton instance of SimpleCar 9 | this.experience = new Experience() // Get the singleton instance of Experience 10 | 11 | this.scene = this.experience.scene 12 | 13 | this.setPhysics() 14 | } 15 | 16 | setPhysics() { 17 | const wheelMaterial = new CANNON.Material('wheel') 18 | const down = new CANNON.Vec3(0, -1, 0) 19 | const mass = 1 20 | const quaternion = new CANNON.Quaternion().setFromEuler(0, 0, -Math.PI / 2) 21 | 22 | // Chassis setup 23 | const chassisShape = new CANNON.Box(new CANNON.Vec3(1, 0.5, 2)) 24 | const chassisBody = new CANNON.Body({ mass: 6, shape: chassisShape }) 25 | chassisBody.position.set(5, 5, 0) // Adjusted position to be above the floor and away from the origin 26 | this.vehicle = new CANNON.RigidVehicle({ chassisBody }) 27 | 28 | // Wheel setup 29 | const wheelMeshes = [ 30 | this.simpleCar.simpleCarModel.rearWheelMesh1, 31 | this.simpleCar.simpleCarModel.rearWheelMesh2, 32 | this.simpleCar.simpleCarModel.frontWheelMesh1, 33 | this.simpleCar.simpleCarModel.frontWheelMesh2 34 | ] 35 | 36 | wheelMeshes.forEach((wheelMesh, index) => { 37 | const wheelShape = new CANNON.Cylinder(0.5, 0.5, 0.5, 32) 38 | const wheelBody = new CANNON.Body({ mass, material: wheelMaterial }) 39 | wheelBody.addShape(wheelShape, new CANNON.Vec3(), quaternion) 40 | const axis = (index % 2 === 0) ? new CANNON.Vec3(-1, 0, 0) : new CANNON.Vec3(1, 0, 0) 41 | const position = new CANNON.Vec3( 42 | wheelMesh.position.x - chassisBody.position.x, 43 | wheelMesh.position.y - chassisBody.position.y, 44 | wheelMesh.position.z - chassisBody.position.z 45 | ) 46 | this.vehicle.addWheel({ 47 | body: wheelBody, 48 | position, 49 | axis, 50 | direction: down 51 | }) 52 | wheelBody.angularDamping = 0.4 53 | }) 54 | 55 | this.vehicle.addToWorld(this.experience.worldPhysics.instance) 56 | 57 | // Add visual markers for the front wheel physics body 58 | const markerGeometry = new THREE.SphereGeometry(0.1, 8, 8); 59 | const markerMaterial = new THREE.MeshBasicMaterial({ color: 0x00ff00 }); 60 | this.frontWheelMarker = new THREE.Mesh(markerGeometry, markerMaterial); 61 | this.scene.add(this.frontWheelMarker); 62 | 63 | // Add meshes to the scene 64 | this.scene.add(this.simpleCar.simpleCarModel.chassisMesh) 65 | this.scene.add(this.simpleCar.simpleCarModel.frontWheelMesh1) 66 | this.scene.add(this.simpleCar.simpleCarModel.frontWheelMesh2) 67 | this.scene.add(this.simpleCar.simpleCarModel.rearWheelMesh1) 68 | this.scene.add(this.simpleCar.simpleCarModel.rearWheelMesh2) 69 | } 70 | 71 | update() { 72 | // No need for debugger update here, it's in PhysicsWorld class 73 | } 74 | } -------------------------------------------------------------------------------- /src/Experience/Utils/EventEmitter.js: -------------------------------------------------------------------------------- 1 | export default class EventEmitter { 2 | constructor() { 3 | this.callbacks = {} 4 | this.callbacks.base = {} 5 | } 6 | 7 | on(_names, callback) { 8 | // Errors 9 | if (typeof _names === 'undefined' || _names === '') { 10 | console.warn('wrong names') 11 | return false 12 | } 13 | 14 | if (typeof callback === 'undefined') { 15 | console.warn('wrong callback') 16 | return false 17 | } 18 | 19 | // Resolve names 20 | const names = this.resolveNames(_names) 21 | 22 | // Each name 23 | names.forEach((_name) => { 24 | // Resolve name 25 | const name = this.resolveName(_name) 26 | 27 | // Create namespace if not exist 28 | if (!(this.callbacks[name.namespace] instanceof Object)) 29 | this.callbacks[name.namespace] = {} 30 | 31 | // Create callback if not exist 32 | if (!(this.callbacks[name.namespace][name.value] instanceof Array)) 33 | this.callbacks[name.namespace][name.value] = [] 34 | 35 | // Add callback 36 | this.callbacks[name.namespace][name.value].push(callback) 37 | }) 38 | 39 | return this 40 | } 41 | 42 | off(_names) { 43 | // Errors 44 | if (typeof _names === 'undefined' || _names === '') { 45 | console.warn('wrong name') 46 | return false 47 | } 48 | 49 | // Resolve names 50 | const names = this.resolveNames(_names) 51 | 52 | // Each name 53 | names.forEach((_name) => { 54 | // Resolve name 55 | const name = this.resolveName(_name) 56 | 57 | // Remove namespace 58 | if (name.namespace !== 'base' && name.value === '') { 59 | delete this.callbacks[name.namespace] 60 | } 61 | 62 | // Remove specific callback in namespace 63 | else { 64 | // Default 65 | if (name.namespace === 'base') { 66 | // Try to remove from each namespace 67 | for (const namespace in this.callbacks) { 68 | if (this.callbacks[namespace] instanceof Object && this.callbacks[namespace][name.value] instanceof Array) { 69 | delete this.callbacks[namespace][name.value] 70 | 71 | // Remove namespace if empty 72 | if (Object.keys(this.callbacks[namespace]).length === 0) 73 | delete this.callbacks[namespace] 74 | } 75 | } 76 | } 77 | 78 | // Specified namespace 79 | else if (this.callbacks[name.namespace] instanceof Object && this.callbacks[name.namespace][name.value] instanceof Array) { 80 | delete this.callbacks[name.namespace][name.value] 81 | 82 | // Remove namespace if empty 83 | if (Object.keys(this.callbacks[name.namespace]).length === 0) 84 | delete this.callbacks[name.namespace] 85 | } 86 | } 87 | }) 88 | 89 | return this 90 | } 91 | 92 | trigger(_name, _args) { 93 | // Errors 94 | if (typeof _name === 'undefined' || _name === '') { 95 | console.warn('wrong name') 96 | return false 97 | } 98 | 99 | let finalResult = null 100 | let result = null 101 | 102 | // Default args 103 | const args = !(_args instanceof Array) ? [] : _args 104 | 105 | // Resolve names (should on have one event) 106 | let name = this.resolveNames(_name) 107 | 108 | // Resolve name 109 | name = this.resolveName(name[0]) 110 | 111 | // Default namespace 112 | if (name.namespace === 'base') { 113 | // Try to find callback in each namespace 114 | for (const namespace in this.callbacks) { 115 | if (this.callbacks[namespace] instanceof Object && this.callbacks[namespace][name.value] instanceof Array) { 116 | this.callbacks[namespace][name.value].forEach(function (callback) { 117 | result = callback.apply(this, args) 118 | 119 | if (typeof finalResult === 'undefined') { 120 | finalResult = result 121 | } 122 | }) 123 | } 124 | } 125 | } 126 | 127 | // Specified namespace 128 | else if (this.callbacks[name.namespace] instanceof Object) { 129 | if (name.value === '') { 130 | console.warn('wrong name') 131 | return this 132 | } 133 | 134 | this.callbacks[name.namespace][name.value].forEach(function (callback) { 135 | result = callback.apply(this, args) 136 | 137 | if (typeof finalResult === 'undefined') 138 | finalResult = result 139 | }) 140 | } 141 | 142 | return finalResult 143 | } 144 | 145 | resolveNames(_names) { 146 | let names = _names 147 | names = names.replace(/[^a-zA-Z0-9 ,/.]/g, '') 148 | names = names.replace(/[,/]+/g, ' ') 149 | names = names.split(' ') 150 | 151 | return names 152 | } 153 | 154 | resolveName(name) { 155 | const newName = {} 156 | const parts = name.split('.') 157 | 158 | newName.original = name 159 | newName.value = parts[0] 160 | newName.namespace = 'base' // Base namespace 161 | 162 | // Specified namespace 163 | if (parts.length > 1 && parts[1] !== '') { 164 | newName.namespace = parts[1] 165 | } 166 | 167 | return newName 168 | } 169 | } -------------------------------------------------------------------------------- /src/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | padding: 0; 4 | } 5 | 6 | @import url('https://fonts.googleapis.com/css2?family=Bangers&family=Bowlby+One+SC&family=Press+Start+2P&display=swap'); 7 | 8 | html, 9 | body { 10 | overflow: hidden; 11 | font-family: 'Press Start 2P', 'Bowlby One SC', 'Bangers', 'Arial Rounded MT Bold', sans-serif; 12 | } 13 | 14 | .webgl { 15 | position: fixed; 16 | top: 0; 17 | left: 0; 18 | outline: none; 19 | } 20 | 21 | #loading-screen { 22 | position: absolute; 23 | z-index: 2; 24 | top: 0; 25 | left: 0; 26 | width: 100%; 27 | height: 100%; 28 | background: linear-gradient(135deg, #00B0FF, #00BFA5); /* Blue to teal Nintendo-style gradient */ 29 | opacity: 1; 30 | transition: 1s opacity; 31 | } 32 | 33 | #loading-screen.fade-out { 34 | opacity: 0; 35 | } 36 | 37 | /* Simplified Nintendo-style loader */ 38 | #loader { 39 | display: block; 40 | position: relative; 41 | left: 50%; 42 | top: 50%; 43 | width: 150px; /* Smaller size */ 44 | height: 150px; /* Smaller size */ 45 | margin: -75px 0 0 -75px; /* Adjusted for new size */ 46 | border-radius: 50%; 47 | border: 15px solid transparent; /* Less thick border */ 48 | border-top-color: #FF3D00; /* Nintendo red */ 49 | border-bottom-color: #FF3D00; /* Matching bottom */ 50 | -webkit-animation: spin 1.6s linear infinite; 51 | animation: spin 1.6s linear infinite; 52 | } 53 | 54 | #loader:before { 55 | content: ""; 56 | position: absolute; 57 | top: 15px; 58 | left: 15px; 59 | right: 15px; 60 | bottom: 15px; 61 | border-radius: 50%; 62 | border: 10px solid transparent; /* Thinner inner border */ 63 | border-top-color: white; /* Simplified to just white */ 64 | border-bottom-color: white; /* Adding bottom color to make it more visible */ 65 | -webkit-animation: spin 2.4s linear infinite reverse; 66 | animation: spin 2.4s linear infinite reverse; 67 | } 68 | 69 | /* Adding back the third spinner for visual completeness */ 70 | #loader:after { 71 | content: ""; 72 | position: absolute; 73 | top: 40px; 74 | left: 40px; 75 | right: 40px; 76 | bottom: 40px; 77 | border-radius: 50%; 78 | border: 8px solid transparent; /* Thinner for smallest circle */ 79 | border-top-color: #FFDD00; /* Nintendo yellow */ 80 | border-bottom-color: #FFDD00; /* Matching bottom */ 81 | -webkit-animation: spin 1.2s linear infinite; 82 | animation: spin 1.2s linear infinite; 83 | } 84 | 85 | @-webkit-keyframes spin { 86 | 0% { 87 | -webkit-transform: rotate(0deg); 88 | -ms-transform: rotate(0deg); 89 | transform: rotate(0deg); 90 | } 91 | 92 | 100% { 93 | -webkit-transform: rotate(360deg); 94 | -ms-transform: rotate(360deg); 95 | transform: rotate(360deg); 96 | } 97 | } 98 | 99 | @keyframes spin { 100 | 0% { 101 | -webkit-transform: rotate(0deg); 102 | -ms-transform: rotate(0deg); 103 | transform: rotate(0deg); 104 | } 105 | 106 | 100% { 107 | -webkit-transform: rotate(360deg); 108 | -ms-transform: rotate(360deg); 109 | transform: rotate(360deg); 110 | } 111 | } 112 | 113 | /* Updated Nintendo-style GitHub button */ 114 | #button { 115 | position: fixed; 116 | bottom: 20px; 117 | right: 20px; 118 | width: 60px; 119 | height: 60px; 120 | border-radius: 50%; 121 | background-color: #FF3D00; /* Match reset button */ 122 | box-shadow: 0 6px 0 #C53000, 0 8px 15px rgba(0,0,0,0.3); /* 3D effect */ 123 | opacity: 1; 124 | z-index: 999; 125 | transition: transform 0.1s, box-shadow 0.1s; 126 | display: flex; 127 | justify-content: center; 128 | align-items: center; 129 | border: 4px solid white; /* White border for cartoon look */ 130 | } 131 | 132 | #button:hover { 133 | cursor: pointer; 134 | transform: translateY(-3px); 135 | box-shadow: 0 9px 0 #C53000, 0 11px 17px rgba(0,0,0,0.3); 136 | } 137 | 138 | #button:active { 139 | transform: translateY(4px); 140 | box-shadow: 0 2px 0 #C53000, 0 4px 8px rgba(0,0,0,0.3); 141 | } 142 | 143 | #button img { 144 | display: block; 145 | width: 30px; 146 | height: 30px; 147 | filter: brightness(0) invert(1); /* Make icon white */ 148 | } 149 | 150 | #button.text { 151 | border-radius: 25px; 152 | padding-right: 20px; 153 | padding-left: 20px; 154 | color: #ffffff; 155 | opacity: 1; 156 | font-weight: 500; 157 | } 158 | 159 | #reset { 160 | position: absolute; 161 | top: 16px; 162 | left: 16px; 163 | width: 2.0em; 164 | height: 2.0em; 165 | padding: 12px; 166 | border-radius: 50%; 167 | margin-bottom: 0px; 168 | background-color: #00BFA5; /* Teal green Nintendo style */ 169 | opacity: .9; 170 | z-index: 999; 171 | box-shadow: 0 0 8px rgba(0, 0, 0, .25); 172 | transition: transform 0.2s, opacity 0.2s; 173 | } 174 | 175 | #reset:hover { 176 | cursor: pointer; 177 | opacity: 1; 178 | transform: scale(1.1); 179 | } 180 | 181 | /* Updated Nintendo-style reset button */ 182 | #reset-button { 183 | position: absolute; 184 | top: 20px; 185 | right: 20px; 186 | padding: 15px 30px; 187 | font-size: 22px; 188 | font-weight: bold; 189 | font-family: 'Press Start 2P', 'Bowlby One SC', sans-serif; 190 | background-color: #FF3D00; /* Orange-red instead of pink */ 191 | color: white; 192 | border: none; 193 | border-radius: 40px; /* More rounded, Nintendo-style */ 194 | cursor: pointer; 195 | z-index: 1000; 196 | box-shadow: 0 8px 0 #C53000, 0 10px 20px rgba(0,0,0,0.3); /* Deeper 3D effect */ 197 | transition: transform 0.1s, box-shadow 0.1s; 198 | letter-spacing: 2px; 199 | text-transform: uppercase; 200 | text-shadow: 2px 2px 0 #C53000; 201 | } 202 | 203 | #reset-button:hover { 204 | background-color: #FF6333; 205 | transform: translateY(-3px); 206 | box-shadow: 0 11px 0 #C53000, 0 13px 22px rgba(0,0,0,0.3); 207 | } 208 | 209 | #reset-button:active { 210 | transform: translateY(5px); 211 | box-shadow: 0 3px 0 #C53000, 0 5px 10px rgba(0,0,0,0.3); 212 | } -------------------------------------------------------------------------------- /dist/main.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css2?family=Bangers&family=Bowlby+One+SC&family=Press+Start+2P&display=swap); 2 | * { 3 | margin: 0; 4 | padding: 0; 5 | } 6 | 7 | html, 8 | body { 9 | overflow: hidden; 10 | font-family: 'Press Start 2P', 'Bowlby One SC', 'Bangers', 'Arial Rounded MT Bold', sans-serif; 11 | } 12 | 13 | .webgl { 14 | position: fixed; 15 | top: 0; 16 | left: 0; 17 | outline: none; 18 | } 19 | 20 | #loading-screen { 21 | position: absolute; 22 | z-index: 2; 23 | top: 0; 24 | left: 0; 25 | width: 100%; 26 | height: 100%; 27 | background: linear-gradient(135deg, #00B0FF, #00BFA5); /* Blue to teal Nintendo-style gradient */ 28 | opacity: 1; 29 | transition: 1s opacity; 30 | } 31 | 32 | #loading-screen.fade-out { 33 | opacity: 0; 34 | } 35 | 36 | /* Simplified Nintendo-style loader */ 37 | #loader { 38 | display: block; 39 | position: relative; 40 | left: 50%; 41 | top: 50%; 42 | width: 150px; /* Smaller size */ 43 | height: 150px; /* Smaller size */ 44 | margin: -75px 0 0 -75px; /* Adjusted for new size */ 45 | border-radius: 50%; 46 | border: 15px solid transparent; /* Less thick border */ 47 | border-top-color: #FF3D00; /* Nintendo red */ 48 | border-bottom-color: #FF3D00; /* Matching bottom */ 49 | -webkit-animation: spin 1.6s linear infinite; 50 | animation: spin 1.6s linear infinite; 51 | } 52 | 53 | #loader:before { 54 | content: ""; 55 | position: absolute; 56 | top: 15px; 57 | left: 15px; 58 | right: 15px; 59 | bottom: 15px; 60 | border-radius: 50%; 61 | border: 10px solid transparent; /* Thinner inner border */ 62 | border-top-color: white; /* Simplified to just white */ 63 | border-bottom-color: white; /* Adding bottom color to make it more visible */ 64 | -webkit-animation: spin 2.4s linear infinite reverse; 65 | animation: spin 2.4s linear infinite reverse; 66 | } 67 | 68 | /* Adding back the third spinner for visual completeness */ 69 | #loader:after { 70 | content: ""; 71 | position: absolute; 72 | top: 40px; 73 | left: 40px; 74 | right: 40px; 75 | bottom: 40px; 76 | border-radius: 50%; 77 | border: 8px solid transparent; /* Thinner for smallest circle */ 78 | border-top-color: #FFDD00; /* Nintendo yellow */ 79 | border-bottom-color: #FFDD00; /* Matching bottom */ 80 | -webkit-animation: spin 1.2s linear infinite; 81 | animation: spin 1.2s linear infinite; 82 | } 83 | 84 | @-webkit-keyframes spin { 85 | 0% { 86 | -webkit-transform: rotate(0deg); 87 | -ms-transform: rotate(0deg); 88 | transform: rotate(0deg); 89 | } 90 | 91 | 100% { 92 | -webkit-transform: rotate(360deg); 93 | -ms-transform: rotate(360deg); 94 | transform: rotate(360deg); 95 | } 96 | } 97 | 98 | @keyframes spin { 99 | 0% { 100 | -webkit-transform: rotate(0deg); 101 | -ms-transform: rotate(0deg); 102 | transform: rotate(0deg); 103 | } 104 | 105 | 100% { 106 | -webkit-transform: rotate(360deg); 107 | -ms-transform: rotate(360deg); 108 | transform: rotate(360deg); 109 | } 110 | } 111 | 112 | /* Updated Nintendo-style GitHub button */ 113 | #button { 114 | position: fixed; 115 | bottom: 20px; 116 | right: 20px; 117 | width: 60px; 118 | height: 60px; 119 | border-radius: 50%; 120 | background-color: #FF3D00; /* Match reset button */ 121 | box-shadow: 0 6px 0 #C53000, 0 8px 15px rgba(0,0,0,0.3); /* 3D effect */ 122 | opacity: 1; 123 | z-index: 999; 124 | transition: transform 0.1s, box-shadow 0.1s; 125 | display: flex; 126 | justify-content: center; 127 | align-items: center; 128 | border: 4px solid white; /* White border for cartoon look */ 129 | } 130 | 131 | #button:hover { 132 | cursor: pointer; 133 | transform: translateY(-3px); 134 | box-shadow: 0 9px 0 #C53000, 0 11px 17px rgba(0,0,0,0.3); 135 | } 136 | 137 | #button:active { 138 | transform: translateY(4px); 139 | box-shadow: 0 2px 0 #C53000, 0 4px 8px rgba(0,0,0,0.3); 140 | } 141 | 142 | #button img { 143 | display: block; 144 | width: 30px; 145 | height: 30px; 146 | filter: brightness(0) invert(1); /* Make icon white */ 147 | } 148 | 149 | #button.text { 150 | border-radius: 25px; 151 | padding-right: 20px; 152 | padding-left: 20px; 153 | color: #ffffff; 154 | opacity: 1; 155 | font-weight: 500; 156 | } 157 | 158 | #reset { 159 | position: absolute; 160 | top: 16px; 161 | left: 16px; 162 | width: 2.0em; 163 | height: 2.0em; 164 | padding: 12px; 165 | border-radius: 50%; 166 | margin-bottom: 0px; 167 | background-color: #00BFA5; /* Teal green Nintendo style */ 168 | opacity: .9; 169 | z-index: 999; 170 | box-shadow: 0 0 8px rgba(0, 0, 0, .25); 171 | transition: transform 0.2s, opacity 0.2s; 172 | } 173 | 174 | #reset:hover { 175 | cursor: pointer; 176 | opacity: 1; 177 | transform: scale(1.1); 178 | } 179 | 180 | /* Updated Nintendo-style reset button */ 181 | #reset-button { 182 | position: absolute; 183 | top: 20px; 184 | right: 20px; 185 | padding: 15px 30px; 186 | font-size: 22px; 187 | font-weight: bold; 188 | font-family: 'Press Start 2P', 'Bowlby One SC', sans-serif; 189 | background-color: #FF3D00; /* Orange-red instead of pink */ 190 | color: white; 191 | border: none; 192 | border-radius: 40px; /* More rounded, Nintendo-style */ 193 | cursor: pointer; 194 | z-index: 1000; 195 | box-shadow: 0 8px 0 #C53000, 0 10px 20px rgba(0,0,0,0.3); /* Deeper 3D effect */ 196 | transition: transform 0.1s, box-shadow 0.1s; 197 | letter-spacing: 2px; 198 | text-transform: uppercase; 199 | text-shadow: 2px 2px 0 #C53000; 200 | } 201 | 202 | #reset-button:hover { 203 | background-color: #FF6333; 204 | transform: translateY(-3px); 205 | box-shadow: 0 11px 0 #C53000, 0 13px 22px rgba(0,0,0,0.3); 206 | } 207 | 208 | #reset-button:active { 209 | transform: translateY(5px); 210 | box-shadow: 0 3px 0 #C53000, 0 5px 10px rgba(0,0,0,0.3); 211 | } 212 | 213 | /*# sourceMappingURL=main.css.map*/ -------------------------------------------------------------------------------- /src/Experience/World/Floor.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import * as CANNON from 'cannon-es' 3 | import Experience from '../Experience.js' 4 | 5 | export default class Floor { 6 | constructor() { 7 | this.experience = new Experience() 8 | this.scene = this.experience.scene 9 | this.worldPhysics = this.experience.worldPhysics.instance 10 | 11 | // Simplified Nintendo racing colors 12 | this.nintendoColors = { 13 | roadColor: 0x2C2C2C, // Darker gray road for a more Nintendo-like appearance 14 | roadStripeColor: 0xF8F8F8, // Nintendo-like white stripes 15 | cylinderColor: 0xFF0000, // Classic Nintendo red 16 | cylinderTopColor: 0xF8F8F8 // Nintendo-like white 17 | } 18 | 19 | this.setGeometry() 20 | this.setMaterial() 21 | this.setMesh() 22 | this.setPhysics() 23 | //this.addRoadMarkings() 24 | this.createBoundaryMarkers() 25 | } 26 | 27 | setGeometry() { 28 | this.geometry = new THREE.PlaneGeometry(100, 100) 29 | } 30 | 31 | setMaterial() { 32 | // Create a dark gray cartoonish road surface 33 | this.material = new THREE.MeshToonMaterial({ 34 | color: this.nintendoColors.roadColor 35 | }) 36 | } 37 | 38 | setMesh() { 39 | this.mesh = new THREE.Mesh(this.geometry, this.material) 40 | this.mesh.rotation.x = -Math.PI * 0.5 41 | this.mesh.receiveShadow = true 42 | this.scene.add(this.mesh) 43 | } 44 | 45 | addRoadMarkings() { 46 | // Add simple white dashed lines to the road 47 | const lineWidth = 2 48 | const lineLength = 5 49 | const numLines = 12 50 | 51 | const lineMaterial = new THREE.MeshBasicMaterial({ 52 | color: this.nintendoColors.roadStripeColor 53 | }) 54 | 55 | for (let i = 0; i < numLines; i++) { 56 | const lineGeometry = new THREE.PlaneGeometry(lineWidth, lineLength) 57 | const line = new THREE.Mesh(lineGeometry, lineMaterial) 58 | 59 | // Position in a circle around the center 60 | const angle = (i / numLines) * Math.PI * 2 61 | const radius = 25 // Middle of the road 62 | 63 | const x = Math.sin(angle) * radius 64 | const z = Math.cos(angle) * radius 65 | 66 | line.position.set(x, 0.02, z) // Slightly above road 67 | line.rotation.set(-Math.PI / 2, 0, angle + Math.PI/2) 68 | 69 | this.scene.add(line) 70 | } 71 | 72 | // Add a center line circle 73 | const centerLineGeometry = new THREE.RingGeometry(15, 16, 32) 74 | const centerLine = new THREE.Mesh(centerLineGeometry, lineMaterial) 75 | centerLine.rotation.x = -Math.PI / 2 76 | centerLine.position.y = 0.02 // Slightly above road 77 | this.scene.add(centerLine) 78 | } 79 | 80 | createBoundaryMarkers() { 81 | // Create red cylinders with white tops as boundary markers 82 | const cylinderGeometry = new THREE.CylinderGeometry(0.5, 0.5, 1.3, 8) 83 | const cylinderTopGeometry = new THREE.CylinderGeometry(0.5, 0.5, 0.2, 8) 84 | 85 | const cylinderMaterial = new THREE.MeshToonMaterial({ 86 | color: this.nintendoColors.cylinderColor 87 | }) 88 | 89 | const cylinderTopMaterial = new THREE.MeshToonMaterial({ 90 | color: this.nintendoColors.cylinderTopColor 91 | }) 92 | 93 | // Place cylinders around in a pattern 94 | const radius = 40 95 | const numCylinders = 16 96 | 97 | for (let i = 0; i < numCylinders; i++) { 98 | const angle = (i / numCylinders) * Math.PI * 2 99 | const x = Math.cos(angle) * radius 100 | const z = Math.sin(angle) * radius 101 | 102 | // Create cylinder group 103 | const cylinderGroup = new THREE.Group() 104 | cylinderGroup.position.set(x, 0.75, z) 105 | 106 | // Main red part 107 | const cylinder = new THREE.Mesh(cylinderGeometry, cylinderMaterial) 108 | cylinder.position.y = -0.1 // Offset to place top correctly 109 | cylinderGroup.add(cylinder) 110 | 111 | // White top 112 | const cylinderTop = new THREE.Mesh(cylinderTopGeometry, cylinderTopMaterial) 113 | cylinderTop.position.y = 0.65 // Position on top of the red part 114 | cylinderGroup.add(cylinderTop) 115 | 116 | cylinderGroup.castShadow = true 117 | this.scene.add(cylinderGroup) 118 | 119 | // Add physics for the cylinder with bounce properties 120 | const cylinderBody = new CANNON.Body({ 121 | mass: 0, // Static body 122 | shape: new CANNON.Cylinder(0.5, 0.5, 1.5, 8), // Matching cylinder dimensions 123 | position: new CANNON.Vec3(x, 0.75, z) 124 | }); 125 | 126 | // Add bouncy material for bumpers 127 | const bumperMaterial = new CANNON.Material('bumperMaterial') 128 | bumperMaterial.friction = 0.2 129 | bumperMaterial.restitution = 0.7 // Higher bounce for more cartoon feel 130 | cylinderBody.material = bumperMaterial 131 | 132 | this.worldPhysics.addBody(cylinderBody); 133 | 134 | // Set up contact material between car and bumpers 135 | const carBumperContactMaterial = new CANNON.ContactMaterial( 136 | bumperMaterial, 137 | this.worldPhysics.defaultMaterial, 138 | { friction: 0.1, restitution: 0.7 } 139 | ) 140 | this.worldPhysics.addContactMaterial(carBumperContactMaterial) 141 | } 142 | } 143 | 144 | setPhysics() { 145 | // Create a physics body for the floor 146 | this.body = new CANNON.Body({ 147 | type: CANNON.Body.STATIC, 148 | shape: new CANNON.Box(new CANNON.Vec3(50, 0.01, 50)) 149 | }) 150 | 151 | this.body.position.y = 0 152 | 153 | const material = new CANNON.Material('floorMaterial') 154 | material.friction = 0.3 155 | material.restitution = 0.1 156 | this.body.material = material 157 | 158 | this.worldPhysics.addBody(this.body) 159 | } 160 | } -------------------------------------------------------------------------------- /dist/main.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"main.css","mappings":";AAAA;IACI,SAAS;IACT,UAAU;AACd;;AAIA;;IAEI,gBAAgB;IAChB,8FAA8F;AAClG;;AAEA;IACI,eAAe;IACf,MAAM;IACN,OAAO;IACP,aAAa;AACjB;;AAEA;IACI,kBAAkB;IAClB,UAAU;IACV,MAAM;IACN,OAAO;IACP,WAAW;IACX,YAAY;IACZ,qDAAqD,EAAE,yCAAyC;IAChG,UAAU;IACV,sBAAsB;AAC1B;;AAEA;IACI,UAAU;AACd;;AAEA,qCAAqC;AACrC;IACI,cAAc;IACd,kBAAkB;IAClB,SAAS;IACT,QAAQ;IACR,YAAY,EAAE,iBAAiB;IAC/B,aAAa,EAAE,iBAAiB;IAChC,uBAAuB,EAAE,0BAA0B;IACnD,kBAAkB;IAClB,8BAA8B,EAAE,sBAAsB;IACtD,yBAAyB,EAAE,iBAAiB;IAC5C,4BAA4B,EAAE,oBAAoB;IAClD,4CAA4C;IAC5C,oCAAoC;AACxC;;AAEA;IACI,WAAW;IACX,kBAAkB;IAClB,SAAS;IACT,UAAU;IACV,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,8BAA8B,EAAE,yBAAyB;IACzD,uBAAuB,EAAE,6BAA6B;IACtD,0BAA0B,EAAE,gDAAgD;IAC5E,oDAAoD;IACpD,4CAA4C;AAChD;;AAEA,0DAA0D;AAC1D;IACI,WAAW;IACX,kBAAkB;IAClB,SAAS;IACT,UAAU;IACV,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,6BAA6B,EAAE,gCAAgC;IAC/D,yBAAyB,EAAE,oBAAoB;IAC/C,4BAA4B,EAAE,oBAAoB;IAClD,4CAA4C;IAC5C,oCAAoC;AACxC;;AAEA;IACI;QACI,+BAA+B;QAC/B,2BAA2B;QAC3B,uBAAuB;IAC3B;;IAEA;QACI,iCAAiC;QACjC,6BAA6B;QAC7B,yBAAyB;IAC7B;AACJ;;AAEA;IACI;QACI,+BAA+B;QAC/B,2BAA2B;QAC3B,uBAAuB;IAC3B;;IAEA;QACI,iCAAiC;QACjC,6BAA6B;QAC7B,yBAAyB;IAC7B;AACJ;;AAEA,yCAAyC;AACzC;IACI,eAAe;IACf,YAAY;IACZ,WAAW;IACX,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,yBAAyB,EAAE,uBAAuB;IAClD,uDAAuD,EAAE,cAAc;IACvE,UAAU;IACV,YAAY;IACZ,2CAA2C;IAC3C,aAAa;IACb,uBAAuB;IACvB,mBAAmB;IACnB,uBAAuB,EAAE,kCAAkC;AAC/D;;AAEA;IACI,eAAe;IACf,2BAA2B;IAC3B,wDAAwD;AAC5D;;AAEA;IACI,0BAA0B;IAC1B,sDAAsD;AAC1D;;AAEA;IACI,cAAc;IACd,WAAW;IACX,YAAY;IACZ,+BAA+B,EAAE,oBAAoB;AACzD;;AAEA;IACI,mBAAmB;IACnB,mBAAmB;IACnB,kBAAkB;IAClB,cAAc;IACd,UAAU;IACV,gBAAgB;AACpB;;AAEA;IACI,kBAAkB;IAClB,SAAS;IACT,UAAU;IACV,YAAY;IACZ,aAAa;IACb,aAAa;IACb,kBAAkB;IAClB,kBAAkB;IAClB,yBAAyB,EAAE,8BAA8B;IACzD,WAAW;IACX,YAAY;IACZ,sCAAsC;IACtC,wCAAwC;AAC5C;;AAEA;IACI,eAAe;IACf,UAAU;IACV,qBAAqB;AACzB;;AAEA,wCAAwC;AACxC;IACI,kBAAkB;IAClB,SAAS;IACT,WAAW;IACX,kBAAkB;IAClB,eAAe;IACf,iBAAiB;IACjB,0DAA0D;IAC1D,yBAAyB,EAAE,+BAA+B;IAC1D,YAAY;IACZ,YAAY;IACZ,mBAAmB,EAAE,iCAAiC;IACtD,eAAe;IACf,aAAa;IACb,wDAAwD,EAAE,qBAAqB;IAC/E,2CAA2C;IAC3C,mBAAmB;IACnB,yBAAyB;IACzB,8BAA8B;AAClC;;AAEA;IACI,yBAAyB;IACzB,2BAA2B;IAC3B,yDAAyD;AAC7D;;AAEA;IACI,0BAA0B;IAC1B,uDAAuD;AAC3D,C","sources":["webpack:///./src/style.css"],"sourcesContent":["* {\n margin: 0;\n padding: 0;\n}\n\n@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Bowlby+One+SC&family=Press+Start+2P&display=swap');\n\nhtml,\nbody {\n overflow: hidden;\n font-family: 'Press Start 2P', 'Bowlby One SC', 'Bangers', 'Arial Rounded MT Bold', sans-serif;\n}\n\n.webgl {\n position: fixed;\n top: 0;\n left: 0;\n outline: none;\n}\n\n#loading-screen {\n position: absolute;\n z-index: 2;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(135deg, #00B0FF, #00BFA5); /* Blue to teal Nintendo-style gradient */\n opacity: 1;\n transition: 1s opacity;\n}\n\n#loading-screen.fade-out {\n opacity: 0;\n}\n\n/* Simplified Nintendo-style loader */\n#loader {\n display: block;\n position: relative;\n left: 50%;\n top: 50%;\n width: 150px; /* Smaller size */\n height: 150px; /* Smaller size */\n margin: -75px 0 0 -75px; /* Adjusted for new size */\n border-radius: 50%;\n border: 15px solid transparent; /* Less thick border */\n border-top-color: #FF3D00; /* Nintendo red */\n border-bottom-color: #FF3D00; /* Matching bottom */\n -webkit-animation: spin 1.6s linear infinite;\n animation: spin 1.6s linear infinite;\n}\n\n#loader:before {\n content: \"\";\n position: absolute;\n top: 15px;\n left: 15px;\n right: 15px;\n bottom: 15px;\n border-radius: 50%;\n border: 10px solid transparent; /* Thinner inner border */\n border-top-color: white; /* Simplified to just white */\n border-bottom-color: white; /* Adding bottom color to make it more visible */\n -webkit-animation: spin 2.4s linear infinite reverse;\n animation: spin 2.4s linear infinite reverse;\n}\n\n/* Adding back the third spinner for visual completeness */\n#loader:after {\n content: \"\";\n position: absolute;\n top: 40px;\n left: 40px;\n right: 40px;\n bottom: 40px;\n border-radius: 50%;\n border: 8px solid transparent; /* Thinner for smallest circle */\n border-top-color: #FFDD00; /* Nintendo yellow */\n border-bottom-color: #FFDD00; /* Matching bottom */\n -webkit-animation: spin 1.2s linear infinite;\n animation: spin 1.2s linear infinite;\n}\n\n@-webkit-keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n -ms-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n -ms-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n -ms-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -webkit-transform: rotate(360deg);\n -ms-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n/* Updated Nintendo-style GitHub button */\n#button {\n position: fixed;\n bottom: 20px;\n right: 20px;\n width: 60px;\n height: 60px;\n border-radius: 50%;\n background-color: #FF3D00; /* Match reset button */\n box-shadow: 0 6px 0 #C53000, 0 8px 15px rgba(0,0,0,0.3); /* 3D effect */\n opacity: 1;\n z-index: 999;\n transition: transform 0.1s, box-shadow 0.1s;\n display: flex;\n justify-content: center;\n align-items: center;\n border: 4px solid white; /* White border for cartoon look */\n}\n\n#button:hover {\n cursor: pointer;\n transform: translateY(-3px);\n box-shadow: 0 9px 0 #C53000, 0 11px 17px rgba(0,0,0,0.3);\n}\n\n#button:active {\n transform: translateY(4px);\n box-shadow: 0 2px 0 #C53000, 0 4px 8px rgba(0,0,0,0.3);\n}\n\n#button img {\n display: block;\n width: 30px;\n height: 30px;\n filter: brightness(0) invert(1); /* Make icon white */\n}\n\n#button.text {\n border-radius: 25px;\n padding-right: 20px;\n padding-left: 20px;\n color: #ffffff;\n opacity: 1;\n font-weight: 500;\n}\n\n#reset {\n position: absolute;\n top: 16px;\n left: 16px;\n width: 2.0em;\n height: 2.0em;\n padding: 12px;\n border-radius: 50%;\n margin-bottom: 0px;\n background-color: #00BFA5; /* Teal green Nintendo style */\n opacity: .9;\n z-index: 999;\n box-shadow: 0 0 8px rgba(0, 0, 0, .25);\n transition: transform 0.2s, opacity 0.2s;\n}\n\n#reset:hover {\n cursor: pointer;\n opacity: 1;\n transform: scale(1.1);\n}\n\n/* Updated Nintendo-style reset button */\n#reset-button {\n position: absolute;\n top: 20px;\n right: 20px;\n padding: 15px 30px;\n font-size: 22px;\n font-weight: bold;\n font-family: 'Press Start 2P', 'Bowlby One SC', sans-serif;\n background-color: #FF3D00; /* Orange-red instead of pink */\n color: white;\n border: none;\n border-radius: 40px; /* More rounded, Nintendo-style */\n cursor: pointer;\n z-index: 1000;\n box-shadow: 0 8px 0 #C53000, 0 10px 20px rgba(0,0,0,0.3); /* Deeper 3D effect */\n transition: transform 0.1s, box-shadow 0.1s;\n letter-spacing: 2px;\n text-transform: uppercase;\n text-shadow: 2px 2px 0 #C53000;\n}\n\n#reset-button:hover {\n background-color: #FF6333;\n transform: translateY(-3px);\n box-shadow: 0 11px 0 #C53000, 0 13px 22px rgba(0,0,0,0.3);\n}\n\n#reset-button:active {\n transform: translateY(5px);\n box-shadow: 0 3px 0 #C53000, 0 5px 10px rgba(0,0,0,0.3);\n}"],"names":[],"sourceRoot":""} -------------------------------------------------------------------------------- /src/Experience/World/SimpleCarModel.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import Experience from '../Experience.js' 3 | 4 | export default class SimpleCarModel { 5 | constructor() { 6 | this.experience = new Experience() 7 | 8 | // Simplified primary color palette that appeals to kids 9 | this.nintendoColors = [ 10 | 0xFF0000, // Bright red 11 | 0x00FF00, // Bright green 12 | 0x0000FF, // Bright blue 13 | 0xFFFF00, // Yellow 14 | 0xFF00FF, // Magenta 15 | 0x00FFFF // Cyan 16 | ]; 17 | 18 | this.setModel() 19 | } 20 | 21 | setModel() { 22 | // Create chassis with bright red as default 23 | const initialColor = this.nintendoColors[0]; 24 | 25 | // Main body - NO ROOF 26 | this.chassisMesh = new THREE.Group(); 27 | this.chassisMesh.position.set(5, 5, 0); 28 | 29 | // Create main body with slightly rounded corners for cartoon effect 30 | const bodyGeometry = new THREE.BoxGeometry(2, 0.9, 4); 31 | const bodyMaterial = new THREE.MeshToonMaterial({ 32 | color: initialColor, 33 | emissive: new THREE.Color(initialColor).multiplyScalar(0.1) 34 | }); 35 | 36 | const bodyMesh = new THREE.Mesh(bodyGeometry, bodyMaterial); 37 | this.chassisMesh.add(bodyMesh); 38 | 39 | // Add cartoon-style windows (black) 40 | // this.windowMesh = new THREE.Mesh( 41 | // new THREE.BoxGeometry(1.5, 0.4, 1.6), 42 | // new THREE.MeshToonMaterial({ 43 | // color: 0x111111 44 | // }) 45 | // ); 46 | // this.windowMesh.position.set(0, 0.3, 0.5); 47 | // this.chassisMesh.add(this.windowMesh); 48 | 49 | // Add cartoon headlights (yellow) 50 | // this.headlightLeft = new THREE.Mesh( 51 | // new THREE.CylinderGeometry(0.2, 0.2, 0.1, 16), 52 | // new THREE.MeshToonMaterial({ 53 | // color: 0xFFFF00, 54 | // emissive: 0xFFFF00, 55 | // emissiveIntensity: 0.5 56 | // }) 57 | // ); 58 | // this.headlightLeft.position.set(0.7, 0, 1.9); 59 | // this.headlightLeft.rotation.z = Math.PI / 2; 60 | // this.chassisMesh.add(this.headlightLeft); 61 | 62 | // this.headlightRight = new THREE.Mesh( 63 | // new THREE.CylinderGeometry(0.2, 0.2, 0.1, 16), 64 | // new THREE.MeshToonMaterial({ 65 | // color: 0xFFFF00, 66 | // emissive: 0xFFFF00, 67 | // emissiveIntensity: 0.5 68 | // }) 69 | // ); 70 | // this.headlightRight.position.set(-0.7, 0, 1.9); 71 | // this.headlightRight.rotation.z = Math.PI / 2; 72 | // this.chassisMesh.add(this.headlightRight); 73 | 74 | // Add taillights (red) 75 | // this.taillightLeft = new THREE.Mesh( 76 | // new THREE.CylinderGeometry(0.15, 0.15, 0.1, 16), 77 | // new THREE.MeshToonMaterial({ 78 | // color: 0xFF0000, 79 | // emissive: 0xFF0000, 80 | // emissiveIntensity: 0.5 81 | // }) 82 | // ); 83 | // this.taillightLeft.position.set(0.7, 0, -1.9); 84 | // this.taillightLeft.rotation.z = Math.PI / 2; 85 | // this.chassisMesh.add(this.taillightLeft); 86 | 87 | // this.taillightRight = new THREE.Mesh( 88 | // new THREE.CylinderGeometry(0.15, 0.15, 0.1, 16), 89 | // new THREE.MeshToonMaterial({ 90 | // color: 0xFF0000, 91 | // emissive: 0xFF0000, 92 | // emissiveIntensity: 0.5 93 | // }) 94 | // ); 95 | // this.taillightRight.position.set(-0.7, 0, -1.9); 96 | // this.taillightRight.rotation.z = Math.PI / 2; 97 | // this.chassisMesh.add(this.taillightRight); 98 | 99 | // Create wheels with better black color 100 | const wheelGeometry = new THREE.CylinderGeometry(0.5, 0.5, 0.5, 32); 101 | 102 | // Darker but not pure black wheel material with some shine 103 | const wheelMaterial = new THREE.MeshStandardMaterial({ 104 | color: 0x0A0A0A, 105 | roughness: 0.7, 106 | metalness: 0.2 107 | }); 108 | 109 | // Improved rim material with more contrast 110 | const wheelRimMaterial = new THREE.MeshStandardMaterial({ 111 | color: 0xDDDDDD, 112 | metalness: 0.6, 113 | roughness: 0.3 114 | }); 115 | 116 | // Create wheel meshes with adjusted positions (pulled away from chassis) 117 | this.frontWheelMesh1 = this.createCartoonWheel(wheelGeometry, wheelMaterial, wheelRimMaterial); 118 | this.frontWheelMesh1.position.set(6.5, 4.5, 2); // Moved from 6 to 6.5 119 | 120 | this.frontWheelMesh2 = this.createCartoonWheel(wheelGeometry, wheelMaterial, wheelRimMaterial); 121 | this.frontWheelMesh2.position.set(3.5, 4.5, 2); // Moved from 4 to 3.5 122 | 123 | this.rearWheelMesh1 = this.createCartoonWheel(wheelGeometry, wheelMaterial, wheelRimMaterial); 124 | this.rearWheelMesh1.position.set(6.5, 4.5, -2); // Moved from 6 to 6.5 125 | 126 | this.rearWheelMesh2 = this.createCartoonWheel(wheelGeometry, wheelMaterial, wheelRimMaterial); 127 | this.rearWheelMesh2.position.set(3.5, 4.5, -2); // Moved from 4 to 3.5 128 | } 129 | 130 | createCartoonWheel(wheelGeometry, wheelMaterial, rimMaterial) { 131 | // Create the main wheel group 132 | const wheelGroup = new THREE.Group(); 133 | 134 | // Create the main tire part 135 | const wheel = new THREE.Mesh(wheelGeometry, wheelMaterial); 136 | wheelGroup.add(wheel); 137 | 138 | // Create a simple rim 139 | const rimGeometry = new THREE.CylinderGeometry(0.25, 0.25, 0.51, 16); 140 | const rim = new THREE.Mesh(rimGeometry, rimMaterial); 141 | wheelGroup.add(rim); 142 | 143 | // Add just 4 spokes for a simpler look 144 | for (let i = 0; i < 4; i++) { 145 | const spokeGeometry = new THREE.BoxGeometry(0.1, 0.51, 0.4); 146 | const spoke = new THREE.Mesh(spokeGeometry, rimMaterial); 147 | spoke.rotation.z = (i / 4) * Math.PI * 2; 148 | wheelGroup.add(spoke); 149 | } 150 | 151 | // Set the rotation for proper orientation 152 | wheelGroup.rotation.z = Math.PI / 2; 153 | 154 | return wheelGroup; 155 | } 156 | 157 | updateMeshPosition(mesh, body) { 158 | // Update position from physics body 159 | mesh.position.copy(body.position); 160 | 161 | // For wheels, we need special handling for rotation 162 | if (mesh === this.frontWheelMesh1 || 163 | mesh === this.frontWheelMesh2 || 164 | mesh === this.rearWheelMesh1 || 165 | mesh === this.rearWheelMesh2) { 166 | 167 | // First preserve the wheel's base orientation (cylinder along X axis) 168 | mesh.rotation.set(0, 0, Math.PI / 2); 169 | 170 | // Create a quaternion from the physics body's orientation 171 | const bodyQuat = new THREE.Quaternion( 172 | body.quaternion.x, 173 | body.quaternion.y, 174 | body.quaternion.z, 175 | body.quaternion.w 176 | ); 177 | 178 | // Apply the physics rotation to the wheel's base orientation 179 | mesh.quaternion.premultiply(bodyQuat); 180 | } else { 181 | // For non-wheel objects (chassis), just copy the quaternion 182 | mesh.quaternion.copy(body.quaternion); 183 | } 184 | } 185 | 186 | // Method to get Nintendo colors array for use in the controller 187 | getNintendoColors() { 188 | return this.nintendoColors; 189 | } 190 | } -------------------------------------------------------------------------------- /src/Experience/World/RampAndPlatform.js: -------------------------------------------------------------------------------- 1 | import * as THREE from 'three' 2 | import * as CANNON from 'cannon-es' 3 | import Experience from '../Experience.js' 4 | 5 | export default class RampAndPlatform { 6 | constructor() { 7 | this.experience = new Experience() 8 | this.scene = this.experience.scene 9 | this.worldPhysics = this.experience.worldPhysics.instance 10 | 11 | this.colors = { 12 | rampColor: 0x2C2C2C, 13 | platformColor: 0x2C2C2C 14 | } 15 | 16 | this.createRamp() 17 | this.createPlatform() 18 | this.createDecorations() 19 | //this.createRampApproach() // Add approach obstacle 20 | } 21 | 22 | createRamp() { 23 | // Create a jump ramp - raised above ground and steeper 24 | const rampShape = new CANNON.Box(new CANNON.Vec3(5, 1, 10)) 25 | this.rampBody = new CANNON.Body({ 26 | mass: 0, // Static body 27 | position: new CANNON.Vec3(0, 2, -30), // Raised to y=2 so it's visible above ground 28 | shape: rampShape 29 | }) 30 | 31 | // Make the ramp steeper for more challenge 32 | const angle = Math.PI * 0.18 // Increased from 0.12 to 0.18 (approx 32 degrees) 33 | this.rampBody.quaternion.setFromAxisAngle(new CANNON.Vec3(1, 0, 0), angle) 34 | 35 | this.worldPhysics.addBody(this.rampBody) 36 | 37 | // Create visual mesh 38 | const rampGeometry = new THREE.BoxGeometry(10, 2, 20) 39 | const rampMaterial = new THREE.MeshToonMaterial({ color: this.colors.rampColor }) 40 | this.rampMesh = new THREE.Mesh(rampGeometry, rampMaterial) 41 | 42 | this.rampMesh.position.copy(this.rampBody.position) 43 | this.rampMesh.quaternion.copy(this.rampBody.quaternion) 44 | 45 | this.rampMesh.castShadow = true 46 | this.rampMesh.receiveShadow = true 47 | 48 | this.scene.add(this.rampMesh) 49 | 50 | this.addRampStripes() 51 | } 52 | 53 | // Add a challenging approach to the ramp 54 | createRampApproach() { 55 | // Create a small hill before the ramp 56 | const hillShape = new CANNON.Box(new CANNON.Vec3(5, 0.5, 4)) 57 | const hillBody = new CANNON.Body({ 58 | mass: 0, 59 | position: new CANNON.Vec3(0, 0.5, -15), // Positioned in front of the ramp 60 | shape: hillShape 61 | }) 62 | 63 | // Slight incline 64 | hillBody.quaternion.setFromAxisAngle(new CANNON.Vec3(1, 0, 0), Math.PI * 0.05) 65 | this.worldPhysics.addBody(hillBody) 66 | 67 | // Visual mesh 68 | const hillGeometry = new THREE.BoxGeometry(10, 1, 8) 69 | const hillMaterial = new THREE.MeshToonMaterial({ color: 0x3C3C3C }) 70 | const hillMesh = new THREE.Mesh(hillGeometry, hillMaterial) 71 | 72 | hillMesh.position.copy(hillBody.position) 73 | hillMesh.quaternion.copy(hillBody.quaternion) 74 | hillMesh.castShadow = true 75 | hillMesh.receiveShadow = true 76 | 77 | this.scene.add(hillMesh) 78 | 79 | // Add small bumps to make it challenging 80 | this.addBumps() 81 | } 82 | 83 | addBumps() { 84 | // Add a few small bumps on the approach to the ramp 85 | const bumpPositions = [ 86 | new CANNON.Vec3(-2, 0.2, -20), 87 | new CANNON.Vec3(2, 0.2, -22), 88 | new CANNON.Vec3(0, 0.2, -18) 89 | ] 90 | 91 | bumpPositions.forEach(position => { 92 | // Physics body 93 | const bumpShape = new CANNON.Sphere(0.4) 94 | const bumpBody = new CANNON.Body({ 95 | mass: 0, 96 | position: position, 97 | shape: bumpShape 98 | }) 99 | 100 | this.worldPhysics.addBody(bumpBody) 101 | 102 | // Visual mesh 103 | const bumpGeometry = new THREE.SphereGeometry(0.4, 16, 16) 104 | const bumpMaterial = new THREE.MeshToonMaterial({ color: 0x3C3C3C }) 105 | const bumpMesh = new THREE.Mesh(bumpGeometry, bumpMaterial) 106 | 107 | bumpMesh.position.copy(bumpBody.position) 108 | bumpMesh.castShadow = true 109 | 110 | this.scene.add(bumpMesh) 111 | }) 112 | } 113 | 114 | createPlatform() { 115 | // Create an elevated platform to land on 116 | const platformHeight = 10 117 | const platformSize = 40 // Increased size 118 | 119 | // Physics body 120 | const platformShape = new CANNON.Box(new CANNON.Vec3(platformSize / 2, 0.5, platformSize / 2)) 121 | this.platformBody = new CANNON.Body({ 122 | mass: 0, 123 | position: new CANNON.Vec3(0, platformHeight, -65), 124 | shape: platformShape 125 | }) 126 | 127 | this.worldPhysics.addBody(this.platformBody) 128 | 129 | // Visual mesh - larger platform 130 | const platformGeometry = new THREE.BoxGeometry(platformSize, 1, platformSize) 131 | const platformMaterial = new THREE.MeshToonMaterial({ color: this.colors.platformColor }) 132 | this.platformMesh = new THREE.Mesh(platformGeometry, platformMaterial) 133 | 134 | this.platformMesh.position.copy(this.platformBody.position) 135 | this.platformMesh.castShadow = true 136 | this.platformMesh.receiveShadow = true 137 | 138 | this.scene.add(this.platformMesh) 139 | } 140 | 141 | addRampStripes() { 142 | // Add directional stripes to the ramp 143 | const stripeGeometry = new THREE.PlaneGeometry(1.5, 18) 144 | const stripeMaterial = new THREE.MeshBasicMaterial({ 145 | color: 0xFFFFFF, 146 | side: THREE.DoubleSide 147 | }) 148 | 149 | // Create three stripes 150 | for (let i = -1; i <= 1; i++) { 151 | const stripe = new THREE.Mesh(stripeGeometry, stripeMaterial) 152 | 153 | // Position on ramp surface with slight offset 154 | stripe.position.set(i * 3, 1.02, 0) 155 | 156 | // Match ramp rotation 157 | stripe.rotation.x = Math.PI * 0.5 158 | 159 | // Parent to ramp for automatic positioning 160 | this.rampMesh.add(stripe) 161 | } 162 | } 163 | 164 | createDecorations() { 165 | this.addCheckeredPattern() 166 | this.addJumpArrow() 167 | } 168 | 169 | addCheckeredPattern() { 170 | // Updated for larger platform 171 | const gridSize = 8 172 | const squareSize = 5 173 | 174 | for (let i = 0; i < gridSize; i++) { 175 | for (let j = 0; j < gridSize; j++) { 176 | if ((i + j) % 2 === 0) continue 177 | 178 | const squareGeometry = new THREE.PlaneGeometry(squareSize, squareSize) 179 | const squareMaterial = new THREE.MeshBasicMaterial({ 180 | color: 0xFFFFFF, 181 | transparent: true, 182 | opacity: 0.4 183 | }) 184 | 185 | const square = new THREE.Mesh(squareGeometry, squareMaterial) 186 | 187 | square.position.set( 188 | (i - gridSize / 2 + 0.5) * squareSize + this.platformBody.position.x, 189 | this.platformBody.position.y + 0.51, 190 | (j - gridSize / 2 + 0.5) * squareSize + this.platformBody.position.z 191 | ) 192 | 193 | square.rotation.x = -Math.PI / 2 194 | 195 | this.scene.add(square) 196 | } 197 | } 198 | } 199 | 200 | addJumpArrow() { 201 | // Add an arrow pointing to the ramp 202 | const arrowShape = new THREE.Shape() 203 | 204 | // Create arrow shape 205 | arrowShape.moveTo(0, 0) 206 | arrowShape.lineTo(5, 0) 207 | arrowShape.lineTo(5, 10) 208 | arrowShape.lineTo(10, 10) 209 | arrowShape.lineTo(0, 20) 210 | arrowShape.lineTo(-10, 10) 211 | arrowShape.lineTo(-5, 10) 212 | arrowShape.lineTo(-5, 0) 213 | 214 | const extrudeSettings = { 215 | steps: 1, 216 | depth: 0.2, 217 | bevelEnabled: false 218 | } 219 | 220 | const arrowGeometry = new THREE.ExtrudeGeometry(arrowShape, extrudeSettings) 221 | const arrowMaterial = new THREE.MeshToonMaterial({ color: 0xFFDD00 }) 222 | const arrow = new THREE.Mesh(arrowGeometry, arrowMaterial) 223 | 224 | // Position in front of the ramp 225 | arrow.position.set(0, 0.1, -15) 226 | arrow.rotation.x = -Math.PI / 2 227 | arrow.rotation.z = Math.PI 228 | arrow.scale.set(0.4, 0.4, 0.4) 229 | 230 | this.scene.add(arrow) 231 | } 232 | } -------------------------------------------------------------------------------- /src/Experience/World/Environment.js: -------------------------------------------------------------------------------- 1 | import * as THREE from "three" 2 | import Experience from "../Experience.js" 3 | 4 | export default class Environment { 5 | constructor() { 6 | this.experience = new Experience() 7 | this.scene = this.experience.scene 8 | this.debug = this.experience.debug 9 | 10 | // Nintendo-style colors 11 | this.nintendoColors = { 12 | skyTop: 0x4DB7FF, // Bright Nintendo blue sky 13 | skyBottom: 0xB5EDFF, // Lighter blue near horizon 14 | sunColor: 0xFFDD00, // Vibrant Nintendo yellow 15 | grassColor: 0x00DD6D, // Bright Nintendo green 16 | cloudColor: 0xFFFFFF // Pure white for cartoon clouds 17 | } 18 | 19 | if (this.debug.active) { 20 | this.debugFolder = this.debug.gui.addFolder('environment') 21 | } 22 | 23 | this.setSunLight() 24 | this.setNintendoSky() 25 | this.addCartoonSun() 26 | this.addDecorations() 27 | } 28 | 29 | setSunLight() { 30 | this.sunLight = new THREE.DirectionalLight(0xffffff, 3) 31 | this.sunLight.castShadow = true 32 | this.sunLight.shadow.mapSize.set(1024, 1024) 33 | this.sunLight.shadow.camera.far = 15 34 | this.sunLight.shadow.camera.left = -7 35 | this.sunLight.shadow.camera.top = 7 36 | this.sunLight.shadow.camera.right = 7 37 | this.sunLight.shadow.camera.bottom = -7 38 | 39 | this.sunLight.shadow.normalBias = 0.05 40 | this.sunLight.position.set(5, 10, 8) 41 | this.scene.add(this.sunLight) 42 | 43 | // Add a brighter ambient light for Nintendo-style flat lighting 44 | const ambientLight = new THREE.AmbientLight(0xCCEEFF, 0.7) 45 | this.scene.add(ambientLight) 46 | 47 | // Add a subtle hemispherical light for better ground colors 48 | const hemiLight = new THREE.HemisphereLight( 49 | this.nintendoColors.skyTop, // Sky color 50 | this.nintendoColors.grassColor, // Ground color 51 | 0.3 52 | ) 53 | this.scene.add(hemiLight) 54 | 55 | // Debug 56 | if (this.debug.active) { 57 | this.debugFolder 58 | .add(this.sunLight, 'intensity') 59 | .name('sunLightIntensity') 60 | .min(0) 61 | .max(10) 62 | .step(0.001) 63 | 64 | this.debugFolder 65 | .add(this.sunLight.position, 'x') 66 | .name('sunLightX') 67 | .min(- 5) 68 | .max(5) 69 | .step(0.001) 70 | 71 | this.debugFolder 72 | .add(this.sunLight.position, 'y') 73 | .name('sunLightY') 74 | .min(- 5) 75 | .max(5) 76 | .step(0.001) 77 | 78 | this.debugFolder 79 | .add(this.sunLight.position, 'z') 80 | .name('sunLightZ') 81 | .min(- 5) 82 | .max(5) 83 | .step(0.001) 84 | } 85 | } 86 | 87 | setNintendoSky() { 88 | // Create a simple gradient sky dome using a large sphere 89 | const skyGeometry = new THREE.SphereGeometry(500, 32, 16) 90 | 91 | // Create gradient material with shaders for Nintendo cartoon look 92 | const skyMaterial = new THREE.ShaderMaterial({ 93 | vertexShader: ` 94 | varying vec3 vWorldPosition; 95 | 96 | void main() { 97 | vec4 worldPosition = modelMatrix * vec4(position, 1.0); 98 | vWorldPosition = worldPosition.xyz; 99 | gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 100 | } 101 | `, 102 | fragmentShader: ` 103 | varying vec3 vWorldPosition; 104 | 105 | // Nintendo-style colors 106 | vec3 topColor = vec3(0.3, 0.72, 1.0); // Bright Nintendo sky blue 107 | vec3 bottomColor = vec3(0.71, 0.93, 1.0); // Very light blue/white for horizon 108 | 109 | void main() { 110 | // Normalized direction from center to position 111 | vec3 viewDirection = normalize(vWorldPosition); 112 | 113 | // Calculate gradient based on height (y-coordinate) 114 | float h = normalize(viewDirection).y; 115 | 116 | // More pronounced gradient transition for cartoon effect 117 | // Sharp transition is more Nintendo-like 118 | vec3 skyColor = mix(bottomColor, topColor, smoothstep(-0.1, 0.55, h)); 119 | 120 | gl_FragColor = vec4(skyColor, 1.0); 121 | } 122 | `, 123 | side: THREE.BackSide // Render inside of sphere 124 | }); 125 | 126 | this.sky = new THREE.Mesh(skyGeometry, skyMaterial); 127 | this.scene.add(this.sky); 128 | 129 | if (this.debug.active) { 130 | this.debugFolder 131 | .add(this.sky.position, 'y') 132 | .name('skyPositionY') 133 | .min(-100) 134 | .max(100) 135 | .step(1) 136 | } 137 | } 138 | 139 | addCartoonSun() { 140 | // Create a more Nintendo-style sun using a circle with rays 141 | const sunGroup = new THREE.Group(); 142 | 143 | // Main sun disc 144 | const sunGeometry = new THREE.CircleGeometry(15, 32); 145 | const sunMaterial = new THREE.MeshBasicMaterial({ 146 | color: this.nintendoColors.sunColor, 147 | side: THREE.DoubleSide 148 | }); 149 | 150 | const sunDisc = new THREE.Mesh(sunGeometry, sunMaterial); 151 | sunGroup.add(sunDisc); 152 | 153 | // Add sun rays (triangles arranged in a star pattern) 154 | const rayCount = 12; 155 | const innerRadius = 15; 156 | const outerRadius = 22; 157 | 158 | for (let i = 0; i < rayCount; i++) { 159 | const angle = (i / rayCount) * Math.PI * 2; 160 | const angleNext = ((i + 0.5) / rayCount) * Math.PI * 2; 161 | 162 | const rayGeometry = new THREE.BufferGeometry(); 163 | const vertices = new Float32Array([ 164 | 0, 0, 0, // Center 165 | innerRadius * Math.cos(angle), innerRadius * Math.sin(angle), 0, // Inner point 166 | outerRadius * Math.cos(angleNext), outerRadius * Math.sin(angleNext), 0 // Outer point 167 | ]); 168 | 169 | rayGeometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3)); 170 | const rayMaterial = new THREE.MeshBasicMaterial({ 171 | color: this.nintendoColors.sunColor, 172 | side: THREE.DoubleSide 173 | }); 174 | 175 | const ray = new THREE.Mesh(rayGeometry, rayMaterial); 176 | sunGroup.add(ray); 177 | } 178 | 179 | // Position the sun in the same direction as the light 180 | const sunPosition = this.sunLight.position.clone().normalize(); 181 | sunGroup.position.copy(sunPosition.multiplyScalar(490)); // Just inside the sky sphere 182 | sunGroup.lookAt(0, 0, 0); // Make it face the center 183 | 184 | this.scene.add(sunGroup); 185 | this.sunMesh = sunGroup; 186 | } 187 | 188 | addDecorations() { 189 | // Add some Nintendo-style cartoon clouds 190 | this.addCartoonClouds(); 191 | 192 | // Add some distant hills in Nintendo style (optional) 193 | //this.addNintendoHills(); 194 | } 195 | 196 | addCartoonClouds() { 197 | // Create a group for all clouds 198 | this.cloudGroup = new THREE.Group(); 199 | this.scene.add(this.cloudGroup); 200 | 201 | // Create several cartoon clouds 202 | const cloudPositions = [ 203 | { x: 150, y: 100, z: -200, scale: 1.5 }, 204 | { x: -250, y: 80, z: -150, scale: 2 }, 205 | { x: 100, y: 120, z: 200, scale: 1.8 }, 206 | { x: -180, y: 90, z: 220, scale: 1.2 } 207 | ]; 208 | 209 | cloudPositions.forEach(pos => { 210 | const cloud = this.createNintendoCloud(); 211 | cloud.position.set(pos.x, pos.y, pos.z); 212 | cloud.scale.set(pos.scale, pos.scale, pos.scale); 213 | this.cloudGroup.add(cloud); 214 | }); 215 | } 216 | 217 | createNintendoCloud() { 218 | // Create a Nintendo-style puffy cloud using spheres 219 | const cloudGroup = new THREE.Group(); 220 | 221 | // Cloud material - pure white for cartoon look 222 | const cloudMaterial = new THREE.MeshToonMaterial({ 223 | color: this.nintendoColors.cloudColor, 224 | emissive: 0x333333, 225 | emissiveIntensity: 0.1 226 | }); 227 | 228 | // Main cloud puffs 229 | const puffPositions = [ 230 | { x: 0, y: 0, z: 0, scale: 1 }, 231 | { x: -10, y: -2, z: 0, scale: 0.8 }, 232 | { x: 10, y: -3, z: 0, scale: 0.7 }, 233 | { x: 5, y: 5, z: 0, scale: 0.6 }, 234 | { x: -7, y: 6, z: 0, scale: 0.7 } 235 | ]; 236 | 237 | puffPositions.forEach(puff => { 238 | const puffGeometry = new THREE.SphereGeometry(10, 16, 16); 239 | const puffMesh = new THREE.Mesh(puffGeometry, cloudMaterial); 240 | puffMesh.position.set(puff.x, puff.y, puff.z); 241 | puffMesh.scale.set(puff.scale, puff.scale, 0.6 * puff.scale); // Flatten a bit 242 | cloudGroup.add(puffMesh); 243 | }); 244 | 245 | return cloudGroup; 246 | } 247 | 248 | addNintendoHills() { 249 | // Create some distant cartoon hills 250 | const hillsGroup = new THREE.Group(); 251 | 252 | // Hill material in bright Nintendo green 253 | const hillMaterial = new THREE.MeshToonMaterial({ 254 | color: this.nintendoColors.grassColor 255 | }); 256 | 257 | // Create a few hills at different positions 258 | const hillPositions = [ 259 | { x: 0, z: -350, width: 400, height: 60 }, 260 | { x: -300, z: -300, width: 250, height: 40 }, 261 | { x: 280, z: -320, width: 300, height: 50 } 262 | ]; 263 | 264 | hillPositions.forEach(hill => { 265 | // Simple curved hill shape 266 | const hillShape = new THREE.Shape(); 267 | hillShape.moveTo(-hill.width/2, 0); 268 | hillShape.quadraticCurveTo(0, hill.height, hill.width/2, 0); 269 | 270 | const hillGeometry = new THREE.ExtrudeGeometry(hillShape, { 271 | steps: 1, 272 | depth: 20, 273 | bevelEnabled: false 274 | }); 275 | 276 | const hillMesh = new THREE.Mesh(hillGeometry, hillMaterial); 277 | hillMesh.position.set(hill.x, -5, hill.z); 278 | hillMesh.rotation.x = -Math.PI / 2; 279 | 280 | hillsGroup.add(hillMesh); 281 | }); 282 | 283 | this.scene.add(hillsGroup); 284 | } 285 | } -------------------------------------------------------------------------------- /src/Experience/World/SimpleCarController.js: -------------------------------------------------------------------------------- 1 | import SimpleCar from './SimpleCar.js' 2 | import * as CANNON from 'cannon-es' 3 | import * as THREE from 'three' 4 | import Experience from '../Experience.js' 5 | 6 | export default class SimpleCarController { 7 | constructor() { 8 | this.experience = new Experience() 9 | this.simpleCar = new SimpleCar() // Get the singleton instance of SimpleCar 10 | this.maxSteerVal = Math.PI / 8 11 | this.maxForce = -25 12 | 13 | // Get Nintendo colors from the car model 14 | this.nintendoColors = this.simpleCar.simpleCarModel.getNintendoColors(); 15 | 16 | // Jump counter 17 | this.jumpCount = 0 18 | this.maxJumps = 2 19 | this.isGrounded = true 20 | this.groundCheckInterval = null 21 | 22 | this.createResetButton() 23 | this.setSteering() 24 | this.setupGroundDetection() 25 | } 26 | 27 | createResetButton() { 28 | // Create reset button 29 | const resetButton = document.createElement('button') 30 | resetButton.id = 'reset-button' 31 | resetButton.textContent = 'RESET' 32 | 33 | // Reset functionality - Properly reload the scene 34 | resetButton.addEventListener('click', () => { 35 | window.location.reload() 36 | }) 37 | 38 | document.body.appendChild(resetButton) 39 | } 40 | 41 | setupGroundDetection() { 42 | // Check if the car is on the ground every 100ms 43 | this.groundCheckInterval = setInterval(() => { 44 | // Get the chassis position 45 | const position = this.simpleCar.vehicle.chassisBody.position; 46 | 47 | // Ray starting from slightly above the car's position 48 | const start = new CANNON.Vec3(position.x, position.y - 0.4, position.z); 49 | const end = new CANNON.Vec3(position.x, position.y - 1.5, position.z); 50 | 51 | // Perform the raycast 52 | const result = new CANNON.RaycastResult(); 53 | this.experience.worldPhysics.instance.rayTest(start, end, result); 54 | 55 | // If the ray hit something, the car is grounded 56 | if (result.hasHit) { 57 | if (!this.isGrounded) { 58 | // We've just landed 59 | this.isGrounded = true; 60 | this.jumpCount = 0; // Reset jump count when landing 61 | console.log("Car landed - jumps reset!"); 62 | } 63 | } else { 64 | this.isGrounded = false; 65 | } 66 | }, 100); 67 | } 68 | 69 | jumpCar() { 70 | if (this.jumpCount < this.maxJumps) { 71 | // Apply an upward impulse at the center of mass 72 | this.simpleCar.vehicle.chassisBody.applyImpulse( 73 | new CANNON.Vec3(0, 60, 0), 74 | new CANNON.Vec3(0, 0, 0) 75 | ) 76 | this.jumpCount++ 77 | this.isGrounded = false; 78 | console.log(`Jump! (${this.jumpCount}/${this.maxJumps})`) 79 | } else { 80 | console.log('No more jumps available until landing!') 81 | } 82 | } 83 | 84 | changeCarColor() { 85 | // Select random Nintendo-style color from our palette (excluding current color) 86 | let currentColor; 87 | if (this.simpleCar.chassisMesh && this.simpleCar.chassisMesh.children[0].material) { 88 | currentColor = this.simpleCar.chassisMesh.children[0].material.color.getHex(); 89 | } 90 | 91 | let randomColor; 92 | do { 93 | randomColor = this.nintendoColors[Math.floor(Math.random() * this.nintendoColors.length)]; 94 | } while (randomColor === currentColor && this.nintendoColors.length > 1); 95 | 96 | // Apply to main chassis 97 | if (this.simpleCar.chassisMesh && this.simpleCar.chassisMesh.children[0]) { 98 | const bodyMesh = this.simpleCar.chassisMesh.children[0]; 99 | 100 | if (bodyMesh.material) { 101 | // Update main chassis 102 | bodyMesh.material.color.setHex(randomColor); 103 | bodyMesh.material.emissive = new THREE.Color(randomColor).multiplyScalar(0.15); 104 | } 105 | } 106 | 107 | // Add a little particle effect for fun 108 | this.createColorChangeEffect(this.simpleCar.chassisMesh.position); 109 | 110 | console.log('Color changed to Nintendo style!'); 111 | } 112 | 113 | createColorChangeEffect(position) { 114 | // Create a simple particle system for color change effect 115 | const particleCount = 15; 116 | const particleGeometry = new THREE.SphereGeometry(0.2, 8, 8); 117 | 118 | for (let i = 0; i < particleCount; i++) { 119 | // Random Nintendo color for each particle 120 | const particleColor = this.nintendoColors[Math.floor(Math.random() * this.nintendoColors.length)]; 121 | 122 | const particleMaterial = new THREE.MeshBasicMaterial({ 123 | color: particleColor, 124 | transparent: true, 125 | opacity: 1 126 | }); 127 | 128 | const particle = new THREE.Mesh(particleGeometry, particleMaterial); 129 | 130 | // Position particles around the car 131 | particle.position.copy(position); 132 | particle.position.x += (Math.random() - 0.5) * 3; 133 | particle.position.y += (Math.random()) * 3; 134 | particle.position.z += (Math.random() - 0.5) * 5; 135 | 136 | this.experience.scene.add(particle); 137 | 138 | // Animate the particle 139 | const duration = 0.7 + Math.random() * 0.5; 140 | const startTime = this.experience.time.elapsed; 141 | 142 | const animate = () => { 143 | const elapsedTime = (this.experience.time.elapsed - startTime) / 1000; 144 | if (elapsedTime < duration) { 145 | particle.position.y += 0.05; 146 | particle.material.opacity = 1 - (elapsedTime / duration); 147 | requestAnimationFrame(animate); 148 | } else { 149 | this.experience.scene.remove(particle); 150 | particle.geometry.dispose(); 151 | particle.material.dispose(); 152 | } 153 | }; 154 | 155 | animate(); 156 | } 157 | } 158 | 159 | turboBoost() { 160 | // Apply a strong forward impulse 161 | const direction = new CANNON.Vec3() 162 | 163 | // Get the forward direction of the car 164 | this.simpleCar.vehicle.chassisBody.quaternion.vmult( 165 | new CANNON.Vec3(0, 0, 1), 166 | direction 167 | ) 168 | 169 | // Scale it up for a boost 170 | direction.scale(200, direction) 171 | 172 | // Apply the impulse 173 | this.simpleCar.vehicle.chassisBody.applyImpulse( 174 | direction, 175 | new CANNON.Vec3(0, 0, 0) 176 | ) 177 | 178 | // Add a boost effect 179 | this.createBoostEffect(this.simpleCar.chassisMesh.position); 180 | 181 | console.log('Turbo Boost activated!') 182 | } 183 | 184 | createBoostEffect(position) { 185 | // Create a boost trail effect 186 | const trailCount = 20; 187 | const trailGeometry = new THREE.SphereGeometry(0.2, 8, 8); 188 | 189 | for (let i = 0; i < trailCount; i++) { 190 | // Use flame colors for boost 191 | const trailColors = [0xFF5722, 0xFF9800, 0xFFEB3B]; 192 | const trailColor = trailColors[Math.floor(Math.random() * trailColors.length)]; 193 | 194 | const trailMaterial = new THREE.MeshBasicMaterial({ 195 | color: trailColor, 196 | transparent: true, 197 | opacity: 0.8 198 | }); 199 | 200 | const trail = new THREE.Mesh(trailGeometry, trailMaterial); 201 | 202 | // Get car direction and position behind it 203 | const direction = new THREE.Vector3(); 204 | this.simpleCar.chassisMesh.getWorldDirection(direction); 205 | 206 | // Position behind car 207 | trail.position.copy(position); 208 | trail.position.x -= direction.x * (3 + Math.random() * 2); 209 | trail.position.y += 0.5; 210 | trail.position.z -= direction.z * (3 + Math.random() * 2); 211 | 212 | this.experience.scene.add(trail); 213 | 214 | // Animate the trail 215 | const duration = 0.5 + Math.random() * 0.3; 216 | const startTime = this.experience.time.elapsed; 217 | 218 | const animate = () => { 219 | const elapsedTime = (this.experience.time.elapsed - startTime) / 1000; 220 | if (elapsedTime < duration) { 221 | trail.scale.multiplyScalar(0.95); 222 | trail.material.opacity = 0.8 - (elapsedTime / duration); 223 | requestAnimationFrame(animate); 224 | } else { 225 | this.experience.scene.remove(trail); 226 | trail.geometry.dispose(); 227 | trail.material.dispose(); 228 | } 229 | }; 230 | 231 | animate(); 232 | } 233 | } 234 | 235 | setSteering() { 236 | document.addEventListener("keydown", (event) => { 237 | switch (event.key) { 238 | case "w": 239 | case "ArrowUp": 240 | this.simpleCar.vehicle.setWheelForce(this.maxForce, 0) 241 | this.simpleCar.vehicle.setWheelForce(-this.maxForce, 1) 242 | break 243 | 244 | case 's': 245 | case 'ArrowDown': 246 | this.simpleCar.vehicle.setWheelForce(-this.maxForce * 0.5, 0) 247 | this.simpleCar.vehicle.setWheelForce(this.maxForce * 0.5, 1) 248 | break 249 | 250 | case 'a': 251 | case 'ArrowLeft': 252 | this.simpleCar.vehicle.setSteeringValue(this.maxSteerVal, 2) 253 | this.simpleCar.vehicle.setSteeringValue(this.maxSteerVal, 3) 254 | break 255 | 256 | case 'd': 257 | case 'ArrowRight': 258 | this.simpleCar.vehicle.setSteeringValue(-this.maxSteerVal, 2) 259 | this.simpleCar.vehicle.setSteeringValue(-this.maxSteerVal, 3) 260 | break 261 | 262 | case ' ': 263 | // Jump with limited uses 264 | this.jumpCar() 265 | break 266 | 267 | case 'c': 268 | // Change car color 269 | this.changeCarColor() 270 | break 271 | 272 | case 'b': 273 | // Turbo boost 274 | this.turboBoost() 275 | break 276 | 277 | case 'r': 278 | // Full reset - just like the button 279 | window.location.reload() 280 | break 281 | } 282 | }) 283 | 284 | // Reset force on keyup 285 | document.addEventListener('keyup', (event) => { 286 | switch (event.key) { 287 | case 'w': 288 | case 'ArrowUp': 289 | this.simpleCar.vehicle.setWheelForce(0, 0) 290 | this.simpleCar.vehicle.setWheelForce(0, 1) 291 | break 292 | 293 | case 's': 294 | case 'ArrowDown': 295 | this.simpleCar.vehicle.setWheelForce(0, 0) 296 | this.simpleCar.vehicle.setWheelForce(0, 1) 297 | break 298 | 299 | case 'a': 300 | case 'ArrowLeft': 301 | this.simpleCar.vehicle.setSteeringValue(0, 2) 302 | this.simpleCar.vehicle.setSteeringValue(0, 3) 303 | break 304 | 305 | case 'd': 306 | case 'ArrowRight': 307 | this.simpleCar.vehicle.setSteeringValue(0, 2) 308 | this.simpleCar.vehicle.setSteeringValue(0, 3) 309 | break 310 | } 311 | }) 312 | } 313 | } 314 | 315 | 316 | 317 | -------------------------------------------------------------------------------- /dist/draco/draco_wasm_wrapper.js: -------------------------------------------------------------------------------- 1 | var $jscomp=$jscomp||{};$jscomp.scope={},$jscomp.arrayIteratorImpl=function(t){var e=0;return function(){return e=n);)++r;if(16(o=224==(240&o)?(15&o)<<12|_<<6|i:(7&o)<<18|_<<12|i<<6|63&t[e++])?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else n+=String.fromCharCode(o)}return n}function o(t,e){return t?n(it,t,e):""}function _(t,e){return 0=n&&(n=65536+((1023&n)<<10)|1023&t.charCodeAt(++r)),127>=n?++e:e=2047>=n?e+2:65535>=n?e+3:e+4}if(r=0,0<(n=(e=Array(e+1)).length)){n=r+n-1;for(var o=0;o=_&&(_=65536+((1023&_)<<10)|1023&t.charCodeAt(++o)),127>=_){if(r>=n)break;e[r++]=_}else{if(2047>=_){if(r+1>=n)break;e[r++]=192|_>>6}else{if(65535>=_){if(r+2>=n)break;e[r++]=224|_>>12}else{if(r+3>=n)break;e[r++]=240|_>>18,e[r++]=128|_>>12&63}e[r++]=128|_>>6&63}e[r++]=128|63&_}}e[r]=0}t=an.alloc(e,_t),an.copy(e,_t,t)}return t}function b(){throw"cannot construct a Status, no constructor in IDL"}function A(){this.ptr=Pt(),f(A)[this.ptr]=this}function h(){this.ptr=Nt(),f(h)[this.ptr]=this}function T(){this.ptr=wt(),f(T)[this.ptr]=this}function D(){this.ptr=Bt(),f(D)[this.ptr]=this}function I(){this.ptr=$t(),f(I)[this.ptr]=this}function v(){this.ptr=Yt(),f(v)[this.ptr]=this}function G(){this.ptr=ie(),f(G)[this.ptr]=this}function j(){this.ptr=ue(),f(j)[this.ptr]=this}function E(){this.ptr=me(),f(E)[this.ptr]=this}function O(){this.ptr=he(),f(O)[this.ptr]=this}function R(){this.ptr=Re(),f(R)[this.ptr]=this}function P(){this.ptr=Me(),f(P)[this.ptr]=this}function g(){this.ptr=Ce(),f(g)[this.ptr]=this}function S(){this.ptr=ze(),f(S)[this.ptr]=this}function M(){this.ptr=Be(),f(M)[this.ptr]=this}function N(){this.ptr=fr(),f(N)[this.ptr]=this}function U(){throw"cannot construct a VoidPtr, no constructor in IDL"}function F(){this.ptr=Tr(),f(F)[this.ptr]=this}function C(){this.ptr=Gr(),f(C)[this.ptr]=this}var w=void 0!==(e=e||{})?e:{},z=!1,L=!1;w.onRuntimeInitialized=function(){z=!0,L&&"function"==typeof w.onModuleLoaded&&w.onModuleLoaded(w)},w.onModuleParsed=function(){L=!0,z&&"function"==typeof w.onModuleLoaded&&w.onModuleLoaded(w)},w.isVersionSupported=function(t){return"string"==typeof t&&!(2>(t=t.split(".")).length||3=t[1]||!(0!=t[0]||10>2]},getStr:function(){return o(Dt.get())},get64:function(){var t=Dt.get();return Dt.get(),t},getZero:function(){Dt.get()}},It={__cxa_allocate_exception:function(t){return pn(t)},__cxa_throw:function(t,e,r){throw"uncaught_exception"in on?on.uncaught_exceptions++:on.uncaught_exceptions=1,t},abort:function(){a()},emscripten_get_sbrk_ptr:function(){return 18416},emscripten_memcpy_big:function(t,e,r){it.set(it.subarray(e,e+r),t)},emscripten_resize_heap:function(t){if(2147418112=e?_(2*e,65536):Math.min(_((3*e+2147483648)/4,65536),2147418112);t:{try{et.grow(e-ut.byteLength+65535>>16),i(et.buffer);var r=1;break t}catch(t){}r=void 0}return!!r},environ_get:function(t,e){var r=0;return s().forEach((function(n,o){var _=e+r;for(o=pt[t+4*o>>2]=_,_=0;_>0]=n.charCodeAt(_);_t[o>>0]=0,r+=n.length+1})),0},environ_sizes_get:function(t,e){var r=s();pt[t>>2]=r.length;var n=0;return r.forEach((function(t){n+=t.length+1})),pt[e>>2]=n,0},fd_close:function(t){return 0},fd_seek:function(t,e,r,n,o){return 0},fd_write:function(t,e,r,n){try{for(var o=0,_=0;_>2],p=pt[e+(8*_+4)>>2],u=0;u>2]=o,0}catch(t){return"undefined"!=typeof FS&&t instanceof FS.ErrnoError||a(t),t.errno}},memory:et,setTempRet0:function(t){},table:rt},vt=function(){function t(t,e){w.asm=t.exports,mt--,w.monitorRunDependencies&&w.monitorRunDependencies(mt),0==mt&&(null!==dt&&(clearInterval(dt),dt=null),bt&&(t=bt,bt=null,t()))}function e(e){t(e.instance)}function r(t){return(X||!Q&&!$||"function"!=typeof fetch?new Promise((function(t,e){t(c())})):fetch(ht,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+ht+"'";return t.arrayBuffer()})).catch((function(){return c()}))).then((function(t){return WebAssembly.instantiate(t,n)})).then(t,(function(t){tt("failed to asynchronously prepare wasm: "+t),a(t)}))}var n={env:It,wasi_unstable:It};if(mt++,w.monitorRunDependencies&&w.monitorRunDependencies(mt),w.instantiateWasm)try{return w.instantiateWasm(n,t)}catch(t){return tt("Module.instantiateWasm callback failed with error: "+t),!1}return function(){if(X||"function"!=typeof WebAssembly.instantiateStreaming||u(ht)||"function"!=typeof fetch)return r(e);fetch(ht,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,n).then(e,(function(t){tt("wasm streaming compile failed: "+t),tt("falling back to ArrayBuffer instantiation"),r(e)}))}))}(),{}}();w.asm=vt;var Gt=w.___wasm_call_ctors=function(){return w.asm.__wasm_call_ctors.apply(null,arguments)},jt=w._emscripten_bind_Status_code_0=function(){return w.asm.emscripten_bind_Status_code_0.apply(null,arguments)},Et=w._emscripten_bind_Status_ok_0=function(){return w.asm.emscripten_bind_Status_ok_0.apply(null,arguments)},Ot=w._emscripten_bind_Status_error_msg_0=function(){return w.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},Rt=w._emscripten_bind_Status___destroy___0=function(){return w.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Pt=w._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return w.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},gt=w._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null,arguments)},St=w._emscripten_bind_DracoUInt16Array_size_0=function(){return w.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},Mt=w._emscripten_bind_DracoUInt16Array___destroy___0=function(){return w.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Nt=w._emscripten_bind_PointCloud_PointCloud_0=function(){return w.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},Ut=w._emscripten_bind_PointCloud_num_attributes_0=function(){return w.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null,arguments)},Ft=w._emscripten_bind_PointCloud_num_points_0=function(){return w.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},Ct=w._emscripten_bind_PointCloud___destroy___0=function(){return w.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},wt=w._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return w.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},zt=w._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null,arguments)},Lt=w._emscripten_bind_DracoUInt8Array_size_0=function(){return w.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},Vt=w._emscripten_bind_DracoUInt8Array___destroy___0=function(){return w.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Bt=w._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return w.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},kt=w._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null,arguments)},xt=w._emscripten_bind_DracoUInt32Array_size_0=function(){return w.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},Qt=w._emscripten_bind_DracoUInt32Array___destroy___0=function(){return w.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},$t=w._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return w.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},Wt=w._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return w.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ht=w._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return w.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},qt=w._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return w.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Yt=w._emscripten_bind_PointAttribute_PointAttribute_0=function(){return w.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Kt=w._emscripten_bind_PointAttribute_size_0=function(){return w.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Zt=w._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return w.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Xt=w._emscripten_bind_PointAttribute_attribute_type_0=function(){return w.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null,arguments)},Jt=w._emscripten_bind_PointAttribute_data_type_0=function(){return w.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},te=w._emscripten_bind_PointAttribute_num_components_0=function(){return w.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},ee=w._emscripten_bind_PointAttribute_normalized_0=function(){return w.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},re=w._emscripten_bind_PointAttribute_byte_stride_0=function(){return w.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null,arguments)},ne=w._emscripten_bind_PointAttribute_byte_offset_0=function(){return w.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},oe=w._emscripten_bind_PointAttribute_unique_id_0=function(){return w.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},_e=w._emscripten_bind_PointAttribute___destroy___0=function(){return w.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},ie=w._emscripten_bind_AttributeTransformData_AttributeTransformData_0=function(){return w.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},pe=w._emscripten_bind_AttributeTransformData_transform_type_0=function(){return w.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},ae=w._emscripten_bind_AttributeTransformData___destroy___0=function(){return w.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},ue=w._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},ce=w._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},se=w._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)},le=w._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},ye=w._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},fe=w._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},me=w._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return w.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},de=w._emscripten_bind_DracoInt8Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},be=w._emscripten_bind_DracoInt8Array_size_0=function(){return w.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Ae=w._emscripten_bind_DracoInt8Array___destroy___0=function(){return w.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null,arguments)},he=w._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return w.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Te=w._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return w.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},De=w._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return w.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Ie=w._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=function(){return w.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},ve=w._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return w.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},Ge=w._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return w.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},je=w._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return w.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null,arguments)},Ee=w._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return w.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},Oe=w._emscripten_bind_MetadataQuerier___destroy___0=function(){return w.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Re=w._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return w.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},Pe=w._emscripten_bind_DracoInt16Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ge=w._emscripten_bind_DracoInt16Array_size_0=function(){return w.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},Se=w._emscripten_bind_DracoInt16Array___destroy___0=function(){return w.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Me=w._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return w.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null,arguments)},Ne=w._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},Ue=w._emscripten_bind_DracoFloat32Array_size_0=function(){return w.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},Fe=w._emscripten_bind_DracoFloat32Array___destroy___0=function(){return w.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},Ce=w._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return w.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,arguments)},we=w._emscripten_bind_GeometryAttribute___destroy___0=function(){return w.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ze=w._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return w.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},Le=w._emscripten_bind_DecoderBuffer_Init_2=function(){return w.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},Ve=w._emscripten_bind_DecoderBuffer___destroy___0=function(){return w.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null,arguments)},Be=w._emscripten_bind_Decoder_Decoder_0=function(){return w.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},ke=w._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return w.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},xe=w._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return w.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},Qe=w._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return w.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null,arguments)},$e=w._emscripten_bind_Decoder_GetAttributeId_2=function(){return w.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},We=w._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return w.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},He=w._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},qe=w._emscripten_bind_Decoder_GetAttribute_2=function(){return w.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},Ye=w._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return w.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},Ke=w._emscripten_bind_Decoder_GetMetadata_1=function(){return w.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},Ze=w._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return w.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null,arguments)},Xe=w._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return w.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},Je=w._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return w.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},tr=w._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return w.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},er=w._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=function(){return w.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},rr=w._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},nr=w._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},or=w._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null,arguments)},_r=w._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},ir=w._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},pr=w._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)},ar=w._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},ur=w._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},cr=w._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},sr=w._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return w.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},lr=w._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return w.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},yr=w._emscripten_bind_Decoder___destroy___0=function(){return w.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},fr=w._emscripten_bind_Mesh_Mesh_0=function(){return w.asm.emscripten_bind_Mesh_Mesh_0.apply(null,arguments)},mr=w._emscripten_bind_Mesh_num_faces_0=function(){return w.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},dr=w._emscripten_bind_Mesh_num_attributes_0=function(){return w.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},br=w._emscripten_bind_Mesh_num_points_0=function(){return w.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Ar=w._emscripten_bind_Mesh___destroy___0=function(){return w.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)},hr=w._emscripten_bind_VoidPtr___destroy___0=function(){return w.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},Tr=w._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return w.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Dr=w._emscripten_bind_DracoInt32Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Ir=w._emscripten_bind_DracoInt32Array_size_0=function(){return w.asm.emscripten_bind_DracoInt32Array_size_0.apply(null,arguments)},vr=w._emscripten_bind_DracoInt32Array___destroy___0=function(){return w.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},Gr=w._emscripten_bind_Metadata_Metadata_0=function(){return w.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},jr=w._emscripten_bind_Metadata___destroy___0=function(){return w.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Er=w._emscripten_enum_draco_StatusCode_OK=function(){return w.asm.emscripten_enum_draco_StatusCode_OK.apply(null,arguments)},Or=w._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return w.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Rr=w._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return w.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Pr=w._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return w.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},gr=w._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return w.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},Sr=w._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return w.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},Mr=w._emscripten_enum_draco_DataType_DT_INVALID=function(){return w.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},Nr=w._emscripten_enum_draco_DataType_DT_INT8=function(){return w.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null,arguments)},Ur=w._emscripten_enum_draco_DataType_DT_UINT8=function(){return w.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},Fr=w._emscripten_enum_draco_DataType_DT_INT16=function(){return w.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},Cr=w._emscripten_enum_draco_DataType_DT_UINT16=function(){return w.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},wr=w._emscripten_enum_draco_DataType_DT_INT32=function(){return w.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null,arguments)},zr=w._emscripten_enum_draco_DataType_DT_UINT32=function(){return w.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},Lr=w._emscripten_enum_draco_DataType_DT_INT64=function(){return w.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},Vr=w._emscripten_enum_draco_DataType_DT_UINT64=function(){return w.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},Br=w._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return w.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null,arguments)},kr=w._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return w.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},xr=w._emscripten_enum_draco_DataType_DT_BOOL=function(){return w.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},Qr=w._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return w.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},$r=w._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return w.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,arguments)},Wr=w._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return w.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},Hr=w._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return w.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qr=w._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return w.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,arguments)},Yr=w._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return w.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},Kr=w._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return w.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},Zr=w._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return w.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,arguments)},Xr=w._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},Jr=w._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},tn=w._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},en=w._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},rn=w._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},nn=w._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};w._setThrew=function(){return w.asm.setThrew.apply(null,arguments)};var on=w.__ZSt18uncaught_exceptionv=function(){return w.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};w._free=function(){return w.asm.free.apply(null,arguments)};var _n,pn=w._malloc=function(){return w.asm.malloc.apply(null,arguments)};if(w.stackSave=function(){return w.asm.stackSave.apply(null,arguments)},w.stackAlloc=function(){return w.asm.stackAlloc.apply(null,arguments)},w.stackRestore=function(){return w.asm.stackRestore.apply(null,arguments)},w.__growWasmMemory=function(){return w.asm.__growWasmMemory.apply(null,arguments)},w.dynCall_ii=function(){return w.asm.dynCall_ii.apply(null,arguments)},w.dynCall_vi=function(){return w.asm.dynCall_vi.apply(null,arguments)},w.dynCall_iii=function(){return w.asm.dynCall_iii.apply(null,arguments)},w.dynCall_vii=function(){return w.asm.dynCall_vii.apply(null,arguments)},w.dynCall_iiii=function(){return w.asm.dynCall_iiii.apply(null,arguments)},w.dynCall_v=function(){return w.asm.dynCall_v.apply(null,arguments)},w.dynCall_viii=function(){return w.asm.dynCall_viii.apply(null,arguments)},w.dynCall_viiii=function(){return w.asm.dynCall_viiii.apply(null,arguments)},w.dynCall_iiiiiii=function(){return w.asm.dynCall_iiiiiii.apply(null,arguments)},w.dynCall_iidiiii=function(){return w.asm.dynCall_iidiiii.apply(null,arguments)},w.dynCall_jiji=function(){return w.asm.dynCall_jiji.apply(null,arguments)},w.dynCall_viiiiii=function(){return w.asm.dynCall_viiiiii.apply(null,arguments)},w.dynCall_viiiii=function(){return w.asm.dynCall_viiiii.apply(null,arguments)},w.asm=vt,w.then=function(t){if(_n)t(w);else{var e=w.onRuntimeInitialized;w.onRuntimeInitialized=function(){e&&e(),t(w)}}return w},bt=function t(){_n||l(),_n||(bt=t)},w.run=l,w.preInit)for("function"==typeof w.preInit&&(w.preInit=[w.preInit]);0=an.size?(r(0>=1;break;case 4:r>>=2;break;case 8:r>>=3}for(var n=0;n=n);)++r;if(16(o=224==(240&o)?(15&o)<<12|_<<6|i:(7&o)<<18|_<<12|i<<6|63&t[e++])?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else n+=String.fromCharCode(o)}return n}function o(t,e){return t?n(it,t,e):""}function _(t,e){return 0=n&&(n=65536+((1023&n)<<10)|1023&t.charCodeAt(++r)),127>=n?++e:e=2047>=n?e+2:65535>=n?e+3:e+4}if(r=0,0<(n=(e=Array(e+1)).length)){n=r+n-1;for(var o=0;o=_&&(_=65536+((1023&_)<<10)|1023&t.charCodeAt(++o)),127>=_){if(r>=n)break;e[r++]=_}else{if(2047>=_){if(r+1>=n)break;e[r++]=192|_>>6}else{if(65535>=_){if(r+2>=n)break;e[r++]=224|_>>12}else{if(r+3>=n)break;e[r++]=240|_>>18,e[r++]=128|_>>12&63}e[r++]=128|_>>6&63}e[r++]=128|63&_}}e[r]=0}t=an.alloc(e,_t),an.copy(e,_t,t)}return t}function b(){throw"cannot construct a Status, no constructor in IDL"}function A(){this.ptr=Pt(),f(A)[this.ptr]=this}function h(){this.ptr=Nt(),f(h)[this.ptr]=this}function T(){this.ptr=wt(),f(T)[this.ptr]=this}function D(){this.ptr=Bt(),f(D)[this.ptr]=this}function I(){this.ptr=$t(),f(I)[this.ptr]=this}function v(){this.ptr=Yt(),f(v)[this.ptr]=this}function G(){this.ptr=ie(),f(G)[this.ptr]=this}function j(){this.ptr=ue(),f(j)[this.ptr]=this}function E(){this.ptr=me(),f(E)[this.ptr]=this}function O(){this.ptr=he(),f(O)[this.ptr]=this}function R(){this.ptr=Re(),f(R)[this.ptr]=this}function P(){this.ptr=Me(),f(P)[this.ptr]=this}function g(){this.ptr=Ce(),f(g)[this.ptr]=this}function S(){this.ptr=ze(),f(S)[this.ptr]=this}function M(){this.ptr=Be(),f(M)[this.ptr]=this}function N(){this.ptr=fr(),f(N)[this.ptr]=this}function U(){throw"cannot construct a VoidPtr, no constructor in IDL"}function F(){this.ptr=Tr(),f(F)[this.ptr]=this}function C(){this.ptr=Gr(),f(C)[this.ptr]=this}var w=void 0!==(e=e||{})?e:{},z=!1,L=!1;w.onRuntimeInitialized=function(){z=!0,L&&"function"==typeof w.onModuleLoaded&&w.onModuleLoaded(w)},w.onModuleParsed=function(){L=!0,z&&"function"==typeof w.onModuleLoaded&&w.onModuleLoaded(w)},w.isVersionSupported=function(t){return"string"==typeof t&&!(2>(t=t.split(".")).length||3=t[1]||!(0!=t[0]||10>2]},getStr:function(){return o(Dt.get())},get64:function(){var t=Dt.get();return Dt.get(),t},getZero:function(){Dt.get()}},It={__cxa_allocate_exception:function(t){return pn(t)},__cxa_throw:function(t,e,r){throw"uncaught_exception"in on?on.uncaught_exceptions++:on.uncaught_exceptions=1,t},abort:function(){a()},emscripten_get_sbrk_ptr:function(){return 13664},emscripten_memcpy_big:function(t,e,r){it.set(it.subarray(e,e+r),t)},emscripten_resize_heap:function(t){if(2147418112=e?_(2*e,65536):Math.min(_((3*e+2147483648)/4,65536),2147418112);t:{try{et.grow(e-ut.byteLength+65535>>16),i(et.buffer);var r=1;break t}catch(t){}r=void 0}return!!r},environ_get:function(t,e){var r=0;return s().forEach((function(n,o){var _=e+r;for(o=pt[t+4*o>>2]=_,_=0;_>0]=n.charCodeAt(_);_t[o>>0]=0,r+=n.length+1})),0},environ_sizes_get:function(t,e){var r=s();pt[t>>2]=r.length;var n=0;return r.forEach((function(t){n+=t.length+1})),pt[e>>2]=n,0},fd_close:function(t){return 0},fd_seek:function(t,e,r,n,o){return 0},fd_write:function(t,e,r,n){try{for(var o=0,_=0;_>2],p=pt[e+(8*_+4)>>2],u=0;u>2]=o,0}catch(t){return"undefined"!=typeof FS&&t instanceof FS.ErrnoError||a(t),t.errno}},memory:et,setTempRet0:function(t){},table:rt},vt=function(){function t(t,e){w.asm=t.exports,mt--,w.monitorRunDependencies&&w.monitorRunDependencies(mt),0==mt&&(null!==dt&&(clearInterval(dt),dt=null),bt&&(t=bt,bt=null,t()))}function e(e){t(e.instance)}function r(t){return(X||!Q&&!$||"function"!=typeof fetch?new Promise((function(t,e){t(c())})):fetch(ht,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+ht+"'";return t.arrayBuffer()})).catch((function(){return c()}))).then((function(t){return WebAssembly.instantiate(t,n)})).then(t,(function(t){tt("failed to asynchronously prepare wasm: "+t),a(t)}))}var n={env:It,wasi_unstable:It};if(mt++,w.monitorRunDependencies&&w.monitorRunDependencies(mt),w.instantiateWasm)try{return w.instantiateWasm(n,t)}catch(t){return tt("Module.instantiateWasm callback failed with error: "+t),!1}return function(){if(X||"function"!=typeof WebAssembly.instantiateStreaming||u(ht)||"function"!=typeof fetch)return r(e);fetch(ht,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,n).then(e,(function(t){tt("wasm streaming compile failed: "+t),tt("falling back to ArrayBuffer instantiation"),r(e)}))}))}(),{}}();w.asm=vt;var Gt=w.___wasm_call_ctors=function(){return w.asm.__wasm_call_ctors.apply(null,arguments)},jt=w._emscripten_bind_Status_code_0=function(){return w.asm.emscripten_bind_Status_code_0.apply(null,arguments)},Et=w._emscripten_bind_Status_ok_0=function(){return w.asm.emscripten_bind_Status_ok_0.apply(null,arguments)},Ot=w._emscripten_bind_Status_error_msg_0=function(){return w.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},Rt=w._emscripten_bind_Status___destroy___0=function(){return w.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Pt=w._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return w.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},gt=w._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null,arguments)},St=w._emscripten_bind_DracoUInt16Array_size_0=function(){return w.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},Mt=w._emscripten_bind_DracoUInt16Array___destroy___0=function(){return w.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Nt=w._emscripten_bind_PointCloud_PointCloud_0=function(){return w.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},Ut=w._emscripten_bind_PointCloud_num_attributes_0=function(){return w.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null,arguments)},Ft=w._emscripten_bind_PointCloud_num_points_0=function(){return w.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},Ct=w._emscripten_bind_PointCloud___destroy___0=function(){return w.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},wt=w._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return w.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},zt=w._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null,arguments)},Lt=w._emscripten_bind_DracoUInt8Array_size_0=function(){return w.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},Vt=w._emscripten_bind_DracoUInt8Array___destroy___0=function(){return w.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Bt=w._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return w.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},kt=w._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null,arguments)},xt=w._emscripten_bind_DracoUInt32Array_size_0=function(){return w.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},Qt=w._emscripten_bind_DracoUInt32Array___destroy___0=function(){return w.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},$t=w._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return w.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},Wt=w._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=function(){return w.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ht=w._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return w.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},qt=w._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return w.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Yt=w._emscripten_bind_PointAttribute_PointAttribute_0=function(){return w.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Kt=w._emscripten_bind_PointAttribute_size_0=function(){return w.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Zt=w._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return w.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Xt=w._emscripten_bind_PointAttribute_attribute_type_0=function(){return w.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null,arguments)},Jt=w._emscripten_bind_PointAttribute_data_type_0=function(){return w.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},te=w._emscripten_bind_PointAttribute_num_components_0=function(){return w.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},ee=w._emscripten_bind_PointAttribute_normalized_0=function(){return w.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},re=w._emscripten_bind_PointAttribute_byte_stride_0=function(){return w.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null,arguments)},ne=w._emscripten_bind_PointAttribute_byte_offset_0=function(){return w.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},oe=w._emscripten_bind_PointAttribute_unique_id_0=function(){return w.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},_e=w._emscripten_bind_PointAttribute___destroy___0=function(){return w.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},ie=w._emscripten_bind_AttributeTransformData_AttributeTransformData_0=function(){return w.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},pe=w._emscripten_bind_AttributeTransformData_transform_type_0=function(){return w.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},ae=w._emscripten_bind_AttributeTransformData___destroy___0=function(){return w.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},ue=w._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},ce=w._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},se=w._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)},le=w._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},ye=w._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},fe=w._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return w.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},me=w._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return w.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},de=w._emscripten_bind_DracoInt8Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},be=w._emscripten_bind_DracoInt8Array_size_0=function(){return w.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Ae=w._emscripten_bind_DracoInt8Array___destroy___0=function(){return w.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null,arguments)},he=w._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return w.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Te=w._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return w.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},De=w._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return w.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Ie=w._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=function(){return w.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},ve=w._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return w.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},Ge=w._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return w.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},je=w._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return w.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null,arguments)},Ee=w._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return w.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},Oe=w._emscripten_bind_MetadataQuerier___destroy___0=function(){return w.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Re=w._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return w.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},Pe=w._emscripten_bind_DracoInt16Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ge=w._emscripten_bind_DracoInt16Array_size_0=function(){return w.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},Se=w._emscripten_bind_DracoInt16Array___destroy___0=function(){return w.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Me=w._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return w.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null,arguments)},Ne=w._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},Ue=w._emscripten_bind_DracoFloat32Array_size_0=function(){return w.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},Fe=w._emscripten_bind_DracoFloat32Array___destroy___0=function(){return w.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},Ce=w._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return w.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,arguments)},we=w._emscripten_bind_GeometryAttribute___destroy___0=function(){return w.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ze=w._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return w.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},Le=w._emscripten_bind_DecoderBuffer_Init_2=function(){return w.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},Ve=w._emscripten_bind_DecoderBuffer___destroy___0=function(){return w.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null,arguments)},Be=w._emscripten_bind_Decoder_Decoder_0=function(){return w.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},ke=w._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return w.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},xe=w._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return w.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},Qe=w._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return w.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null,arguments)},$e=w._emscripten_bind_Decoder_GetAttributeId_2=function(){return w.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},We=w._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return w.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},He=w._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},qe=w._emscripten_bind_Decoder_GetAttribute_2=function(){return w.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},Ye=w._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return w.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},Ke=w._emscripten_bind_Decoder_GetMetadata_1=function(){return w.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},Ze=w._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return w.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null,arguments)},Xe=w._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return w.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},Je=w._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return w.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},tr=w._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return w.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},er=w._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=function(){return w.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},rr=w._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},nr=w._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},or=w._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null,arguments)},_r=w._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},ir=w._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},pr=w._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)},ar=w._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},ur=w._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},cr=w._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return w.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},sr=w._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return w.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},lr=w._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return w.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},yr=w._emscripten_bind_Decoder___destroy___0=function(){return w.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},fr=w._emscripten_bind_Mesh_Mesh_0=function(){return w.asm.emscripten_bind_Mesh_Mesh_0.apply(null,arguments)},mr=w._emscripten_bind_Mesh_num_faces_0=function(){return w.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},dr=w._emscripten_bind_Mesh_num_attributes_0=function(){return w.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},br=w._emscripten_bind_Mesh_num_points_0=function(){return w.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Ar=w._emscripten_bind_Mesh___destroy___0=function(){return w.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)},hr=w._emscripten_bind_VoidPtr___destroy___0=function(){return w.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},Tr=w._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return w.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Dr=w._emscripten_bind_DracoInt32Array_GetValue_1=function(){return w.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Ir=w._emscripten_bind_DracoInt32Array_size_0=function(){return w.asm.emscripten_bind_DracoInt32Array_size_0.apply(null,arguments)},vr=w._emscripten_bind_DracoInt32Array___destroy___0=function(){return w.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},Gr=w._emscripten_bind_Metadata_Metadata_0=function(){return w.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},jr=w._emscripten_bind_Metadata___destroy___0=function(){return w.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Er=w._emscripten_enum_draco_StatusCode_OK=function(){return w.asm.emscripten_enum_draco_StatusCode_OK.apply(null,arguments)},Or=w._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return w.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Rr=w._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return w.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Pr=w._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return w.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},gr=w._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=function(){return w.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},Sr=w._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return w.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},Mr=w._emscripten_enum_draco_DataType_DT_INVALID=function(){return w.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},Nr=w._emscripten_enum_draco_DataType_DT_INT8=function(){return w.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null,arguments)},Ur=w._emscripten_enum_draco_DataType_DT_UINT8=function(){return w.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},Fr=w._emscripten_enum_draco_DataType_DT_INT16=function(){return w.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},Cr=w._emscripten_enum_draco_DataType_DT_UINT16=function(){return w.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},wr=w._emscripten_enum_draco_DataType_DT_INT32=function(){return w.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null,arguments)},zr=w._emscripten_enum_draco_DataType_DT_UINT32=function(){return w.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},Lr=w._emscripten_enum_draco_DataType_DT_INT64=function(){return w.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},Vr=w._emscripten_enum_draco_DataType_DT_UINT64=function(){return w.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},Br=w._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return w.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null,arguments)},kr=w._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return w.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},xr=w._emscripten_enum_draco_DataType_DT_BOOL=function(){return w.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},Qr=w._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return w.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},$r=w._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return w.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,arguments)},Wr=w._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return w.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},Hr=w._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return w.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qr=w._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return w.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,arguments)},Yr=w._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return w.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},Kr=w._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return w.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},Zr=w._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return w.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,arguments)},Xr=w._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},Jr=w._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},tn=w._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},en=w._emscripten_enum_draco_GeometryAttribute_Type_COLOR=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},rn=w._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},nn=w._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return w.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};w._setThrew=function(){return w.asm.setThrew.apply(null,arguments)};var on=w.__ZSt18uncaught_exceptionv=function(){return w.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};w._free=function(){return w.asm.free.apply(null,arguments)};var _n,pn=w._malloc=function(){return w.asm.malloc.apply(null,arguments)};if(w.stackSave=function(){return w.asm.stackSave.apply(null,arguments)},w.stackAlloc=function(){return w.asm.stackAlloc.apply(null,arguments)},w.stackRestore=function(){return w.asm.stackRestore.apply(null,arguments)},w.__growWasmMemory=function(){return w.asm.__growWasmMemory.apply(null,arguments)},w.dynCall_ii=function(){return w.asm.dynCall_ii.apply(null,arguments)},w.dynCall_vi=function(){return w.asm.dynCall_vi.apply(null,arguments)},w.dynCall_iii=function(){return w.asm.dynCall_iii.apply(null,arguments)},w.dynCall_vii=function(){return w.asm.dynCall_vii.apply(null,arguments)},w.dynCall_iiii=function(){return w.asm.dynCall_iiii.apply(null,arguments)},w.dynCall_v=function(){return w.asm.dynCall_v.apply(null,arguments)},w.dynCall_viii=function(){return w.asm.dynCall_viii.apply(null,arguments)},w.dynCall_viiii=function(){return w.asm.dynCall_viiii.apply(null,arguments)},w.dynCall_iiiiiii=function(){return w.asm.dynCall_iiiiiii.apply(null,arguments)},w.dynCall_iidiiii=function(){return w.asm.dynCall_iidiiii.apply(null,arguments)},w.dynCall_jiji=function(){return w.asm.dynCall_jiji.apply(null,arguments)},w.dynCall_viiiiii=function(){return w.asm.dynCall_viiiiii.apply(null,arguments)},w.dynCall_viiiii=function(){return w.asm.dynCall_viiiii.apply(null,arguments)},w.asm=vt,w.then=function(t){if(_n)t(w);else{var e=w.onRuntimeInitialized;w.onRuntimeInitialized=function(){e&&e(),t(w)}}return w},bt=function t(){_n||l(),_n||(bt=t)},w.run=l,w.preInit)for("function"==typeof w.preInit&&(w.preInit=[w.preInit]);0=an.size?(r(0>=1;break;case 4:r>>=2;break;case 8:r>>=3}for(var n=0;n