UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TSampledScalarField2< RealType, ValueType > Class Template Reference

#include <SampledScalarField2.h>

Public Member Functions

 TSampledScalarField2 ()
 
void CopyConfiguration (const TSampledScalarField2< RealType, ValueType > &OtherField)
 
void Resize (int64 Width, int64 Height, const ValueType &InitValue)
 
int32 Width () const
 
int32 Height () const
 
int64 Num () const
 
void SetPosition (const TVector2< RealType > &Origin)
 
void SetCellSize (RealType CellSize)
 
ValueType BilinearSampleClamped (const TVector2< RealType > &Position) const
 
void BilinearSampleGradientClamped (const TVector2< RealType > &Position, ValueType &GradXOut, ValueType &GradYOut) const
 

Public Attributes

TDenseGrid2< ValueType > GridValues
 
TVector2< RealType > GridOrigin
 
TVector2< RealType > CellDimensions
 

Detailed Description

template<typename RealType, typename ValueType>
class UE::Geometry::TSampledScalarField2< RealType, ValueType >

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)

Constructor & Destructor Documentation

◆ TSampledScalarField2()

template<typename RealType , typename ValueType >
UE::Geometry::TSampledScalarField2< RealType, ValueType >::TSampledScalarField2 ( )
inline

Create empty grid, defaults to 2x2 grid of whatever default value of ValueType is

Member Function Documentation

◆ BilinearSampleClamped()

template<typename RealType , typename ValueType >
ValueType UE::Geometry::TSampledScalarField2< RealType, ValueType >::BilinearSampleClamped ( const TVector2< RealType > &  Position) const
inline

Sample scalar field with bilinear interpolation at given Position

Parameters
Positionsample point relative to grid origin/dimensions
Returns
interpolated value at this position

◆ BilinearSampleGradientClamped()

template<typename RealType , typename ValueType >
void UE::Geometry::TSampledScalarField2< RealType, ValueType >::BilinearSampleGradientClamped ( const TVector2< RealType > &  Position,
ValueType &  GradXOut,
ValueType &  GradYOut 
) const
inline

Sample scalar field gradient with bilinear interpolation at given Position

Parameters
Positionsample point relative to grid origin/dimensions
Returns
interpolated value at this position

◆ CopyConfiguration()

template<typename RealType , typename ValueType >
void UE::Geometry::TSampledScalarField2< RealType, ValueType >::CopyConfiguration ( const TSampledScalarField2< RealType, ValueType > &  OtherField)
inline

◆ Height()

template<typename RealType , typename ValueType >
int32 UE::Geometry::TSampledScalarField2< RealType, ValueType >::Height ( ) const
inline

◆ Num()

template<typename RealType , typename ValueType >
int64 UE::Geometry::TSampledScalarField2< RealType, ValueType >::Num ( ) const
inline

◆ Resize()

template<typename RealType , typename ValueType >
void UE::Geometry::TSampledScalarField2< RealType, ValueType >::Resize ( int64  Width,
int64  Height,
const ValueType &  InitValue 
)
inline

Resize the grid to given Width/Height, and initialize w/ given InitValue

◆ SetCellSize()

template<typename RealType , typename ValueType >
void UE::Geometry::TSampledScalarField2< RealType, ValueType >::SetCellSize ( RealType  CellSize)
inline

Set the size of the grid cells to uniform CellSize

◆ SetPosition()

template<typename RealType , typename ValueType >
void UE::Geometry::TSampledScalarField2< RealType, ValueType >::SetPosition ( const TVector2< RealType > &  Origin)
inline

Set the 2D origin of the grid

◆ Width()

template<typename RealType , typename ValueType >
int32 UE::Geometry::TSampledScalarField2< RealType, ValueType >::Width ( ) const
inline

Member Data Documentation

◆ CellDimensions

template<typename RealType , typename ValueType >
TVector2<RealType> UE::Geometry::TSampledScalarField2< RealType, ValueType >::CellDimensions

◆ GridOrigin

template<typename RealType , typename ValueType >
TVector2<RealType> UE::Geometry::TSampledScalarField2< RealType, ValueType >::GridOrigin

◆ GridValues

template<typename RealType , typename ValueType >
TDenseGrid2<ValueType> UE::Geometry::TSampledScalarField2< RealType, ValueType >::GridValues

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