https://github.com/rileyrg/b2dJson
First pass at getting the b2d json loader working with libGDX b2d types.
A few things commented out where I couldnt see obvious libgdx structures to match but bodies and fixtures loading fine.
Box2dJson loader fork now "working" with LibGDX
Re: Box2dJson loader fork now "working" with LibGDX
This is excellent, thanks for sharing!
I've added it to the list of loader contributions.
Just a couple of points I noticed:
1. Since libgdx is using a more recent version of Box2D than JBox2d was ported from, it should be possible to get gear and wheel joints working (those sections are there but commented out).
2. It looks like some automatic text replacement was used to change the type "Vec2" used by JBox2d for the "Vector2" type used by libgdx. This has unfortunately also changed occurrences of the "vec2" type used in RUBE custom properties. For example, the "vec2" in places like this should remain unchanged:
As it is now, the following will never find any custom vector properties:
Ideally, variable names that refer to the RUBE vec2 type should also remain unchanged, (eg. m_customPropertyMap_vec2).

I've added it to the list of loader contributions.
Just a couple of points I noticed:
1. Since libgdx is using a more recent version of Box2D than JBox2d was ported from, it should be possible to get gear and wheel joints working (those sections are there but commented out).
2. It looks like some automatic text replacement was used to change the type "Vec2" used by JBox2d for the "Vector2" type used by libgdx. This has unfortunately also changed occurrences of the "vec2" type used in RUBE custom properties. For example, the "vec2" in places like this should remain unchanged:
Code: Select all
if (propValue.has("vec2"))
setCustomVector(item, propertyName, this.jsonToVec("vec2", propValue));
Code: Select all
if (propValue.has("Vector2"))
setCustomVector(item, propertyName, this.jsonToVec("Vector2", propValue));
Re: Box2dJson loader fork now "working" with LibGDX
Thanks for looking over. I'll address those things in the coming days.
Re: Box2dJson loader fork now "working" with LibGDX
hi! That's cool! I use libGdx and to load the scenes i use the
http://github.com/tescott/RubeLoader
and spend some time to get used to it.
I'm curious what is your loader doing specifically ? Sorry I'm new to Rube and confused which one I should take.
Thanks
http://github.com/tescott/RubeLoader
and spend some time to get used to it.
I'm curious what is your loader doing specifically ? Sorry I'm new to Rube and confused which one I should take.
Thanks