8 #include <glm/vec3.hpp>
9 #include <glm/vec4.hpp>
23 Model(
const std::vector<float>& positions,
24 const std::vector<unsigned int>& indices,
25 const std::vector<unsigned int>& adjacentIndices,
26 const std::vector<float>& normals,
27 const std::vector<float>& uvs,
55 std::vector<unsigned char>& data,
56 std::vector<float>& heights,
57 std::vector<float>& positions,
58 std::vector<unsigned int>& indices,
59 std::vector<float>& normals,
60 std::vector<float>& uvs);
63 std::vector<unsigned int>& indices,
64 std::vector<float>& normals,
65 std::vector<float>& uvs);
68 std::vector<unsigned int>& indices,
69 std::vector<float>& uvs,
74 std::vector<unsigned int>& indices,
75 std::vector<float>& normals,
76 std::vector<float>& uvs);
78 static void loadModels(
const std::string& modelPath, std::vector<std::unique_ptr<Model> >& models);
static void getCubeModel(std::vector< float > &positions, std::vector< unsigned int > &indices, std::vector< float > &normals, std::vector< float > &uvs)
Definition: model.cpp:105
glm::vec4 diffuse
Definition: model.hpp:86
void setTexture(Texture *val)
Definition: model.hpp:46
Texture * getTexture() const
Definition: model.hpp:39
size_t getIndexCount() const
Definition: model.hpp:37
Encapsulates a graphical object model in the GPU.
Definition: model.hpp:14
static void getTerrainModel(size_t width, size_t height, size_t bitPerPixel, float cellSize, std::vector< unsigned char > &data, std::vector< float > &heights, std::vector< float > &positions, std::vector< unsigned int > &indices, std::vector< float > &normals, std::vector< float > &uvs)
Definition: model.cpp:232
void setAmbient(const glm::vec4 &val)
Definition: model.hpp:48
GLuint getIndicesAdj() const
Definition: model.hpp:35
size_t indexCount
Definition: model.hpp:82
static void loadModels(const std::string &modelPath, std::vector< std::unique_ptr< Model > > &models)
Definition: model.cpp:54
void setSpecular(const glm::vec4 &val)
Definition: model.hpp:49
size_t getIndexAdjCount() const
Definition: model.hpp:38
GLuint getIndices() const
Definition: model.hpp:34
GLuint vbo[VBO_COUNT]
Definition: model.hpp:81
Model(const std::vector< float > &positions, const std::vector< unsigned int > &indices, const std::vector< unsigned int > &adjacentIndices, const std::vector< float > &normals, const std::vector< float > &uvs, Texture *texture=0)
Definition: model.cpp:11
GLuint getPosition() const
Definition: model.hpp:32
size_t indexAdjCount
Definition: model.hpp:83
static void getQuadModel(std::vector< float > &positions, std::vector< unsigned int > &indices, std::vector< float > &uvs, float width, float height)
Definition: model.cpp:70
glm::vec4 specular
Definition: model.hpp:88
float getShininess() const
Definition: model.hpp:40
static void getSphereModel(std::vector< float > &positions, std::vector< unsigned int > &indices, std::vector< float > &normals, std::vector< float > &uvs)
Definition: model.cpp:304
float shininess
Definition: model.hpp:85
void setDiffuse(const glm::vec4 &val)
Definition: model.hpp:47
glm::vec4 getSpecular() const
Definition: model.hpp:43
~Model()
Definition: model.cpp:49
Encapsulates a texture in the GPU.
Definition: texture.hpp:10
glm::vec4 getAmbient() const
Definition: model.hpp:42
glm::vec4 getDiffuse() const
Definition: model.hpp:41
GLuint getUVs() const
Definition: model.hpp:36
void setShininess(float val)
Definition: model.hpp:45
Texture * texture
Definition: model.hpp:84
GLuint getNormals() const
Definition: model.hpp:33
glm::vec4 ambient
Definition: model.hpp:87