My question is in a similar vein to this question, I am creating a pre-mapped pathfinding solution much akin to how Ash Blue was for my 2D platformer-style game (in XNA). As part of the process, I have to be able to 'neighbor' nodes in the pathfinding algorithm. To be able to do this, I need a procedural manner to precalculate the maximum capabilities of motion from a given game object at a given location. I am having a difficult time with one specific aspect of this: I cannot, for the life of me, figure out how to test whether or not a game object will be able to successfully jump to a given platform from where they are standing. I know there's a way to express this in some manner of equation, but I cannot find what the proper equation would be, it's probably in the vein of projectile physics, but the answer eludes me. If anybody can shed some insight into the matter, I would be very grateful.
Given a particle which starts at position
(0,0) and is fired at velocity
v_max the maximum range it can achieve is,
x_max = Sqrt(v_max^4 / g^2 - 2 * v_max^2 * y_fin / g)
g is the acceleration due to gravity (for earth
g ~ 9.81) and
y_fin is the final height of the particle (e.g. the height of the platform it needs to reach. This maximum range is achieved when the particle is fired at an angle,
theta = Atan( (1 - 2 * y_fin * g / v_max^2)^(-1/2) ) = Atan( Sqrt(1 / ((1 - 2 * y_fin * g / v_max^2)) ),
Atan is the inverse
If desired I can explain in more detail how to achieve this result (as after seeing the approach in the linked question I was able to solve it myself) it requires knowledge of differentiation and trigonometric identities but is not too difficult.