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

Revision 13041, 1.7 kB (checked in by robert, 2 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#include "Vertex.h"
21
22using namespace flt;
23
24Vertex::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
35Vertex::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
49void Vertex::setCoord(const osg::Vec3& coord)
50{
51    _coord = coord;
52}
53
54void Vertex::setColor(const osg::Vec4& color)
55{
56    _color = color;
57    _validColor = true;
58}
59
60void Vertex::setNormal(const osg::Vec3& normal)
61{
62    _normal = normal;
63    _validNormal = true;
64}
65
66void 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
Note: See TracBrowser for help on using the browser.