This document describes the demos in the Samples application (currently compiles only under Windows). When you run the samples application the application will initially start paused, press P to unpause it. The menu is accessible through pressing ESC, it has the following options:
- Select Test - This allows you to select between the different types of physics tests
- Test Settings - Some tests will allow extra configuration, if not this setting will be greyed out
- Restart Test (R) - When selecting this, the test will go back to its initial state
- Run All Tests - This will run every tests for 10 seconds before proceeding to the next. This is a good way of visually inspecting the simulation before commiting a code change.
- Next Test (N) - When running all tests, this option can be used to quickly skip to the next test.
- Physics Settings - This menu contains all physics configuration.
- Drawing Options - This menu shows all the options for drawing the internal state of the physics simulation.
- Mouse Probe - This allows you to switch between various collision detection modes to test the different collision detection algorithms
- Shoot Object - A sample application is not complete without being able to shoot some balls at the simulation (B key). This menu allows additional settings.
- Help - A quick help text.
- Use the Mouse and WSAD keys to move around, hold Shift to speed up and Ctrl to slow down
- Hold the Space key to pick up an object in the center of the screen and move it around with the mouse and WSAD.
- P - Pause / unpause simulation.
- O - Single step the simulation.
- , - Step back (only when Physics Settings / Record State for Playback is on).
- . - Step forward (only when Physics Settings / Record State for Playback is on).
- Shift + , - Play reverse (only when Physics Settings / Record State for Playback is on).
- Shift + . - Replay forward (only when Physics Settings / Record State for Playback is on).
- T - Dump frame timing information to profile_*.html (when JPH_PROFILE_ENABLED defined).
Note that you can watch all movies below in a single YouTube playlist.
This categories shows vehicles created through the VehicleConstraint. These vehicles use ray- or shape casts to detect collision with the ground and simulate a vehicle with an engine, gearbox, differentials and suspension.
![Vehicle Demo](https://camo.githubusercontent.com/ac66b63cc9c21c905384ae06eca85479ce88a572324e718cf20b13f935bf60a5/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f415f67764c48344b4b44412f687164656661756c742e6a7067) |
A wheeled vehicle. |
![Tank Demo](https://camo.githubusercontent.com/3660e4f271fa5531987bfa581ec8f716f69edfe3653dbbf99f19b4cab9e63d45/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f51776c504f4b62787371552f687164656661756c742e6a7067) |
Demonstrates a tracked vehicle with a turret constrained to the main body with hinge constraints. |
This category demonstrates how ragdolls can be made and controlled using keyframing or motors.
![Kinematic Ragdoll](https://camo.githubusercontent.com/96d4a93124353d30ce11b5cca3b34c29ae19c4b3ba83fe51df3ec60f8dc521b9/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f67767136716455335a54732f687164656661756c742e6a7067) |
A ragdoll set to kinematic mode (infinite mass, simulated using velocities only) interacting with dynamic objects. |
![Ragdoll Driven to Animated Pose](https://camo.githubusercontent.com/615ff00f9e1b5d5e92f3ea8349b86580fa0f1b3df6c23d1531e495e4fb76b23d/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f6c5948686536484c6273342f687164656661756c742e6a7067) |
Demonstrating a humanoid ragdoll driven by motors which are trying to match a sprint animation in local space (green sticks). |
![160 Ragdolls in a Pile](https://camo.githubusercontent.com/550fe905b7f57f13e5f843b9371db0715ebc62f5a8628ed84f563af402636694/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f707779435730794e4b4d412f687164656661756c742e6a7067) |
160 Ragdolls being dropped on a scene from Horizon Zero Dawn. |
![160 Ragdolls in a Pile (Sleeping Visualization)](https://camo.githubusercontent.com/d4b58f39d634842c71a420c85d9641b220ad2c06a43626a86f5281b88dd39c6e/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f375a4d6d37794f627071732f687164656661756c742e6a7067) |
160 Ragdolls dropping on a pile, simulated using the Jolt Physics engine. Yellow means the ragdoll is simulated, red means the simulation is sleeping. |
![160 Ragdolls Driven to Pose](https://camo.githubusercontent.com/c7000d7dbf4b720a3bf6309c894233ea14e727d5dfb42a5dccdb2c3d9a21281e/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f6a687073497162735534492f687164656661756c742e6a7067) |
A pile of ragdolls that are driven to a specific animated death pose. This gives the ragdolls 'stiffness'. |
This category shows how you can simulate a (humanoid) character using a capsule.
![Character Demo](https://camo.githubusercontent.com/d751abf2b60c30dd988f4ab587fc7be45f514192743284aa1240be24c1b7719a/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f596a614a54396f663755452f687164656661756c742e6a7067) |
A demonstration of a game Character. Demonstrates moving, sliding against the environment, crouching and jumping. |
This category shows how you can implement a water simulation in your game.
![Water Simulation](https://camo.githubusercontent.com/a40254dacaacb112ba2a7c24dac9b1d127e3283cfa75cb03929406fdb4815f1e/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f4345725f4c74514c4765672f687164656661756c742e6a7067) |
Water buoyancy and friction simulation. Demonstrates how various shapes and compound shapes behave in the water. The right most object has a lowered center of mass. |
This category shows the various constraints that are supported. Constraints connect two or more bodies together and limit the relative movement.
![Path Constraint](https://camo.githubusercontent.com/09f22a3be58ca414ca64ae710cba88dbade164e2c490d7006db1d120486d41fc/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f36784d4b4e4d6a443570452f687164656661756c742e6a7067) |
Showing the path constraint in action. |
![Swing Twist Constraing](https://camo.githubusercontent.com/e30e026ee93b445675f8216e6df7224c49544decc9a1facedc8b8ed56093260a/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f386151397838535153754d2f687164656661756c742e6a7067) |
Demonstrates a chain of swing-twist constraints (usable for humanoid shoulders). The green cones show the swing limit and the pink pie shows the twist limit. |
This category contains general simulation tests. It demonstrates things like friction, restitution, damping, modifying gravity and continous collision detection. Some highlights:
![Stable Box Stacking](https://camo.githubusercontent.com/c9f39dc2d55dcfaa5ae7f32d278474acbe53f37389ff88fe43754e7f99ea9d93/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f6654746a424c594278636f2f687164656661756c742e6a7067) |
A YouTube video showing stability of a pile of boxes. |
![Active Edge Detection](https://camo.githubusercontent.com/e440e6c506928980b8333dab93bd3f9a142f65cca3a2dc582c9fab50769ab570/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f45616e46786c6b5a6763412f687164656661756c742e6a7067) |
Demonstrates objects sliding along a polygon mesh. Internal mesh edges are ignored and do not cause objects to bounce off. |
![Funnel Test](https://camo.githubusercontent.com/c0a894ba53004dea431b1909c0a163a00e028db2818ca9f8d0601991458b1686/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f592d5567796c48393932412f687164656661756c742e6a7067) |
1000 random shapes in a funnel. |
![Multithreaded Island Simulation](https://camo.githubusercontent.com/435ebcdf2344d12d41e6cdfeeb432bbf4078c442e9ed73a8037f4941af37a600/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f5f4c7635786c577443704d2f687164656661756c742e6a7067) |
We will automatically split up the simulation in islands of non-interacting bodies and distribute the work across multiple threads. Each island has its own color. |
These categories show off all of the supported shapes and how they can be scaled at run-time.
![Shape Scaling](https://camo.githubusercontent.com/c3c4a717e2ae06ae24d65401e2de665c8605e626e7207c7b441f7bb0820a6a7d/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f75396350424755467572632f687164656661756c742e6a7067) |
A height field shape using various scales in Jolt Physics: Uniform, Non uniform, Mirrored, Inside out |