{"action":"created","comment":{"url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/comments/150846395","pull_request_review_id":76456251,"id":150846395,"diff_hunk":"@@ -116,6 +118,48 @@ void Graphics::GUIRenderPass::update(float deltaTime)\n     vertexBuffer.unmap(Global::context);\n }\n \n+void Graphics::GUIRenderPass::updateShake(float deltaTime)\n+{\n+    static float shakeCounter = 0;\n+    static float shakeDuration = 0;\n+    static float shakeRadius = 0;\n+    static bool isShaking = 0;\n+\n+    for (auto & info : RenderQueue::get().getQueue<SpecialEffectRenderInfo>())\n+    {\n+        if (info.type == info.screenShake)\n+        {\n+            shakeCounter = 0;\n+            shakeDuration = info.duration;\n+            shakeRadius = info.radius;\n+            isShaking = true;\n+        }\n+    }\n+\n+    if (isShaking)\n+    {\n+        float currentShakeAmount = shakeRadius * (1 - (shakeCounter / shakeDuration));\n+\n+        static float angle = 0;\n+        angle = rand() % 360;\n+        positionOffset = DirectX::SimpleMath::Vector2(sin(angle) * currentShakeAmount, cos(angle) * currentShakeAmount);\n+\n+\n+\n+        shakeCounter += deltaTime;\n+        if (shakeCounter >= shakeDuration)\n+        {\n+            isShaking = false;\n+            positionOffset = DirectX::SimpleMath::Vector2(0, 0);\n+        }\n+\n+        ndcPositionOffset = DirectX::SimpleMath::Vector2((float)(positionOffset.x * 2.f / WIN_WIDTH), ((WIN_HEIGHT - positionOffset.y) / WIN_HEIGHT) - 1.f);\n+\n+        //this ugly\n+        Global::mainCamera->update(Global::mainCamera->getPos() + ndcPositionOffset * 3.f, Global::mainCamera->getForward(), Global::context);","path":"Graphics/include/RenderPass/GUIRenderPass.cpp","position":73,"original_position":73,"commit_id":"d6585bb2436c7c1bfc599feb7c588c62a1211cbb","original_commit_id":"d6585bb2436c7c1bfc599feb7c588c62a1211cbb","user":{"login":"fkaa","id":768574,"avatar_url":"https://avatars2.githubusercontent.com/u/768574?v=4","gravatar_id":"","url":"https://api.github.com/users/fkaa","html_url":"https://github.com/fkaa","followers_url":"https://api.github.com/users/fkaa/followers","following_url":"https://api.github.com/users/fkaa/following{/other_user}","gists_url":"https://api.github.com/users/fkaa/gists{/gist_id}","starred_url":"https://api.github.com/users/fkaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fkaa/subscriptions","organizations_url":"https://api.github.com/users/fkaa/orgs","repos_url":"https://api.github.com/users/fkaa/repos","events_url":"https://api.github.com/users/fkaa/events{/privacy}","received_events_url":"https://api.github.com/users/fkaa/received_events","type":"User","site_admin":false},"body":"🙍 ","created_at":"2017-11-14T14:25:29Z","updated_at":"2017-11-14T14:25:42Z","html_url":"https://github.com/henrikvik/DV1544-Stort-Spel/pull/165#discussion_r150846395","pull_request_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/165","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/comments/150846395"},"html":{"href":"https://github.com/henrikvik/DV1544-Stort-Spel/pull/165#discussion_r150846395"},"pull_request":{"href":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/165","id":152517647,"html_url":"https://github.com/henrikvik/DV1544-Stort-Spel/pull/165","diff_url":"https://github.com/henrikvik/DV1544-Stort-Spel/pull/165.diff","patch_url":"https://github.com/henrikvik/DV1544-Stort-Spel/pull/165.patch","issue_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/issues/165","number":165,"state":"open","locked":false,"title":"Parkinson_enaled","user":{"login":"Maakuz","id":18489346,"avatar_url":"https://avatars0.githubusercontent.com/u/18489346?v=4","gravatar_id":"","url":"https://api.github.com/users/Maakuz","html_url":"https://github.com/Maakuz","followers_url":"https://api.github.com/users/Maakuz/followers","following_url":"https://api.github.com/users/Maakuz/following{/other_user}","gists_url":"https://api.github.com/users/Maakuz/gists{/gist_id}","starred_url":"https://api.github.com/users/Maakuz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maakuz/subscriptions","organizations_url":"https://api.github.com/users/Maakuz/orgs","repos_url":"https://api.github.com/users/Maakuz/repos","events_url":"https://api.github.com/users/Maakuz/events{/privacy}","received_events_url":"https://api.github.com/users/Maakuz/received_events","type":"User","site_admin":false},"body":"Screen shake can be queued by specialeffectsinstance","created_at":"2017-11-14T14:24:03Z","updated_at":"2017-11-14T14:25:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc085aeb93f8829bfe6b8738866e26f8672aa418","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/165/commits","review_comments_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/165/comments","review_comment_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/issues/165/comments","statuses_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/statuses/d6585bb2436c7c1bfc599feb7c588c62a1211cbb","head":{"label":"henrikvik:Shaky_branch","ref":"Shaky_branch","sha":"d6585bb2436c7c1bfc599feb7c588c62a1211cbb","user":{"login":"henrikvik","id":4365481,"avatar_url":"https://avatars2.githubusercontent.com/u/4365481?v=4","gravatar_id":"","url":"https://api.github.com/users/henrikvik","html_url":"https://github.com/henrikvik","followers_url":"https://api.github.com/users/henrikvik/followers","following_url":"https://api.github.com/users/henrikvik/following{/other_user}","gists_url":"https://api.github.com/users/henrikvik/gists{/gist_id}","starred_url":"https://api.github.com/users/henrikvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrikvik/subscriptions","organizations_url":"https://api.github.com/users/henrikvik/orgs","repos_url":"https://api.github.com/users/henrikvik/repos","events_url":"https://api.github.com/users/henrikvik/events{/privacy}","received_events_url":"https://api.github.com/users/henrikvik/received_events","type":"User","site_admin":false},"repo":{"id":101863249,"name":"DV1544-Stort-Spel","full_name":"henrikvik/DV1544-Stort-Spel","owner":{"login":"henrikvik","id":4365481,"avatar_url":"https://avatars2.githubusercontent.com/u/4365481?v=4","gravatar_id":"","url":"https://api.github.com/users/henrikvik","html_url":"https://github.com/henrikvik","followers_url":"https://api.github.com/users/henrikvik/followers","following_url":"https://api.github.com/users/henrikvik/following{/other_user}","gists_url":"https://api.github.com/users/henrikvik/gists{/gist_id}","starred_url":"https://api.github.com/users/henrikvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrikvik/subscriptions","organizations_url":"https://api.github.com/users/henrikvik/orgs","repos_url":"https://api.github.com/users/henrikvik/repos","events_url":"https://api.github.com/users/henrikvik/events{/privacy}","received_events_url":"https://api.github.com/users/henrikvik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/henrikvik/DV1544-Stort-Spel","description":"DV1544-Stort-Spel","fork":false,"url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel","forks_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/forks","keys_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/teams","hooks_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/hooks","issue_events_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/issues/events{/number}","events_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/events","assignees_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/assignees{/user}","branches_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/branches{/branch}","tags_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/tags","blobs_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/git/refs{/sha}","trees_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/statuses/{sha}","languages_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/languages","stargazers_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/stargazers","contributors_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/contributors","subscribers_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/subscribers","subscription_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/subscription","commits_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/commits{/sha}","git_commits_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/git/commits{/sha}","comments_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/comments{/number}","issue_comment_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/issues/comments{/number}","contents_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/contents/{+path}","compare_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/merges","archive_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/downloads","issues_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/issues{/number}","pulls_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls{/number}","milestones_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/milestones{/number}","notifications_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/labels{/name}","releases_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/releases{/id}","deployments_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/deployments","created_at":"2017-08-30T09:28:57Z","updated_at":"2017-11-08T15:05:11Z","pushed_at":"2017-11-14T14:24:04Z","git_url":"git://github.com/henrikvik/DV1544-Stort-Spel.git","ssh_url":"git@github.com:henrikvik/DV1544-Stort-Spel.git","clone_url":"https://github.com/henrikvik/DV1544-Stort-Spel.git","svn_url":"https://github.com/henrikvik/DV1544-Stort-Spel","homepage":null,"size":177003,"stargazers_count":4,"watchers_count":4,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":4,"default_branch":"development"}},"base":{"label":"henrikvik:development","ref":"development","sha":"d46b6f384322f21086d45c0929b919131468e74f","user":{"login":"henrikvik","id":4365481,"avatar_url":"https://avatars2.githubusercontent.com/u/4365481?v=4","gravatar_id":"","url":"https://api.github.com/users/henrikvik","html_url":"https://github.com/henrikvik","followers_url":"https://api.github.com/users/henrikvik/followers","following_url":"https://api.github.com/users/henrikvik/following{/other_user}","gists_url":"https://api.github.com/users/henrikvik/gists{/gist_id}","starred_url":"https://api.github.com/users/henrikvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrikvik/subscriptions","organizations_url":"https://api.github.com/users/henrikvik/orgs","repos_url":"https://api.github.com/users/henrikvik/repos","events_url":"https://api.github.com/users/henrikvik/events{/privacy}","received_events_url":"https://api.github.com/users/henrikvik/received_events","type":"User","site_admin":false},"repo":{"id":101863249,"name":"DV1544-Stort-Spel","full_name":"henrikvik/DV1544-Stort-Spel","owner":{"login":"henrikvik","id":4365481,"avatar_url":"https://avatars2.githubusercontent.com/u/4365481?v=4","gravatar_id":"","url":"https://api.github.com/users/henrikvik","html_url":"https://github.com/henrikvik","followers_url":"https://api.github.com/users/henrikvik/followers","following_url":"https://api.github.com/users/henrikvik/following{/other_user}","gists_url":"https://api.github.com/users/henrikvik/gists{/gist_id}","starred_url":"https://api.github.com/users/henrikvik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrikvik/subscriptions","organizations_url":"https://api.github.com/users/henrikvik/orgs","repos_url":"https://api.github.com/users/henrikvik/repos","events_url":"https://api.github.com/users/henrikvik/events{/privacy}","received_events_url":"https://api.github.com/users/henrikvik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/henrikvik/DV1544-Stort-Spel","description":"DV1544-Stort-Spel","fork":false,"url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel","forks_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/forks","keys_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/teams","hooks_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/hooks","issue_events_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/issues/events{/number}","events_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/events","assignees_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/assignees{/user}","branches_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/branches{/branch}","tags_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/tags","blobs_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/git/refs{/sha}","trees_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/statuses/{sha}","languages_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/languages","stargazers_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/stargazers","contributors_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/contributors","subscribers_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/subscribers","subscription_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/subscription","commits_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/commits{/sha}","git_commits_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/git/commits{/sha}","comments_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/comments{/number}","issue_comment_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/issues/comments{/number}","contents_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/contents/{+path}","compare_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/merges","archive_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/downloads","issues_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/issues{/number}","pulls_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls{/number}","milestones_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/milestones{/number}","notifications_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/labels{/name}","releases_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/releases{/id}","deployments_url":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/deployments","created_at":"2017-08-30T09:28:57Z","updated_at":"2017-11-08T15:05:11Z","pushed_at":"2017-11-14T14:24:04Z","git_url":"git://github.com/henrikvik/DV1544-Stort-Spel.git","ssh_url":"git@github.com:henrikvik/DV1544-Stort-Spel.git","clone_url":"https://github.com/henrikvik/DV1544-Stort-Spel.git","svn_url":"https://github.com/henrikvik/DV1544-Stort-Spel","homepage":null,"size":177003,"stargazers_count":4,"watchers_count":4,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":4,"default_branch":"development"}},"_links":{"self":{"href":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/165"},"html":{"href":"https://github.com/henrikvik/DV1544-Stort-Spel/pull/165"},"issue":{"href":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/issues/165"},"comments":{"href":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/henrikvik/DV1544-Stort-Spel/statuses/d6585bb2436c7c1bfc599feb7c588c62a1211cbb"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"fkaa"}}