Skip to content

makeCameraRigSystem

makeCameraRigSystem<TCtx>(options): SchedulableSystem<TCtx>

Defined in: src/modules/camera-3d/rigs.ts:256

Returns a system that, each tick, poses every cameraTag-tagged entity from its rig — writing its Position3D and Rotation3D — relative to the first targetTag-tagged entity. Only the rig components a world registers are looked up, so a world registers just the rigs it uses.

  • FirstPersonRig: at the target plus eyeHeight, rotated by yaw / pitch.
  • OrbitRig: around the target (see orbitPose), always looking at it.
  • ChaseRig: in the target’s frame (see chasePose); reads the target’s Rotation3D, treating a missing one as unrotated.

Smoothing needs ctx.dtMs; without it the rigs snap. Pitch and distance are clamped to the rig’s limits when posing, without writing them back. With no target the tick is a no-op. A camera carrying more than one rig throws — which rig wins would otherwise depend on lookup order.

TCtx extends CameraRigTickCtx

CameraRigOptions

SchedulableSystem<TCtx>