source: GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCSubEntity.h @ 700

Revision 700, 2.6 KB checked in by igarcia, 19 years ago (diff)
Line 
1#ifndef _BBCSUBENTITY_H
2#define _BBCSUBENTITY_H
3
4#include <BBCPrerequisites.h>
5
6namespace BBC {
7
8class _BBCExport UniqueVertex
9{
10public:
11    Ogre::Vector3 position;
12    Ogre::Vector3 normal;
13    Ogre::Vector3 uv[OGRE_MAX_TEXTURE_COORD_SETS];
14    Ogre::RGBA colour;
15    // The index of the next component with the same base details
16    // but with some variation
17    size_t nextIndex;
18
19    UniqueVertex();
20    bool operator==(const UniqueVertex& rhs) const;
21
22};
23
24typedef std::vector<UniqueVertex> UniqueVertexList;
25
26class _BBCExport SubEntity {
27  public:
28
29        typedef std::vector<unsigned short int> TextureCoordSetsDimensions;
30        typedef std::vector<Ogre::Vector3> Indices;
31
32  protected:
33
34        UniqueVertexList mUniqueVertexList;
35
36        TextureCoordSetsDimensions mTextureCoordSetsDimensions;
37       
38        Indices mIndices;
39       
40        bool mHasTangents;
41       
42        bool mHasVertexColours;
43       
44        bool mHasNormals;
45
46        bool mHasTextureCoords;
47
48        Ogre::String mName;
49
50        Ogre::String mMaterialName;
51
52        Ogre::AxisAlignedBox mAABBox;
53       
54  public:
55
56    SubEntity();
57
58    ~SubEntity();
59
60        void enableTangents(bool value);
61       
62        bool hasTangents();
63
64        void enableNormals(bool value);
65
66        bool hasNormals();
67
68        void enableTextureCoords(bool value);
69
70        bool hasVertexColours();
71
72        void enableVertexColours(bool value);
73
74        void setVertexColour(unsigned int index, Ogre::RGBA value);
75
76        Ogre::RGBA getVertexColour(unsigned int index);
77
78        unsigned int getNumTexCoordSets();
79
80        unsigned int getTexCoordDimensions(unsigned int value);
81
82        void addTextureCoordSet(unsigned int numTexCoords);
83
84        unsigned int getNumTexCoords();
85
86        unsigned int getNumVertices();
87
88        void setPosition(unsigned int index, Ogre::Vector3 value);
89
90        Ogre::Vector3 getPosition(unsigned int index);
91
92        void setNormal(unsigned int index, Ogre::Vector3 value);
93
94        Ogre::Vector3 getNormal(unsigned int index);
95
96        void setTexCoord(unsigned int index, unsigned int set, Ogre::Vector3 value);
97
98        Ogre::Vector3 getTexCoord(unsigned int index, unsigned int set, unsigned int value);   
99
100        void addFaceVerticesIDs(Ogre::Vector3 value);
101
102        void removeFaceVerticesIDs(unsigned int value);
103
104        Ogre::Vector3 getFaceVerticesIDs(unsigned int value);
105
106        unsigned int getNumFaces();
107
108        Ogre::String getName();
109
110        void setName(Ogre::String value);
111
112        Ogre::String getMaterialName();
113
114        void setMaterialName(Ogre::String value);
115
116        //void createUniqueVertices();
117
118        UniqueVertexList* getUniqueVertices();
119
120        void addUniqueVertex(UniqueVertex uniqueVertex);
121
122        void removeUniqueVertex(unsigned int index);
123
124        UniqueVertex getUniqueVertex(unsigned int index);
125
126        const Ogre::AxisAlignedBox &getAABBox();
127
128        void setAABBox(Ogre::AxisAlignedBox box);
129
130        void generateAABBox();
131};
132
133}
134#endif
Note: See TracBrowser for help on using the repository browser.