quick backup of the renderer - things missing
[demo] / src / scene.cc
index 2dc20bc..c640847 100644 (file)
@@ -100,7 +100,7 @@ static void create_object(aiNode *node, Mat4 parent_transform, Scene *scene, con
           The 99% of the scenes have 1 mesh per node => for simplicity we only check the 1st one.
           Also: the 3D models we are going to use for this demo, have flat structure (no hierarchy)
           but just in case we need to replace them later, we calculate the transform by assuming that we
-          have a node hierarchy. This => that each object's modelling transformation is the 
+          have a node hierarchy. This => that each object's modelling transformation is the
           product of its local transformation (mTransformation) with the acc parent nodes transformations
           (parent_transform)
        */
@@ -145,12 +145,10 @@ static Mesh *load_mesh(const aiScene *scene, unsigned int index)
        }
 
        mesh->name = std::string(amesh->mName.data);
-       mesh->which_mask = 0;
 
        for(unsigned int i=0; i<amesh->mNumVertices; ++i) {
                /* vertices */
                if(amesh->HasPositions()) {
-                       mesh->which_mask |= MESH_VERTEX;
                        Vec3 vertex = Vec3(amesh->mVertices[i].x, amesh->mVertices[i].y,
                                           amesh->mVertices[i].z);
 
@@ -164,7 +162,6 @@ static Mesh *load_mesh(const aiScene *scene, unsigned int index)
 
                /* normals */
                if(amesh->HasNormals()) {
-                       mesh->which_mask |= MESH_NORMAL;
                        Vec3 normal = Vec3(amesh->mNormals[i].x, amesh->mNormals[i].y,
                                           amesh->mNormals[i].z);
                        mesh->normals.push_back(normal);
@@ -177,7 +174,6 @@ static Mesh *load_mesh(const aiScene *scene, unsigned int index)
 
                /* texture coordinates */
                if(amesh->mTextureCoords[0]) {
-                       mesh->which_mask |= MESH_TEXTURE;
                        Vec2 tex_coord = Vec2(amesh->mTextureCoords[0][i].x, amesh->mTextureCoords[0][i].y);
                        mesh->tex_coords.push_back(tex_coord);
                }
@@ -186,19 +182,18 @@ static Mesh *load_mesh(const aiScene *scene, unsigned int index)
                }
 
                /* tangents */
-               if(amesh->mTangents) {
-                       mesh->which_mask |= MESH_TANGENT;
-                       Vec3 tangent = Vec3(amesh->mTangents[i].x, amesh->mTangents[i].y,
-                                           amesh->mTangents[i].z);
-                       mesh->tangents.push_back(tangent);
-               }
-               else {
-                       mesh->tangents.push_back(Vec3(1, 0, 0));
-               }
+               // if(amesh->mTangents) {
+               //      mesh->which_mask |= MESH_TANGENT;
+               //      Vec3 tangent = Vec3(amesh->mTangents[i].x, amesh->mTangents[i].y,
+               //                          amesh->mTangents[i].z);
+               //      mesh->tangents.push_back(tangent);
+               // }
+               // else {
+               //      mesh->tangents.push_back(Vec3(1, 0, 0));
+               // }
        }
        /* indices (called faces in assimp) */
        if(amesh->HasFaces()) {
-               mesh->which_mask |= MESH_INDEX;
                for(unsigned int i=0; i<amesh->mNumFaces; ++i) {
                        mesh->indices.push_back(amesh->mFaces[i].mIndices[0]);
                        mesh->indices.push_back(amesh->mFaces[i].mIndices[1]);