-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathintersection.h
More file actions
43 lines (28 loc) · 795 Bytes
/
intersection.h
File metadata and controls
43 lines (28 loc) · 795 Bytes
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
43
#ifndef INTERSECTION_HPP
#define INTERSECTION_HPP
#include <glm/glm.hpp>
class Objet;
class Intersection {
private:
float dist; // La distance à l'origine de l'intersection
glm::vec3 normal;
Objet* obj; // l'objet intersecté
public:
Intersection() = default;
explicit Intersection(Objet* obj);
explicit Intersection(float dist, Objet* obj);
explicit Intersection(float dist, const glm::vec3& normal, Objet* obj);
~Intersection() = default;
const glm::vec3& getNormal() const;
void setNormal(const glm::vec3& normal);
float getDist() const;
Objet* getObj() const;
// Opérateur de tri des intersections
int operator<(const Intersection& i) const {
return dist < i.dist;
}
int operator>(const Intersection& i) const {
return dist > i.dist;
}
};
#endif