gdx2d
gdx2d copied to clipboard
DemoPolygonPhysics crashes when run standalone
but it runs in the DemoSelector
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.UnsatisfiedLinkError: com.badlogic.gdx.physics.box2d.PolygonShape.newPolygonShape()J
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:127)
Caused by: java.lang.UnsatisfiedLinkError: com.badlogic.gdx.physics.box2d.PolygonShape.newPolygonShape()J
at com.badlogic.gdx.physics.box2d.PolygonShape.newPolygonShape(Native Method)
at com.badlogic.gdx.physics.box2d.PolygonShape.
It seems the physics world is not initialized. PhysicsWorld.getInstance() fix it...
Good point @RandomReaper
I tested with the demo selector gdx2d-demoDesktop-1.2.1.jar
and it doesn't work either. If no other physics demo are launched before the DemoPolygonPhysics
, the bug also appears in the demo selector.
I am not sure if we should really initialize the physics world for all applications because not all the demo use the `PhysicsWorld``...
The demo works if another demo using physics and calling PhysicsWorld.getInstance()
have been run before...
I think creating an unused variable using PhysicsWorld.getInstance()
in the constructor of the PortableApplication is counter-intuitive and initializing the physics world is not so expensive.