Game Development Reference
In-Depth Information
How it works...
Another way of handling it would be not to move the camera during the input but the actual
point it looks at, and have the camera troll along. No matter which way you choose to do it
though, practicing and thus getting a better understanding of these trigonometric problems
is always a good idea.
Since we're using linear interpolation here, camLocation2D will never actually reach
targetLocation ; it'll just get infinitely closer. This is why an if statement can be use-
ful in these cases to see whether it's worth actually changing the distance or not. Finding
the right threshold to break off is empiric and varies from case to case.
Search WWH ::




Custom Search