game.laser.pointer
The thing in the keeper's hand.
A small anodised pointer built from primitives and hung off the local player's own camera rig, so it rides the view with no frame of lag: a knurled grip, a lacquered barrel, two brass collars, a pocket clip, a brass thumb button and a lens that lights when the beam is on.
local Pointer = require("game.laser.pointer")
Pointer.ensure(cameraRig)
Pointer.update(dt, { firing = true, heat = 0.4, moving = 0.8, lookDx = dy })
Pointer.muzzle() -- the world point the beam leaves from
Pointer.ids() -- what a raycast from the eye must step over
Pointer.destroy()
Where it sits
It is placed from the LIVE viewport every frame: a fixed share of the half
width and half height the rig's own field of view covers at the model's distance
, so it holds the same corner of a 3:4 phone frame and of a 21:9 monitor rather
than sitting at numbers picked for one of them. The share is FRAC_X / FRAC_Y,
and the offset in metres is what changes with the shape of the screen.
The lens is read from the RIG, not from the viewport camera: in an editor session the viewport is the fly camera, whose field of view is not the keeper's.
How it moves
A kick when the trigger closes, the hand lagging a little behind the look and settling, a bob that grows with how hard the keeper is walking, a shiver that comes on with the heat, and a sag when the pointer cuts out. The lens writes its own emissive intensity, and only when the value actually moves.
Scoped to this part · feeds back into the world's score.