CrowCamera
The camera of the climb, and the lens every staged moment is shot through. It sits on the PlayerPrototype's `CameraRig` beside the `Camera` component, so every joining player gets one of their own.
CrowCamera
The camera of the climb, and the lens every staged moment is shot through. It
sits on the PlayerPrototype's CameraRig beside the Camera component, so
every joining player gets one of their own.
The frame
Perspective, standing off the cliff face (the plane z = 0) at distance,
looking at a point on that plane. The vertical field of view is what is
fixed, so the same world height shows on every screen and a wide screen simply
sees more cliff to either side. Nothing here is a number chosen for
1080x1440.
Whatever else happens, the crow is in frame: after the follow, the landing
spring and the shake have all had their say, a last clamp holds the crow inside
keepIn of the LIVE frame's own half-extents, measured from the lens and the
live aspect. That clamp is what makes one set of numbers hold at 3:4 and at
21:9. Measured over 186 follow frames of keyboard play: lost = 0, worst
offset exactly 0.56 of the half-frame in both axes — the clamp, doing its job.
The follow
- Lead up, because the climb goes up, and harder while the crow is rising
(
leadYplus a term in the crow's own vertical speed). - Deadzone in both axes (
deadX,deadY), so a sidle does not swim the frame. - Asymmetric tracking —
tauUpchases a rising crow harder thantauDownlets it fall away. - Landing weight — the frame drops with the crow on a landing and springs back, scaled by the landing's hardness.
- Kicks on a hard landing, a crumble, a fall and the weak state.
- Only a share of the crow's x (
followX), because there is little width to give away on a portrait screen; the clamp above is what stops that share from ever losing the bird. - While the crow hangs, the lead drops so the lip its feet are on is in shot.
The staged shot — CF.camera
Filled in when the component wakes, and re-filled whenever game.CF reloads:
| Call | What it does |
|---|---|
panTo(x, y, seconds, ease) | where the camera stands |
aimTo(x, y, seconds, ease) | where it LOOKS — the tilt a crane needs |
dollyTo(distance, seconds, ease) | in or out from the face |
zoomTo(fov, seconds, ease) | the lens |
snapTo(x, y, distance, fov) | a cut, declared to the renderer with camera.cut() |
release(seconds) | hand the shot back to the crow; the aim eases home |
kick(amount) · weight(amount) | shake, and the weight of a landing |
isPanning() · held() · pose() | what the shot is doing |
frameHalf() · aspect() | the live frame's half-extents and shape |
bars(frac, seconds) · veil(r, g, b, a, seconds) · clearFrame(seconds) | the staged frame (see game.stage.Cinema) |
Eases: linear, inOutQuad, inOutSine, inOutCubic, outCubic, inCubic.
Public fields
distance · leadY · followX · tauX · tauUp · tauDown · deadX ·
deadY · fov · keepIn.
One thing to know
game.CF belongs to the climb slice, and every edit of it hands back a NEW
module table with an empty event bus and no CF.camera on it. So this
component re-reads it every frame and puts its listeners and its camera hooks
back on whatever table the rest of the game is talking to.
Owned by the staging slice. Design: /zero/source/design/spec.md.
Scoped to this part · feeds back into the world's score.