@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.
範例
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 }參閱
- CameraMux for the interface specification
- createDefaultCameraMux for a factory function
實作
建構函式
建構函式
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
回傳
Output allowing passthrough with the original delta
實作了
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
回傳
Output allowing passthrough with the original delta
實作了
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
回傳
Output allowing passthrough with the original parameters