Skip to content

@ue-too/board / index / Relay

Class: Relay ​

Defined in: packages/board/src/camera/camera-mux/relay.ts:48

Stateless camera input multiplexer that always allows inputs to pass through. This is the simplest CameraMux implementation with no filtering or state management.

Remarks ​

The Relay class provides a "transparent" mux that:

  • Never blocks inputs
  • Passes all inputs unchanged
  • Has no internal state
  • Acts as a simple conduit between input sources and camera control

Use this when you want:

  • Direct, unfiltered camera control
  • No animation system or input blocking
  • Maximum simplicity with minimal overhead

For more advanced use cases (animations, input blocking, state management), implement a custom CameraMux or use a stateful implementation.

Example ​

typescript
const relay = new Relay();

// All inputs pass through unchanged
const panResult = relay.notifyPanInput({ x: 10, y: 5 });
// panResult = { allowPassThrough: true, delta: { x: 10, y: 5 } }

const zoomResult = relay.notifyZoomInput(0.5, { x: 100, y: 200 });
// zoomResult = { allowPassThrough: true, delta: 0.5, anchorPoint: { x: 100, y: 200 } }

const rotateResult = relay.notifyRotationInput(0.1);
// rotateResult = { allowPassThrough: true, delta: 0.1 }

See ​

Implements ​

Constructors ​

Constructor ​

new Relay(): Relay

Defined in: packages/board/src/camera/camera-mux/relay.ts:52

Creates a new stateless relay multiplexer.

Returns ​

Relay

Methods ​

notifyPanInput() ​

notifyPanInput(diff): CameraMuxPanOutput

Defined in: packages/board/src/camera/camera-mux/relay.ts:60

Processes pan input by always allowing it through unchanged.

Parameters ​

diff ​

Point

Pan displacement in viewport space

Returns ​

CameraMuxPanOutput

Output allowing passthrough with the original delta

Implementation of ​

CameraMux.notifyPanInput


notifyRotationInput() ​

notifyRotationInput(deltaRotation): CameraMuxRotationOutput

Defined in: packages/board/src/camera/camera-mux/relay.ts:88

Processes rotation input by always allowing it through unchanged.

Parameters ​

deltaRotation ​

number

Change in rotation in radians

Returns ​

CameraMuxRotationOutput

Output allowing passthrough with the original delta

Implementation of ​

CameraMux.notifyRotationInput


notifyZoomInput() ​

notifyZoomInput(deltaZoomAmount, anchorPoint): CameraMuxZoomOutput

Defined in: packages/board/src/camera/camera-mux/relay.ts:71

Processes zoom input by always allowing it through unchanged.

Parameters ​

deltaZoomAmount ​

number

Change in zoom level

anchorPoint ​

Point

Point to zoom towards in viewport coordinates

Returns ​

CameraMuxZoomOutput

Output allowing passthrough with the original parameters

Implementation of ​

CameraMux.notifyZoomInput