CloudyDay
 All Classes Functions Variables Enumerations
Cloud2D.h
1 #pragma once
2 #include "Scene.h"
3 #include <osg/Geometry>
4 #include <osg/Geode>
5 #include <osg/Texture2D>
6 #include <osg/Image>
7 #include <osgUtil/SmoothingVisitor>
8 #include <osgUtil/TangentSpaceGenerator>
9 #include <osg/BlendFunc>
10 #include <osgDB/ReadFile>
11 
12 #define PI 3.14159265
13 
14 namespace osgCloudyDay
15 {
20  class Cloud2D
21  {
22  public:
26  Cloud2D();
30  ~Cloud2D();
31 
35  void Cloud2D::SetGeometry();
41  void Cloud2D::SetGeometry(osg::Vec3 position, osg::Vec2 size);
42 
48  void Cloud2D::Create(osg::Geode* geode, osg::Image* perlinImg);
55  void Create(osg::Geode* geode, osg::Image* perlinImg, osg::Image* perlinNormalImg);
63  void Create(osg::Geode* geode, osg::Image* perlinImg, osg::Image* perlinNormalImg, osg::Image* perlinHeightImg);
64 
70  osg::Image* CreateNormalMap(osg::Image* img);
71 
80  virtual void SetupGeometry(osg::Vec3 position, osg::Vec2 size, osg::Vec3Array* vertices, osg::Vec2Array* tcoords, osg::UIntArray* indices) = 0;
81 
82  public:
83  osg::Geometry* geom;
84  osg::Geode* geode;
85 
86  osg::Node* terrain_obj;
87  bool m_tesselation;
88 
89  protected:
90  osg::Vec3Array* coords;
91  osg::Vec2Array* tcoords;
92  osg::UIntArray* indices;
93  };
94 }