Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SixDofDragBehavior

A behavior that when attached to a mesh will allow the mesh to be dragged around based on directions and origin of the pointer's ray

Hierarchy

Implements

Index

Properties

allowMultiPointerSearch playground for allowMultiPointer

allowMultiPointer: boolean

Should the behavior allow simultaneous pointers to interact with the owner node.

currentDraggingPointerIdsSearch playground for currentDraggingPointerIds

currentDraggingPointerIds: number[]

In case of multipointer interaction, all pointer ids currently active are stored here

detachCameraControlsSearch playground for detachCameraControls

detachCameraControls: boolean

/** If camera controls should be detached during the drag

dragDeltaRatioSearch playground for dragDeltaRatio

dragDeltaRatio: number

The distance towards the target drag position to move each frame. This can be useful to avoid jitter. Set this to 1 for no delay. (Default: 0.2)

draggableMeshesSearch playground for draggableMeshes

draggableMeshes: Nullable<AbstractMesh[]>

The list of child meshes that can receive drag events If null, all child meshes will receive drag event

faceCameraOnDragStartSearch playground for faceCameraOnDragStart

faceCameraOnDragStart: boolean

Should the object rotate towards the camera when we start dragging it

onDragEndObservableSearch playground for onDragEndObservable

onDragEndObservable: Observable<{}>

Fires each time a drag ends (eg. mouse release after drag)

onDragObservableSearch playground for onDragObservable

onDragObservable: Observable<{ delta: Vector3; position: Vector3 }>

Fires each time a drag happens

onDragStartObservableSearch playground for onDragStartObservable

onDragStartObservable: Observable<{ position: Vector3 }>

Fires each time a drag starts

onPositionChangedObservableSearch playground for onPositionChangedObservable

onPositionChangedObservable: Observable<{ position: Vector3 }>

Fires when position is updated

rotateAroundYOnlySearch playground for rotateAroundYOnly

rotateAroundYOnly: boolean

If rotateDraggedObject is set to true, this parameter determines if we are only rotating around the y axis (yaw)

rotateDraggedObjectSearch playground for rotateDraggedObject

rotateDraggedObject: boolean

If the object should rotate to face the drag origin

zDragFactorSearch playground for zDragFactor

zDragFactor: number

How much faster the object should move when the controller is moving towards it. This is useful to bring objects that are far away from the user to them faster. Set this to 0 to avoid any speed increase. (Default: 3)

Accessors

currentDraggingPointerID

  • get currentDraggingPointerID(): number
  • set currentDraggingPointerID(currentDraggingPointerID: number): any
  • Get or set the currentDraggingPointerId

    deprecated

    Please use currentDraggingPointerId instead

    Returns number

  • Get or set the currentDraggingPointerId

    deprecated

    Please use currentDraggingPointerId instead

    Parameters

    • currentDraggingPointerID: number

    Returns any

currentDraggingPointerId

  • get currentDraggingPointerId(): number
  • set currentDraggingPointerId(value: number): any
  • The id of the pointer that is currently interacting with the behavior (-1 when no pointer is active)

    Returns number

  • The id of the pointer that is currently interacting with the behavior (-1 when no pointer is active)

    Parameters

    • value: number

    Returns any

isMoving

  • get isMoving(): boolean
  • Returns true if the attached mesh is currently moving with this behavior

    Returns boolean

name

  • get name(): string

Methods

attachSearch playground for attach

  • attach(ownerNode: Mesh): void
  • Attaches the six DoF drag behavior

    Parameters

    • ownerNode: Mesh

      The mesh that will be dragged around once attached

    Returns void

detachSearch playground for detach

  • detach(): void

initSearch playground for init

  • init(): void

Legend

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