49 lines
750 B
C++
49 lines
750 B
C++
#ifndef GEOMETRY_H
|
|
|
|
#include "point.h"
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
|
|
// STRUCTURES
|
|
struct Face
|
|
{
|
|
unsigned int vertIndex[3];
|
|
};
|
|
|
|
struct Mesh
|
|
{
|
|
inline Mesh(void)
|
|
{
|
|
position.x = 0.0f;
|
|
position.y = 0.0f;
|
|
position.z = 0.0f;
|
|
|
|
rotation[0] = 0.0f;
|
|
rotation[1] = 0.0f;
|
|
rotation[2] = 0.0f;
|
|
|
|
scale = 1.0f;
|
|
}
|
|
|
|
Point position;
|
|
float rotation[3];
|
|
float scale;
|
|
std::vector<Point> verts;
|
|
std::vector<Point> vertsTransformed;
|
|
std::vector<Face> faces;
|
|
};
|
|
|
|
|
|
// PUBLIC FUNCTIONS
|
|
void FillTriangle(
|
|
uint32_t *buffer, int width, uint32_t color,
|
|
float x0, float y0,
|
|
float x1, float y1,
|
|
float x2, float y2);
|
|
|
|
|
|
#define GEOMETRY_H
|
|
#endif
|
|
|