11 #ifndef QTOPENGL_OBJ_MODEL_H
12 #define QTOPENGL_OBJ_MODEL_H
17 #include <argos3/core/utility/datatypes/datatypes.h>
18 #include <argos3/core/utility/math/vector3.h>
19 #include <argos3/core/utility/math/vector2.h>
41 std::array<GLfloat, 4>
Ambient = {{0.0f, 0.0f, 0.0f, 1.0f}};
42 std::array<GLfloat, 4>
Diffuse = {{0.0f, 0.0f, 0.0f, 1.0f}};
43 std::array<GLfloat, 4>
Emission = {{0.0f, 0.0f, 0.0f, 1.0f}};
44 std::array<GLfloat, 4>
Specular = {{0.0f, 0.0f, 0.0f, 1.0f}};
79 const std::array<GLuint, 3>& arr_indices) :
80 Material(it_material),
81 Indices(arr_indices) {}
84 std::array<GLuint, 3> Indices;
89 Material(t_material) {}
91 std::vector<GLuint> Triangles;
97 const QString& GetModelDir()
const;
99 void ImportGeometry(QTextStream& c_text_stream);
101 void ImportMaterials(QTextStream& c_text_stream);
103 GLuint AddVertex(
SInt32 n_key,
104 const CVector3& c_position,
105 const CVector3& c_normal,
106 const CVector2& c_texture);
110 void GenerateOpenGLVectors();
114 std::vector<CVector3> m_vecVertexCoords;
115 std::vector<CVector2> m_vecTextureCoords;
116 std::vector<CVector3> m_vecNormals;
118 std::map<std::string, SMaterial> m_mapMaterials;
119 std::vector<SVertex> m_vecVertices;
120 std::vector<STriangle> m_vecTriangles;
121 std::vector<SMesh> m_vecMeshes;
122 std::multimap<SInt32, GLuint> m_mapVertexCache;
124 std::vector<GLdouble> m_vecOpenGLPositions;
125 std::vector<GLdouble> m_vecOpenGLNormals;
signed int SInt32
32-bit signed integer.
The namespace containing all the ARGoS related code.
static const CVector2 ZERO
The zero vector (0,0)
static const CVector3 ZERO
The zero vector (0,0,0)
CQTOpenGLObjModel(const std::string &str_model)
SMaterial & GetMaterial(const std::string &str_material)
std::array< GLfloat, 4 > Specular
std::map< std::string, SMaterial >::iterator TMapIterator
std::array< GLfloat, 4 > Emission
std::array< GLfloat, 4 > Ambient
std::array< GLfloat, 4 > Diffuse
std::array< GLfloat, 1 > Shininess