O'Reilly logo

jMonkeyEngine 3.0 Beginner's Guide by Ruth Kusterer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required