added animation support to obj

This commit is contained in:
Sandro Sobczyński
2020-10-28 20:42:17 +01:00
parent abda2fe3fa
commit 9e00ef3634
12 changed files with 242 additions and 119 deletions
+3 -3
View File
@@ -30,7 +30,7 @@ ObjLoader::~ObjLoader() {}
* Notice: At this moment textures names are MATERIAL names from .obj file!
* Notice 2: Faces MUST be triangulated (check out blender export settings).
*/
void ObjLoader::load(ObjModel *o_result, char *t_filename, float t_scale)
void ObjLoader::load(Frame *o_result, char *t_filename, float t_scale)
{
FILE *file = fopen(t_filename, "rb");
if (file == NULL)
@@ -102,7 +102,7 @@ void ObjLoader::load(ObjModel *o_result, char *t_filename, float t_scale)
}
/** Calculate how many vertices(v), coordinates(vt), normals(vn) and faces(f) have .obj file */
void ObjLoader::allocateObjMemory(FILE *t_file, ObjModel *o_result)
void ObjLoader::allocateObjMemory(FILE *t_file, Frame *o_result)
{
o_result->verticesCount = 0;
o_result->coordinatesCount = 0;
@@ -157,5 +157,5 @@ void ObjLoader::allocateObjMemory(FILE *t_file, ObjModel *o_result)
o_result->vertices = new Vector3[o_result->verticesCount];
o_result->coordinates = new Vector3[o_result->coordinatesCount];
o_result->normals = new Vector3[o_result->normalsCount];
o_result->isMemoryAllocated = true;
// o_result->isMemoryAllocated = true;
}