Created
April 30, 2012 14:33
Revisions
-
jonathanKingston revised this gist
Apr 30, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ Meteor.setInterval(function() { var allTheThings = Things.find({}); //Near will contain all the object _id's and this will be an array of all other objects nearby. near = {} allTheThings.forEach(function (thing) { if (thing != undefined) { -
jonathanKingston revised this gist
Apr 30, 2012 . 1 changed file with 14 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,17 @@ Meteor.setInterval(function() { var allTheThings = Things.find({}); near = {} allTheThings.forEach(function (thing) { if (thing != undefined) { near[thing._id] = []; allTheThings.forEach(function (thing2) { if(thing2.x >= thing.x-5 && thing2.x <= thing.x+5) { if(thing2.y >= thing.y-5 && thing2.y <= thing.y+5) { near[thing._id].push thing2; } } }); } } },5000); -
jonathanKingston revised this gist
Apr 30, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,8 +7,8 @@ near = {} if (thing != undefined) { near[thing._id] = []; allTheThings.forEach(function (thing2) { if(thing2.x >= thing.x-5 && thing2.x <= thing.x+5) { if(thing2.y >= thing.y-5 && thing2.y <= thing.y+5) { near[thing._id].push thing2; } } -
jonathanKingston created this gist
Apr 30, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ Meteor.setInterval(function() { var allTheThings = Things.find({}); near = {} allTheThings.forEach(function (thing) { if (thing != undefined) { near[thing._id] = []; allTheThings.forEach(function (thing2) { if(thing2.x >+ thing.x-5 && thing2.x <+ thing.x+5) { if(thing2.x >+ thing.x-5 && thing2.x <+ thing.x+5) { near[thing._id].push thing2; } } }); } } },5000);