added structs to represent chunk data
This commit is contained in:
parent
0d28d5950b
commit
69e4eee05b
|
@ -90,10 +90,16 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="src\assets\material.h" />
|
<ClInclude Include="src\assets\material.h" />
|
||||||
|
<ClInclude Include="src\chunks\materials.h" />
|
||||||
|
<ClInclude Include="src\chunks\normals.h" />
|
||||||
|
<ClInclude Include="src\chunks\texcoords.h" />
|
||||||
|
<ClInclude Include="src\chunks\triangles.h" />
|
||||||
|
<ClInclude Include="src\chunks\vertices.h" />
|
||||||
<ClInclude Include="src\common.h" />
|
<ClInclude Include="src\common.h" />
|
||||||
<ClInclude Include="src\geometry\common.h" />
|
<ClInclude Include="src\geometry\common.h" />
|
||||||
<ClInclude Include="src\geometry\matrix4x4.h" />
|
<ClInclude Include="src\geometry\matrix4x4.h" />
|
||||||
<ClInclude Include="src\geometry\quaternion.h" />
|
<ClInclude Include="src\geometry\quaternion.h" />
|
||||||
|
<ClInclude Include="src\geometry\triangle.h" />
|
||||||
<ClInclude Include="src\geometry\vector2.h" />
|
<ClInclude Include="src\geometry\vector2.h" />
|
||||||
<ClInclude Include="src\geometry\vector3.h" />
|
<ClInclude Include="src\geometry\vector3.h" />
|
||||||
<ClInclude Include="src\md2\md2.h" />
|
<ClInclude Include="src\md2\md2.h" />
|
||||||
|
|
26
MeshConverter/src/chunks/materials.h
Normal file
26
MeshConverter/src/chunks/materials.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef __CHUNK_MATERIALS_H_INCLUDED__
|
||||||
|
#define __CHUNK_MATERIALS_H_INCLUDED__
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "../assets/material.h"
|
||||||
|
|
||||||
|
struct MaterialsChunk
|
||||||
|
{
|
||||||
|
static const char *ident = "MTL";
|
||||||
|
|
||||||
|
uint32_t count;
|
||||||
|
Material *materials;
|
||||||
|
|
||||||
|
MaterialsChunk()
|
||||||
|
{
|
||||||
|
count = 0;
|
||||||
|
materials = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
~MaterialsChunk()
|
||||||
|
{
|
||||||
|
SAFE_DELETE_ARRAY(materials);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
26
MeshConverter/src/chunks/normals.h
Normal file
26
MeshConverter/src/chunks/normals.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef __CHUNKS_NORMALS_H_INCLUDED__
|
||||||
|
#define __CHUNKS_NORMALS_H_INCLUDED__
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "../geometry/vector3.h"
|
||||||
|
|
||||||
|
struct NormalsChunk
|
||||||
|
{
|
||||||
|
static const char *ident = "NRL";
|
||||||
|
|
||||||
|
uint32_t count;
|
||||||
|
Vector3 *normals;
|
||||||
|
|
||||||
|
NormalsChunk()
|
||||||
|
{
|
||||||
|
count = 0;
|
||||||
|
normals = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
~NormalsChunk()
|
||||||
|
{
|
||||||
|
SAFE_DELETE_ARRAY(normals);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
26
MeshConverter/src/chunks/texcoords.h
Normal file
26
MeshConverter/src/chunks/texcoords.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef __CHUNKS_TEXCOORDS_H_INCLUDED__
|
||||||
|
#define __CHUNKS_TEXCOORDS_H_INCLUDED__
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "../geometry/vector2.h"
|
||||||
|
|
||||||
|
struct TexCoordsChunk
|
||||||
|
{
|
||||||
|
static const char *ident = "TXT";
|
||||||
|
|
||||||
|
uint32_t count;
|
||||||
|
Vector2 *texCoords;
|
||||||
|
|
||||||
|
TexCoordsChunk()
|
||||||
|
{
|
||||||
|
count = 0;
|
||||||
|
texCoords = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
~TexCoordsChunk()
|
||||||
|
{
|
||||||
|
SAFE_DELETE_ARRAY(texCoords);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
26
MeshConverter/src/chunks/triangles.h
Normal file
26
MeshConverter/src/chunks/triangles.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef __CHUNKS_TRIANGLES_H_INCLUDED__
|
||||||
|
#define __CHUNKS_TRIANGLES_H_INCLUDED__
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "../geometry/triangle.h"
|
||||||
|
|
||||||
|
struct TrianglesChunk
|
||||||
|
{
|
||||||
|
static const char *ident = "TRI";
|
||||||
|
|
||||||
|
uint32_t count;
|
||||||
|
Triangle *triangles;
|
||||||
|
|
||||||
|
TrianglesChunk()
|
||||||
|
{
|
||||||
|
count = 0;
|
||||||
|
triangles = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
~TrianglesChunk()
|
||||||
|
{
|
||||||
|
SAFE_DELETE_ARRAY(triangles);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
26
MeshConverter/src/chunks/vertices.h
Normal file
26
MeshConverter/src/chunks/vertices.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef __CHUNKS_VERTICES_H_INCLUDED__
|
||||||
|
#define __CHUNKS_VERTICES_H_INCLUDED__
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
#include "../geometry/vector3.h"
|
||||||
|
|
||||||
|
struct VerticesChunk
|
||||||
|
{
|
||||||
|
static const char *ident = "VTX";
|
||||||
|
|
||||||
|
uint32_t count;
|
||||||
|
Vector3 *vertices;
|
||||||
|
|
||||||
|
VerticesChunk()
|
||||||
|
{
|
||||||
|
count = 0;
|
||||||
|
vertices = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
~VerticesChunk()
|
||||||
|
{
|
||||||
|
SAFE_DELETE_ARRAY(vertices);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
15
MeshConverter/src/geometry/triangle.h
Normal file
15
MeshConverter/src/geometry/triangle.h
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#ifndef __GEOMETRY_TRIANGLE_H_INCLUDED__
|
||||||
|
#define __GEOMETRY_TRIANGLE_H_INCLUDED__
|
||||||
|
|
||||||
|
#include "../common.h"
|
||||||
|
|
||||||
|
class Triangle
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
uint32_t vertices[3];
|
||||||
|
uint32_t normals[3];
|
||||||
|
uint32_t texCoords[3];
|
||||||
|
uint32_t materialIndex;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Reference in a new issue