PDA

View Full Version : Anyone familiar with orbital mechanics?



Zeph
July 27th, 2013, 08:41 AM
I'm starting to work out some of the shortcomings CryEngine3 has with physics for my game.
I'm not doing anything super precise, since I have to keep my level geometry relatively static for gameplay. All my math is pretty simple and resembles the physics I took way back in high school.

By default in CE3, gravity is a Vec3 that stays constant representing direction/amount something should accelerate per second. It's handled per entity, so each thing has its own gravity vector it pays attention to.

I have a class of entity I'm calling Planetoid. This Planetoid class is going to provide a point and desired gravity amount to other entities I deem under its influence. Since this kind of gravity was never intended for CE3, I'm having to build everything I want physically simulated off a new class that can accommodate this Planetoid (and other kinds of gravity manipulating classes) per frame.
Short term, I'm done with it since it does what I need.

Except, I had an idea I wanted to try after seeing something enter an orbit (lol).
I know that there's a whole host of equations out there for two-body equations where both mass and distance play a huge factor in the results.
Since my gameplay pretty much ignores mass/volume for level geometry and has arbitrarily decided numbers on all other properties, is there anything I can use to determine if something will enter an orbit, what kind of orbit it will be, and an equation describing that orbit based on positions, tangential velocity, and the desired gravity I've set?
To me, it screams conic sections but I don't ever recall seeing the sections described in three-dimensional space, nonetheless vectors for velocity and acceleration.