00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef WATERPLAN_H
00024 #define WATERPLAN_H
00025
00026 #include <iostream>
00027 #include <string>
00028 #include <osg/Node>
00029 #include <osg/Geometry>
00030 #include <osg/Texture2D>
00031 #include <osg/Texture3D>
00032
00033 #include <osgDB/Registry>
00034 #include <osgDB/ReadFile>
00035 #include <osgProducer/Viewer>
00036 #include <osg/TexGen>
00037 #include <osg/BlendFunc>
00038
00039 class ConstructStateCallback ;
00040
00044 class waterPlan{
00045 private:
00046 float xMin, xMax, yMin, yMax, z;
00047
00049 float densite_texture;
00050 std::string texture;
00051
00053 osg::Vec4 deplacement_texture;
00054
00055
00056 osg::Geometry* water_geometry;
00057 osg::Geode* water_geode;
00058
00059 public:
00060 waterPlan();
00061 ~waterPlan();
00062 float getZ(){ return z; }
00063 void setPlan(float xMin,float xMax,float yMin,float yMax,float z);
00064 void setTexture(std::string tex, float densite);
00065 void setDeplacementWater(osg::Vec4 depl);
00066
00068 osg::Drawable* createMirrorSurface();
00069 osg::Drawable* createMirrorSurfaceForTheDam(float x);
00070 osg::Drawable* createSurfaceBehindForTheDam(float x,float dz);
00071 osg::Drawable* getOrCreateDrawable();
00073 osg::StateSet* createMirrorTexturedState();
00075 osg::Geode* getOrCreateGeodeWater(osg::StateSet* stateset=NULL);
00076 osg::Geode* createGeodeUnderWater(float x,float dz);
00078 static ConstructStateCallback* getStateCallback(osg::Node* node1,osg::Node* node2);
00079 };
00080
00081 #endif