Nape and Starling together? It’s possible!

Somebody of you already tried fastest 2D flash physics engine Nape with a GPU 2D rendering framework Starling together and noticed that Body.graphic property is class of flash.display.DisplayObject and it can’t be assigned to the starling.display.DisplayObject instance.
So, some of you just used Box2D, some of you controlled Starling DisplayObjects manually, maybe some did what I did, but keep it away from public, but I like Body.graphic property – it’s really useful and I wish all as3 developers can easily use fastest 2d physics engine with 2D GPU rendering engine.

Today I’m glad to present you modified Nape FP 10+ swcs (release and debug) of the Milestone 7.2 “r3” (maybe not fully) compatible with the Starling.

I just replaced Body.graphic flash.display.DisplayObject class by the Dynamic class (* in as3) and removed Body.graphic.rotation radians to degrees conversion to make it compatible with Starling in my case.
Now I can use Nape as usual, with usual DisplayObjects, it’s really cool!
Yes, there are possible some more compatibility issues, but this changes was enough in my case and Nape worked with the Starling DisplayObjects fine.

I like a challenge with caxe and flib compiling on Windows in the MinGW I faced while recompiling swc, it was fun!
To get the working swcs on Windows, you should:
1. Compile caxe from sources (only once).
2. Compile flib from sources (only once).
3. Use caxe preprocessor on .cx sources to get haxe (.hx) sources (every swc compile).
4. Compile haxe sources into the swcs (every swc compile).

Nape sources updates too often, thus, I’ll not keep this swcs sync with them, moreover, maybe we will see the Starling support officially in some of next Nape updates!

UPDATED:
By the way, manual Starling DisplayObjects control is really simple. You could do it this way:

That’s it!
This approach a could be slower when positioning and rotating your Body.graphic right inside of Body instances, because you should iterate through all bodies and call a bunch of getters\methods each frame.
But it allows you to use the latest native Nape swc with any third-party rendering framework, as Starling, and it’s great!

UPDATED #2
Nape was updated and in it’s new version we can use Starling DisplayObjects like this:

Hey, Lee! Glad to see you here!
Now you can use Starling with official pure Nape swcs, like as I showed in the UPDATED #2 section.
Latest Nape swcs can be found here: http://deltaluca.me.uk/docnew/
Thanks for your comment!