I have two platforms and one ball. The ball should fly from the red platform to the blue platform. The ball should land somewhere in the purple rectangle of the blue platform.
How can I know how fast the linear velocity of the ball should be to accomplish the jump of the ball? Is there a mathematical formula to calculate the linear velocity(x,y) which should be added to the ball so that the ball can jump to the blue platform?
The ball should always land in the purple area.
Distance(width) from the ball to the target: 212 pixel
Distance(height) from the ball to the target: 52 pixel
The distances were measured from the center of the ball to the center of the purple rectangle.
The gravitation of my world is world(0,3).
Upadte I use the following formula for the impulse:
impulse = Vector2(distance.x / time * mass + gravity.x / 2 * time * mass, distance.y / time * mass + gravity.y / 2 * time * mass);
mass: mass of the ball
It's working with this formula, but only if the value of the time is not too low. time = 2.0f(or higher) is working but if I use time = 1.0f, then the ball is touching the left side of the blue platform.
Why is the formula not working with low time values? I don't understand that.