API

Class AxisScaleGizmo

Single axis scale gizmo

Hierarchy (View Summary)

Implements

Index
_rootMesh: Mesh

The root mesh of the gizmo

dragBehavior: PointerDragBehavior

Drag behavior responsible for the gizmos dragging interactions

dragScale: number = 1

The magnitude of the drag strength (scaling factor)

gizmoLayer: UtilityLayerRenderer = UtilityLayerRenderer.DefaultUtilityLayer

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

incrementalSnap: boolean = false

Incremental snap scaling (default is false). When true, with a snapDistance of 0.1, scaling will be 1.1,1.2,1.3 instead of, when false: 1.1,1.21,1.33,...

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

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

  • snapDistance is the change in distance
sensitivity: number = 1

Custom sensitivity value for the drag strength

snapDistance: number = 0

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

uniformScaling: boolean = false

If the scaling operation should be done on all axis (default: false)

MinimumAbsoluteScale: number = Epsilon

The minimal absolute scale per component. can be positive or negative but never smaller.

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