|
Revision 13041, 1.8 kB
(checked in by robert, 14 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #ifndef FLT_VERTEX_H |
|---|
| 21 | #define FLT_VERTEX_H 1 |
|---|
| 22 | |
|---|
| 23 | #include <vector> |
|---|
| 24 | #include <osg/Vec2> |
|---|
| 25 | #include <osg/Vec3> |
|---|
| 26 | #include <osg/Vec4> |
|---|
| 27 | #include <osg/Referenced> |
|---|
| 28 | |
|---|
| 29 | namespace flt { |
|---|
| 30 | |
|---|
| 31 | class Vertex |
|---|
| 32 | { |
|---|
| 33 | public: |
|---|
| 34 | |
|---|
| 35 | Vertex(); |
|---|
| 36 | Vertex(const Vertex& vertex); |
|---|
| 37 | |
|---|
| 38 | void setCoord(const osg::Vec3& coord); |
|---|
| 39 | void setColor(const osg::Vec4& color); |
|---|
| 40 | void setNormal(const osg::Vec3& normal); |
|---|
| 41 | void setUV(int layer, const osg::Vec2& uv); |
|---|
| 42 | |
|---|
| 43 | bool validColor() const { return _validColor; } |
|---|
| 44 | bool validNormal() const { return _validNormal; } |
|---|
| 45 | bool validUV(int layer) const { return layer>=0 && layer<MAX_LAYERS && _validUV[layer]; } |
|---|
| 46 | |
|---|
| 47 | static const int MAX_LAYERS = 8; |
|---|
| 48 | |
|---|
| 49 | osg::Vec3 _coord; |
|---|
| 50 | osg::Vec4 _color; |
|---|
| 51 | osg::Vec3 _normal; |
|---|
| 52 | osg::Vec2 _uv[MAX_LAYERS]; |
|---|
| 53 | |
|---|
| 54 | bool _validColor; |
|---|
| 55 | bool _validNormal; |
|---|
| 56 | bool _validUV[MAX_LAYERS]; |
|---|
| 57 | }; |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | class VertexList : public osg::Referenced , public std::vector<Vertex> |
|---|
| 61 | { |
|---|
| 62 | public: |
|---|
| 63 | |
|---|
| 64 | VertexList() {} |
|---|
| 65 | |
|---|
| 66 | explicit VertexList(int size) : |
|---|
| 67 | std::vector<Vertex>(size) {} |
|---|
| 68 | |
|---|
| 69 | protected: |
|---|
| 70 | |
|---|
| 71 | virtual ~VertexList() {} |
|---|
| 72 | }; |
|---|
| 73 | |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | #endif |
|---|