Page 1 of 1

Crashes out loading a RUBE Json export

Posted: Wed Jul 22, 2015 4:39 pm
by rileyrg
I instantiate an async RubeSceneLoader (https://github.com/tescott/RubeLoader) (JAVA) in libgdx and load an exported RUBE json file. I get this crash : java: /var/lib/jenkins/workspace/libgdx/extensions/gdx-box2d/gdx-box2d/jni/Box2D/Collision/Shapes/b2PolygonShape.cpp:158: void b2PolygonShape::Set(const b2Vec2*, int32): Assertion `false' failed. JSON file is here. Any indications if this is an error in the data RUBE has exported? https://gist.github.com/rileyrg/bc71e7d6b9c7fe07bb09 Image

Re: Crashes out loading a RUBE Json export

Posted: Wed Jul 22, 2015 5:03 pm
by rileyrg
I tried the async loader with a more conventional fixture shape (n sided poly) and it loaded fine. So its that shape in my OP causing an error (link to GIST included)

Re: Crashes out loading a RUBE Json export

Posted: Wed Jul 22, 2015 5:09 pm
by iforce2d
I'm not sure what the async loader is, but the assert you mention has come up before.
viewtopic.php?f=7&t=319
viewtopic.php?f=7&t=373
You could try replacing the existing b2PolygonShape.cpp with the one I modified in the first of those threads.

Re: Crashes out loading a RUBE Json export

Posted: Wed Jul 22, 2015 5:19 pm
by rileyrg
I dont have any cpp files. You mean I should build my own box2d? OK, stop press. It seems this fix has been ported into some cutting edge of box2d. It should be backported into libgdx in the near future.

Re: Crashes out loading a RUBE Json export

Posted: Thu Jul 23, 2015 4:02 am
by iforce2d
I haven't used libgdx but since it's open source, surely there is a 'build everything' type script or some instructions that let you make the components from scratch yourself? In any case the change would be to replace the b2PolygonShape.cpp, this has apparently helped other users.

Re: Crashes out loading a RUBE Json export

Posted: Wed Jul 29, 2015 1:05 pm
by rileyrg
Upgrading to the latest snapshot saw the box2d fix incorporated. Closed.