cloudy-raytracer/primitive/objmodel.h
arvid schröder ed9c300d77 added objects
2022-11-21 15:49:53 +01:00

23 lines
624 B
C++

#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