{"id":1180,"date":"2014-12-21T01:47:21","date_gmt":"2014-12-21T01:47:21","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=1180"},"modified":"2014-12-21T01:47:36","modified_gmt":"2014-12-21T01:47:36","slug":"p-152-virtual-world-concept-update-25-spherical-terrain-polysoup-collision","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-152-virtual-world-concept-update-25-spherical-terrain-polysoup-collision\/","title":{"rendered":"P-152: Virtual World Concept Update 25: Spherical Terrain: Polysoup Collision"},"content":{"rendered":"<p>I have finally made some progress with the collision system, after having been stuck for some time. I have managed to get a collision mesh created, and item collision working, but player collision is still not working. I am very close to figuring this out.<\/p>\n<p>I tried various different ideas to get collision working, from modifying the existing terrain collision system, to copying the polysoup\/OPCODE solution from the tsstatic class, and anything and everything in between.<\/p>\n<p>Eventually, I realised that I needed a collision class that handled just a raw triangle, ie, three points. The existing collision types were for handling more complex shapes, such as meshes, terrains, or boxes.<\/p>\n<p>I eventually found some code to allow me to implement such as system on a T3D archive site\u00a0<a href=\"http:\/\/abighole.hngamers.com\/1Woqu\">HERE<\/a>. This is actually a resource to implement a road object in T3D, but it contains a class called &#8220;TriangleConvex&#8221; which is a collision type designed to take only a triangle object. I was able to easily implement and apply this to my terrain.<\/p>\n<p>Now, I just need to fix player collision, and then implement optimisation. As can be seen from the images below, I have significantly reduced the complexity of the terrain, since every vertex is now being added to the collision list. I need to only add the vertices close to the player to the collision object, and update these vertices as the player moves. This will allow for high resolution terrain which also runs fast.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment05-Dec.-20-22.28.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1186\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment05-Dec.-20-22.28-300x232.jpg\" alt=\"PhoenixGameDevelopment05 Dec. 20 22.28\" width=\"300\" height=\"232\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment05-Dec.-20-22.28-300x232.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment05-Dec.-20-22.28-1024x793.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment05-Dec.-20-22.28.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment06-Dec.-20-22.28.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1185\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment06-Dec.-20-22.28-300x232.jpg\" alt=\"PhoenixGameDevelopment06 Dec. 20 22.28\" width=\"300\" height=\"232\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment06-Dec.-20-22.28-300x232.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment06-Dec.-20-22.28-1024x793.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment06-Dec.-20-22.28.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment01-Dec.-20-22.28.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1184\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment01-Dec.-20-22.28-300x232.jpg\" alt=\"PhoenixGameDevelopment01 Dec. 20 22.28\" width=\"300\" height=\"232\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment01-Dec.-20-22.28-300x232.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment01-Dec.-20-22.28-1024x793.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment01-Dec.-20-22.28.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment04-Dec.-20-22.28.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1181\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment04-Dec.-20-22.28-300x232.jpg\" alt=\"PhoenixGameDevelopment04 Dec. 20 22.28\" width=\"300\" height=\"232\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment04-Dec.-20-22.28-300x232.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment04-Dec.-20-22.28-1024x793.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment04-Dec.-20-22.28.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment03-Dec.-20-22.28.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1182\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment03-Dec.-20-22.28-300x232.jpg\" alt=\"PhoenixGameDevelopment03 Dec. 20 22.28\" width=\"300\" height=\"232\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment03-Dec.-20-22.28-300x232.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment03-Dec.-20-22.28-1024x793.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment03-Dec.-20-22.28.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment02-Dec.-20-22.28.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-1183\" src=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment02-Dec.-20-22.28-300x232.jpg\" alt=\"PhoenixGameDevelopment02 Dec. 20 22.28\" width=\"300\" height=\"232\" srcset=\"https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment02-Dec.-20-22.28-300x232.jpg 300w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment02-Dec.-20-22.28-1024x793.jpg 1024w, https:\/\/phoenixgamedevelopment.com\/blog\/wp-content\/uploads\/2014\/12\/PhoenixGameDevelopment02-Dec.-20-22.28.jpg 1040w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have finally made some progress with the collision system, after having been stuck for some time. I have managed to get a collision mesh created, and item collision working, but player collision is still not working. I am very close to figuring this out. I tried various different ideas to get collision working, from [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,10],"tags":[],"class_list":["post-1180","post","type-post","status-publish","format-standard","hentry","category-astral-realms","category-software-and-games","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"aioseo_notices":[],"builder_content":"","_links":{"self":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1180"}],"collection":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/comments?post=1180"}],"version-history":[{"count":2,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1180\/revisions"}],"predecessor-version":[{"id":1188,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/1180\/revisions\/1188"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=1180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=1180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=1180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}