{"action":"created","comment":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/23464773","id":23464773,"diff_hunk":"@@ -230,6 +230,32 @@ QScriptValue Text3DOverlay::getProperty(const QString& property) {\n     return Planar3DOverlay::getProperty(property);\n }\n \n+bool Text3DOverlay::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction,\n+    float& distance, BoxFace& face) {\n+\n+    bool intersects = Planar3DOverlay::findRayIntersection(origin, direction, distance, face);\n+\n+    if (intersects) {\n+        glm::vec3 hitPosition = origin + (distance * direction);\n+\n+        const glm::vec3 X_AXIS(1.0f, 0.0f, 0.0f);\n+        glm::vec3 xHalfVector = 0.5f * _dimensions.x * (_rotation * X_AXIS);\n+        const glm::vec3 Y_AXIS(0.0f, 1.0f, 0.0f);\n+        glm::vec3 yHalfVector = 0.5f * _dimensions.y * (_rotation * Y_AXIS);\n+\n+        glm::vec3 corner00 = _position - xHalfVector - yHalfVector;\n+        glm::vec3 corner10 = _position + xHalfVector - yHalfVector;\n+        glm::vec3 corner01 = _position - xHalfVector + yHalfVector;\n+\n+        intersects = glm::dot(hitPosition - corner00, corner01 - corner00) > 0\n+                  && glm::dot(hitPosition - corner01, corner00 - corner01) > 0\n+                  && glm::dot(hitPosition - corner00, corner10 - corner00) > 0\n+                  && glm::dot(hitPosition - corner10, corner00 - corner10) > 0;\n+    }\n+\n+    return intersects;\n+}","path":"interface/src/ui/overlays/Text3DOverlay.cpp","position":28,"original_position":28,"commit_id":"08afe9dd8f72568669e2707827ac0902ea22fd7d","original_commit_id":"08afe9dd8f72568669e2707827ac0902ea22fd7d","user":{"login":"ctrlaltdavid","id":7455448,"avatar_url":"https://avatars.githubusercontent.com/u/7455448?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlaltdavid","html_url":"https://github.com/ctrlaltdavid","followers_url":"https://api.github.com/users/ctrlaltdavid/followers","following_url":"https://api.github.com/users/ctrlaltdavid/following{/other_user}","gists_url":"https://api.github.com/users/ctrlaltdavid/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlaltdavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlaltdavid/subscriptions","organizations_url":"https://api.github.com/users/ctrlaltdavid/orgs","repos_url":"https://api.github.com/users/ctrlaltdavid/repos","events_url":"https://api.github.com/users/ctrlaltdavid/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlaltdavid/received_events","type":"User","site_admin":false},"body":"Thanks. I'll have a look at the alternative visualization. And sorry about the \"0\"s - have been looking at JavaScript too much lately.\r\n\r\nYes, it would be better moved to Planar3DOverlay (the current Planar3DOverlay's infinite plane test is annoying). And then it would work for Rectangle3DOverlay also. And yes, Circle3DOverlay already checks its radius (but there's a TODO in there about making it work for ellipses).\r\n\r\nBillboard overlays are in a separate branch of the class tree, but already have a working ray intersection calculation.","created_at":"2015-01-23T17:21:12Z","updated_at":"2015-01-23T17:21:12Z","html_url":"https://github.com/highfidelity/hifi/pull/4155#discussion_r23464773","pull_request_url":"https://api.github.com/repos/highfidelity/hifi/pulls/4155","_links":{"self":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/23464773"},"html":{"href":"https://github.com/highfidelity/hifi/pull/4155#discussion_r23464773"},"pull_request":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/4155"}}},"pull_request":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/4155","id":27904328,"html_url":"https://github.com/highfidelity/hifi/pull/4155","diff_url":"https://github.com/highfidelity/hifi/pull/4155.diff","patch_url":"https://github.com/highfidelity/hifi/pull/4155.patch","issue_url":"https://api.github.com/repos/highfidelity/hifi/issues/4155","number":4155,"state":"open","locked":false,"title":"Implement text3d overlay ray intersection calculation","user":{"login":"ctrlaltdavid","id":7455448,"avatar_url":"https://avatars.githubusercontent.com/u/7455448?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlaltdavid","html_url":"https://github.com/ctrlaltdavid","followers_url":"https://api.github.com/users/ctrlaltdavid/followers","following_url":"https://api.github.com/users/ctrlaltdavid/following{/other_user}","gists_url":"https://api.github.com/users/ctrlaltdavid/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlaltdavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlaltdavid/subscriptions","organizations_url":"https://api.github.com/users/ctrlaltdavid/orgs","repos_url":"https://api.github.com/users/ctrlaltdavid/repos","events_url":"https://api.github.com/users/ctrlaltdavid/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlaltdavid/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-01-23T06:42:11Z","updated_at":"2015-01-23T17:21:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2dd8bbd3d305bda362b5c2870f41eb507b32e51e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/highfidelity/hifi/pulls/4155/commits","review_comments_url":"https://api.github.com/repos/highfidelity/hifi/pulls/4155/comments","review_comment_url":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/{number}","comments_url":"https://api.github.com/repos/highfidelity/hifi/issues/4155/comments","statuses_url":"https://api.github.com/repos/highfidelity/hifi/statuses/08afe9dd8f72568669e2707827ac0902ea22fd7d","head":{"label":"ctrlaltdavid:text3d-intersection","ref":"text3d-intersection","sha":"08afe9dd8f72568669e2707827ac0902ea22fd7d","user":{"login":"ctrlaltdavid","id":7455448,"avatar_url":"https://avatars.githubusercontent.com/u/7455448?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlaltdavid","html_url":"https://github.com/ctrlaltdavid","followers_url":"https://api.github.com/users/ctrlaltdavid/followers","following_url":"https://api.github.com/users/ctrlaltdavid/following{/other_user}","gists_url":"https://api.github.com/users/ctrlaltdavid/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlaltdavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlaltdavid/subscriptions","organizations_url":"https://api.github.com/users/ctrlaltdavid/orgs","repos_url":"https://api.github.com/users/ctrlaltdavid/repos","events_url":"https://api.github.com/users/ctrlaltdavid/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlaltdavid/received_events","type":"User","site_admin":false},"repo":{"id":19596658,"name":"hifi","full_name":"ctrlaltdavid/hifi","owner":{"login":"ctrlaltdavid","id":7455448,"avatar_url":"https://avatars.githubusercontent.com/u/7455448?v=3","gravatar_id":"","url":"https://api.github.com/users/ctrlaltdavid","html_url":"https://github.com/ctrlaltdavid","followers_url":"https://api.github.com/users/ctrlaltdavid/followers","following_url":"https://api.github.com/users/ctrlaltdavid/following{/other_user}","gists_url":"https://api.github.com/users/ctrlaltdavid/gists{/gist_id}","starred_url":"https://api.github.com/users/ctrlaltdavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctrlaltdavid/subscriptions","organizations_url":"https://api.github.com/users/ctrlaltdavid/orgs","repos_url":"https://api.github.com/users/ctrlaltdavid/repos","events_url":"https://api.github.com/users/ctrlaltdavid/events{/privacy}","received_events_url":"https://api.github.com/users/ctrlaltdavid/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ctrlaltdavid/hifi","description":"Open, decentralized virtual worlds using sensors to control avatars and dynamically assigned devices as servers.  San Francisco based startup, we are hiring: http://highfidelity.io/jobs  You can also contribute by doing jobs listed at http://worklist.net -","fork":true,"url":"https://api.github.com/repos/ctrlaltdavid/hifi","forks_url":"https://api.github.com/repos/ctrlaltdavid/hifi/forks","keys_url":"https://api.github.com/repos/ctrlaltdavid/hifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ctrlaltdavid/hifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ctrlaltdavid/hifi/teams","hooks_url":"https://api.github.com/repos/ctrlaltdavid/hifi/hooks","issue_events_url":"https://api.github.com/repos/ctrlaltdavid/hifi/issues/events{/number}","events_url":"https://api.github.com/repos/ctrlaltdavid/hifi/events","assignees_url":"https://api.github.com/repos/ctrlaltdavid/hifi/assignees{/user}","branches_url":"https://api.github.com/repos/ctrlaltdavid/hifi/branches{/branch}","tags_url":"https://api.github.com/repos/ctrlaltdavid/hifi/tags","blobs_url":"https://api.github.com/repos/ctrlaltdavid/hifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ctrlaltdavid/hifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ctrlaltdavid/hifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/ctrlaltdavid/hifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ctrlaltdavid/hifi/statuses/{sha}","languages_url":"https://api.github.com/repos/ctrlaltdavid/hifi/languages","stargazers_url":"https://api.github.com/repos/ctrlaltdavid/hifi/stargazers","contributors_url":"https://api.github.com/repos/ctrlaltdavid/hifi/contributors","subscribers_url":"https://api.github.com/repos/ctrlaltdavid/hifi/subscribers","subscription_url":"https://api.github.com/repos/ctrlaltdavid/hifi/subscription","commits_url":"https://api.github.com/repos/ctrlaltdavid/hifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/ctrlaltdavid/hifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/ctrlaltdavid/hifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/ctrlaltdavid/hifi/issues/comments/{number}","contents_url":"https://api.github.com/repos/ctrlaltdavid/hifi/contents/{+path}","compare_url":"https://api.github.com/repos/ctrlaltdavid/hifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ctrlaltdavid/hifi/merges","archive_url":"https://api.github.com/repos/ctrlaltdavid/hifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ctrlaltdavid/hifi/downloads","issues_url":"https://api.github.com/repos/ctrlaltdavid/hifi/issues{/number}","pulls_url":"https://api.github.com/repos/ctrlaltdavid/hifi/pulls{/number}","milestones_url":"https://api.github.com/repos/ctrlaltdavid/hifi/milestones{/number}","notifications_url":"https://api.github.com/repos/ctrlaltdavid/hifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ctrlaltdavid/hifi/labels{/name}","releases_url":"https://api.github.com/repos/ctrlaltdavid/hifi/releases{/id}","created_at":"2014-05-09T02:45:53Z","updated_at":"2015-01-22T23:51:19Z","pushed_at":"2015-01-23T06:40:38Z","git_url":"git://github.com/ctrlaltdavid/hifi.git","ssh_url":"git@github.com:ctrlaltdavid/hifi.git","clone_url":"https://github.com/ctrlaltdavid/hifi.git","svn_url":"https://github.com/ctrlaltdavid/hifi","homepage":"http://highfidelity.io","size":129433,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"highfidelity:master","ref":"master","sha":"e488e841b754d1faf381b60f8ac82c241929362a","user":{"login":"highfidelity","id":1565370,"avatar_url":"https://avatars.githubusercontent.com/u/1565370?v=3","gravatar_id":"","url":"https://api.github.com/users/highfidelity","html_url":"https://github.com/highfidelity","followers_url":"https://api.github.com/users/highfidelity/followers","following_url":"https://api.github.com/users/highfidelity/following{/other_user}","gists_url":"https://api.github.com/users/highfidelity/gists{/gist_id}","starred_url":"https://api.github.com/users/highfidelity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highfidelity/subscriptions","organizations_url":"https://api.github.com/users/highfidelity/orgs","repos_url":"https://api.github.com/users/highfidelity/repos","events_url":"https://api.github.com/users/highfidelity/events{/privacy}","received_events_url":"https://api.github.com/users/highfidelity/received_events","type":"Organization","site_admin":false},"repo":{"id":5372872,"name":"hifi","full_name":"highfidelity/hifi","owner":{"login":"highfidelity","id":1565370,"avatar_url":"https://avatars.githubusercontent.com/u/1565370?v=3","gravatar_id":"","url":"https://api.github.com/users/highfidelity","html_url":"https://github.com/highfidelity","followers_url":"https://api.github.com/users/highfidelity/followers","following_url":"https://api.github.com/users/highfidelity/following{/other_user}","gists_url":"https://api.github.com/users/highfidelity/gists{/gist_id}","starred_url":"https://api.github.com/users/highfidelity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highfidelity/subscriptions","organizations_url":"https://api.github.com/users/highfidelity/orgs","repos_url":"https://api.github.com/users/highfidelity/repos","events_url":"https://api.github.com/users/highfidelity/events{/privacy}","received_events_url":"https://api.github.com/users/highfidelity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/highfidelity/hifi","description":"Open, decentralized virtual worlds using sensors to control avatars and dynamically assigned devices as servers.  San Francisco based startup, we are hiring: http://highfidelity.io/jobs  Documentation at http://docs.highfidelity.io  Contribute by reporting bugs & doing jobs on http://worklist.net","fork":false,"url":"https://api.github.com/repos/highfidelity/hifi","forks_url":"https://api.github.com/repos/highfidelity/hifi/forks","keys_url":"https://api.github.com/repos/highfidelity/hifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/highfidelity/hifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/highfidelity/hifi/teams","hooks_url":"https://api.github.com/repos/highfidelity/hifi/hooks","issue_events_url":"https://api.github.com/repos/highfidelity/hifi/issues/events{/number}","events_url":"https://api.github.com/repos/highfidelity/hifi/events","assignees_url":"https://api.github.com/repos/highfidelity/hifi/assignees{/user}","branches_url":"https://api.github.com/repos/highfidelity/hifi/branches{/branch}","tags_url":"https://api.github.com/repos/highfidelity/hifi/tags","blobs_url":"https://api.github.com/repos/highfidelity/hifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/highfidelity/hifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/highfidelity/hifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/highfidelity/hifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/highfidelity/hifi/statuses/{sha}","languages_url":"https://api.github.com/repos/highfidelity/hifi/languages","stargazers_url":"https://api.github.com/repos/highfidelity/hifi/stargazers","contributors_url":"https://api.github.com/repos/highfidelity/hifi/contributors","subscribers_url":"https://api.github.com/repos/highfidelity/hifi/subscribers","subscription_url":"https://api.github.com/repos/highfidelity/hifi/subscription","commits_url":"https://api.github.com/repos/highfidelity/hifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/highfidelity/hifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/highfidelity/hifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/highfidelity/hifi/issues/comments/{number}","contents_url":"https://api.github.com/repos/highfidelity/hifi/contents/{+path}","compare_url":"https://api.github.com/repos/highfidelity/hifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/highfidelity/hifi/merges","archive_url":"https://api.github.com/repos/highfidelity/hifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/highfidelity/hifi/downloads","issues_url":"https://api.github.com/repos/highfidelity/hifi/issues{/number}","pulls_url":"https://api.github.com/repos/highfidelity/hifi/pulls{/number}","milestones_url":"https://api.github.com/repos/highfidelity/hifi/milestones{/number}","notifications_url":"https://api.github.com/repos/highfidelity/hifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/highfidelity/hifi/labels{/name}","releases_url":"https://api.github.com/repos/highfidelity/hifi/releases{/id}","created_at":"2012-08-10T18:26:22Z","updated_at":"2015-01-23T16:06:00Z","pushed_at":"2015-01-23T16:06:00Z","git_url":"git://github.com/highfidelity/hifi.git","ssh_url":"git@github.com:highfidelity/hifi.git","clone_url":"https://github.com/highfidelity/hifi.git","svn_url":"https://github.com/highfidelity/hifi","homepage":"","size":175740,"stargazers_count":222,"watchers_count":222,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":129,"mirror_url":null,"open_issues_count":47,"forks":129,"open_issues":47,"watchers":222,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/4155"},"html":{"href":"https://github.com/highfidelity/hifi/pull/4155"},"issue":{"href":"https://api.github.com/repos/highfidelity/hifi/issues/4155"},"comments":{"href":"https://api.github.com/repos/highfidelity/hifi/issues/4155/comments"},"review_comments":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/4155/comments"},"review_comment":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/4155/commits"},"statuses":{"href":"https://api.github.com/repos/highfidelity/hifi/statuses/08afe9dd8f72568669e2707827ac0902ea22fd7d"}}}}