rayzor
view src/camera.cc @ 12:d94a69933a71
lots of stuff, can't remember
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 12 Apr 2014 23:28:24 +0300 |
parents | a826bf0fb169 |
children | 964f8ea5f095 |
line source
1 #include "camera.h"
3 Camera::Camera()
4 {
5 type = NODE_CAMERA;
6 fov = M_PI;
7 set_position(Vector3(0, 0, 10));
8 }
10 void Camera::set_target(const Vector3 &target)
11 {
12 this->target->set_position(target);
13 }
15 const Vector3 &Camera::get_target() const
16 {
17 return target->get_position();
18 }
20 void Camera::set_fov(float fov)
21 {
22 this->fov = fov;
23 }
25 float Camera::get_fov() const
26 {
27 return fov;
28 }
30 void Camera::calc_matrix() const
31 {
32 xform.set_identity();
33 xform.lookat(pos, target, Vector3(0, 1, 0));
34 xform_valid = true;
35 }
37 void Camera::calc_inv_matrix() const
38 {
39 // TODO
40 }
42 void Camera::draw() const
43 {
44 }
46 bool Camera::intersect(const Ray &ray, float *dist)
47 {
48 return false;
49 }