summaryrefslogtreecommitdiff
path: root/gfx/gl/transform.h
blob: 61b571db53807167a79acfd16a7872d9ea72a4d2 (plain)
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
#ifndef TRANSFORM_INCLUDED_H
#define TRANSFORM_INCLUDED_H

#include <glm/glm.hpp>

class Transform {
public:
	explicit Transform(glm::vec3 pos = {}, glm::vec3 rot = {});

	[[nodiscard]] glm::mat4 GetModel() const;

	[[nodiscard]] inline glm::vec3 &
	GetPos()
	{
		return pos;
	}

	[[nodiscard]] inline const glm::vec3 &
	GetPos() const
	{
		return pos;
	}

	[[nodiscard]] inline glm::vec3 &
	GetRot()
	{
		return rot;
	}

	[[nodiscard]] inline const glm::vec3 &
	GetRot() const
	{
		return rot;
	}

	inline void
	SetPos(glm::vec3 && pos)
	{
		this->pos = pos;
	}

	inline void
	SetRot(glm::vec3 && rot)
	{
		this->rot = rot;
	}

private:
	glm::vec3 pos;
	glm::vec3 rot;
};

#endif