-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
only set this.controls.userHeight if device has positional tracking #3111
only set this.controls.userHeight if device has positional tracking #3111
Conversation
The proper solution for this is probably moving the logic to the restore pose of the camera component: https://github.com/aframevr/aframe/blob/master/src/components/camera.js#L99 |
@dmarcos There is already a hasPositionalTracking check in camera to save the pose (position and rotation of the camera) yes. So you mean saving userHeight? But this is set on the VRControls object, not the camera. I'm really lost with this, and I don't have any positional tracking device to test this, only GearVR. What I know it that before #3000, there was no |
It feels to me as though we are trying to bake too many smarts into the |
24fa2aa
to
4da8fe4
Compare
All right. I think we should then move the logic to save / restore the camera pose / position from the |
One other thing that seems to differ between positional and non positional tracking devices is that with positional tracking you are placed to z -2 or something like that, and with GearVR you are probably at z: 0. So there are some examples, notably c-frame/aframe-super-hands-component#89 where you are too close to the object, here with the big cube. |
I just wanted to add that this fix works for me. It allows my project to work on GearVR with the Oculus browser, and the Vive using Firefox 56.0, without having to make any camera changes. Thanks! |
@dmarcos Maybe we can merge this and you folks work eventually on a refactoring in another branch? |
Fixed the tests. @dmarcos this fix make sense? We can refactor later. |
@vincentfretin sorry for breaking GearVR and thank you for issuing the fix. I verified that it works as expected with Window Mixed Reality. |
hasPositionalTracking = this.hasPositionalTracking !== undefined | ||
? this.hasPositionalTracking | ||
: checkHasPositionalTracking(); | ||
if (hasPositionalTracking) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to understand. How come we still want to apply user height if there is positional tracking? Seems to me you don't want to apply an offset if your height is tracked, or we should check more specifically that there are no stage parameters? And how come it was adding up more and more each time enter VR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good. thanks for this. let me know when you want another review. no rush. also, just so I know, which example(s) are you testing against? and on which platforms have you tested?
@@ -1,8 +1,11 @@ | |||
var registerComponent = require('../core/component').registerComponent; | |||
var THREE = require('../lib/three'); | |||
var utils = require('../utils/'); | |||
var DEFAULT_CAMERA_HEIGHT = require('../constants').DEFAULT_CAMERA_HEIGHT; | |||
var bind = require('../utils/bind'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel free to change this to utils.bind
var DEFAULT_CAMERA_HEIGHT = require('../constants').DEFAULT_CAMERA_HEIGHT; | ||
var bind = require('../utils/bind'); | ||
|
||
var checkHasPositionalTracking = utils.device.checkHasPositionalTracking; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want to import this function above?
this.controls.standing = data.standing; | ||
this.controls.userHeight = this.getUserHeight(); | ||
|
||
hasPositionalTracking = this.hasPositionalTracking !== undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is already expect to be a Boolean, you can simplify this expression
requestAnimationFrame: function () { return 1; }, | ||
cancelAnimationFrame: function (h) { return window.cancelAnimationFrame(1); } | ||
requestPresent: resolvePromise, | ||
submitFrame: function () { return; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a test for checking the tracking method and user height?
VRControls / VREffect will be soon gone. See #3152 I leave it open as a reference and a reminder to port the logic. Nothing to do here. |
After the removal of VREffect / VRControls this PR is not applicable anymore. |
This definitely fix issue #3051
I don't know how to write a test for this, this seems bound to the VRControls and how it renders in the browser...