Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
renderable.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <vector>
5#include <set>
6
7#define GLM_ENABLE_EXPERIMENTAL
8#include <glm/glm.hpp>
9#include <glm/gtx/quaternion.hpp>
10
11
12#define GLM_ENABLE_EXPERIMENTAL
13#include <glm/gtx/quaternion.hpp>
14
15#include "client/shader.hpp"
16#include "client/util.hpp"
19
20
21
23 public:
24 Renderable();
32 virtual void draw(Shader* shader,
33 glm::vec3 camPos,
34 bool fill) = 0;
35
42 virtual void translateAbsolute(const glm::vec3& new_pos);
43
51 virtual void translateRelative(const glm::vec3& delta);
52
62 virtual void scaleAbsolute(const float& new_factor);
63
72 virtual void scaleAbsolute(const glm::vec3& scale);
73
83 virtual void scaleRelative(const float& new_factor);
84
93 virtual void scaleRelative(const glm::vec3& scale);
94
104 virtual void rotateAbsolute(const glm::vec3& dir, bool is_player = false, const glm::vec3& axis = glm::vec3(0.0f, 1.0f, 0.0f));
105
114 virtual void rotateAbsolute(const float& angle, const glm::vec3& axis = glm::vec3(0.0f, 1.0f, 0.0f));
115
124 virtual void rotateRelative(const glm::vec3& dir, const glm::vec3& axis = glm::vec3(0.0f, 1.0f, 0.0f));
125
126
133 glm::mat4 getModelMat();
134
139 virtual void clear();
140
144 virtual void clearScale();
145
149 virtual void clearPosition();
150
151 private:
152 glm::mat4 model;
153 glm::quat rotation;
154};
Definition: renderable.hpp:22
virtual void scaleAbsolute(const float &new_factor)
Definition: renderable.cpp:31
virtual void clearPosition()
Definition: renderable.cpp:71
virtual void rotateRelative(const glm::vec3 &dir, const glm::vec3 &axis=glm::vec3(0.0f, 1.0f, 0.0f))
Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-...
Definition: renderable.cpp:52
virtual void rotateAbsolute(const glm::vec3 &dir, bool is_player=false, const glm::vec3 &axis=glm::vec3(0.0f, 1.0f, 0.0f))
Rotates the item along the specified axis. If no axis is specified, then assumes a rotation on the y-...
Definition: renderable.cpp:43
virtual void draw(Shader *shader, glm::vec3 camPos, bool fill)=0
glm::mat4 getModelMat()
Definition: renderable.cpp:59
virtual void translateRelative(const glm::vec3 &delta)
Definition: renderable.cpp:18
Renderable()
Definition: renderable.cpp:12
virtual void scaleRelative(const float &new_factor)
Definition: renderable.cpp:22
virtual void translateAbsolute(const glm::vec3 &new_pos)
Definition: renderable.cpp:14
virtual void clearScale()
Definition: renderable.cpp:67
virtual void clear()
Definition: renderable.cpp:63
Definition: shader.hpp:12
GLuint shader
Definition: glad.h:1843