{"action":"created","comment":{"url":"https://api.github.com/repos/falltergeist/falltergeist/pulls/comments/27277628","id":27277628,"diff_hunk":"@@ -146,22 +147,40 @@ void Hexagon::setInRender(bool value)\n \n unsigned int Hexagon::orientationTo(Hexagon* hexagon)\n {\n-    int dx = hexagon->cubeX() - cubeX();\n-    int dy = hexagon->cubeY() - cubeY();\n \n-    if (dx == 0) // 0 || 3\n+    int x1 = x();\n+    int y1 = y();\n+    int x2 = hexagon->x();\n+    int y2 = hexagon->y();\n+    int dx = x2 - x1;\n+    int dy = y2 - y1;\n+\n+    unsigned int result = 0;\n+\n+    if (dx)\n     {\n-        return dy > 0 ? 0 : 3;\n+        // triginometry magick.\n+        // basically, we try to find angle to second hex in circle, where first hex is center\n+        // and then find out to which of 60� slices it belongs\n+\n+        double degree = atan2((double)-dy, (double)dx) * 180.0 * 0.3183098862851122; //  180 * 1/PI","path":"src/PathFinding/Hexagon.cpp","position":32,"original_position":32,"commit_id":"c6179871fef0a67b5261b66d0930d4b063841f68","original_commit_id":"c6179871fef0a67b5261b66d0930d4b063841f68","user":{"login":"isage","id":273697,"avatar_url":"https://avatars.githubusercontent.com/u/273697?v=3","gravatar_id":"","url":"https://api.github.com/users/isage","html_url":"https://github.com/isage","followers_url":"https://api.github.com/users/isage/followers","following_url":"https://api.github.com/users/isage/following{/other_user}","gists_url":"https://api.github.com/users/isage/gists{/gist_id}","starred_url":"https://api.github.com/users/isage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isage/subscriptions","organizations_url":"https://api.github.com/users/isage/orgs","repos_url":"https://api.github.com/users/isage/repos","events_url":"https://api.github.com/users/isage/events{/privacy}","received_events_url":"https://api.github.com/users/isage/received_events","type":"User","site_admin":false},"body":"M_PI is non-standard extension: it may be defined, may be not.\r\nSame as M_1_PI = 1/M_PI\r\nAnd once again - it slightly differs in value from original binary. And while i don't know why - i will use value from binary.","created_at":"2015-03-27T06:09:01Z","updated_at":"2015-03-27T06:09:01Z","html_url":"https://github.com/falltergeist/falltergeist/pull/342#discussion_r27277628","pull_request_url":"https://api.github.com/repos/falltergeist/falltergeist/pulls/342","_links":{"self":{"href":"https://api.github.com/repos/falltergeist/falltergeist/pulls/comments/27277628"},"html":{"href":"https://github.com/falltergeist/falltergeist/pull/342#discussion_r27277628"},"pull_request":{"href":"https://api.github.com/repos/falltergeist/falltergeist/pulls/342"}}},"pull_request":{"url":"https://api.github.com/repos/falltergeist/falltergeist/pulls/342","id":31923227,"html_url":"https://github.com/falltergeist/falltergeist/pull/342","diff_url":"https://github.com/falltergeist/falltergeist/pull/342.diff","patch_url":"https://github.com/falltergeist/falltergeist/pull/342.patch","issue_url":"https://api.github.com/repos/falltergeist/falltergeist/issues/342","number":342,"state":"closed","locked":false,"title":"Proper orientationTo inmplementation","user":{"login":"isage","id":273697,"avatar_url":"https://avatars.githubusercontent.com/u/273697?v=3","gravatar_id":"","url":"https://api.github.com/users/isage","html_url":"https://github.com/isage","followers_url":"https://api.github.com/users/isage/followers","following_url":"https://api.github.com/users/isage/following{/other_user}","gists_url":"https://api.github.com/users/isage/gists{/gist_id}","starred_url":"https://api.github.com/users/isage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isage/subscriptions","organizations_url":"https://api.github.com/users/isage/orgs","repos_url":"https://api.github.com/users/isage/repos","events_url":"https://api.github.com/users/isage/events{/privacy}","received_events_url":"https://api.github.com/users/isage/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-25T13:48:54Z","updated_at":"2015-03-27T06:09:01Z","closed_at":"2015-03-25T14:27:45Z","merged_at":"2015-03-25T14:27:45Z","merge_commit_sha":"503ec2b45c69bd143ae10ee1cdb8179c0f26eba0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/falltergeist/falltergeist/pulls/342/commits","review_comments_url":"https://api.github.com/repos/falltergeist/falltergeist/pulls/342/comments","review_comment_url":"https://api.github.com/repos/falltergeist/falltergeist/pulls/comments{/number}","comments_url":"https://api.github.com/repos/falltergeist/falltergeist/issues/342/comments","statuses_url":"https://api.github.com/repos/falltergeist/falltergeist/statuses/c6179871fef0a67b5261b66d0930d4b063841f68","head":{"label":"isage:hexagons","ref":"hexagons","sha":"c6179871fef0a67b5261b66d0930d4b063841f68","user":{"login":"isage","id":273697,"avatar_url":"https://avatars.githubusercontent.com/u/273697?v=3","gravatar_id":"","url":"https://api.github.com/users/isage","html_url":"https://github.com/isage","followers_url":"https://api.github.com/users/isage/followers","following_url":"https://api.github.com/users/isage/following{/other_user}","gists_url":"https://api.github.com/users/isage/gists{/gist_id}","starred_url":"https://api.github.com/users/isage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isage/subscriptions","organizations_url":"https://api.github.com/users/isage/orgs","repos_url":"https://api.github.com/users/isage/repos","events_url":"https://api.github.com/users/isage/events{/privacy}","received_events_url":"https://api.github.com/users/isage/received_events","type":"User","site_admin":false},"repo":{"id":30808872,"name":"falltergeist","full_name":"isage/falltergeist","owner":{"login":"isage","id":273697,"avatar_url":"https://avatars.githubusercontent.com/u/273697?v=3","gravatar_id":"","url":"https://api.github.com/users/isage","html_url":"https://github.com/isage","followers_url":"https://api.github.com/users/isage/followers","following_url":"https://api.github.com/users/isage/following{/other_user}","gists_url":"https://api.github.com/users/isage/gists{/gist_id}","starred_url":"https://api.github.com/users/isage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isage/subscriptions","organizations_url":"https://api.github.com/users/isage/orgs","repos_url":"https://api.github.com/users/isage/repos","events_url":"https://api.github.com/users/isage/events{/privacy}","received_events_url":"https://api.github.com/users/isage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/isage/falltergeist","description":"Opensource crossplatform Fallout 2™ game engine writen in C++ and SDL. Current version: 0.2.0","fork":true,"url":"https://api.github.com/repos/isage/falltergeist","forks_url":"https://api.github.com/repos/isage/falltergeist/forks","keys_url":"https://api.github.com/repos/isage/falltergeist/keys{/key_id}","collaborators_url":"https://api.github.com/repos/isage/falltergeist/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/isage/falltergeist/teams","hooks_url":"https://api.github.com/repos/isage/falltergeist/hooks","issue_events_url":"https://api.github.com/repos/isage/falltergeist/issues/events{/number}","events_url":"https://api.github.com/repos/isage/falltergeist/events","assignees_url":"https://api.github.com/repos/isage/falltergeist/assignees{/user}","branches_url":"https://api.github.com/repos/isage/falltergeist/branches{/branch}","tags_url":"https://api.github.com/repos/isage/falltergeist/tags","blobs_url":"https://api.github.com/repos/isage/falltergeist/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/isage/falltergeist/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/isage/falltergeist/git/refs{/sha}","trees_url":"https://api.github.com/repos/isage/falltergeist/git/trees{/sha}","statuses_url":"https://api.github.com/repos/isage/falltergeist/statuses/{sha}","languages_url":"https://api.github.com/repos/isage/falltergeist/languages","stargazers_url":"https://api.github.com/repos/isage/falltergeist/stargazers","contributors_url":"https://api.github.com/repos/isage/falltergeist/contributors","subscribers_url":"https://api.github.com/repos/isage/falltergeist/subscribers","subscription_url":"https://api.github.com/repos/isage/falltergeist/subscription","commits_url":"https://api.github.com/repos/isage/falltergeist/commits{/sha}","git_commits_url":"https://api.github.com/repos/isage/falltergeist/git/commits{/sha}","comments_url":"https://api.github.com/repos/isage/falltergeist/comments{/number}","issue_comment_url":"https://api.github.com/repos/isage/falltergeist/issues/comments{/number}","contents_url":"https://api.github.com/repos/isage/falltergeist/contents/{+path}","compare_url":"https://api.github.com/repos/isage/falltergeist/compare/{base}...{head}","merges_url":"https://api.github.com/repos/isage/falltergeist/merges","archive_url":"https://api.github.com/repos/isage/falltergeist/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/isage/falltergeist/downloads","issues_url":"https://api.github.com/repos/isage/falltergeist/issues{/number}","pulls_url":"https://api.github.com/repos/isage/falltergeist/pulls{/number}","milestones_url":"https://api.github.com/repos/isage/falltergeist/milestones{/number}","notifications_url":"https://api.github.com/repos/isage/falltergeist/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/isage/falltergeist/labels{/name}","releases_url":"https://api.github.com/repos/isage/falltergeist/releases{/id}","created_at":"2015-02-14T21:08:12Z","updated_at":"2015-03-24T15:18:15Z","pushed_at":"2015-03-25T15:13:12Z","git_url":"git://github.com/isage/falltergeist.git","ssh_url":"git@github.com:isage/falltergeist.git","clone_url":"https://github.com/isage/falltergeist.git","svn_url":"https://github.com/isage/falltergeist","homepage":"https://falltergeist.org/","size":4578,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"falltergeist:master","ref":"master","sha":"42a2a181d3dca56a1885506c63425341fc00daad","user":{"login":"falltergeist","id":10937205,"avatar_url":"https://avatars.githubusercontent.com/u/10937205?v=3","gravatar_id":"","url":"https://api.github.com/users/falltergeist","html_url":"https://github.com/falltergeist","followers_url":"https://api.github.com/users/falltergeist/followers","following_url":"https://api.github.com/users/falltergeist/following{/other_user}","gists_url":"https://api.github.com/users/falltergeist/gists{/gist_id}","starred_url":"https://api.github.com/users/falltergeist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/falltergeist/subscriptions","organizations_url":"https://api.github.com/users/falltergeist/orgs","repos_url":"https://api.github.com/users/falltergeist/repos","events_url":"https://api.github.com/users/falltergeist/events{/privacy}","received_events_url":"https://api.github.com/users/falltergeist/received_events","type":"Organization","site_admin":false},"repo":{"id":6838493,"name":"falltergeist","full_name":"falltergeist/falltergeist","owner":{"login":"falltergeist","id":10937205,"avatar_url":"https://avatars.githubusercontent.com/u/10937205?v=3","gravatar_id":"","url":"https://api.github.com/users/falltergeist","html_url":"https://github.com/falltergeist","followers_url":"https://api.github.com/users/falltergeist/followers","following_url":"https://api.github.com/users/falltergeist/following{/other_user}","gists_url":"https://api.github.com/users/falltergeist/gists{/gist_id}","starred_url":"https://api.github.com/users/falltergeist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/falltergeist/subscriptions","organizations_url":"https://api.github.com/users/falltergeist/orgs","repos_url":"https://api.github.com/users/falltergeist/repos","events_url":"https://api.github.com/users/falltergeist/events{/privacy}","received_events_url":"https://api.github.com/users/falltergeist/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/falltergeist/falltergeist","description":"Opensource crossplatform Fallout 2™ game engine writen in C++ and SDL. Current version: 0.2.0","fork":false,"url":"https://api.github.com/repos/falltergeist/falltergeist","forks_url":"https://api.github.com/repos/falltergeist/falltergeist/forks","keys_url":"https://api.github.com/repos/falltergeist/falltergeist/keys{/key_id}","collaborators_url":"https://api.github.com/repos/falltergeist/falltergeist/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/falltergeist/falltergeist/teams","hooks_url":"https://api.github.com/repos/falltergeist/falltergeist/hooks","issue_events_url":"https://api.github.com/repos/falltergeist/falltergeist/issues/events{/number}","events_url":"https://api.github.com/repos/falltergeist/falltergeist/events","assignees_url":"https://api.github.com/repos/falltergeist/falltergeist/assignees{/user}","branches_url":"https://api.github.com/repos/falltergeist/falltergeist/branches{/branch}","tags_url":"https://api.github.com/repos/falltergeist/falltergeist/tags","blobs_url":"https://api.github.com/repos/falltergeist/falltergeist/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/falltergeist/falltergeist/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/falltergeist/falltergeist/git/refs{/sha}","trees_url":"https://api.github.com/repos/falltergeist/falltergeist/git/trees{/sha}","statuses_url":"https://api.github.com/repos/falltergeist/falltergeist/statuses/{sha}","languages_url":"https://api.github.com/repos/falltergeist/falltergeist/languages","stargazers_url":"https://api.github.com/repos/falltergeist/falltergeist/stargazers","contributors_url":"https://api.github.com/repos/falltergeist/falltergeist/contributors","subscribers_url":"https://api.github.com/repos/falltergeist/falltergeist/subscribers","subscription_url":"https://api.github.com/repos/falltergeist/falltergeist/subscription","commits_url":"https://api.github.com/repos/falltergeist/falltergeist/commits{/sha}","git_commits_url":"https://api.github.com/repos/falltergeist/falltergeist/git/commits{/sha}","comments_url":"https://api.github.com/repos/falltergeist/falltergeist/comments{/number}","issue_comment_url":"https://api.github.com/repos/falltergeist/falltergeist/issues/comments{/number}","contents_url":"https://api.github.com/repos/falltergeist/falltergeist/contents/{+path}","compare_url":"https://api.github.com/repos/falltergeist/falltergeist/compare/{base}...{head}","merges_url":"https://api.github.com/repos/falltergeist/falltergeist/merges","archive_url":"https://api.github.com/repos/falltergeist/falltergeist/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/falltergeist/falltergeist/downloads","issues_url":"https://api.github.com/repos/falltergeist/falltergeist/issues{/number}","pulls_url":"https://api.github.com/repos/falltergeist/falltergeist/pulls{/number}","milestones_url":"https://api.github.com/repos/falltergeist/falltergeist/milestones{/number}","notifications_url":"https://api.github.com/repos/falltergeist/falltergeist/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/falltergeist/falltergeist/labels{/name}","releases_url":"https://api.github.com/repos/falltergeist/falltergeist/releases{/id}","created_at":"2012-11-24T10:08:12Z","updated_at":"2015-03-25T17:25:33Z","pushed_at":"2015-03-25T17:25:32Z","git_url":"git://github.com/falltergeist/falltergeist.git","ssh_url":"git@github.com:falltergeist/falltergeist.git","clone_url":"https://github.com/falltergeist/falltergeist.git","svn_url":"https://github.com/falltergeist/falltergeist","homepage":"https://falltergeist.org/","size":9323,"stargazers_count":71,"watchers_count":71,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":50,"forks":16,"open_issues":50,"watchers":71,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/falltergeist/falltergeist/pulls/342"},"html":{"href":"https://github.com/falltergeist/falltergeist/pull/342"},"issue":{"href":"https://api.github.com/repos/falltergeist/falltergeist/issues/342"},"comments":{"href":"https://api.github.com/repos/falltergeist/falltergeist/issues/342/comments"},"review_comments":{"href":"https://api.github.com/repos/falltergeist/falltergeist/pulls/342/comments"},"review_comment":{"href":"https://api.github.com/repos/falltergeist/falltergeist/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/falltergeist/falltergeist/pulls/342/commits"},"statuses":{"href":"https://api.github.com/repos/falltergeist/falltergeist/statuses/c6179871fef0a67b5261b66d0930d4b063841f68"}}}}