mercator 0.4.0
A terrain generation library for the Worldforge system.
Mercator::QuadInterp Class Reference

Helper to interpolate in a quad. More...

Public Member Functions

float calc (float locX, float locY)
 Determine the interpolated value within the quad. More...
 
 QuadInterp (float size, float e1, float e2, float e3, float e4)
 Constructor. More...
 

Public Attributes

float ep1
 Values at the four corners. More...
 
float ep2
 
float ep3
 
float ep4
 

Detailed Description

Helper to interpolate in a quad.

The quad specified is assumed to be square of integer size, and the position specified for interpolation is specified in integer form. A check is included to avoid calculation if the value of each corner is the same.

Definition at line 68 of file HeightMap.cpp.

Constructor & Destructor Documentation

◆ QuadInterp()

Mercator::QuadInterp::QuadInterp ( float  size,
float  e1,
float  e2,
float  e3,
float  e4 
)
inline

Constructor.

Parameters
sizelength of one side of the square quad.
e1value at one corner of the square quad.
e2value at one corner of the square quad.
e3value at one corner of the square quad.
e4value at one corner of the square quad.

Definition at line 91 of file HeightMap.cpp.

References ep1.

Member Function Documentation

◆ calc()

float Mercator::QuadInterp::calc ( float  locX,
float  locY 
)
inline

Determine the interpolated value within the quad.

Definition at line 78 of file HeightMap.cpp.

References ep1.

Referenced by Mercator::HeightMap::fill2d().

Member Data Documentation

◆ ep1

float Mercator::QuadInterp::ep1

Values at the four corners.

Definition at line 76 of file HeightMap.cpp.

Referenced by calc(), and QuadInterp().

◆ ep2

float Mercator::QuadInterp::ep2

Definition at line 76 of file HeightMap.cpp.

◆ ep3

float Mercator::QuadInterp::ep3

Definition at line 76 of file HeightMap.cpp.

◆ ep4

float Mercator::QuadInterp::ep4

Definition at line 76 of file HeightMap.cpp.


The documentation for this class was generated from the following file: