Time for action – an elevator platform

Let's build a scene that uses all three types of physical objects: dynamic, static, and kinematic. The static part of the scene contains a floor (a horizontal box), a slope (a rotated box), and a wall (a vertical box). Later, we add a kinematic moving platform (a cuboid box) and a dynamic ball (a sphere), and then see how they interact.

  1. Make a copy of Main.java and name the class PhysicsKinematic.java. Remember to also refactor the first line of the main() method to the following:
    PhysicsKinematic app = new PhysicsKinematic();
  2. Make this a physical game by attaching a BulletAppState instance.
    private BulletAppState bulletAppState; @Override public void simpleInitApp() { bulletAppState = new BulletAppState(); stateManager.attach(bulletAppState); ...

Get jMonkeyEngine 3.0 Beginner's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.