{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments/52124781","id":52124781,"diff_hunk":"@@ -0,0 +1,83 @@\n+/* Copyright 2015 Samsung Electronics Co., LTD\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.gearvrf.io;\n+\n+import org.gearvrf.GVRContext;\n+import org.gearvrf.GVRDrawFrameListener;\n+import org.gearvrf.GVRScene;\n+import org.gearvrf.GVRSceneObject;\n+import org.gearvrf.GVRTransform;\n+import org.gearvrf.utility.Log;\n+\n+import android.opengl.Matrix;\n+import android.view.KeyEvent;\n+import android.view.MotionEvent;\n+\n+class GVRGazeCursorController extends GVRBaseController\n+        implements GVRDrawFrameListener {\n+    private static final String TAG = GVRGazeCursorController.class\n+            .getSimpleName();\n+    private boolean isActive;\n+    private float x, y, z;\n+    private GVRContext context;\n+\n+    public GVRGazeCursorController(GVRContext context,\n+            GVRCursorType cursorType) {\n+        super(cursorType);\n+        this.context = context;\n+        context.registerDrawFrameListener(this);\n+    }\n+\n+    @Override\n+    boolean dispatchKeyEvent(KeyEvent event) {\n+        // Not used.\n+        return false;\n+    }\n+\n+    @Override\n+    boolean dispatchMotionEvent(MotionEvent event) {\n+        if (event.getAction() == MotionEvent.ACTION_DOWN && isActive == false) {\n+            this.isActive = true;\n+            setActive(isActive);\n+        } else if (event.getAction() == MotionEvent.ACTION_UP\n+                && isActive == true) {\n+            this.isActive = false;\n+            setActive(isActive);\n+        }\n+        return true;\n+    }\n+\n+    @Override\n+    public void setPosition(float x, float y, float z) {\n+        this.x = x;\n+        this.y = y;\n+        this.z = z;\n+        super.setPosition(x, y, z);\n+    }\n+\n+    @Override\n+    public void onDrawFrame(float frameTime) {\n+        float[] position = new float[] { x, y, z, 1.0f };","path":"GVRf/Framework/src/org/gearvrf/io/GVRGazeCursorController.java","position":null,"original_position":73,"commit_id":"fe8e63eebcda21a9156ec9d3b9f2d12fd69e685d","original_commit_id":"90286257a27926f259e8512d940478de0eb61937","user":{"login":"rahul27","id":609380,"avatar_url":"https://avatars.githubusercontent.com/u/609380?v=3","gravatar_id":"","url":"https://api.github.com/users/rahul27","html_url":"https://github.com/rahul27","followers_url":"https://api.github.com/users/rahul27/followers","following_url":"https://api.github.com/users/rahul27/following{/other_user}","gists_url":"https://api.github.com/users/rahul27/gists{/gist_id}","starred_url":"https://api.github.com/users/rahul27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahul27/subscriptions","organizations_url":"https://api.github.com/users/rahul27/orgs","repos_url":"https://api.github.com/users/rahul27/repos","events_url":"https://api.github.com/users/rahul27/events{/privacy}","received_events_url":"https://api.github.com/users/rahul27/received_events","type":"User","site_admin":false},"body":"I always assumed that the compiler would kick in to do that optimization. In any case I have changed this in the new patch.","created_at":"2016-02-07T21:03:42Z","updated_at":"2016-02-07T21:03:42Z","html_url":"https://github.com/Samsung/GearVRf/pull/410#discussion_r52124781","pull_request_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/410","_links":{"self":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments/52124781"},"html":{"href":"https://github.com/Samsung/GearVRf/pull/410#discussion_r52124781"},"pull_request":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/410"}}},"pull_request":{"url":"https://api.github.com/repos/Samsung/GearVRf/pulls/410","id":58535006,"html_url":"https://github.com/Samsung/GearVRf/pull/410","diff_url":"https://github.com/Samsung/GearVRf/pull/410.diff","patch_url":"https://github.com/Samsung/GearVRf/pull/410.patch","issue_url":"https://api.github.com/repos/Samsung/GearVRf/issues/410","number":410,"state":"open","locked":false,"title":"Adding the Gaze Cursor Controller","user":{"login":"rahul27","id":609380,"avatar_url":"https://avatars.githubusercontent.com/u/609380?v=3","gravatar_id":"","url":"https://api.github.com/users/rahul27","html_url":"https://github.com/rahul27","followers_url":"https://api.github.com/users/rahul27/followers","following_url":"https://api.github.com/users/rahul27/following{/other_user}","gists_url":"https://api.github.com/users/rahul27/gists{/gist_id}","starred_url":"https://api.github.com/users/rahul27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahul27/subscriptions","organizations_url":"https://api.github.com/users/rahul27/orgs","repos_url":"https://api.github.com/users/rahul27/repos","events_url":"https://api.github.com/users/rahul27/events{/privacy}","received_events_url":"https://api.github.com/users/rahul27/received_events","type":"User","site_admin":false},"body":"Use the setting useGazeCursorController to enable this feature.\r\n\r\n","created_at":"2016-02-07T00:41:13Z","updated_at":"2016-02-07T21:03:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"569c369fd2e06176cf65a69de0b003a069a44f22","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/410/commits","review_comments_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/410/comments","review_comment_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/GearVRf/issues/410/comments","statuses_url":"https://api.github.com/repos/Samsung/GearVRf/statuses/fe8e63eebcda21a9156ec9d3b9f2d12fd69e685d","head":{"label":"rahul27:gaze","ref":"gaze","sha":"fe8e63eebcda21a9156ec9d3b9f2d12fd69e685d","user":{"login":"rahul27","id":609380,"avatar_url":"https://avatars.githubusercontent.com/u/609380?v=3","gravatar_id":"","url":"https://api.github.com/users/rahul27","html_url":"https://github.com/rahul27","followers_url":"https://api.github.com/users/rahul27/followers","following_url":"https://api.github.com/users/rahul27/following{/other_user}","gists_url":"https://api.github.com/users/rahul27/gists{/gist_id}","starred_url":"https://api.github.com/users/rahul27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahul27/subscriptions","organizations_url":"https://api.github.com/users/rahul27/orgs","repos_url":"https://api.github.com/users/rahul27/repos","events_url":"https://api.github.com/users/rahul27/events{/privacy}","received_events_url":"https://api.github.com/users/rahul27/received_events","type":"User","site_admin":false},"repo":{"id":39517990,"name":"GearVRf","full_name":"rahul27/GearVRf","owner":{"login":"rahul27","id":609380,"avatar_url":"https://avatars.githubusercontent.com/u/609380?v=3","gravatar_id":"","url":"https://api.github.com/users/rahul27","html_url":"https://github.com/rahul27","followers_url":"https://api.github.com/users/rahul27/followers","following_url":"https://api.github.com/users/rahul27/following{/other_user}","gists_url":"https://api.github.com/users/rahul27/gists{/gist_id}","starred_url":"https://api.github.com/users/rahul27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahul27/subscriptions","organizations_url":"https://api.github.com/users/rahul27/orgs","repos_url":"https://api.github.com/users/rahul27/repos","events_url":"https://api.github.com/users/rahul27/events{/privacy}","received_events_url":"https://api.github.com/users/rahul27/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rahul27/GearVRf","description":"The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices. ","fork":true,"url":"https://api.github.com/repos/rahul27/GearVRf","forks_url":"https://api.github.com/repos/rahul27/GearVRf/forks","keys_url":"https://api.github.com/repos/rahul27/GearVRf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rahul27/GearVRf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rahul27/GearVRf/teams","hooks_url":"https://api.github.com/repos/rahul27/GearVRf/hooks","issue_events_url":"https://api.github.com/repos/rahul27/GearVRf/issues/events{/number}","events_url":"https://api.github.com/repos/rahul27/GearVRf/events","assignees_url":"https://api.github.com/repos/rahul27/GearVRf/assignees{/user}","branches_url":"https://api.github.com/repos/rahul27/GearVRf/branches{/branch}","tags_url":"https://api.github.com/repos/rahul27/GearVRf/tags","blobs_url":"https://api.github.com/repos/rahul27/GearVRf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rahul27/GearVRf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rahul27/GearVRf/git/refs{/sha}","trees_url":"https://api.github.com/repos/rahul27/GearVRf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rahul27/GearVRf/statuses/{sha}","languages_url":"https://api.github.com/repos/rahul27/GearVRf/languages","stargazers_url":"https://api.github.com/repos/rahul27/GearVRf/stargazers","contributors_url":"https://api.github.com/repos/rahul27/GearVRf/contributors","subscribers_url":"https://api.github.com/repos/rahul27/GearVRf/subscribers","subscription_url":"https://api.github.com/repos/rahul27/GearVRf/subscription","commits_url":"https://api.github.com/repos/rahul27/GearVRf/commits{/sha}","git_commits_url":"https://api.github.com/repos/rahul27/GearVRf/git/commits{/sha}","comments_url":"https://api.github.com/repos/rahul27/GearVRf/comments{/number}","issue_comment_url":"https://api.github.com/repos/rahul27/GearVRf/issues/comments{/number}","contents_url":"https://api.github.com/repos/rahul27/GearVRf/contents/{+path}","compare_url":"https://api.github.com/repos/rahul27/GearVRf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rahul27/GearVRf/merges","archive_url":"https://api.github.com/repos/rahul27/GearVRf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rahul27/GearVRf/downloads","issues_url":"https://api.github.com/repos/rahul27/GearVRf/issues{/number}","pulls_url":"https://api.github.com/repos/rahul27/GearVRf/pulls{/number}","milestones_url":"https://api.github.com/repos/rahul27/GearVRf/milestones{/number}","notifications_url":"https://api.github.com/repos/rahul27/GearVRf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rahul27/GearVRf/labels{/name}","releases_url":"https://api.github.com/repos/rahul27/GearVRf/releases{/id}","deployments_url":"https://api.github.com/repos/rahul27/GearVRf/deployments","created_at":"2015-07-22T16:45:10Z","updated_at":"2016-01-12T22:16:07Z","pushed_at":"2016-02-07T21:01:32Z","git_url":"git://github.com/rahul27/GearVRf.git","ssh_url":"git@github.com:rahul27/GearVRf.git","clone_url":"https://github.com/rahul27/GearVRf.git","svn_url":"https://github.com/rahul27/GearVRf","homepage":"http://www.gearvrf.org","size":603788,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Samsung:master","ref":"master","sha":"34651f05b85a64c609a35c38e35a22165ab73bcf","user":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"repo":{"id":32836701,"name":"GearVRf","full_name":"Samsung/GearVRf","owner":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Samsung/GearVRf","description":"The GearVR framework(GearVRf) is an Open Source VR rendering library for application development on VR-supported Android devices. ","fork":false,"url":"https://api.github.com/repos/Samsung/GearVRf","forks_url":"https://api.github.com/repos/Samsung/GearVRf/forks","keys_url":"https://api.github.com/repos/Samsung/GearVRf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Samsung/GearVRf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Samsung/GearVRf/teams","hooks_url":"https://api.github.com/repos/Samsung/GearVRf/hooks","issue_events_url":"https://api.github.com/repos/Samsung/GearVRf/issues/events{/number}","events_url":"https://api.github.com/repos/Samsung/GearVRf/events","assignees_url":"https://api.github.com/repos/Samsung/GearVRf/assignees{/user}","branches_url":"https://api.github.com/repos/Samsung/GearVRf/branches{/branch}","tags_url":"https://api.github.com/repos/Samsung/GearVRf/tags","blobs_url":"https://api.github.com/repos/Samsung/GearVRf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Samsung/GearVRf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Samsung/GearVRf/git/refs{/sha}","trees_url":"https://api.github.com/repos/Samsung/GearVRf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Samsung/GearVRf/statuses/{sha}","languages_url":"https://api.github.com/repos/Samsung/GearVRf/languages","stargazers_url":"https://api.github.com/repos/Samsung/GearVRf/stargazers","contributors_url":"https://api.github.com/repos/Samsung/GearVRf/contributors","subscribers_url":"https://api.github.com/repos/Samsung/GearVRf/subscribers","subscription_url":"https://api.github.com/repos/Samsung/GearVRf/subscription","commits_url":"https://api.github.com/repos/Samsung/GearVRf/commits{/sha}","git_commits_url":"https://api.github.com/repos/Samsung/GearVRf/git/commits{/sha}","comments_url":"https://api.github.com/repos/Samsung/GearVRf/comments{/number}","issue_comment_url":"https://api.github.com/repos/Samsung/GearVRf/issues/comments{/number}","contents_url":"https://api.github.com/repos/Samsung/GearVRf/contents/{+path}","compare_url":"https://api.github.com/repos/Samsung/GearVRf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Samsung/GearVRf/merges","archive_url":"https://api.github.com/repos/Samsung/GearVRf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Samsung/GearVRf/downloads","issues_url":"https://api.github.com/repos/Samsung/GearVRf/issues{/number}","pulls_url":"https://api.github.com/repos/Samsung/GearVRf/pulls{/number}","milestones_url":"https://api.github.com/repos/Samsung/GearVRf/milestones{/number}","notifications_url":"https://api.github.com/repos/Samsung/GearVRf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Samsung/GearVRf/labels{/name}","releases_url":"https://api.github.com/repos/Samsung/GearVRf/releases{/id}","deployments_url":"https://api.github.com/repos/Samsung/GearVRf/deployments","created_at":"2015-03-25T02:02:18Z","updated_at":"2016-02-05T22:09:26Z","pushed_at":"2016-02-07T21:01:33Z","git_url":"git://github.com/Samsung/GearVRf.git","ssh_url":"git@github.com:Samsung/GearVRf.git","clone_url":"https://github.com/Samsung/GearVRf.git","svn_url":"https://github.com/Samsung/GearVRf","homepage":"http://www.gearvrf.org","size":710440,"stargazers_count":82,"watchers_count":82,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":82,"mirror_url":null,"open_issues_count":66,"forks":82,"open_issues":66,"watchers":82,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/410"},"html":{"href":"https://github.com/Samsung/GearVRf/pull/410"},"issue":{"href":"https://api.github.com/repos/Samsung/GearVRf/issues/410"},"comments":{"href":"https://api.github.com/repos/Samsung/GearVRf/issues/410/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/410/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/410/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/GearVRf/statuses/fe8e63eebcda21a9156ec9d3b9f2d12fd69e685d"}}}}