You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
603 B

4 years ago
4 years ago
  1. #pragma once
  2. #include "Vector3.h"
  3. class Material;
  4. class LinkedList {
  5. public:
  6. LinkedList* mNext;
  7. LinkedList() {
  8. mNext = nullptr;
  9. }
  10. template<typename T>
  11. T* Next() {
  12. return (T*)mNext;
  13. }
  14. void Append(LinkedList* node) {
  15. if (mNext == nullptr) {
  16. mNext = node;
  17. }
  18. else {
  19. mNext->Append(node);
  20. }
  21. }
  22. };
  23. class Object : public LinkedList{
  24. public:
  25. Geometry *mGeometry;
  26. Material *mMaterial;
  27. Object(Geometry* g, Material* m);
  28. void Set(Geometry* g, Material* m);
  29. bool HitTest(const Ray& input_ray, float min_distance, float max_distance, HitPoint& hit_point);
  30. };