box2d

2D physics engine library for simulating rigid body dynamics

brewmacoslinux
Try with needOr install directly
Source

About

2D physics engine for games

Commands

box2d

Examples

Link box2d library in a C++ project compilation$ g++ -o physics_sim main.cpp -I/usr/local/opt/box2d/include -L/usr/local/opt/box2d/lib -lbox2d
Check box2d version and installation details$ brew info box2d
Use box2d in CMake project configuration$ find_package(box2d REQUIRED)