API

Class BaseSixDofDragBehavior

Base behavior for six degrees of freedom interactions in XR experiences. Creates virtual meshes that are dragged around And observables for position/rotation changes

Hierarchy (View Summary)

Implements

Index
allowMultiPointer: boolean = true

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

currentDraggingPointerIds: number[] = []

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

detachCameraControls: boolean = true

/**

  • If camera controls should be detached during the drag
draggableMeshes: Nullable<AbstractMesh[]> = null

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

onDragEndObservable: Observable<unknown> = ...

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

onDragObservable: Observable<
    { delta: Vector3; pickInfo: PickingInfo; position: Vector3 },
> = ...

Fires each time a drag happens

onDragStartObservable: Observable<{ position: Vector3 }> = ...

Fires each time a drag starts

zDragFactor: number = 3

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)