{"id":268,"date":"2018-06-07T22:59:41","date_gmt":"2018-06-08T03:59:41","guid":{"rendered":"http:\/\/www.chroniclesoftright.com\/blog\/?p=268"},"modified":"2018-06-07T22:59:41","modified_gmt":"2018-06-08T03:59:41","slug":"collide-and-slide","status":"publish","type":"post","link":"https:\/\/www.chroniclesoftright.com\/blog\/2018\/06\/07\/collide-and-slide\/","title":{"rendered":"Collide and Slide!"},"content":{"rendered":"<p>I haven&#8217;t done a ton of testing with it yet but it looks like I have successfully implemented collision response a la Fauerby&#8217;s paper.\u00a0 I&#8217;ve only tried against a simple box but it is absolutely beautiful to watch a sphere collide with the box near the edge and just slide over until it&#8217;s past the edge then continue on its merry way.\u00a0 The code listings from the paper are, in my opinion, an absolute mess.\u00a0 I just don&#8217;t like code that follows this structure:<\/p>\n<p>var object;<\/p>\n<p>function doSomething(object) {<\/p>\n<p>object.prop = &#8220;value&#8221;;<\/p>\n<p>object.otherProp = &#8220;otherValue&#8221;;<\/p>\n<p>}<\/p>\n<p>doSomething(object);<\/p>\n<p>if (object.prop == &#8220;value&#8221;) {<\/p>\n<p>\/\/ whatever<\/p>\n<p>}<\/p>\n<p>I don&#8217;t like it when a function changes the properties of an object passed into it as a parameter, and Fauerby&#8217;s code does a\u00a0<em>bunch<\/em> of that.\u00a0 Maybe that&#8217;s a very common practice for some programmers but it drives me crazy because it becomes very difficult to follow the values of an object&#8217;s properties.\u00a0 So I&#8217;ll be rewriting all that code but regardless of all that it seems to be working!\u00a0 So exciting.\u00a0 Once I&#8217;ve refactored this code I&#8217;ll integrate it into the rest of Lyridia&#8217;s code, then test some in the world and as long as everything looks good I&#8217;ll definitely release a new version at that point.\u00a0 So stay tuned.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I haven&#8217;t done a ton of testing with it yet but it looks like I have successfully implemented collision response a la Fauerby&#8217;s paper.\u00a0 I&#8217;ve only tried against a simple box but it is absolutely beautiful to watch a sphere collide with the box near the edge and just slide over until it&#8217;s past the&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-268","post","type-post","status-publish","format-standard","hentry","category-planning-and-development"],"_links":{"self":[{"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/posts\/268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/comments?post=268"}],"version-history":[{"count":1,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/posts\/268\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/posts\/268\/revisions\/269"}],"wp:attachment":[{"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/media?parent=268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/categories?post=268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/tags?post=268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}