Tuesday, January 11, 2011

SVG Box2D level loader and tilemap viewer on iPad


https://github.com/timkerchmar/TrippySoftLib

The SVG parser in C++ is usable. The same SVG parser is used on the C++ side as will be demonstrated in the AS3 version. I ripped out some of the core SVG parsing routines from SVGWeb, creating MiniSVGWeb. Using a pretty generic delegate class, you can draw to Box2D or anything else if you wanted. On an actual iPad, the SVG parsing is still pretty slow.

There are several very nice gems in this iPad app:

1. minimal objective C (kept quarentined in a few particular files).
2. shows a satisfying scroll/throw touch handling
3. renders everything with OpenGL ES 2.0 shaders
4. same numbers and math can be used for OpenGL or upcoming AS3 version (screen goes from 0-1024 wide on both)
5. Allows easy override of SVG unit -> box2D unit scale, and box2D -> screen unit scale
6. Shows DrawDebugDataInAABB (which I lazily stuck directly into b2World).

The repository is public, so if you are interested, please use and update. This is for us all.

The Box2Scene work is still pending. Translating from AS3's containers and GC conveniences to C++'s is quite a chore.

0 comments:

Post a Comment