{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments/76806848","id":76806848,"diff_hunk":"@@ -0,0 +1,134 @@\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;\n+\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.List;\n+import java.util.concurrent.locks.ReentrantLock;\n+\n+import org.joml.FrustumCuller;\n+import org.joml.Matrix4f;\n+import org.joml.Vector3f;\n+import org.joml.Vector4f;\n+\n+/**\n+ * Finds the scene objects that intersect the scene object the\n+ * picker is attached to.\n+ *\n+ * For a {@linkplain GVRSceneObject scene object} to be pickable, it must have a\n+ * {@link GVRCollider} component attached to it that is enabled.\n+ * The picker returns an array containing all the collisions as instances of GVRPickedObject.\n+ * The picked object contains the collider instance, the distance between\n+ * the colliding and the scene object and the center of the scene object hit\n+ * in world coordinates.\n+ *\n+ * The picker maintains the list of currently\n+ * picked objects which can be obtained with getPicked() and continually\n+ * updates it each frame. When a pickable object is inside the view frustum,\n+ * the picker generates one or more pick events (IPickEvents interface)\n+ * which are sent the event receiver of the scene. These events can be\n+ * observed by listeners.\n+ *  - onEnter(GVRSceneObject)  called when the scene object enters the frustum.\n+ *  - onExit(GVRSceneObject)   called when the scene object exits the frustum.\n+ *  - onInside(GVRSceneObject) called while the scene object is inside the frustum.\n+ *  - onPick(GVRPicker)        called when the set of picked objects changes.\n+ *  - onNoPick(GVRPicker)      called once when nothing is picked.\n+ *\n+ * @see IPickEvents\n+ * @see GVRSceneObject.attachComponent\n+ * @see GVRCollider\n+ * @see GVRComponent.setEnable\n+ * @see GVRPickedObject\n+ * @see GVRPicker\n+ */\n+public class GVRObjectPicker extends GVRPicker\n+{\n+\n+    /**\n+     * Construct a picker which picks from a given scene.\n+     * @param context context that owns the scene\n+     * @param scene scene containing the scene objects to pick from\n+     */\n+    public GVRObjectPicker(GVRContext context, GVRScene scene)\n+    {\n+        super(context, scene);\n+    }\n+\n+    public void onDrawFrame(float frameTime)\n+    {\n+        if (isEnabled())\n+        {\n+            doPick();\n+        }\n+    }\n+\n+    /**\n+     * Scans the scene graph to collect picked items\n+     * and generates appropriate pick events.\n+     * This function is called automatically by\n+     * the picker if it is attached to a scene object.\n+     * You can instantiate the picker and not attach\n+     * it to a scene object. In this case you must\n+     * manually set the pick ray and call doPick()\n+     * to generate the pick events.\n+     * @see IPickEvents\n+     * @see GVRFrustumPicker.pickVisible\n+     */\n+    public void doPick()","path":"GVRf/Framework/framework/src/main/java/org/gearvrf/GVRObjectPicker.java","position":91,"original_position":91,"commit_id":"25df9b9a77349a2faa4f41cd55379eaeed3281d3","original_commit_id":"25df9b9a77349a2faa4f41cd55379eaeed3281d3","user":{"login":"liaxim","id":11889541,"avatar_url":"https://avatars.githubusercontent.com/u/11889541?v=3","gravatar_id":"","url":"https://api.github.com/users/liaxim","html_url":"https://github.com/liaxim","followers_url":"https://api.github.com/users/liaxim/followers","following_url":"https://api.github.com/users/liaxim/following{/other_user}","gists_url":"https://api.github.com/users/liaxim/gists{/gist_id}","starred_url":"https://api.github.com/users/liaxim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liaxim/subscriptions","organizations_url":"https://api.github.com/users/liaxim/orgs","repos_url":"https://api.github.com/users/liaxim/repos","events_url":"https://api.github.com/users/liaxim/events{/privacy}","received_events_url":"https://api.github.com/users/liaxim/received_events","type":"User","site_admin":false},"body":"Regarding the javadoc: if not attached to a scene object, wouldn't it still pick against the list of visible colliders? How the pick ray comes into play in this case?","created_at":"2016-08-30T14:33:16Z","updated_at":"2016-08-30T14:33:16Z","html_url":"https://github.com/Samsung/GearVRf/pull/829#discussion_r76806848","pull_request_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/829","_links":{"self":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments/76806848"},"html":{"href":"https://github.com/Samsung/GearVRf/pull/829#discussion_r76806848"},"pull_request":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/829"}}},"pull_request":{"url":"https://api.github.com/repos/Samsung/GearVRf/pulls/829","id":82459978,"html_url":"https://github.com/Samsung/GearVRf/pull/829","diff_url":"https://github.com/Samsung/GearVRf/pull/829.diff","patch_url":"https://github.com/Samsung/GearVRf/pull/829.patch","issue_url":"https://api.github.com/repos/Samsung/GearVRf/issues/829","number":829,"state":"open","locked":false,"title":"Adding GVRObjectPicker, fixed bug with hit position","user":{"login":"NolaDonato","id":17577291,"avatar_url":"https://avatars.githubusercontent.com/u/17577291?v=3","gravatar_id":"","url":"https://api.github.com/users/NolaDonato","html_url":"https://github.com/NolaDonato","followers_url":"https://api.github.com/users/NolaDonato/followers","following_url":"https://api.github.com/users/NolaDonato/following{/other_user}","gists_url":"https://api.github.com/users/NolaDonato/gists{/gist_id}","starred_url":"https://api.github.com/users/NolaDonato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NolaDonato/subscriptions","organizations_url":"https://api.github.com/users/NolaDonato/orgs","repos_url":"https://api.github.com/users/NolaDonato/repos","events_url":"https://api.github.com/users/NolaDonato/events{/privacy}","received_events_url":"https://api.github.com/users/NolaDonato/received_events","type":"User","site_admin":false},"body":"This is the same as PR #826 with commits squashed\r\nThis patch fixes a bug with the calculation of the hit location for\r\n GVRMeshCollider\r\n It add GVRObjectPicker which picks against the bounding box of the scene\r\n object the picker is attached to.\r\n\r\nUpdated documentation on picking.\r\n\r\nGearVRF DCO signed off by: Nola Donato nola.donato@samsung.com\r\n","created_at":"2016-08-23T23:44:38Z","updated_at":"2016-08-30T14:33:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0c973c2304abb3b3d1fe804f43d294c16ce7641","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/829/commits","review_comments_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/829/comments","review_comment_url":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/GearVRf/issues/829/comments","statuses_url":"https://api.github.com/repos/Samsung/GearVRf/statuses/25df9b9a77349a2faa4f41cd55379eaeed3281d3","head":{"label":"NolaDonato:objectpicker2","ref":"objectpicker2","sha":"25df9b9a77349a2faa4f41cd55379eaeed3281d3","user":{"login":"NolaDonato","id":17577291,"avatar_url":"https://avatars.githubusercontent.com/u/17577291?v=3","gravatar_id":"","url":"https://api.github.com/users/NolaDonato","html_url":"https://github.com/NolaDonato","followers_url":"https://api.github.com/users/NolaDonato/followers","following_url":"https://api.github.com/users/NolaDonato/following{/other_user}","gists_url":"https://api.github.com/users/NolaDonato/gists{/gist_id}","starred_url":"https://api.github.com/users/NolaDonato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NolaDonato/subscriptions","organizations_url":"https://api.github.com/users/NolaDonato/orgs","repos_url":"https://api.github.com/users/NolaDonato/repos","events_url":"https://api.github.com/users/NolaDonato/events{/privacy}","received_events_url":"https://api.github.com/users/NolaDonato/received_events","type":"User","site_admin":false},"repo":{"id":53075365,"name":"GearVRf","full_name":"NolaDonato/GearVRf","owner":{"login":"NolaDonato","id":17577291,"avatar_url":"https://avatars.githubusercontent.com/u/17577291?v=3","gravatar_id":"","url":"https://api.github.com/users/NolaDonato","html_url":"https://github.com/NolaDonato","followers_url":"https://api.github.com/users/NolaDonato/followers","following_url":"https://api.github.com/users/NolaDonato/following{/other_user}","gists_url":"https://api.github.com/users/NolaDonato/gists{/gist_id}","starred_url":"https://api.github.com/users/NolaDonato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NolaDonato/subscriptions","organizations_url":"https://api.github.com/users/NolaDonato/orgs","repos_url":"https://api.github.com/users/NolaDonato/repos","events_url":"https://api.github.com/users/NolaDonato/events{/privacy}","received_events_url":"https://api.github.com/users/NolaDonato/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/NolaDonato/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/NolaDonato/GearVRf","forks_url":"https://api.github.com/repos/NolaDonato/GearVRf/forks","keys_url":"https://api.github.com/repos/NolaDonato/GearVRf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NolaDonato/GearVRf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NolaDonato/GearVRf/teams","hooks_url":"https://api.github.com/repos/NolaDonato/GearVRf/hooks","issue_events_url":"https://api.github.com/repos/NolaDonato/GearVRf/issues/events{/number}","events_url":"https://api.github.com/repos/NolaDonato/GearVRf/events","assignees_url":"https://api.github.com/repos/NolaDonato/GearVRf/assignees{/user}","branches_url":"https://api.github.com/repos/NolaDonato/GearVRf/branches{/branch}","tags_url":"https://api.github.com/repos/NolaDonato/GearVRf/tags","blobs_url":"https://api.github.com/repos/NolaDonato/GearVRf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NolaDonato/GearVRf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NolaDonato/GearVRf/git/refs{/sha}","trees_url":"https://api.github.com/repos/NolaDonato/GearVRf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NolaDonato/GearVRf/statuses/{sha}","languages_url":"https://api.github.com/repos/NolaDonato/GearVRf/languages","stargazers_url":"https://api.github.com/repos/NolaDonato/GearVRf/stargazers","contributors_url":"https://api.github.com/repos/NolaDonato/GearVRf/contributors","subscribers_url":"https://api.github.com/repos/NolaDonato/GearVRf/subscribers","subscription_url":"https://api.github.com/repos/NolaDonato/GearVRf/subscription","commits_url":"https://api.github.com/repos/NolaDonato/GearVRf/commits{/sha}","git_commits_url":"https://api.github.com/repos/NolaDonato/GearVRf/git/commits{/sha}","comments_url":"https://api.github.com/repos/NolaDonato/GearVRf/comments{/number}","issue_comment_url":"https://api.github.com/repos/NolaDonato/GearVRf/issues/comments{/number}","contents_url":"https://api.github.com/repos/NolaDonato/GearVRf/contents/{+path}","compare_url":"https://api.github.com/repos/NolaDonato/GearVRf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NolaDonato/GearVRf/merges","archive_url":"https://api.github.com/repos/NolaDonato/GearVRf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NolaDonato/GearVRf/downloads","issues_url":"https://api.github.com/repos/NolaDonato/GearVRf/issues{/number}","pulls_url":"https://api.github.com/repos/NolaDonato/GearVRf/pulls{/number}","milestones_url":"https://api.github.com/repos/NolaDonato/GearVRf/milestones{/number}","notifications_url":"https://api.github.com/repos/NolaDonato/GearVRf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NolaDonato/GearVRf/labels{/name}","releases_url":"https://api.github.com/repos/NolaDonato/GearVRf/releases{/id}","deployments_url":"https://api.github.com/repos/NolaDonato/GearVRf/deployments","created_at":"2016-03-03T19:01:04Z","updated_at":"2016-03-03T19:01:07Z","pushed_at":"2016-08-30T03:25:25Z","git_url":"git://github.com/NolaDonato/GearVRf.git","ssh_url":"git@github.com:NolaDonato/GearVRf.git","clone_url":"https://github.com/NolaDonato/GearVRf.git","svn_url":"https://github.com/NolaDonato/GearVRf","homepage":"http://www.gearvrf.org","size":667955,"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":"157a48ebc8794cfd2ab70f159ccd8efd1837329b","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-08-30T12:51:37Z","pushed_at":"2016-08-30T14:05:08Z","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":757391,"stargazers_count":201,"watchers_count":201,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":154,"mirror_url":null,"open_issues_count":86,"forks":154,"open_issues":86,"watchers":201,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/829"},"html":{"href":"https://github.com/Samsung/GearVRf/pull/829"},"issue":{"href":"https://api.github.com/repos/Samsung/GearVRf/issues/829"},"comments":{"href":"https://api.github.com/repos/Samsung/GearVRf/issues/829/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/829/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/GearVRf/pulls/829/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/GearVRf/statuses/25df9b9a77349a2faa4f41cd55379eaeed3281d3"}}}}
{"actor":{"display_login":"liaxim"}}