From 69706300e33d4431a2985a6b35c4568f5fad898b Mon Sep 17 00:00:00 2001 From: Yoel <s73017@beuth-hochschule.de> Date: Wed, 12 Jan 2022 13:04:17 +0100 Subject: [PATCH] CamObs cleanup --- RayTracer/camera/CamObs.cpp | 5 +++-- RayTracer/camera/CamObs.h | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/RayTracer/camera/CamObs.cpp b/RayTracer/camera/CamObs.cpp index 9688e53..e3f4c0c 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 f17a05d..b2f31f8 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: -- GitLab