bool visible;
};
- float Rnd(float);
+ float Rnd(float);
// Radius of the LoD nodes for the dynamic quadtrees.
static float RADIUS_LEVEL_1;
// this is a relative position only, with that we can move all clouds at once
SGVec3f relative_position;
- osg::ref_ptr<osg::Group> field_root;
+ osg::ref_ptr<osg::Group> field_root;
osg::ref_ptr<osg::Group> placed_root;
osg::ref_ptr<osg::PositionAttitudeTransform> field_transform;
- osg::ref_ptr<osg::PositionAttitudeTransform> altitude_transform;
- osg::ref_ptr<osg::LOD> field_lod;
+ osg::ref_ptr<osg::PositionAttitudeTransform> altitude_transform;
+ osg::ref_ptr<osg::LOD> field_lod;
osg::Vec3f old_pos;
CloudHash cloud_hash;
- struct CloudFog : public simgear::Singleton<CloudFog>
- {
- CloudFog();
- osg::ref_ptr<osg::Fog> fog;
- };
+ struct CloudFog : public simgear::Singleton<CloudFog>
+ {
+ CloudFog();
+ osg::ref_ptr<osg::Fog> fog;
+ };
void removeCloudFromTree(osg::ref_ptr<osg::PositionAttitudeTransform> transform);
void addCloudToTree(osg::ref_ptr<osg::PositionAttitudeTransform> transform, float lon, float lat, float alt, float x, float y);
+ void addCloudToTree(osg::ref_ptr<osg::PositionAttitudeTransform> transform, SGGeod loc, float x, float y);
+ void addCloudToTree(osg::ref_ptr<osg::PositionAttitudeTransform> transform, SGGeod loc);
void applyVisRangeAndCoverage(void);
public:
/**
- * reposition the cloud layer at the specified origin and
- * orientation.
- * @param p position vector
- * @param up the local up vector
- * @param lon specifies a rotation about the Z axis
- * @param lat specifies a rotation about the new Y axis
- * @param dt the time elapsed since the last call
- * @param asl altitude of the layer
- * @param speed of cloud layer movement (due to wind)
- * @param direction of cloud layer movement (due to wind)
- */
- bool reposition( const SGVec3f& p, const SGVec3f& up,
- double lon, double lat, double dt, int asl, float speed, float direction);
-
- osg::Group* getNode() { return field_root.get(); }
-
- // visibility distance for clouds in meters
- static float CloudVis;
-
- static SGVec3f view_vec, view_X, view_Y;
-
- static float view_distance;
- static double timer_dt;
- static float fieldSize;
- static bool wrap;
-
- static float getVisRange(void) { return view_distance; }
- static void setVisRange(float d) { view_distance = d; }
- void applyVisRange(void);
-
- static osg::Fog* getFog()
- {
- return CloudFog::instance()->fog.get();
- }
- static void updateFog(double visibility, const osg::Vec4f& color);
+ * reposition the cloud layer at the specified origin and
+ * orientation.
+ * @param p position vector
+ * @param up the local up vector
+ * @param lon specifies a rotation about the Z axis
+ * @param lat specifies a rotation about the new Y axis
+ * @param dt the time elapsed since the last call
+ * @param asl altitude of the layer
+ * @param speed of cloud layer movement (due to wind)
+ * @param direction of cloud layer movement (due to wind)
+ */
+ bool reposition( const SGVec3f& p, const SGVec3f& up,
+ double lon, double lat, double dt, int asl, float speed, float direction);
+
+ osg::Group* getNode() { return field_root.get(); }
+
+ // visibility distance for clouds in meters
+ static float CloudVis;
+
+ static SGVec3f view_vec, view_X, view_Y;
+
+ static float view_distance;
+ static double timer_dt;
+ static float fieldSize;
+ static bool wrap;
+
+ static bool getWrap(void) { return wrap; }
+ static void setWrap(bool w) { wrap = w; }
+
+ static float getVisRange(void) { return view_distance; }
+ static void setVisRange(float d) { view_distance = d; }
+ void applyVisRange(void);
+
+ static osg::Fog* getFog()
+ {
+ return CloudFog::instance()->fog.get();
+ }
+ static void updateFog(double visibility, const osg::Vec4f& color);
};
#endif // _CLOUDFIELD_HXX