intersection.h 590 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * Intersection header
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #ifndef DORAYME_INTERSECTION_H
  10. #define DORAYME_INTERSECTION_H
  11. #include <stdlib.h>
  12. class Shape;
  13. class Intersection
  14. {
  15. public:
  16. double t;
  17. Shape *object;
  18. public:
  19. Intersection(double t, Shape *object) : t(t), object(object) { };
  20. bool nothing() { return (this->object == nullptr); };
  21. bool operator==(const Intersection &b) const { return ((this->t == b.t) && (this->object == b.object)); };
  22. };
  23. #endif //DORAYME_INTERSECTION_H