game physics

closed account (zwA4jE8b)
Hi guys, I am implementing physics into an SDL "game" and my goal is to use real world equations.

So far for i have

delta y (kinematic equation for y-axis position) dy=((Vy*T)+(1/2*a*T2)
 
y += ((y_vel * air_time) + (0.5f * tem_grav * (air_time * air_time)));


vector component breakdown for x and y velocity respectively.
the velocity parameter is total velocity (hypotenuse)
1
2
3
4
5
6
void Ball::setmovetrue(float angle, float velocity)
{
	x_vel = velocity * std::cos(angle);
	y_vel = velocity * std::sin(angle) * -1.0f;
	moving = true;
}


values for the defined variables are arbitrary.
I would like to eventually use values that are correlated some how.
air_time increments by 0.1f
tem_grav is 3.0f

Does anyone have any suggestions for values that are less arbitrary? A method to scale real world values?

Link to source code plus a .zip (exe with all needed files)
http://www.mediafire.com/?1rjltlz2413jj


EDIT: The current code and values work! I am not looking to change my equations, just use more meaningful values.
Last edited on
Topic archived. No new replies allowed.