cloudy-raytracer/primitive/objmodel.h
2022-11-21 17:48:20 +01:00

25 lines
610 B
C++

#ifndef CG1_TRACER_OBJMODEL_H
#define CG1_TRACER_OBJMODEL_H
#include "primitive.h"
#include "box.h"
#include <vector>
class ObjModel : public Primitive {
public:
explicit ObjModel(const std::shared_ptr<Shader> &shader);
void loadObj(const char* fileName, Vector3d scale, Vector3d translation);
bool intersect(Ray &ray) const override;
[[nodiscard]] float minimumBounds(int dimension) const override;
[[nodiscard]] float maximumBounds(int dimension) const override;
protected:
std::vector<std::shared_ptr<Primitive>> faces;
Box boundingBox;
};
#endif //CG1_TRACER_OBJMODEL_H