Alright, so!
I’m experimenting with a camera control system that’s set up somewhat like Metroid Prime on the Wii, where the closer the cursor is to the edge of the screen (without going past a bounding box), the camera rotates.
So, here’s what I’m trying to do:
I have a Rect representing the bounding box, which is computed from a single float telling how much of the screen it covers.
After the mouse leaves the Rect, I want to find out the coordinates where a ray going from the center of the screen to the mouse would intersect on both the bounding box and the edge of the screen.
Those three coordinates would then be Math’d to figure out the distance from the bounding box and center of the screen (all at once), and then the result would be applied to the camera to rotate. I don’t really need help on this, just putting it here for completions sake.
For the life of me, I cannot figure out how to do this, and would really appreciate the help.
ed: I should also point out, this is an FPS, not a 2D game.
I mistyped and didn’t notice, earlier.