Back to Tools
Coding

Box2D

By Erin Catto

2D rigid-body physics with joints and collision queries; useful for physics puzzles, vehicles and custom 2D game runtimes.

tool

Follow Hello Box2D for the Box2D 3.x C API. Create a world with b2DefaultWorldDef and b2CreateWorld, add bodies/shapes, step the simulation and use its transforms in your renderer. Use meter, kilogram and second scaling. HelloWorld prints positions without graphics, so rendering is your responsibility. These instructions are not the C++ b2World workflow from 2.x tutorials.

Sources: https://box2d.org/documentation/ · https://box2d.org/documentation/hello.html

View source