Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PositionGizmo

Gizmo that enables dragging a mesh along 3 axis

Hierarchy

Implements

Index

Constructors

constructor

  • Creates a PositionGizmo

    Parameters

    • Optional gizmoLayer: UtilityLayerRenderer

      The utility layer the gizmo will be added to

    • Optional thickness: number

      display gizmo axis thickness

    • Optional gizmoManager: GizmoManager

    Returns PositionGizmo

Properties

_rootMeshSearch playground for _rootMesh

_rootMesh: Mesh

The root mesh of the gizmo

gizmoLayerSearch playground for gizmoLayer

The utility layer the gizmo will be added to

onDragEndObservableSearch playground for onDragEndObservable

onDragEndObservable: Observable<unknown>

Fires an event when any of it's sub gizmos are released from dragging

onDragStartObservableSearch playground for onDragStartObservable

onDragStartObservable: Observable<unknown>

Fires an event when any of it's sub gizmos are dragged

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)

xGizmoSearch playground for xGizmo

Internal gizmo used for interactions on the x axis

xPlaneGizmoSearch playground for xPlaneGizmo

xPlaneGizmo: PlaneDragGizmo

Internal gizmo used for interactions on the yz plane

yGizmoSearch playground for yGizmo

Internal gizmo used for interactions on the y axis

yPlaneGizmoSearch playground for yPlaneGizmo

yPlaneGizmo: PlaneDragGizmo

Internal gizmo used for interactions on the xz plane

zGizmoSearch playground for zGizmo

Internal gizmo used for interactions on the z axis

zPlaneGizmoSearch playground for zPlaneGizmo

zPlaneGizmo: PlaneDragGizmo

Internal gizmo used for interactions on the xy plane

Accessors

attachedMesh

attachedNode

isHovered

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

    Returns boolean

planarGizmoEnabled

  • get planarGizmoEnabled(): boolean
  • set planarGizmoEnabled(value: boolean): any
  • If the planar drag gizmo is enabled setting this will enable/disable XY, XZ and YZ planes regardless of individual gizmo settings.

    Returns boolean

  • If the planar drag gizmo is enabled setting this will enable/disable XY, XZ and YZ planes regardless of individual gizmo settings.

    Parameters

    • value: boolean

    Returns any

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

snapDistance

  • get snapDistance(): number
  • set snapDistance(value: number): any
  • Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)

    Returns number

  • Drag distance in babylon units that the gizmo will snap to when dragged (Default: 0)

    Parameters

    • value: number

    Returns any

updateGizmoRotationToMatchAttachedMesh

  • get updateGizmoRotationToMatchAttachedMesh(): boolean
  • set updateGizmoRotationToMatchAttachedMesh(value: boolean): any

Methods

addToAxisCacheSearch playground for addToAxisCache

  • Builds Gizmo Axis Cache to enable features such as hover state preservation and graying out other axis during manipulation

    Parameters

    • mesh: Mesh

      Axis gizmo mesh

    • cache: GizmoAxisCache

      Gizmo axis definition used for reactive gizmo UI

    Returns void

disposeSearch playground for dispose

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

Static GizmoAxisPointerObserverSearch playground for GizmoAxisPointerObserver

Legend

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