VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtTritonHeightMapManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <osg/Camera>
13 #include <osg/View>
14 #include <osg/Drawable>
15 #include <osg/Texture2D>
16 
18 
19 namespace makVrv
20 {
21  class DtTritonDrawable;
22  class DtDe;
23 
27  {
28  public:
29  DtTritonHeightMapManager(makVrv::DtDe& de, DtTritonDrawable *parentDrawable, osg::View* view);
30 
31  virtual ~DtTritonHeightMapManager();
32 
34  void setupHeightMap( void );
35 
37  void setHeightMapResolution(float resolution);
38 
40  float getHeightMapResolution() const;
41 
44  void setHeightMapTextureSize(int pixels);
45 
47  int heightMapTextureSize() const;
48 
51  bool updateHeightCamera( unsigned int frameNum,
52  const osg::Vec3& currentPosition, bool isGeocentric );
53 
55  void setHeightCameraAttachment(bool enabled);
56 
58  const osg::Matrix& getHeightMapMatrix()
59  {
60  return myHeightMapMatrix;
61  }
62 
64  const osg::ref_ptr<osg::Texture2D> getHeightMapTexture()
65  {
66  return myHeightMap;
67  }
68 
70  void forceUpdate()
71  {
72  myForceUpdate = true;
73  }
74 
75  protected:
76 
77  void cleanup( );
78 
79  osg::Matrixd oglRevDepthOrtho(double left, double right,
80  double bottom, double top,
81  double zNear, double zFar);
82 
84  unsigned int myHeightUpdateFrame;
87  float myResolution;
90 
91  osg::ref_ptr<osg::Texture2D> myHeightMap, myDepthTexture;
92  osg::Matrix myHeightMapMatrix;
94  osg::ref_ptr<osg::Camera> myHeightCamera;
95 
97 
99 
101 
102  osg::View* myOsgView;
103 
104  };
105 }

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)