ray.h 493 B

1234567891011121314151617181920212223242526
  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. #include <renderstat.h>
  13. class Ray
  14. {
  15. public:
  16. Tuple direction;
  17. Tuple origin;
  18. Ray(Tuple origin, Tuple direction) : origin(origin), direction(direction) { stats.addRay(); };
  19. Tuple position(double t) { return this->origin + this->direction * t; };
  20. };
  21. #endif /* DORAYME_RAY_H */