#include "vertex.h"

namespace Vertices
{
	falseIndex::falseIndex(UINT position, UINT texcoord, UINT normal, WORD index)
	{
		_position = position;
		_texcoord = texcoord;
		_normal = normal;
		_index = index;
	}

	bool falseIndex::operator==(const falseIndex& other) const
	{
		return ((_position == other._position) && (_texcoord == other._texcoord) && (_normal == other._normal));
	}

	bool falseIndex::operator<(const falseIndex& other) const
	{
		return (long long int(*this) < long long int(other));
	}

	falseIndex::operator long long int(void) const
	{
		const long long int sizeUINT = (2 << 16 << sizeof(UINT));
		return (((long long int(_position) * sizeUINT) | size_t(_texcoord)) * sizeUINT) | size_t(_normal);
	}

	Position::Position(float x, float y, float z)
	{
		_x  = x;  _y  = y;  _z  = z;
	}

	Normal::Normal(float nx, float ny, float nz)
	{
		_nx = nx; _ny = ny; _nz = nz;
	}

	TexCoord::TexCoord(float u, float v)
	{
		_u  = u;  _v  = v;
	}
}