Qianyuan Wang converted the Box2d physics engine to Delphi VCL a couple years ago and the source code for it is up on Google Code. However, the code was not cross platform and worked only on Windows. I hired an expert developer on oDesk to take the existing Box2d for Delphi project and convert it to Firemonkey so that it will run cross platform on mobile devices. The Box2d physics engine is now available for Delphi XE6 Firemonkey (plus Delphi XE5 Firemonkey and AppMethod) and it runs on Windows, Android, IOS, and OSX. The code is 100% native Delphi and there are no library files to include. The original code base has been refactored so that the VCL and FMX versions both use the same code on the back end. I’m sure there are performance tweaks that you can make yourself to optimize it but for now it is in a usable state. If you do make significant performance improvements I’d like to get your changes so they can be included with the download. There are over 60 different demo projects included in the Box2d conversion code archive. Everything from a car driving on terrain to a swaying bridge to a basic version of Arkanoid (or Breakout). Here is a list of the demo projects:

Add Pair(stress test)

Apply Force

Body Types

Breakable

Bridge

Bullet Test

Buoyancy Controller

Cantilever

Car

Chain

Character Collision

Collision Filtering

Collision Processing

Compound Shapes

Confined

Continuous Test

Convex Hull

Conveyor Belt

Distance Test

Dominos

Dynamic Tree Test

Edge Shapes

Edge Test

Explosion

Free Rope

Gears

Graviation Controller

Mobile

Mobile Balanced

Motors & Limits

One Sided Platform

Pin Ball

Poly Shapes

PolyCollision

Prismatic

Pulleys

Pyramid

RayCast

Restitution Test

Revolute

Rope In Wind

Rope Joint

Sensor Test

Shape Editing

Slider Crank

Sphere Stack

Terrain Box

Theo Jansen’s Walker

Tiles(stress test)

Time of Impact

Time of Impact2

Tumbler(stress test)

Varying Friction

Varying Restitution

Vertical Stack

Web

Wheel Joint

Ping Pong (Arkanoid / Breakout)

The Box2d physics engine has been extensively used in Adobe Flash’s ActionScript 3 (AS3) language. There is a site run by Emanuele Feronato which has over 160 easy to follow Box2d tutorials for AS3. You can easily follow the tutorials for building games using Delphi XE6 Firemonkey simply by translating the AS3 code to Object Pascal. The Box2d calls will be very similar between the two languages.

Download Box2d For Delphi XE6 Firemonkey v1.0.

Box2d Firemonkey source code also available on Github.