-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRectangle.h
38 lines (29 loc) · 1014 Bytes
/
Rectangle.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
#ifndef RECTANGLE_CLASS_H
#define RECTANGLE_CLASS_H
#include <glm/glm.hpp>
#include "Mesh.h"
#include "Primitives.h"
class Rectangle {
private:
const Primitives& primitives;
Mesh* rectMesh;
void UpdateBounds();
public:
glm::mat4 matrix = glm::mat4( 1.0f );
glm::vec3 translation = glm::vec3( 0.0f, 0.0f, 0.0f );
glm::quat rotation = glm::quat( 1.0f, 0.0f, 0.0f, 0.0f );
glm::vec3 scale = glm::vec3( 1.0f, 1.0f, 1.0f );
glm::vec3 pivot = glm::vec3( 0.0f, 0.0f, 0.0f );
glm::vec3 minBound;
glm::vec3 maxBound;
float width;
float height;
Rectangle( const Primitives& primitives, float width, float height );
void Draw( Shader& shader, Camera& camera );
void Translate( glm::vec3 diplacementVec );
void MoveTo( glm::vec3 newPosition );
void Rotate( float angle );
void SetWidth( float value );
void SetHeight( float value );
};
#endif