I've created some objects that have the following attributes:
a = acceleration
v = velocity
p = position
t = delta time
Right now, I am doing the following:
v += (a + gravity) * t;
p += v * t;
How do I incorporate wind? Lets say that I have a wind velocity = w. where would I put it in my equations?
I was thinking of doing this:
v += (a + gravity + w) * t;
but I don't think this is right, because wind is not an acceleration.... it is a velocity.
So then I was thinking maybe:
v += (a + gravity) * t + w;
but because t is not constant then w does not change the velocity in a nice fasion.
What is the correct way to handle wind speed?
Well, for starters, your equations are just the simple kinematic equations, so no rigid body involved here. So, a wind you could treat just like a force applied from some direction. It would be a bit more involved in rigid body sim, but you would simplify and treat wind as a resistance force or just a directional force. Simulating it like a fluid mechanics problem would be ... overkill In a car racing sim, you would model wind resistance, but treat it mostly uniform like a frictional force, and maybe a little more involvement, but you really don't need much more complex modelling like this for a game, it will be realistic enough to believe it. Last, to get a more 'windy' feel, you could randomly perturb the wind force amount at times, like from hard to mild, none to tornado blast, etc.... just modulate the amount of pressure force the wind is putting on the object.
Let me clarify by force, it would just become a velocity on the object, disregarding mass since it's a particle you wind up
x = x0 + (v+wind_vx)*t
y = y0 + (v+wind_vy)*t - 0.5*g*t*t
And wind is a velocity in some direction. I just ignore the mass of the particle so the force ends up being a linear accel which than becomes
a constant applied to velocity .... but, that is not very rigorous, but it *works* in a video game sim.