Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for VR headsets that do not provide stageParameters #3000

Merged
merged 4 commits into from
Aug 29, 2017

Conversation

olga-microsoft
Copy link
Contributor

Description:
Fixes issue of inconsistent head and controller height offset, for cases when stageParameters property on VR display is null.

Changes Proposed:
Provide default user height, if this is the case to be consistent with tracked controls.

@@ -17,7 +18,9 @@ module.exports.Component = registerComponent('look-controls', {
enabled: {default: true},
hmdEnabled: {default: true},
reverseMouseDrag: {default: false},
standing: {default: true}
standing: {default: true},
userHeight: {default: 0},
Copy link
Member

@dmarcos dmarcos Aug 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using this property anywhere? it seems you are using userHeight from the camera component in getUserHeight

* Return user height to use for standing poses, where a device doesn't provide an offset.
*/
getUserHeight: function () {
var headEl = this.data.headElement || this.el.sceneEl.camera.el;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the cases where the headElement is not the active camera?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(e.g. spectator camera?)

standing: {default: true}
standing: {default: true},
userHeight: {default: 0},
headElement: {type: 'selector'}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a description for the use cases of this property?

@@ -52,4 +53,27 @@ suite('look-controls', function () {
window.dispatchEvent(new Event('mouseup'));
});
});

suite('head-height', function () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tests!

@olga-microsoft
Copy link
Contributor Author

olga-microsoft commented Aug 25, 2017

Thank you @dmarcos for review. I removed the properties under question.
Merged master in order to get tests to pass.
Please let me know, if there are any more concerns.

* Return user height to use for standing poses, where a device doesn't provide an offset.
*/
getUserHeight: function () {
var headEl = this.el.sceneEl.camera.el;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A scene could have multiple cameras. In this case we probably only care about the camera on the entity where this component is setup. I would use the public API this way:

var el = this.el;
var userHeight = el.hasAttribute('camera') && el.getAttribute('camera').userHeight || DEFAULT_CAMERA_HEIGHT;
return userHeight;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work in your case?

Copy link
Member

@dmarcos dmarcos Aug 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about the coupling of look-controls and the camera components we have now. Moving userHeight to look-controls is something we have discussed in the past but we can do it in a separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this works and looks better. Thank you!

@dmarcos
Copy link
Member

dmarcos commented Aug 26, 2017

Thanks! Pretty close! A small couple of tweaks and we're ready to go.

@dmarcos
Copy link
Member

dmarcos commented Aug 29, 2017

Nice! Thank you! Welcome as a contributor!

@dmarcos dmarcos merged commit cb657f5 into aframevr:master Aug 29, 2017
@olga-microsoft
Copy link
Contributor Author

Thank you!

@vincentfretin
Copy link
Contributor

These changes introduced a regression for non positional devices like GearVR, see #3051

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants