1 // scenery.hxx -- data structures and routines for managing scenery.
3 // Written by Curtis Olson, started May 1997.
5 // Copyright (C) 1997 Curtis L. Olson - curt@infoplane.com
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 # error This library requires C++
35 #include <simgear/structure/subsystem_mgr.hxx>
36 #include <simgear/math/point3d.hxx>
43 // Define a structure containing global scenery parameters
44 class FGScenery : public SGSubsystem {
45 // center of current scenery chunk
48 // next center of current scenery chunk
51 // angle of sun relative to current local horizontal
54 // elevation of terrain at our current lat/lon (based on the
55 // actual drawn polygons)
58 // the distance (radius) from the center of the earth to the
59 // current scenery elevation point
62 // unit normal at point used to determine current elevation
67 ssgBranch *terrain_branch;
68 ssgRoot *gnd_lights_root;
69 ssgRoot *vasi_lights_root;
70 ssgRoot *rwy_lights_root;
71 ssgRoot *taxi_lights_root;
72 ssgBranch *models_branch;
73 ssgBranch *aircraft_branch;
80 // Implementation of SGSubsystem.
84 void update (double dt);
86 inline double get_cur_elev() const { return cur_elev; }
87 inline void set_cur_elev( double e ) { cur_elev = e; }
89 inline Point3D get_center() const { return center; }
90 inline void set_center( Point3D p ) { center = p; }
92 inline Point3D get_next_center() const { return next_center; }
93 inline void set_next_center( Point3D p ) { next_center = p; }
95 inline void set_cur_radius( double r ) { cur_radius = r; }
96 inline void set_cur_normal( sgdVec3 n ) { sgdCopyVec3( cur_normal, n ); }
98 inline ssgRoot *get_scene_graph () const { return scene_graph; }
99 inline void set_scene_graph (ssgRoot * s) { scene_graph = s; }
101 inline ssgBranch *get_terrain_branch () const { return terrain_branch; }
102 inline void set_terrain_branch (ssgBranch * t) { terrain_branch = t; }
104 inline ssgRoot *get_gnd_lights_root () const {
105 return gnd_lights_root;
107 inline void set_gnd_lights_root (ssgRoot *r) {
111 inline ssgRoot *get_vasi_lights_root () const {
112 return vasi_lights_root;
114 inline void set_vasi_lights_root (ssgRoot *r) {
115 vasi_lights_root = r;
118 inline ssgRoot *get_rwy_lights_root () const {
119 return rwy_lights_root;
121 inline void set_rwy_lights_root (ssgRoot *r) {
125 inline ssgRoot *get_taxi_lights_root () const {
126 return taxi_lights_root;
128 inline void set_taxi_lights_root (ssgRoot *r) {
129 taxi_lights_root = r;
132 inline ssgBranch *get_models_branch () const {
133 return models_branch;
135 inline void set_models_branch (ssgBranch *t) {
139 inline ssgBranch *get_aircraft_branch () const {
140 return aircraft_branch;
142 inline void set_aircraft_branch (ssgBranch *t) {
148 #endif // _SCENERY_HXX