EHS/include/ehs/io/mdl/Vertex.h

50 lines
1.1 KiB
C++

#pragma once
#include "ehs/EHS.h"
#include "ehs/Vec4.h"
#include "ehs/Vec3.h"
#include "ehs/Vec2.h"
#include "ehs/Color4.h"
namespace ehs
{
template<typename T = float>
class Vertex
{
public:
Vec3<T> pos;
Vec3<T> normal;
Vec2<T> uv;
Vec3<T> tan;
Vec3<T> bTan;
Vec4<UInt_8> bones;
Vec4<float> weights;
Vertex() = default;
Vertex(const Vec3<T>& pos)
: pos(pos), bones{0, 0, 0, 0}, weights{0.0f, 0.0f, 0.0f, 0.0f}
{
}
Vertex(const Vec3<T>& pos, const Vec3<T>& normal)
: pos(pos), normal(normal), bones{0, 0, 0, 0}, weights{0.0f, 0.0f, 0.0f, 0.0f}
{
}
Vertex(const Vec3<T>& pos, const Vec3<T>& normal, const Vec2<T>& uv)
: pos(pos), normal(normal), uv(uv), bones{0, 0, 0, 0}, weights{0.0f, 0.0f, 0.0f, 0.0f}
{
}
Vertex(const Vertex& vert)
: pos(vert.pos), normal(vert.normal), uv(vert.uv), bones(vert.bones), weights(vert.weights)
{
}
Vertex& operator=(const Vertex& vert) = default;
};
typedef Vertex<double> Vertex_d;
typedef Vertex<float> Vertex_f;
}