PGD Home

P0-A1: Part 376: Orbital Mechanics

by on May.20, 2018, under Astral Realms, P-0, Software and Games, Spiritus Astrum

I have started working on a very complex feature for this project.

I had been postponing this for a while, because I suspect it will be difficult, but I want to try to add in realistic orbital mechanics for all objects in the simulation.

Currently, there is limited orbital mechanics (just a proof of concept) for certain stellar objects like black holes, etc, and there is gravity acting on players and AI characters to keep them fixed to the ground regardless of the rotation of the ship that they are on.

However, after some experimentation of my own, I have purchased an asset from the asset store which should allow me to create a very realistic physics simulation of not only planetary and satellite orbits, but I should also be able to calculate orbit transfers and rendezvous of space craft, as well as elliptical and eccentric orbits.

So far, the asset is working well, but integrating it into my existing codebase will be difficult. Most of the code should be ok, but the main issue is the floating origin system. With the above asset that I purchased, the transform of the objects in the physics engine are fixed, and can only be changed by the physics simulation itself. However, my project uses a floating origin system which changes the transform of every object based on the players movement, this is causing issues.

I am also concerned about the realistic scale of my planets and solar systems, although this seems to be catered for by the gravity engine asset. The below plots show an object orbiting a planet at of realistic size, at a realistic distance. Each point is a different angle in its rotation, and it seems, based on this, that the orbit is correct.

wgnuplot 19/05/2018 , 08:28:10 PM Gnuplot (window id : 0)

wgnuplot
19/05/2018 , 08:28:10 PM
Gnuplot (window id : 0)

wgnuplot 19/05/2018 , 08:56:47 PM Gnuplot (window id : 0)

wgnuplot
19/05/2018 , 08:56:47 PM
Gnuplot (window id : 0)

Unity 19/05/2018 , 08:20:50 PM Unity 2018.1.0f2 Personal (64bit) - P0Main44.unity - P0-A1 - PC, Mac & Linux Standalone*

Unity
19/05/2018 , 08:20:50 PM
Unity 2018.1.0f2 Personal (64bit) – P0Main44.unity – P0-A1 – PC, Mac & Linux Standalone*

Facebooktwitterredditpinterestlinkedinmail

Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!