Waterflow
Visualize water in terrain
|
00001 00002 00003 #ifndef FLOWSOURCE_H 00004 #define FLOWSOURCE_H 00005 #include <vector> 00006 00012 00013 00014 class FlowSource { 00015 std::vector<std::vector<float>> normal; 00016 std::vector<int> normalTime; 00017 00018 std::vector<float> pressureTime; 00019 00020 std::vector<float> pressure; 00021 int xpos; 00022 int ypos; 00023 int zpos; 00024 float totalWater; 00025 float radius; 00026 float currTime; 00027 00028 public: 00029 float currPres; 00030 00032 FlowSource() {currTime = 0; currPres = 0;}; 00033 00035 ~FlowSource() = default; 00036 00041 void setPressure(std::vector<float> P, std::vector<float> t); 00042 00047 void setNormal(std::vector< std::vector<float> > N, std::vector<int> t); 00048 00053 void setPosition(int x, int y, int z); 00054 00058 void setTotalWater(float tot); 00059 00062 void setRadius(float r); 00063 00066 void update(float dt); 00067 00070 float getPressure(); 00071 00074 std::vector<float> getNormal(); 00075 00078 std::vector<int> getPosition(); 00079 00082 float getWaterLeft(); 00083 00086 float getRadius(); 00087 00091 bool getChange(float dt); 00092 }; 00093 00094 #endif