Update model chapter, and add new backpack model to repo (w/ attribution mention). Also use new model on deferred source code.

This commit is contained in:
Joey de Vries
2020-04-30 14:32:14 +02:00
parent f9ae66b16a
commit 66d51ae668
12 changed files with 199517 additions and 10 deletions

View File

@@ -26,13 +26,12 @@ unsigned int TextureFromFile(const char *path, const string &directory, bool gam
class Model
{
public:
/* Model Data */
// model data
vector<Texture> textures_loaded; // stores all the textures loaded so far, optimization to make sure textures aren't loaded more than once.
vector<Mesh> meshes;
vector<Mesh> meshes;
string directory;
bool gammaCorrection;
/* Functions */
// constructor, expects a filepath to a 3D model.
Model(string const &path, bool gamma = false) : gammaCorrection(gamma)
{
@@ -47,7 +46,6 @@ public:
}
private:
/* Functions */
// loads a model with supported ASSIMP extensions from file and stores the resulting meshes in the meshes vector.
void loadModel(string const &path)
{
@@ -93,7 +91,7 @@ private:
vector<unsigned int> indices;
vector<Texture> textures;
// Walk through each of the mesh's vertices
// walk through each of the mesh's vertices
for(unsigned int i = 0; i < mesh->mNumVertices; i++)
{
Vertex vertex;