Reusable C++20 2D simulation library with an optional SDL2/OpenGL 3.3 runtime. Kinetra-Lab owns applications, the bundled launcher executable and experiments. Kinetra builds independently of Lab.
- Features
- Shared UI
- Modules
- Quick start
- Using Kinetra
- Working with Kinetra-Lab
- Documentation
- Platform support
- License
Directory guides: docs, media, tests, tools.
- Headless geometry, collisions, physics, spatial queries, navigation and steering.
- Optional window, input, camera, colored primitives, RGBA image drawing, bitmap text and direct sessions.
- Public C++ headers under
include/kinetra/, grouped by layer insimulation/,view/andruntime/; CMake targetsKinetra::Simulation, optionalKinetra::RuntimeandKinetra::Launcher. - Optional reusable launcher menu and session host in
<kinetra/runtime/launcher.h>; application registration and gameplay remain in Lab.
Every Kinetra-Lab application runs in the same shell: the launcher menu and session host of Kinetra::Launcher, and the runtime's overlays. The applications supply rows, content and actions; Kinetra lays them out, draws them and captures their input (contracts). The GIFs show them in Kinetra-Lab's Demo, with the pointer and keys a person would use (how they are made).
| Part | In use |
|---|---|
Launcher menu (LaunchMenu, SessionHost) |
![]() |
Settings panel (SettingsOverlay) |
![]() |
Debug menu (DebugMenu) |
![]() |
Agent inspector and frame times (InspectorView, draw_frame_times) |
![]() |
| Debug layers | ![]() |
| Module | CMake target | Public headers in include/kinetra/<layer>/ |
Guide |
|---|---|---|---|
| Simulation: geometry, physics, spatial queries, navigation, steering, avoidance, passing, stall detection, right of way and making way, traffic admission, the fixed clock | Kinetra::Simulation |
simulation/: math.h, physics.h, spatial_grid.h, collision_grid.h, navigation.h, weighted_grid.h, steering.h, avoidance.h, passing.h, passing_coordinator.h, stall_detector.h, right_of_way.h, traffic.h, clock.h |
Simulation |
| View: camera, input, debug-menu rows and frame statistics, usable headless | header-only, with Kinetra::Simulation |
view/: camera.h, input.h, debug_menu.h, inspector.h, timing.h |
Runtime and launcher |
| Runtime: window, drawing, sessions, overlays | Kinetra::Runtime (optional) |
runtime/: engine.h, session.h, settings_view.h, inspector_view.h, error_view.h, and header-only bitmap_text.h, hud_text.h, overlay_style.h, debug_view.h, help_view.h |
Runtime and launcher |
| Launcher: menu, session host and loop | Kinetra::Launcher (optional) |
runtime/launcher.h |
Runtime and launcher |
| Tests and the external consumer | Core tests |
Include headers with their layer, as <kinetra/simulation/physics.h>; a headless consumer includes simulation/ and view/ only. The rule for both repositories is in conventions. include/glad/ and include/KHR/ hold the generated OpenGL loader; they are private to the runtime. The vendored test framework is described in third_party/doctest.
Requires C++20, CMake 3.16+, a build tool. The default build is headless.
cmake --workflow --preset dev # Debug, runtime, warnings; needs CMake 3.25+, Ninja, ccache cmake --workflow --preset headless # simulation only, no SDL2/OpenGL needed
Without presets: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build --parallel && ctest --test-dir build. Enable -DKINETRA_BUILD_RUNTIME=ON for SDL2/OpenGL (development packages required).
See development for all presets, editor setup and graphics verification. Run applications from Kinetra-Lab.
Source integration:
set(BUILD_TESTING OFF CACHE BOOL "" FORCE) add_subdirectory(external/Kinetra) add_executable(my_simulation main.cpp) target_link_libraries(my_simulation PRIVATE Kinetra::Simulation)
#include <kinetra/simulation/physics.h> int main() { kinetra::World world; world.add({}); world.step(1.f / 120); }
Runtime consumers enable KINETRA_BUILD_RUNTIME and link Kinetra::Runtime. Kinetra also supplies Kinetra::Launcher for the generic menu, session host and launcher loop. Integration uses source targets; there is no installed CMake package.
Kinetra-Lab includes Kinetra as a Git submodule at external/Kinetra and records one exact engine commit. An engine change is made, committed and published here first; Lab then moves its pointer to that commit and verifies the applications against it. Application-only changes belong in Lab. Lab's external dependencies guide has the steps and commands, including building Lab against an unpublished sibling checkout, and the workflow gives the merge order.
Start with the documentation index and the architecture; each module guide explains its own code.
Contributors follow the development workflow: the implementing session plans the affected scenarios, adds and verifies regression tests, and reviews the final diff. Code changes have a design document. Each change is verified at the level its impact requires. AGENTS.md records the rules for agents and developers; conventions and the documentation guide give the details.
Kinetra is built from source on Linux. Ubuntu 24.04 LTS is the Linux reference for CI. See the dependencies per distribution. Continuous collision detection covers circles and nonrotating boxes and polygons; rotating boxes and polygons are checked discretely and can tunnel. Navigation does not guarantee arrival in moving crowds. Rendering supports standalone RGBA images supplied by the caller. Applications own pose interpolation. Cross-machine bitwise determinism is not promised.
MIT; see LICENSE. Generated GLAD retains embedded licenses.




