Installation
Fx2D is a C++20 project built with CMake. The visual viewer uses raylib, Dear ImGui, rlImGui, yaml-cpp, and Eigen3. The engine also supports a headless build for CI and non-rendered simulations.
Clone and prepare dependencies
git clone https://github.com/Bharath2/fx2d-physics-engine.git
cd fx2d-physics-engineInstall CMake 3.16+, Eigen3 3.3+, yaml-cpp, and raylib 4.5+. For visual builds, populate the placeholder lib/imgui and lib/rlImGui folders with their upstream sources before configuring CMake.
Eigen 3 and Eigen 5 are supported; both use the CMake package name Eigen3 and target Eigen3::Eigen. Configuration prints the selected version. To select a specific installation, pass -DEigen3_DIR=/path/to/share/eigen3/cmake.
Build the viewer
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
./build/Fx2DThe fxmake helper offers equivalent shortcuts:
./fxmake # release build
./fxmake debug # debug buildBuild headless
For tests, batch simulations, or code that does not need the graphics stack:
./scripts/build_headless.sh
cmake --build build-headless -jContinue with your first scene, or read the full headless guide.