Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BoundingBoxGizmo

Bounding box gizmo

Hierarchy

Implements

Index

Constructors

constructor

Properties

_rootMeshSearch playground for _rootMesh

_rootMesh: Mesh

The root mesh of the gizmo

fixedDragMeshBoundsSizeSearch playground for fixedDragMeshBoundsSize

fixedDragMeshBoundsSize: boolean

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

fixedDragMeshScreenSizeSearch playground for fixedDragMeshScreenSize

fixedDragMeshScreenSize: boolean

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

fixedDragMeshScreenSizeDistanceFactorSearch playground for fixedDragMeshScreenSizeDistanceFactor

fixedDragMeshScreenSizeDistanceFactor: number

The distance away from the object which the draggable meshes should appear world sized when fixedDragMeshScreenSize is set to true (default: 10)

gizmoLayerSearch playground for gizmoLayer

The utility layer the gizmo will be added to

ignoreChildrenSearch playground for ignoreChildren

ignoreChildren: boolean

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 (Default: false)

includeChildPredicateSearch playground for includeChildPredicate

includeChildPredicate: Nullable<(abstractMesh: AbstractMesh) => boolean>

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)

onDragStartObservableSearch playground for onDragStartObservable

onDragStartObservable: Observable<{}>

Fired when a rotation sphere or scale box is dragged

onRotationSphereDragEndObservableSearch playground for onRotationSphereDragEndObservable

onRotationSphereDragEndObservable: Observable<{}>

Fired when a rotation sphere drag is ended

onRotationSphereDragObservableSearch playground for onRotationSphereDragObservable

onRotationSphereDragObservable: Observable<{}>

Fired when a rotation sphere is dragged

onScaleBoxDragEndObservableSearch playground for onScaleBoxDragEndObservable

onScaleBoxDragEndObservable: Observable<{}>

Fired when a scale box drag is ended

onScaleBoxDragObservableSearch playground for onScaleBoxDragObservable

onScaleBoxDragObservable: Observable<{}>

Fired when a scale box is dragged

rotationSphereSizeSearch playground for rotationSphereSize

rotationSphereSize: number

The size of the rotation spheres attached to the bounding box (Default: 0.1)

scaleBoxSizeSearch playground for scaleBoxSize

scaleBoxSize: number

The size of the scale boxes attached to the bounding box (Default: 0.1)

scalePivotSearch playground for scalePivot

scalePivot: Nullable<Vector3>

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)

updateGizmoPositionToMatchAttachedMeshSearch playground for updateGizmoPositionToMatchAttachedMesh

updateGizmoPositionToMatchAttachedMesh: boolean

If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)

updateScaleSearch playground for updateScale

updateScale: boolean

When set, the gizmo will always appear the same size no matter where the camera is (default: true)

Accessors

attachedMesh

  • 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

    Returns any

attachedNode

  • 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

axisFactor

  • Gets the axis factor

    Returns Vector3

    the Vector3 factor value

  • Sets the axis factor

    Parameters

    • factor: Vector3

      the Vector3 value

    Returns any

    the Vector3 factor value

isHovered

  • get isHovered(): boolean
  • True when the mouse pointer is hovered a gizmo mesh

    Returns boolean

scaleDragSpeed

  • get scaleDragSpeed(): number
  • set scaleDragSpeed(value: number): any
  • Gets scale drag speed

    Returns number

    the scale speed number

  • Sets scale drag speed value

    Parameters

    • value: number

      the new speed value

    Returns any

    the scale speed number

scaleRatio

  • get scaleRatio(): number
  • set scaleRatio(value: number): any
  • 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

updateGizmoRotationToMatchAttachedMesh

  • get updateGizmoRotationToMatchAttachedMesh(): boolean
  • set updateGizmoRotationToMatchAttachedMesh(value: boolean): any
  • 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

  • dispose(): void

enableDragBehaviorSearch playground for enableDragBehavior

  • enableDragBehavior(): void
  • Enables a pointer drag behavior on the bounding box of the gizmo

    Returns void

setColorSearch playground for setColor

  • setColor(color: Color3): void
  • Sets the color of the bounding box gizmo

    Parameters

    • color: Color3

      the color to set

    Returns void

setCustomMeshSearch playground for setCustomMesh

  • setCustomMesh(mesh: Mesh): void
  • CustomMeshes are not supported by this gizmo

    Parameters

    • mesh: Mesh

      The mesh to replace the default mesh of the gizmo

    Returns void

setEnabledRotationAxisSearch playground for setEnabledRotationAxis

  • setEnabledRotationAxis(axis: string): void
  • 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

setEnabledScalingSearch playground for setEnabledScaling

  • setEnabledScaling(enable: boolean, homogeneousScaling?: boolean): void
  • Enables/disables scaling

    Parameters

    • enable: boolean

      if scaling should be enabled

    • Optional homogeneousScaling: boolean

      defines if scaling should only be homogeneous

    Returns void

updateBoundingBoxSearch playground for updateBoundingBox

  • updateBoundingBox(): void
  • Updates the bounding box information for the Gizmo

    Returns void

Static GizmoAxisPointerObserverSearch playground for GizmoAxisPointerObserver

Static MakeNotPickableAndWrapInBoundingBoxSearch playground for MakeNotPickableAndWrapInBoundingBox

  • MakeNotPickableAndWrapInBoundingBox(mesh: Mesh): Mesh
  • 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

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static property
  • Static method