rayzor

diff src/camera.cc @ 1:a826bf0fb169

fixed line endings
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 05 Apr 2014 09:05:26 +0300
parents 2a5340a6eee4
children d94a69933a71
line diff
     1.1 --- a/src/camera.cc	Sat Apr 05 08:46:27 2014 +0300
     1.2 +++ b/src/camera.cc	Sat Apr 05 09:05:26 2014 +0300
     1.3 @@ -1,50 +1,50 @@
     1.4 -#include "camera.h"
     1.5 -
     1.6 -Camera::Camera()
     1.7 -	: pos(0, 0, 10)
     1.8 -{
     1.9 -	fov = M_PI;
    1.10 -}
    1.11 -
    1.12 -void Camera::set_position(const Vector3 &pos)
    1.13 -{
    1.14 -	this->pos = pos;
    1.15 -}
    1.16 -
    1.17 -const Vector3 &Camera::get_position() const
    1.18 -{
    1.19 -	return pos;
    1.20 -}
    1.21 -
    1.22 -void Camera::set_target(const Vector3 &target)
    1.23 -{
    1.24 -	this->target = target;
    1.25 -}
    1.26 -
    1.27 -const Vector3 &Camera::get_target() const
    1.28 -{
    1.29 -	return target;
    1.30 -}
    1.31 -
    1.32 -void Camera::set_fov(float fov)
    1.33 -{
    1.34 -	this->fov = fov;
    1.35 -}
    1.36 -
    1.37 -float Camera::get_fov() const
    1.38 -{
    1.39 -	return fov;
    1.40 -}
    1.41 -
    1.42 -Matrix4x4 Camera::get_matrix() const
    1.43 -{
    1.44 -	Matrix4x4 res;
    1.45 -	res.lookat(pos, target, Vector3(0, 1, 0));
    1.46 -	return res;
    1.47 -}
    1.48 -
    1.49 -Matrix4x4 Camera::get_inv_matrix() const
    1.50 -{
    1.51 -	Matrix4x4 res;
    1.52 -	return res;	// TODO
    1.53 -}
    1.54 +#include "camera.h"
    1.55 +
    1.56 +Camera::Camera()
    1.57 +	: pos(0, 0, 10)
    1.58 +{
    1.59 +	fov = M_PI;
    1.60 +}
    1.61 +
    1.62 +void Camera::set_position(const Vector3 &pos)
    1.63 +{
    1.64 +	this->pos = pos;
    1.65 +}
    1.66 +
    1.67 +const Vector3 &Camera::get_position() const
    1.68 +{
    1.69 +	return pos;
    1.70 +}
    1.71 +
    1.72 +void Camera::set_target(const Vector3 &target)
    1.73 +{
    1.74 +	this->target = target;
    1.75 +}
    1.76 +
    1.77 +const Vector3 &Camera::get_target() const
    1.78 +{
    1.79 +	return target;
    1.80 +}
    1.81 +
    1.82 +void Camera::set_fov(float fov)
    1.83 +{
    1.84 +	this->fov = fov;
    1.85 +}
    1.86 +
    1.87 +float Camera::get_fov() const
    1.88 +{
    1.89 +	return fov;
    1.90 +}
    1.91 +
    1.92 +Matrix4x4 Camera::get_matrix() const
    1.93 +{
    1.94 +	Matrix4x4 res;
    1.95 +	res.lookat(pos, target, Vector3(0, 1, 0));
    1.96 +	return res;
    1.97 +}
    1.98 +
    1.99 +Matrix4x4 Camera::get_inv_matrix() const
   1.100 +{
   1.101 +	Matrix4x4 res;
   1.102 +	return res;	// TODO
   1.103 +}