{"action":"created","comment":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/97637746","pull_request_review_id":18253708,"id":97637746,"diff_hunk":"@@ -187,25 +188,35 @@ AABox Avatar::getBounds() const {\n }\n \n void Avatar::animateScaleChanges(float deltaTime) {\n-    float currentScale = getUniformScale();\n-    auto desiredScale = getDomainLimitedScale();\n-    if (currentScale != desiredScale) {\n+    if (_isAnimatingScale) {\n+        float currentScale = getUniformScale();\n+        float desiredScale = getDomainLimitedScale();\n+\n         // use exponential decay toward the domain limit clamped scale\n         const float SCALE_ANIMATION_TIMESCALE = 0.5f;\n         float blendFactor = glm::clamp(deltaTime / SCALE_ANIMATION_TIMESCALE, 0.0f, 1.0f);\n         float animatedScale = (1.0f - blendFactor) * currentScale + blendFactor * desiredScale;\n \n         // snap to the end when we get close enough\n-        const float MIN_RELATIVE_SCALE_ERROR = 0.03f;\n-        if (fabsf(desiredScale - currentScale) / desiredScale < MIN_RELATIVE_SCALE_ERROR) {\n+        const float MIN_RELATIVE_ERROR = 0.03f;\n+        float relativeError = fabsf(desiredScale - currentScale) / desiredScale;\n+        if (relativeError < MIN_RELATIVE_ERROR) {\n             animatedScale = desiredScale;\n+            _isAnimatingScale = false;\n         }\n-\n         setScale(glm::vec3(animatedScale)); // avatar scale is uniform\n+\n+        // TODO: rebuilding the shape constantly is somehwat expensive.\n+        // We should only rebuild after significant change.\n         rebuildCollisionShape();\n     }\n }\n \n+void Avatar::setTargetScale(float targetScale) {\n+    AvatarData::setTargetScale(targetScale);\n+    _isAnimatingScale = true;\n+}","path":"interface/src/avatar/Avatar.cpp","position":45,"original_position":45,"commit_id":"c8741cb518d4db09614f882c16e187f5bc3262c4","original_commit_id":"c8741cb518d4db09614f882c16e187f5bc3262c4","user":{"login":"AndrewMeadows","id":2186405,"avatar_url":"https://avatars.githubusercontent.com/u/2186405?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewMeadows","html_url":"https://github.com/AndrewMeadows","followers_url":"https://api.github.com/users/AndrewMeadows/followers","following_url":"https://api.github.com/users/AndrewMeadows/following{/other_user}","gists_url":"https://api.github.com/users/AndrewMeadows/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewMeadows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewMeadows/subscriptions","organizations_url":"https://api.github.com/users/AndrewMeadows/orgs","repos_url":"https://api.github.com/users/AndrewMeadows/repos","events_url":"https://api.github.com/users/AndrewMeadows/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewMeadows/received_events","type":"User","site_admin":false},"body":"`setTargetScale()` moved out of base class `AvatarData` into derived class `Avatar`.","created_at":"2017-01-24T19:59:48Z","updated_at":"2017-01-24T19:59:49Z","html_url":"https://github.com/highfidelity/hifi/pull/9493#discussion_r97637746","pull_request_url":"https://api.github.com/repos/highfidelity/hifi/pulls/9493","_links":{"self":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/97637746"},"html":{"href":"https://github.com/highfidelity/hifi/pull/9493#discussion_r97637746"},"pull_request":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/9493"}}},"pull_request":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/9493","id":102978796,"html_url":"https://github.com/highfidelity/hifi/pull/9493","diff_url":"https://github.com/highfidelity/hifi/pull/9493.diff","patch_url":"https://github.com/highfidelity/hifi/pull/9493.patch","issue_url":"https://api.github.com/repos/highfidelity/hifi/issues/9493","number":9493,"state":"open","locked":false,"title":"optimize, prioritize, and timebox processing of avatar updates","user":{"login":"AndrewMeadows","id":2186405,"avatar_url":"https://avatars.githubusercontent.com/u/2186405?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewMeadows","html_url":"https://github.com/AndrewMeadows","followers_url":"https://api.github.com/users/AndrewMeadows/followers","following_url":"https://api.github.com/users/AndrewMeadows/following{/other_user}","gists_url":"https://api.github.com/users/AndrewMeadows/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewMeadows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewMeadows/subscriptions","organizations_url":"https://api.github.com/users/AndrewMeadows/orgs","repos_url":"https://api.github.com/users/AndrewMeadows/repos","events_url":"https://api.github.com/users/AndrewMeadows/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewMeadows/received_events","type":"User","site_admin":false},"body":"* removed cruft\r\n* prioritize avatar updates by proximity, position, and time since last update\r\n* handle avatar updates by priority until out of time","created_at":"2017-01-24T18:43:36Z","updated_at":"2017-01-24T19:59:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc493a3b94f4bb220e1deafc79c147afb2abbb15","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/highfidelity/hifi/pulls/9493/commits","review_comments_url":"https://api.github.com/repos/highfidelity/hifi/pulls/9493/comments","review_comment_url":"https://api.github.com/repos/highfidelity/hifi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/highfidelity/hifi/issues/9493/comments","statuses_url":"https://api.github.com/repos/highfidelity/hifi/statuses/c8741cb518d4db09614f882c16e187f5bc3262c4","head":{"label":"AndrewMeadows:otherAvatars","ref":"otherAvatars","sha":"c8741cb518d4db09614f882c16e187f5bc3262c4","user":{"login":"AndrewMeadows","id":2186405,"avatar_url":"https://avatars.githubusercontent.com/u/2186405?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewMeadows","html_url":"https://github.com/AndrewMeadows","followers_url":"https://api.github.com/users/AndrewMeadows/followers","following_url":"https://api.github.com/users/AndrewMeadows/following{/other_user}","gists_url":"https://api.github.com/users/AndrewMeadows/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewMeadows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewMeadows/subscriptions","organizations_url":"https://api.github.com/users/AndrewMeadows/orgs","repos_url":"https://api.github.com/users/AndrewMeadows/repos","events_url":"https://api.github.com/users/AndrewMeadows/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewMeadows/received_events","type":"User","site_admin":false},"repo":{"id":15350502,"name":"hifi","full_name":"AndrewMeadows/hifi","owner":{"login":"AndrewMeadows","id":2186405,"avatar_url":"https://avatars.githubusercontent.com/u/2186405?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewMeadows","html_url":"https://github.com/AndrewMeadows","followers_url":"https://api.github.com/users/AndrewMeadows/followers","following_url":"https://api.github.com/users/AndrewMeadows/following{/other_user}","gists_url":"https://api.github.com/users/AndrewMeadows/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewMeadows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewMeadows/subscriptions","organizations_url":"https://api.github.com/users/AndrewMeadows/orgs","repos_url":"https://api.github.com/users/AndrewMeadows/repos","events_url":"https://api.github.com/users/AndrewMeadows/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewMeadows/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AndrewMeadows/hifi","description":"Open, decentralized virtual world 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/worklist.php","fork":true,"url":"https://api.github.com/repos/AndrewMeadows/hifi","forks_url":"https://api.github.com/repos/AndrewMeadows/hifi/forks","keys_url":"https://api.github.com/repos/AndrewMeadows/hifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AndrewMeadows/hifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AndrewMeadows/hifi/teams","hooks_url":"https://api.github.com/repos/AndrewMeadows/hifi/hooks","issue_events_url":"https://api.github.com/repos/AndrewMeadows/hifi/issues/events{/number}","events_url":"https://api.github.com/repos/AndrewMeadows/hifi/events","assignees_url":"https://api.github.com/repos/AndrewMeadows/hifi/assignees{/user}","branches_url":"https://api.github.com/repos/AndrewMeadows/hifi/branches{/branch}","tags_url":"https://api.github.com/repos/AndrewMeadows/hifi/tags","blobs_url":"https://api.github.com/repos/AndrewMeadows/hifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AndrewMeadows/hifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AndrewMeadows/hifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/AndrewMeadows/hifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AndrewMeadows/hifi/statuses/{sha}","languages_url":"https://api.github.com/repos/AndrewMeadows/hifi/languages","stargazers_url":"https://api.github.com/repos/AndrewMeadows/hifi/stargazers","contributors_url":"https://api.github.com/repos/AndrewMeadows/hifi/contributors","subscribers_url":"https://api.github.com/repos/AndrewMeadows/hifi/subscribers","subscription_url":"https://api.github.com/repos/AndrewMeadows/hifi/subscription","commits_url":"https://api.github.com/repos/AndrewMeadows/hifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/AndrewMeadows/hifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/AndrewMeadows/hifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/AndrewMeadows/hifi/issues/comments{/number}","contents_url":"https://api.github.com/repos/AndrewMeadows/hifi/contents/{+path}","compare_url":"https://api.github.com/repos/AndrewMeadows/hifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AndrewMeadows/hifi/merges","archive_url":"https://api.github.com/repos/AndrewMeadows/hifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AndrewMeadows/hifi/downloads","issues_url":"https://api.github.com/repos/AndrewMeadows/hifi/issues{/number}","pulls_url":"https://api.github.com/repos/AndrewMeadows/hifi/pulls{/number}","milestones_url":"https://api.github.com/repos/AndrewMeadows/hifi/milestones{/number}","notifications_url":"https://api.github.com/repos/AndrewMeadows/hifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AndrewMeadows/hifi/labels{/name}","releases_url":"https://api.github.com/repos/AndrewMeadows/hifi/releases{/id}","deployments_url":"https://api.github.com/repos/AndrewMeadows/hifi/deployments","created_at":"2013-12-20T23:18:13Z","updated_at":"2015-04-03T16:42:09Z","pushed_at":"2017-01-24T18:38:06Z","git_url":"git://github.com/AndrewMeadows/hifi.git","ssh_url":"git@github.com:AndrewMeadows/hifi.git","clone_url":"https://github.com/AndrewMeadows/hifi.git","svn_url":"https://github.com/AndrewMeadows/hifi","homepage":"http://highfidelity.io","size":268121,"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":"highfidelity:master","ref":"master","sha":"479aa93ab279e971a298a0695883613606c87916","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 source client/server software for creating shared VR environments.  Docs at http://wiki.highfidelity.com  We are hiring: http://highfidelity.com/jobs  Also, PT work available at 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}","deployments_url":"https://api.github.com/repos/highfidelity/hifi/deployments","created_at":"2012-08-10T18:26:22Z","updated_at":"2017-01-15T00:25:55Z","pushed_at":"2017-01-24T19:53:16Z","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":268999,"stargazers_count":473,"watchers_count":473,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":276,"mirror_url":null,"open_issues_count":61,"forks":276,"open_issues":61,"watchers":473,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/9493"},"html":{"href":"https://github.com/highfidelity/hifi/pull/9493"},"issue":{"href":"https://api.github.com/repos/highfidelity/hifi/issues/9493"},"comments":{"href":"https://api.github.com/repos/highfidelity/hifi/issues/9493/comments"},"review_comments":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/9493/comments"},"review_comment":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/9493/commits"},"statuses":{"href":"https://api.github.com/repos/highfidelity/hifi/statuses/c8741cb518d4db09614f882c16e187f5bc3262c4"}}}}
{"actor":{"display_login":"AndrewMeadows"}}