{"_id":"@azaleacolburn/jolt-physics","_rev":"5-41d4c3a46546455c2d88a6f0975daeac","name":"@azaleacolburn/jolt-physics","dist-tags":{"latest":"1.0.3"},"versions":{"0.31.0":{"name":"@azaleacolburn/jolt-physics","version":"0.31.0","keywords":["physics","physics-engine","physics-simulation","simulation","game-engine","vr","game-development","webassembly","wasm"],"author":{"name":"azaleacolburn"},"license":"MIT","_id":"@azaleacolburn/jolt-physics@0.31.0","maintainers":[{"name":"azaleacolburn","email":"azaleacolburn@gmail.com"}],"homepage":"https://github.com/jrouwe/JoltPhysics.js","bugs":{"url":"https://github.com/jrouwe/JoltPhysics.js/issues"},"dist":{"shasum":"49499bfc7a87bb192f839e46960014ecad262c8f","tarball":"https://registry.npmjs.org/@azaleacolburn/jolt-physics/-/jolt-physics-0.31.0.tgz","fileCount":8,"integrity":"sha512-S3yMbUr6ZCvYcwd3npV9L/+Lb+g6nz0xUgu3LDp3ZUlyH53u8mvQsDek8rUbq5yHgR2s8UUBu9X+yCGOYrH2bg==","signatures":[{"sig":"MEUCIAjqIB5uTNM/YPy6/BrxX8+yOiMQmWKqo6xuTTRODG0PAiEAtGvzb0pkQzfLxW0JAx917I9utbdcuVD0q575ie4am48=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11964},"main":"dist/jolt-physics.wasm-compat.js","type":"module","types":"dist/jolt-physics.wasm-compat.d.ts","exports":{".":{"types":"./dist/jolt-physics.wasm-compat.d.ts","default":"./dist/jolt-physics.wasm-compat.js"},"./asm":{"types":"./dist/jolt-physics.d.ts","default":"./dist/jolt-physics.js"},"./wasm":{"types":"./dist/jolt-physics.wasm.d.ts","default":"./dist/jolt-physics.wasm.js"},"./wasm-compat":{"types":"./dist/jolt-physics.wasm-compat.d.ts","default":"./dist/jolt-physics.wasm-compat.js"},"./package.json":"./package.json","./wasm-multithread":{"types":"./dist/jolt-physics.multithread.wasm.d.ts","default":"./dist/jolt-physics.multithread.wasm.js"},"./jolt-physics.wasm.wasm":"./dist/jolt-physics.wasm.wasm","./wasm-compat-multithread":{"types":"./dist/jolt-physics.multithread.wasm-compat.d.ts","default":"./dist/jolt-physics.multithread.wasm-compat.js"},"./jolt-physics.multithread.wasm.wasm":"./dist/jolt-physics.multithread.wasm.wasm"},"gitHead":"f7360a751f1db4d0cc1273483b5baf1a85d90b08","scripts":{"build":"sh build.sh","examples":"node serveexamples/serveexamples.cjs"},"_npmUser":{"name":"azaleacolburn","actor":{"name":"azaleacolburn","type":"user","email":"azaleacolburn@gmail.com"},"email":"azaleacolburn@gmail.com"},"repository":{"url":"git+https://github.com/jrouwe/JoltPhysics.js.git","type":"git"},"_npmVersion":"10.8.1","description":"A WebAssembly port of JoltPhysics, a rigid body physics and collision detection library, suitable for games and VR applications. Forked and maintained by Azalea Colburn for use in Synthesis.","directories":{},"_nodeVersion":"22.4.1","_hasShrinkwrap":false,"devDependencies":{"express":"^4.19.2","webidl-dts-gen":"^1.11.0"},"_npmOperationalInternal":{"tmp":"tmp/jolt-physics_0.31.0_1750352576649_0.9540612413834015","host":"s3://npm-registry-packages-npm-production"}},"0.31.1":{"name":"@azaleacolburn/jolt-physics","version":"0.31.1","keywords":["physics","physics-engine","physics-simulation","simulation","game-engine","vr","game-development","webassembly","wasm"],"author":{"name":"azaleacolburn"},"license":"MIT","_id":"@azaleacolburn/jolt-physics@0.31.1","maintainers":[{"name":"azaleacolburn","email":"azaleacolburn@gmail.com"}],"homepage":"https://github.com/jrouwe/JoltPhysics.js","bugs":{"url":"https://github.com/jrouwe/JoltPhysics.js/issues"},"dist":{"shasum":"9c5209adef24a53a334dac80687aab0e2a8ada9d","tarball":"https://registry.npmjs.org/@azaleacolburn/jolt-physics/-/jolt-physics-0.31.1.tgz","fileCount":8,"integrity":"sha512-aTdDx057MQk6+l2J1/5sxNwqa26937uArxR9OefpE/57gdLNsR4U4CHZqvrcTulJgadhIMi7AHJ0/Qs5+ogfaw==","signatures":[{"sig":"MEUCIQD/qX7jN94vBtQjxkF/oTBx6WAAvKXbiDfAl+/4wCqZUQIgRdPL9RwHKJNLIyJBRXl96xocY2Ypm9BPMmFMoJoPIhk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11964},"main":"dist/jolt-physics.wasm-compat.js","type":"module","types":"dist/jolt-physics.wasm-compat.d.ts","exports":{".":{"types":"./dist/jolt-physics.wasm-compat.d.ts","default":"./dist/jolt-physics.wasm-compat.js"},"./asm":{"types":"./dist/jolt-physics.d.ts","default":"./dist/jolt-physics.js"},"./wasm":{"types":"./dist/jolt-physics.wasm.d.ts","default":"./dist/jolt-physics.wasm.js"},"./wasm-compat":{"types":"./dist/jolt-physics.wasm-compat.d.ts","default":"./dist/jolt-physics.wasm-compat.js"},"./package.json":"./package.json","./wasm-multithread":{"types":"./dist/jolt-physics.multithread.wasm.d.ts","default":"./dist/jolt-physics.multithread.wasm.js"},"./jolt-physics.wasm.wasm":"./dist/jolt-physics.wasm.wasm","./wasm-compat-multithread":{"types":"./dist/jolt-physics.multithread.wasm-compat.d.ts","default":"./dist/jolt-physics.multithread.wasm-compat.js"},"./jolt-physics.multithread.wasm.wasm":"./dist/jolt-physics.multithread.wasm.wasm"},"gitHead":"f7360a751f1db4d0cc1273483b5baf1a85d90b08","scripts":{"build":"sh build.sh","examples":"node serveexamples/serveexamples.cjs"},"_npmUser":{"name":"azaleacolburn","actor":{"name":"azaleacolburn","type":"user","email":"azaleacolburn@gmail.com"},"email":"azaleacolburn@gmail.com"},"repository":{"url":"git+https://github.com/jrouwe/JoltPhysics.js.git","type":"git"},"_npmVersion":"11.3.0","description":"A WebAssembly port of JoltPhysics, a rigid body physics and collision detection library, suitable for games and VR applications. Forked and maintained by Azalea Colburn for use in Synthesis.","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"devDependencies":{"express":"^4.19.2","webidl-dts-gen":"^1.11.0"},"_npmOperationalInternal":{"tmp":"tmp/jolt-physics_0.31.1_1750357632483_0.7973802803260037","host":"s3://npm-registry-packages-npm-production"}},"0.31.2":{"name":"@azaleacolburn/jolt-physics","version":"0.31.2","keywords":["physics","physics-engine","physics-simulation","simulation","game-engine","vr","game-development","webassembly","wasm"],"author":{"name":"azaleacolburn"},"license":"MIT","_id":"@azaleacolburn/jolt-physics@0.31.2","maintainers":[{"name":"azaleacolburn","email":"azaleacolburn@gmail.com"}],"homepage":"https://github.com/jrouwe/JoltPhysics.js","bugs":{"url":"https://github.com/jrouwe/JoltPhysics.js/issues"},"dist":{"shasum":"ff95985f8606890d2d25f0b39d978f9469599a7b","tarball":"https://registry.npmjs.org/@azaleacolburn/jolt-physics/-/jolt-physics-0.31.2.tgz","fileCount":21,"integrity":"sha512-vNmmWZK0GmmpDA91secxQDxqvydjadDITAib3OO3cBhs8pRA0OawmDtjY1Fu3RiW/h2GE0J4FGZ804eqXwHK5g==","signatures":[{"sig":"MEUCIDZL6hma4HzjRqeKhT8eaprfBBr8WFTqIci2SWP27OxaAiEA4fkfPrKQhKHEyg5YfHMLIy9zxphVKnMR9fPLQMBZiD0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20937141},"main":"dist/jolt-physics.wasm-compat.js","type":"module","types":"dist/jolt-physics.wasm-compat.d.ts","exports":{".":{"types":"./dist/jolt-physics.wasm-compat.d.ts","default":"./dist/jolt-physics.wasm-compat.js"},"./asm":{"types":"./dist/jolt-physics.d.ts","default":"./dist/jolt-physics.js"},"./wasm":{"types":"./dist/jolt-physics.wasm.d.ts","default":"./dist/jolt-physics.wasm.js"},"./wasm-compat":{"types":"./dist/jolt-physics.wasm-compat.d.ts","default":"./dist/jolt-physics.wasm-compat.js"},"./package.json":"./package.json","./wasm-multithread":{"types":"./dist/jolt-physics.multithread.wasm.d.ts","default":"./dist/jolt-physics.multithread.wasm.js"},"./jolt-physics.wasm.wasm":"./dist/jolt-physics.wasm.wasm","./wasm-compat-multithread":{"types":"./dist/jolt-physics.multithread.wasm-compat.d.ts","default":"./dist/jolt-physics.multithread.wasm-compat.js"},"./jolt-physics.multithread.wasm.wasm":"./dist/jolt-physics.multithread.wasm.wasm"},"gitHead":"f7360a751f1db4d0cc1273483b5baf1a85d90b08","scripts":{"build":"sh build.sh","examples":"node serveexamples/serveexamples.cjs"},"_npmUser":{"name":"azaleacolburn","actor":{"name":"azaleacolburn","type":"user","email":"azaleacolburn@gmail.com"},"email":"azaleacolburn@gmail.com"},"repository":{"url":"git+https://github.com/jrouwe/JoltPhysics.js.git","type":"git"},"_npmVersion":"11.3.0","description":"A WebAssembly port of JoltPhysics, a rigid body physics and collision detection library, suitable for games and VR applications. Forked and maintained by Azalea Colburn for use in Synthesis.","directories":{},"_nodeVersion":"24.2.0","_hasShrinkwrap":false,"devDependencies":{"express":"^4.19.2","webidl-dts-gen":"^1.11.0"},"_npmOperationalInternal":{"tmp":"tmp/jolt-physics_0.31.2_1750357902350_0.6956385022932772","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@azaleacolburn/jolt-physics","version":"1.0.1","keywords":["physics","physics-engine","physics-simulation","simulation","game-engine","vr","game-development","webassembly","wasm"],"author":{"name":"jrouwe"},"license":"MIT","_id":"@azaleacolburn/jolt-physics@1.0.1","maintainers":[{"name":"azaleacolburn","email":"azaleacolburn@gmail.com"}],"homepage":"https://github.com/jrouwe/JoltPhysics.js","bugs":{"url":"https://github.com/jrouwe/JoltPhysics.js/issues"},"dist":{"shasum":"f0556fd00192b41681f99a13a7bef0c9b1155702","tarball":"https://registry.npmjs.org/@azaleacolburn/jolt-physics/-/jolt-physics-1.0.1.tgz","fileCount":10,"integrity":"sha512-GoF/tW0ZlPZt1RZo0wMe8alQH7mwJAp1PgdxKgLXYoJVSQqaa+kDsbIV/Q+gONw2kWy0nw2TzC88uHuQLLQZqw==","signatures":[{"sig":"MEYCIQCmmNTAiqKkqYfWVUWMjtq1JI2/A937s4QOAG8LiepyAAIhAPZiOskbNZcieXc/PO4C+t37+z5UisY2HHfGeRIxem90","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13865},"main":"dist/jolt-physics.wasm-compat.js","type":"module","types":"dist/jolt-physics.wasm-compat.d.ts","exports":{".":{"types":"./dist/jolt-physics.wasm-compat.d.ts","default":"./dist/jolt-physics.wasm-compat.js"},"./asm":{"types":"./dist/jolt-physics.d.ts","default":"./dist/jolt-physics.js"},"./wasm":{"types":"./dist/jolt-physics.wasm.d.ts","default":"./dist/jolt-physics.wasm.js"},"./wasm-compat":{"types":"./dist/jolt-physics.wasm-compat.d.ts","default":"./dist/jolt-physics.wasm-compat.js"},"./package.json":"./package.json","./wasm-multithread":{"types":"./dist/jolt-physics.multithread.wasm.d.ts","default":"./dist/jolt-physics.multithread.wasm.js"},"./debug-wasm-compat":{"types":"./dist/jolt-physics.debug.wasm-compat.d.ts","default":"./dist/jolt-physics.debug.wasm-compat.js"},"./jolt-physics.wasm.wasm":"./dist/jolt-physics.wasm.wasm","./wasm-compat-multithread":{"types":"./dist/jolt-physics.multithread.wasm-compat.d.ts","default":"./dist/jolt-physics.multithread.wasm-compat.js"},"./debug-wasm-compat-multithread":{"types":"./dist/jolt-physics.debug.multithread.wasm-compat.d.ts","default":"./dist/jolt-physics.debug.multithread.wasm-compat.js"},"./jolt-physics.multithread.wasm.wasm":"./dist/jolt-physics.multithread.wasm.wasm"},"gitHead":"22f70d77024211229390a428d401ec2f3fa5f45b","scripts":{"build":"sh build.sh","examples":"node serveexamples/serveexamples.cjs"},"_npmUser":{"name":"azaleacolburn","email":"azaleacolburn@gmail.com"},"repository":{"url":"git+https://github.com/jrouwe/JoltPhysics.js.git","type":"git"},"_npmVersion":"11.16.0","description":"A WebAssembly port of JoltPhysics, a rigid body physics and collision detection library, suitable for games and VR applications","directories":{},"_nodeVersion":"26.3.1","_hasShrinkwrap":false,"devDependencies":{"express":"^4.19.2","webidl-dts-gen":"^1.11.0"},"_npmOperationalInternal":{"tmp":"tmp/jolt-physics_1.0.1_1783354849595_0.9961576005366815","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@azaleacolburn/jolt-physics","version":"1.0.3","description":"A WebAssembly port of JoltPhysics, a rigid body physics and collision detection library, suitable for games and VR applications","type":"module","main":"dist/jolt-physics.wasm-compat.js","types":"dist/jolt-physics.wasm-compat.d.ts","exports":{".":{"types":"./dist/jolt-physics.wasm-compat.d.ts","default":"./dist/jolt-physics.wasm-compat.js"},"./wasm":{"types":"./dist/jolt-physics.wasm.d.ts","default":"./dist/jolt-physics.wasm.js"},"./wasm-compat":{"types":"./dist/jolt-physics.wasm-compat.d.ts","default":"./dist/jolt-physics.wasm-compat.js"},"./debug-wasm-compat":{"types":"./dist/jolt-physics.debug.wasm-compat.d.ts","default":"./dist/jolt-physics.debug.wasm-compat.js"},"./asm":{"types":"./dist/jolt-physics.d.ts","default":"./dist/jolt-physics.js"},"./wasm-multithread":{"types":"./dist/jolt-physics.multithread.wasm.d.ts","default":"./dist/jolt-physics.multithread.wasm.js"},"./wasm-compat-multithread":{"types":"./dist/jolt-physics.multithread.wasm-compat.d.ts","default":"./dist/jolt-physics.multithread.wasm-compat.js"},"./debug-wasm-compat-multithread":{"types":"./dist/jolt-physics.debug.multithread.wasm-compat.d.ts","default":"./dist/jolt-physics.debug.multithread.wasm-compat.js"},"./jolt-physics.wasm.wasm":"./dist/jolt-physics.wasm.wasm","./jolt-physics.multithread.wasm.wasm":"./dist/jolt-physics.multithread.wasm.wasm","./package.json":"./package.json"},"scripts":{"build":"sh build.sh","examples":"node serveexamples/serveexamples.cjs"},"homepage":"https://github.com/jrouwe/JoltPhysics.js","repository":{"type":"git","url":"git+https://github.com/jrouwe/JoltPhysics.js.git"},"author":{"name":"jrouwe"},"license":"MIT","keywords":["physics","physics-engine","physics-simulation","simulation","game-engine","vr","game-development","webassembly","wasm"],"devDependencies":{"express":"^4.19.2","webidl-dts-gen":"^1.11.0"},"gitHead":"eca0eba091324a1ff36020c45c07a352612de35b","_id":"@azaleacolburn/jolt-physics@1.0.3","bugs":{"url":"https://github.com/jrouwe/JoltPhysics.js/issues"},"_nodeVersion":"26.4.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-Qgpr7G9DCBGQCwN+TljmNf+CP9yyHLli8uOWv/fo6lVSoqAde+FocxCRmOzG8DatEuMk8RGfFnUxUrFPlrc2iA==","shasum":"f637306f6b67e12cf681154086f0a9c6d5616f72","tarball":"https://registry.npmjs.org/@azaleacolburn/jolt-physics/-/jolt-physics-1.0.3.tgz","fileCount":27,"unpackedSize":44673929,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD6UdQEvZyhnA7ps9aapwzp5qov3yPeMWLxCJK/V3/G4QIgEf/f+OApvK6ZuEDuhygv9Fd8lMtILHZC2X/yy+DS4Cc="}]},"_npmUser":{"name":"azaleacolburn","email":"azaleacolburn@gmail.com"},"directories":{},"maintainers":[{"name":"azaleacolburn","email":"azaleacolburn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jolt-physics_1.0.3_1783545841392_0.7725829325456361"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-19T17:02:56.573Z","modified":"2026-07-08T21:24:01.812Z","0.31.0":"2025-06-19T17:02:56.841Z","0.31.1":"2025-06-19T18:27:12.649Z","0.31.2":"2025-06-19T18:31:42.668Z","1.0.1":"2026-07-06T16:20:49.769Z","1.0.3":"2026-07-08T21:24:01.705Z"},"bugs":{"url":"https://github.com/jrouwe/JoltPhysics.js/issues"},"author":{"name":"jrouwe"},"license":"MIT","homepage":"https://github.com/jrouwe/JoltPhysics.js","keywords":["physics","physics-engine","physics-simulation","simulation","game-engine","vr","game-development","webassembly","wasm"],"repository":{"type":"git","url":"git+https://github.com/jrouwe/JoltPhysics.js.git"},"description":"A WebAssembly port of JoltPhysics, a rigid body physics and collision detection library, suitable for games and VR applications","maintainers":[{"name":"azaleacolburn","email":"azaleacolburn@gmail.com"}],"readme":"[![Version](https://img.shields.io/npm/v/jolt-physics)](https://www.npmjs.com/package/jolt-physics)\n[![Downloads](https://img.shields.io/npm/dt/jolt-physics.svg)](https://www.npmjs.com/package/jolt-physics)\n[![Bundle Size](https://img.shields.io/bundlephobia/min/jolt-physics?label=bundle%20size)](https://bundlephobia.com/result?p=jolt-physics)\n[![Build Status](https://github.com/jrouwe/JoltPhysics.js/actions/workflows/build-and-deploy.yml/badge.svg)](https://github.com/jrouwe/JoltPhysics.js/actions/)\n\n# JoltPhysics.js\n\nThis project enables using [Jolt Physics](https://github.com/jrouwe/JoltPhysics) in JavaScript.\n\n## Demos\n\nGo to the [demos page](https://jrouwe.github.io/JoltPhysics.js/) to see the project in action.\n\n## Using\n\nThis library comes in 7 flavours:\n- `wasm-compat` - A WASM version with the WASM file (encoded in base64) embedded in the bundle\n- `debug-wasm-compat` - Same as `wasm-compat` but with debug checking enabled (outputs errors to the console and enables the debug renderer).\n- `wasm` - A WASM version with a separate WASM file\n- `asm` - A JavaScript version that uses [asm.js](https://developer.mozilla.org/en-US/docs/Games/Tools/asm.js)\n- `wasm-compat-multithread` - Same as `wasm-compat` but with multi threading enabled.\n- `debug-wasm-compat-multithread` - Same as `wasm-compat-multithread` but with debug checking enabled (outputs errors to the console and enables the debug renderer).\n- `wasm-multithread` - Same as `wasm` but with multi threading enabled.\n\nSee [falling_shapes.html](Examples/falling_shapes.html) for an example on how to use the library.\n\n### Documentation\n\nThe interface of the library is the same as the C++ interface of JoltPhysics, this means that you can use the [C++ documentation](https://jrouwe.github.io/JoltPhysics/) as reference.\n\nAlmost the entire Jolt interface has been exposed. Check [JoltJS.idl](https://github.com/jrouwe/JoltPhysics.js/blob/main/JoltJS.idl) if a particular interface has been exposed. If not, edit [JoltJS.idl](https://github.com/jrouwe/JoltPhysics.js/blob/main/JoltJS.idl) and [JoltJS.h](https://github.com/jrouwe/JoltPhysics.js/blob/main/JoltJS.h) and send a pull request, or open an issue.\n\n### Installation\n\nThis library is distributed as ECMAScript modules on npm:\n\n```sh\nnpm install jolt-physics\n```\n\nThe different flavours are available via entrypoints on the npm package:\n\n```js\n// WASM embedded in the bundle\nimport Jolt from 'jolt-physics';\nimport Jolt from 'jolt-physics/wasm-compat';\n\n// WASM embedded in the bundle, debug checking enabled (outputs errors to the console and enables the debug renderer)\nimport Jolt from 'jolt-physics/debug-wasm-compat';\n\n// WASM\nimport Jolt from 'jolt-physics/wasm';\n\n// asm.js\nimport Jolt from 'jolt-physics/asm';\n\n// WASM embedded in the bundle, multithread enabled\nimport Jolt from 'jolt-physics/wasm-compat-multithread';\n\n// WASM embedded in the bundle, multithread enabled, debug checking enabled (outputs errors to the console and enables the debug renderer)\nimport Jolt from 'jolt-physics/debug-wasm-compat-multithread';\n\n// WASM, multithread enabled\nimport Jolt from 'jolt-physics/wasm-multithread';\n```\n\nYou can also import esm bundles with unpkg:\n\n```html\n<script type=\"module\">\n    // import latest\n    import Jolt from 'https://www.unpkg.com/jolt-physics/dist/jolt-physics.wasm-compat.js';\n\n    // or import a specific version\n    import Jolt from 'https://www.unpkg.com/jolt-physics@x.y.z/dist/jolt-physics.wasm-compat.js';\n</script>\n```\n\nWhere ```x.y.z``` is the version of the library you want to use.\n\n### Using the WASM flavour\n\nTo use the `wasm` flavour, you must either serve the WASM file `jolt-physics.wasm.wasm` alongside `jolt-physics.wasm.js`, or use a bundler that supports importing an asset as a url, and tell Jolt where to find the WASM file.\n\nTo specify where to retrieve the WASM file from, you can pass a `locateFile` function to the default export of `jolt-physics/wasm`. For example, using [vite](https://vitejs.dev/) this would look like: \n\n```js\nimport initJolt from \"jolt-physics\";\nimport joltWasmUrl from \"jolt-physics/jolt-physics.wasm.wasm?url\";\n\nconst Jolt = await initJolt({\n  locateFile: () => joltWasmUrl,\n});\n```\n\nFor more information on the `locateFile` function, see the [Emscripten documentation](https://emscripten.org/docs/api_reference/module.html#Module.locateFile).\n\n## Building\n\nThis project has only been compiled under Linux.\n\n* Install [emscripten](https://emscripten.org/) and ensure that its environment variables have been setup\n* Install [cmake](https://cmake.org/)\n* Run ```./build.sh``` to build both the Debug and Distribution build, ```./build.sh Debug``` for only the Debug build.\n\nAdditional options that can be provided to ```build.sh```:\n\n* ```-DENABLE_MEMORY_PROFILER=ON``` will enable memory tracking to detect leaks.\n* ```-DDOUBLE_PRECISION=ON``` will enable the double precision mode. This allows worlds larger than a couple of km.\n* ```-DENABLE_SIMD=ON``` will enable SIMD instructions. Safari 16.4 was the last major browser to support this (in March 2023). The multithreaded builds have this on by default.\n* ```-DBUILD_WASM_COMPAT_ONLY=ON``` speeds up the build by only compiling the WASM compat version which the examples use.\n* ```-DCROSS_PLATFORM_DETERMINISTIC=ON``` builds the library so that it produces the same results as the native version of the library. For more info [click here](https://jrouwe.github.io/JoltPhysics/#deterministic-simulation).\n\n## Running\n\nBy default the examples use the WASM compat version of Jolt. This requires serving the html file using a web server rather than opening the html file directly.\n\nOpen a terminal in this folder and run the following commands:\n\n```\nnpm install\nnpm run examples\n```\n\nThen navigate to: [http://localhost:3000/](http://localhost:3000/)\n\nIf you need to debug the C++ code take a look at [WASM debugging](https://developer.chrome.com/blog/wasm-debugging-2020/).\n\n## Memory Management\n\nThe samples are very bad at cleaning up after themselves (basically they don't). When using emscripten to port a library to WASM, [nothing is cleaned up](https://emscripten.org/docs/porting/connecting_cpp_and_javascript/WebIDL-Binder.html#using-c-classes-in-javascript) automatically, so everything you newed with ```new Jolt.XXX``` needs to be destroyed by ```Jolt.destroy(...)```.\n\nOn top of this, Jolt uses reference counting for a number of its classes (everything that inherits from [RefTarget](https://jrouwe.github.io/JoltPhysics/class_ref_target.html)). The most important classes are:\n\n* ShapeSettings\n* Shape\n* ConstraintSettings\n* Constraint\n* PathConstraintPath\n* PhysicsMaterial\n* GroupFilter\n* SoftBodySharedSettings\n* VehicleCollisionTester\n* VehicleControllerSettings\n* WheelSettings\n* CharacterBaseSettings\n* CharacterBase\n* Skeleton\n* SkeletonAnimation\n* SkeletonMapper\n* PhysicsScene\n* RagdollSettings\n* Ragdoll\n\nReference counting objects start with a reference count of 0. If you want to keep ownership over the object, you need to call ```object.AddRef()```, this will increment the reference count. If you want to release ownership you call ```object.Release()```, this will decrement the reference count and if the reference count reaches 0 the object will be destroyed. If, after newing, you pass a reference counted object on to another object (e.g. a ShapeSettings to a CompoundShapeSettings or a Shape to a Body) then that other object will take a reference, in that case it is not needed take a reference yourself beforehand so you can skip the calls to ```AddRef/Release```. Note that it is also possible to do ```new Jolt.XXX``` followed by ```Jolt.destroy(...)``` for a reference counted object if no one took a reference.\n\nThe Body class is also a special case, it is destroyed through BodyInterface.DestroyBody(body.GetID()) (which internally destroys the Body).\n\nAlmost everything else can be destroyed straight after it has been passed to Jolt. [An example that shows how to properly clean up using Jolt is here](https://github.com/jrouwe/JoltPhysics.js/blob/main/Examples/proper_cleanup.html).\n\n## Projects using JoltPhysics.js\n\n* [Babylon.js plugin](https://github.com/PhoenixIllusion/babylonjs-jolt-physics-plugin) - A plugin that replaces the default physics engine with Jolt.\n* [GDevelop](https://gdevelop.io/) - An Open-source, cross-platform 2D/3D/multiplayer game engine. See [announcement](https://github.com/4ian/GDevelop/releases/tag/v5.5.220).\n* [react-three-jolt](https://github.com/pmndrs/react-three-jolt) - Wraps Jolt to make it easy to use in react-three-fiber.\n* [r3f-jolt](https://github.com/sajal353/r3f-jolt) - Another wrapper for react-three-fiber.\n* [Synthesis](https://github.com/Autodesk/synthesis) - A Robotics Simulator for Autodesk Fusion CAD Designs\n\n## License\n\nThe project is distributed under the [MIT license](LICENSE).\n","readmeFilename":"README.md"}