From: Stuart Buchanan Date: Sun, 7 Aug 2011 10:41:25 +0000 (+0100) Subject: Add control of 3D cloud field wrapping. Base code was already present, but without... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=410c5ae919a1f2966fef4d10621f450f03967668;p=simgear.git Add control of 3D cloud field wrapping. Base code was already present, but without accessor methods. --- diff --git a/simgear/scene/sky/cloudfield.hxx b/simgear/scene/sky/cloudfield.hxx index ae7ce12a..77f504b6 100644 --- a/simgear/scene/sky/cloudfield.hxx +++ b/simgear/scene/sky/cloudfield.hxx @@ -130,23 +130,26 @@ public: * @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) + * @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; + // visibility distance for clouds in meters + static float CloudVis; - static SGVec3f view_vec, view_X, view_Y; + static SGVec3f view_vec, view_X, view_Y; static float view_distance; static double timer_dt; - static float fieldSize; - static bool wrap; + 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; } diff --git a/simgear/scene/sky/sky.cxx b/simgear/scene/sky/sky.cxx index e21adaa3..f22a9a6a 100644 --- a/simgear/scene/sky/sky.cxx +++ b/simgear/scene/sky/sky.cxx @@ -237,6 +237,16 @@ void SGSky::set_3dCloudVisRange(float vis) } } +bool SGSky::get_3dCloudWrap() const { + return SGCloudField::getWrap(); +} + +void SGSky::set_3dCloudWrap(bool wrap) +{ + SGCloudField::setWrap(wrap); +} + + void SGSky::texture_path( const string& path ) { tex_path = SGPath( path ); } diff --git a/simgear/scene/sky/sky.hxx b/simgear/scene/sky/sky.hxx index 28678041..33673ca6 100644 --- a/simgear/scene/sky/sky.hxx +++ b/simgear/scene/sky/sky.hxx @@ -440,6 +440,15 @@ public: */ virtual void set_3dCloudVisRange(float vis); + /** Get 3D cloud wrapping */ + virtual bool get_3dCloudWrap() const; + + /** Set 3D cloud wrapping + * @param wrap whether to wrap 3D clouds + */ + virtual void set_3dCloudWrap(bool wrap); + + };