Skip to main content

Class: GrabBehaviour

Defined in: webxr-interactions/src/behaviours/grab.ts:24

Implements

Constructors

Constructor

new GrabBehaviour(_config?: Omit<GrabConfig, "kind">, fulfilment?: GrabFulfilment): GrabBehaviour;

Defined in: webxr-interactions/src/behaviours/grab.ts:35

Parameters

ParameterTypeDefault value
_configOmit<GrabConfig, "kind">{}
fulfilmentGrabFulfilment"poseOnly"

Returns

GrabBehaviour

Properties

PropertyModifierTypeDefault valueDescriptionDefined in
grabbablereadonlytruetrueTrue when this behaviour makes the interactable a grab target.webxr-interactions/src/behaviours/grab.ts:28
kindreadonly"grab""grab"-webxr-interactions/src/behaviours/grab.ts:25
ownershipreadonly"handDriven" | "native"undefined-webxr-interactions/src/behaviours/grab.ts:26
requiresreadonlyreadonly ["grabs"]undefinedALL of these must be satisfied.webxr-interactions/src/behaviours/grab.ts:27

Methods

getValue()

getValue(): number;

Defined in: webxr-interactions/src/behaviours/grab.ts:87

Current logical 0..1 value (state snapshots, HUDs).

Returns

number

Implementation of

Behaviour.getValue


onGrabEnd()

onGrabEnd(ctx: BehaviourContext, interactor: InteractorInfo): void;

Defined in: webxr-interactions/src/behaviours/grab.ts:63

Parameters

ParameterType
ctxBehaviourContext
interactorInteractorInfo

Returns

void

Implementation of

Behaviour.onGrabEnd


onGrabStart()

onGrabStart(ctx: BehaviourContext, interactor: InteractorInfo): void;

Defined in: webxr-interactions/src/behaviours/grab.ts:44

Parameters

ParameterType
ctxBehaviourContext
interactorInteractorInfo

Returns

void

Implementation of

Behaviour.onGrabStart


setFulfilment()

setFulfilment(fulfilment: GrabFulfilment): void;

Defined in: webxr-interactions/src/behaviours/grab.ts:40

Parameters

ParameterType
fulfilmentGrabFulfilment

Returns

void


update()

update(ctx: BehaviourContext, holder?: InteractorInfo): void;

Defined in: webxr-interactions/src/behaviours/grab.ts:75

Per-frame tick. holder is set while a grab interactor holds this interactable (grab-family behaviours consume it; others ignore it).

Parameters

ParameterType
ctxBehaviourContext
holder?InteractorInfo

Returns

void

Implementation of

Behaviour.update