SwarmCam
The chase camera, running as the behaviour on the player rig's `Camera`.
SwarmCam
The chase camera, running as the behaviour on the player rig's Camera.
Its job is one sentence: the cloud stays readable, whatever it is doing.
That is harder than a trailing offset, because the thing being framed changes size over the round. A swarm at full mass is nearly four times the radius it started at, and a fixed distance either loses the far half of it or turns it into a speck. So the rig is placed from the cloud's radius, not from a constant — it backs off as the swarm grows, and the cloud keeps roughly the same share of the frame from the first minute to the last.
The rest is what makes flying read as flying.
- Down in the crop it drops and closes in, so the ground rushes past underneath instead of crawling. Feeding altitude is the one place the ground is near enough to show how fast you are going.
- It rides above the flight path in a dive and below it in a climb, so a dive looks down into the field you are falling into and a climb looks out at sky.
- It rolls a share of the swarm's bank, so a hard turn tilts the world.
- It widens its lens and shakes flat out, and settles when you throttle back.
- It never drops below
CAM_MIN_Y, so hugging the crop cannot put the camera underground. - A jump of more than 400 m snaps instead of sweeping — a respawn or a scene reload should not cost a second of looking at nothing.
It reads Locust.state.swarm and nothing else, so it frames correctly before
the rest of the game exists, and falls back to the mass curve for the radius
if the rules slice has not written one yet. It writes only this camera
entity's transform and its fov.
Tune it live from the inspector: distance, height, lookAhead,
smoothing and shake are all public, and the rest of the shape is in
Locust.C under the camera block.
Scoped to this part · feeds back into the world's score.