Skip to content

Commit

Permalink
Remove unused orientationOffset from the controls components
Browse files Browse the repository at this point in the history
  • Loading branch information
mrxz committed Feb 12, 2024
1 parent 1329fc4 commit 2b2d7f3
Show file tree
Hide file tree
Showing 17 changed files with 16 additions and 43 deletions.
1 change: 0 additions & 1 deletion docs/components/magicleap-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion docs/components/oculus-touch-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion docs/components/tracked-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion docs/components/vive-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion docs/components/vive-focus-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions docs/introduction/interactions-and-controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions src/components/generic-tracked-controller-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,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}
},

Expand Down Expand Up @@ -133,7 +132,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; }
Expand Down
6 changes: 2 additions & 4 deletions src/components/hp-mixed-reality-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,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,
Expand Down Expand Up @@ -126,8 +125,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.
Expand Down
6 changes: 2 additions & 4 deletions src/components/magicleap-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,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,
Expand Down Expand Up @@ -121,8 +120,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.
Expand Down
6 changes: 2 additions & 4 deletions src/components/oculus-go-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,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,
Expand Down Expand Up @@ -110,8 +109,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);
Expand Down
4 changes: 1 addition & 3 deletions src/components/oculus-touch-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,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,
Expand Down Expand Up @@ -243,7 +242,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'
Expand Down
6 changes: 2 additions & 4 deletions src/components/pico-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,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,
Expand Down Expand Up @@ -118,8 +117,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; }
Expand Down
1 change: 0 additions & 1 deletion src/components/tracked-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
},
Expand Down
6 changes: 2 additions & 4 deletions src/components/valve-index-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,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: {
Expand Down Expand Up @@ -126,8 +125,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();
Expand Down
6 changes: 2 additions & 4 deletions src/components/vive-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,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,
Expand Down Expand Up @@ -128,8 +127,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.
Expand Down
6 changes: 2 additions & 4 deletions src/components/vive-focus-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,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}
},

/**
Expand Down Expand Up @@ -101,8 +100,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);
Expand Down
2 changes: 0 additions & 2 deletions src/utils/tracked-controls.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit 2b2d7f3

Please sign in to comment.