Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members
CVertex.h
Go to the documentation of this file.00001 #ifndef __cVERTEX_h__ 00002 #define __cVERTEX_h__ 00003 00005 // MarSTD version 2004 - (c)2004 - Marcel Smit // 00006 // // 00007 // [email protected] // 00008 // [email protected] // 00009 // // 00010 // This code may not be used in a commercial product without my // 00011 // permission. If you redistribute it, this message must remain // 00012 // intact. If you use this code, some acknowledgement would be // 00013 // appreciated. ;-) // 00015 00017 00018 00019 00020 #include <vector> 00021 00022 #define VERTEX_TEX_COUNT 2 00023 #define VERTEX_TEX_COMPONENTS 3 00024 00025 //--------------------------------------------------------------------------- 00026 00028 00034 class CVertex 00035 { 00036 00037 public: 00038 00039 CVertex(); 00040 ~CVertex(); 00041 00042 public: 00043 00044 CVector p; 00045 float c[4]; 00046 float t[VERTEX_TEX_COUNT][VERTEX_TEX_COMPONENTS]; 00047 00048 public: 00049 00053 void setColour(float r, float g, float b, float a=1.0); 00057 void setTexCoord(float u, float v, float w=0.0); 00063 void setTexCoord(int texture, float u, float v, float w=0.0); 00064 00065 public: 00066 00067 CVertex interpolateLinear(CVertex& vertex1, CVertex& vertex2, float t); 00068 00069 public: 00070 00074 CVertex& operator=(CVertex vertex); 00080 CVertex operator*(float scale); 00086 CVertex operator+(CVertex vertex); 00087 00088 }; 00089 00090 //--------------------------------------------------------------------------- 00091 00092 typedef std::vector<CVertex> CVertexArray; 00093 typedef CVertexArray::iterator CVertexArrayItr; 00094 00095 typedef std::vector<CVertex*> CPVertexArray; 00096 typedef CPVertexArray::iterator CPVertexArrayItr; 00097 00098 //--------------------------------------------------------------------------- 00099 00100 #endif
Generated on Tue Feb 8 21:59:02 2005 for MarSTDv2004 by
