]> git.mxchange.org Git - simgear.git/blob - simgear/sky/stars.hxx
Tweaks to follow flightgear STL standard coding procedure.
[simgear.git] / simgear / sky / stars.hxx
1 // stars.hxx -- model the stars
2 //
3 // Written by Durk Talsma. Originally started October 1997, for distribution  
4 // with the FlightGear project. Version 2 was written in August and 
5 // September 1998. This code is based upon algorithms and data kindly 
6 // provided by Mr. Paul Schlyter. (pausch@saaf.se). 
7 //
8 // Separated out rendering pieces and converted to ssg by Curt Olson,
9 // March 2000
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU Library General Public
13 // License as published by the Free Software Foundation; either
14 // version 2 of the License, or (at your option) any later version.
15 //
16 // This library is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 // Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public
22 // License along with this library; if not, write to the
23 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 // Boston, MA  02111-1307, USA.
25 //
26 // $Id$
27
28
29 #ifndef _SG_STARS_HXX_
30 #define _SG_STARS_HXX_
31
32
33 #include <plib/ssg.h>
34
35
36 class SGStars {
37
38     ssgTransform *stars_transform;
39     ssgSimpleState *state;
40
41     ssgColourArray *cl;
42     ssgVertexArray *vl;
43
44 public:
45
46     // Constructor
47     SGStars( void );
48
49     // Destructor
50     ~SGStars( void );
51
52     // initialize the stars structure
53     ssgBranch *build( int num, sgdVec3 *star_data, double star_dist );
54
55     // repaint the planet magnitudes based on current value of
56     // sun_angle in degrees relative to verticle (so we can make them
57     // relatively dimmer during dawn and dusk
58     // 0 degrees = high noon
59     // 90 degrees = sun rise/set
60     // 180 degrees = darkest midnight
61     bool repaint( double sun_angle, int num, sgdVec3 *star_data );
62
63     // reposition the stars for the specified time (GST rotation),
64     // offset by our current position (p) so that it appears fixed at
65     // a great distance from the viewer.
66     bool reposition( sgVec3 p, double angle );
67 };
68
69
70 #endif // _SG_STARS_HXX_