For a physics engine library for 2D and 3D games, the strongest matches are dimforge/rapier (Rapier is a cross-platform physics engine and rigid body), liabru/matter-js (Matter-js is a 2D rigid body physics engine with) and google-deepmind/mujoco (MuJoCo is a high-fidelity physics simulation engine focused on). idmillington/cyclone-physics and soulwire/coffee-physics round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.
High-performance libraries for simulating rigid body dynamics, collision detection, and physical interactions in game development.
Rapier is a cross-platform physics engine and rigid body dynamics solver designed for 2D and 3D simulations. It functions as a collision detection system and a robotics simulation framework, providing a consistent API for calculating physical interactions across different environments. The engine distinguishes itself with specialized robotics capabilities, including a toolkit for importing URDF and STL models to control multibody chains. It supports precise mechanical movement through inverse kinematics calculations and the application of PID controllers for dynamic body control. The simulat
Rapier is a cross-platform physics engine and rigid body solver that explicitly supports both 2D and 3D simulations with collision detection, constraints, and broadphase acceleration, making it a comprehensive fit for game development physics.
Matter-js is a 2D rigid body physics engine written in JavaScript for simulating realistic physical interactions, collisions, and dynamics in web browsers. It functions as a web physics simulation library that calculates motion, gravity, and constraints for objects rendered on a web canvas. The library includes a built-in canvas physics visualizer to draw physical bodies, joints, and constraints for debugging and gameplay. It distinguishes itself through a plugin system that supports recursive dependency resolution and internal method patching to inject custom logic into the engine's executio
Matter-js is a 2D rigid body physics engine with comprehensive collision detection, constraints, and broadphase acceleration, but it does not support 3D physics as your search requires—it's a strong 2D-only option, not a dual-dimension library.
MuJoCo is a physics simulation engine designed for the dynamics of multi-joint articulated structures. It provides a computational framework for calculating the forces, velocities, and physical interactions of complex models within a virtual environment, supporting research in robotics, biomechanics, and machine learning. The engine utilizes a constraint-based dynamics solver and recursive algorithms to manage the motion of articulated systems. It includes a native graphical interface for real-time visualization, allowing users to inspect physical behaviors and contact dynamics as they occur.
MuJoCo is a high-fidelity physics simulation engine focused on 3D dynamics for robotics and biomechanics, so it provides the physics library you need for 3D but lacks built-in 2D support, which makes it a narrower fit for a general-purpose 2D/3D game development library.
Cyclone Physics is a three-dimensional rigid body physics engine designed for game development. It provides a framework for simulating the motion, rotation, and physical interactions of solid objects by applying fundamental laws of mechanics. The library utilizes discrete time integration to update object positions and velocities across fixed intervals. It manages complex scenes through a bounding volume hierarchy and employs impulse-based collision resolution to maintain momentum during contact. To handle simultaneous interactions, the engine uses an iterative velocity solver that repeatedly
Cyclone Physics is a C++ physics engine library for game development, based on the book "Game Physics Engine Design"; it provides 3D rigid body dynamics and collision detection but does not include 2D support, so it partially matches your requirement for a 2D/3D library.
Coffee-Physics is a lightweight physics engine designed for two-dimensional particle simulation within web environments. It provides a framework for managing the movement and physical interactions of individual objects across a coordinate system, utilizing a collection of mathematical functions to calculate trajectories and collision responses. The library employs Verlet-based integration to maintain stability by tracking coordinate history, avoiding the need for explicit velocity or acceleration variables. It enforces deterministic behavior through fixed-step time stepping, which ensures con
A physics engine library written in CoffeeScript, but it appears to be 2D only — it will give you rigid body dynamics and collision detection for games, but not the 3D support this search requires.
Avian is a 2D physics engine and rigid body dynamics simulator designed to calculate physical motion using mass, forces, and velocity. It provides a framework for simulating rigid body dynamics, collision detection, and joint constraints for games and applications. The engine utilizes a modular physics pipeline with a plugin-based architecture, allowing for the customization of simulation fidelity settings and the extension of collision backends. It includes a specialized kinematic character controller for implementing entity movement and sliding behavior against physical geometry. The syste
Avian is a 2D-only physics engine and rigid body simulator for game development, so it does not support the 3D physics you need alongside 2D.
JoltPhysics is a high-performance C++ physics engine designed for multi-threaded simulation of 3D rigid bodies and soft bodies. It serves as a deterministic simulation framework, ensuring identical results across different platforms and architectures to support networked synchronization. The engine distinguishes itself through a focus on concurrent execution across multiple CPU cores to handle large numbers of active bodies. It provides specialized systems for vehicle physics, including wheeled and tracked models, as well as soft body physics for deformable objects and cloth. The simulation
JoltPhysics is a high-performance 3D physics engine library with rigid body dynamics, collision detection, constraints, and broadphase acceleration, but it does not support 2D physics as needed for a 2D/3D physics simulation library.
cannon.js is a JavaScript 3D physics engine designed for calculating rigid body dynamics and collisions in three-dimensional space. It functions as a rigid body dynamics engine that models mass, friction, and velocity to determine object movement, while providing a mathematical framework for applying physical constraints and joints. The engine supports a variety of collision volumes, including spheres, boxes, convex polyhedrons, heightfields for terrain simulation, and complex triangle meshes. It provides tools for identifying intersections between these shapes and calculating the exact areas
cannon.js is a 3D physics engine library for rigid body dynamics and collision detection, but it does not support 2D physics, so it only partially matches the query for a library that handles both 2D and 3D environments.
Box2D is a 2D physics engine and rigid body simulator designed to compute collisions, forces, and joints in a two-dimensional plane. It functions as a collision detection library and a constraint-based physics solver that calculates the movement and interaction of solid objects using mass, friction, and restitution properties. The engine ensures consistency across different hardware architectures through a deterministic trigonometry implementation. It prevents high-speed objects from passing through boundaries using continuous collision detection and time-of-impact interpolation. The system
Box2D is a high-quality 2D physics engine library with rigid body dynamics, collision detection, and constraints, but it only supports 2D and lacks 3D physics, so it doesn't fully match the request for a combined 2D/3D simulation library.
KawaiiPhysics is an Unreal Engine physics plugin that provides a skeletal mesh simulation tool for calculating pseudo-physics bone sway. It is designed to create natural movement for hair and clothing by controlling bone rotation based on stiffness and damping without requiring a full rigid body physics engine. The system features a character physics constraint framework and a runtime controller that allows for the dynamic adjustment of simulation parameters and external forces. It utilizes data-asset preset management to ensure consistent physics behavior across different characters and obje
KawaiiPhysics is an Unreal Engine plugin for pseudo-physics bone sway on skeletal meshes (hair, clothing) rather than a general-purpose 2D/3D physics simulation library with rigid body dynamics, collision detection, or broadphase acceleration — it is a specialized animation tool, not the full physics library this search requires.
planck.js is a 2D rigid body physics engine for JavaScript and HTML5, based on Box2D. It provides a framework for simulating physical interactions and calculating the motion of solid objects within a two-dimensional virtual environment. The engine is designed for cross-platform web gaming, enabling the implementation of rigid body dynamics across different web browsers and devices. The library manages simulation through a constraint-based physics solver and rigid body state management. It utilizes iterative impulse resolution, semi-implicit Euler integration, and dynamic AABB tree partitioni
planck.js is a 2D rigid body physics engine and does not support 3D physics, so it does not cover the full 2D/3D range you are looking for.
LiquidFun is a 2D physics engine and game physics framework designed to calculate movement and collisions for rigid bodies and particle systems. It functions as a simulation tool for integrating real-time physical interactions and dynamics into interactive applications. The framework specifically provides a particle-based fluid simulator to model liquid dynamics, including splashing, displacement, and surface tension. It also includes a soft body physics simulator for creating deformable and elastic objects that react to physical forces. The engine covers a broad range of physical interactio
LiquidFun is a 2D physics engine specialized in fluid and soft body simulation, so it lacks the 3D support required for this search, though it provides rigid body dynamics and collision detection in 2D.
| Repository | Stars | Language | License | Last push |
|---|---|---|---|---|
| dimforge/rapier | 5.5K | Rust | Apache-2.0 | |
| liabru/matter-js | 18.3K | JavaScript | MIT | |
| google-deepmind/mujoco | 14K | C++ | Apache-2.0 | |
| idmillington/cyclone-physics | 1.1K | C++ | MIT | |
| soulwire/coffee-physics | 1.1K | CoffeeScript | MIT | |
| avianphysics/avian | 3K | Rust | Apache-2.0 | |
| jrouwe/joltphysics | 9.7K | C++ | mit | |
| schteppe/cannon.js | 5K | JavaScript | MIT | |
| erincatto/box2d | 9.5K | C | mit | |
| pafuhana1213/kawaiiphysics | 2.9K | C++ | mit |