cone.h 640 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * DoRayMe - a quick and dirty Raytracer
  3. * Cone header
  4. *
  5. * Created by Manoël Trapier
  6. * Copyright (c) 2020 986-Studio.
  7. *
  8. */
  9. #ifndef DORAYME_CONE_H
  10. #define DORAYME_CONE_H
  11. #include <shape.h>
  12. #include <ray.h>
  13. #include <intersect.h>
  14. class Cone : public Shape {
  15. protected:
  16. Intersect localIntersect(Ray r);
  17. Tuple localNormalAt(Tuple point);
  18. bool checkCap(Ray r, double t, double y);
  19. void intersectCaps(Ray r, Intersect &xs);
  20. public:
  21. bool isClosed;
  22. double minCap;
  23. double maxCap;
  24. Cone() : minCap(-INFINITY), maxCap(INFINITY), isClosed(false), Shape(SHAPE_CONE) {};
  25. };
  26. #endif /* DORAYME_CONE_H */