{"action":"created","comment":{"url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/comments/44362934","id":44362934,"diff_hunk":"@@ -20,124 +20,229 @@ window.altspace.utilities.behaviors = window.altspace.utilities.behaviors || {};\n  * @memberof module:altspace/utilities/behaviors\n  **/\n window.altspace.utilities.behaviors.Object3DSync = function (config){\n-    config = config || {};\n-    /*if (config.position === undefined) config.position = true;\n-    if (config.rotation === undefined) config.rotation = true;\n-    if (config.scale === undefined) config.scale = true;\n-    if (config.syncData === undefined) config.syncData = true;*/\n-    var object3d;\n-    var ref;\n-    var key;\n-\n-    var sendEnqueued = false;\n-\n-    var positionRef;\n-    var rotationRef;\n-    var scaleRef;\n-    var syncDataRef;\n-\n-    function link(objectRef) {\n-        ref = objectRef;\n-        key = ref.key();\n-        positionRef = ref.child('position');\n-        rotationRef = ref.child('rotation');\n-        scaleRef = ref.child('scale');\n-        syncDataRef = ref.child('syncData');\n-    }\n-\n-    //TODO: lerp\n-    function setupReceive() {\n-        if (config.position) {\n-            positionRef.on('value', function (snapshot) {\n-                var value = snapshot.val();\n-                if(!value) return;\n-                object3d.position.set(value.x, value.y, value.z);\n-            });\n-        }\n-        if (config.rotation) {\n-            rotationRef.on('value', function (snapshot) {\n-                var value = snapshot.val();\n-                if (!value) return;\n-                object3d.quaternion.set(value.x, value.y, value.z, value.w);\n-            });\n-        }\n-        if (config.scale) {\n-            scaleRef.on('value', function (snapshot) {\n-                var value = snapshot.val();\n-                if (!value) return;\n-                object3d.scale.set(value.x, value.y, value.z);\n-            });\n-        }\n-        if (config.syncData) {\n-            if (!object3d.userData.syncData) {//init here so app can assume it exists\n-                object3d.userData.syncData = {};\n-            }\n-            syncDataRef.on('value', function (snapshot) {\n-                var value = snapshot.val();\n-                if (!value) return;\n-                object3d.userData.syncData = value;\n-            });\n-        }\n-    }\n-\n-\n-    /**\n-     * Enqueue a sync for the next SceneSync update.\n-     * \n-     * This is to be used whenever you update a property and are not using auto. If multiple users could potentially move an object, this is preferred vs using auto.\n-     * @instance\n-     * @method enqueueSend\n-     * @memberof module:altspace/utilities/behaviors.Object3DSync\n-     */\n-    function enqueueSend() {\n-        sendEnqueued = true;\n-    }\n-\n-    function send() {\n-        if (config.position) {\n-            positionRef.set({\n-                x: object3d.position.x,\n-                y: object3d.position.y,\n-                z: object3d.position.z\n-            });\n-        }\n-        if (config.rotation) {\n-            rotationRef.set({\n-                x: object3d.quaternion.x,\n-                y: object3d.quaternion.y,\n-                z: object3d.quaternion.z,\n-                w: object3d.quaternion.w\n-            });\n-        }\n-        if (config.scale) {\n-            scaleRef.set({\n-                x: object3d.scale.x,\n-                y: object3d.scale.y,\n-                z: object3d.scale.z\n-            });\n-        }\n-        if (config.syncData) {\n-            syncDataRef.set(object3d.userData.syncData);//TODO: see if this needs to be parsed and stringified\n-        }\n-    }\n-\n-    function autoSend() {\n-        if (config.auto || sendEnqueued) send();\n-        sendEnqueued = false;\n-    }\n-\n-    function awake(o) {\n-        object3d = o;\n-\n-        setupReceive();\n-    }\n-\n-    function update(deltaTime) {\n-        \n-    }\n-\n-    var exports = { awake: awake, update: update, type: 'Object3DSync', link: link, send: send, enqueueSend: enqueueSend, autoSend: autoSend};\n-\n-    return exports;\n+\tconfig = config || {};\n+\tif (config.position === undefined) config.position = false;\n+\tif (config.rotation === undefined) config.rotation = false;\n+\tif (config.scale === undefined) config.scale = false;\n+\tif (config.syncData === undefined) config.syncData = false;\n+\tif (config.auto === undefined) config.auto = false;\n+\tif (config.tolerance === undefined) config.tolerance = {\n+\t\tposition: 1, rotation: 1, scale: 1\n+\t};\n+\n+\tvar object3d;\n+\tvar ref;\n+\tvar key;\n+\n+\tvar sendEnqueued = false;\n+\n+\tvar dataRef;\n+\n+\tvar lastData;//most recent data sent for this object\n+\n+\tfunction link(objectRef) {\n+\t\tref = objectRef;\n+\t\tkey = ref.key();\n+\t\tdataRef = ref.child('data');\n+\t}\n+\n+\t//TODO: lerp\n+\tfunction setupReceive() {\n+\t\tdataRef.on('value', function (snapshot) {\n+\t\t\tvar data = snapshot.val();","path":"src/utilities/behaviors/Object3DSync.js","position":152,"original_position":152,"commit_id":"09f75872398fb252b2b256cbedcd5e792688e780","original_commit_id":"09f75872398fb252b2b256cbedcd5e792688e780","user":{"login":"GavanWilhite","id":2085119,"avatar_url":"https://avatars.githubusercontent.com/u/2085119?v=3","gravatar_id":"","url":"https://api.github.com/users/GavanWilhite","html_url":"https://github.com/GavanWilhite","followers_url":"https://api.github.com/users/GavanWilhite/followers","following_url":"https://api.github.com/users/GavanWilhite/following{/other_user}","gists_url":"https://api.github.com/users/GavanWilhite/gists{/gist_id}","starred_url":"https://api.github.com/users/GavanWilhite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GavanWilhite/subscriptions","organizations_url":"https://api.github.com/users/GavanWilhite/orgs","repos_url":"https://api.github.com/users/GavanWilhite/repos","events_url":"https://api.github.com/users/GavanWilhite/events{/privacy}","received_events_url":"https://api.github.com/users/GavanWilhite/received_events","type":"User","site_admin":false},"body":"let's keep this as value if possible since the call is .val();","created_at":"2015-11-10T02:14:02Z","updated_at":"2015-11-10T02:14:02Z","html_url":"https://github.com/AltspaceVR/AltspaceSDK/pull/80#discussion_r44362934","pull_request_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/80","_links":{"self":{"href":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/comments/44362934"},"html":{"href":"https://github.com/AltspaceVR/AltspaceSDK/pull/80#discussion_r44362934"},"pull_request":{"href":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/80"}}},"pull_request":{"url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/80","id":50020452,"html_url":"https://github.com/AltspaceVR/AltspaceSDK/pull/80","diff_url":"https://github.com/AltspaceVR/AltspaceSDK/pull/80.diff","patch_url":"https://github.com/AltspaceVR/AltspaceSDK/pull/80.patch","issue_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/issues/80","number":80,"state":"open","locked":false,"title":"Several fixes to Utilities","user":{"login":"amberroy","id":1117692,"avatar_url":"https://avatars.githubusercontent.com/u/1117692?v=3","gravatar_id":"","url":"https://api.github.com/users/amberroy","html_url":"https://github.com/amberroy","followers_url":"https://api.github.com/users/amberroy/followers","following_url":"https://api.github.com/users/amberroy/following{/other_user}","gists_url":"https://api.github.com/users/amberroy/gists{/gist_id}","starred_url":"https://api.github.com/users/amberroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amberroy/subscriptions","organizations_url":"https://api.github.com/users/amberroy/orgs","repos_url":"https://api.github.com/users/amberroy/repos","events_url":"https://api.github.com/users/amberroy/events{/privacy}","received_events_url":"https://api.github.com/users/amberroy/received_events","type":"User","site_admin":false},"body":"Ignore thel iving-room-main.js not sure if we need that.","created_at":"2015-11-07T00:12:11Z","updated_at":"2015-11-10T02:14:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17075d1cdc92bb42930aa6c3f984a846e172d0ee","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/80/commits","review_comments_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/80/comments","review_comment_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/issues/80/comments","statuses_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/statuses/09f75872398fb252b2b256cbedcd5e792688e780","head":{"label":"AltspaceVR:feature/utilities-bugfixes","ref":"feature/utilities-bugfixes","sha":"09f75872398fb252b2b256cbedcd5e792688e780","user":{"login":"AltspaceVR","id":7229981,"avatar_url":"https://avatars.githubusercontent.com/u/7229981?v=3","gravatar_id":"","url":"https://api.github.com/users/AltspaceVR","html_url":"https://github.com/AltspaceVR","followers_url":"https://api.github.com/users/AltspaceVR/followers","following_url":"https://api.github.com/users/AltspaceVR/following{/other_user}","gists_url":"https://api.github.com/users/AltspaceVR/gists{/gist_id}","starred_url":"https://api.github.com/users/AltspaceVR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltspaceVR/subscriptions","organizations_url":"https://api.github.com/users/AltspaceVR/orgs","repos_url":"https://api.github.com/users/AltspaceVR/repos","events_url":"https://api.github.com/users/AltspaceVR/events{/privacy}","received_events_url":"https://api.github.com/users/AltspaceVR/received_events","type":"Organization","site_admin":false},"repo":{"id":33642201,"name":"AltspaceSDK","full_name":"AltspaceVR/AltspaceSDK","owner":{"login":"AltspaceVR","id":7229981,"avatar_url":"https://avatars.githubusercontent.com/u/7229981?v=3","gravatar_id":"","url":"https://api.github.com/users/AltspaceVR","html_url":"https://github.com/AltspaceVR","followers_url":"https://api.github.com/users/AltspaceVR/followers","following_url":"https://api.github.com/users/AltspaceVR/following{/other_user}","gists_url":"https://api.github.com/users/AltspaceVR/gists{/gist_id}","starred_url":"https://api.github.com/users/AltspaceVR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltspaceVR/subscriptions","organizations_url":"https://api.github.com/users/AltspaceVR/orgs","repos_url":"https://api.github.com/users/AltspaceVR/repos","events_url":"https://api.github.com/users/AltspaceVR/events{/privacy}","received_events_url":"https://api.github.com/users/AltspaceVR/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AltspaceVR/AltspaceSDK","description":"","fork":false,"url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK","forks_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/forks","keys_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/teams","hooks_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/hooks","issue_events_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/issues/events{/number}","events_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/events","assignees_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/assignees{/user}","branches_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/branches{/branch}","tags_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/tags","blobs_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/statuses/{sha}","languages_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/languages","stargazers_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/stargazers","contributors_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/contributors","subscribers_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/subscribers","subscription_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/subscription","commits_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/contents/{+path}","compare_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/merges","archive_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/downloads","issues_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/issues{/number}","pulls_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls{/number}","milestones_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/milestones{/number}","notifications_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/labels{/name}","releases_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/releases{/id}","created_at":"2015-04-09T01:41:42Z","updated_at":"2015-11-09T05:43:17Z","pushed_at":"2015-11-10T02:06:06Z","git_url":"git://github.com/AltspaceVR/AltspaceSDK.git","ssh_url":"git@github.com:AltspaceVR/AltspaceSDK.git","clone_url":"https://github.com/AltspaceVR/AltspaceSDK.git","svn_url":"https://github.com/AltspaceVR/AltspaceSDK","homepage":null,"size":28264,"stargazers_count":21,"watchers_count":21,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":21,"default_branch":"master"}},"base":{"label":"AltspaceVR:master","ref":"master","sha":"91985d72f257a7fd7312b1954795daa861fe1f74","user":{"login":"AltspaceVR","id":7229981,"avatar_url":"https://avatars.githubusercontent.com/u/7229981?v=3","gravatar_id":"","url":"https://api.github.com/users/AltspaceVR","html_url":"https://github.com/AltspaceVR","followers_url":"https://api.github.com/users/AltspaceVR/followers","following_url":"https://api.github.com/users/AltspaceVR/following{/other_user}","gists_url":"https://api.github.com/users/AltspaceVR/gists{/gist_id}","starred_url":"https://api.github.com/users/AltspaceVR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltspaceVR/subscriptions","organizations_url":"https://api.github.com/users/AltspaceVR/orgs","repos_url":"https://api.github.com/users/AltspaceVR/repos","events_url":"https://api.github.com/users/AltspaceVR/events{/privacy}","received_events_url":"https://api.github.com/users/AltspaceVR/received_events","type":"Organization","site_admin":false},"repo":{"id":33642201,"name":"AltspaceSDK","full_name":"AltspaceVR/AltspaceSDK","owner":{"login":"AltspaceVR","id":7229981,"avatar_url":"https://avatars.githubusercontent.com/u/7229981?v=3","gravatar_id":"","url":"https://api.github.com/users/AltspaceVR","html_url":"https://github.com/AltspaceVR","followers_url":"https://api.github.com/users/AltspaceVR/followers","following_url":"https://api.github.com/users/AltspaceVR/following{/other_user}","gists_url":"https://api.github.com/users/AltspaceVR/gists{/gist_id}","starred_url":"https://api.github.com/users/AltspaceVR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltspaceVR/subscriptions","organizations_url":"https://api.github.com/users/AltspaceVR/orgs","repos_url":"https://api.github.com/users/AltspaceVR/repos","events_url":"https://api.github.com/users/AltspaceVR/events{/privacy}","received_events_url":"https://api.github.com/users/AltspaceVR/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AltspaceVR/AltspaceSDK","description":"","fork":false,"url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK","forks_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/forks","keys_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/teams","hooks_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/hooks","issue_events_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/issues/events{/number}","events_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/events","assignees_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/assignees{/user}","branches_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/branches{/branch}","tags_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/tags","blobs_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/statuses/{sha}","languages_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/languages","stargazers_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/stargazers","contributors_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/contributors","subscribers_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/subscribers","subscription_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/subscription","commits_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/contents/{+path}","compare_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/merges","archive_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/downloads","issues_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/issues{/number}","pulls_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls{/number}","milestones_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/milestones{/number}","notifications_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/labels{/name}","releases_url":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/releases{/id}","created_at":"2015-04-09T01:41:42Z","updated_at":"2015-11-09T05:43:17Z","pushed_at":"2015-11-10T02:06:06Z","git_url":"git://github.com/AltspaceVR/AltspaceSDK.git","ssh_url":"git@github.com:AltspaceVR/AltspaceSDK.git","clone_url":"https://github.com/AltspaceVR/AltspaceSDK.git","svn_url":"https://github.com/AltspaceVR/AltspaceSDK","homepage":null,"size":28264,"stargazers_count":21,"watchers_count":21,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/80"},"html":{"href":"https://github.com/AltspaceVR/AltspaceSDK/pull/80"},"issue":{"href":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/issues/80"},"comments":{"href":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/issues/80/comments"},"review_comments":{"href":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/80/comments"},"review_comment":{"href":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/pulls/80/commits"},"statuses":{"href":"https://api.github.com/repos/AltspaceVR/AltspaceSDK/statuses/09f75872398fb252b2b256cbedcd5e792688e780"}}}}