rayzor

view src/camera.cc @ 13:964f8ea5f095

missed quite a lot of things in my last commit apparently
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 12 Apr 2014 23:37:55 +0300
parents d94a69933a71
children be616b58df99
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 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.get_position(), 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) const
47 {
48 return false;
49 }