{"id":850,"date":"2013-01-29T17:15:14","date_gmt":"2013-01-29T17:15:14","guid":{"rendered":"https:\/\/allonestring.co.uk\/wp2\/?p=850"},"modified":"2016-05-16T16:13:03","modified_gmt":"2016-05-16T16:13:03","slug":"coding","status":"publish","type":"post","link":"https:\/\/allonestring.co.uk\/wp\/coding\/","title":{"rendered":"coding"},"content":{"rendered":"<p>Spurred by a query on the Processing forum, I&#8217;ve had a go at grid-based collision. Instead of checking every ball against all of the others to see if there&#8217;s a collision, you just look to see if there&#8217;s a ball in the same or neighbouring grid cell.<br \/>\nMove the mouse over the grid to see which cells are checking which neighbouring cells.<br \/>\n<applet code=\"gridCollision04\" width = \"400\" height=\"400\" archive=\"http:\/\/allonestring.co.uk\/images\/jar\/gridCollision04.jar\"><br \/>\n<\/applet><br \/>\nIt doesn&#8217;t yet deal with mass, nor does it cope well when the balls start out as overlapping. Refresh the page if the balls go mental!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[63],"tags":[],"class_list":["post-850","post","type-post","status-publish","format-standard","hentry","category-code"],"_links":{"self":[{"href":"https:\/\/allonestring.co.uk\/wp\/wp-json\/wp\/v2\/posts\/850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/allonestring.co.uk\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/allonestring.co.uk\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/allonestring.co.uk\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/allonestring.co.uk\/wp\/wp-json\/wp\/v2\/comments?post=850"}],"version-history":[{"count":10,"href":"https:\/\/allonestring.co.uk\/wp\/wp-json\/wp\/v2\/posts\/850\/revisions"}],"predecessor-version":[{"id":4870,"href":"https:\/\/allonestring.co.uk\/wp\/wp-json\/wp\/v2\/posts\/850\/revisions\/4870"}],"wp:attachment":[{"href":"https:\/\/allonestring.co.uk\/wp\/wp-json\/wp\/v2\/media?parent=850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/allonestring.co.uk\/wp\/wp-json\/wp\/v2\/categories?post=850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/allonestring.co.uk\/wp\/wp-json\/wp\/v2\/tags?post=850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}