//////////////////////////////////////////////////////////////////////////////////////////////////
// 
// File: vertex.h
// 
// Author: Frank Luna (C) All Rights Reserved
//
// System: AMD Athlon 1800+ XP, 512 DDR, Geforce 3, Windows XP, MSVC++ 7.0 
//
// Desc: Represents a vertex.
//          
//////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __vertexH__
#define __vertexH__

#include "d3dUtility.h"

namespace Vertices
{
	class falseIndex
	{
	public:
		falseIndex(UINT position = 0, UINT texcoord = 0, UINT normal = 0, WORD index = 0);

		bool operator==(const falseIndex& other) const;
		bool operator<(const falseIndex& other) const;

		operator long long int(void) const;

		UINT _position, _texcoord, _normal;
		WORD _index;
	};

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

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

	class TexCoord
	{
	public:
		TexCoord(float u = 0.0f, float v = 0.0f);
		float _u, _v;
	};

	class Vertex
	{
	public:
		Vertex(
			float x = 0.0f, float y = 0.0f, float z = 0.0f,
			float nx = 0.0f, float ny = 0.0f, float nz = 0.0f,
			float u = 0.0f, float v = 0.0f)
		{
			_x  = x;  _y  = y;  _z  = z;
			_nx = nx; _ny = ny; _nz = nz;
			_u  = u;  _v  = v;
		}
		float _x, _y, _z;
		float _nx, _ny, _nz;
		float _u, _v; // texture coordinates
		
		static const DWORD FVF = (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1);
	};
}

#endif // __vertexH__