diff --git a/src/camera.cc b/src/camera.cc index 754d0bc..4e11fa2 100644 --- a/src/camera.cc +++ b/src/camera.cc @@ -12,33 +12,34 @@ #pragma mark - Generic Camera Camera::Camera() - : direction(Vector3::Z), + : mDirection(Vector3::Z), mRight(1.33, 0, 0), mUp(Vector3::Y) { } +Camera::Camera(const Camera& other) + : mDirection(other.mDirection), + mRight(other.mRight), + mUp(other.mUp) +{ } + + Camera::~Camera() { } -/* - * Camera::get_direction -- - * Camera::set_direction -- - * - * Get and set direction vector. - */ -const Vector3 & +const Vector3& Camera::get_direction() const { - return direction; + return mDirection; } void -Camera::set_direction(const Vector3 &d) +Camera::set_direction(const Vector3 &direction) { - direction = d; + mDirection = direction; } diff --git a/src/camera.h b/src/camera.h index 2552c1f..a058aae 100644 --- a/src/camera.h +++ b/src/camera.h @@ -14,11 +14,12 @@ #include "object.h" -class Camera +struct Camera : public Object { public: Camera(); + Camera(const Camera& other); virtual ~Camera(); const Vector3 &get_direction() const; @@ -35,7 +36,7 @@ public: private: /** A normalized vector defining where the camera is pointed. */ - Vector3 direction; + Vector3 mDirection; /** * A vector defining the width of the camera's image plane. The ratio of