Allow explicit world axes for widescreen visibility cones

(cherry picked from commit 2c6e0a3a20)
This commit is contained in:
Matthew Stanley
2026-10-08 21:02:03 -07:00
parent 42ddce61b5
commit 4fca2d27d8
9 changed files with 86 additions and 12 deletions
+12 -5
View File
@@ -330,12 +330,13 @@ A model-list or per-child cosine rejection can use a horizontal-only envelope:
```toml
[widescreen.cull.aspect_cone]
forward_addr = "0x1F8000E8" # signed Q12 X/Z/Y halfwords
forward_addr = "0x1F8000E8" # three signed Q12 halfwords
forward_offsets = [0, 4, 2] # byte offsets for X/Z/Y; this title stores X/Y/Z
object_type_offset = 12
object_reg = 19
x_reg = 16
z_reg = 17
y_reg = 18
z_reg = 18
y_reg = 17
hysteresis_pixels = 24
queue_reserve = 4
queue_count_addrs = ["0x1F800144", "0x1F800150", "0x1F80015C"]
@@ -352,8 +353,8 @@ expected = "0x0082202A" # signed SLT reject predicate
cosine_threshold = 856 # required for SLT; Q10
object_reg = 20 # optional per-site register overrides
x_reg = 19
z_reg = 18
y_reg = 17
z_reg = 17
y_reg = 18
queue_guard = false # this lower-level predicate appends to no fixed queue
```
@@ -362,6 +363,12 @@ queue_guard = false # this lower-level predicate appends to no fixed queue
- An `SLTI` site derives its Q10 cosine threshold from the immediate unless
`cosine_threshold` is given. An `SLT` site requires it explicitly.
- A vanilla keep is always preserved. Only a vanilla rejection is retested.
- `x_reg`/`z_reg` describe the world ground plane; `y_reg` is world vertical.
`forward_offsets` maps the corresponding X/Z/Y forward components from the
three halfwords at `forward_addr`. It must be a permutation of `[0, 2, 4]`.
Omitting it preserves the legacy `[0, 2, 4]` order. Match both register and
forward mappings to the actual camera basis; the title's coordinate names
alone are not sufficient evidence.
- Horizontal reach follows the current client aspect. Vertical reach,
near/far checks, type dispatch, and the game’s queue-capacity branches are
unchanged.