Navigation
API > API/Runtime > API/Runtime/GeometryCore
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)
| Name | TSampledScalarField2 |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Spatial/SampledScalarField2.h |
| Include Path | #include "Spatial/SampledScalarField2.h" |
Syntax
template<typename RealType, typename ValueType>
class TSampledScalarField2
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TSampledScalarField2() |
Create empty grid, defaults to 2x2 grid of whatever default value of ValueType is | Spatial/SampledScalarField2.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CellDimensions | TVector2< RealType > | Spatial/SampledScalarField2.h | ||
| GridOrigin | TVector2< RealType > | Spatial/SampledScalarField2.h | ||
| GridValues | TDenseGrid2< ValueType > | Spatial/SampledScalarField2.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ValueType BilinearSampleClamped
(
const TVector2< RealType >& Position |
Sample scalar field with bilinear interpolation at given Position | Spatial/SampledScalarField2.h | |
void BilinearSampleGradientClamped
(
const TVector2< RealType >& Position, |
Sample scalar field gradient with bilinear interpolation at given Position | Spatial/SampledScalarField2.h | |
void CopyConfiguration
(
const TSampledScalarField2< RealType, ValueType >& OtherField |
Spatial/SampledScalarField2.h | ||
int32 Height() |
Spatial/SampledScalarField2.h | ||
int64 Num() |
Spatial/SampledScalarField2.h | ||
void Resize
(
int64 Width, |
Resize the grid to given Width/Height, and initialize w/ given InitValue | Spatial/SampledScalarField2.h | |
void SetCellSize
(
RealType CellSize |
Set the size of the grid cells to uniform CellSize | Spatial/SampledScalarField2.h | |
void SetPosition
(
const TVector2< RealType >& Origin |
Set the 2D origin of the grid | Spatial/SampledScalarField2.h | |
int32 Width() |
Spatial/SampledScalarField2.h |