aboutsummaryrefslogtreecommitdiffstats
path: root/include/rt.hpp
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2020-12-20 22:42:37 +0100
committerladevieq <ladevie.quentin@gmail.com>2020-12-20 22:42:37 +0100
commit643708a9922cabe9b37329ee41a8668087dc92d7 (patch)
treee4052ae5b08569d97af39afc8456852d836d6c9f /include/rt.hpp
parent44c1eec63fc51d1a4eb888cde5e8f4b874876bab (diff)
Add a camera class
Diffstat (limited to 'include/rt.hpp')
-rw-r--r--include/rt.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/rt.hpp b/include/rt.hpp
index 3c37fa1..a0c912e 100644
--- a/include/rt.hpp
+++ b/include/rt.hpp
@@ -19,10 +19,17 @@ inline double randd(double min, double max) {
return min + randd() * (max - min);
}
+inline double clamp(double x, double min, double max) {
+ if (x < min) return min;
+ if (x > max) return max;
+ return x;
+}
+
#include "vec3.hpp"
#include "ray.hpp"
#include "color.hpp"
#include "sphere.hpp"
+#include "camera.hpp"
#endif // !__RT_HPP_