--- orphan: true --- # Physics Backend Compare The builtin solver and Jolt, side by side in one scene. ```{raw} html ▶ Run in browser ``` **Tags:** `physics` Every ``PhysicsRoot`` owns an isolated world, and its ``backend`` names the solver that world runs. Two roots in one scene run two solvers at once, each stepping only the bodies below it: left = self.add_child(PhysicsRoot(backend="builtin")) right = self.add_child(PhysicsRoot(backend="jolt")) Each side here is the same arena: a walled floor, a ``CharacterBody3D`` pad and six bodies dropped from the same heights, five onto the pad and one clear of it onto the floor. WASD or the left stick drives both pads with one velocity, so any difference between the halves comes from the solver, not the game code. The contract is the same on both: the dropped bodies rest on the pad, a pad walked away leaves its load behind, and a pad driven into a body shoves it. What differs is what each world can report, and a game asks rather than guessing from the backend's name. ``world.capabilities()`` answers once, at setup, whether contacts carry a measured impulse: measures = Capability.CONTACT_IMPULSE in root.world.capabilities() Every body's ``collided`` signal hands over a ``Contact``. The builtin solver fills ``contact.impulse`` with the normal impulse it applied; Jolt has no hook into its solver and leaves it ``None`` rather than inventing a number. Both fill ``contact.impulse_estimate``, the impulse that would stop the two bodies' approach, computed from their masses and linear velocities by the same formula on every backend. It ignores bounce and spin, so it is the number for hit sounds, shake and damage, not a measure of load. Each side's readout shows the hardest impulse and estimate it has seen and how many contacts arrived; the two estimates are close rather than equal, because each solver moves its bodies a little differently. Jolt ships with ``simvx-physics-jolt``. Where it is not installed, ``backend="jolt"`` falls back to the builtin solver with a warning, and the right-hand title names the world that actually runs. Controls: WASD / left stick - Move both pads Drag / arrows - Orbit the camera Scroll / pinch - Zoom R / Re-drop - Drop both batches again ## Source ```{literalinclude} ../../examples/features/physics/backend_compare.py :language: python :linenos: ```