Represents a single segment of a two-dimensional terrain which consists of a grid of NxN points (where N >= 2) in the XZ plane (in OSG coordinates) with the value in the Y axis representing height of the point.
More...
#include <Terrain2DSegment.h>
Represents a single segment of a two-dimensional terrain which consists of a grid of NxN points (where N >= 2) in the XZ plane (in OSG coordinates) with the value in the Y axis representing height of the point.
Terrain2DSegment::Terrain2DSegment |
( |
| ) |
|
Default constructor - initializes the default safe values for the inner variables.
APNature::Terrain2DSegment::~Terrain2DSegment |
( |
void |
| ) |
|
|
inline |
Default destructor - Releases all memory used by object.
void Terrain2DSegment::Flatten |
( |
float |
height | ) |
|
Sets the same height of the terrain in the whole segment. [in] Height which is set to every point in the segment.
const Terrain2DSegment* APNature::Terrain2DSegment::GetNeighbourSouthh |
( |
| ) |
const |
|
inline |
const osg::Vec3f& APNature::Terrain2DSegment::GetPoint |
( |
int |
x, |
|
|
int |
y |
|
) |
| const |
|
inline |
Returns an address of a single point of the terrain. [in] Coordinate of the point in the segment in the X-axis. [in] Coordinate of the point in the segment in the Y-axis.
- Returns
- Address of the point of the segment.
osg::ref_ptr<osg::Geode> APNature::Terrain2DSegment::GetTerrainSegmentGeode |
( |
| ) |
const |
|
inline |
Returns the OSG Geode of the 2D terrain segment.
- Returns
- OSG Geode of the 2D terrain segment.
int APNature::Terrain2DSegment::Height |
( |
| ) |
const |
|
inline |
Actual height (north <-> south distance) of the segment in vertices.
- Returns
- Height of the terrain in vertices.
void Terrain2DSegment::InitializeGeode |
( |
| ) |
|
Initializes the segment geode.
bool APNature::Terrain2DSegment::IsNeighbourEast |
( |
| ) |
const |
|
inline |
bool APNature::Terrain2DSegment::IsNeighbourNorth |
( |
| ) |
const |
|
inline |
bool APNature::Terrain2DSegment::IsNeighbourSouth |
( |
| ) |
const |
|
inline |
bool APNature::Terrain2DSegment::IsNeighbourWest |
( |
| ) |
const |
|
inline |
void APNature::Terrain2DSegment::SetPoint |
( |
int |
x, |
|
|
int |
y, |
|
|
const osg::Vec3f & |
point |
|
) |
| |
|
inline |
Sets the new value of the given point in the segment. [in] Coordinate of the point in the segment in the X-axis. [in] Coordinate of the point in the segment in the Y-axis. [in] New value of terrain point.
void Terrain2DSegment::SetSegmentPosition |
( |
const osg::Vec2f & |
position | ) |
|
Sets the new position of the terrain segment, located in the most NW corner of the segment. Additionally recomputes the position of all segment points. [in] New position of the terrain segment in the XZ plane (in OSG coordinates) which is located in the NW corner of the segment.
int APNature::Terrain2DSegment::Width |
( |
| ) |
const |
|
inline |
Actual width (west <-> east distance) of the segment in vertices.
- Returns
- Width of the terrain in vertices.
The documentation for this class was generated from the following files: