The engine, compiled to WebAssembly, running in your browser. Drag anything with the left mouse button: swing the wrecking ball into the crates, or pull the rope bridge out of shape. Right-click or press Space to spawn a shape at the cursor, C clears what you spawned, R resets the scene.
What you are dragging is the mouse joint: a damped spring from the cursor to the point you grabbed, solved by the same XPBD kernel as every other constraint.
Everything else in the scene is one engine feature or another. The wrecking ball hangs on a thirteen-link rope and the bridge deck is ten planks slung between two towers, both chains of distance joints — the deck's links are compliant, which is why it dips when something lands on it and springs back when it comes off. The seesaw is a revolute joint, the hillside is a chain collider, and the rounded hexagon is a polygon with a skin radius.
The playground is examples/playground, an ordinary example: one main.cpp, one Scene.yml. The renderer's frame loop is the only thing Emscripten changes, and it does that through emscripten_set_main_loop.
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DFX2D_BUILD_EXAMPLES=ON
cmake --build build -j --target example_playground
./build/example_playgroundWith an activated emsdk on the path, one script fetches raylib, yaml-cpp, Dear ImGui and rlImGui, compiles them for the web, builds the playground, and copies the result into docs/public/playground/:
./scripts/build_web.shThe output is three files, playground.js, playground.wasm and playground.data (the preloaded scene), served next to a small index.html. Any Fx2D program that uses FxRylbRenderer::run() can be built the same way; add it as a target under FX2D_BUILD_WEB in CMakeLists.txt.