Advertisement

Question about Projectile Motion

Started by July 30, 2015 08:57 PM
9 comments, last by Brum87 9 years, 1 month ago


How did you end up with this quadratic equation for theta? How doesn't it involve any trigonometric function?

Hi sorry for the delay.

It's the same quadratic that you have in your original equation. Sorry I may have been confusing with my previous answer. You still have to use atan to get Theta but you can tell a lot about the answer using the quadratic part. I found that understanding how the solution resolves lets you deal with the failure conditions in a cleaner way.

For example I wrote a version of this function which wouldn't fail if the solution was further than my max range, so in that case it would return theta for the max range. For this specific case it made sense because the AI part of the problem had already decided to fire the gun but the character trying to actually perform the action of "firing a gun" couldn't reach.. but up until that moment he thought he could...

This topic is closed to new replies.

Advertisement