{"id":266,"date":"2018-06-06T23:09:44","date_gmt":"2018-06-07T04:09:44","guid":{"rendered":"http:\/\/www.chroniclesoftright.com\/blog\/?p=266"},"modified":"2018-06-06T23:09:44","modified_gmt":"2018-06-07T04:09:44","slug":"collisions-update-again","status":"publish","type":"post","link":"https:\/\/www.chroniclesoftright.com\/blog\/2018\/06\/06\/collisions-update-again\/","title":{"rendered":"Collisions update, again"},"content":{"rendered":"<p>The collision detection system is still moving along.\u00a0 I can now test a sphere against an arbitrary triangle and if there is a collision the sphere simply stops.\u00a0 This works whether the sphere hits the face, vertices, or edges of the triangle.\u00a0 I also made a simple test case with the sphere moving against a SphereGeometry mesh in THREE.js.\u00a0 This just basically involved looping through all of the faces of the sphere to test for collisions.\u00a0 That simple test seems to be working but I&#8217;m reserving judgment until I have done much more testing.\u00a0 Specifically it would be really nice if I could load an object modeled in Blender with a custom, hidden collision cage and see if that works.\u00a0 That&#8217;s the ultimate goal since I don&#8217;t want the collision system to test against the relatively complicated geometry of the objects visible in the world, but rather against a set of hidden, simpler geometries custom made for each object.\u00a0 I think this should be fairly straightforward to pull off.<\/p>\n<p>The next step, after I&#8217;ve tested with some other objects, is to implement collision response.\u00a0 Right now if the sphere hits an object it just stops.\u00a0 For a game, when the sphere hits an object it needs to slide along the surface of that object.\u00a0 The paper I&#8217;m following includes a collision response code listing, so hopefully converting it over to Javascript will be pretty easy as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The collision detection system is still moving along.\u00a0 I can now test a sphere against an arbitrary triangle and if there is a collision the sphere simply stops.\u00a0 This works whether the sphere hits the face, vertices, or edges of the triangle.\u00a0 I also made a simple test case with the sphere moving against a&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-266","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\/266","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=266"}],"version-history":[{"count":1,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/posts\/266\/revisions"}],"predecessor-version":[{"id":267,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/posts\/266\/revisions\/267"}],"wp:attachment":[{"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/media?parent=266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/categories?post=266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/tags?post=266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}