Jump to content

  • Log In with Google      Sign In   
  • Create Account

14 years ago on June 15th Gamedev.net was first launched! We want to thank all of you for being part of our community and hope the best years are ahead of us. Happy birthday Gamedev.net!

#ActualBacterius

Posted 09 May 2012 - 07:36 AM

I'd expect a constant acceleration to still pull the object towards the well...

It's not constant. Basically the pull becomes stronger and stronger as you get closer to the well, and follows a inverse-squared relationship with distance. It's why it's called a well, you fall faster and faster in it (a black hole is your ideal well, with perfectly* vertical sides, from which is it impossible to escape, "normal" wells are more akin to the three-dimensional analogue of a funnel).

* this is not quite true, in fact the sides just need to be "vertical" enough to make the escape velocity of the gravitational field higher than the speed of light .

And anyway, acceleration depends on mass, from . If two objects of different masses are subjected to an identical force, they will accelerate at different rates. Imagine you kicking the ground. You apply a force on the Earth, and the Earth exerts a force on you (Newton's third law). Then the acceleration on you is which is fairly small (considering your kick delivered at best 25N, and you probably weigh at least 50kg) (this is absorbed by your body which explains why kicking the ground hurts your leg instead of pushing you upwards) On the other hand, the acceleration on the Earth is which is, for all practical purposes, zero. If you didn't apply and directly used force as acceleration, the Earth would be flung backwards a significant distance every time you kicked it, which clearly doesn't happen.

I didn't update the velocity because dY = Vy0*t = .5*a*t^2 doesn't call for it. I'll try out your method of simply updating the velocity based on the acceleration instead of getting dY and see how that works out.

From the above, kinematics are inapplicable because the acceleration isn't constant. In fact in your first post's code the acceleration isn't constant anyway because of the gravDir unit vector (so kinematics can't be applied there anyway). You will want to keep track of position and velocity and repeatedly apply forces on the object every physics step.

#1Bacterius

Posted 09 May 2012 - 07:34 AM

I'd expect a constant acceleration to still pull the object towards the well...

It's not constant. Basically the pull becomes stronger and stronger as you get closer to the well, and follows a inverse-squared relationship with distance. It's why it's called a well, you fall faster and faster in it (a black hole is your ideal well, with perfectly vertical sides, from which is it impossible to escape, "normal" wells are more akin to the three-dimensional analogue of a funnel).

And anyway, acceleration depends on mass, from . If two objects of different masses are subjected to an identical force, they will accelerate at different rates. Imagine you kicking the ground. You apply a force on the Earth, and the Earth exerts a force on you (Newton's third law). Then the acceleration on you is which is fairly small (considering your kick delivered at best 25N, and you probably weigh at least 50kg) (this is absorbed by your body which explains why kicking the ground hurts your leg instead of pushing you upwards) On the other hand, the acceleration on the Earth is which is, for all practical purposes, zero. If you didn't apply and directly used force as acceleration, the Earth would be flung backwards a significant distance every time you kicked it, which clearly doesn't happen.

I didn't update the velocity because dY = Vy0*t = .5*a*t^2 doesn't call for it. I'll try out your method of simply updating the velocity based on the acceleration instead of getting dY and see how that works out.

From the above, kinematics are inapplicable because the acceleration isn't constant. In fact in your first post's code the acceleration isn't constant anyway because of the gravDir unit vector (so kinematics can't be applied there anyway). You will want to keep track of position and velocity and repeatedly apply forces on the object every physics step.

PARTNERS