diff --git a/docs/components/magicleap-controls.md b/docs/components/magicleap-controls.md index a56cf1fa6cd..b09d722383e 100644 --- a/docs/components/magicleap-controls.md +++ b/docs/components/magicleap-controls.md @@ -31,7 +31,6 @@ mappings, events, and Magic Leap controller model/ |----------------------|----------------------------------------------------|----------------------| | hand | The hand that will be tracked (e.g., right, left). | | | model | Whether the Magic Leap controller model is loaded. | true | -| orientationOffset | Offset to apply to model orientation. | x: 0, y: 0, z: 0 | ## Events diff --git a/docs/components/oculus-touch-controls.md b/docs/components/oculus-touch-controls.md index 91c901654f4..3fb3903ebfc 100644 --- a/docs/components/oculus-touch-controls.md +++ b/docs/components/oculus-touch-controls.md @@ -26,7 +26,6 @@ mappings, events, and a Touch controller model. |----------------------|----------------------------------------------------|----------------------| | hand | The hand that will be tracked (i.e., right, left). | left | | model | Whether the Touch controller model is loaded. | true | -| orientationOffset | Offset to apply to model orientation. | x: 0, y: 0, z: 0 | ## Events diff --git a/docs/components/tracked-controls.md b/docs/components/tracked-controls.md index a1924524fce..571050680a0 100644 --- a/docs/components/tracked-controls.md +++ b/docs/components/tracked-controls.md @@ -46,7 +46,6 @@ so using idPrefix for Vive / OpenVR controllers is recommended. | idPrefix | Selects the controller from the Gamepad API using prefix match. | | | headElement | Head element for arm model if needed (if not active camera). | | | hand | Which hand to use, if arm model is needed. (left negates X) | right | -| orientationOffset | Offset to apply to model orientation. | x: 0, y: 0, z: 0 | | space | Specifies whether to use targetRayspace or gripSpace to determine controller pose. | targetRaySpace | ## Events diff --git a/docs/components/vive-controls.md b/docs/components/vive-controls.md index 8fe71565c83..9f27d1c243a 100644 --- a/docs/components/vive-controls.md +++ b/docs/components/vive-controls.md @@ -29,7 +29,6 @@ buttons (trigger, grip, menu, system) and trackpad. | buttonHighlightColor | Button colors when pressed and active. | #22D1EE (light blue) | | hand | The hand that will be tracked (i.e., right, left). | left | | model | Whether the Vive controller model is loaded. | true | -| orientationOffset | Offset to apply to model orientation. | x: 0, y: 0, z: 0 | ## Events diff --git a/docs/components/vive-focus-controls.md b/docs/components/vive-focus-controls.md index 282ac1e306e..14d87a1b8b4 100644 --- a/docs/components/vive-focus-controls.md +++ b/docs/components/vive-focus-controls.md @@ -34,7 +34,6 @@ and/or pressed buttons (trackpad, trigger). | buttonHighlightColor | Button colors when pressed and active. | #FFFFFF | | hand | The hand that will be tracked (e.g., right, left). | | | model | Whether the Vive Focus controller model is loaded. | true | -| orientationOffset | Offset to apply to model orientation. | x: 0, y: 0, z: 0 | ## Events diff --git a/docs/introduction/interactions-and-controllers.md b/docs/introduction/interactions-and-controllers.md index fdf02b2fea3..aa1c7912572 100644 --- a/docs/introduction/interactions-and-controllers.md +++ b/docs/introduction/interactions-and-controllers.md @@ -454,8 +454,7 @@ AFRAME.registerComponent('custom-controls', { var el = this.el; var controlConfiguration = { hand: hand, - model: false, - orientationOffset: {x: 0, y: 0, z: hand === 'left' ? 90 : -90} + model: false }; // Build on top of controller components. diff --git a/src/components/generic-tracked-controller-controls.js b/src/components/generic-tracked-controller-controls.js index 4327f968903..0181b5e8290 100644 --- a/src/components/generic-tracked-controller-controls.js +++ b/src/components/generic-tracked-controller-controls.js @@ -38,7 +38,6 @@ module.exports.Component = registerComponent('generic-tracked-controller-control hand: {default: ''}, // This informs the degenerate arm model. defaultModel: {default: true}, defaultModelColor: {default: 'gray'}, - orientationOffset: {type: 'vec3'}, disabled: {default: false} }, @@ -132,7 +131,6 @@ module.exports.Component = registerComponent('generic-tracked-controller-control el.setAttribute('tracked-controls', { hand: data.hand, idPrefix: GAMEPAD_ID_PREFIX, - orientationOffset: data.orientationOffset, iterateControllerProfiles: true }); if (!this.data.defaultModel) { return; } diff --git a/src/components/hp-mixed-reality-controls.js b/src/components/hp-mixed-reality-controls.js index 8af348aad5d..9e7d1db48de 100644 --- a/src/components/hp-mixed-reality-controls.js +++ b/src/components/hp-mixed-reality-controls.js @@ -44,8 +44,7 @@ var INPUT_MAPPING_WEBXR = { module.exports.Component = registerComponent('hp-mixed-reality-controls', { schema: { hand: {default: 'none'}, - model: {default: true}, - orientationOffset: {type: 'vec3'} + model: {default: true} }, mapping: INPUT_MAPPING_WEBXR, @@ -125,8 +124,7 @@ module.exports.Component = registerComponent('hp-mixed-reality-controls', { // TODO: verify expected behavior between reserved prefixes. idPrefix: GAMEPAD_ID, hand: data.hand, - controller: this.controllerIndex, - orientationOffset: data.orientationOffset + controller: this.controllerIndex }); // Load model. diff --git a/src/components/magicleap-controls.js b/src/components/magicleap-controls.js index 8e2c25ed982..8c80702b963 100644 --- a/src/components/magicleap-controls.js +++ b/src/components/magicleap-controls.js @@ -39,8 +39,7 @@ var INPUT_MAPPING_WEBXR = { module.exports.Component = registerComponent('magicleap-controls', { schema: { hand: {default: 'none'}, - model: {default: true}, - orientationOffset: {type: 'vec3'} + model: {default: true} }, mapping: INPUT_MAPPING_WEBXR, @@ -120,8 +119,7 @@ module.exports.Component = registerComponent('magicleap-controls', { // TODO: verify expected behavior between reserved prefixes. idPrefix: GAMEPAD_ID_COMPOSITE, hand: data.hand, - controller: this.controllerIndex, - orientationOffset: data.orientationOffset + controller: this.controllerIndex }); // Load model. diff --git a/src/components/oculus-go-controls.js b/src/components/oculus-go-controls.js index dbc2267c737..69d4bdb2d39 100644 --- a/src/components/oculus-go-controls.js +++ b/src/components/oculus-go-controls.js @@ -39,8 +39,7 @@ module.exports.Component = registerComponent('oculus-go-controls', { buttonColor: {type: 'color', default: '#FFFFFF'}, buttonTouchedColor: {type: 'color', default: '#BBBBBB'}, buttonHighlightColor: {type: 'color', default: '#7A7A7A'}, - model: {default: true}, - orientationOffset: {type: 'vec3'} + model: {default: true} }, mapping: INPUT_MAPPING, @@ -109,8 +108,7 @@ module.exports.Component = registerComponent('oculus-go-controls', { var data = this.data; el.setAttribute('tracked-controls', { hand: data.hand, - idPrefix: GAMEPAD_ID_PREFIX, - orientationOffset: data.orientationOffset + idPrefix: GAMEPAD_ID_PREFIX }); if (!this.data.model) { return; } this.el.setAttribute('gltf-model', OCULUS_GO_CONTROLLER_MODEL_URL); diff --git a/src/components/oculus-touch-controls.js b/src/components/oculus-touch-controls.js index bcbeddc81b1..2d0a3a9e88d 100644 --- a/src/components/oculus-touch-controls.js +++ b/src/components/oculus-touch-controls.js @@ -132,8 +132,7 @@ module.exports.Component = registerComponent('oculus-touch-controls', { buttonTouchColor: {type: 'color', default: '#8AB'}, buttonHighlightColor: {type: 'color', default: '#2DF'}, // Light blue. model: {default: true}, - controllerType: {default: 'auto', oneOf: ['auto', 'oculus-touch', 'oculus-touch-v2', 'oculus-touch-v3']}, - orientationOffset: {type: 'vec3', default: {x: 43, y: 0, z: 0}} + controllerType: {default: 'auto', oneOf: ['auto', 'oculus-touch', 'oculus-touch-v2', 'oculus-touch-v3']} }, mapping: INPUT_MAPPING, @@ -242,7 +241,6 @@ module.exports.Component = registerComponent('oculus-touch-controls', { this.el.setAttribute('tracked-controls', { id: id, hand: data.hand, - orientationOffset: data.orientationOffset, handTrackingEnabled: false, iterateControllerProfiles: true, space: 'gripSpace' diff --git a/src/components/pico-controls.js b/src/components/pico-controls.js index 2d0302ee612..a62aedcd6e6 100644 --- a/src/components/pico-controls.js +++ b/src/components/pico-controls.js @@ -41,8 +41,7 @@ var INPUT_MAPPING_WEBXR = { module.exports.Component = registerComponent('pico-controls', { schema: { hand: {default: 'none'}, - model: {default: true}, - orientationOffset: {type: 'vec3'} + model: {default: true} }, mapping: INPUT_MAPPING_WEBXR, @@ -117,8 +116,7 @@ module.exports.Component = registerComponent('pico-controls', { // TODO: verify expected behavior between reserved prefixes. idPrefix: GAMEPAD_ID, hand: data.hand, - controller: this.controllerIndex, - orientationOffset: data.orientationOffset + controller: this.controllerIndex }); // Load model. if (!this.data.model) { return; } diff --git a/src/components/tracked-controls.js b/src/components/tracked-controls.js index 9b392b334f2..b2b31b29999 100644 --- a/src/components/tracked-controls.js +++ b/src/components/tracked-controls.js @@ -18,7 +18,6 @@ module.exports.Component = registerComponent('tracked-controls', { hand: {type: 'string', default: ''}, idPrefix: {type: 'string', default: ''}, handTrackingEnabled: {default: false}, - orientationOffset: {type: 'vec3'}, iterateControllerProfiles: {default: false}, space: {type: 'string', oneOf: ['targetRaySpace', 'gripSpace'], default: 'targetRaySpace'} }, diff --git a/src/components/valve-index-controls.js b/src/components/valve-index-controls.js index f82e4334a9a..c65065eb285 100644 --- a/src/components/valve-index-controls.js +++ b/src/components/valve-index-controls.js @@ -36,8 +36,7 @@ module.exports.Component = registerComponent('valve-index-controls', { hand: {default: 'left'}, buttonColor: {type: 'color', default: '#FAFAFA'}, // Off-white. buttonHighlightColor: {type: 'color', default: '#22D1EE'}, // Light blue. - model: {default: true}, - orientationOffset: {type: 'vec3'} + model: {default: true} }, mapping: { @@ -125,8 +124,7 @@ module.exports.Component = registerComponent('valve-index-controls', { idPrefix: GAMEPAD_ID_PREFIX, // Hand IDs: 1 = right, 0 = left, 2 = anything else. controller: data.hand === 'right' ? 1 : data.hand === 'left' ? 0 : 2, - hand: data.hand, - orientationOffset: data.orientationOffset + hand: data.hand }); this.loadModel(); diff --git a/src/components/vive-controls.js b/src/components/vive-controls.js index 75da0aa2351..98824c03e0b 100644 --- a/src/components/vive-controls.js +++ b/src/components/vive-controls.js @@ -41,8 +41,7 @@ module.exports.Component = registerComponent('vive-controls', { hand: {default: 'left'}, buttonColor: {type: 'color', default: '#FAFAFA'}, // Off-white. buttonHighlightColor: {type: 'color', default: '#22D1EE'}, // Light blue. - model: {default: true}, - orientationOffset: {type: 'vec3'} + model: {default: true} }, mapping: INPUT_MAPPING, @@ -127,8 +126,7 @@ module.exports.Component = registerComponent('vive-controls', { el.setAttribute('tracked-controls', { idPrefix: GAMEPAD_ID_PREFIX, hand: data.hand, - controller: this.controllerIndex, - orientationOffset: data.orientationOffset + controller: this.controllerIndex }); // Load model. diff --git a/src/components/vive-focus-controls.js b/src/components/vive-focus-controls.js index 97feef7aa77..d8e85461762 100644 --- a/src/components/vive-focus-controls.js +++ b/src/components/vive-focus-controls.js @@ -33,8 +33,7 @@ module.exports.Component = registerComponent('vive-focus-controls', { hand: {default: ''}, // This informs the degenerate arm model. buttonTouchedColor: {type: 'color', default: '#BBBBBB'}, buttonHighlightColor: {type: 'color', default: '#7A7A7A'}, - model: {default: true}, - orientationOffset: {type: 'vec3'} + model: {default: true} }, mapping: INPUT_MAPPING, @@ -104,8 +103,7 @@ module.exports.Component = registerComponent('vive-focus-controls', { var el = this.el; var data = this.data; el.setAttribute('tracked-controls', { - idPrefix: GAMEPAD_ID_PREFIX, - orientationOffset: data.orientationOffset + idPrefix: GAMEPAD_ID_PREFIX }); if (!this.data.model) { return; } this.el.setAttribute('gltf-model', VIVE_FOCUS_CONTROLLER_MODEL_URL); diff --git a/src/utils/tracked-controls.js b/src/utils/tracked-controls.js index 5cfad5482ab..40d4e553313 100644 --- a/src/utils/tracked-controls.js +++ b/src/utils/tracked-controls.js @@ -1,6 +1,4 @@ -var DEFAULT_HANDEDNESS = require('../constants').DEFAULT_HANDEDNESS; var AXIS_LABELS = ['x', 'y', 'z', 'w']; -var NUM_HANDS = 2; // Number of hands in a pair. Should always be 2. /** * Called on controller component `.play` handlers.