intersect.h 599 B

12345678910111213141516171819202122232425262728293031
  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 reset();
  23. void add(Intersection i);
  24. int count() { return this->num; };
  25. Intersection operator[](const int p) { return *this->list[p]; }
  26. Intersection hit();
  27. };
  28. #endif /* DORAYME_INTERSECT_H */