Browse Source

Update docs for library/visualizer split

- technical_reference.md: new Build System section, core library architecture
- AGENTS.md: add make lib/example targets, clarify orbit_sim is visualizer
- README.md: update cloning, building, and running instructions
main
cinnaboot 3 months ago
parent
commit
2205b1b202
  1. 9
      AGENTS.md
  2. 16
      README.md
  3. 29
      docs/technical_reference.md

9
AGENTS.md

@ -6,7 +6,8 @@
## Architecture ## Architecture
- C-style C++ (structs/functions, NO classes/templates) - C-style C++ (structs/functions, NO classes/templates)
- Raylib (git submodule) for 3D - chose over SFML (no 3D support) - Core library (`liborbit.a`) in `src/` — simulation, physics, maneuvers, config
- Visualizer in `example/src/` — Raylib/raygui rendering (moved from core)
- See docs/technical_reference.md for data structures reference - See docs/technical_reference.md for data structures reference
- See docs/rendering.md for rendering system reference - See docs/rendering.md for rendering system reference
@ -42,7 +43,9 @@
- Always ask the user if we want to update the technical_reference after generating a summary - Always ask the user if we want to update the technical_reference after generating a summary
## Common Commands ## Common Commands
- Build: make - Build all (lib + tests + visualizer): make
- Build library only: make lib
- Build visualizer example: make example
- Test (build + run all): make test - Test (build + run all): make test
- Test (rebuild only): make test-build - Test (rebuild only): make test-build
- Test (specific tag): ./build/orbit_test '[tag_name]' - Test (specific tag): ./build/orbit_test '[tag_name]'
@ -51,7 +54,7 @@
- See docs/technical_reference.md for full build target reference - See docs/technical_reference.md for full build target reference
## Simulation ## Simulation
The simulation binary is built at `./build/orbit_sim`. Agents should NOT attempt to run the graphical simulation. Focus on testing and code changes only. The core simulation library is built at `build/liborbit.a`. The visualizer binary is at `./build/orbit_sim`. Agents should NOT attempt to run the graphical simulation. Focus on testing and code changes only.
## Testing Guidelines ## Testing Guidelines
- Always use `WithinAbs()` for floating-point comparisons - Always use `WithinAbs()` for floating-point comparisons

16
README.md

@ -17,6 +17,8 @@ cd claudes_game
git submodule update --init --recursive # If already cloned without --recursive git submodule update --init --recursive # If already cloned without --recursive
``` ```
This initializes submodules in both `ext/` (tomlc17) and `example/ext/` (raylib, raygui).
### Dependencies (Debian 13) ### Dependencies (Debian 13)
```bash ```bash
@ -29,17 +31,23 @@ sudo apt install -y build-essential g++ make libx11-dev libxcursor-dev \
### Building ### Building
```bash ```bash
make # Build raylib (first time) and compile sources make # Build library (liborbit.a), tests, and visualizer example
make rebuild # Clean and rebuild make lib # Build library only
make clean-all # Clean everything including raylib make example # Build visualizer only
make rebuild # Clean and rebuild all
make clean-all # Clean everything
``` ```
The visualizer (`./build/orbit_sim`) links against the core simulation library.
## Running ## Running
```bash ```bash
./orbit_sim # Run with the default solar system configuration ./build/orbit_sim # Run visualizer with default config
``` ```
Pass a config file as argument: `./build/orbit_sim tests/test_moon_orbits.toml`
## Documentation ## Documentation
- **[Technical Reference](docs/technical_reference.md)** - Data structures and module overview - **[Technical Reference](docs/technical_reference.md)** - Data structures and module overview

29
docs/technical_reference.md

@ -2,20 +2,20 @@
## Overview ## Overview
2-body orbital mechanics simulator using **analytical propagation** for precise Keplerian trajectories. Supports elliptical, parabolic, and hyperbolic orbits with dynamic Sphere of Influence (SOI) transitions, impulsive burns, and 3D visualization via Raylib. 2-body orbital mechanics simulator using **analytical propagation** for precise Keplerian trajectories. Supports elliptical, parabolic, and hyperbolic orbits with dynamic Sphere of Influence (SOI) transitions and impulsive burns. 3D visualization via Raylib is provided as a separate example project in `example/`.
## Architecture ## Architecture
Modular C-style C++ (structs/functions, no classes). Module dependencies: Modular C-style C++ (structs/functions, no classes). Module dependencies:
``` ```
Main → Simulation → Orbital Mechanics → Physics Core Library → Simulation → Orbital Mechanics → Physics
→ Maneuver → Maneuver
→ Rendezvous → Rendezvous
→ Config Loader → Config Loader
``` ```
Renderer and UI Renderer depend on Config Loader for display data. Test Utilities are standalone. The core library (`liborbit.a`) contains all simulation code. 3D rendering (Raylib/raygui) is in `example/src/`. Test Utilities are standalone.
## Coordinate Frame System ## Coordinate Frame System
@ -250,9 +250,22 @@ All satisfy vis-viva: v² = μ(2/r - 1/a).
## Build System ## Build System
**Targets**: make / make all (build + ctags), make raylib, make test, make test-build, make clean, make clean-all, make rebuild. The project is split into a core simulation library and a visualizer example.
**Dependencies**: g++ (C++14), raylib (git submodule), raygui (header-only), tomlc17, Catch2 (tests only). **Root Makefile** (simulation library + tests):
- `make all` — build library, tests, and example (default)
- `make lib` — build `build/liborbit.a` static library
- `make test` — build and run all tests
- `make test-build` — rebuild test executable only
- `make clean` — clean build artifacts
- `make clean-all` — clean everything including example
- `make rebuild` — clean and rebuild all
**Example Makefile** (visualizer):
- `make all` — build `build/orbit_sim` (recursive from root via `make example`)
- `make clean` — clean example build artifacts
**Dependencies**: g++ (C++14), tomlc17 (root submodule), Catch2 (tests only). Raylib/raygui are in `example/ext/` submodules.
**Testing**: **Testing**:
```bash ```bash

Loading…
Cancel
Save