API

Class WebXRMotionControllerManager

Motion controller manager is managing the different webxr profiles and makes sure the right controller is being loaded.

Index
BaseRepositoryUrl: string = "https://immersive-web.github.io/webxr-input-profiles/packages/viewer/dist"

The base URL of the online controller repository. Can be changed at any time.

DisableControllerCache: boolean = true

Disable the controller cache and load the models each time a new WebXRProfileMotionController is loaded. Defaults to true.

PrioritizeOnlineRepository: boolean = true

Which repository gets priority - local or online

UseOnlineRepository: boolean = true

Use the online repository, or use only locally-defined controllers

  • When acquiring a new xrInput object (usually by the WebXRInput class), match it with the correct profile. The order of search:

    1. Iterate the profiles array of the xr input and try finding a corresponding motion controller
    2. (If not found) search in the gamepad id and try using it (legacy versions only)
    3. search for registered fallbacks (should be redundant, nonetheless it makes sense to check)
    4. return the generic trigger controller if none were found

    Parameters

    • xrInput: XRInputSource

      the xrInput to which a new controller is initialized

    • scene: Scene

      the scene to which the model will be added

    • OptionalforceProfile: string

      force a certain profile for this controller

    Returns Promise<WebXRAbstractMotionController>

    A promise that fulfils with the motion controller class for this profile id or the generic standard class if none was found