vrecko
virtual reality framework
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
TerrainAlgorithm.h
Go to the documentation of this file.
1
9
#ifndef VRECKO_NATURE_TERRAIN_TERRAINALGORITHM_H
10
#define VRECKO_NATURE_TERRAIN_TERRAINALGORITHM_H
11
12
#include "../TerrainUtility.h"
13
#include <osg/Array>
14
15
namespace
APNature
16
{
17
class
TerrainAlgorithm
18
{
19
protected
:
20
21
float
*
_terrain
;
22
int
_width
,
_height
;
23
24
public
:
25
31
// TODO: Add TerrainSurface and make TerrainAlgorithm abstract by inheriting from TerrainSurface. (?)
32
TerrainAlgorithm
(
int
width,
int
height);
33
34
~TerrainAlgorithm
();
35
42
inline
unsigned
int
PointIndex
(
int
x,
int
y)
const
{
return
y * this->
_width
+ x;}
43
48
float
GetLowestValue
()
const
;
49
54
float
GetHighestValue
()
const
;
55
56
protected
:
57
64
float
*
Allocate
(
int
width,
int
height);
65
69
void
Release
();
70
74
void
Zero
();
75
80
void
Flatten
(
float
height);
81
88
inline
float
GetPointHeight
(
int
x,
int
y)
const
{
return
this->
_terrain
[
PointIndex
(x, y)]; }
89
96
inline
void
SetPointHeight
(
int
x,
int
y,
float
height) { this->
_terrain
[
PointIndex
(x, y)] = height;}
97
98
};
99
}
100
101
#endif
include
vreckoAP
Nature
Terrain
Algorithms
TerrainAlgorithm.h
Generated on Tue Feb 19 2013 10:23:44 for vrecko by
1.8.3.1