diff --git a/RayTracer/camera/CamObs.cpp b/RayTracer/camera/CamObs.cpp index 9688e53cd5b60ced5829fefb1aa853fec7b2041d..e3f4c0c998e0b6ed598d8f98c5a26204810abe52 100644 --- a/RayTracer/camera/CamObs.cpp +++ b/RayTracer/camera/CamObs.cpp @@ -3,11 +3,12 @@ #include <limits> namespace cam { -cam::CamObs::CamObs(const util::Mat4& mat, float theta, int width, int height) +CamObs::CamObs(const util::Mat4& mat, float theta, int width, int height) : mat(mat), theta(theta), width(width), height(height) { } -Ray cam::CamObs::create(float x, float y) const { +// Create a new ray shooting from the camera +Ray CamObs::create(float x, float y) const { util::Vec3 d(x - width / 2, height / 2 - y, -(width / 2) / (tan(theta / 2))); diff --git a/RayTracer/camera/CamObs.h b/RayTracer/camera/CamObs.h index f17a05d6c5ae41befe3aaf2246e1a947b7a70e59..b2f31f805e213b1f3be9a994374ef7efbf36984e 100644 --- a/RayTracer/camera/CamObs.h +++ b/RayTracer/camera/CamObs.h @@ -6,11 +6,10 @@ namespace cam { class CamObs { public: - // Constructor CamObs(const util::Mat4& mat, float theta, int width, int height); - // Methods + Ray create(float x, float y) const; - // Attributes + const int width, height; private: