Screen Bounds
Safezone Perimeter ($S \in [0.8, 1.0]$)
UI Anchor Points (Minimap, HUD, Reticle)
Excluded Screen Margins
aesir-utils-rs is a zero-dependency Rust math library for scaling game interfaces and HUDs across 16:9, 21:9 ultrawide, 32:9 super-ultrawide, and bezel-corrected multi-monitor displays. It computes safe-zone anchor rectangles, aspect-ratio letterboxing, and DPI-aware coordinate transforms in sub-microsecond time.
$ cargo add aesir-utils-rs
Head-to-head performance comparing native pure Rust with zero heap allocations vs dynamic FiveM Lua coordinate math.
| Scenario / Workload | aesir-utils-rs (Rust) | FiveM Lua Script | Speedup / Impact | Memory Overhead |
|---|---|---|---|---|
| Safezone Bounds & Two-Way Safe NDC | 4.18 ns / eval | 150 – 450 ns | 48× – 108× faster | 0 bytes (Registers) |
| Aspect Ratio Category & Viewport Fit | 6.88 ns / eval | 180 – 500 ns | 29× – 73× faster | 0 bytes (Stack) |
| 9-Way Anchor Inward Placement | 3.19 ns / eval | 250 – 800 ns | 94× – 251× faster | 0 bytes (LUT) |
| Virtual 1080p Canvas (100 HUD Elements) | 0.118 µs / frame | 15 – 45 µs | 169× – 380× faster | 0 bytes (Zero GC) |
cargo run --release --example bench_vs_original