import type { Observer } from "../Misc/observable"; import { Observable } from "../Misc/observable"; import type { Nullable } from "../types"; import type { PointerInfo } from "../Events/pointerEvents"; import { Vector3 } from "../Maths/math.vector"; import { Color3 } from "../Maths/math.color"; import "../Meshes/Builders/linesBuilder"; import type { AbstractMesh } from "../Meshes/abstractMesh"; import { Mesh } from "../Meshes/mesh"; import type { Node } from "../node"; import { PointerDragBehavior } from "../Behaviors/Meshes/pointerDragBehavior"; import type { IGizmo } from "./gizmo"; import { Gizmo } from "./gizmo"; import { UtilityLayerRenderer } from "../Rendering/utilityLayerRenderer"; import { StandardMaterial } from "../Materials/standardMaterial"; import type { RotationGizmo } from "./rotationGizmo"; import { ShaderMaterial } from "../Materials/shaderMaterial"; /** * Interface for plane rotation gizmo */ export interface IPlaneRotationGizmo extends IGizmo { /** Drag behavior responsible for the gizmos dragging interactions */ dragBehavior: PointerDragBehavior; /** Drag distance in babylon units that the gizmo will snap to when dragged */ snapDistance: number; /** Sensitivity factor for dragging */ sensitivity: number; /** * Event that fires each time the gizmo snaps to a new location. * * snapDistance is the change in distance */ onSnapObservable: Observable<{ snapDistance: number; }>; /** Accumulated relative angle value for rotation on the axis. */ angle: number; /** If the gizmo is enabled */ isEnabled: boolean; /** Default material used to render when gizmo is not disabled or hovered */ coloredMaterial: StandardMaterial; /** Material used to render when gizmo is hovered with mouse */ hoverMaterial: StandardMaterial; /** Color used to render the drag angle sector when gizmo is rotated with mouse */ rotationColor: Color3; /** Material used to render when gizmo is disabled. typically grey. */ disableMaterial: StandardMaterial; } /** * Single plane rotation gizmo */ export declare class PlaneRotationGizmo extends Gizmo implements IPlaneRotationGizmo { /** * Drag behavior responsible for the gizmos dragging interactions */ dragBehavior: PointerDragBehavior; protected _pointerObserver: Nullable>; /** * Rotation distance in radians that the gizmo will snap to (Default: 0) */ snapDistance: number; /** * Event that fires each time the gizmo snaps to a new location. * * snapDistance is the change in distance */ onSnapObservable: Observable<{ snapDistance: number; }>; /** * The maximum angle between the camera and the rotation allowed for interaction * If a rotation plane appears 'flat', a lower value allows interaction. */ static MaxDragAngle: number; /** * Accumulated relative angle value for rotation on the axis. Reset to 0 when a dragStart occurs */ angle: number; /** * Custom sensitivity value for the drag strength */ sensitivity: number; /** Default material used to render when gizmo is not disabled or hovered */ get coloredMaterial(): StandardMaterial; /** Material used to render when gizmo is hovered with mouse */ get hoverMaterial(): StandardMaterial; /** Color used to render the drag angle sector when gizmo is rotated with mouse */ set rotationColor(color: Color3); /** Material used to render when gizmo is disabled. typically grey. */ get disableMaterial(): StandardMaterial; protected _isEnabled: boolean; protected _parent: Nullable; protected _coloredMaterial: StandardMaterial; protected _hoverMaterial: StandardMaterial; protected _disableMaterial: StandardMaterial; protected _gizmoMesh: Mesh; protected _rotationDisplayPlane: Mesh; protected _dragging: boolean; protected _angles: Vector3; protected static _RotationGizmoVertexShader: string; protected static _RotationGizmoFragmentShader: string; protected _rotationShaderMaterial: ShaderMaterial; /** * Creates a PlaneRotationGizmo * @param planeNormal The normal of the plane which the gizmo will be able to rotate on * @param color The color of the gizmo * @param gizmoLayer The utility layer the gizmo will be added to * @param tessellation Amount of tessellation to be used when creating rotation circles * @param parent * @param useEulerRotation Use and update Euler angle instead of quaternion * @param thickness display gizmo axis thickness * @param hoverColor The color of the gizmo when hovering over and dragging * @param disableColor The Color of the gizmo when its disabled */ constructor(planeNormal: Vector3, color?: Color3, gizmoLayer?: UtilityLayerRenderer, tessellation?: number, parent?: Nullable, useEulerRotation?: boolean, thickness?: number, hoverColor?: Color3, disableColor?: Color3); /** * @internal * Create Geometry for Gizmo * @param parentMesh * @param thickness * @param tessellation * @returns */ protected _createGizmoMesh(parentMesh: AbstractMesh, thickness: number, tessellation: number): { rotationMesh: Mesh; collider: Mesh; }; protected _attachedNodeChanged(value: Nullable): void; /** * If the gizmo is enabled */ set isEnabled(value: boolean); get isEnabled(): boolean; /** * Disposes of the gizmo */ dispose(): void; }