/** * The base class of gizmos dragged to edit values: {@link TransformGizmo}s and * {@link HandleGizmo}s. With {@link DragGizmo#snap} on, lengths snap to * {@link DragGizmo#snapIncrement} and angles to {@link DragGizmo#snapAngleIncrement}. * * @category Gizmo */ export class DragGizmo extends Gizmo { /** * Whether dragging snaps to the increments. Defaults to false. * * @type {boolean} */ snap: boolean; /** * The increment angles snap to, in degrees. Defaults to 5. * * @type {number} */ snapAngleIncrement: number; /** * The increment lengths snap to. * * @private */ private _snapIncrement; /** * Sets the increment lengths and {@link ScaleGizmo} factors snap to. Defaults to 1. * * @type {number} */ set snapIncrement(value: number); /** * Gets the increment lengths and {@link ScaleGizmo} factors snap to. * * @type {number} */ get snapIncrement(): number; /** * Rounds a value to a multiple of an increment while snapping. * * @param {number} value - The value. * @param {number} increment - The increment. * @returns {number} The value, snapped while {@link DragGizmo#snap} is on. * @protected */ protected _snapValue(value: number, increment: number): number; /** * Rounds each component of a vector to a multiple of an increment while snapping. * * @param {Vec3} vec - The vector, snapped in place. * @param {number} increment - The increment. * @returns {Vec3} The vector. * @protected */ protected _snapVector(vec: Vec3, increment: number): Vec3; /** * Rounds a length to a multiple of {@link DragGizmo#snapIncrement} while snapping, at least one * increment so a size never snaps to zero. * * @param {number} value - The length. * @returns {number} The length, snapped while {@link DragGizmo#snap} is on. * @protected */ protected _snapLength(value: number): number; /** * Rounds an angle to a multiple of {@link DragGizmo#snapAngleIncrement} while snapping. * * @param {number} value - The angle in degrees. * @returns {number} The angle, snapped while {@link DragGizmo#snap} is on. * @protected */ protected _snapAngle(value: number): number; /** * Gets the normal of the plane through a line that best faces the camera, for dragging along * the line. * * @param {Vec3} dir - The unit direction of the line. * @param {Vec3} facing - The unit direction towards the camera. * @param {Vec3} out - Receives the unit normal. * @returns {boolean} False when the line points at the camera. * @protected */ protected _lineNormal(dir: Vec3, facing: Vec3, out: Vec3): boolean; /** * Formats a readout label in its color. * * @param {string} text - The label. * @param {Color} color - The label color. * @returns {string} The label markup. * @protected */ protected _labelMarkup(text: string, color: Color): string; } import { Gizmo } from './gizmo.js'; import { Vec3 } from '../../core/math/vec3.js'; import type { Color } from '../../core/math/color.js';