-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLine.h
48 lines (41 loc) · 1.06 KB
/
Line.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
#ifndef LINE_CLASS_H
#define LINE_CLASS_H
#include "VAO.h"
#include <glm/glm.hpp>
#include "Camera.h"
#include "Rectangle.h"
#include "Helpers/Mathematics.h"
class Line {
private:
Rectangle *lineRect;
void _adjustRectangle();
void _createGLBuffer(
const glm::vec3& startPosition,
const glm::vec3& endPosition,
const glm::vec3& color = glm::vec3(1, 1, 1) );
public:
std::vector<Vertex> line_vertices;
float thickness = -1.0f;
VAO vao;
VBO* vbo;
Line();
Line(
const glm::vec3& startPosition,
const glm::vec3& endPosition,
const glm::vec3& color );
Line(
const Primitives& primitives,
const glm::vec3& startPosition,
const glm::vec3& endPosition,
float thickness );
void Draw( Shader& shader, Camera& camera );
void SetStartPosition( glm::vec3 newPosition );
glm::vec3 GetStartPosition();
void SetEndPosition( glm::vec3 newPosition );
glm::vec3 GetEndPosition();
void SetPoints( glm::vec3 startPosition,glm::vec3 endPosition );
void SetColor( glm::vec3 newColor );
float GetLength();
glm::vec3 GetMidPoint();
};
#endif // !LINE_CLASS_H