update all battle locations

This commit is contained in:
DramaticShape
2026-08-05 20:36:46 -04:00
parent 77e0f93315
commit 6240b50cec
9 changed files with 2260 additions and 75 deletions
+21 -2
View File
@@ -431,7 +431,22 @@ function BattleCam.rig(arena, groundY, canonical)
-- arena's own axis, and the room the player has is all on the far side of
-- that -- out toward square-on. (orbitRange measures exactly that room.)
local steer = steered and -BattleCam.orbit * BattleCam.orbitRange(arena) or 0
local yaw = steer + (fixed and 0
-- ------- and the quarter turn the arena itself is standing at
--
-- An arena may be laid down any of the four ways (BattleArena's `turn`),
-- and the rig is solved for ONE of them: eye off the player's shoulder,
-- back down an axis that runs north-south. So the whole offset is turned
-- with the ground under it, which leaves the camera in exactly the same
-- place RELATIVE to the two mons -- same distance, same height, same
-- angle -- and therefore lands them on the same two screen anchors at the
-- same size. A turn is a fact about the map, never about the shot.
--
-- It goes in with the drift and the steer rather than beside them because
-- it is the same rotation about the same point; the player's own orbit is
-- then measured from wherever the arena starts, so both stops travel with
-- it and side-on stays side-on.
local base = math.rad(arena.turn or 0)
local yaw = base + steer + (fixed and 0
or BattleCam.PAN_YAW * phase(BattleCam.t, BattleCam.PAN_PERIOD))
local c, s = math.cos(yaw), math.sin(yaw)
-- the breath scales the whole offset, height included, so the eye moves
@@ -443,7 +458,11 @@ function BattleCam.rig(arena, groundY, canonical)
local dz = (R.side * s + R.back * c) * k
local eye = { mx + dx, groundY + R.height * k, mz + dz }
local focus = { mx + R.lookX, groundY + R.lookY, mz }
-- the aim's own offset turns with the arena too, and with the BASE alone --
-- the drift and the steer swing the eye about the focus, so a focus that
-- followed them would take the thing being orbited around with it
local bc, bs = math.cos(base), math.sin(base)
local focus = { mx + R.lookX * bc, groundY + R.lookY, mz + R.lookX * bs }
-- and the climb: the eye swung UP about the focus, at a constant radius.
-- About the focus so the aim stays nailed to the two mons and only the