how to make the perfect jump using box2d

hi
i am new on game development and i am making a game in iphone in which i am using box2d to make the game real but i am also very weak in physic too so i am facing many problems. first thing how can i make the perfect jump in my game i am using the

Code: Select all

ApplyLinearImpulse


function in my game so it is good for me to use this function for jump if yes then i have problem that i want to make the user to make long jump if he press long or short jump if he press small how can i tackle that thing in my game. Also how can i check that if user reach it max height if i apply a linearimpulse on it i mean if i push the object how can i check that it reach to it end and now it's coming back ? any formula or builtin feature in box2d. sorry for too many question and poor english

regards

Faizan

Original thread: https://box2d.org/forum/viewtopic.php?t=9185