1 // skydome.hxx -- model sky with an upside down "bowl"
3 // Written by Curtis Olson, started December 1997.
4 // SSG-ified by Curtis Olson, February 2000.
6 // Copyright (C) 1997-2000 Curtis L. Olson - curt@flightgear.org
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 # error This library requires C++
34 #include <plib/ssg.h> // plib include
39 ssgSelector *sky_selector;
40 ssgTransform *sky_transform;
41 ssgSimpleState *sky_state;
43 ssgVertexArray *center_disk_vl;
44 ssgColourArray *center_disk_cl;
46 ssgVertexArray *upper_ring_vl;
47 ssgColourArray *upper_ring_cl;
49 ssgVertexArray *middle_ring_vl;
50 ssgColourArray *middle_ring_cl;
52 ssgVertexArray *lower_ring_vl;
53 ssgColourArray *lower_ring_cl;
63 // initialize the sky object and connect it into the scene graph
64 // as a kid to to the specified root
65 bool initialize( ssgRoot *branch );
67 // repaint the sky colors based on current value of sun_angle,
68 // sky, and fog colors. This updates the color arrays for
70 // sun angle in degrees relative to verticle
71 // 0 degrees = high noon
72 // 90 degrees = sun rise/set
73 // 180 degrees = darkest midnight
74 bool repaint( sgVec3 sky_color, sgVec3 fog_color, double sun_angle );
76 // reposition the sky at the specified origin and orientation
77 // lon specifies a rotation about the Z axis
78 // lat specifies a rotation about the new Y axis
79 // spin specifies a rotation about the new Z axis (and orients the
80 // sunrise/set effects
81 bool reposition( sgVec3 p, double lon, double lat, double spin );
83 // enable the sky in the scene graph (default)
84 void enable() { sky_selector->select( 1 ); }
86 // disable the sky in the scene graph. The leaf node is still
87 // there, how ever it won't be traversed on the cullandrender
89 void disable() { sky_selector->select( 0 ); }
94 extern FGSkyDome current_sky;
97 // (Re)generate the display list
100 // (Re)calculate the sky colors at each vertex
101 // void fgSkyColorsInit();
104 // void fgSkyRender();
107 #endif // _SKYDOM_HXX