UDocumentation
UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
LargeWorldCoordinates.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#pragma once
4
5
// Forward declaration of LWC supported core types
6
#define UE_DECLARE_LWC_TYPE_EX(TYPE, CC, DEFAULT_TYPENAME, COMPONENT_TYPE) \
7
namespace UE { namespace Math { template<typename T> struct T##TYPE; } } \
8
typedef UE::Math::T##TYPE<float> F##TYPE##CC##f;
/* FVector3f */
\
9
typedef UE::Math::T##TYPE<double> F##TYPE##CC##d;
/* FVector3d */
\
10
typedef UE::Math::T##TYPE<COMPONENT_TYPE> DEFAULT_TYPENAME;
/* FVector */
\
11
namespace ispc { struct DEFAULT_TYPENAME; }
/* ISPC forward declaration */
12
13
// TODO: Need to fix various UE::Geometry name collisions to support this!
14
//typedef UE::Math::T##TYPE<COMPONENT_TYPE> F##TYPE##CC; /* FVector3 */
15
16
17
#define UE_DECLARE_LWC_TYPE_3(TYPE, DIM, UE_TYPENAME) UE_DECLARE_LWC_TYPE_EX(TYPE, DIM, UE_TYPENAME, double)
18
#define UE_DECLARE_LWC_TYPE_2(TYPE, DIM) UE_DECLARE_LWC_TYPE_3(TYPE, DIM, F##TYPE)
19
#define UE_DECLARE_LWC_TYPE_1(TYPE) UE_DECLARE_LWC_TYPE_2(TYPE,)
20
21
// Necessary to convince the MSVC preprocessor to play ball with variadic args - https://stackoverflow.com/questions/5134523/msvc-doesnt-expand-va-args-correctly
22
#define FORCE_EXPAND(X) X
23
#define UE_LWC_MACRO_SELECT(PAD1, PAD2, PAD3, PAD4, MACRO, ...) MACRO
24
#define UE_DECLARE_LWC_TYPE_SELECT(...) FORCE_EXPAND(UE_LWC_MACRO_SELECT(__VA_ARGS__, UE_DECLARE_LWC_TYPE_EX, UE_DECLARE_LWC_TYPE_3, UE_DECLARE_LWC_TYPE_2, UE_DECLARE_LWC_TYPE_1 ))
25
26
// Args - TYPE, DIMENSION, [UE_TYPENAME], [COMPONENT_TYPE]. e.g. Vector, 3, FVector, double // LWC_TODO: Remove COMPONENT_TYPE
27
#define UE_DECLARE_LWC_TYPE(...) FORCE_EXPAND(UE_DECLARE_LWC_TYPE_SELECT(__VA_ARGS__)(__VA_ARGS__))
28
29
// Use to make any narrowing casts searchable in code when it is updated to work with a 64 bit count/range
30
#define UE_REAL_TO_FLOAT(argument) static_cast<float>(argument)
31
32
// Use to make any narrowing casts searchable in code when it is updated to work with a 64 bit count/range clamped to max float.
33
#define UE_REAL_TO_FLOAT_CLAMPED_MAX(argument) static_cast<float>(FMath::Min(argument, (FVector::FReal)TNumericLimits<float>::Max()))
34
35
// Use to make any narrowing casts searchable in code when it is updated to work with a 64 bit count/range clamped to min / max float.
36
#define UE_REAL_TO_FLOAT_CLAMPED(argument) static_cast<float>(FMath::Clamp(argument, (FVector::FReal)TNumericLimits<float>::Lowest(), (FVector::FReal)TNumericLimits<float>::Max()))
37
Engine
Source
Runtime
Core
Public
Misc
LargeWorldCoordinates.h
Generated by
1.9.8