Heightfield 1.0
|
A base two-dimensional analytic field of real values. More...
#include <analyticfield.h>
Public Member Functions | |
AnalyticHeightField () | |
Empty. | |
virtual double | Height (const Vector2 &) const |
Compute elevation at a given point. More... | |
virtual Vector | Normal (const Vector2 &) const |
Compute the normal to the field. More... | |
HeightField | CreateHeightField (const Box2 &, int, int) const |
Create a HeightField given an input domain. More... | |
double | Slope (const Vector2 &) const |
Compute the slope at a given point. More... | |
double | AverageSlope (const Vector2 &, int=8) const |
Compute the average slope at a given point. More... | |
double | Slope (const Vector2 &, const Vector2 &) const |
Compute the slope in a given direction and at a given point. More... | |
QVector< double > | Cross (const Vector2 &, const Vector2 &, int) const |
Compute the elevation along a segment. More... | |
Static Public Member Functions | |
static double | Ridge (const double &, const double &=0.0) |
Ridge function. More... | |
Static Protected Attributes | |
static double | Epsilon = 1e-6 |
Epsilon value used for gradient computation. More... | |
A base two-dimensional analytic field of real values.
double AnalyticHeightField::AverageSlope | ( | const Vector2 & | p, |
int | n = 8 |
||
) | const |
Compute the average slope at a given point.
p | The point. |
n | Number of sampling directions. |
HeightField AnalyticHeightField::CreateHeightField | ( | const Box2 & | box, |
int | nx, | ||
int | ny | ||
) | const |
Create a HeightField given an input domain.
box | The box. |
nx,ny | Resolution. |
Compute the elevation along a segment.
a,b | Segment. |
n | Number of samples. |
|
inlinevirtual |
Compute the normal to the field.
p | Point. |
|
inlinestatic |
Ridge function.
z | Elevation. |
r | Ridge elevation. |
double AnalyticHeightField::Slope | ( | const Vector2 & | p | ) | const |
Compute the slope at a given point.
This is the maximum slope, which is the norm of the gradient.
p | The point. |
Compute the slope in a given direction and at a given point.
p | The point. |
d | Direction (should be normalized). |
|
staticprotected |
Epsilon value used for gradient computation.
Epsilon value used for all fields.