Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DemoPolygonPhysics crashes when run standalone #132

Open
RandomReaper opened this issue May 11, 2016 · 3 comments
Open

DemoPolygonPhysics crashes when run standalone #132

RandomReaper opened this issue May 11, 2016 · 3 comments
Labels

Comments

@RandomReaper
Copy link
Collaborator

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.(PolygonShape.java:29)
at ch.hevs.gdx2d.lib.physics.AbstractPhysicsObject.createPolygonObject(AbstractPhysicsObject.java:98)
at ch.hevs.gdx2d.lib.physics.AbstractPhysicsObject.(AbstractPhysicsObject.java:57)
at ch.hevs.gdx2d.components.physics.primitives.PhysicsPolygon.(PhysicsPolygon.java:43)
at ch.hevs.gdx2d.demos.physics.DemoPolygonPhysics.onInit(DemoPolygonPhysics.java:54)
at ch.hevs.gdx2d.desktop.Game2D.create(Game2D.java:174)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:143)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)

@RandomReaper
Copy link
Collaborator Author

It seems the physics world is not initialized. PhysicsWorld.getInstance() fix it...

@metc
Copy link
Contributor

metc commented May 11, 2016

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``...

@metc metc added the bug label May 11, 2016
@RandomReaper
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants