Options
All
  • Public
  • Public/Protected
  • All
Menu

Helps setup gizmo's in the scene to rotate/scale/position nodes

Hierarchy

  • GizmoManager

Implements

Index

Constructors

  • Instantiates a gizmo manager

    Parameters

    • _scene: Scene

      the scene to overlay the gizmos on top of

    • Optional thickness: number

      display gizmo axis thickness

    • Optional utilityLayer: UtilityLayerRenderer

      the layer where gizmos are rendered

    • Optional keepDepthUtilityLayer: UtilityLayerRenderer

      the layer where occluded gizmos are rendered

    Returns GizmoManager

Properties

attachableMeshes: Nullable<AbstractMesh[]>

Array of meshes which will have the gizmo attached when a pointer selected them. If null, all meshes are attachable. (Default: null)

attachableNodes: Nullable<Node[]>

Array of nodes which will have the gizmo attached when a pointer selected them. If null, all nodes are attachable. (Default: null)

boundingBoxDragBehavior: SixDofDragBehavior

When bounding box gizmo is enabled, this can be used to track drag/end events

clearGizmoOnEmptyPointerEvent: boolean

When true, the gizmo will be detached from the current object when a pointer down occurs with an empty picked mesh

enableAutoPicking: boolean

When true (default), picking to attach a new mesh is enabled. This works in sync with inspector autopicking.

gizmos: { boundingBoxGizmo: Nullable<IBoundingBoxGizmo>; positionGizmo: Nullable<IPositionGizmo>; rotationGizmo: Nullable<IRotationGizmo>; scaleGizmo: Nullable<IScaleGizmo> }

Gizmo's created by the gizmo manager, gizmo will be null until gizmo has been enabled for the first time

Type declaration

onAttachedToMeshObservable: Observable<Nullable<AbstractMesh>>

Fires an event when the manager is attached to a mesh

onAttachedToNodeObservable: Observable<Nullable<Node>>

Fires an event when the manager is attached to a node

usePointerToAttachGizmos: boolean

If pointer events should perform attaching/detaching a gizmo, if false this can be done manually via attachToMesh/attachToNode. (Default: true)

Accessors

  • get boundingBoxGizmoEnabled(): boolean
  • set boundingBoxGizmoEnabled(value: boolean): void
  • If the boundingBox gizmo is enabled

    Returns boolean

  • If the boundingBox gizmo is enabled

    Parameters

    • value: boolean

    Returns void

  • Set the coordinate system to use. By default it's local. But it's possible for a user to tweak so its local for translation and world for rotation. In that case, setting the coordinate system will change updateGizmoRotationToMatchAttachedMesh and updateGizmoPositionToMatchAttachedMesh

    Returns GizmoCoordinatesMode

  • Set the coordinate system to use. By default it's local. But it's possible for a user to tweak so its local for translation and world for rotation. In that case, setting the coordinate system will change updateGizmoRotationToMatchAttachedMesh and updateGizmoPositionToMatchAttachedMesh

    Parameters

    Returns void

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

    Returns boolean

  • Utility layer that the bounding box gizmo belongs to

    Returns UtilityLayerRenderer

  • get positionGizmoEnabled(): boolean
  • set positionGizmoEnabled(value: boolean): void
  • If the position gizmo is enabled

    Returns boolean

  • If the position gizmo is enabled

    Parameters

    • value: boolean

    Returns void

  • get rotationGizmoEnabled(): boolean
  • set rotationGizmoEnabled(value: boolean): void
  • If the rotation gizmo is enabled

    Returns boolean

  • If the rotation gizmo is enabled

    Parameters

    • value: boolean

    Returns void

  • get scaleGizmoEnabled(): boolean
  • set scaleGizmoEnabled(value: boolean): void
  • If the scale gizmo is enabled

    Returns boolean

  • If the scale gizmo is enabled

    Parameters

    • value: boolean

    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

  • Utility layer that all gizmos besides bounding box belong to

    Returns UtilityLayerRenderer

Methods

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

    Parameters

    • gizmoAxisCache: Map<Mesh, GizmoAxisCache>

      Gizmo axis definition used for reactive gizmo UI

    Returns void

  • Attaches a set of gizmos to the specified mesh

    Parameters

    Returns void

  • Attaches a set of gizmos to the specified node

    Parameters

    • node: Nullable<Node>

      The node the gizmo's should be attached to

    Returns void

  • dispose(): void
  • Disposes of the gizmo manager

    Returns void

Legend

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

Settings

Theme