Files
goldeneye-pc-port/port/include/port_math.h
T
James Dansereau c20a205bac D194: absolute (cursor-anchored) aim -- GEPD-style position-based aiming
Holding RMB (or the Aim bind, default Left Shift) in a stage now releases
the click-to-lock grab and drives the aim stick from a closed position
loop on the live camera (vv_theta/vv_verta read via player.h): the
crosshair chases the point under the free OS cursor and HOLDS it --
stationary cursor = stationary aim, even while walking. Release re-grabs
with no snap.

- Target derived from cursor NDC against the real render viewport rect
  (viGetView*), portScaleFovY so scope zooms compose for free; re-anchors
  on every cursor move or FOV change.
- Coast prediction (game's 0.05*mult/tick speed decay) prevents overshoot;
  first-order dithering maps continuous demand onto the game's 10 discrete
  stick levels for precision work (shoot-the-lock etc.).
- LMB fires while the cursor is out; ESC still releases capture; menus and
  MouseCaptureMode=0 unchanged. New knob: Input.AimAbsolute (default 1).

Also: -I include shadows <math.h> with the game's constants-only header,
which left fabs/pow/tan in input.c on implicit declarations -- new
port/include/port_math.h pulls the real system math.h via #include_next.
2026-09-13 11:21:13 -04:00

16 lines
671 B
C

/* port_math.h -- real system math declarations for port/ code.
*
* The build's -I list puts the game's include/math.h (a constants-only
* header: M_PI & friends, guard _MATH_EXT_H_) ahead of the system one, so a
* plain #include <math.h> in a .c file picks up the game header and leaves
* fabs/tan/atan/pow/... implicitly declared. Including from THIS header lets
* #include_next step past the game header to the real system math.h.
*/
#ifndef PORT_MATH_H
#define PORT_MATH_H
#include <math.h> /* -> include/math.h (game constants) via -I include */
#include_next <math.h> /* -> next match in the search path: system math.h */
#endif /* PORT_MATH_H */