Adding Bullet physics to the application

This section provides a description of the basic steps to add bullet physics to an application.

In the simple InitApp method of the application, add the following lines of code:

BulletAppState bulletAppState = new BulletAppState();
stateManager.attach(bulletAppState);

To get a basic ground and some items to play with, add the following code:

PhysicsTestHelper.createPhysicsTestWorldSoccer(rootNode, assetManager, bulletAppState.getPhysicsSpace());

Objects that require physics should both be attached to the scene graph and have a RigidBodyControl object, which is added to physicsSpace of bulletAppState.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.239.118