BoundingBoxGizmo

Bounding box gizmo

Hierarchy

Implements

Index

Constructors

constructor

Find examples in Playground

Properties

attachedMesh

Find examples in Playground
attachedMesh: 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

fixedDragMeshScreenSize

Find examples in Playground
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)

fixedDragMeshScreenSizeDistanceFactor

Find examples in Playground
fixedDragMeshScreenSizeDistanceFactor: number

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

gizmoLayer

Find examples in Playground

The utility layer the gizmo will be added to

ignoreChildren

Find examples in Playground
ignoreChildren: boolean

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)

includeChildPredicate

Find examples in Playground
includeChildPredicate: Nullable<function>

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

Find examples in Playground
onDragStartObservable: Observable<__type>

Fired when a rotation sphere or scale box is dragged

onRotationSphereDragEndObservable

Find examples in Playground
onRotationSphereDragEndObservable: Observable<__type>

Fired when a rotation sphere drag is ended

onRotationSphereDragObservable

Find examples in Playground
onRotationSphereDragObservable: Observable<__type>

Fired when a rotation sphere is dragged

onScaleBoxDragEndObservable

Find examples in Playground
onScaleBoxDragEndObservable: Observable<__type>

Fired when a scale box drag is ended

onScaleBoxDragObservable

Find examples in Playground
onScaleBoxDragObservable: Observable<__type>

Fired when a scale box is dragged

rotationSphereSize

Find examples in Playground
rotationSphereSize: number

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

scaleBoxSize

Find examples in Playground
scaleBoxSize: number

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

scalePivot

Find examples in Playground
scalePivot: Nullable<Vector3>

Relative bounding box pivot used when scaling the attached mesh. 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)

scaleRatio

Find examples in Playground
scaleRatio: number

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

updateGizmoPositionToMatchAttachedMesh

Find examples in Playground
updateGizmoPositionToMatchAttachedMesh: boolean

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

updateGizmoRotationToMatchAttachedMesh

Find examples in Playground
updateGizmoRotationToMatchAttachedMesh: boolean

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

Methods

dispose

Find examples in Playground
  • dispose(): void

setCustomMesh

Find examples in Playground
  • 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

setEnabledRotationAxis

Find examples in Playground
  • 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

updateBoundingBox

Find examples in Playground
  • updateBoundingBox(): void
  • Updates the bounding box information for the Gizmo

    Returns void

Static MakeNotPickableAndWrapInBoundingBox

Find examples in Playground
  • 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

Generated using TypeDoc