-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTriangle.h
More file actions
54 lines (36 loc) · 1.21 KB
/
Triangle.h
File metadata and controls
54 lines (36 loc) · 1.21 KB
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
#pragma once
#define GLEW_STATIC
#include <glew.h>
// GLFW 3.x, to handle the OpenGL window
#include <glfw3.h>
// File and console I/O for logging and error reporting
#include <iostream>
// Math header for trigonometric functions
#include <cmath>
// another thing instead of GLFW
#include <glm.hpp>
#include <vec2.hpp>
#include <vec3.hpp>
#include <vec4.hpp>
#include <mat4x2.hpp>
#include <gtc/matrix_transform.hpp>
#include <gtc/type_ptr.hpp>
#include <vector>
// ----
#include "Stuff_n_Things.h"
class Triangle
{
public:
Triangle(Vertex vertex0, Vertex vertex1, Vertex vertex2, ColorDbl colorIn, Direction direc, std::string stringIn);
~Triangle();
Vertex v0, v1, v2; // vertex
glm::vec3 e1, e2; // vectors to use when calc normal
//glm::vec3 normal; // normal :)
Direction normal;
ColorDbl color; // color
std::string type = "";
//Function that checks if you have an intersection point with a triangle when you shoot a ray
//Set INF (infinity) to 9999999999, make the ray as long as possible to give it a change to intersect
//sPos is the starting position, direction is a normal
bool intersection(glm::vec3 sPos, Direction direction, float &t);
};