An overview of the demo applications

Demo apps are provided to showcase certain features of Jolt JNI. The following apps are found in the com.github.stephengold.sportjolt.javaapp.demo package of the Sport-Jolt "java-apps" sub-project:

  • NewtonsCradle demonstrates dynamic restitution and distance constraints

  • Pachinko demonstrates compound shapes and 2-D physics

  • ThousandCubes demonstrates stacking cubes and launching projectiles

User interface

The demo apps are controlled primarily by keyboard input.

The descriptions below assume a keyboard with the "US" (QWERTY) layout. On keyboards with other layouts, the keys may be labeled differently.

For convenience, the mapping of keys to actions is partly standardized. In all demo apps:

  • . and Pause toggle the simulation between running and paused,

  • C dumps the camera’s position to the console, and

  • Esc ends the app.

For camera control, all demo apps use DragLMB rotation mode. This means you can rotate the camera by dragging with the left mouse button. Furthermore:

  • W and S dolly the camera forward and back, respectively,

  • A and D dolly the camera left and right, respectively,

  • Q raises the camera, and

  • Z lowers the camera.

Additional mappings are specific to each app:

  • In NewtonsCradle:

    • F1, 1, and Numpad1 restart with a single ball

    • F2, 2, and Numpad2 restart with 2 balls

    • F3, 3, and Numpad3 restart with 3 balls

    • F4, 4, and Numpad4 restart with 4 balls

    • F5, 5, and Numpad5 restart with 5 balls

  • In Pachinko:

    • F4, 4, and Numpad4 restart with 4 rows of pins

    • F5, 5, and Numpad5 restart with 5 rows of pins

    • F6, 6, and Numpad6 restart with 6 rows of pins

    • F7, 7, and Numpad7 restart with 7 rows of pins

    • F8, 8, and Numpad8 restart with 8 rows of pins

    • F9, 9, and Numpad9 restart with 9 rows of pins

  • In ThousandCubes:

    • E launch a red ball