Class BoundingBoxGizmo
Hierarchy
-
Gizmo
- BoundingBoxGizmo
Implements
Index
Constructors
Properties
- _root
Mesh - fixed
Drag Mesh Bounds Size - fixed
Drag Mesh Screen Size - fixed
Drag Mesh Screen Size Distance Factor - gizmo
Layer - ignore
Children - include
Child Predicate - on
Drag Start Observable - on
Rotation Sphere Drag End Observable - on
Rotation Sphere Drag Observable - on
Scale Box Drag End Observable - on
Scale Box Drag Observable - rotation
Sphere Size - scale
Box Size - scale
Pivot - update
Gizmo Position ToMatch Attached Mesh - update
Scale
Accessors
Methods
Constructors
constructor
-
Creates an BoundingBoxGizmo
Parameters
-
Optional color: Color3
The color of the gizmo
-
Optional gizmoLayer: UtilityLayerRenderer
The utility layer the gizmo will be added to
Returns BoundingBoxGizmo
-
Properties
_root MeshSearch playground for _rootMesh
The root mesh of the gizmo
fixed Drag Mesh Bounds SizeSearch playground for fixedDragMeshBoundsSize
If set, the rotation spheres 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 SizeSearch playground for fixedDragMeshScreenSize
If set, the rotation spheres and scale boxes will increase in size based on the distance away from the camera to have a consistent screen size (Default: false) Note : fixedDragMeshScreenSize takes precedence over fixedDragMeshBoundsSize if both are true
fixed Drag Mesh Screen Size Distance FactorSearch playground for fixedDragMeshScreenSizeDistanceFactor
The distance away from the object which the draggable meshes should appear world sized when fixedDragMeshScreenSize is set to true (default: 10)
gizmo LayerSearch playground for gizmoLayer
The utility layer the gizmo will be added to
ignore ChildrenSearch playground for ignoreChildren
If child meshes should be ignored when calculating the boudning box. This should be set to true to avoid perf hits with heavily nested meshes (Default: false)
include Child PredicateSearch playground for includeChildPredicate
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. (Default: null)
on Drag Start ObservableSearch playground for onDragStartObservable
Fired when a rotation sphere or scale box is dragged
on Rotation Sphere Drag End ObservableSearch playground for onRotationSphereDragEndObservable
Fired when a rotation sphere drag is ended
on Rotation Sphere Drag ObservableSearch playground for onRotationSphereDragObservable
Fired when a rotation sphere is dragged
on Scale Box Drag End ObservableSearch playground for onScaleBoxDragEndObservable
Fired when a scale box drag is ended
on Scale Box Drag ObservableSearch playground for onScaleBoxDragObservable
Fired when a scale box is dragged
rotation Sphere SizeSearch playground for rotationSphereSize
The size of the rotation spheres attached to the bounding box (Default: 0.1)
scale Box SizeSearch playground for scaleBoxSize
The size of the scale boxes attached to the bounding box (Default: 0.1)
scale PivotSearch playground for scalePivot
Relative bounding box pivot used when scaling the attached node. When null object with scale from the opposite corner. 0.5,0.5,0.5 for center and 0.5,0,0.5 for bottom (Default: null)
update Gizmo Position ToMatch Attached MeshSearch playground for updateGizmoPositionToMatchAttachedMesh
If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)
update ScaleSearch playground for updateScale
When set, the gizmo will always appear the same size no matter where the camera is (default: true)
Accessors
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
Returns Nullable<AbstractMesh>
-
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
Parameters
-
value: Nullable<AbstractMesh>
Returns any
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
Returns Nullable<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
Parameters
Returns any
is Hovered
-
True when the mouse pointer is hovered a gizmo mesh
Returns boolean
scale Ratio
-
Ratio for the scale of the gizmo (Default: 1)
Returns number
-
Ratio for the scale of the gizmo (Default: 1)
Parameters
-
value: number
Returns any
-
update Gizmo Rotation ToMatch Attached Mesh
-
If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
Returns boolean
-
If set the gizmo's rotation will be updated to match the attached mesh each frame (Default: true)
Parameters
-
value: boolean
Returns any
-
Methods
disposeSearch playground for dispose
-
Disposes of the gizmo
Returns void
enable Drag BehaviorSearch playground for enableDragBehavior
-
Enables a pointer drag behavior on the bounding box of the gizmo
Returns void
set ColorSearch playground for setColor
-
Sets the color of the bounding box gizmo
Parameters
-
color: Color3
the color to set
Returns void
-
set Custom MeshSearch playground for setCustomMesh
-
CustomMeshes are not supported by this gizmo
Parameters
-
mesh: Mesh
The mesh to replace the default mesh of the gizmo
Returns void
-
set Enabled Rotation AxisSearch playground for setEnabledRotationAxis
-
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
-
set Enabled ScalingSearch playground for setEnabledScaling
-
Enables/disables scaling
Parameters
-
enable: boolean
if scaling should be enabled
-
Optional homogeneousScaling: boolean
defines if scaling should only be homogeneous
Returns void
-
update Bounding BoxSearch playground for updateBoundingBox
-
Updates the bounding box information for the Gizmo
Returns void
Static Gizmo Axis Pointer ObserverSearch playground for GizmoAxisPointerObserver
-
Subscribes to pointer up, down, and hover events. Used for responsive gizmos.
Parameters
-
gizmoLayer: UtilityLayerRenderer
The utility layer the gizmo will be added to
-
gizmoAxisCache: Map<Mesh, GizmoAxisCache>
Gizmo axis definition used for reactive gizmo UI
Returns Observer<PointerInfo>
pointerObserver
-
Static Make Not Pickable And Wrap InBounding BoxSearch playground for MakeNotPickableAndWrapInBoundingBox
-
Makes a mesh not pickable and wraps the mesh inside of a bounding box mesh that is pickable. (This is useful to avoid picking within complex geometry)
Parameters
-
mesh: Mesh
the mesh to wrap in the bounding box mesh and make not pickable
Returns Mesh
the bounding box mesh with the passed in mesh as a child
-
Bounding box gizmo