-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrimitive.h
42 lines (32 loc) · 1.02 KB
/
Primitive.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Primitive.h
Public; holds shape and material data for use by the raytracer and shader.
*/
#ifndef I_PRIM
#define I_PRIM
#include <glm/glm.hpp>
#include "Shape.h"
#include "Material.h"
#include "Ray.h"
#include "Intersection.h"
#include "AABB.h"
class Primitive {
public:
Primitive(Shape* shape);
~Primitive();
int getIntersectionPoint(const Ray& ray, Intersection& intersection, const double dt);
bool doesRayIntersect(const Ray& ray, const float tmax, const double dt);
// Delete soon
int intersectionPoint(Ray* ray, Intersection* intersection);
bool doesIntersect(Ray* ray, float tmax);
void setAmbient(const glm::dvec3& ambient);
void setMaterial(const Material& material);
void setTransformation(glm::dmat4& transformation);
Shape* shape;
Material* material;
glm::dvec3 ambient;
glm::dmat4 transformation;
glm::dmat4 inverseTransformation;
glm::dmat4 inverseTranspose;
};
#endif