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:
Code: Select all
if (propValue.has("vec2"))
setCustomVector(item, propertyName, this.jsonToVec("vec2", propValue));
As it is now, the following will never find any custom vector properties:
Code: Select all
if (propValue.has("Vector2"))
setCustomVector(item, propertyName, this.jsonToVec("Vector2", propValue));
Ideally, variable names that refer to the RUBE vec2 type should also remain unchanged, (eg. m_customPropertyMap_vec2).