15template<
typename RealType>
24 static constexpr float ZeroTolerance = 1e-06f;
33 static constexpr float Pi = 3.1415926535897932384626433832795f;
34 static constexpr float FourPi = 4.0f * Pi;
35 static constexpr float TwoPi = 2.0f*Pi;
36 static constexpr float HalfPi = 0.5f*Pi;
39 static constexpr float InvPi = 1.0f / Pi;
41 static constexpr float InvTwoPi = 1.0f / TwoPi;
44 static constexpr float DegToRad = Pi / 180.0f;
46 static constexpr float RadToDeg = 180.0f / Pi;
53 static constexpr float Sqrt2 = 1.4142135623730950488016887242097f;
54 static constexpr float InvSqrt2 = 1.0f /
Sqrt2;
55 static constexpr float Sqrt3 = 1.7320508075688772935274463415059f;
56 static constexpr float InvSqrt3 = 1.0f / Sqrt3;
65 static constexpr double ZeroTolerance = 1e-08;
68 static constexpr double MaxReal =
DBL_MAX;
74 static constexpr double Pi = 3.1415926535897932384626433832795;
75 static constexpr double FourPi = 4.0 * Pi;
76 static constexpr double TwoPi = 2.0 * Pi;
77 static constexpr double HalfPi = 0.5 * Pi;
80 static constexpr double InvPi = 1.0 / Pi;
82 static constexpr double InvTwoPi = 1.0 / TwoPi;
85 static constexpr double DegToRad = Pi / 180.0;
87 static constexpr double RadToDeg = 180.0 / Pi;
94 static constexpr double Sqrt2 = 1.4142135623730950488016887242097;
95 static constexpr double InvSqrt2 = 1.0 /
Sqrt2;
96 static constexpr double Sqrt3 = 1.7320508075688772935274463415059;
97 static constexpr double InvSqrt3 = 1.0 / Sqrt3;
106 static constexpr int32 ZeroTolerance = 0;
110 static constexpr int32 FourPi = 4 * Pi;
111 static constexpr int32 TwoPi = 2 * Pi;
114 static constexpr int32 InvTwoPi = 1;
115 static constexpr int32 DegToRad = 1;
116 static constexpr int32 RadToDeg = 1;
118 static constexpr int32 InvSqrt2 = 1;
120 static constexpr int32 InvSqrt3 = 1;
129 static constexpr int64 ZeroTolerance = 0;
133 static constexpr int64 FourPi = 4 * Pi;
134 static constexpr int64 TwoPi = 2 * Pi;
137 static constexpr int64 InvTwoPi = 1;
138 static constexpr int64 DegToRad = 1;
139 static constexpr int64 RadToDeg = 1;
141 static constexpr int64 InvSqrt2 = 1;
143 static constexpr int64 InvSqrt3 = 1;
148template<
typename RealType>
152 static inline bool IsNaN(
const RealType
Value);
154 static inline RealType
Abs(
const RealType
Value);
155 static inline RealType
Clamp(
const RealType
Value,
const RealType ClampMin,
const RealType ClampMax);
156 static inline RealType
Sign(
const RealType
Value);
159 static inline RealType
Max(
const RealType
A,
const RealType
B);
160 static inline RealType
Max3(
const RealType
A,
const RealType
B,
const RealType
C);
161 static inline int32 Max3Index(
const RealType
A,
const RealType
B,
const RealType
C);
162 static inline RealType
Min(
const RealType
A,
const RealType
B);
163 static inline RealType
Min3(
const RealType
A,
const RealType
B,
const RealType
C);
164 static inline int32 Min3Index(
const RealType
A,
const RealType
B,
const RealType
C);
171 static inline RealType
Sqrt(
const RealType
Value);
173 static inline RealType
Cbrt(
const RealType
Value);
174 static inline RealType
Tan(
const RealType
Value);
176 static inline RealType
Sin(
const RealType
Value);
177 static inline RealType
Cos(
const RealType
Value);
178 static inline RealType
ACos(
const RealType
Value);
179 static inline RealType
Floor(
const RealType
Value);
180 static inline RealType
Ceil(
const RealType
Value);
181 static inline RealType
Round(
const RealType
Value);
182 static inline RealType
Pow(
const RealType
Value,
const RealType Power);
183 static inline RealType
Exp(
const RealType Power);
184 static inline RealType
Log(
const RealType
Value);
185 static inline RealType
Lerp(
const RealType
A,
const RealType
B, RealType
Alpha);
191 static inline RealType
Atan2Positive(
const RealType
Y,
const RealType
X);
200template<
typename RealType>
203 return std::isnan(
Value);
207template<
typename RealType>
210 return std::isfinite(
Value);
214template<
typename RealType>
221template<
typename RealType>
224 return (
Value < ClampMin) ? ClampMin : ((
Value > ClampMax) ? ClampMax :
Value);
227template<
typename RealType>
230 return (
Value > (RealType)0) ? 1 : ((
Value < (RealType)0) ? -1 : 0);
233template<
typename RealType>
236 return (RealType)SignAsInt(
Value);
239template<
typename RealType>
242 return (
Value < (RealType)0) ? (RealType)-1 : (RealType)1;
245template<
typename RealType>
248 return (
A >=
B) ?
A :
B;
251template<
typename RealType>
257template<
typename RealType>
262 return (
A >=
C) ? 0 : 2;
266 return (
B >=
C) ? 1 : 2;
270template<
typename RealType>
273 return (
A <=
B) ?
A :
B;
276template<
typename RealType>
282template<
typename RealType>
287 return (
A <=
C) ? 0 : 2;
291 return (
B <=
C) ? 1 : 2;
296template<
typename RealType>
317template<
typename RealType>
329template<
typename RealType>
341template<
typename RealType>
347template<
typename RealType>
353template<
typename RealType>
359template<
typename RealType>
365template<
typename RealType>
371template<
typename RealType>
377template<
typename RealType>
383template<
typename RealType>
389template<
typename RealType>
395template<
typename RealType>
401template<
typename RealType>
407template<
typename RealType>
413template<
typename RealType>
421template<
typename RealType>
428template<
typename RealType>
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_LARGE_WORLD_MAX
Definition EngineDefines.h:41
TMathUtil< double > FMathd
Definition MathUtil.h:197
TMathUtil< float > FMathf
Definition MathUtil.h:196
#define MAX_int32
Definition NumericLimits.h:25
#define MAX_int64
Definition NumericLimits.h:26
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
float Sqrt2(float X)
Definition SubsurfaceProfile.cpp:428
Definition MathUtil.h:150
static RealType SmoothMin(RealType A, RealType B, RealType BlendExtent)
Definition MathUtil.h:318
static RealType Log(const RealType Value)
Definition MathUtil.h:414
static RealType Cos(const RealType Value)
Definition MathUtil.h:372
static RealType Cbrt(const RealType Value)
Definition MathUtil.h:348
static RealType Atan2(const RealType ValueY, const RealType ValueX)
Definition MathUtil.h:360
static bool IsFinite(const RealType Value)
Definition MathUtil.h:208
static RealType Sign(const RealType Value)
Definition MathUtil.h:234
static void MinMax(RealType A, RealType B, RealType C, RealType &MinOut, RealType &MaxOut)
Definition MathUtil.h:297
static RealType Lerp(const RealType A, const RealType B, RealType Alpha)
Definition MathUtil.h:422
static bool IsNaN(const RealType Value)
Definition MathUtil.h:201
static RealType Min3(const RealType A, const RealType B, const RealType C)
Definition MathUtil.h:277
static RealType Sin(const RealType Value)
Definition MathUtil.h:366
static RealType Clamp(const RealType Value, const RealType ClampMin, const RealType ClampMax)
Definition MathUtil.h:222
static RealType Floor(const RealType Value)
Definition MathUtil.h:384
static int32 Min3Index(const RealType A, const RealType B, const RealType C)
Definition MathUtil.h:283
static RealType Tan(const RealType Value)
Definition MathUtil.h:354
static int32 Max3Index(const RealType A, const RealType B, const RealType C)
Definition MathUtil.h:258
static RealType Max(const RealType A, const RealType B)
Definition MathUtil.h:246
static RealType Max3(const RealType A, const RealType B, const RealType C)
Definition MathUtil.h:252
static RealType Sqrt(const RealType Value)
Definition MathUtil.h:342
static RealType Abs(const RealType Value)
Definition MathUtil.h:215
static RealType ACos(const RealType Value)
Definition MathUtil.h:378
static RealType SignNonZero(const RealType Value)
Definition MathUtil.h:240
static int32 SignAsInt(const RealType Value)
Definition MathUtil.h:228
static RealType Atan2Positive(const RealType Y, const RealType X)
Definition MathUtil.h:429
static RealType Pow(const RealType Value, const RealType Power)
Definition MathUtil.h:402
static RealType Ceil(const RealType Value)
Definition MathUtil.h:390
static RealType SmoothMax(RealType A, RealType B, RealType BlendExtent)
Definition MathUtil.h:330
static RealType Exp(const RealType Power)
Definition MathUtil.h:408
static RealType Min(const RealType A, const RealType B)
Definition MathUtil.h:271
static RealType Round(const RealType Value)
Definition MathUtil.h:396