Add Camera::LookAt

This is identical to the POV-Ray look_at keyword for cameras. In fact, I stole the code almost directly from them… It's super handy for panning and tilting the camera towards a particular point, and saves me having to do dubiously accurate direction vector calculations by hand.

I still need to figure out what exactly this math is doing.
This commit is contained in:
Eryn Wells 2014-08-03 18:33:09 -07:00
parent e64b9403ac
commit 7297bc5c17
4 changed files with 52 additions and 0 deletions

View file

@ -35,6 +35,8 @@ struct Camera
const Vector3& GetUp() const;
void SetUp(const Vector3& up);
void LookAt(const Vector3& pt);
virtual Ray compute_primary_ray(const int x, const int width,
const int y, const int height) const = 0;