Game Development Reference
In-Depth Information
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 Ri-
gidBodyControl object, which is added to physicsSpace of bulletAppState .
Search WWH ::




Custom Search