Skip to content

@ue-too/board / createCameraMuxWithAnimationAndLock

Function: createCameraMuxWithAnimationAndLock()

createCameraMuxWithAnimationAndLock(): CameraMux

Defined in: packages/board/src/camera/camera-mux/animation-and-lock/animation-and-lock.ts:431

Creates a camera mux with animation and locking capabilities from a camera instance.

Returns

CameraMux

Configured camera mux with animation support

Remarks

This factory function creates a complete camera input flow control system with:

  1. A default CameraRig wrapping the provided camera
  2. Three state machines (pan, zoom, rotation) for animation control
  3. A CameraMuxWithAnimationAndLock coordinating the state machines

What you get:

  • Smooth camera animations (pan-to, zoom-to, rotate-to)
  • Automatic input blocking during animations
  • State-based input arbitration
  • All with sensible default configurations

Use this when:

  • You have a camera and want animation support out-of-the-box
  • You don't need custom camera rig configuration
  • You want the simplest setup for animated camera control

Example

typescript
const camera = new DefaultBoardCamera(1920, 1080);
const mux = createCameraMuxWithAnimationAndLock(camera);

// Start a pan animation
mux.notifyPanToAnimationInput({ x: 1000, y: 500 });

// User input is blocked during animation
const result = mux.notifyPanInput({ x: 50, y: 30 });
console.log(result.allowPassThrough); // false during animation

See