Options
All
  • Public
  • Public/Protected
  • All
Menu

Bounding box gizmo

Hierarchy

Implements

Index

Constructors

Properties

_rootMesh: Mesh

The root mesh of the gizmo

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

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

fixedDragMeshScreenSizeDistanceFactor: number

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

The utility layer the gizmo will be added to

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)

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)

onDragStartObservable: Observable<{}>

Fired when a rotation sphere or scale box is dragged

onRotationSphereDragEndObservable: Observable<{}>

Fired when a rotation sphere drag is ended

onRotationSphereDragObservable: Observable<{}>

Fired when a rotation sphere is dragged

onScaleBoxDragEndObservable: Observable<{}>

Fired when a scale box drag is ended

onScaleBoxDragObservable: Observable<{}>

Fired when a scale box is dragged

rotationSphereSize: number

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

scaleBoxSize: number

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

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)

PreserveScaling: boolean

When enabled, any gizmo operation will perserve scaling sign. Default is off. Only valid for TransformNode derived classes (Mesh, AbstractMesh, ...)

Accessors

  • 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 void

  • 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 void

  • posture that the gizmo will be display When set null, default value will be used (Quaternion(0, 0, 0, 1))

    Returns Nullable<Quaternion>

  • posture that the gizmo will be display When set null, default value will be used (Quaternion(0, 0, 0, 1))

    Parameters

    Returns void

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

    Returns boolean

  • Get the pointerDragBehavior

    Returns PointerDragBehavior

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

    Returns number

    the scale speed number

  • Sets scale drag speed value

    Parameters

    • value: number

      the new speed value

    Returns void

  • get scaleRatio(): number
  • set scaleRatio(value: number): void
  • Ratio for the scale of the gizmo (Default: 1)

    Returns number

  • Ratio for the scale of the gizmo (Default: 1)

    Parameters

    • value: number

    Returns void

  • get updateGizmoPositionToMatchAttachedMesh(): boolean
  • set updateGizmoPositionToMatchAttachedMesh(value: boolean): void
  • If set the gizmo's position will be updated to match the attached mesh each frame (Default: true)

    Returns boolean

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

    Parameters

    • value: boolean

    Returns void

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

  • get updateScale(): boolean
  • set updateScale(value: boolean): void
  • When set, the gizmo will always appear the same size no matter where the camera is (default: true)

    Returns boolean

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

    Parameters

    • value: boolean

    Returns void

Methods

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

    Returns void

  • Sets the color of the bounding box gizmo

    Parameters

    • color: Color3

      the color to set

    Returns void

  • setCustomMesh(): void
  • 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

  • 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

  • updateBoundingBox(): void
  • 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 constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static method

Settings

Theme