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