nuclear@1: #include "camera.h" nuclear@1: nuclear@1: Camera::Camera() nuclear@1: : pos(0, 0, 10) nuclear@1: { nuclear@1: fov = M_PI; nuclear@1: } nuclear@1: nuclear@1: void Camera::set_position(const Vector3 &pos) nuclear@1: { nuclear@1: this->pos = pos; nuclear@1: } nuclear@1: nuclear@1: const Vector3 &Camera::get_position() const nuclear@1: { nuclear@1: return pos; nuclear@1: } nuclear@1: nuclear@1: void Camera::set_target(const Vector3 &target) nuclear@1: { nuclear@1: this->target = target; nuclear@1: } nuclear@1: nuclear@1: const Vector3 &Camera::get_target() const nuclear@1: { nuclear@1: return target; nuclear@1: } nuclear@1: nuclear@1: void Camera::set_fov(float fov) nuclear@1: { nuclear@1: this->fov = fov; nuclear@1: } nuclear@1: nuclear@1: float Camera::get_fov() const nuclear@1: { nuclear@1: return fov; nuclear@1: } nuclear@1: nuclear@1: Matrix4x4 Camera::get_matrix() const nuclear@1: { nuclear@1: Matrix4x4 res; nuclear@1: res.lookat(pos, target, Vector3(0, 1, 0)); nuclear@1: return res; nuclear@1: } nuclear@1: nuclear@1: Matrix4x4 Camera::get_inv_matrix() const nuclear@1: { nuclear@1: Matrix4x4 res; nuclear@1: return res; // TODO nuclear@1: }