A core heightfield on a hexagonal grid.
More...
#include <hexagonheightfield.h>
|
| HexagonHeightField () |
| Empty.
|
|
| HexagonHeightField (const ScalarHexagonField2 &) |
| Create a heightfield from a scalar field.
|
|
| HexagonHeightField (const Vector2 &, const double &, int, int, const double &=0.0) |
| Create the field structure.
|
|
| ~HexagonHeightField () |
| Empty.
|
|
Vector | Vertex (int, int) const |
| Compute the vertex corresponding to a given sample.
|
|
Vector | Normal (int, int) const |
| Compute the normal at a given sample.
|
|
double | Slope (int, int) const |
| Compute the slope at a given integer point on the terrain.
|
|
Mesh | CreateMesh () const |
| Create the surface mesh.
|
|
void | CreateHexes (QVector< FrameScaled > &) const |
| Create a stack representation of the model.
|
|
A core heightfield on a hexagonal grid.
◆ HexagonHeightField() [1/2]
Create a heightfield from a scalar field.
This constructor provides implicit conversion.
- Parameters
-
◆ HexagonHeightField() [2/2]
HexagonHeightField::HexagonHeightField |
( |
const Vector2 & | c, |
|
|
const double & | r, |
|
|
int | x, |
|
|
int | y, |
|
|
const double & | v = 0.0 ) |
|
explicit |
Create the field structure.
- Parameters
-
c | Origin. |
r | Radius. |
x,y | Size of the array. |
v | Default value of field. |
◆ CreateHexes()
void HexagonHeightField::CreateHexes |
( |
QVector< FrameScaled > & | frames | ) |
const |
Create a stack representation of the model.
Stacks are defined as scaled hexagonal prisms.
- Parameters
-
◆ Normal()
Vector HexagonHeightField::Normal |
( |
int | i, |
|
|
int | j ) const |
Compute the normal at a given sample.
This function uses the weighted sum (area) of the normals of the triangles sharing the point on the grid. The returned vector is normalized.
- Parameters
-
i,j | Integer coordinates of the sample. |
◆ Slope()
double HexagonHeightField::Slope |
( |
int | i, |
|
|
int | j ) const |
Compute the slope at a given integer point on the terrain.
- Parameters
-
◆ Vertex()
Vector HexagonHeightField::Vertex |
( |
int | i, |
|
|
int | j ) const |
Compute the vertex corresponding to a given sample.
- Parameters
-
i,j | Integer coordinates of the sample. |