Ark Server API (ASE) - Wiki
|
#include <UnrealMathUtility.h>
Static Public Member Functions | |
static FORCEINLINE int32 | RandHelper (int32 A) |
static FORCEINLINE int32 | RandRange (int32 Min, int32 Max) |
static FORCEINLINE float | RandRange (float InMin, float InMax) |
static FORCEINLINE float | FRandRange (float InMin, float InMax) |
static FORCEINLINE bool | RandBool () |
template<typename T > | |
static FORCEINLINE bool | IsPowerOfTwo (T Value) |
template<class T > | |
static FORCEINLINE T | Max3 (const T A, const T B, const T C) |
template<class T > | |
static FORCEINLINE T | Min3 (const T A, const T B, const T C) |
template<class T > | |
static FORCEINLINE T | Square (const T A) |
template<class T > | |
static FORCEINLINE T | Clamp (const T X, const T Min, const T Max) |
template<class T > | |
static FORCEINLINE T | DivideAndRoundUp (T Dividend, T Divisor) |
template<class T > | |
static FORCEINLINE T | DivideAndRoundDown (T Dividend, T Divisor) |
static FORCEINLINE void | SinCos (float *ScalarSin, float *ScalarCos, float Value) |
static FORCEINLINE float | FastAsin (float Value) |
template<class T > | |
static FORCEINLINE auto | RadiansToDegrees (T const &RadVal) -> decltype(RadVal *(180.f/PI)) |
template<class T > | |
static FORCEINLINE auto | DegreesToRadians (T const &DegVal) -> decltype(DegVal *(PI/180.f)) |
static float | FindDeltaAngleDegrees (float A1, float A2) |
static float | FindDeltaAngleRadians (float A1, float A2) |
static float | UnwindRadians (float A) |
static float | UnwindDegrees (float A) |
static FORCEINLINE void | PolarToCartesian (const float Rad, const float Ang, float &OutX, float &OutY) |
template<class T , class U > | |
static T | Lerp (const T &A, const T &B, const U &Alpha) |
template<class T > | |
static T | LerpStable (const T &A, const T &B, double Alpha) |
template<class T > | |
static T | LerpStable (const T &A, const T &B, float Alpha) |
template<class T , class U > | |
static T | BiLerp (const T &P00, const T &P10, const T &P01, const T &P11, const U &FracX, const U &FracY) |
template<class T , class U > | |
static T | CubicInterp (const T &P0, const T &T0, const T &P1, const T &T1, const U &A) |
template<class T , class U > | |
static T | CubicInterpDerivative (const T &P0, const T &T0, const T &P1, const T &T1, const U &A) |
template<class T , class U > | |
static T | CubicInterpSecondDerivative (const T &P0, const T &T0, const T &P1, const T &T1, const U &A) |
template<class T > | |
static T | InterpEaseIn (const T &A, const T &B, float Alpha, float Exp) |
template<class T > | |
static T | InterpEaseOut (const T &A, const T &B, float Alpha, float Exp) |
template<class T > | |
static T | InterpEaseInOut (const T &A, const T &B, float Alpha, float Exp) |
template<class T > | |
static T | InterpStep (const T &A, const T &B, float Alpha, int32 Steps) |
template<class T > | |
static T | InterpSinIn (const T &A, const T &B, float Alpha) |
template<class T > | |
static T | InterpSinOut (const T &A, const T &B, float Alpha) |
template<class T > | |
static T | InterpSinInOut (const T &A, const T &B, float Alpha) |
template<class T > | |
static T | InterpExpoIn (const T &A, const T &B, float Alpha) |
template<class T > | |
static T | InterpExpoOut (const T &A, const T &B, float Alpha) |
template<class T > | |
static T | InterpExpoInOut (const T &A, const T &B, float Alpha) |
template<class T > | |
static T | InterpCircularIn (const T &A, const T &B, float Alpha) |
template<class T > | |
static T | InterpCircularOut (const T &A, const T &B, float Alpha) |
template<class T > | |
static T | InterpCircularInOut (const T &A, const T &B, float Alpha) |
template<class U > | |
static U | CubicCRSplineInterp (const U &P0, const U &P1, const U &P2, const U &P3, const float T0, const float T1, const float T2, const float T3, const float T) |
static FORCEINLINE float | RoundFromZero (float F) |
static FORCEINLINE double | RoundFromZero (double F) |
static FORCEINLINE float | RoundToZero (float F) |
static FORCEINLINE double | RoundToZero (double F) |
static FORCEINLINE float | RoundToNegativeInfinity (float F) |
static FORCEINLINE double | RoundToNegativeInfinity (double F) |
static FORCEINLINE float | RoundToPositiveInfinity (float F) |
static FORCEINLINE double | RoundToPositiveInfinity (double F) |
static float | SmoothStep (float A, float B, float X) |
static int32 | GreatestCommonDivisor (int32 a, int32 b) |
static int32 | LeastCommonMultiplier (int32 a, int32 b) |
Static Public Member Functions inherited from FGenericPlatformMath | |
static CONSTEXPR FORCEINLINE int32 | TruncToInt (float F) |
static CONSTEXPR FORCEINLINE float | TruncToFloat (float F) |
static FORCEINLINE int32 | FloorToInt (float F) |
static FORCEINLINE float | FloorToFloat (float F) |
static FORCEINLINE double | FloorToDouble (double F) |
static FORCEINLINE int32 | RoundToInt (float F) |
static FORCEINLINE float | RoundToFloat (float F) |
static FORCEINLINE double | RoundToDouble (double F) |
static FORCEINLINE int32 | CeilToInt (float F) |
static FORCEINLINE float | CeilToFloat (float F) |
static FORCEINLINE double | CeilToDouble (double F) |
static FORCEINLINE float | Fractional (float Value) |
static FORCEINLINE float | Frac (float Value) |
static FORCEINLINE float | Modf (const float InValue, float *OutIntPart) |
static FORCEINLINE double | Modf (const double InValue, double *OutIntPart) |
static FORCEINLINE float | Exp (float Value) |
static FORCEINLINE float | Exp2 (float Value) |
static FORCEINLINE float | Loge (float Value) |
static FORCEINLINE float | LogX (float Base, float Value) |
static FORCEINLINE float | Log2 (float Value) |
static FORCEINLINE float | Fmod (float X, float Y) |
static FORCEINLINE float | Sin (float Value) |
static FORCEINLINE float | Asin (float Value) |
static FORCEINLINE float | Sinh (float Value) |
static FORCEINLINE float | Cos (float Value) |
static FORCEINLINE float | Acos (float Value) |
static FORCEINLINE float | Tan (float Value) |
static FORCEINLINE float | Atan (float Value) |
static FORCEINLINE float | Sqrt (float Value) |
static FORCEINLINE float | Pow (float A, float B) |
static FORCEINLINE float | InvSqrt (float F) |
static FORCEINLINE float | InvSqrtEst (float F) |
static FORCEINLINE bool | IsNaN (float A) |
static FORCEINLINE bool | IsFinite (float A) |
static FORCEINLINE bool | IsNegativeFloat (const float &A) |
static FORCEINLINE bool | IsNegativeDouble (const double &A) |
static FORCEINLINE int32 | Rand () |
static FORCEINLINE void | RandInit (int32 Seed) |
static FORCEINLINE float | FRand () |
static FORCEINLINE uint32 | FloorLog2 (uint32 Value) |
static FORCEINLINE uint64 | FloorLog2_64 (uint64 Value) |
static FORCEINLINE uint32 | CountLeadingZeros (uint32 Value) |
static FORCEINLINE uint64 | CountLeadingZeros64 (uint64 Value) |
static FORCEINLINE uint32 | CountTrailingZeros (uint32 Value) |
static FORCEINLINE uint32 | CeilLogTwo (uint32 Arg) |
static FORCEINLINE uint64 | CeilLogTwo64 (uint64 Arg) |
static FORCEINLINE uint32 | RoundUpToPowerOfTwo (uint32 Arg) |
static FORCEINLINE uint32 | MortonCode2 (uint32 x) |
static FORCEINLINE uint32 | ReverseMortonCode2 (uint32 x) |
static FORCEINLINE uint32 | MortonCode3 (uint32 x) |
static FORCEINLINE uint32 | ReverseMortonCode3 (uint32 x) |
static CONSTEXPR FORCEINLINE float | FloatSelect (float Comparand, float ValueGEZero, float ValueLTZero) |
static CONSTEXPR FORCEINLINE double | FloatSelect (double Comparand, double ValueGEZero, double ValueLTZero) |
template<class T > | |
static CONSTEXPR FORCEINLINE T | Abs (const T A) |
template<class T > | |
static CONSTEXPR FORCEINLINE T | Sign (const T A) |
template<class T > | |
static CONSTEXPR FORCEINLINE T | Max (const T A, const T B) |
template<class T > | |
static CONSTEXPR FORCEINLINE T | Min (const T A, const T B) |
template<class T > | |
static FORCEINLINE T | Min (const TArray< T > &Values, int32 *MinIndex=NULL) |
template<class T > | |
static FORCEINLINE T | Max (const TArray< T > &Values, int32 *MaxIndex=NULL) |
static FORCEINLINE int32 | CountBits (uint64 Bits) |
Additional Inherited Members | |
Public Member Functions inherited from FGenericPlatformMath | |
template<> | |
FORCEINLINE float | Abs (const float A) |
Structure for all math helper functions, inherits from platform math to pick up platform-specific implementations Check GenericPlatformMath.h for additional math functions
Definition at line 69 of file UnrealMathUtility.h.
|
inlinestatic |
Performs a 2D linear interpolation between four values values, FracX, FracY ranges from 0-1
Definition at line 378 of file UnrealMathUtility.h.
|
inlinestatic |
Clamps X to be between Min and Max, inclusive
Definition at line 143 of file UnrealMathUtility.h.
|
inlinestatic |
Definition at line 576 of file UnrealMathUtility.h.
|
inlinestatic |
Performs a cubic interpolation
P | - end points |
T | - tangent directions at end points |
Alpha | - distance along spline |
Definition at line 397 of file UnrealMathUtility.h.
|
inlinestatic |
Performs a first derivative cubic interpolation
P | - end points |
T | - tangent directions at end points |
Alpha | - distance along spline |
Definition at line 415 of file UnrealMathUtility.h.
|
inlinestatic |
Performs a second derivative cubic interpolation
P | - end points |
T | - tangent directions at end points |
Alpha | - distance along spline |
Definition at line 436 of file UnrealMathUtility.h.
|
inlinestatic |
Converts degrees to radians.
DegVal | Value in degrees. |
Definition at line 265 of file UnrealMathUtility.h.
|
inlinestatic |
|
inlinestatic |
Divides two integers and rounds up
Definition at line 150 of file UnrealMathUtility.h.
|
inlinestatic |
Computes the ASin of a scalar float.
Value | input angle |
Definition at line 225 of file UnrealMathUtility.h.
|
inlinestatic |
Find the smallest angle between two headings (in degrees)
Definition at line 271 of file UnrealMathUtility.h.
|
inlinestatic |
Find the smallest angle between two headings (in radians)
Definition at line 294 of file UnrealMathUtility.h.
|
inlinestatic |
Util to generate a random number in a range.
Definition at line 95 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolation between A and B, applying a circular in function.
Definition at line 540 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolation between A and B, applying a circular in/out function.
Definition at line 557 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolation between A and B, applying a circular out function.
Definition at line 548 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolate between A and B, applying an ease in function. Exp controls the degree of the curve.
Definition at line 446 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolate between A and B, applying an ease in/out function. Exp controls the degree of the curve.
Definition at line 462 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolate between A and B, applying an ease out function. Exp controls the degree of the curve.
Definition at line 454 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolation between A and B, applying an exponential in function.
Definition at line 515 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolation between A and B, applying an exponential in/out function.
Definition at line 531 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolation between A and B, applying an exponential out function.
Definition at line 523 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolation between A and B, applying a sinusoidal in function.
Definition at line 490 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolation between A and B, applying a sinusoidal in/out function.
Definition at line 506 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolation between A and B, applying a sinusoidal out function.
Definition at line 498 of file UnrealMathUtility.h.
|
inlinestatic |
Interpolation between A and B, applying a step function.
Definition at line 471 of file UnrealMathUtility.h.
|
inlinestatic |
Checks whether a number is a power of two.
Value | Number to check |
Definition at line 112 of file UnrealMathUtility.h.
|
inlinestatic |
Performs a linear interpolation between two values, Alpha ranges from 0-1
Definition at line 357 of file UnrealMathUtility.h.
|
inlinestatic |
Performs a linear interpolation between two values, Alpha ranges from 0-1. Handles full numeric range of T
Definition at line 364 of file UnrealMathUtility.h.
|
inlinestatic |
Performs a linear interpolation between two values, Alpha ranges from 0-1. Handles full numeric range of T
Definition at line 371 of file UnrealMathUtility.h.
|
inlinestatic |
Returns highest of 3 values
Definition at line 122 of file UnrealMathUtility.h.
|
inlinestatic |
Returns lowest of 3 values
Definition at line 129 of file UnrealMathUtility.h.
|
inlinestatic |
Converts given Polar coordinate pair to Cartesian coordinate system.
Definition at line 349 of file UnrealMathUtility.h.
|
inlinestatic |
Converts radians to degrees.
RadVal | Value in radians. |
Definition at line 254 of file UnrealMathUtility.h.
|
inlinestatic |
Util to generate a random boolean.
Definition at line 101 of file UnrealMathUtility.h.
Helper function for rand implementations. Returns a random number in [0..A)
Definition at line 74 of file UnrealMathUtility.h.
|
inlinestatic |
Util to generate a random number in a range. Overloaded to distinguish from int32 version, where passing a float is typically a mistake.
Definition at line 89 of file UnrealMathUtility.h.
Helper function for rand implementations. Returns a random number >= Min and <= Max
Definition at line 82 of file UnrealMathUtility.h.
|
inlinestatic |
|
inlinestatic |
Converts a floating point number to an integer which is further from zero, "larger" in absolute value: 0.1 becomes 1, -0.1 becomes -1
F | Floating point value to convert |
Definition at line 602 of file UnrealMathUtility.h.
|
inlinestatic |
|
inlinestatic |
Converts a floating point number to an integer which is more negative: 0.1 becomes 0, -0.1 becomes -1
F | Floating point value to convert |
Definition at line 632 of file UnrealMathUtility.h.
|
inlinestatic |
|
inlinestatic |
Converts a floating point number to an integer which is more positive: 0.1 becomes 1, -0.1 becomes 0
F | Floating point value to convert |
Definition at line 647 of file UnrealMathUtility.h.
|
inlinestatic |
|
inlinestatic |
Converts a floating point number to an integer which is closer to zero, "smaller" in absolute value: 0.1 becomes 0, -0.1 becomes 0
F | Floating point value to convert |
Definition at line 617 of file UnrealMathUtility.h.
|
inlinestatic |
Computes the sine and cosine of a scalar float.
ScalarSin | Pointer to where the Sin result should be stored |
ScalarCos | Pointer to where the Cos result should be stored |
Value | input angles |
Definition at line 168 of file UnrealMathUtility.h.
|
inlinestatic |
Returns a smooth Hermite interpolation between 0 and 1 for the value X (where X ranges between A and B) Clamped to 0 for X <= A and 1 for X >= B.
A | Minimum value of X |
B | Maximum value of X |
X | Parameter |
Definition at line 667 of file UnrealMathUtility.h.
|
inlinestatic |
Multiples value by itself
Definition at line 136 of file UnrealMathUtility.h.
|
inlinestatic |
Utility to ensure angle is between +/- 180 degrees by unwinding.
Definition at line 333 of file UnrealMathUtility.h.
|
inlinestatic |
Given a heading which may be outside the +/- PI range, 'unwind' it back into that range.
Definition at line 317 of file UnrealMathUtility.h.