cloudy-raytracer/primitive/objmodel.h

24 lines
624 B
C
Raw Normal View History

2022-11-21 15:49:53 +01:00
#ifndef CG1_TRACER_OBJMODEL_H
#define CG1_TRACER_OBJMODEL_H
#include "primitive.h"
#include "triangle.h"
#include <vector>
#include <string>
class ObjModel : public Primitive {
public:
explicit ObjModel(const std::shared_ptr<Shader> &shader) : Primitive(shader) {}
void loadObj(const std::string& fileName, Vector3d translation, Vector3d upVector);
bool intersect(Ray &ray) const override;
[[nodiscard]] float minimumBounds(int dimension) const override;
[[nodiscard]] float maximumBounds(int dimension) const override;
protected:
std::vector<Triangle> faces;
};
#endif //CG1_TRACER_OBJMODEL_H