nuclear@1: #include "camera.h" nuclear@1: nuclear@1: Camera::Camera() nuclear@1: { nuclear@12: type = NODE_CAMERA; nuclear@1: fov = M_PI; nuclear@12: set_position(Vector3(0, 0, 10)); nuclear@1: } nuclear@1: nuclear@1: void Camera::set_target(const Vector3 &target) nuclear@1: { nuclear@13: this->target.set_position(target); nuclear@1: } nuclear@1: nuclear@13: Vector3 Camera::get_target() const nuclear@1: { nuclear@13: return target.get_position(); 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@12: void Camera::calc_matrix() const nuclear@1: { nuclear@12: xform.set_identity(); nuclear@13: xform.lookat(pos, target.get_position(), Vector3(0, 1, 0)); nuclear@12: xform_valid = true; nuclear@1: } nuclear@1: nuclear@12: void Camera::calc_inv_matrix() const nuclear@1: { nuclear@12: // TODO nuclear@1: } nuclear@12: nuclear@12: void Camera::draw() const nuclear@12: { nuclear@12: } nuclear@12: nuclear@13: bool Camera::intersect(const Ray &ray, float *dist) const nuclear@12: { nuclear@12: return false; nuclear@12: }