PointerDragBehavior

A behavior that when attached to a mesh will allow the mesh to be dragged around the screen based on pointer events

Hierarchy

  • PointerDragBehavior

Implements

Index

Constructors

constructor

  • Creates a pointer drag behavior that can be attached to a mesh

    Parameters

    • options: object

      The drag axis or normal of the plane that will be dragged across. pointerObservableScene can be used to listen to drag events from another scene(eg. if the attached mesh is in an overlay scene).

      • Optional dragAxis?: Vector3
      • Optional dragPlaneNormal?: Vector3
      • Optional pointerObservableScene?: Scene

    Returns PointerDragBehavior

Properties

moveAttached

moveAttached: boolean

If the attached mesh should be moved when dragged

name

name: string

The name of the behavior

onDragEndObservable

onDragEndObservable: Observable<object>

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

onDragObservable

onDragObservable: Observable<object>

Fires each time the attached mesh is dragged with the pointer

onDragStartObservable

onDragStartObservable: Observable<object>

Fires each time a drag begins (eg. mouse down on mesh)

Methods

attach

  • attach(ownerNode: Mesh): void
  • Attaches the drag behavior the passed in mesh

    Parameters

    • ownerNode: Mesh

      The mesh that will be dragged around once attached

    Returns void

detach

  • detach(): void
  • Detaches the behavior from the mesh

    Returns void

init

  • init(): void
  • Initializes the behavior

    Returns void

Generated using TypeDoc