intersect.h 581 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * Intersect header
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #ifndef DORAYME_INTERSECT_H
  10. #define DORAYME_INTERSECT_H
  11. #include <stdint.h>
  12. #include <intersection.h>
  13. class Intersect
  14. {
  15. private:
  16. Intersection **list;
  17. uint32_t num;
  18. uint32_t allocated;
  19. public:
  20. Intersect();
  21. ~Intersect();
  22. void add(Intersection i);
  23. int count() { return this->num; };
  24. Intersection operator[](const int p) { return *this->list[p]; }
  25. Intersection hit();
  26. };
  27. #endif /* DORAYME_INTERSECT_H */