Interface IRotationGizmo
_rootMesh: Mesh;
additionalTransformNode?: TransformNode;
anchorPoint: GizmoAnchorPoint;
attachedMesh: Nullable<AbstractMesh>;
attachedNode: Nullable<Node>;
coordinatesMode: GizmoCoordinatesMode;
customRotationQuaternion: Nullable<Quaternion>;
gizmoLayer: UtilityLayerRenderer;
isDragging: boolean;
isHovered: boolean;
onDragEndObservable: Observable<DragStartEndEvent>;
onDragObservable: Observable<DragEvent>;
onDragStartObservable: Observable<DragStartEndEvent>;
scaleRatio: number;
sensitivity: number;
snapDistance: number;
updateGizmoPositionToMatchAttachedMesh: boolean;
updateGizmoRotationToMatchAttachedMesh: boolean;
updateScale: boolean;
xGizmo: IPlaneRotationGizmo;
yGizmo: IPlaneRotationGizmo;
zGizmo: IPlaneRotationGizmo;
addToAxisCache(mesh: Mesh, cache: GizmoAxisCache): void;
dispose(): void;
releaseDrag(): void;
setCustomMesh(mesh: Mesh): void;
}
Hierarchy (View Summary)
- IGizmo
- IRotationGizmo
Implemented by
Index
Properties
Methods
Properties
_ root Mesh
The root mesh of the gizmo
Optionaladditional Transform Node
Additional transform applied to the gizmo. It's useful when the gizmo is attached to a bone: if the bone is part of a skeleton attached to a mesh, you should define the mesh as additionalTransformNode if you want the gizmo to be displayed at the bone's correct location. Otherwise, as the gizmo is relative to the skeleton root, the mesh transformation will not be taken into account.
anchor Point
Defines where the gizmo will be positioned if updateGizmoPositionToMatchAttachedMesh is enabled.
(Default: GizmoAnchorPoint.Origin)
attached Mesh
Mesh that the gizmo will be attached to. (eg. on a drag gizmo the mesh that will be dragged)
- When set, interactions will be enabled
attached Node
Node that the gizmo will be attached to. (eg. on a drag gizmo the mesh, bone or NodeTransform that will be dragged)
- When set, interactions will be enabled
coordinates Mode
Set the coordinate mode to use. By default it's local.
custom Rotation Quaternion
Orientation that the gizmo will be displayed with. When set null, default value will be used (Quaternion(0, 0, 0, 1))
gizmo Layer
The utility layer the gizmo will be added to
Readonlyis Dragging
True when the mouse pointer is dragging a gizmo mesh
Readonlyis Hovered
True when the mouse pointer is hovered a gizmo mesh
on Drag End Observable
Fires an event when any of it's sub gizmos are released from dragging
on Drag Observable
Fires an event when any of it's sub gizmos are being dragged
on Drag Start Observable
Fires an event when any of it's sub gizmos are dragged
scale Ratio
Ratio for the scale of the gizmo
sensitivity
Custom sensitivity value for the drag strength
snap Distance
Drag distance in babylon units that the gizmo will snap to when dragged
update Gizmo Position To Match Attached Mesh
If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
update Gizmo Rotation To Match Attached Mesh
If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
update Scale
When set, the gizmo will always appear the same size no matter where the camera is (default: true)
x Gizmo
Internal gizmo used for interactions on the x axis
y Gizmo
Internal gizmo used for interactions on the y axis
z Gizmo
Internal gizmo used for interactions on the z axis
Methods
add To Axis Cache
-
Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation
Parameters
- mesh: Mesh
Axis gizmo mesh
- cache: GizmoAxisCache
Gizmo axis definition used for reactive gizmo UI
Returns void
- mesh: Mesh
dispose
-
Releases all held resources
Returns void
release Drag
-
Force release the drag action by code
Returns void
set Custom Mesh
-
Disposes and replaces the current meshes in the gizmo with the specified mesh
Parameters
- mesh: Mesh
The mesh to replace the default mesh of the gizmo
Returns void
- mesh: Mesh
Interface for rotation gizmo