triangle.h 561 B

123456789101112131415161718192021222324252627282930313233
  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. Intersect localIntersect(Ray r);
  16. Tuple localNormalAt(Tuple point);
  17. public:
  18. Tuple p1, p2, p3;
  19. Tuple e1, e2;
  20. Tuple normal;
  21. public:
  22. Triangle(Point p1, Point p2, Point p3);
  23. BoundingBox getLocalBounds();
  24. void dumpMe(FILE *fp);
  25. };
  26. #endif /* DORAYME_TRIANGLE_H */