|
@@ -1,16 +1,11 @@
|
|
|
-import {
|
|
|
- WebXRAbstractMotionController,
|
|
|
- IMinimalMotionControllerObject,
|
|
|
- MotionControllerHandedness,
|
|
|
- IMotionControllerLayoutMap
|
|
|
-} from "./webXRAbstractMotionController";
|
|
|
-import { WebXRMotionControllerManager } from './webXRMotionControllerManager';
|
|
|
-import { AbstractMesh } from '../../Meshes/abstractMesh';
|
|
|
-import { Scene } from '../../scene';
|
|
|
-import { Mesh } from '../../Meshes/mesh';
|
|
|
-import { Quaternion } from '../../Maths/math.vector';
|
|
|
-import { SceneLoader } from '../../Loading/sceneLoader';
|
|
|
-import { Logger } from '../../Misc/logger';
|
|
|
+import { WebXRAbstractMotionController, IMinimalMotionControllerObject, MotionControllerHandedness, IMotionControllerLayoutMap } from "./webXRAbstractMotionController";
|
|
|
+import { WebXRMotionControllerManager } from "./webXRMotionControllerManager";
|
|
|
+import { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
|
+import { Scene } from "../../scene";
|
|
|
+import { Mesh } from "../../Meshes/mesh";
|
|
|
+import { Quaternion } from "../../Maths/math.vector";
|
|
|
+import { SceneLoader } from "../../Loading/sceneLoader";
|
|
|
+import { Logger } from "../../Misc/logger";
|
|
|
|
|
|
/**
|
|
|
* The motion controller class for all microsoft mixed reality controllers
|
|
@@ -19,69 +14,69 @@ export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionCon
|
|
|
// use this in the future - https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/assets/profiles/microsoft
|
|
|
protected readonly _mapping = {
|
|
|
defaultButton: {
|
|
|
- "valueNodeName": "VALUE",
|
|
|
- "unpressedNodeName": "UNPRESSED",
|
|
|
- "pressedNodeName": "PRESSED"
|
|
|
+ valueNodeName: "VALUE",
|
|
|
+ unpressedNodeName: "UNPRESSED",
|
|
|
+ pressedNodeName: "PRESSED",
|
|
|
},
|
|
|
defaultAxis: {
|
|
|
- "valueNodeName": "VALUE",
|
|
|
- "minNodeName": "MIN",
|
|
|
- "maxNodeName": "MAX"
|
|
|
+ valueNodeName: "VALUE",
|
|
|
+ minNodeName: "MIN",
|
|
|
+ maxNodeName: "MAX",
|
|
|
},
|
|
|
buttons: {
|
|
|
"xr-standard-trigger": {
|
|
|
- "rootNodeName": "SELECT",
|
|
|
- "componentProperty": "button",
|
|
|
- "states": ["default", "touched", "pressed"]
|
|
|
+ rootNodeName: "SELECT",
|
|
|
+ componentProperty: "button",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
},
|
|
|
"xr-standard-squeeze": {
|
|
|
- "rootNodeName": "GRASP",
|
|
|
- "componentProperty": "state",
|
|
|
- "states": ["pressed"]
|
|
|
+ rootNodeName: "GRASP",
|
|
|
+ componentProperty: "state",
|
|
|
+ states: ["pressed"],
|
|
|
},
|
|
|
"xr-standard-touchpad": {
|
|
|
- "rootNodeName": "TOUCHPAD_PRESS",
|
|
|
- "labelAnchorNodeName": "squeeze-label",
|
|
|
- "touchPointNodeName": "TOUCH" // TODO - use this for visual feedback
|
|
|
+ rootNodeName: "TOUCHPAD_PRESS",
|
|
|
+ labelAnchorNodeName: "squeeze-label",
|
|
|
+ touchPointNodeName: "TOUCH", // TODO - use this for visual feedback
|
|
|
},
|
|
|
"xr-standard-thumbstick": {
|
|
|
- "rootNodeName": "THUMBSTICK_PRESS",
|
|
|
- "componentProperty": "state",
|
|
|
- "states": ["pressed"],
|
|
|
- }
|
|
|
+ rootNodeName: "THUMBSTICK_PRESS",
|
|
|
+ componentProperty: "state",
|
|
|
+ states: ["pressed"],
|
|
|
+ },
|
|
|
},
|
|
|
axes: {
|
|
|
"xr-standard-touchpad": {
|
|
|
"x-axis": {
|
|
|
- "rootNodeName": "TOUCHPAD_TOUCH_X"
|
|
|
+ rootNodeName: "TOUCHPAD_TOUCH_X",
|
|
|
},
|
|
|
"y-axis": {
|
|
|
- "rootNodeName": "TOUCHPAD_TOUCH_Y"
|
|
|
- }
|
|
|
+ rootNodeName: "TOUCHPAD_TOUCH_Y",
|
|
|
+ },
|
|
|
},
|
|
|
"xr-standard-thumbstick": {
|
|
|
"x-axis": {
|
|
|
- "rootNodeName": "THUMBSTICK_X"
|
|
|
+ rootNodeName: "THUMBSTICK_X",
|
|
|
},
|
|
|
"y-axis": {
|
|
|
- "rootNodeName": "THUMBSTICK_Y"
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ rootNodeName: "THUMBSTICK_Y",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* The base url used to load the left and right controller models
|
|
|
*/
|
|
|
- public static MODEL_BASE_URL: string = 'https://controllers.babylonjs.com/microsoft/';
|
|
|
+ public static MODEL_BASE_URL: string = "https://controllers.babylonjs.com/microsoft/";
|
|
|
/**
|
|
|
* The name of the left controller model file
|
|
|
*/
|
|
|
- public static MODEL_LEFT_FILENAME: string = 'left.glb';
|
|
|
+ public static MODEL_LEFT_FILENAME: string = "left.glb";
|
|
|
/**
|
|
|
* The name of the right controller model file
|
|
|
*/
|
|
|
- public static MODEL_RIGHT_FILENAME: string = 'right.glb';
|
|
|
+ public static MODEL_RIGHT_FILENAME: string = "right.glb";
|
|
|
|
|
|
public profileId = "microsoft-mixed-reality";
|
|
|
|
|
@@ -89,33 +84,35 @@ export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionCon
|
|
|
super(scene, MixedRealityProfile["left-right"], gamepadObject, handedness);
|
|
|
}
|
|
|
|
|
|
- protected _getFilenameAndPath(): { filename: string; path: string; } {
|
|
|
+ protected _getFilenameAndPath(): { filename: string; path: string } {
|
|
|
let filename = "";
|
|
|
- if (this.handedness === 'left') {
|
|
|
+ if (this.handedness === "left") {
|
|
|
filename = WebXRMicrosoftMixedRealityController.MODEL_LEFT_FILENAME;
|
|
|
- }
|
|
|
- else { // Right is the default if no hand is specified
|
|
|
+ } else {
|
|
|
+ // Right is the default if no hand is specified
|
|
|
filename = WebXRMicrosoftMixedRealityController.MODEL_RIGHT_FILENAME;
|
|
|
}
|
|
|
|
|
|
- const device = 'default';
|
|
|
- let path = WebXRMicrosoftMixedRealityController.MODEL_BASE_URL + device + '/';
|
|
|
+ const device = "default";
|
|
|
+ let path = WebXRMicrosoftMixedRealityController.MODEL_BASE_URL + device + "/";
|
|
|
return {
|
|
|
filename,
|
|
|
- path
|
|
|
+ path,
|
|
|
};
|
|
|
}
|
|
|
|
|
|
protected _getModelLoadingConstraints(): boolean {
|
|
|
const glbLoaded = SceneLoader.IsPluginForExtensionAvailable(".glb");
|
|
|
if (!glbLoaded) {
|
|
|
- Logger.Warn('glTF / glb loaded was not registered, using generic controller instead');
|
|
|
+ Logger.Warn("glTF / glb loaded was not registered, using generic controller instead");
|
|
|
}
|
|
|
return glbLoaded;
|
|
|
}
|
|
|
|
|
|
protected _processLoadedModel(_meshes: AbstractMesh[]): void {
|
|
|
- if (!this.rootMesh) { return; }
|
|
|
+ if (!this.rootMesh) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
// Button Meshes
|
|
|
this.getComponentIds().forEach((id, i) => {
|
|
@@ -126,13 +123,13 @@ export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionCon
|
|
|
const buttonMap = (<any>this._mapping.buttons)[id];
|
|
|
const buttonMeshName = buttonMap.rootNodeName;
|
|
|
if (!buttonMeshName) {
|
|
|
- Logger.Log('Skipping unknown button at index: ' + i + ' with mapped name: ' + id);
|
|
|
+ Logger.Log("Skipping unknown button at index: " + i + " with mapped name: " + id);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
var buttonMesh = this._getChildByName(this.rootMesh, buttonMeshName);
|
|
|
if (!buttonMesh) {
|
|
|
- Logger.Warn('Missing button mesh with name: ' + buttonMeshName);
|
|
|
+ Logger.Warn("Missing button mesh with name: " + buttonMeshName);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -143,16 +140,19 @@ export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionCon
|
|
|
if (buttonMap.valueMesh && buttonMap.pressedMesh && buttonMap.unpressedMesh) {
|
|
|
const comp = this.getComponent(id);
|
|
|
if (comp) {
|
|
|
- comp.onButtonStateChangedObservable.add((component) => {
|
|
|
- this._lerpTransform(buttonMap, component.value);
|
|
|
- }, undefined, true);
|
|
|
+ comp.onButtonStateChangedObservable.add(
|
|
|
+ (component) => {
|
|
|
+ this._lerpTransform(buttonMap, component.value);
|
|
|
+ },
|
|
|
+ undefined,
|
|
|
+ true
|
|
|
+ );
|
|
|
}
|
|
|
} else {
|
|
|
// If we didn't find the mesh, it simply means this button won't have transforms applied as mapped button value changes.
|
|
|
- Logger.Warn('Missing button submesh under mesh with name: ' + buttonMeshName);
|
|
|
+ Logger.Warn("Missing button submesh under mesh with name: " + buttonMeshName);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
|
|
|
// Axis Meshes
|
|
@@ -163,12 +163,14 @@ export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionCon
|
|
|
}
|
|
|
|
|
|
["x-axis", "y-axis"].forEach((axis) => {
|
|
|
- if (!this.rootMesh) { return; }
|
|
|
+ if (!this.rootMesh) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
const axisMap = (<any>this._mapping.axes)[id][axis];
|
|
|
|
|
|
var axisMesh = this._getChildByName(this.rootMesh, axisMap.rootNodeName);
|
|
|
if (!axisMesh) {
|
|
|
- Logger.Warn('Missing axis mesh with name: ' + axisMap.rootNodeName);
|
|
|
+ Logger.Warn("Missing axis mesh with name: " + axisMap.rootNodeName);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -178,17 +180,19 @@ export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionCon
|
|
|
|
|
|
if (axisMap.valueMesh && axisMap.minMesh && axisMap.maxMesh) {
|
|
|
if (comp) {
|
|
|
- comp.onAxisValueChangedObservable.add((axisValues) => {
|
|
|
- const value = axis === "x-axis" ? axisValues.x : axisValues.y;
|
|
|
- this._lerpTransform(axisMap, value, true);
|
|
|
- }, undefined, true);
|
|
|
+ comp.onAxisValueChangedObservable.add(
|
|
|
+ (axisValues) => {
|
|
|
+ const value = axis === "x-axis" ? axisValues.x : axisValues.y;
|
|
|
+ this._lerpTransform(axisMap, value, true);
|
|
|
+ },
|
|
|
+ undefined,
|
|
|
+ true
|
|
|
+ );
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
// If we didn't find the mesh, it simply means this button won't have transforms applied as mapped button value changes.
|
|
|
- Logger.Warn('Missing axis submesh under mesh with name: ' + axisMap.rootNodeName);
|
|
|
+ Logger.Warn("Missing axis submesh under mesh with name: " + axisMap.rootNodeName);
|
|
|
}
|
|
|
-
|
|
|
});
|
|
|
});
|
|
|
}
|
|
@@ -225,365 +229,279 @@ export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionCon
|
|
|
|
|
|
// register the profile
|
|
|
WebXRMotionControllerManager.RegisterController("windows-mixed-reality", (xrInput: XRInputSource, scene: Scene) => {
|
|
|
- return new WebXRMicrosoftMixedRealityController(scene, <any>(xrInput.gamepad), xrInput.handedness);
|
|
|
+ return new WebXRMicrosoftMixedRealityController(scene, <any>xrInput.gamepad, xrInput.handedness);
|
|
|
});
|
|
|
|
|
|
// https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/microsoft/microsoft-mixed-reality.json
|
|
|
const MixedRealityProfile: IMotionControllerLayoutMap = {
|
|
|
- "left": {
|
|
|
- "selectComponentId": "xr-standard-trigger",
|
|
|
- "components": {
|
|
|
+ left: {
|
|
|
+ selectComponentId: "xr-standard-trigger",
|
|
|
+ components: {
|
|
|
"xr-standard-trigger": {
|
|
|
- "type": "trigger",
|
|
|
- "gamepadIndices": {
|
|
|
- "button": 0
|
|
|
+ type: "trigger",
|
|
|
+ gamepadIndices: {
|
|
|
+ button: 0,
|
|
|
+ },
|
|
|
+ rootNodeName: "xr_standard_trigger",
|
|
|
+ visualResponses: {
|
|
|
+ xr_standard_trigger_pressed: {
|
|
|
+ componentProperty: "button",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_trigger_pressed_value",
|
|
|
+ minNodeName: "xr_standard_trigger_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_trigger_pressed_max",
|
|
|
+ },
|
|
|
},
|
|
|
- "rootNodeName": "xr_standard_trigger",
|
|
|
- "visualResponses": {
|
|
|
- "xr_standard_trigger_pressed": {
|
|
|
- "componentProperty": "button",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_trigger_pressed_value",
|
|
|
- "minNodeName": "xr_standard_trigger_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_trigger_pressed_max"
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
"xr-standard-squeeze": {
|
|
|
- "type": "squeeze",
|
|
|
- "gamepadIndices": {
|
|
|
- "button": 1
|
|
|
+ type: "squeeze",
|
|
|
+ gamepadIndices: {
|
|
|
+ button: 1,
|
|
|
+ },
|
|
|
+ rootNodeName: "xr_standard_squeeze",
|
|
|
+ visualResponses: {
|
|
|
+ xr_standard_squeeze_pressed: {
|
|
|
+ componentProperty: "button",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_squeeze_pressed_value",
|
|
|
+ minNodeName: "xr_standard_squeeze_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_squeeze_pressed_max",
|
|
|
+ },
|
|
|
},
|
|
|
- "rootNodeName": "xr_standard_squeeze",
|
|
|
- "visualResponses": {
|
|
|
- "xr_standard_squeeze_pressed": {
|
|
|
- "componentProperty": "button",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_squeeze_pressed_value",
|
|
|
- "minNodeName": "xr_standard_squeeze_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_squeeze_pressed_max"
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
"xr-standard-touchpad": {
|
|
|
- "type": "touchpad",
|
|
|
- "gamepadIndices": {
|
|
|
- "button": 2,
|
|
|
- "xAxis": 0,
|
|
|
- "yAxis": 1
|
|
|
+ type: "touchpad",
|
|
|
+ gamepadIndices: {
|
|
|
+ button: 2,
|
|
|
+ xAxis: 0,
|
|
|
+ yAxis: 1,
|
|
|
},
|
|
|
- "rootNodeName": "xr_standard_touchpad",
|
|
|
- "visualResponses": {
|
|
|
- "xr_standard_touchpad_pressed": {
|
|
|
- "componentProperty": "button",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_touchpad_pressed_value",
|
|
|
- "minNodeName": "xr_standard_touchpad_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_touchpad_pressed_max"
|
|
|
+ rootNodeName: "xr_standard_touchpad",
|
|
|
+ visualResponses: {
|
|
|
+ xr_standard_touchpad_pressed: {
|
|
|
+ componentProperty: "button",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_touchpad_pressed_value",
|
|
|
+ minNodeName: "xr_standard_touchpad_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_touchpad_pressed_max",
|
|
|
},
|
|
|
- "xr_standard_touchpad_xaxis_pressed": {
|
|
|
- "componentProperty": "xAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_touchpad_xaxis_pressed_value",
|
|
|
- "minNodeName": "xr_standard_touchpad_xaxis_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_touchpad_xaxis_pressed_max"
|
|
|
+ xr_standard_touchpad_xaxis_pressed: {
|
|
|
+ componentProperty: "xAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_touchpad_xaxis_pressed_value",
|
|
|
+ minNodeName: "xr_standard_touchpad_xaxis_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_touchpad_xaxis_pressed_max",
|
|
|
},
|
|
|
- "xr_standard_touchpad_yaxis_pressed": {
|
|
|
- "componentProperty": "yAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_touchpad_yaxis_pressed_value",
|
|
|
- "minNodeName": "xr_standard_touchpad_yaxis_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_touchpad_yaxis_pressed_max"
|
|
|
+ xr_standard_touchpad_yaxis_pressed: {
|
|
|
+ componentProperty: "yAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_touchpad_yaxis_pressed_value",
|
|
|
+ minNodeName: "xr_standard_touchpad_yaxis_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_touchpad_yaxis_pressed_max",
|
|
|
},
|
|
|
- "xr_standard_touchpad_xaxis_touched": {
|
|
|
- "componentProperty": "xAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_touchpad_xaxis_touched_value",
|
|
|
- "minNodeName": "xr_standard_touchpad_xaxis_touched_min",
|
|
|
- "maxNodeName": "xr_standard_touchpad_xaxis_touched_max"
|
|
|
+ xr_standard_touchpad_xaxis_touched: {
|
|
|
+ componentProperty: "xAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_touchpad_xaxis_touched_value",
|
|
|
+ minNodeName: "xr_standard_touchpad_xaxis_touched_min",
|
|
|
+ maxNodeName: "xr_standard_touchpad_xaxis_touched_max",
|
|
|
},
|
|
|
- "xr_standard_touchpad_yaxis_touched": {
|
|
|
- "componentProperty": "yAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_touchpad_yaxis_touched_value",
|
|
|
- "minNodeName": "xr_standard_touchpad_yaxis_touched_min",
|
|
|
- "maxNodeName": "xr_standard_touchpad_yaxis_touched_max"
|
|
|
+ xr_standard_touchpad_yaxis_touched: {
|
|
|
+ componentProperty: "yAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_touchpad_yaxis_touched_value",
|
|
|
+ minNodeName: "xr_standard_touchpad_yaxis_touched_min",
|
|
|
+ maxNodeName: "xr_standard_touchpad_yaxis_touched_max",
|
|
|
+ },
|
|
|
+ xr_standard_touchpad_axes_touched: {
|
|
|
+ componentProperty: "state",
|
|
|
+ states: ["touched", "pressed"],
|
|
|
+ valueNodeProperty: "visibility",
|
|
|
+ valueNodeName: "xr_standard_touchpad_axes_touched_value",
|
|
|
},
|
|
|
- "xr_standard_touchpad_axes_touched": {
|
|
|
- "componentProperty": "state",
|
|
|
- "states": [
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "visibility",
|
|
|
- "valueNodeName": "xr_standard_touchpad_axes_touched_value"
|
|
|
- }
|
|
|
},
|
|
|
- "touchPointNodeName": "xr_standard_touchpad_axes_touched_value"
|
|
|
+ touchPointNodeName: "xr_standard_touchpad_axes_touched_value",
|
|
|
},
|
|
|
"xr-standard-thumbstick": {
|
|
|
- "type": "thumbstick",
|
|
|
- "gamepadIndices": {
|
|
|
- "button": 3,
|
|
|
- "xAxis": 2,
|
|
|
- "yAxis": 3
|
|
|
+ type: "thumbstick",
|
|
|
+ gamepadIndices: {
|
|
|
+ button: 3,
|
|
|
+ xAxis: 2,
|
|
|
+ yAxis: 3,
|
|
|
},
|
|
|
- "rootNodeName": "xr_standard_thumbstick",
|
|
|
- "visualResponses": {
|
|
|
- "xr_standard_thumbstick_pressed": {
|
|
|
- "componentProperty": "button",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_thumbstick_pressed_value",
|
|
|
- "minNodeName": "xr_standard_thumbstick_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_thumbstick_pressed_max"
|
|
|
+ rootNodeName: "xr_standard_thumbstick",
|
|
|
+ visualResponses: {
|
|
|
+ xr_standard_thumbstick_pressed: {
|
|
|
+ componentProperty: "button",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_thumbstick_pressed_value",
|
|
|
+ minNodeName: "xr_standard_thumbstick_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_thumbstick_pressed_max",
|
|
|
},
|
|
|
- "xr_standard_thumbstick_xaxis_pressed": {
|
|
|
- "componentProperty": "xAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value",
|
|
|
- "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max"
|
|
|
+ xr_standard_thumbstick_xaxis_pressed: {
|
|
|
+ componentProperty: "xAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value",
|
|
|
+ minNodeName: "xr_standard_thumbstick_xaxis_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max",
|
|
|
},
|
|
|
- "xr_standard_thumbstick_yaxis_pressed": {
|
|
|
- "componentProperty": "yAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value",
|
|
|
- "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max"
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ xr_standard_thumbstick_yaxis_pressed: {
|
|
|
+ componentProperty: "yAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value",
|
|
|
+ minNodeName: "xr_standard_thumbstick_yaxis_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
- "gamepadMapping": "xr-standard",
|
|
|
- "rootNodeName": "microsoft-mixed-reality-left",
|
|
|
- "assetPath": "left.glb"
|
|
|
+ gamepadMapping: "xr-standard",
|
|
|
+ rootNodeName: "microsoft-mixed-reality-left",
|
|
|
+ assetPath: "left.glb",
|
|
|
},
|
|
|
- "right": {
|
|
|
- "selectComponentId": "xr-standard-trigger",
|
|
|
- "components": {
|
|
|
+ right: {
|
|
|
+ selectComponentId: "xr-standard-trigger",
|
|
|
+ components: {
|
|
|
"xr-standard-trigger": {
|
|
|
- "type": "trigger",
|
|
|
- "gamepadIndices": {
|
|
|
- "button": 0
|
|
|
+ type: "trigger",
|
|
|
+ gamepadIndices: {
|
|
|
+ button: 0,
|
|
|
+ },
|
|
|
+ rootNodeName: "xr_standard_trigger",
|
|
|
+ visualResponses: {
|
|
|
+ xr_standard_trigger_pressed: {
|
|
|
+ componentProperty: "button",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_trigger_pressed_value",
|
|
|
+ minNodeName: "xr_standard_trigger_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_trigger_pressed_max",
|
|
|
+ },
|
|
|
},
|
|
|
- "rootNodeName": "xr_standard_trigger",
|
|
|
- "visualResponses": {
|
|
|
- "xr_standard_trigger_pressed": {
|
|
|
- "componentProperty": "button",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_trigger_pressed_value",
|
|
|
- "minNodeName": "xr_standard_trigger_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_trigger_pressed_max"
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
"xr-standard-squeeze": {
|
|
|
- "type": "squeeze",
|
|
|
- "gamepadIndices": {
|
|
|
- "button": 1
|
|
|
+ type: "squeeze",
|
|
|
+ gamepadIndices: {
|
|
|
+ button: 1,
|
|
|
+ },
|
|
|
+ rootNodeName: "xr_standard_squeeze",
|
|
|
+ visualResponses: {
|
|
|
+ xr_standard_squeeze_pressed: {
|
|
|
+ componentProperty: "button",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_squeeze_pressed_value",
|
|
|
+ minNodeName: "xr_standard_squeeze_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_squeeze_pressed_max",
|
|
|
+ },
|
|
|
},
|
|
|
- "rootNodeName": "xr_standard_squeeze",
|
|
|
- "visualResponses": {
|
|
|
- "xr_standard_squeeze_pressed": {
|
|
|
- "componentProperty": "button",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_squeeze_pressed_value",
|
|
|
- "minNodeName": "xr_standard_squeeze_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_squeeze_pressed_max"
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
"xr-standard-touchpad": {
|
|
|
- "type": "touchpad",
|
|
|
- "gamepadIndices": {
|
|
|
- "button": 2,
|
|
|
- "xAxis": 0,
|
|
|
- "yAxis": 1
|
|
|
+ type: "touchpad",
|
|
|
+ gamepadIndices: {
|
|
|
+ button: 2,
|
|
|
+ xAxis: 0,
|
|
|
+ yAxis: 1,
|
|
|
},
|
|
|
- "rootNodeName": "xr_standard_touchpad",
|
|
|
- "visualResponses": {
|
|
|
- "xr_standard_touchpad_pressed": {
|
|
|
- "componentProperty": "button",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_touchpad_pressed_value",
|
|
|
- "minNodeName": "xr_standard_touchpad_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_touchpad_pressed_max"
|
|
|
+ rootNodeName: "xr_standard_touchpad",
|
|
|
+ visualResponses: {
|
|
|
+ xr_standard_touchpad_pressed: {
|
|
|
+ componentProperty: "button",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_touchpad_pressed_value",
|
|
|
+ minNodeName: "xr_standard_touchpad_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_touchpad_pressed_max",
|
|
|
},
|
|
|
- "xr_standard_touchpad_xaxis_pressed": {
|
|
|
- "componentProperty": "xAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_touchpad_xaxis_pressed_value",
|
|
|
- "minNodeName": "xr_standard_touchpad_xaxis_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_touchpad_xaxis_pressed_max"
|
|
|
+ xr_standard_touchpad_xaxis_pressed: {
|
|
|
+ componentProperty: "xAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_touchpad_xaxis_pressed_value",
|
|
|
+ minNodeName: "xr_standard_touchpad_xaxis_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_touchpad_xaxis_pressed_max",
|
|
|
},
|
|
|
- "xr_standard_touchpad_yaxis_pressed": {
|
|
|
- "componentProperty": "yAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_touchpad_yaxis_pressed_value",
|
|
|
- "minNodeName": "xr_standard_touchpad_yaxis_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_touchpad_yaxis_pressed_max"
|
|
|
+ xr_standard_touchpad_yaxis_pressed: {
|
|
|
+ componentProperty: "yAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_touchpad_yaxis_pressed_value",
|
|
|
+ minNodeName: "xr_standard_touchpad_yaxis_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_touchpad_yaxis_pressed_max",
|
|
|
},
|
|
|
- "xr_standard_touchpad_xaxis_touched": {
|
|
|
- "componentProperty": "xAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_touchpad_xaxis_touched_value",
|
|
|
- "minNodeName": "xr_standard_touchpad_xaxis_touched_min",
|
|
|
- "maxNodeName": "xr_standard_touchpad_xaxis_touched_max"
|
|
|
+ xr_standard_touchpad_xaxis_touched: {
|
|
|
+ componentProperty: "xAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_touchpad_xaxis_touched_value",
|
|
|
+ minNodeName: "xr_standard_touchpad_xaxis_touched_min",
|
|
|
+ maxNodeName: "xr_standard_touchpad_xaxis_touched_max",
|
|
|
},
|
|
|
- "xr_standard_touchpad_yaxis_touched": {
|
|
|
- "componentProperty": "yAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_touchpad_yaxis_touched_value",
|
|
|
- "minNodeName": "xr_standard_touchpad_yaxis_touched_min",
|
|
|
- "maxNodeName": "xr_standard_touchpad_yaxis_touched_max"
|
|
|
+ xr_standard_touchpad_yaxis_touched: {
|
|
|
+ componentProperty: "yAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_touchpad_yaxis_touched_value",
|
|
|
+ minNodeName: "xr_standard_touchpad_yaxis_touched_min",
|
|
|
+ maxNodeName: "xr_standard_touchpad_yaxis_touched_max",
|
|
|
+ },
|
|
|
+ xr_standard_touchpad_axes_touched: {
|
|
|
+ componentProperty: "state",
|
|
|
+ states: ["touched", "pressed"],
|
|
|
+ valueNodeProperty: "visibility",
|
|
|
+ valueNodeName: "xr_standard_touchpad_axes_touched_value",
|
|
|
},
|
|
|
- "xr_standard_touchpad_axes_touched": {
|
|
|
- "componentProperty": "state",
|
|
|
- "states": [
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "visibility",
|
|
|
- "valueNodeName": "xr_standard_touchpad_axes_touched_value"
|
|
|
- }
|
|
|
},
|
|
|
- "touchPointNodeName": "xr_standard_touchpad_axes_touched_value"
|
|
|
+ touchPointNodeName: "xr_standard_touchpad_axes_touched_value",
|
|
|
},
|
|
|
"xr-standard-thumbstick": {
|
|
|
- "type": "thumbstick",
|
|
|
- "gamepadIndices": {
|
|
|
- "button": 3,
|
|
|
- "xAxis": 2,
|
|
|
- "yAxis": 3
|
|
|
+ type: "thumbstick",
|
|
|
+ gamepadIndices: {
|
|
|
+ button: 3,
|
|
|
+ xAxis: 2,
|
|
|
+ yAxis: 3,
|
|
|
},
|
|
|
- "rootNodeName": "xr_standard_thumbstick",
|
|
|
- "visualResponses": {
|
|
|
- "xr_standard_thumbstick_pressed": {
|
|
|
- "componentProperty": "button",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_thumbstick_pressed_value",
|
|
|
- "minNodeName": "xr_standard_thumbstick_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_thumbstick_pressed_max"
|
|
|
+ rootNodeName: "xr_standard_thumbstick",
|
|
|
+ visualResponses: {
|
|
|
+ xr_standard_thumbstick_pressed: {
|
|
|
+ componentProperty: "button",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_thumbstick_pressed_value",
|
|
|
+ minNodeName: "xr_standard_thumbstick_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_thumbstick_pressed_max",
|
|
|
},
|
|
|
- "xr_standard_thumbstick_xaxis_pressed": {
|
|
|
- "componentProperty": "xAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_thumbstick_xaxis_pressed_value",
|
|
|
- "minNodeName": "xr_standard_thumbstick_xaxis_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_thumbstick_xaxis_pressed_max"
|
|
|
+ xr_standard_thumbstick_xaxis_pressed: {
|
|
|
+ componentProperty: "xAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_thumbstick_xaxis_pressed_value",
|
|
|
+ minNodeName: "xr_standard_thumbstick_xaxis_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_thumbstick_xaxis_pressed_max",
|
|
|
},
|
|
|
- "xr_standard_thumbstick_yaxis_pressed": {
|
|
|
- "componentProperty": "yAxis",
|
|
|
- "states": [
|
|
|
- "default",
|
|
|
- "touched",
|
|
|
- "pressed"
|
|
|
- ],
|
|
|
- "valueNodeProperty": "transform",
|
|
|
- "valueNodeName": "xr_standard_thumbstick_yaxis_pressed_value",
|
|
|
- "minNodeName": "xr_standard_thumbstick_yaxis_pressed_min",
|
|
|
- "maxNodeName": "xr_standard_thumbstick_yaxis_pressed_max"
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ xr_standard_thumbstick_yaxis_pressed: {
|
|
|
+ componentProperty: "yAxis",
|
|
|
+ states: ["default", "touched", "pressed"],
|
|
|
+ valueNodeProperty: "transform",
|
|
|
+ valueNodeName: "xr_standard_thumbstick_yaxis_pressed_value",
|
|
|
+ minNodeName: "xr_standard_thumbstick_yaxis_pressed_min",
|
|
|
+ maxNodeName: "xr_standard_thumbstick_yaxis_pressed_max",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
- "gamepadMapping": "xr-standard",
|
|
|
- "rootNodeName": "microsoft-mixed-reality-right",
|
|
|
- "assetPath": "right.glb"
|
|
|
- }
|
|
|
-};
|
|
|
+ gamepadMapping: "xr-standard",
|
|
|
+ rootNodeName: "microsoft-mixed-reality-right",
|
|
|
+ assetPath: "right.glb",
|
|
|
+ },
|
|
|
+};
|