UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GridSampler.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "MathUtil.h"
6#include "VectorTypes.h"
7
8namespace UE
9{
10namespace Geometry
11{
12
18template<typename RealType>
20{
21private:
22 int32 Size = 1;
23
24public:
26 : Size(SizeIn)
27 {
28 checkSlow(Size >= 1);
29 }
30
32 int32 Num() const
33 {
34 return Size * Size;
35 }
36
42 {
43 checkSlow(Index >= 0 && Index < Num());
44 RealType X = (static_cast<RealType>(Index % Size) + RealType{ 1 } / RealType{ 2 }) / static_cast<RealType>(Size); //-V1064
45 RealType Y = (static_cast<RealType>(Index / Size) + RealType{ 1 } / RealType{ 2 }) / static_cast<RealType>(Size); //-V1064
47 }
48};
49
50} // end namespace UE::Geometry
51} // end namespace UE
52
#define checkSlow(expr)
Definition AssertionMacros.h:332
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define X(Name, Desc)
Definition FormatStringSan.h:47
uint32 Size
Definition VulkanMemory.cpp:4034
Definition GridSampler.h:20
TGridSampler(int32 SizeIn)
Definition GridSampler.h:25
int32 Num() const
Definition GridSampler.h:32
UE::Math::TVector2< RealType > Sample(int32 Index) const
Definition GridSampler.h:41
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
Definition Vector2D.h:38