branch | pyrit |
changeset 49 | 558fde7da82a |
parent 47 | 320d5d466864 |
child 50 | 14a727b70d07 |
48:a4913301c626 | 49:558fde7da82a |
---|---|
61 */ |
61 */ |
62 class Camera |
62 class Camera |
63 { |
63 { |
64 public: |
64 public: |
65 Vector3 eye, p, u, v; |
65 Vector3 eye, p, u, v; |
66 Float f; |
66 Float f,F; |
67 |
67 |
68 Camera(): eye(0,0,10), p(0,0,-1), u(-1,0,0), v(0,1,0), f(3.14/4.0) {}; |
68 Camera(): eye(0,0,10), p(0,0,-1), u(-1,0,0), v(0,1,0), f(3.14/4.0), F(0.5/f) {}; |
69 Camera(const Vector3 &C, const Vector3 &ap, const Vector3 &au, const Vector3 &av): |
69 Camera(const Vector3 &C, const Vector3 &ap, const Vector3 &au, const Vector3 &av): |
70 eye(C), p(ap), u(au), v(av), f(3.14/4.0) {}; |
70 eye(C), p(ap), u(au), v(av), f(3.14/4.0), F(0.5/f) {}; |
71 void setEye(const Vector3 &aeye) { eye = aeye; }; |
71 void setEye(const Vector3 &aeye) { eye = aeye; }; |
72 void setFocalLength(const Float af) { f = af; }; |
72 void setFocalLength(const Float af) { f = af; F = 0.5/f; }; |
73 void rotate(const Quaternion &q); |
73 void rotate(const Quaternion &q); |
74 void move(const Float fw, const Float left, const Float up); |
74 void move(const Float fw, const Float left, const Float up); |
75 |
75 |
76 Ray makeRay(Sample *samp); |
76 Ray makeRay(Sample *samp); |
77 }; |
77 }; |