playcanvas
Version:
PlayCanvas WebGL game engine
177 lines (176 loc) • 3.94 kB
TypeScript
/**
* Rotation gizmo.
*
* @category Gizmo
*/
export class RotateGizmo extends TransformGizmo {
_shapes: {
z: ArcShape;
x: ArcShape;
y: ArcShape;
face: ArcShape;
};
/**
* Internal mapping from each attached node to their starting rotation in local space.
*
* @type {Map<GraphNode, Quat>}
* @private
*/
private _nodeLocalRotations;
/**
* Internal mapping from each attached node to their starting rotation in world space.
*
* @type {Map<GraphNode, Quat>}
* @private
*/
private _nodeRotations;
/**
* Internal mapping from each attached node to their offset position from the gizmo.
*
* @type {Map<GraphNode, Vec3>}
* @private
*/
private _nodeOffsets;
/**
* Internal color for guide angle starting line.
*
* @type {Color}
* @private
*/
private _guideAngleStartColor;
/**
* Internal vector for the start point of the guide line angle.
*
* @type {Vec3}
* @private
*/
private _guideAngleStart;
/**
* Internal vector for the end point of the guide line angle.
*
* @type {Vec3}
* @private
*/
private _guideAngleEnd;
/**
* Sets the XYZ tube radius.
*
* @type {number}
*/
set xyzTubeRadius(value: number);
/**
* Gets the XYZ tube radius.
*
* @type {number}
*/
get xyzTubeRadius(): number;
/**
* Sets the XYZ ring radius.
*
* @type {number}
*/
set xyzRingRadius(value: number);
/**
* Gets the XYZ ring radius.
*
* @type {number}
*/
get xyzRingRadius(): number;
/**
* Sets the face tube radius.
*
* @type {number}
*/
set faceTubeRadius(value: number);
/**
* Gets the face tube radius.
*
* @type {number}
*/
get faceTubeRadius(): number;
/**
* Sets the face ring radius.
*
* @type {number}
*/
set faceRingRadius(value: number);
/**
* Gets the face ring radius.
*
* @type {number}
*/
get faceRingRadius(): number;
/**
* Sets the ring tolerance.
*
* @type {number}
*/
set ringTolerance(value: number);
/**
* Gets the ring tolerance.
*
* @type {number}
*/
get ringTolerance(): number;
/**
* @param {string} prop - The property.
* @param {any} value - The value.
* @private
*/
private _setDiskProp;
/**
* @private
*/
private _storeGuidePoints;
/**
* @param {number} angleDelta - The angle delta.
* @private
*/
private _updateGuidePoints;
/**
* @param {Vec3} pos - The position.
* @param {string} axis - The axis.
* @param {Vec3} point - The point.
* @param {Color} [color] - The color.
* @private
*/
private _drawGuideAngleLine;
/**
* @param {Vec3} position - The position.
* @returns {Vec3} The look at euler angles.
* @private
*/
private _getLookAtEulerAngles;
/**
* @private
*/
private _shapesLookAtCamera;
/**
* @param {boolean} state - The state.
* @private
*/
private _drag;
/**
* @private
*/
private _storeNodeRotations;
/**
* @param {string} axis - The axis.
* @param {number} angleDelta - The angle delta.
* @private
*/
private _setNodeRotations;
/**
* @param {number} x - The x coordinate.
* @param {number} y - The y coordinate.
* @returns {{ point: Vec3, angle: number }} The point and angle.
* @protected
*/
protected _screenToPoint(x: number, y: number): {
point: Vec3;
angle: number;
};
}
import { TransformGizmo } from './transform-gizmo.js';
import { ArcShape } from './shape/arc-shape.js';
import { Vec3 } from '../../core/math/vec3.js';