integrated mesh import class into OpenGL,

Problem with STRP, indices are not logical
This commit is contained in:
Anakin
2016-10-16 12:33:25 +02:00
parent b2f174d15f
commit 9700638548
4 changed files with 147 additions and 44 deletions

View File

@@ -3,6 +3,7 @@
#include <list>
#include <fstream>
#include <string>
#include <gl\glew.h>
enum Mtyp {
null,
@@ -23,7 +24,6 @@ struct Modl {
std::string name;
std::string parent;
Mtyp type;
std::uint32_t zeroBaseIndex;
std::uint32_t renderFlags;
struct {
float scale[3];
@@ -36,6 +36,11 @@ struct Modl {
float data2;
float data3;
} swci;
std::string texture;
float* vertex;
float* uv;
std::uint32_t meshSize;
std::uint32_t* mesh;
};
@@ -53,12 +58,19 @@ private:
private:
void setModlDefault(Modl* model);
void loadChunks(std::list<ChunkHeader*> &destination, std::streampos start, const std::uint32_t end);
void analyseModlChunks(Modl* dataDestination, std::list<ChunkHeader*> &chunkList);
void analyseGeomChunks(Modl* dataDestination, std::list<ChunkHeader*> &chunkList);
void analyseSegmChunks(Modl* dataDestination, std::list<ChunkHeader*> &chunkList);
void analyseClthChunks(Modl* dataDestination, std::list<ChunkHeader*> &chunkList);
void readVertex(Modl* dataDestination, std::streampos position);
void readUV(Modl* dataDestination, std::streampos position);
void readMesh(Modl* dataDestination, std::streampos position);
public:
std::vector<GLfloat> getVertex() const;
std::vector<GLfloat> getUV() const;
};