From 5c46e0f0a924989201c6784b0f956bc442f14a7e Mon Sep 17 00:00:00 2001 From: majortom6 Date: Sun, 19 Feb 2017 09:17:35 -0600 Subject: -removed glm library, its in the debian repos -made opengl and sdl folders in includes, moved various *hpps to them --- inc/graphicsobjects.hpp | 94 ------------------------------------------------- 1 file changed, 94 deletions(-) delete mode 100644 inc/graphicsobjects.hpp (limited to 'inc/graphicsobjects.hpp') diff --git a/inc/graphicsobjects.hpp b/inc/graphicsobjects.hpp deleted file mode 100644 index de85467..0000000 --- a/inc/graphicsobjects.hpp +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef graphicsobjects_h -#define graphicsobjects_h - -#include -#include - -#include "camera.hpp" - - -struct Transform -{ -public: - Transform(const glm::vec3& pos = glm::vec3(), const glm::vec3& rot = glm::vec3(), const glm::vec3& scale = glm::vec3(1.0f, 1.0f, 1.0f)) - { - this->pos = pos; - this->rot = rot; - this->scale = scale; - } - - inline glm::mat4 GetModel() const - { - glm::mat4 posMat = glm::translate(pos); - glm::mat4 scaleMat = glm::scale(scale); - glm::mat4 rotX = glm::rotate(rot.x, glm::vec3(1.0, 0.0, 0.0)); - glm::mat4 rotY = glm::rotate(rot.y, glm::vec3(0.0, 1.0, 0.0)); - glm::mat4 rotZ = glm::rotate(rot.z, glm::vec3(0.0, 0.0, 1.0)); - glm::mat4 rotMat = rotX * rotY * rotZ; - - return posMat * rotMat * scaleMat; - } - - inline glm::mat4 GetMVP(const Camera& camera) const - { - glm::mat4 VP = camera.GetViewProjection(); - glm::mat4 M = GetModel(); - - return VP * M; - } - - inline glm::vec3* GetPos() { return &pos; } - inline glm::vec3* GetRot() { return &rot; } - inline glm::vec3* GetScale() { return &scale; } - - inline void SetPos(glm::vec3& pos) { this->pos = pos; } - inline void SetRot(glm::vec3& rot) { this->rot = rot; } - inline void SetScale(glm::vec3& scale) { this->scale = scale; } -protected: -private: - glm::vec3 pos; - glm::vec3 rot; - glm::vec3 scale; -}; - -class GraphicsData -{ - public: - - float x; - float y; - float r; - float g; - float b; - float sides; - - GraphicsData(){ - this->x = 0; - this->y = 0; - this->r = 0; - this->g = 0; - this->b = 0; - this->sides = 0; - } - - - GraphicsData(float x,float y,float r,float g,float b,float sides){ - this->x = 0; - this->y = 0; - this->r = 0; - this->g = 0; - this->b = 0; - this->sides = 0; - } - - float getX(){ - return x; - } - - float getY(){ - return y; - } - -}; - -#endif -- cgit v1.2.3