Skip to main content

Interface: Behaviour

Defined in: webxr-interactions/src/behaviours/behaviour.ts:51

Properties​

PropertyModifierTypeDescriptionDefined in
grabbablereadonlybooleanTrue when this behaviour makes the interactable a grab target.webxr-interactions/src/behaviours/behaviour.ts:59
kindreadonlystring-webxr-interactions/src/behaviours/behaviour.ts:52
ownershipreadonlyTransformOwnership-webxr-interactions/src/behaviours/behaviour.ts:53
requiresreadonlyreadonly ( | "gaze" | "pointer2d" | "rays" | "pokes" | "grabs" | "grabsNative" | "handJoints" | "pinch" | "buttonsAxes" | "headPose" | "haptics" | "presence")[]ALL of these must be satisfied.webxr-interactions/src/behaviours/behaviour.ts:55
requiresAnyOf?readonlyreadonly readonly ( | "gaze" | "pointer2d" | "rays" | "pokes" | "grabs" | "grabsNative" | "handJoints" | "pinch" | "buttonsAxes" | "headPose" | "haptics" | "presence")[][]For each group, AT LEAST ONE must be satisfied.webxr-interactions/src/behaviours/behaviour.ts:57

Methods​

getValue()​

getValue(): number;

Defined in: webxr-interactions/src/behaviours/behaviour.ts:73

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

Returns​

number


onGrabEnd()?​

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

Defined in: webxr-interactions/src/behaviours/behaviour.ts:64

Parameters​

ParameterType
ctxBehaviourContext
interactorInteractorInfo

Returns​

void


onGrabStart()?​

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

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

Parameters​

ParameterType
ctxBehaviourContext
interactorInteractorInfo

Returns​

void


onPressEnd()?​

optional onPressEnd(ctx: BehaviourContext, interactor: InteractorInfo): void;

Defined in: webxr-interactions/src/behaviours/behaviour.ts:62

Parameters​

ParameterType
ctxBehaviourContext
interactorInteractorInfo

Returns​

void


onPressStart()?​

optional onPressStart(ctx: BehaviourContext, interactor: InteractorInfo): void;

Defined in: webxr-interactions/src/behaviours/behaviour.ts:61

Parameters​

ParameterType
ctxBehaviourContext
interactorInteractorInfo

Returns​

void


update()​

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

Defined in: webxr-interactions/src/behaviours/behaviour.ts:70

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