11 #ifndef VRECKO_NATURE_TERRAIN_TERRAIN2D_H
12 #define VRECKO_NATURE_TERRAIN_TERRAIN2D_H
15 #include <osg/PositionAttitudeTransform>
16 #include <osg/ShapeDrawable>
31 osg::ref_ptr<osg::Group> _terrainGroup;
32 osg::ref_ptr<osg::PositionAttitudeTransform> _PATGroup;
59 const osg::Vec3f&
GetPoint(
int x,
int y)
const;
67 void SetPoint(
int x,
int y,
const osg::Vec3f& point);
143 void AllocateSegments();
148 void AllocateSegmentPoints();
158 void InitializeNeighbours();
165 void InitializeSegmentPositions();
170 void ComputeNormals();
175 void AddSegmentGeodesToTerrainGroup();
183 static inline unsigned int SegmentIndex(
int x,
int y) {
return y * TerrainProperties::ResolutionX() + x;}