Crashes out loading a RUBE Json export

Report problems here (or use the built-in feedback dialog in the editor)
Post Reply
rileyrg
Posts: 54
Joined: Sun Jul 19, 2015 11:42 am

Crashes out loading a RUBE Json export

Post 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
rileyrg
Posts: 54
Joined: Sun Jul 19, 2015 11:42 am

Re: Crashes out loading a RUBE Json export

Post 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)
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Crashes out loading a RUBE Json export

Post 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.
rileyrg
Posts: 54
Joined: Sun Jul 19, 2015 11:42 am

Re: Crashes out loading a RUBE Json export

Post 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.
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: Crashes out loading a RUBE Json export

Post 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.
rileyrg
Posts: 54
Joined: Sun Jul 19, 2015 11:42 am

Re: Crashes out loading a RUBE Json export

Post by rileyrg »

Upgrading to the latest snapshot saw the box2d fix incorporated. Closed.
Post Reply