// Copyright (C) 2002-2006 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #pragma once #include "Vector3D.h" #include "Vector2D.h" #include "Color.h" namespace Irrlicht { namespace Video { /// /// Enumeration for all vertex types there are. /// public __value enum VertexType { /// Standard vertex type used by the Irrlicht engine. STANDARD = 0, /// Vertex with two texture coordinates. Usually used for geometry with lightmaps /// or other special materials. TWOTCOORDS }; /// /// Standard vertex used by the Irrlicht engine. Its size is 36 bytes. /// /// public __value class Vertex3D { public: /// /// default constructor /// Vertex3D() {}; /// /// constructor /// Vertex3D(float x, float y, float z, float nx, float ny, float nz, Color c, float tu, float tv) : Pos(x,y,z), Normal(nx,ny,nz), Color(c), TCoords(tu,tv) {} /// /// constructor /// Vertex3D(Core::Vector3D pos, Core::Vector3D normal, Video::Color color, Core::Vector2D tcoords) : Pos(pos), Normal(normal), Color(color), TCoords(tcoords) {} /// /// Position /// Core::Vector3D Pos; /// /// Normal vector /// Core::Vector3D Normal; /// /// Color /// Video::Color Color; /// /// Texture coordinates /// Core::Vector2D TCoords; /// /// Compares the vertex to another vertex. /// bool Equals(Object* rhs) { Vertex3D* c = dynamic_cast(rhs); if(!c) return false; return c->Pos == Pos && c->Normal == Normal && c->Color == Color && c->TCoords == TCoords; } }; /// /// Vertex with two texture coordinates. /// /// public __value class Vertex3D2Tex { public: /// /// default constructor /// Vertex3D2Tex() {}; /// /// constructor /// Vertex3D2Tex(float x, float y, float z, float nx, float ny, float nz, Color c, float tu, float tv) : Pos(x,y,z), Normal(nx,ny,nz), Color(c), TCoords(tu,tv) {} /// /// constructor /// Vertex3D2Tex(Core::Vector3D pos, Core::Vector3D normal, Video::Color color, Core::Vector2D tcoords) : Pos(pos), Normal(normal), Color(color), TCoords(tcoords) {} /// /// Position /// Core::Vector3D Pos; /// /// Normal vector /// Core::Vector3D Normal; /// /// Color /// Video::Color Color; /// /// First set of texture coordinates /// Core::Vector2D TCoords; /// /// Second set of texture coordinates /// Core::Vector2D TCoords2; /// /// Compares the vertex to another vertex. /// bool Equals(Object* rhs) { Vertex3D2Tex* c = dynamic_cast(rhs); if(!c) return false; return c->Pos == Pos && c->Normal == Normal && c->Color == Color && c->TCoords == TCoords && c->TCoords2 == TCoords; } }; } }