-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShapes.h
54 lines (42 loc) · 938 Bytes
/
Shapes.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
43
44
45
46
47
48
49
50
51
52
53
54
//
// Created by Brett on 4/24/2018.
//
#ifndef PROGRAM3_TRIANGLE_H
#define PROGRAM3_TRIANGLE_H
#include <glm/glm.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <vector>
using namespace glm;
using namespace std;
struct Sphere {
int id;
glm::vec3 center;
glm::vec3 color;
float radius;
Sphere(const glm::vec3& center=glm::vec3(0,0,0),
float radius=0,
const glm::vec3& color=glm::vec3(0,0,0))
: center(center), radius(radius), color(color) {
static int id_seed = 0;
id = ++id_seed;
}
};
class Triangle{
public:
vector<vec3> points;
vec3 color;
Triangle(vector<vec3> pts, vec3 col){
color = col;
points = pts;
}
};
// hold data about direction and origin of ray
struct Ray {
vec3 origin;
vec3 dir;
Ray(vec3 _origin, vec3 _dir){
origin = _origin;
dir = _dir;
}
};
#endif //PROGRAM3_TRIANGLE_H