back to home

schteppe / cannon.js

A lightweight 3D physics engine written in JavaScript.

4,966 stars
742 forks
213 issues
JavaScriptHTMLCSS

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing schteppe/cannon.js in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/schteppe/cannon.js)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

cannon.js Lightweight 3D physics for the web Inspired by three.js and ammo.js, and driven by the fact that the web lacks a physics engine, here comes cannon.js. The rigid body physics engine includes simple collision detection, various body shapes, contacts, friction and constraints. Demos - Documentation - Rendering hints - NPM package - CDN Browser install Just include cannon.js or cannon.min.js in your html and you're done: Node.js install Install the cannon package via NPM: Alternatively, point to the Github repo directly to get the very latest version: Example The sample code below creates a sphere on a plane, steps the simulation, and prints the sphere simulation to the console. Note that Cannon.js uses SI units (metre, kilogram, second, etc.). If you want to know how to use cannon.js with a rendering engine, for example Three.js, see the Examples. Features • Rigid body dynamics • Discrete collision detection • Contacts, friction and restitution • Constraints • PointToPoint (a.k.a. ball/socket joint) • Distance • Hinge (with optional motor) • Lock • ConeTwist • Gauss-Seidel constraint solver and an island split algorithm • Collision filters • Body sleeping • Experimental SPH / fluid support • Various shapes and collision algorithms (see table below) | | Sphere | Plane | Box | Convex | Particle | Heightfield | Trimesh | | :-----------|:------:|:-----:|:---:|:------:|:--------:|:-----------:|:-------:| | Sphere | Yes | Yes | Yes | Yes | Yes | Yes | Yes | | Plane | - | - | Yes | Yes | Yes | - | Yes | | Box | - | - | Yes | Yes | Yes | Yes | (todo) | | Cylinder | - | - | Yes | Yes | Yes | Yes | (todo) | | Convex | - | - | - | Yes | Yes | Yes | (todo) | | Particle | - | - | - | - | - | (todo) | (todo) | | Heightfield | - | - | - | - | - | - | (todo) | | Trimesh | - | - | - | - | - | - | - | Todo The simpler todos are marked with in the code. Github Issues can and should also be used for todos. Help Create an issue if you need help.