Box2d Physics Engine For Delphi XE6 Firemonkey On Android, IOS, Windows, And OSX
April 18, 2014
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.
Thank you very much. I admire you and your site!
I’ve been thinkin of doing the same a while ago but i did not had the time. I cant wait to try this out
wow,thank you so much. love it 🙂
Hi, It’ll be helpful if you can host the box2d source code on github.
Working on getting it on Google Code. Haven’t figured out how to do the initial commit of the project however.
https://github.com/FMXExpress/box2d-firemonkey
Any chance to work/port to XE5?
It works in XE5 without any problems.
Are there any examples on how to use TSprite with this on XE6?