Privacy
An open-source, flexible 3D physical simulation framework
VertexBufferTerrain.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016, DFKI GmbH Robotics Innovation Center
3  *
4  * This file is part of the MARS simulation framework.
5  *
6  * MARS is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License
8  * as published by the Free Software Foundation, either version 3
9  * of the License, or (at your option) any later version.
10  *
11  * MARS is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with MARS. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 /*
22  * VertexBufferTerrain.h
23  * General to inherit from.
24  *
25  */
26 
27 #ifndef VERTEX_BUFFER_TERRAIN_H
28 #define VERTEX_BUFFER_TERRAIN_H
29 
30 #include <osg/Drawable>
31 #include <cstdio>
32 
33 namespace osg_terrain {
34 
35  class MultiResHeightMapRenderer;
36  class VertexBufferTerrain : public osg::Drawable {
37 
38  public:
39  VertexBufferTerrain(int width, int height, double scaleZ, int resolution,
40  int depth);
41  //VertexBufferTerrain(const interfaces::terrainStruct *ts);
42 
44  const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY) {
45  fprintf(stderr, "error: not implemented yet!!");
46  }
47 
48  virtual ~VertexBufferTerrain();
49 
50  virtual osg::Object* cloneType() const {
51  fprintf(stderr, "error: not implemented yet!!");
52  return new VertexBufferTerrain(0, 0, 0, 0, 0);
53  }
54 
55  virtual osg::Object* clone(const osg::CopyOp& copyop) const {
56  fprintf(stderr, "error: not implemented yet!!");
57  return new VertexBufferTerrain (*this, copyop);
58  }
59 
60  virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
61  void collideSphere(double xPos, double yPos, double zPos, double radius);
62 #if (OPENSCENEGRAPH_MAJOR_VERSION < 3 || ( OPENSCENEGRAPH_MAJOR_VERSION == 3 && OPENSCENEGRAPH_MINOR_VERSION < 4))
63  osg::BoundingBox computeBound() const;
64 #elif (OPENSCENEGRAPH_MAJOR_VERSION > 3 || (OPENSCENEGRAPH_MAJOR_VERSION == 3 && OPENSCENEGRAPH_MINOR_VERSION >= 4))
65  osg::BoundingSphere computeBound() const;
66 #else
67 #error Unknown OSG Version
68 #endif
69  void setSelected(bool val);
70  void setCameraPosition(double x, double y);
71 
72  private:
74  double width, height, scale;
75 
76  }; // end of class VertexBufferTerrain
77 
78 } // end of namespace osg_terrain
79 
80 #endif /* MARS_GRAPHICS_VERTEX_BUFFER_TERRAIN_H */
MultiResHeightMapRenderer * mrhmr
virtual void drawImplementation(osg::RenderInfo &renderInfo) const
void setCameraPosition(double x, double y)
virtual osg::Object * clone(const osg::CopyOp &copyop) const
virtual osg::Object * cloneType() const
VertexBufferTerrain(int width, int height, double scaleZ, int resolution, int depth)
void collideSphere(double xPos, double yPos, double zPos, double radius)
osg::BoundingBox computeBound() const
VertexBufferTerrain(const VertexBufferTerrain &pg, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)