47 lines
773 B
C++
47 lines
773 B
C++
#ifndef MESH_H
|
|
#define MESH_H
|
|
|
|
#include <vector>
|
|
#include <glm/vec3.hpp>
|
|
#include <glm/vec2.hpp>
|
|
|
|
class Material;
|
|
|
|
struct Mesh
|
|
{
|
|
typedef struct
|
|
{
|
|
glm::vec3 tangent;
|
|
glm::vec3 binormal;
|
|
} Tangents;
|
|
|
|
typedef struct
|
|
{
|
|
std::vector<unsigned int> indices;
|
|
Material* material;
|
|
} Group;
|
|
|
|
std::vector<glm::vec3> positions;
|
|
std::vector<glm::vec3> normals;
|
|
std::vector<glm::vec2> texCoords;
|
|
std::vector<Tangents> tangents;
|
|
std::vector<Group> indiceGroups;
|
|
|
|
bool hasNormals() const
|
|
{
|
|
return normals.size() != 0;
|
|
}
|
|
|
|
bool hasTexCoords() const
|
|
{
|
|
return texCoords.size() != 0;
|
|
}
|
|
|
|
bool hasTangents() const
|
|
{
|
|
return tangents.size() != 0;
|
|
}
|
|
};
|
|
|
|
#endif // MESH_H
|