triangle.h 509 B

123456789101112131415161718192021222324252627282930
  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. class Triangle : public Shape
  13. {
  14. Intersect localIntersect(Ray r);
  15. Tuple localNormalAt(Tuple point);
  16. public:
  17. Tuple p1, p2, p3;
  18. Tuple e1, e2;
  19. Tuple normal;
  20. public:
  21. Triangle(Point p1, Point p2, Point p3);
  22. BoundingBox getBounds();
  23. };
  24. #endif /* DORAYME_TRIANGLE_H */