Jump to content
  • Advertisement
Sign in to follow this  

gradual acceleration and deacceleration

This topic is 3183 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

Hello everyone i am currently working on a 2d project... my object falls from a particular height then the speed gradually accelerates then on key press the parachute opens and the object starts to de-accelerate upto a point and then keep falling again with a continuos speed... i have been able to achieve the acceleration and deacceleration with my function which returns me the distance int CalculateSpeed (float speed, float time ) { time += 0.1; dist = dist + (speed * time); return dist; } the problem i am facing is that after deaccelerating to a point i am not able to get the object falling with a continous speed.... please can anyone suggest some solution or a better/different way of doing it... any advice would be of great help... Thanks Anup Gupta

Share this post

Link to post
Share on other sites
Perhaps you can set the speed something like:

if( parachute_open && speed <= parachute_open_speed && not_on_ground )
speed = parachute_open_speed

Share this post

Link to post
Share on other sites
Here's something somewhere in-between real C/C++ code and pseudocode:

struct particleState
vector2d pos;
vector2d vel;


particleState nextState(particleState x, bool parachuteOpen, double dt)
// Given the current state x, the timestep dt, and whether the parachute
// is open, returns the next state.
particleState x2; // This will store our return value

double a;
a = mu*square(x.vel) - g; // g,mu constants
a = -g;

// Take a symplectic Euler step
x2.vel = x.vel + Vector2d(0, a*dt);
x2.pos = x.pos + x2.vel*dt;

return x2;

To find terminal velocity with parachute open, solve

a = mu*square(x.vel) - g = 0

for x.vel. You get that the terminal velocity will be sqrt(g/mu). So pick mu accordingly.

[Edited by - Emergent on February 25, 2010 12:43:14 PM]

Share this post

Link to post
Share on other sites
hello Emergent

I just want to say thank you a million times...

I just got the parachute acceleration , deacceleration and continuous falling after deacceleration in perfect sync..just as i wanted...

thanks for your pseudocode it worked like a charm...


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!