{"action":"created","issue":{"url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/310","repository_url":"https://api.github.com/repos/immersive-web/webvr-polyfill","labels_url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/310/comments","events_url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/310/events","html_url":"https://github.com/immersive-web/webvr-polyfill/issues/310","id":306086144,"number":310,"title":"Initial orientation correction in hotfix (chrome m65)","user":{"login":"env3d","id":4198867,"avatar_url":"https://avatars3.githubusercontent.com/u/4198867?v=4","gravatar_id":"","url":"https://api.github.com/users/env3d","html_url":"https://github.com/env3d","followers_url":"https://api.github.com/users/env3d/followers","following_url":"https://api.github.com/users/env3d/following{/other_user}","gists_url":"https://api.github.com/users/env3d/gists{/gist_id}","starred_url":"https://api.github.com/users/env3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/env3d/subscriptions","organizations_url":"https://api.github.com/users/env3d/orgs","repos_url":"https://api.github.com/users/env3d/repos","events_url":"https://api.github.com/users/env3d/events{/privacy}","received_events_url":"https://api.github.com/users/env3d/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-03-16T21:45:04Z","updated_at":"2018-03-17T15:52:30Z","closed_at":null,"author_association":"NONE","body":"##### Description:\r\n\r\nIn Chrome m65, after the latest hotfix patch, the starting orientation is off by 45 degrees.  To reproduce, simply visit the example page https://immersive-web.github.io/webvr-polyfill/examples/ with an affected browser.  You will see the cube flashed and then the orientation is turned at 45 degree angle.\r\n\r\nI patched the cardboard-vr-display with the following, which seems to fix the issue:\r\n\r\n```\r\ndiff --git a/src/sensor-fusion/fusion-pose-sensor.js b/src/sensor-fusion/fusion-pose-sensor.js\r\nindex 43bd398..7b2dec9 100644\r\n--- a/src/sensor-fusion/fusion-pose-sensor.js\r\n+++ b/src/sensor-fusion/fusion-pose-sensor.js\r\n@@ -91,10 +91,10 @@ FusionPoseSensor.prototype.getOrientation = function() {\r\n       const z = new MathUtil.Quaternion().setFromAxisAngle(new MathUtil.Vector3(0, 0, -1), 0);\r\n       const y = new MathUtil.Quaternion()\r\n \r\n-      if (window.orientation === -90) {\r\n-        y.setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI / -2);\r\n+      if (window.orientation === 90) {\r\n+        y.setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI + (Math.PI / 4));\r\n       } else {\r\n-        y.setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI / 2);\r\n+        y.setFromAxisAngle(new MathUtil.Vector3(0, 1, 0), Math.PI / -4);\r\n       }\r\n \r\n       return z.multiply(y);\r\n```\r\n\r\n##### Additional Information:\r\n\r\n* webvr-polyfill version: 0.10.4\r\n* Browser name/version/release channel: Chrome M65 (on my MotoZ play)\r\n* Operating System: Android\r\n"},"comment":{"url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/comments/373930465","html_url":"https://github.com/immersive-web/webvr-polyfill/issues/310#issuecomment-373930465","issue_url":"https://api.github.com/repos/immersive-web/webvr-polyfill/issues/310","id":373930465,"user":{"login":"env3d","id":4198867,"avatar_url":"https://avatars3.githubusercontent.com/u/4198867?v=4","gravatar_id":"","url":"https://api.github.com/users/env3d","html_url":"https://github.com/env3d","followers_url":"https://api.github.com/users/env3d/followers","following_url":"https://api.github.com/users/env3d/following{/other_user}","gists_url":"https://api.github.com/users/env3d/gists{/gist_id}","starred_url":"https://api.github.com/users/env3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/env3d/subscriptions","organizations_url":"https://api.github.com/users/env3d/orgs","repos_url":"https://api.github.com/users/env3d/repos","events_url":"https://api.github.com/users/env3d/events{/privacy}","received_events_url":"https://api.github.com/users/env3d/received_events","type":"User","site_admin":false},"created_at":"2018-03-17T15:52:30Z","updated_at":"2018-03-17T15:52:30Z","author_association":"NONE","body":"So just tried it on firefox and the behavior is the same as Chrome M65.  I need to apply the patch to have the start orientation center properly.  So this may be something specific to the MotoZ?  Incidentally, the MotoZ does not seem to suffer from the low refresh rate, but the LG G3 does.\r\n\r\nI'll check out the code and maybe setup a test to examine the numbers coming from deviceorientation and devicemotion from those phones."}}
{"actor":{"display_login":"env3d"}}