BoundingBoxGizmo

Bounding box gizmo

Hierarchy

Implements

Index

Constructors

constructor

Properties

attachedMesh

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

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

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

The utility layer the gizmo will be added to

ignoreChildren

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

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

onDragStartObservable: Observable<__type>

Fired when a rotation sphere or scale box is dragged

onRotationSphereDragEndObservable

onRotationSphereDragEndObservable: Observable<__type>

Fired when a rotation sphere drag is ended

onRotationSphereDragObservable

onRotationSphereDragObservable: Observable<__type>

Fired when a rotation sphere is dragged

onScaleBoxDragEndObservable

onScaleBoxDragEndObservable: Observable<__type>

Fired when a scale box drag is ended

onScaleBoxDragObservable

onScaleBoxDragObservable: Observable<__type>

Fired when a scale box is dragged

rotationSphereSize

rotationSphereSize: number

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

scaleBoxSize

scaleBoxSize: number

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

scalePivot

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

scaleRatio: number

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

updateGizmoPositionToMatchAttachedMesh

updateGizmoPositionToMatchAttachedMesh: boolean

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

updateGizmoRotationToMatchAttachedMesh

updateGizmoRotationToMatchAttachedMesh: boolean

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

Methods

dispose

  • dispose(): void

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

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

updateBoundingBox

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

    Returns void

Static 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

Generated using TypeDoc