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

VRFrameData constructor is totally undefined #19

Open
toji opened this issue May 16, 2018 · 5 comments
Open

VRFrameData constructor is totally undefined #19

toji opened this issue May 16, 2018 · 5 comments

Comments

@toji
Copy link
Member

toji commented May 16, 2018

From @bzbarsky on March 1, 2017 21:31

What does it do? What is the .pose of the resulting object, for example?

Copied from original issue: immersive-web/webxr#195

@toji
Copy link
Member Author

toji commented May 16, 2018

For my part, I'd ideally like to get away from having a constructor for this, but that's related to GC conversations. See #128 and the current explainer for more details.

@toji
Copy link
Member Author

toji commented May 16, 2018

From @kearwood on March 2, 2017 18:33

immersive-web/webxr#195

I am hoping that we will be able to simply return VRFrameData and avoid the constructor as well, but would like to see this change as part of WebVR 2.0.

(This is assuming that there wouldn't be any GC issues as discussed in the other #128 thread)

Firefox currently initializes the VRFrameData values in the constructors:

VRFrameData.timestamp = 0
leftProjectionMatrix, leftviewMatrix, rightProjectionMatrix, rightViewMatrix = 4x4 identity matrix
VRFrameData.pose = a VRPose with all members set to null

For the WebVR 1.1 Spec, should we make this explicit or say something like, "The member values of VRFrameData are not valid until initialized by a call to VRDisplay.getFrameData returning true".

@toji
Copy link
Member Author

toji commented May 16, 2018

From @bzbarsky on March 2, 2017 18:42

Please make it explicit, unless "not valid" means "the getter throws". In which case that should be made explicit.

@toji
Copy link
Member Author

toji commented May 16, 2018

From @kearwood on March 2, 2017 18:56

I just checked Brandon's latest experimental desktop Chromium build, and see that the values are the same except the matrices have all members initialized to 0.

As these initial values don't matter for sites that correctly check for the "true" return value in VRDisplay.getFrameData(), I could change Firefox to match if that makes it simpler.. Do you have a preference for the initial values, @toji ?

(This change of course should only apply to the WebVR 1.1 spec)

@toji
Copy link
Member Author

toji commented May 16, 2018

From @RafaelCintron on March 3, 2017 3:13

Edge currently initializes all of the matrices to identity. The VRPose object is initialized to all zeros except for the orientation which is initialized with a small value. We did this to workaround an issue in AFrame that attempted to determine connected state by calling getVRPose and checking whether the orientation values are zero. This issue has since been fixed. See aframevr/aframe#2426

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

No branches or pull requests

1 participant