1 // stars.hxx -- model the stars
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).
8 // Separated out rendering pieces and converted to ssg by Curt Olson,
11 // This program is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU General Public License as
13 // published by the Free Software Foundation; either version 2 of the
14 // License, or (at your option) any later version.
16 // This program is distributed in the hope that it will be useful, but
17 // WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 // General Public License for more details.
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #ifndef _SG_STARS_HXX_
29 #define _SG_STARS_HXX_
37 ssgTransform *stars_transform;
38 ssgSimpleState *state;
51 // initialize the stars structure
52 ssgBranch *build( int num, sgdVec3 *star_data, double star_dist );
54 // repaint the planet magnitudes based on current value of
55 // sun_angle in degrees relative to verticle (so we can make them
56 // relatively dimmer during dawn and dusk
57 // 0 degrees = high noon
58 // 90 degrees = sun rise/set
59 // 180 degrees = darkest midnight
60 bool repaint( double sun_angle, int num, sgdVec3 *star_data );
62 // reposition the stars for the specified time (GST rotation),
63 // offset by our current position (p) so that it appears fixed at
64 // a great distance from the viewer.
65 bool reposition( sgVec3 p, double angle );
69 #endif // _SG_STARS_HXX_