Jump to content
  • Advertisement
Sign in to follow this  
Aph3x

Gravity from Jupiter!!?

This topic is 4883 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK here's a strange one for non-SI-unit people out there ;) My world has 1 unit = 1 foot. I've been using a value for gravity that 'felt right', which was 0.00014. All ok - aircraft seems to handle fine. Then I realise I should be using a value of 0.032152 ft/ms to simulate real-world gravity. Result: aircraft falls out of the sky at seemingly ridiculous speeds (falls 200 ft in just over 100ms). But measuring the falling speed after 100ms gives 0.98m/s, which I believe is correct. There really isn't that much going into the calculations for gravity, basically:
TVector3 accel(mLinearForceSum / TotalMass());
accel.y -= CONSTANTS().KGravitySpeed; // Apply gravity.
mVelocity += accel * aFrameTimeMs;

mPosn.Add(mVelocity * aFrameTimeMs);

mLinearForceSum.Zero();

Am I missing something out here?! I've modelled air resistance as per real-world values (rho=0.002378 slugs/cubic ft) And same goes for my projectiles. Do I need to go to the lengths of simulating the Reynolds effect to keep em up in the air?!

Share this post


Link to post
Share on other sites
Advertisement
What you are looking for is 9.8 m/s.

Now movement due to gravity does change depending on your distance from the center of the earth (though unless you are modeling spaceships you can ignore that). At sea level objects experience an acceleration of 9.8 m/s. So an object failing for 1 second will have a speed of 9.8 m/s, after 2 seconds it will have a speed of 20.4 m/s, and so on. Now another important factor here is friction. Unless you are in a vacumm you typically have two types of friction. The first, surface friction, is constant. The second is fluid friction (which also applies when moving through a gas, like air). Fluid friction varies with speed. The faster you are trying to move an object through a fluid/gas, the harder it is to get that fluid out of the way in time. This results in an important concept for falling - terminal velocity. As you accelerate when falling the fluid friction will increase. Eventually fluid friction will equal the acceleration due to gravity and you will begin to fall at a constant speed (no more acceleration unless your change you shape/makeup, or the fluid changes [i.e. air temperate/density changes])

Share this post


Link to post
Share on other sites
0.032152 ft/ms...

accelerations are in units distance per units time squared. not important? yes it is.

why are you using ms? just dont do that to yourself. stick to whole units (SI ones if you know whats good for you).

your value should be 1000 times smaller, because it should have units of ft/ms^2, not ft/ms. but as i said simply dont do that to yourself and stick with whole units.

9.81m/s^2 is your friend. or 0.000032152 ft/ms^2 if you insist.

Share this post


Link to post
Share on other sites
Michalson: ta, I have drag in there at the moment, prop to squared speed. My aircraft only go to 1000ft, so I'm ignoring temperature & gravity attenuation :)

Ah eelco, that makes sense... (although that's ~1/4 of what I estimated felt 'right'!)
I figured if I used SI units I'd have to convert my vectors to feet every update, so may as well pre-calc the constants for feet instead.
Also, my update time delta is in ms, so I thought I'd precalc that in too. Wrongly, as it happens ;)

Share this post


Link to post
Share on other sites
Hmm... in the same vein, is the air density I have correct?

Air density: 1.2 kg/m^3 == 0.002378 slugs/ft^3

Share this post


Link to post
Share on other sites
Quote:
Original post by Aph3x
Air density: 1.2 kg/m^3 == 0.002378 slugs/ft^3


what the HELL is a slug? no wonder you are confused..

SI units > *

Share this post


Link to post
Share on other sites
Quote:
Original post by Eelco
Quote:
Original post by Aph3x
Air density: 1.2 kg/m^3 == 0.002378 slugs/ft^3


what the HELL is a slug? no wonder you are confused..

SI units > *


Oi you can't use wildcard units!! ;)
LOL, I thought it was a typo when I first encountered slugs in physics.
Yes, well, maybe I'll switch to SI units thinking about it...

Ah, bit64's conversion fits the figures :)

Share this post


Link to post
Share on other sites
Even if you are not using SI units, it is best to avoid slugs as they are rather antiquated. You are better off with using lbm, which at standard 32.2ft/s^2 gravity is equivalent to 1 lbf. If g is not equal to the gravitational constant (Gc, usually) then you need to convert. The units will work out so you'll know what to multiply/divide if you work the problem through.
This has the effect that lbf is basically an "english newton" and lbm is an "english kilogram". You will be able to find viscosity, density, etc figures using lbm easily.

There isnt anything wrong with the english system per-se. Consider yourself a well-rounded person if you know all its whacky details = o

As for your plane falling out of the sky, that could be alot of things. First things first, is that it's probably best to stick with s as your time unit over ms.

Make sure your distances are drawn to scale. If your plane is undersized it will appear to have fallen a larger distance than it really did.

Check the system without lift, drag, etc. Suspend your plane at 1000ft. Make sure the time to reach the ground and its impact velocity jive well with the standard physics equations. If they do, then your problem is somewhere in your lift/drag calculations; fluid dynamics are rather complex.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!