Kinetic Visualization
 All Classes Functions Variables Pages
Geometry.h
1 #pragma once
2 #include "MyShader.hpp"
3 #include "ShaderObj.h"
4 #include "Texture.h"
5 #include "Material.h"
6 
7 #include <glm\glm.hpp>
8 #include <map>
9 #include <vector>
10 
11 class Geometry
12 {
13 public:
14  enum GeometryType{
15  GT_VertexGeometry,
16  GT_ParticleGeometry
17  };
18 
19  enum TextureType
20  {
21  TT_Diffuse,
22  TT_Ambient,
23  TT_Bumpmap,
24  TT_Normalmap,
25  TT_Emissive
26  };
27 
28  enum RenderType
29  {
30  RT_TRIANGLE,
31  RT_POINT
32  };
33 
34 public:
38  Geometry(void);
43  Geometry(unsigned int type);
47  virtual ~Geometry(void);
48 
49 public:
50  glm::mat4 World;
51  glm::mat4 Local;
52 
53 public:
54  float start_time;
55  std::map<unsigned int, Texture::TexturePtr> m_TextureObjs;
56  Material* m_MatrialObjs;
57 
63  void SetShader(unsigned int id, MyShader* shader);
68  MyShader* GetShader(unsigned int id);
69 
75  void CreateDictShaderToVBO(unsigned int id, std::map<std::string, int> dict);
81  void SetDictShaderToVBO(unsigned int id, std::map<int, int> dict);
82 
88  void CreateDictShaderUniforms(unsigned int id, std::map<std::string, int> dict);
89 
95  void SetDictShaderUniforms(unsigned int id, std::map<int, int> dict);
96 
101  void CreateDictShaderSpecificUniforms(unsigned int id);
102 
103  std::map<int, int> GetDictShaderToVBO(unsigned int id);
104  std::map<int, int> GetDictShaderUniform(unsigned int id);
105 
106  /*Die Idee davon ist ziemlich easy. Man muss die VBOs (oder auch VAOs)
107  mit dem Befehl
108  glEnableVertexAttribArray(...)
109  den richtigen Attrib Variable zuweisen (also die in Variablen im MyShader). Diese kriegt man über die Funktion
110  get_attrib_location(...).
111  Dieses Map speichert nun einfach für jede Attrib-Location den dazugehörigen VBO
112 
113  Also es wird gespeichert das Ergebnis von get_attrib_location(...) und von VertexGeometry ein Eintrag von dem ArrayTabe enum,
114  also <0, VertexGeometry::AT_POSITION>
115  */
116  std::vector<std::map<int, int>> m_dict_shader_vbo;
117 
118  /*Die gleiche Idee wie bei dem m_dict_shader_vbo Dictionary.
119  Nur jetzt mit dem Uniform Variablen.
120  */
121  std::vector<std::map<int, int>> m_dict_shader_uniform;
122 
123  std::vector<std::vector<ShaderObj*>> m_shader_uniforms;
124 
125 public:
126  glm::mat4 m_modelMatrix;
127  std::vector<glm::mat4> m_oldModelMatrix;
128 
129  unsigned int m_type;
130  bool useNormals;
131  bool useTextures;
132 
133 
134 public:
135  bool renderTo3DTexture;
136  int actDepth;
137 
138  unsigned int m_bones_count;
139  glm::mat4* bones;
140  glm::mat4* oldBones;
141  glm::mat4* act_bones;
142 
143 
144  glm::mat4* bones_helper;
145 
146  unsigned int m_rendertype;
147 
148  std::vector<MyShader*> m_shader;
149 };
150