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

#include <MeshSurfacePointSampling.h>

Public Member Functions

GEOMETRYCORE_API bool Init (TConstArrayView< RealType > Weights, RealType SumOfValidWeights, bool bAllowInvalidWeights)
 
 TWeightedSamplingAliasTable ()=default
 
 TWeightedSamplingAliasTable (TConstArrayView< RealType > Weights, RealType SumOfValidWeights, bool bAllowInvalidWeights)
 
 TWeightedSamplingAliasTable (TConstArrayView< RealType > Weights)
 
int32 Num () const
 
bool IsValid () const
 
int32 Sample (RealType UniformRandom1, RealType UniformRandom2) const
 

Constructor & Destructor Documentation

◆ TWeightedSamplingAliasTable() [1/3]

template<typename RealType >
UE::Geometry::TWeightedSamplingAliasTable< RealType >::TWeightedSamplingAliasTable ( )
default

◆ TWeightedSamplingAliasTable() [2/3]

template<typename RealType >
UE::Geometry::TWeightedSamplingAliasTable< RealType >::TWeightedSamplingAliasTable ( TConstArrayView< RealType >  Weights,
RealType  SumOfValidWeights,
bool  bAllowInvalidWeights 
)
inline

◆ TWeightedSamplingAliasTable() [3/3]

template<typename RealType >
UE::Geometry::TWeightedSamplingAliasTable< RealType >::TWeightedSamplingAliasTable ( TConstArrayView< RealType >  Weights)
inline

Member Function Documentation

◆ Init()

template<class RealType >
bool TWeightedSamplingAliasTable::Init ( TConstArrayView< RealType >  Weights,
RealType  SumOfValidWeights,
bool  bAllowInvalidWeights 
)

Initialize sampling table

Parameters
WeightsThe relative frequency that the element should be sampled – e.g., for uniform mesh sampling, these may be triangle areas.
SumOfValidWeightsSum of all valid weights. Must not include negative (invalid) weights.
bAllowInvalidWeightsIf true, then negative weights can be used to indicate invalid IDs, which must never be sampled. Otherwise, all weights should be non-negative.
Returns
true if successfully created a valid sampling table, false otherwise (e.g., if there were no valid weights)

◆ IsValid()

template<typename RealType >
bool UE::Geometry::TWeightedSamplingAliasTable< RealType >::IsValid ( ) const
inline

◆ Num()

template<typename RealType >
int32 UE::Geometry::TWeightedSamplingAliasTable< RealType >::Num ( ) const
inline

◆ Sample()

template<typename RealType >
int32 UE::Geometry::TWeightedSamplingAliasTable< RealType >::Sample ( RealType  UniformRandom1,
RealType  UniformRandom2 
) const
inline

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