|
Revision 13041, 1.7 kB
(checked in by robert, 15 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 | #include "Vertex.h" |
|---|
| 21 | |
|---|
| 22 | using namespace flt; |
|---|
| 23 | |
|---|
| 24 | Vertex::Vertex(): |
|---|
| 25 | _coord(0,0,0), |
|---|
| 26 | _color(1,1,1,1), |
|---|
| 27 | _normal(0,0,1), |
|---|
| 28 | _validColor(false), |
|---|
| 29 | _validNormal(false) |
|---|
| 30 | { |
|---|
| 31 | for (int layer=0; layer<MAX_LAYERS; layer++) |
|---|
| 32 | _validUV[layer] = false; |
|---|
| 33 | } |
|---|
| 34 | |
|---|
| 35 | Vertex::Vertex(const Vertex& vertex): |
|---|
| 36 | _coord(vertex._coord), |
|---|
| 37 | _color(vertex._color), |
|---|
| 38 | _normal(vertex._normal), |
|---|
| 39 | _validColor(vertex._validColor), |
|---|
| 40 | _validNormal(vertex._validNormal) |
|---|
| 41 | { |
|---|
| 42 | for (int layer=0; layer<MAX_LAYERS; layer++) |
|---|
| 43 | { |
|---|
| 44 | _uv[layer] = vertex._uv[layer]; |
|---|
| 45 | _validUV[layer] = vertex._validUV[layer]; |
|---|
| 46 | } |
|---|
| 47 | } |
|---|
| 48 | |
|---|
| 49 | void Vertex::setCoord(const osg::Vec3& coord) |
|---|
| 50 | { |
|---|
| 51 | _coord = coord; |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | void Vertex::setColor(const osg::Vec4& color) |
|---|
| 55 | { |
|---|
| 56 | _color = color; |
|---|
| 57 | _validColor = true; |
|---|
| 58 | } |
|---|
| 59 | |
|---|
| 60 | void Vertex::setNormal(const osg::Vec3& normal) |
|---|
| 61 | { |
|---|
| 62 | _normal = normal; |
|---|
| 63 | _validNormal = true; |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | void Vertex::setUV(int layer, const osg::Vec2& uv) |
|---|
| 67 | { |
|---|
| 68 | if (layer>=0 && layer<MAX_LAYERS) |
|---|
| 69 | { |
|---|
| 70 | _uv[layer] = uv; |
|---|
| 71 | _validUV[layer] = true; |
|---|
| 72 | } |
|---|
| 73 | } |
|---|
| 74 | |
|---|