/** * Multi-touch input source class. Attached to an element, it accumulates `touch` deltas for the * movement of the touch points, `count` deltas for changes in the number of touches, and `pinch` * deltas for the change in distance between two touches, which is what an orbiting camera needs * on a touch screen. */ export type MultiTouchSourceDeltas = { /** * - The touch deltas, represented as an array of [x, y] coordinates. */ touch: number[]; /** * - The count deltas, represented as an array of integers. */ count: number[]; /** * - The pinch deltas, represented as an array of integers. */ pinch: number[]; }; /** * Multi-touch input source class. Attached to an element, it accumulates `touch` deltas for the * movement of the touch points, `count` deltas for changes in the number of touches, and `pinch` * deltas for the change in distance between two touches, which is what an orbiting camera needs * on a touch screen. * * @category Input * @alpha * * @typedef {object} MultiTouchSourceDeltas * @property {number[]} touch - The touch deltas, represented as an array of [x, y] coordinates. * @property {number[]} count - The count deltas, represented as an array of integers. * @property {number[]} pinch - The pinch deltas, represented as an array of integers. * @augments {InputSource} */ export class MultiTouchSource extends InputSource { constructor(); /** * @type {ReturnType} * @private */ private _movementState; /** * @type {Map} * @private */ private _pointerEvents; /** @private */ private _pointerPos; /** @private */ private _pinchDist; /** * @param {PointerEvent} event - The pointer event. * @private */ private _onPointerDown; /** * @param {PointerEvent} event - The pointer event. * @private */ private _onPointerMove; /** * @param {PointerEvent} event - The pointer event. * @private */ private _onPointerUp; /** * @param {MouseEvent} event - The mouse event. * @private */ private _onContextMenu; /** * @param {Vec2} out - The output vector. * @returns {Vec2} The mid point. * @private */ private _getMidPoint; /** * @returns {number} The pinch distance. * @private */ private _getPinchDist; } import { InputSource } from '../input.js';