Skip to content

Math and screen geometry

API Returns
distance(a, b) number (vectors as {x,y,z} or six floats)
length(v) number
normalize(v) x, y, z
dot(a, b) number
lerp(a, b, t) number
lerp_vec(a, b, t) x, y, z
clamp(v, min, max) number
angles_to_forward(pitch, yaw) or ({pitch,yaw}) x, y, z unit forward
calc_angle(from, to) pitch, yaw degrees (Source-style)
fov(eye, target, viewAngles) degrees between view forward and eye→target

Note: this is aqua.math, not the global Lua math library (both remain available).

  • Per player: p.bones (alias of p.hitboxes) - world joint positions, Lua 1-based, index 1 ≈ head.
  • aqua.skeleton.parents() → { [i] = parentOr0 } (1-based; 0 = root).
  • aqua.skeleton.edges() → { {child, parent}, ... } for drawing.
  • aqua.skeleton.names() → hitbox name strings ("head_0", …).

Connectivity matches the built-in ESP skeleton.

Returns a table of 16 row-major floats at indices 1..16, plus nested rows m[1]..m[4] each with 1..4 columns. Same VP matrix used by world_to_screen.

Menu geometry for attaching overlay chrome next to the aqua window:

Field Meaning
open Menu visible
x, y, w, h Screen pixels (same space as aqua.draw.*)
logical_x/y/w/h Menu canvas units (pre-UI_SCALE)
scale Current UI_SCALE
function on_draw()
local m = aqua.get_menu()
if not m.open then return end
-- Panel docked to the right edge of the menu
aqua.draw.rect(m.x + m.w + 8, m.y, 160, m.h, 0.05, 0.05, 0.08, 0.9, 4)
aqua.draw.text(m.x + m.w + 16, m.y + 12, "side panel", 1, 1, 1, 1, { size = 12 })
end