]> git.mxchange.org Git - simgear.git/blob - simgear/misc/texcoord.hxx
Removal of PLIB/SG from SimGear
[simgear.git] / simgear / misc / texcoord.hxx
1 /**
2  * \file texcoord.hxx
3  * Routine to handle texture coordinate generation.
4  */
5
6 // Written by Curtis Olson, started March 1999.
7 //
8 // Copyright (C) 1999  Curtis L. Olson  - http://www.flightgear.org/~curt
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Library General Public
12 // License as published by the Free Software Foundation; either
13 // version 2 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 // Library General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with this program; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
23 //
24 // $Id$
25
26
27 #ifndef _TEXCOORD_HXX
28 #define _TEXCOORD_HXX
29
30
31 #ifndef __cplusplus
32 # error This library requires C++
33 #endif
34
35
36 #include <simgear/bucket/newbucket.hxx>
37 #include <simgear/math/sg_types.hxx>
38
39 #include <simgear/math/SGMathFwd.hxx>
40 #include <simgear/math/SGGeod.hxx>
41 #include <simgear/math/SGVec2.hxx>
42
43 /**
44  * Traverse the specified fan/strip/list of vertices and attempt to
45  * calculate "none stretching" texture coordinates.
46  * @param b the bucket containing the structure
47  * @param geod_nodes vertices in geodetic coordinates
48  * @param fan integer list of indices pointing into the vertex list
49  * @param scale (default = 1.0) scaling factor
50  * @return list of texture coordinates
51  */
52 std::vector<SGVec2f> sgCalcTexCoords( const SGBucket& b, const std::vector<SGGeod>& geod_nodes,
53                             const int_list& fan, double scale = 1.0 );
54
55 std::vector<SGVec2f> sgCalcTexCoords( double centerLat, const std::vector<SGGeod>& geod_nodes,
56                             const int_list& fan, double scale = 1.0 );
57
58
59 #endif // _TEXCOORD_HXX