luaBox2D exposes the Box2D 2D physics engine to Lua. It is the physics layer behind the Lua-scripted games in Cinder Climb.
Nearly the whole Box2D API has a Lua counterpart: worlds and bodies, fixtures and every shape type (circle, polygon, edge, chain), all joint types (distance, revolute, prismatic, pulley, gear, wheel, weld, rope, friction, motor, mouse), contacts, ray casts, queries and filters. A Lua script reads almost like the C++ “Hello World” from the Box2D manual:
local box2d = require 'LuaBox2D'
local world = box2d.World(box2d.Vec2(0, -10))
local bodyDef = box2d.BodyDef()
bodyDef.type = 'dynamic'
bodyDef.position = box2d.Vec2(0, 4)
local body = world.createBody(bodyDef)The bindings are written in C++ and built with CMake against Lua 5.1, and the repository includes Lua tests for the main classes.