@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
53 lines (52 loc) • 2.31 kB
TypeScript
import { Object3D } from 'three';
import { Constructor, ConvertToStrings } from '../../../../../types/GlobalTypes';
import { BaseRayObjectIntersectionsController } from './_BaseRayObjectIntersectionsController';
import { ObjectOptions, GPUOptions, CPUOptions, PriorityOptions, ButtonAndModifierOptions, ButtonAndModifierOptionsAsString } from './Common';
interface SwipeOptions {
angle: number;
angleMargin: number;
minDistance: number;
callback: () => void;
}
export interface ObjectToSwipeOptions extends ObjectOptions {
swipe: SwipeOptions;
config: ButtonAndModifierOptions;
}
export interface ObjectToSwipeOptionsAsString {
priority: ConvertToStrings<PriorityOptions>;
cpu?: ConvertToStrings<CPUOptions>;
gpu?: ConvertToStrings<GPUOptions>;
swipe: ConvertToStrings<SwipeOptions>;
config: ButtonAndModifierOptionsAsString;
}
export declare const ANGLE_DEGREES: {
LEFT: number;
RIGHT: number;
UP: number;
DOWN: number;
};
export declare function SwipeParamConfig<TBase extends Constructor>(Base: TBase): {
new (...args: any[]): {
/** @param angle */
angle: import("../../../../nodes/utils/params/ParamsConfig").ParamTemplate<import("../../../../index_all").ParamType.FLOAT>;
/** @param angle margin */
angleMargin: import("../../../../nodes/utils/params/ParamsConfig").ParamTemplate<import("../../../../index_all").ParamType.FLOAT>;
/** @param min distance */
minDistance: import("../../../../nodes/utils/params/ParamsConfig").ParamTemplate<import("../../../../index_all").ParamType.FLOAT>;
};
} & TBase;
export declare class RayObjectIntersectionsSwipeController extends BaseRayObjectIntersectionsController {
protected _propertiesListByObject: Map<Object3D, ObjectToSwipeOptions[]>;
protected _intersectedStateOnPointerdownByObject: Map<Object3D, boolean>;
protected _intersectedStateOnPointerupByObject: Map<Object3D, boolean>;
private _objectsMatchingEventConfig;
private _objectsIntersectedOnPointerdown;
private _cursorOnPointerdown;
private _cursorOnPointerup;
private _pointerdownEvent;
private _bound;
onPointerdown(event: Readonly<PointerEvent | MouseEvent | TouchEvent>): void;
private _onPointerup;
private _getCursor;
}
export {};