X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fsky%2Fcloudfield.hxx;h=5016c6329f3bba01622d770249757aa84cae695b;hb=ccbc5abec63e508261b6d4bdbd5b1f780d233fc8;hp=39b0e00118455af317b80c694fe83d3c86f82dae;hpb=b5e03030d1d9549104a936242f602a9a27198d01;p=simgear.git diff --git a/simgear/scene/sky/cloudfield.hxx b/simgear/scene/sky/cloudfield.hxx index 39b0e001..5016c632 100644 --- a/simgear/scene/sky/cloudfield.hxx +++ b/simgear/scene/sky/cloudfield.hxx @@ -16,7 +16,7 @@ // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // @@ -37,12 +37,17 @@ public: SGNewCloud *aCloud; sgVec3 eyePos; float dist; + float heading; + float alt; bool operator<(const culledCloud &b) const { return (this->dist < b.dist); } }; typedef vector list_of_culledCloud; +/** + * A layer of 3D clouds. + */ class SGCloudField { private: @@ -50,12 +55,7 @@ private: public: SGNewCloud *aCloud; sgVec3 pos; -// float dist; -// bool culled; - -// bool operator<(const Cloud &b) { -// return this->dist < b.dist; -// } + bool visible; }; @@ -64,6 +64,8 @@ private: // cull all clouds of a tiled field void cullClouds(sgVec3 eyePos, sgMat4 mat); + void applyDensity(void); + list_of_Cloud theField; // this is a relative position only, with that we can move all clouds at once sgVec3 relative_position; @@ -73,12 +75,18 @@ private: sgMat4 transform; double deltax, deltay, alt; + double last_lon, last_lat, last_course; + sgSphere field_sphere; + float last_density; + bool draw_in_3d; public: SGCloudField(); ~SGCloudField(); + void clear(void); + // add one cloud, data is not copied, ownership given void addCloud( sgVec3 pos, SGNewCloud *cloud); @@ -86,26 +94,32 @@ public: void buildTestLayer(void); // Render a cloud field - void Render(void); + void Render( float *sun_color ); // reposition the cloud layer at the specified origin and orientation - void reposition( sgVec3 p, sgVec3 up, double lon, double lat, double alt, double dt); + void reposition( sgVec3 p, sgVec3 up, double lon, double lat, double alt, double dt, float direction, float speed); + + bool is3D(void) { return draw_in_3d; } // visibility distance for clouds in meters static float CloudVis; - static float density; + static sgVec3 view_vec, view_X, view_Y; + static float density; + static double timer_dt; static double fieldSize; static bool enable3D; // return the size of the memory pool used by texture impostors static int get_CacheSize(void); + static int get_CacheResolution(void); static float get_CloudVis(void) { return CloudVis; } static float get_density(void) { return density; } static bool get_enable3dClouds(void) { return enable3D; } static void set_CacheSize(int sizeKb); + static void set_CacheResolution(int resolutionPixels); static void set_CloudVis(float distance); static void set_density(float density); static void set_enable3dClouds(bool enable);