Skip to content

@ue-too/board / index / Relay

類別: Relay

定義於: 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.

備註

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.

範例

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 }

參閱

實作

建構函式

建構函式

new Relay(): Relay

定義於: packages/board/src/camera/camera-mux/relay.ts:52

Creates a new stateless relay multiplexer.

回傳

Relay

方法

notifyPanInput()

notifyPanInput(diff): CameraMuxPanOutput

定義於: packages/board/src/camera/camera-mux/relay.ts:60

Processes pan input by always allowing it through unchanged.

參數

diff

Point

Pan displacement in viewport space

回傳

CameraMuxPanOutput

Output allowing passthrough with the original delta

實作了

CameraMux.notifyPanInput


notifyRotationInput()

notifyRotationInput(deltaRotation): CameraMuxRotationOutput

定義於: packages/board/src/camera/camera-mux/relay.ts:88

Processes rotation input by always allowing it through unchanged.

參數

deltaRotation

number

Change in rotation in radians

回傳

CameraMuxRotationOutput

Output allowing passthrough with the original delta

實作了

CameraMux.notifyRotationInput


notifyZoomInput()

notifyZoomInput(deltaZoomAmount, anchorPoint): CameraMuxZoomOutput

定義於: packages/board/src/camera/camera-mux/relay.ts:71

Processes zoom input by always allowing it through unchanged.

參數

deltaZoomAmount

number

Change in zoom level

anchorPoint

Point

Point to zoom towards in viewport coordinates

回傳

CameraMuxZoomOutput

Output allowing passthrough with the original parameters

實作了

CameraMux.notifyZoomInput