integrated mesh import class into OpenGL,
Problem with STRP, indices are not logical
This commit is contained in:
@@ -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;
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user