added skybox and multitexture feature in .obj
This commit is contained in:
@@ -25,7 +25,7 @@ public:
|
||||
void load(ObjModel *o_result, char *t_fileName, float t_scale);
|
||||
|
||||
private:
|
||||
void setObjDataQuantities(FILE *t_file, ObjModel *t_result);
|
||||
void allocateObjMemory(FILE *t_file, ObjModel *t_result);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,28 +15,35 @@
|
||||
#include <math3d.h>
|
||||
#include "math/vector3.hpp"
|
||||
|
||||
struct ObjMaterial
|
||||
{
|
||||
char *materialName;
|
||||
u32 facesCount;
|
||||
u32 *verticeFaces, *coordinateFaces, *normalFaces;
|
||||
};
|
||||
|
||||
/** Class which have common types for all 3D objects */
|
||||
class ObjModel
|
||||
{
|
||||
|
||||
public:
|
||||
u32 verticesCount, coordinatesCount, normalsCount, facesCount;
|
||||
u32 verticesCount, coordinatesCount, normalsCount, materialsCount;
|
||||
Vector3 *vertices __attribute__((aligned(16))),
|
||||
*coordinates __attribute__((aligned(16))),
|
||||
*normals __attribute__((aligned(16)));
|
||||
u32 *verticeFaces, *coordinateFaces, *normalFaces;
|
||||
|
||||
/** File name without extension */
|
||||
char *filename;
|
||||
ObjMaterial *materials;
|
||||
|
||||
ObjModel(char *t_objFile);
|
||||
~ObjModel();
|
||||
u32 getDrawData(VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, VECTOR *o_colors, Vector3 &t_cameraPos, float t_scale, u8 t_shouldBeBackfaceCulled);
|
||||
void allocateMemory();
|
||||
u32 getDrawData(u32 t_materialIndex, VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, VECTOR *o_colors, Vector3 &t_cameraPos, float t_scale, u8 t_shouldBeBackfaceCulled);
|
||||
u32 getFacesCount();
|
||||
u8 isMemoryAllocated;
|
||||
|
||||
private:
|
||||
void fillNextFace(VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, VECTOR *o_colors, u32 t_getI, u32 t_setI);
|
||||
u8 isMemoryAllocated;
|
||||
void fillNextFace(VECTOR *o_vertices, VECTOR *o_normals, VECTOR *o_coordinates, VECTOR *o_colors, u32 t_materialI, u32 t_getI, u32 t_setI);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user