ray.h 453 B

12345678910111213141516171819202122232425
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * Ray header
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #ifndef DORAYME_RAY_H
  10. #define DORAYME_RAY_H
  11. #include <tuple.h>
  12. class Ray
  13. {
  14. public:
  15. Tuple direction;
  16. Tuple origin;
  17. Ray(Tuple origin, Tuple direction) : origin(origin), direction(direction) { };
  18. Tuple position(double t) { return this->origin + this->direction * t; };
  19. };
  20. #endif /* DORAYME_RAY_H */