A lightweight, modern 3D physics engine for JavaScript with TypeScript support and tree-shaking capabilities.
cannon-es is a lightweight 3D physics engine written in JavaScript that provides realistic physics simulations for web applications and games. It's a maintained fork of the original cannon.js with modern improvements including TypeScript support, tree shaking, and performance optimizations. The engine handles collisions, forces, impulses, and body dynamics in three-dimensional space.
JavaScript developers building 3D web applications, games, or interactive experiences who need physics simulation capabilities. Particularly useful for those working with Three.js or react-three-fiber who require a lightweight physics solution.
Developers choose cannon-es for its modern JavaScript/TypeScript support, tree-shaking capabilities that reduce bundle sizes, and maintained codebase with numerous fixes and improvements over the original cannon.js. It provides a balance between performance and features for web-based 3D physics.
💣 A lightweight 3D physics engine written in JavaScript.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides full TypeScript integration and a flatbundle with ESM/CJS modules, ensuring type safety and compatibility with modern JavaScript tooling as highlighted in the README.
Allows importing only necessary components, optimizing bundle sizes for web applications, which is crucial for performance and load times.
Incorporates fixes and enhancements from the original cannon.js, such as merged PRs and new features like trigger bodies and friction gravity customization, ensuring reliability.
Features like World.hasActiveBodies enable frame invalidation when physics are inactive, improving runtime efficiency for web-based simulations.
The README's TODO list mentions fixing 'as any' assertions and improving type safety, indicating that full type coverage is still a work in progress.
The debugger has been moved to a separate repository (cannon-es-debugger), adding an extra dependency and setup step for developers needing visualization.
The TODO list explores performance enhancements from other libraries, suggesting it may not match more advanced engines in handling large-scale or intricate physics scenarios.