// Written by Curtis Olson, started June 2000.
//
-// Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
+// Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
#include STL_STRING
SG_USING_STD(string);
+// #include <iostream>
+// SG_USING_STD(cout);
+// SG_USING_STD(endl);
+
/**
* A class layer to model a single cloud layer
* of the cloud layer. The elevation of the top of the layer is
* elevation_m + thickness_m.
* @param elevation_m the layer elevation in meters
+ * @param set_span defines whether it is allowed to adjust the span
*/
- void setElevation_m (float elevation_m);
+ void setElevation_m (float elevation_m, bool set_span = true);
/** get the layer thickness */
float getThickness_m () const;
* set the cloud movement direction
* @param dir the cloud movement direction
*/
- inline void setDirection(float dir) { direction = dir; }
+ inline void setDirection(float dir) {
+ // cout << "cloud dir = " << dir << endl;
+ direction = dir;
+ }
/** get the cloud movement direction */
inline float getDirection() { return direction; }
* set the cloud movement speed
* @param sp the cloud movement speed
*/
- inline void setSpeed(float sp) { speed = sp; }
+ inline void setSpeed(float sp) {
+ // cout << "cloud speed = " << sp << endl;
+ speed = sp;
+ }
/** get the cloud movement speed */
inline float getSpeed() { return speed; }
double dt = 0.0 );
/** draw the cloud layer */
- void draw();
+ void draw( bool top );
+
+ static bool enable_bump_mapping;
private:
+ struct CloudVertex {
+ sgVec3 position;
+ sgVec2 texCoord;
+ sgVec3 tangentSpLight;
+ sgVec3 sTangent;
+ sgVec3 tTangent;
+ sgVec3 normal;
+ sgVec4 color;
+ };
+
+ CloudVertex *vertices;
+ unsigned int *indices;
+
ssgRoot *layer_root;
ssgTransform *layer_transform;
ssgLeaf *layer[4];
+ ssgStateSelector *state_sel;
ssgColourArray *cl[4];
ssgVertexArray *vl[4];
// from winds, and to simulate the clouds being tied to ground
// position, not view position
// double xoff, yoff;
- double last_lon, last_lat;
-
+ double last_lon, last_lat, last_course;
};