Using JMonkeyEngine as a library

For those people that are using the engine as a library (rather than creating a JMonkeyEngine Application), if you want to use the native bullet libraries you need to load them yourself (instead of being loaded by the Application object).

You can do this simply with the following code:



e.g.:

[java]AppSettings appSettings = new AppSettings(false);

JmeDesktopSystem jmeSystemDelegate = new JmeDesktopSystem();

jmeSystemDelegate.initialize(appSettings);

[/java]



If you are using a physics engine, you’ll probably also want to create a PhysicsSpace(), and add the relevant listeners, rather than use the BulletAppState



e.g.:

[java]_physSpace = new PhysicsSpace();



_physSpace.addCollisionListener(this);

_physSpace.addTickListener(this);

[/java]

2 Likes
@affogato said:
If you are using a physics engine, you’ll probably also want to create a PhysicsSpace(), and add the relevant listeners, rather than use the BulletAppState

..and don't forget to update it with a correct timer ;)
1 Like