93 lines
1.1 KiB
C++
93 lines
1.1 KiB
C++
#ifndef GEOMETRY_H
|
|
|
|
#include "color.h"
|
|
#include "point.h"
|
|
#include <cstdint>
|
|
|
|
|
|
// CONSTANTS
|
|
#define FACE_LIMIT (30000)
|
|
#define MATERIAL_LIMIT (5)
|
|
#define TEXTURE_SIZE_LIMIT (1024)
|
|
#define VERTEX_LIMIT (20000)
|
|
|
|
|
|
// STRUCTURES
|
|
struct Texture
|
|
{
|
|
ColorU32 texels[TEXTURE_SIZE_LIMIT][TEXTURE_SIZE_LIMIT];
|
|
unsigned int width;
|
|
unsigned int height;
|
|
};
|
|
|
|
struct TextureList
|
|
{
|
|
Texture data[MATERIAL_LIMIT];
|
|
size_t size;
|
|
};
|
|
|
|
struct Material
|
|
{
|
|
ColorF32 ambient;
|
|
ColorF32 diffuse;
|
|
ColorF32 specular;
|
|
float glossiness;
|
|
float opacity;
|
|
};
|
|
|
|
struct MaterialList
|
|
{
|
|
Material data[MATERIAL_LIMIT];
|
|
size_t size;
|
|
};
|
|
|
|
struct UV
|
|
{
|
|
float u;
|
|
float v;
|
|
};
|
|
|
|
struct UVList
|
|
{
|
|
UV data[VERTEX_LIMIT];
|
|
size_t size;
|
|
};
|
|
|
|
struct Vertex
|
|
{
|
|
Point position;
|
|
Vector normal;
|
|
ColorF32 color;
|
|
};
|
|
|
|
struct VertexList
|
|
{
|
|
Vertex data[VERTEX_LIMIT];
|
|
size_t size;
|
|
};
|
|
|
|
struct Face
|
|
{
|
|
int vertIndex[3];
|
|
int uvIndex[3];
|
|
int materialIndex;
|
|
};
|
|
|
|
struct FaceList
|
|
{
|
|
Face data[FACE_LIMIT];
|
|
size_t size;
|
|
};
|
|
|
|
struct Mesh
|
|
{
|
|
Point position;
|
|
Point rotation;
|
|
float scale;
|
|
};
|
|
|
|
|
|
#define GEOMETRY_H
|
|
#endif
|
|
|