remove normal and texcoord data from Triangle
This commit is contained in:
parent
d89072b3d5
commit
cc6fb19f4c
|
@ -109,18 +109,6 @@ void WriteChunk(TrianglesChunk *chunk, FILE *fp)
|
||||||
fwrite(&triangle->vertices[2], sizeof(uint32_t), 1, fp);
|
fwrite(&triangle->vertices[2], sizeof(uint32_t), 1, fp);
|
||||||
|
|
||||||
fwrite(&triangle->groupIndex, sizeof(uint32_t), 1, fp);
|
fwrite(&triangle->groupIndex, sizeof(uint32_t), 1, fp);
|
||||||
|
|
||||||
for (int j = 0; j < 3; ++j)
|
|
||||||
{
|
|
||||||
fwrite(&triangle->normals[j].x, sizeof(float), 1, fp);
|
|
||||||
fwrite(&triangle->normals[j].y, sizeof(float), 1, fp);
|
|
||||||
fwrite(&triangle->normals[j].z, sizeof(float), 1, fp);
|
|
||||||
}
|
|
||||||
for (int j = 0; j < 3; ++j)
|
|
||||||
{
|
|
||||||
fwrite(&triangle->texCoords[j].x, sizeof(float), 1, fp);
|
|
||||||
fwrite(&triangle->texCoords[j].y, sizeof(float), 1, fp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,11 @@
|
||||||
#define __GEOMETRY_TRIANGLE_H_INCLUDED__
|
#define __GEOMETRY_TRIANGLE_H_INCLUDED__
|
||||||
|
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
#include "vector2.h"
|
|
||||||
#include "vector3.h"
|
|
||||||
|
|
||||||
struct Triangle
|
struct Triangle
|
||||||
{
|
{
|
||||||
uint32_t vertices[3];
|
uint32_t vertices[3];
|
||||||
uint32_t groupIndex;
|
uint32_t groupIndex;
|
||||||
Vector3 normals[3];
|
|
||||||
Vector2 texCoords[3];
|
|
||||||
|
|
||||||
uint32_t GetSize() const;
|
uint32_t GetSize() const;
|
||||||
};
|
};
|
||||||
|
@ -21,8 +17,6 @@ inline uint32_t Triangle::GetSize() const
|
||||||
|
|
||||||
size += sizeof(uint32_t) * 3; // vertices (index)
|
size += sizeof(uint32_t) * 3; // vertices (index)
|
||||||
size += sizeof(uint32_t); // group index
|
size += sizeof(uint32_t); // group index
|
||||||
size += (sizeof(float) * 3) * 3; // normals (xyz)
|
|
||||||
size += (sizeof(float) * 2) * 3; // texcoords (uv)
|
|
||||||
|
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue