@@ -69028,6 +69028,39 @@ var GAMEPAD_ID_WEBVR = 'Daydream Controller';
6902869028
6902969029var GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;
6903069030
69031+ /**
69032+ * Button indices:
69033+ * 0 - trackpad
69034+ * 1 - menu (never dispatched on this layer)
69035+ * 2 - system (never dispatched on this layer)
69036+ *
69037+ * Axis:
69038+ * 0 - trackpad x
69039+ * 1 - trackpad y
69040+ */
69041+ var INPUT_MAPPING_WEBVR = {
69042+ axes: {trackpad: [0, 1]},
69043+ buttons: ['trackpad', 'menu', 'system']
69044+ };
69045+
69046+ /**
69047+ * Button indices:
69048+ * 0 - none
69049+ * 1 - none
69050+ * 2 - touchpad
69051+ *
69052+ * Axis:
69053+ * 0 - touchpad x
69054+ * 1 - touchpad y
69055+ * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/google/google-daydream.json
69056+ */
69057+ var INPUT_MAPPING_WEBXR = {
69058+ axes: {touchpad: [0, 1]},
69059+ buttons: ['none', 'none', 'touchpad', 'menu', 'system']
69060+ };
69061+
69062+ var INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;
69063+
6903169064/**
6903269065 * Daydream controls.
6903369066 * Interface with Daydream controller and map Gamepad events to
@@ -69045,16 +69078,7 @@ module.exports.Component = registerComponent('daydream-controls', {
6904569078 armModel: {default: true}
6904669079 },
6904769080
69048- /**
69049- * Button IDs:
69050- * 0 - trackpad
69051- * 1 - menu (never dispatched on this layer)
69052- * 2 - system (never dispatched on this layer)
69053- */
69054- mapping: {
69055- axes: {trackpad: [0, 1]},
69056- buttons: ['trackpad', 'menu', 'system']
69057- },
69081+ mapping: INPUT_MAPPING,
6905869082
6905969083 bindMethods: function () {
6906069084 this.onModelLoaded = bind(this.onModelLoaded, this);
@@ -69101,7 +69125,8 @@ module.exports.Component = registerComponent('daydream-controls', {
6910169125 },
6910269126
6910369127 checkIfControllerPresent: function () {
69104- checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {hand: this.data.hand});
69128+ checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX,
69129+ this.data.hand ? {hand: this.data.hand} : {});
6910569130 },
6910669131
6910769132 play: function () {
@@ -69121,6 +69146,7 @@ module.exports.Component = registerComponent('daydream-controls', {
6912169146 armModel: data.armModel,
6912269147 hand: data.hand,
6912369148 idPrefix: GAMEPAD_ID_PREFIX,
69149+ id: GAMEPAD_ID_PREFIX,
6912469150 orientationOffset: data.orientationOffset
6912569151 });
6912669152 if (!this.data.model) { return; }
@@ -69150,6 +69176,7 @@ module.exports.Component = registerComponent('daydream-controls', {
6915069176 buttonMeshes.menu = controllerObject3D.getObjectByName('AppButton_AppButton_Cylinder.004');
6915169177 buttonMeshes.system = controllerObject3D.getObjectByName('HomeButton_HomeButton_Cylinder.005');
6915269178 buttonMeshes.trackpad = controllerObject3D.getObjectByName('TouchPad_TouchPad_Cylinder.003');
69179+ buttonMeshes.touchpad = controllerObject3D.getObjectByName('TouchPad_TouchPad_Cylinder.003');
6915369180 // Offset pivot point.
6915469181 controllerObject3D.position.set(0, 0, -0.04);
6915569182 },
@@ -69232,17 +69259,11 @@ var INPUT_MAPPING_WEBVR = {
6923269259 * Axis:
6923369260 * 0 - touchpad x
6923469261 * 1 - touchpad y
69235- * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/oculus/oculus-go .json
69262+ * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/samsung/samsung-gearvr .json
6923669263 */
6923769264var INPUT_MAPPING_WEBXR = {
69238- left: {
69239- axes: {touchpad: [0, 1]},
69240- buttons: ['trigger', 'none', 'touchpad', 'menu']
69241- },
69242- right: {
69243- axes: {touchpad: [0, 1]},
69244- buttons: ['trigger', 'none', 'touchpad', 'menu']
69245- }
69265+ axes: {touchpad: [0, 1]},
69266+ buttons: ['trigger', 'none', 'touchpad', 'none', 'menu']
6924669267};
6924769268
6924869269var INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;
@@ -69264,11 +69285,6 @@ module.exports.Component = registerComponent('gearvr-controls', {
6926469285 armModel: {default: true}
6926569286 },
6926669287
69267- /**
69268- * Button IDs:
69269- * 0 - trackpad
69270- * 1 - trigger
69271- */
6927269288 mapping: INPUT_MAPPING,
6927369289
6927469290 bindMethods: function () {
@@ -69368,6 +69384,7 @@ module.exports.Component = registerComponent('gearvr-controls', {
6936869384 buttonMeshes = this.buttonMeshes = {};
6936969385 buttonMeshes.trigger = controllerObject3D.children[2];
6937069386 buttonMeshes.trackpad = controllerObject3D.children[1];
69387+ buttonMeshes.touchpad = controllerObject3D.children[1];
6937169388 },
6937269389
6937369390 onButtonChanged: function (evt) {
@@ -72122,11 +72139,6 @@ module.exports.Component = registerComponent('oculus-go-controls', {
7212272139 armModel: {default: true}
7212372140 },
7212472141
72125- /**
72126- * Button IDs:
72127- * 0 - trackpad
72128- * 1 - trigger
72129- */
7213072142 mapping: INPUT_MAPPING,
7213172143
7213272144 bindMethods: function () {
@@ -72224,6 +72236,7 @@ module.exports.Component = registerComponent('oculus-go-controls', {
7222472236 buttonMeshes = this.buttonMeshes = {};
7222572237 buttonMeshes.trigger = controllerObject3D.getObjectByName('oculus_go_button_trigger');
7222672238 buttonMeshes.trackpad = controllerObject3D.getObjectByName('oculus_go_touchpad');
72239+ buttonMeshes.touchpad = controllerObject3D.getObjectByName('oculus_go_touchpad');
7222772240 },
7222872241
7222972242 onButtonChanged: function (evt) {
@@ -82813,7 +82826,7 @@ _dereq_('./core/a-mixin');
8281382826_dereq_('./extras/components/');
8281482827_dereq_('./extras/primitives/');
8281582828
82816- console.log('A-Frame Version: 1.0.4 (Date 2020-05-13, Commit #5178b92a )');
82829+ console.log('A-Frame Version: 1.0.4 (Date 2020-05-13, Commit #ef405451 )');
8281782830console.log('THREE Version (https://github.com/supermedium/three.js):',
8281882831 pkg.dependencies['super-three']);
8281982832console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);
@@ -86301,14 +86314,13 @@ function findMatchingControllerWebXR (controllers, idPrefix, handedness, index,
8630186314 for (i = 0; i < controllers.length; i++) {
8630286315 controller = controllers[i];
8630386316 profiles = controller.profiles;
86304- if (profiles.length === 0) { return; }
8630586317 if (iterateProfiles) {
8630686318 for (j = 0; j < profiles.length; j++) {
8630786319 controllerMatch = profiles[j].startsWith(idPrefix);
8630886320 if (controllerMatch) { break; }
8630986321 }
8631086322 } else {
86311- controllerMatch = profiles[0].startsWith(idPrefix);
86323+ controllerMatch = profiles.length > 0 && profiles [0].startsWith(idPrefix);
8631286324 }
8631386325 if (!controllerMatch) { continue; }
8631486326 // Vive controllers are assigned handedness at runtime and it might not be always available.
0 commit comments