root/OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/Vertex.h @ 13041

Revision 13041, 1.8 kB (checked in by robert, 3 years 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/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14//
15// OpenFlight® loader for OpenSceneGraph
16//
17//  Copyright (C) 2005-2007  Brede Johansen
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
29namespace flt {
30
31class Vertex
32{
33public:
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
60class VertexList : public osg::Referenced , public std::vector<Vertex>
61{
62public:
63
64    VertexList() {}
65
66    explicit VertexList(int size) :
67        std::vector<Vertex>(size) {}
68
69protected:
70
71    virtual ~VertexList() {}
72};
73
74} // end namespace
75
76#endif
Note: See TracBrowser for help on using the browser.