API

Interface IMotionControllerLayout

The schema of motion controller layout. No object will be initialized using this interface This is used just to define the profile.

interface IMotionControllerLayout {
    assetPath: string;
    components: {
        [componentId: string]: {
            gamepadIndices: { button?: number; xAxis?: number; yAxis?: number };
            rootNodeName: string;
            touchPointNodeName?: string;
            type: MotionControllerComponentType;
            visualResponses: {
                [stateKey: string]: {
                    componentProperty: "state" | "button" | "xAxis" | "yAxis";
                    maxNodeName?: string;
                    minNodeName?: string;
                    states: MotionControllerComponentStateType[];
                    valueNodeName?: string;
                    valueNodeProperty: "transform" | "visibility";
                };
            };
        };
    };
    gamepadMapping: ""
    | "xr-standard";
    rootNodeName: string;
    selectComponentId: string;
}
Index
assetPath: string

Path to load the assets. Usually relative to the base path

components: {
    [componentId: string]: {
        gamepadIndices: { button?: number; xAxis?: number; yAxis?: number };
        rootNodeName: string;
        touchPointNodeName?: string;
        type: MotionControllerComponentType;
        visualResponses: {
            [stateKey: string]: {
                componentProperty: "state" | "button" | "xAxis" | "yAxis";
                maxNodeName?: string;
                minNodeName?: string;
                states: MotionControllerComponentStateType[];
                valueNodeName?: string;
                valueNodeProperty: "transform" | "visibility";
            };
        };
    };
}

Available components (unsorted)

Type Declaration

  • [componentId: string]: {
        gamepadIndices: { button?: number; xAxis?: number; yAxis?: number };
        rootNodeName: string;
        touchPointNodeName?: string;
        type: MotionControllerComponentType;
        visualResponses: {
            [stateKey: string]: {
                componentProperty: "state" | "button" | "xAxis" | "yAxis";
                maxNodeName?: string;
                minNodeName?: string;
                states: MotionControllerComponentStateType[];
                valueNodeName?: string;
                valueNodeProperty: "transform" | "visibility";
            };
        };
    }

    A map of component Ids

    Type Declaration

    • gamepadIndices: { button?: number; xAxis?: number; yAxis?: number }

      The indices of this component in the gamepad object

      • Optionalbutton?: number

        Index of button

      • OptionalxAxis?: number

        If available, index of x-axis

      • OptionalyAxis?: number

        If available, index of y-axis

    • rootNodeName: string

      The mesh's root node name

    • OptionaltouchPointNodeName?: string

      If touch enabled, what is the name of node to display user feedback

    • type: MotionControllerComponentType

      The type of input the component outputs

    • visualResponses: {
          [stateKey: string]: {
              componentProperty: "state" | "button" | "xAxis" | "yAxis";
              maxNodeName?: string;
              minNodeName?: string;
              states: MotionControllerComponentStateType[];
              valueNodeName?: string;
              valueNodeProperty: "transform" | "visibility";
          };
      }

      Animation definitions for this model

gamepadMapping: "" | "xr-standard"

Is it xr standard mapping or not

rootNodeName: string

Base root node of this entire model

selectComponentId: string

Defines the main button component id