Isle-Slingers/js/physics/aim/agents.md

15 lines
708 B
Markdown
Raw Normal View History

# js/physics/aim/ — agents.md
Part of the modularization pass. Module map: `MODULES.md`; runtime model: `architecture.md`.
Installs into `P`: aimVector, trajectory.
- `aimVector(g, sling, drag)` clamps drag to [MIN_PULL, MAX_PULL] and maps it to
a launch velocity. The pull clamp is what makes full-power shots deterministic
(the balance spec relies on it).
- `trajectory(g, x, y, vx, vy, steps)` is the preview integrator; it must track
the real flight — there is a dedicated test arm ("trajectory preview tracks
the real flight"). If you change integration in stepPhysics, change it here in
lockstep.
- Consumes: LAUNCH_POWER, GRAVITY, AIR_DRAG, BIRD_BOUNCE, WORLD,
BIRD_GROUND_FRICTION.