]> git.mxchange.org Git - simgear.git/blob - simgear/sky/dome.hxx
Just a few more visibility tweaks and clean ups.
[simgear.git] / simgear / 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 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.
12 //
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.
17 //
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.
21 //
22 // $Id$
23
24
25 #ifndef _SKYDOME_HXX
26 #define _SKYDOME_HXX
27
28
29 #ifndef __cplusplus                                                          
30 # error This library requires C++
31 #endif                                   
32
33
34 #include <plib/ssg.h>           // plib include
35
36
37 class SGSkyDome {
38     ssgTransform *dome_transform;
39     ssgSimpleState *dome_state;
40
41     ssgVertexArray *center_disk_vl;
42     ssgColourArray *center_disk_cl;
43
44     ssgVertexArray *upper_ring_vl;
45     ssgColourArray *upper_ring_cl;
46
47     ssgVertexArray *middle_ring_vl;
48     ssgColourArray *middle_ring_cl;
49
50     ssgVertexArray *lower_ring_vl;
51     ssgColourArray *lower_ring_cl;
52
53 public:
54
55     // Constructor
56     SGSkyDome( void );
57
58     // Destructor
59     ~SGSkyDome( void );
60
61     // initialize the sky object and connect it into our scene graph
62     // root
63     ssgBranch *build();
64
65     // repaint the sky colors based on current value of sun_angle,
66     // sky, and fog colors.  This updates the color arrays for
67     // ssgVtxTable.
68     // sun angle in degrees relative to verticle
69     // 0 degrees = high noon
70     // 90 degrees = sun rise/set
71     // 180 degrees = darkest midnight
72     bool repaint( sgVec3 sky_color, sgVec3 fog_color, double sun_angle,
73                   double vis );
74
75     // reposition the sky at the specified origin and orientation
76     // lon specifies a rotation about the Z axis
77     // lat specifies a rotation about the new Y axis
78     // spin specifies a rotation about the new Z axis (and orients the
79     // sunrise/set effects
80     bool reposition( sgVec3 p, double lon, double lat, double spin );
81 };
82
83
84 #endif // _SKYDOME_HXX