triangle.h 601 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * Triangle header
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #ifndef DORAYME_TRIANGLE_H
  10. #define DORAYME_TRIANGLE_H
  11. #include <shape.h>
  12. #include <stdio.h>
  13. class Triangle : public Shape
  14. {
  15. protected:
  16. Intersect localIntersect(Ray r);
  17. Tuple localNormalAt(Tuple point, Intersection *hit = nullptr);
  18. public:
  19. Tuple p1, p2, p3;
  20. Tuple e1, e2;
  21. Tuple normal;
  22. public:
  23. Triangle(Point p1, Point p2, Point p3);
  24. BoundingBox getLocalBounds();
  25. void dumpMe(FILE *fp);
  26. };
  27. #endif /* DORAYME_TRIANGLE_H */