@@ -22559,7 +22559,7 @@ var isWebXRAvailable = (__webpack_require__(/*! ../utils/ */ "./src/utils/index.
2255922559var GAMEPAD_ID_WEBXR = 'htc-vive';
2256022560var GAMEPAD_ID_WEBVR = 'OpenVR ';
2256122561
22562- // Prefix for Gen1 and Gen2 Oculus Touch Controllers.
22562+ // Prefix for HTC Vive Controllers.
2256322563var GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;
2256422564
2256522565/**
@@ -22592,16 +22592,16 @@ var INPUT_MAPPING_WEBVR = {
2259222592 */
2259322593var INPUT_MAPPING_WEBXR = {
2259422594 axes: {
22595- thumbstick : [0, 1]
22595+ touchpad : [0, 1]
2259622596 },
22597- buttons: ['trigger', 'grip', 'trackpad ', 'none', 'menu ']
22597+ buttons: ['trigger', 'grip', 'touchpad ', 'none']
2259822598};
2259922599var INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;
2260022600
2260122601/**
2260222602 * Vive controls.
2260322603 * Interface with Vive controllers and map Gamepad events to controller buttons:
22604- * trackpad , trigger, grip, menu, system
22604+ * touchpad , trigger, grip, menu, system
2260522605 * Load a controller model and highlight the pressed buttons.
2260622606 */
2260722607module.exports.Component = registerComponent('vive-controls', {
@@ -22769,6 +22769,7 @@ module.exports.Component = registerComponent('vive-controls', {
2276922769 buttonMeshes.menu = controllerObject3D.getObjectByName('menubutton');
2277022770 buttonMeshes.system = controllerObject3D.getObjectByName('systembutton');
2277122771 buttonMeshes.trackpad = controllerObject3D.getObjectByName('touchpad');
22772+ buttonMeshes.touchpad = controllerObject3D.getObjectByName('touchpad');
2277222773 buttonMeshes.trigger = controllerObject3D.getObjectByName('trigger');
2277322774
2277422775 // Set default colors.
@@ -22827,9 +22828,40 @@ var trackedControlsUtils = __webpack_require__(/*! ../utils/tracked-controls */
2282722828var checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;
2282822829var emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;
2282922830var onButtonEvent = trackedControlsUtils.onButtonEvent;
22830- var GAMEPAD_ID_PREFIX = 'HTC Vive Focus';
2283122831var AFRAME_CDN_ROOT = (__webpack_require__(/*! ../constants */ "./src/constants/index.js").AFRAME_CDN_ROOT);
2283222832var VIVE_FOCUS_CONTROLLER_MODEL_URL = AFRAME_CDN_ROOT + 'controllers/vive/focus-controller/focus-controller.gltf';
22833+ var isWebXRAvailable = (__webpack_require__(/*! ../utils/ */ "./src/utils/index.js").device.isWebXRAvailable);
22834+ var GAMEPAD_ID_WEBXR = 'htc-vive-focus';
22835+ var GAMEPAD_ID_WEBVR = 'HTC Vive Focus ';
22836+
22837+ // Prefix for HTC Vive Focus Controllers.
22838+ var GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;
22839+
22840+ /**
22841+ * Button IDs:
22842+ * 0 - trackpad
22843+ * 1 - trigger
22844+ */
22845+ var INPUT_MAPPING_WEBVR = {
22846+ axes: {
22847+ trackpad: [0, 1]
22848+ },
22849+ buttons: ['trackpad', 'trigger']
22850+ };
22851+
22852+ /**
22853+ * Button IDs:
22854+ * 0 - trigger
22855+ * 2 - touchpad
22856+ * 4 - menu
22857+ */
22858+ var INPUT_MAPPING_WEBXR = {
22859+ axes: {
22860+ touchpad: [0, 1]
22861+ },
22862+ buttons: ['trigger', 'none', 'touchpad', 'none', 'menu']
22863+ };
22864+ var INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;
2283322865
2283422866/**
2283522867 * Vive Focus controls.
@@ -22861,17 +22893,7 @@ module.exports.Component = registerComponent('vive-focus-controls', {
2286122893 default: true
2286222894 }
2286322895 },
22864- /**
22865- * Button IDs:
22866- * 0 - trackpad
22867- * 1 - trigger
22868- */
22869- mapping: {
22870- axes: {
22871- trackpad: [0, 1]
22872- },
22873- buttons: ['trackpad', 'trigger']
22874- },
22896+ mapping: INPUT_MAPPING,
2287522897 bindMethods: function () {
2287622898 this.onModelLoaded = this.onModelLoaded.bind(this);
2287722899 this.onControllersUpdate = this.onControllersUpdate.bind(this);
@@ -29839,7 +29861,7 @@ __webpack_require__(/*! ./core/a-mixin */ "./src/core/a-mixin.js");
2983929861// Extras.
2984029862__webpack_require__(/*! ./extras/components/ */ "./src/extras/components/index.js");
2984129863__webpack_require__(/*! ./extras/primitives/ */ "./src/extras/primitives/index.js");
29842- console.log('A-Frame Version: 1.5.0 (Date 2024-02-20 , Commit #fecd166c )');
29864+ console.log('A-Frame Version: 1.5.0 (Date 2024-02-23 , Commit #dd3913c4 )');
2984329865console.log('THREE Version (https://github.com/supermedium/three.js):', pkg.dependencies['super-three']);
2984429866console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);
2984529867module.exports = window.AFRAME = {
@@ -32484,7 +32506,7 @@ var supportsARSession = false;
3248432506 * Oculus Browser 7 doesn't support the WebXR gamepads module.
3248532507 * We fallback to WebVR API and will hotfix when implementation is complete.
3248632508 */
32487- var isWebXRAvailable = module.exports.isWebXRAvailable = !window.debug && navigator.xr !== undefined;
32509+ var isWebXRAvailable = module.exports.isWebXRAvailable = navigator.xr !== undefined;
3248832510
3248932511// Catch vrdisplayactivate early to ensure we can enter VR mode after the scene loads.
3249032512window.addEventListener('vrdisplayactivate', function (evt) {
0 commit comments