Interface IBoundingBoxGizmo
_rootMesh: Mesh;
additionalTransformNode?: TransformNode;
anchorPoint: GizmoAnchorPoint;
attachedMesh: Nullable<AbstractMesh>;
attachedNode: Nullable<Node>;
axisFactor: Vector3;
coloredMaterial: StandardMaterial;
coordinatesMode: GizmoCoordinatesMode;
customRotationQuaternion: Nullable<Quaternion>;
fixedDragMeshBoundsSize: boolean;
fixedDragMeshScreenSize: boolean;
fixedDragMeshScreenSizeDistanceFactor: number;
gizmoLayer: UtilityLayerRenderer;
hoverMaterial: StandardMaterial;
ignoreChildren: boolean;
includeChildPredicate: Nullable<(abstractMesh: AbstractMesh) => boolean>;
isDragging: boolean;
isHovered: boolean;
onDragStartObservable: Observable<
{ dragAxis: Vector3; dragOperation: DragOperation },
>;
onHoverEndObservable: Observable<void>;
onHoverStartObservable: Observable<void>;
onRotationSphereDragEndObservable: Observable<
{ dragAxis: Vector3; dragOperation: DragOperation },
>;
onRotationSphereDragObservable: Observable<
{ dragAxis: Vector3; dragOperation: DragOperation },
>;
onScaleBoxDragEndObservable: Observable<
{ dragAxis: Vector3; dragOperation: DragOperation },
>;
onScaleBoxDragObservable: Observable<
{ dragAxis: Vector3; dragOperation: DragOperation },
>;
rotationSnapDistance: number;
rotationSphereSize: number;
scaleBoxSize: number;
scaleDragSpeed: number;
scalePivot: Nullable<Vector3>;
scaleRatio: number;
scalingSnapDistance: number;
updateGizmoPositionToMatchAttachedMesh: boolean;
updateGizmoRotationToMatchAttachedMesh: boolean;
updateScale: boolean;
dispose(): void;
enableDragBehavior(): void;
getScaleBoxes(): AbstractMesh[];
releaseDrag(): void;
setColor(color: Color3): void;
setCustomMesh(mesh: Mesh): void;
setEnabledRotationAxis(axis: string): void;
setEnabledScaling(enable: boolean, homogeneousScaling?: boolean): void;
updateBoundingBox(): void;
}
Hierarchy (View Summary)
- IGizmo
- IBoundingBoxGizmo
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
axis Factor
Scale factor vector used for masking some axis
colored Material
Default material used to render when gizmo is not disabled or hovered
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))
fixed Drag Mesh Bounds Size
If set, the rotation anchors and scale boxes will increase in size based on the size of the bounding box Note : fixedDragMeshScreenSize takes precedence over fixedDragMeshBoundsSize if both are true
fixed Drag Mesh Screen Size
If set, the rotation anchors and scale boxes will increase in size based on the distance away from the camera to have a consistent screen size Note : fixedDragMeshScreenSize takes precedence over fixedDragMeshBoundsSize if both are true
fixed Drag Mesh Screen Size Distance Factor
The distance away from the object which the draggable meshes should appear world sized when fixedDragMeshScreenSize is set to true
gizmo Layer
The utility layer the gizmo will be added to
hover Material
Material used to render when gizmo is hovered with mouse
ignore Children
If child meshes should be ignored when calculating the bounding box. This should be set to true to avoid perf hits with heavily nested meshes.
include Child Predicate
Returns true if a descendant should be included when computing the bounding box. When null, all descendants are included. If ignoreChildren is set this will be ignored.
Readonlyis Dragging
True when a rotation anchor or scale box or a attached mesh is dragged
Readonlyis Hovered
True when the mouse pointer is hovered a gizmo mesh
on Drag Start Observable
Fired when a rotation anchor or scale box is dragged
on Hover End Observable
Fired when the gizmo mesh hovering ends
on Hover Start Observable
Fired when the gizmo mesh hovering starts
on Rotation Sphere Drag End Observable
{ dragAxis: Vector3; dragOperation: DragOperation },
>
Fired when a rotation anchor drag is ended
on Rotation Sphere Drag Observable
Fired when a rotation anchor is dragged
on Scale Box Drag End Observable
Fired when a scale box drag is ended
on Scale Box Drag Observable
Fired when a scale box is dragged
rotation Snap Distance
Drag distance in babylon units that the gizmo will snap rotation to when dragged
rotation Sphere Size
The size of the rotation anchors attached to the bounding box
scale Box Size
The size of the scale boxes attached to the bounding box
scale Drag Speed
Scale factor scalar affecting all axes' drag speed
scale Pivot
Relative bounding box pivot used when scaling the attached node.
scale Ratio
Ratio for the scale of the gizmo
scaling Snap Distance
Drag distance in babylon units that the gizmo will snap scaling 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)
Methods
dispose
-
Releases all held resources
Returns void
enable Drag Behavior
-
Enables a pointer drag behavior on the bounding box of the gizmo
Returns void
get Scale Boxes
-
Returns an array containing all boxes used for scaling (in increasing x, y and z orders)
Returns AbstractMesh[]
release Drag
-
Force release the drag action by code
Returns void
set Color
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
set Enabled Rotation Axis
-
Enables rotation on the specified axis and disables rotation on the others
Parameters
- axis: string
The list of axis that should be enabled (eg. "xy" or "xyz")
Returns void
- axis: string
set Enabled Scaling
-
Enables/disables scaling
Parameters
- enable: boolean
if scaling should be enabled
OptionalhomogeneousScaling: booleandefines if scaling should only be homogeneous
Returns void
- enable: boolean
update Bounding Box
-
Updates the bounding box information for the Gizmo
Returns void
Interface for bounding box gizmo