#ifndef GEOMETRY_H #include "color.h" #include "engine.h" #include "point.h" #include #include // STRUCTURES struct Material { ColorF32 kAmbient; ColorF32 kDiffuse; }; struct Face { unsigned int vertIndex[3]; Vector normal; ColorF32 color; }; struct Vertex { Point point; Vector normal; ColorF32 color; }; struct Mesh_LocalData { std::vector verts; std::vector faces; }; struct Mesh_TransformedData { std::vector verts; std::vector faces; }; 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; Material material; bool smooth; Mesh_LocalData local; Mesh_TransformedData transformed; }; // PUBLIC FUNCTIONS void CullBackfaces( Mesh_LocalData &local, Mesh_TransformedData &transformed, Point &camPosition); void RenderMesh( Engine_Buffer &buffer, Mesh_TransformedData &mesh, bool smooth); #define GEOMETRY_H #endif