Hello,
I have an object, when I click a button, the game applies impulse force J to it.
I want to predict how it will move (assuming no obstacles, and 0 friction) over time. Ideally a formula like this:
x(t) = ...
y(t) = ...
Currently I found an iterative approach:
(dtt=0.1, vx0=400, vy0==-500)
The problem is calculating ay (acceleration in y direction). I couldn't find a formula for it, but I used a hack by calculating the ay of the Ball object (which is moved by the engine), then plugging that value in ay (the value was 500), the method worked, and the created Mark objects resembled the true trajectory of Ball.
Notice that I set vx0 and vy0 manually instead of using forces and impulses; because I couldn't figure out how the forces work, so I simply applied the ipmulse to the Ball then got those values from the debugger and used them as vx0,vy0!
The questions are:
1- Is there a better way?
2- How to calculate ay given the initial velocities vx,vy? (i.e. before the ball moves)
3- Any idea how the x(t) and y(t) equations will look like?
4- Is it possible to use the impulse J, calculate the resultant force F, then calculate vx,vy of that force?
Thank you!