# Bullet Physics — Real-Time Collision Detection and Multi-Physics Simulation > An open-source physics engine for real-time collision detection and rigid/soft body dynamics, widely used in games, VR, visual effects, and robotics research. ## Install Save in your project root: # Bullet Physics — Real-Time Collision Detection and Multi-Physics Simulation ## Quick Use ```bash # C++ build git clone https://github.com/bulletphysics/bullet3.git cd bullet3 && mkdir build && cd build cmake .. -DBUILD_PYBULLET=ON -DBUILD_PYBULLET_NUMPY=ON make -j$(nproc) # Python (PyBullet) pip install pybullet python -m pybullet_envs.examples.enjoy_humanoid_flagrun ``` ## Introduction Bullet Physics SDK is a real-time collision detection and multi-physics simulation library used across games, film visual effects, VR applications, and robotics research. It supports rigid body dynamics, soft body simulation, and vehicle dynamics. Its Python binding, PyBullet, has become a standard tool for robotics simulation and reinforcement learning research. ## What Bullet Physics Does - Provides fast rigid body dynamics with accurate contact resolution using sequential impulse solvers - Simulates soft bodies including cloth, ropes, and deformable volumes - Offers PyBullet for scripting physics simulations and training RL agents in Python - Supports multi-body dynamics with articulated joint constraints for robotic systems - Includes collision detection for convex, concave, and triangle mesh shapes ## Architecture Overview Bullet is structured in layers: a collision detection pipeline (broadphase, narrowphase, and manifold generation), a constraint solver (sequential impulse or MLCP), and a dynamics world that integrates forces and updates transforms each timestep. PyBullet wraps the C++ engine through a shared-memory interface, allowing Python scripts to load URDF/SDF robot models and run physics steps from a single process. ## Self-Hosting & Configuration - Build from source using CMake on Linux, macOS, or Windows - Enable PyBullet during CMake configuration with -DBUILD_PYBULLET=ON - Install the Python binding directly via pip install pybullet for quick setup - Load robot models in URDF, SDF, or MJCF format for articulated body simulation - Configure simulation parameters like timestep, gravity, and solver iterations per world ## Key Features - Battle-tested in AAA games and film pipelines for over 15 years - PyBullet provides a lightweight alternative to heavier simulators for RL research - Native URDF and SDF loading for standard robot description formats - GPU-accelerated collision detection via OpenCL on supported hardware - Integrated examples including a GUI-based physics explorer and benchmark suite ## Comparison with Similar Tools - **MuJoCo** — higher fidelity contact modeling for robotics research; Bullet is more general-purpose with broader game/VFX adoption - **PhysX (NVIDIA)** — optimized for game engines with GPU acceleration; Bullet is fully open source with no vendor lock-in - **Box2D** — 2D physics only; Bullet handles full 3D rigid and soft body dynamics - **ODE (Open Dynamics Engine)** — similar scope but less actively maintained; Bullet has stronger community and tooling ## FAQ **Q: What is PyBullet?** A: PyBullet is the Python interface to Bullet Physics. It provides scriptable access to physics simulation, robot model loading, and rendering, commonly used for RL training. **Q: Can Bullet simulate robots?** A: Yes. Bullet supports multi-body dynamics with joints, motors, and sensors. Load robot models in URDF format and control them via PyBullet or the C++ API. **Q: Is Bullet suitable for real-time games?** A: Yes. Bullet has been used in commercial games and engines for years. Its deterministic solver runs well within real-time frame budgets. **Q: How does Bullet compare to MuJoCo for RL?** A: MuJoCo provides more accurate contact physics for research benchmarks. PyBullet is free, easier to install, and sufficient for many RL tasks. ## Sources - https://github.com/bulletphysics/bullet3 - https://pybullet.org/ --- Source: https://tokrepo.com/en/workflows/asset-c72e4f93 Author: AI Open Source