Defines an interface for bridging inputs with Interactor.

For custom inputs, implement this interface, e.g.,

Example

export class CustomInput extends Component implements InteractorInput {
static TypeName = InteractorInputTypename;

onGrabStart: Emitter;
onGrabEnd: Emitter;

update() {
// Notify `onGrabStart` and `onGrabEnd`.
// Could be an event from the network, anything.
}

/** @override */
get xrPose(): XRPose {
return this._xrPose;
}
}

The custom bridge doesn't need to be a Wonderland Engine component.

interface InteractorInput {
    onGrabEnd: Emitter<void[]>;
    onGrabStart: Emitter<void[]>;
    get xrPose(): null | XRPose;
}

Hierarchy

  • Component
    • InteractorInput

Implemented by

Properties

Accessors

Properties

onGrabEnd: Emitter<void[]>

Notify once the grab must end.

onGrabStart: Emitter<void[]>

Notify once the grab must start.

Accessors