CloudyDay
 All Classes Functions Variables Enumerations
CloudLayerUpdate.h
1 #pragma once
2 #include "Scene.h"
3 #include <osg/ref_ptr>
4 #include <osg/Geode>
5 #include <iostream>
6 #include <algorithm>
7 
8 namespace osgCloudyDay
9 {
14  class CloudLayerUpdate : public osg::NodeCallback
15  {
16  public:
20  CloudLayerUpdate(void);
24  ~CloudLayerUpdate(void);
25 
29  virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
33  bool operator() (unsigned short i,unsigned short j)
34  {
35  return (depth[i]<depth[j]);
36  };
37 
41  float* depth;
42 
47  bool CloudAdded();
48 
49  osg::ref_ptr<osg::Geometry> bb_geo;
50 
51  private:
52  unsigned int layerid;
53 
54  bool cloud_added;
55  int iteration;
56 
60  void UpdateShader(osg::ref_ptr<osg::Geode> geode);
61  };
62 }