VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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/Drawable>
14 #include <osg/Texture2D>
15 
17 
18 namespace makVrv
19 {
20  class DtTritonDrawable;
21  class DtDe;
22 
26  {
27  public:
29 
30  virtual ~DtTritonHeightMapManager();
31 
33  void setupHeightMap( void );
34 
36  void setHeightMapResolution(float resolution);
37 
39  float getHeightMapResolution() const;
40 
43  void setHeightMapTextureSize(int pixels);
44 
46  int heightMapTextureSize() const;
47 
50  bool updateHeightCamera( unsigned int frameNum,
51  const osg::Vec3& currentPosition, bool isGeocentric );
52 
54  void setHeightCameraAttachment(bool enabled);
55 
57  const osg::Matrix& getHeightMapMatrix()
58  {
59  return myHeightMapMatrix;
60  }
61 
63  const osg::ref_ptr<osg::Texture2D> getHeightMapTexture()
64  {
65  return myHeightMap;
66  }
67 
69  void forceUpdate()
70  {
71  myForceUpdate = true;
72  }
73 
74  protected:
75 
76  void cleanup( );
77 
78  osg::Matrixd oglRevDepthOrtho(double left, double right,
79  double bottom, double top,
80  double zNear, double zFar);
81 
83  unsigned int myHeightUpdateFrame;
86  float myResolution;
89 
90  osg::ref_ptr<osg::Texture2D> myHeightMap, myDepthTexture;
91  osg::Matrix myHeightMapMatrix;
93  osg::ref_ptr<osg::Camera> myHeightCamera;
94 
96 
98 
100  };
101 }

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)