본문으로 건너뛰기

SnapControl

A Control that uses a release momentum to choose destination panel

Constructor

constructor(options?: Partial<SnapControlOptions>);

Constructs a new instance of the SnapControl class

Properties

count

Type: number

Maximum number of panels can go after release

Default: Infinity

Methods

moveToPosition

moveToPosition(position: number, duration: number, axesEvent?: OnRelease): Promise<void>

Move Camera to the given position

Parameters:

  • position (number) - The target position to move

  • duration (number) - Duration of the panel movement animation (unit: ms)

  • axesEvent (OnRelease) - release event of Axes

Returns: A Promise which will be resolved after reaching the target position

Remarks: This method calculates the snap target based on the release momentum and threshold settings.

Throws:

Fires: