gba-bitmap-engine/engine/include/libgba-bitmap-engine/vertex.h

28 lines
889 B
C
Raw Normal View History

2020-07-15 10:52:13 +02:00
//
// Created by Wouter Groeneveld on 15/07/20.
//
#ifndef GBA_BITMAP_ENGINE_PROJECT_VERTEX_H
#define GBA_BITMAP_ENGINE_PROJECT_VERTEX_H
2020-07-15 12:03:50 +02:00
#include <libgba-bitmap-engine/vectorfx.h>
2020-07-15 10:52:13 +02:00
class Vertex {
private:
2020-07-15 12:03:50 +02:00
VectorFx coordinates;
VectorFx norm;
2020-07-16 16:14:46 +02:00
FIXED tU, tV;
2020-07-15 12:03:50 +02:00
public:
2020-07-16 16:14:46 +02:00
Vertex(const VectorFx& coord) : coordinates(coord), norm(VectorFx()), tU(0), tV(0) {}
Vertex(const VectorFx& coord, const VectorFx& theNorm) : coordinates(coord), norm(theNorm), tU(0), tV(0) {}
Vertex(const VectorFx& coord, const VectorFx& theNorm, float theU, float theV) : coordinates(coord), norm(theNorm), tU(float2fx(theU)), tV(float2fx(theV)) {}
2020-07-15 12:03:50 +02:00
inline const VectorFx& coords() const { return coordinates; }
inline const VectorFx& normal() const { return norm; }
2020-07-16 16:14:46 +02:00
inline FIXED u() { return tU; }
inline FIXED v() { return tV; }
2020-07-15 10:52:13 +02:00
};
#endif //GBA_BITMAP_ENGINE_PROJECT_VERTEX_H