UNPKG

spatial-controls

Version:

Configurable 3D movement controls.

153 lines (152 loc) 3.62 kB
import { EventDispatcher, Vector3 } from "three"; import { SettingsEventMap } from "./SettingsEventMap.js"; /** * Rotation settings. * * @group Settings */ export declare class RotationSettings extends EventDispatcher<SettingsEventMap> { /** * Triggers when the settings are changed. * * @event */ static readonly EVENT_CHANGE = "change"; /** * @see {@link enabled} */ private _enabled; /** * @see {@link up} */ private _up; /** * @see {@link pivotOffset} */ private _pivotOffset; /** * @see {@link minAzimuthalAngle} */ private _minAzimuthalAngle; /** * @see {@link maxAzimuthalAngle} */ private _maxAzimuthalAngle; /** * @see {@link minPolarAngle} */ private _minPolarAngle; /** * @see {@link maxPolarAngle} */ private _maxPolarAngle; /** * @see {@link invertedX} */ private _invertedX; /** * @see {@link invertedY} */ private _invertedY; /** * @see {@link sensitivityX} */ private _sensitivityX; /** * @see {@link sensitivityY} */ private _sensitivityY; /** * @see {@link damping} */ private _damping; /** * Constructs new rotation settings. */ constructor(); /** * Indicates whether rotation is enabled. */ get enabled(): boolean; set enabled(value: boolean); /** * A normalized up vector. */ get up(): Vector3; set up(value: Vector3); /** * The pivot offset. */ get pivotOffset(): Vector3; set pivotOffset(value: Vector3); /** * The minimum azimuthal angle in radians. Range: [-Math.PI, Math.PI]. */ get minAzimuthalAngle(): number; set minAzimuthalAngle(value: number); /** * The maximum azimuthal angle in radians. Range: [-Math.PI, Math.PI]. */ get maxAzimuthalAngle(): number; set maxAzimuthalAngle(value: number); /** * The minimum polar angle in radians. Range: [0, Math.PI]. */ get minPolarAngle(): number; set minPolarAngle(value: number); /** * The maximum polar angle in radians. Range: [0, Math.PI]. */ get maxPolarAngle(): number; set maxPolarAngle(value: number); /** * Indicates whether the horizontal rotation is inverted. */ get invertedX(): boolean; set invertedX(value: boolean); /** * Indicates whether the vertical rotation is inverted. */ get invertedY(): boolean; set invertedY(value: boolean); /** * The horizontal rotation sensitivity. */ get sensitivityX(): number; set sensitivityX(value: number); /** * The vertical rotation sensitivity. */ get sensitivityY(): number; set sensitivityY(value: number); /** * Sets the horizontal and vertical rotation sensitivity. */ set sensitivity(value: number); /** * The damping factor. */ get damping(): number; set damping(value: number); /** * Copies the given rotation settings. * * @param settings - Rotation settings. * @return This instance. */ copy(settings: RotationSettings): RotationSettings; /** * Clones this rotation settings instance. * * @return The cloned rotation settings. */ clone(): RotationSettings; /** * Copies the given JSON data. * * @param json - The JSON data. * @return This instance. */ fromJSON(json: RotationSettings): RotationSettings; toJSON(): Record<string, unknown>; }