Panda3D
 All Classes Functions Variables Enumerations
Public Member Functions | Public Attributes
STBasicTerrain::InterpolationData< ValueType > Class Template Reference

List of all members.

Public Member Functions

ValueType calc_bilinear_interpolation (PN_stdfloat u, PN_stdfloat v) const
 Interpolates the value at (u, v) between its four nearest neighbors.
ValueType calc_smooth (PN_stdfloat u, PN_stdfloat v, PN_stdfloat radius) const
 Approximates the average value at (u, v) over the indicated radius, assuming a polynomial curve.
ValueType get_nearest_neighbor (PN_stdfloat u, PN_stdfloat v) const
 Returns the value nearest to (u, v) in the data.
bool is_present () const
 Returns true if the data is present--that is, reset() was called with non-zero values--or false otherwise.
void reset (int width, int height)
 Resets the array to an empty array of width x height cells.

Public Attributes

pvector< ValueType > _data
int _height
int _width

Detailed Description

template<class ValueType>
class STBasicTerrain::InterpolationData< ValueType >

Definition at line 70 of file stBasicTerrain.h.


Member Function Documentation

template<class ValueType >
ValueType STBasicTerrain::InterpolationData< ValueType >::calc_bilinear_interpolation ( PN_stdfloat  u,
PN_stdfloat  v 
) const

Interpolates the value at (u, v) between its four nearest neighbors.

Definition at line 114 of file stBasicTerrain.I.

Referenced by STBasicTerrain::get_height(), and STBasicTerrain::get_slope().

template<class ValueType >
ValueType STBasicTerrain::InterpolationData< ValueType >::calc_smooth ( PN_stdfloat  u,
PN_stdfloat  v,
PN_stdfloat  radius 
) const

Approximates the average value at (u, v) over the indicated radius, assuming a polynomial curve.

Definition at line 150 of file stBasicTerrain.I.

Referenced by STBasicTerrain::get_smooth_height().

template<class ValueType >
ValueType STBasicTerrain::InterpolationData< ValueType >::get_nearest_neighbor ( PN_stdfloat  u,
PN_stdfloat  v 
) const

Returns the value nearest to (u, v) in the data.

Definition at line 98 of file stBasicTerrain.I.

template<class ValueType >
bool STBasicTerrain::InterpolationData< ValueType >::is_present ( ) const

Returns true if the data is present--that is, reset() was called with non-zero values--or false otherwise.

Definition at line 191 of file stBasicTerrain.I.

template<class ValueType >
void STBasicTerrain::InterpolationData< ValueType >::reset ( int  width,
int  height 
)

Resets the array to an empty array of width x height cells.

Definition at line 84 of file stBasicTerrain.I.

Referenced by STBasicTerrain::compute_slope(), and STBasicTerrain::read_height_map().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations