{"id":3281,"date":"2016-07-24T03:07:18","date_gmt":"2016-07-24T02:07:18","guid":{"rendered":"http:\/\/phoenixgamedevelopment.com\/blog\/?p=3281"},"modified":"2016-07-24T03:07:18","modified_gmt":"2016-07-24T02:07:18","slug":"p-152-virtual-world-concept-update-139-planet-sized-terrain-part-18-gravity","status":"publish","type":"post","link":"https:\/\/phoenixgamedevelopment.com\/blog\/p-152-virtual-world-concept-update-139-planet-sized-terrain-part-18-gravity\/","title":{"rendered":"P-152: Virtual World Concept Update 139: Planet-sized Terrain: Part 18: Gravity"},"content":{"rendered":"<p>I have finished updating and fixing the 3D gravity for this project, which is another of the primary objectives for MS2.<\/p>\n<p>The actual Gravity code itself is quite simple, I just need to replace the existing code which applies the force of gravity only on the negative z-axis, with code that works on all axes (ie, spherical). The only real change that I had to make was to make the gravity relative to the center the planet. In MS1, the gravity was relative to the origin (in local space).<\/p>\n<p>I also came across an additional problem. Even though the player is being pulled toward the correct point, there are issues with aligning them to the terrain. What I want is for the players feet (I am assuming the control object is always a humanoid player) to be flat on the terrain, no matter what the players position it. It turns out that this is very difficult, and may involve some extensive changes to the player class.<\/p>\n<p>There may also be some issues with gimbal lock to deal with. I have chosen to postpone this for the time being. Currently, I am testing the project with the player standing on top of the terrain, with gravity acting on the negative Z axis, to avoid these issues,\u00a0but they\u00a0will need to be fixed\u00a0at some point in MS2, since they are critical bugs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have finished updating and fixing the 3D gravity for this project, which is another of the primary objectives for MS2. The actual Gravity code itself is quite simple, I just need to replace the existing code which applies the force of gravity only on the negative z-axis, with code that works on all axes [&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,17,10,11],"tags":[],"class_list":["post-3281","post","type-post","status-publish","format-standard","hentry","category-astral-realms","category-p-0","category-software-and-games","category-spiritus-astrum","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\/3281"}],"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=3281"}],"version-history":[{"count":2,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/3281\/revisions"}],"predecessor-version":[{"id":3283,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/posts\/3281\/revisions\/3283"}],"wp:attachment":[{"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/media?parent=3281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/categories?post=3281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phoenixgamedevelopment.com\/blog\/wp-json\/wp\/v2\/tags?post=3281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}