API

Class PlaneDragGizmo

Single plane drag gizmo

Hierarchy (View Summary)

Implements

Index
_rootMesh: Mesh

The root mesh of the gizmo

dragBehavior: PointerDragBehavior

Drag behavior responsible for the gizmos dragging interactions

gizmoLayer: UtilityLayerRenderer = UtilityLayerRenderer.DefaultUtilityLayer

[Object] The utility layer the gizmo will be added to

onSnapObservable: Observable<{ snapDistance: number }> = ...

Event that fires each time the gizmo snaps to a new location.

  • snapDistance is the change in distance
snapDistance: number = 0

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

PreserveScaling: boolean = false

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

UseAbsoluteScaling: boolean = true

There are 2 ways to preserve scaling: using mesh scaling or absolute scaling. Depending of hierarchy, non uniform scaling and LH or RH coordinates. One is preferable than the other. If the scaling to be preserved is the local scaling, then set this value to false. Default is true which means scaling to be preserved is absolute one (with hierarchy applied)

  • get additionalTransformNode(): TransformNode | undefined

    Additional transform applied to the gizmo. It's useful when the gizmo is attached to a bone: if the bone is part of a skeleton attached to a mesh, you should define the mesh as additionalTransformNode if you want the gizmo to be displayed at the bone's correct location. Otherwise, as the gizmo is relative to the skeleton root, the mesh transformation will not be taken into account.

    Returns TransformNode | undefined

  • set additionalTransformNode(value: TransformNode | undefined): void

    Additional transform applied to the gizmo. It's useful when the gizmo is attached to a bone: if the bone is part of a skeleton attached to a mesh, you should define the mesh as additionalTransformNode if you want the gizmo to be displayed at the bone's correct location. Otherwise, as the gizmo is relative to the skeleton root, the mesh transformation will not be taken into account.

    Parameters

    Returns void