Rev | Line | |
---|
[774] | 1 | #ifndef __GEO_VERTEX_BUFFER__
|
---|
| 2 | #define __GEO_VERTEX_BUFFER__
|
---|
| 3 |
|
---|
| 4 | #include "GeoBase.h"
|
---|
| 5 | #include "GeoVector3.h"
|
---|
| 6 | #include "GeoVector2.h"
|
---|
| 7 | #include "GeoSerializable.h"
|
---|
| 8 |
|
---|
| 9 |
|
---|
[1009] | 10 | namespace Geometry
|
---|
| 11 | {
|
---|
[774] | 12 | /// VertexBuffer interface Class
|
---|
| 13 | /**
|
---|
| 14 | * This Structure holds the vertex information used by Meshes and SubMesehs.
|
---|
| 15 | */
|
---|
| 16 | class VertexBuffer : public Serializable
|
---|
| 17 | {
|
---|
| 18 | public:
|
---|
| 19 |
|
---|
| 20 | /// Default Constructor
|
---|
| 21 | inline VertexBuffer():
|
---|
| 22 | mVertexInfo(VERTEX_EMPTY),
|
---|
| 23 | mVertexCount(0),
|
---|
| 24 | mPosition(0),
|
---|
| 25 | mNormal(0),
|
---|
| 26 | mTexCoords(0)
|
---|
| 27 | {
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | /// Default destructor, releases allocated memory.
|
---|
| 31 | ~VertexBuffer();
|
---|
| 32 |
|
---|
| 33 | /// Returns a new VertexBuffer with the same data.
|
---|
| 34 | VertexBuffer* Clone() const;
|
---|
| 35 |
|
---|
| 36 | /// Fills this VertexBuffer from a Serializer
|
---|
| 37 | void Load(Serializer &s);
|
---|
| 38 |
|
---|
| 39 | /// Stores data
|
---|
| 40 | void Save(Serializer &s);
|
---|
| 41 |
|
---|
[1009] | 42 | unsigned int mVertexInfo; ///< Type of info stored by vertex
|
---|
[774] | 43 | size_t mVertexCount; ///< Number of vertices
|
---|
[1009] | 44 |
|
---|
| 45 | /// Position array of each Vertex, only valid if (vertexInfo & VERTEX_POSITON) == true
|
---|
| 46 | Vector3 *mPosition;
|
---|
| 47 |
|
---|
[774] | 48 | Vector3 *mNormal; ///< Normal array of each Vertex, only valid if (vertexInfo & VERTEX_NORMAL) == true
|
---|
| 49 | Vector2 *mTexCoords;///< Texture Coordinates array of each Vertex, only valid if (vertexInfo & VERTEX_TEXCOORDS) == true
|
---|
| 50 | };
|
---|
| 51 |
|
---|
| 52 | } // end of Geometry namespace;
|
---|
| 53 |
|
---|
| 54 | #endif
|
---|
[1009] | 55 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.