Original Post
I looked in my physics book, and online. The function I found is:
Drag = Coefficient * Area * AirDensity * pow(Velocity, 2) * 0.5;
All well and good. Coefficient would take a LOT of processing power to work out at real time, so I''m currently querying the object for it, and the object will use one of the presets or a custom (currently using 1.28, the coefficient for a flat plate).
AirDensity is queried from atmosphere objects, so it''s arbitrary. Right now it''s using 1.0, which probably doesn''t exist but oh well.
Area is difficult to calculate as well, I have a thread on that in the general programming forum (it''s dropped to the second page though...). I''m currently calculating the area of a box.
Now when I calculate the drag, the drag comes out to 111.0 u/s², when the object''s velocity is 0.1 u/s. As far as I can tell the problem is in the area, because the object is 128x68 u. When I looked through the equation, I realized I didn''t know the units for the coefficient, but after calculating the rest of the equation I come out with a units of gu/s² (g being grams). Does the coefficient have a units of 1/g? And how do I fix my backwards flying object? As far as I can tell, as soon as I press forward the object shoots off to the maximum bounds of the universe and crashes the game (read: the float overflowed)