WebVR's VRFieldOfView object doesn't support keys |
||
Issue descriptionJavascript objects support both keys and dot operators for accessing attributes, e.g. some_object[key] and some_object.key should result in the same thing. For whatever reason, WebVR's VRFieldOfView object does not support this - fov.key works, but fov[key] does not, and Object.keys(fov) returns an empty array. What this means is that you can't use a loop to iterate over all of the attributes, which isn't a huge deal since there are only four, but it's strange since I was under the impression that this was supported in absolutely all Javascript objects.
,
Jan 11 2017
I'm now getting the same behavior as you - Object.keys still returns an empty array, but the following works to log all the values:
for (var prop in fieldOfView) { console.log(fieldOfView[prop]); }
Also, fieldOfView.upDegrees and fieldOfView["upDegrees"] now return the same float. Not quite sure why that's working now - I swear I checked multiple times that it didn't work before, but AFAIK, there aren't any changes that should have fixed it.
,
Jan 12 2017
Yes, I also don't find any changes which fixed it. However, good to know it works :)
,
Jan 12 2017
Closing for now, as the issue seems to have automagically solved itself and is no longer reproducible. |
||
►
Sign in to add a comment |
||
Comment 1 by shaobo....@intel.com
, Jan 11 2017I tested it on the android chromiium canary. And it seems that VRFieldOfView object support both fov.key and fov["key"]. And it seems the statement like: for (var prop in fov) {console.log(prop)} could output all four attribute name successfully.