How worldwalker2000/simplephysics works
Project type and purpose
• This is a standalone C++ desktop application (“SimplePhysics”) that provides an interactive editor to build rigid-body structures and then runs a constraint-based physics simulation on them.
• Key features (from the README):
– An editor/UI for designing custom mechanical assemblies
– A simulation engine based on the “Constrained Dynamics” paper by Witkin & Baraff
File structure
• Top-level files (single‐directory codebase)
– main.cpp → application entry point, event loop, UI/simulation orchestration
– system.cpp/h → core data structures: bodies, joints, system state
– constraints.cpp/h → constraint formulation and solver routines
– forces.cpp/h → definitions of force generators (e.g., gravity, springs)
– la.cpp/h → linear algebra utilities (vectors, matrices, solvers)
– constraints.hpp / forces.hpp / la.hpp → public headers for each module
– Makefile → build rules
– README.md → overview & usage
• No separate “gui” or “render” folder is present, so the editor and rendering logic is likely embedded in main.cpp or linked in at compile time via an external graphics library.
Insights from the README
• Confirms two primary subsystems:
a. Editor/UI for scene construction
b. Physics engine for constrained dynamics simulation
• Points to an underlying academic algorithm, implying the presence of a constraint solver, force evaluator, and numerical integration.