• Public
  • Public/Protected
  • All

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





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

disableMovementSearch playground for disableMovement

disableMovement: boolean

Use this flag to update the target but not move the owner node towards the target

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; pickInfo: PickingInfo; 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

rotateWithMotionControllerSearch playground for rotateWithMotionController

rotateWithMotionController: boolean

Should the behavior rotate 1:1 with the motion controller, when one is used.

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)



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


    Please use currentDraggingPointerId instead

    Returns number

  • Get or set the currentDraggingPointerId


    Please use currentDraggingPointerId instead


    • currentDraggingPointerID: number

    Returns any


  • 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)


    • value: number

    Returns any


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

    Returns boolean


  • get name(): string


attachSearch playground for attach

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


    • 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


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