]> git.mxchange.org Git - simgear.git/blob - simgear/scene/sky/dome.hxx
fix a booboo
[simgear.git] / simgear / scene / sky / dome.hxx
1 // dome.hxx -- model sky with an upside down "bowl"
2 //
3 // Written by Curtis Olson, started December 1997.
4 // SSG-ified by Curtis Olson, February 2000.
5 //
6 // Copyright (C) 1997-2000  Curtis L. Olson  - curt@flightgear.org
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // Library General Public License for more details.
17 //
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the
20 // Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 // Boston, MA  02111-1307, USA.
22 //
23 // $Id$
24
25
26 #ifndef _SKYDOME_HXX
27 #define _SKYDOME_HXX
28
29
30 #ifndef __cplusplus                                                          
31 # error This library requires C++
32 #endif                                   
33
34
35 #include <plib/ssg.h>           // plib include
36
37
38 class SGSkyDome {
39     ssgTransform *dome_transform;
40     ssgSimpleState *dome_state;
41
42     ssgVertexArray *center_disk_vl;
43     ssgColourArray *center_disk_cl;
44
45     ssgVertexArray *upper_ring_vl;
46     ssgColourArray *upper_ring_cl;
47
48     ssgVertexArray *middle_ring_vl;
49     ssgColourArray *middle_ring_cl;
50
51     ssgVertexArray *lower_ring_vl;
52     ssgColourArray *lower_ring_cl;
53
54 public:
55
56     // Constructor
57     SGSkyDome( void );
58
59     // Destructor
60     ~SGSkyDome( void );
61
62     // initialize the sky object and connect it into our scene graph
63     // root
64     ssgBranch *build( double hscale = 80000.0, double vscale = 80000.0 );
65
66     // repaint the sky colors based on current value of sun_angle,
67     // sky, and fog colors.  This updates the color arrays for
68     // ssgVtxTable.
69     // sun angle in degrees relative to verticle
70     // 0 degrees = high noon
71     // 90 degrees = sun rise/set
72     // 180 degrees = darkest midnight
73     bool repaint( sgVec3 sky_color, sgVec3 fog_color, double sun_angle,
74                   double vis );
75
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 );
82 };
83
84
85 #endif // _SKYDOME_HXX