Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/Spatial
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/Spatial/SampledScalarField2.h |
| Include | #include "Spatial/SampledScalarField2.h" |
Syntax
template<typename RealType, typename ValueType>
class TSampledScalarField2
Remarks
TSampledScalarField2 implements a generic 2D grid of values that can be interpolated in various ways. The grid is treated as a set of sample points in 2D space, IE a grid origin and x/y point-spacing is part of this class.
The class is templated on two types: RealType: the real type used for spatial calculations, ie 2D grid origin, cell dimensions, and sample positions ValueType: the type of value stored in the grid. Could be real or vector-typed, needs to support multiplication by RealType (for interpolation)
Variables
| Type | Name | Description | |
|---|---|---|---|
| TVector2< RealType > | CellDimensions | ||
| TVector2< RealType > | GridOrigin | ||
| TDenseGrid2< ValueType > | GridValues |
Constructors
| Type | Name | Description | |
|---|---|---|---|
| Create empty grid, defaults to 2x2 grid of whatever default value of ValueType is |
Functions
| Type | Name | Description | |
|---|---|---|---|
| ValueType | BilinearSampleClamped
(
const TVector2< RealType >& Position |
Sample scalar field with bilinear interpolation at given Position | |
| void | BilinearSampleGradientClamped
(
const TVector2< RealType >& Position, |
Sample scalar field gradient with bilinear interpolation at given Position | |
| void | CopyConfiguration
(
const TSampledScalarField2< RealType, ValueType >& OtherField |
||
| int32 | Height () |
||
| int64 | Num () |
||
| void | Resize
(
int64 Width, |
Resize the grid to given Width/Height, and initialize w/ given InitValue | |
| void | SetCellSize
(
RealType CellSize |
Set the size of the grid cells to uniform CellSize | |
| void | SetPosition
(
const TVector2< RealType >& Origin |
Set the 2D origin of the grid | |
| int32 | Width () |