Navigation
API > API/Runtime > API/Runtime/Core
Structure for all math helper functions, inherits from platform math to pick up platform-specific implementations Check GenericPlatformMath.h for additional math functions
| Name | FMath |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h |
| Include Path | #include "Math/UnrealMathUtility.h" |
Syntax
struct FMath : public FLinuxPlatformMath
Inheritance Hierarchy
- Base → TUnrealPlatformMathSSEBase → TUnrealPlatformMathSSE4Base → FLinuxPlatformMath → FMath
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| BitFlag | const uint32 | 32 bit values where BitFlag[x] == (1< | Math/UnrealMathUtility.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool IntersectPlanes2
(
UE::Math::TVector< T >& I, |
Math/Plane.h | ||
bool IntersectPlanes3
(
UE::Math::TVector< T >& I, |
Math/Plane.h | ||
UE::Math::TVector< T > LinePlaneIntersection
(
const UE::Math::TVector< T >& Point1, |
Math/Plane.h | ||
UE::Math::TVector< T > LinePlaneIntersection
(
const UE::Math::TVector< T >& Point1, |
FMath inline functions | Math/Vector.h | |
bool LineSphereIntersection
(
const UE::Math::TVector< T >& Start, |
Math/Vector.h | ||
UE::Math::TVector< T > RayPlaneIntersection
(
const UE::Math::TVector< T >& RayOrigin, |
FMath inline functions | Math/Plane.h | |
T RayPlaneIntersectionParam
(
const UE::Math::TVector< T >& RayOrigin, |
Math/Plane.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void ApplyScaleToFloat
(
float& Dst, |
Handy to apply scaling in the editor | Math/UnrealMathUtility.h | |
static T BiLerp
(
const T& P00, |
Custom lerps defined for those classes not suited to the default implemenation. | Math/UnrealMathUtility.h | |
static T BiLerp
(
const T& P00, |
Performs a 2D linear interpolation between four values values, FracX, FracY ranges from 0-1 | Math/UnrealMathUtility.h | |
static void CartesianToPolar
(
const T X, |
Converts given Cartesian coordinate pair to Polar coordinate system. | Math/UnrealMathUtility.h | |
static void CartesianToPolar
(
const UE::Math::TVector2< T > InCart, |
Converts given Cartesian coordinate pair to Polar coordinate system. | Math/UnrealMathUtility.h | |
static FLinearColor CInterpTo
(
const FLinearColor& Current, |
Interpolate Linear Color from Current to Target. | Math/UnrealMathUtility.h | |
static T Clamp
(
const T X, |
Clamps X to be between Min and Max, inclusive | Math/UnrealMathUtility.h | |
static decltype(X *Y *Z) Clamp
(
Arg1 X, |
Allow mixing float/double arguments, promoting to highest precision type. | Math/UnrealMathUtility.h | |
static float Clamp
(
const float X, |
Clamps X to be between Min and Max, inclusive. | Math/UnrealMathUtility.h | |
static double Clamp
(
const double X, |
Math/UnrealMathUtility.h | ||
static int64 Clamp
(
const int64 X, |
Clamps X to be between Min and Max, inclusive. Overload to support mixed int64/int32 types. | Math/UnrealMathUtility.h | |
static T ClampAngle
(
T AngleDegrees, |
Clamps an arbitrary angle to be between the given angles. Will clamp to nearest boundary. | Math/UnrealMathUtility.h | |
static decltype(X *Y *Z) ClampAngle
(
Arg1 X, |
Math/UnrealMathUtility.h | ||
static FVector ClosestPointOnInfiniteLine
(
const FVector& LineStart, |
Find the point on the infinite line between two points (LineStart, LineEnd) which is closest to Point | Math/UnrealMathUtility.h | |
static UE::Math::TVector< T > ClosestPointOnLine
(
const UE::Math::TVector< T >& LineStart, |
Find the point on the line segment from LineStart to LineEnd which is closest to Point | Math/UnrealMathUtility.h | |
static UE::Math::TVector< T > ClosestPointOnSegment
(
const UE::Math::TVector< T >& Point, |
Returns closest point on a segment to a given point. | Math/UnrealMathUtility.h | |
static UE::Math::TVector2< T > ClosestPointOnSegment2D
(
const UE::Math::TVector2< T >& Point, |
FVector2D version of ClosestPointOnSegment. | Math/UnrealMathUtility.h | |
static FVector ClosestPointOnTetrahedronToPoint
(
const FVector& Point, |
Returns closest point on a tetrahedron to a point. | Math/UnrealMathUtility.h | |
static FVector ClosestPointOnTriangleToPoint
(
const FVector& Point, |
Returns closest point on a triangle to a point. | Math/UnrealMathUtility.h | |
static FVector ComputeBaryCentric2D
(
const FVector& Point, |
Computes the barycentric coordinates for a given point in a 3D triangle. | Math/UnrealMathUtility.h | |
static FVector4 ComputeBaryCentric3D
(
const FVector& Point, |
Computes the barycentric coordinates for a given point on a tetrahedron (3D) | Math/UnrealMathUtility.h | |
static bool ComputeBarycentricTri
(
const FVector& Point, |
Computes the barycentric coordinates for a given point in a triangle | Math/UnrealMathUtility.h | |
static UE::Math::TSphere< FReal > ComputeBoundingSphereForCone
(
UE::Math::TVector< FReal > const& ConeOrigin, |
FMath inline functions Computes minimal bounding sphere encompassing given cone | Math/UnrealMathUtility.h | |
static uint32 ComputeProjectedSphereScissorRect
(
FIntRect& InOutScissorRect, |
@parma InOutScissorRect should be set to View.ViewRect before the call | Math/UnrealMathUtility.h | |
static void CriticallyDampedSmoothing
(
T& InOutValue, |
Smooths a value using a critically damped spring. | Math/UnrealMathUtility.h | |
static T Cube
(
const T A |
Cubes the value | Math/UnrealMathUtility.h | |
static U CubicCRSplineInterp
(
const U& P0, |
Cubic Catmull-Rom Spline interpolation. | Math/UnrealMathUtility.h | |
static U CubicCRSplineInterpSafe
(
const U& P0, |
Same as CubicCRSplineInterp but with additional saftey checks. If the checks fail P1 is returned. | Math/UnrealMathUtility.h | |
static T CubicInterp
(
const T& P0, |
Custom lerps defined for those classes not suited to the default implemenation. | Math/UnrealMathUtility.h | |
static T CubicInterp
(
const T& P0, |
Performs a cubic interpolation | Math/UnrealMathUtility.h | |
static T CubicInterpDerivative
(
const T& P0, |
Performs a first derivative cubic interpolation | Math/UnrealMathUtility.h | |
static T CubicInterpSecondDerivative
(
const T& P0, |
Performs a second derivative cubic interpolation | Math/UnrealMathUtility.h | |
static decltype(DegVal *((3.1415926535897932f)/180.f)) DegreesToRadians
(
T const& DegVal |
Converts degrees to radians. | Math/UnrealMathUtility.h | |
static float DegreesToRadians
(
float const& DegVal |
Math/UnrealMathUtility.h | ||
static double DegreesToRadians
(
double const& DegVal |
Math/UnrealMathUtility.h | ||
static T DivideAndRoundDown
(
T Dividend, |
Divides two integers and rounds down | Math/UnrealMathUtility.h | |
static T DivideAndRoundNearest
(
T Dividend, |
Divides two integers and rounds to nearest | Math/UnrealMathUtility.h | |
static T DivideAndRoundUp
(
T Dividend, |
Divides two integers and rounds up | Math/UnrealMathUtility.h | |
static T DynamicWeightedMovingAverage
(
T CurrentSample, |
Calculates the new value in a weighted moving average series using the previous value and a weight range. | Math/UnrealMathUtility.h | |
static bool Eval
(
FString Str, |
Evaluates a numerical equation. | Math/UnrealMathUtility.h | |
static void ExponentialSmoothingApprox
(
T& InOutValue, |
Smooths a value using exponential damping towards a target. | Math/UnrealMathUtility.h | |
static bool ExtractBoolFromBitfield
(
const uint8* Ptr, |
Get a bit in memory created from bitflags (uint32 Value:1), used for EngineShowFlags, TestBitFieldFunctions() tests the implementation | Math/UnrealMathUtility.h | |
static double FastAsin
(
double Value |
Math/UnrealMathUtility.h | ||
static float FastAsin
(
float Value |
Computes the ASin of a scalar value. | Math/UnrealMathUtility.h | |
static decltype(A1 *A2) FindDeltaAngleDegrees
(
T A1, |
Find the smallest angle between two headings (in degrees) | Math/UnrealMathUtility.h | |
static decltype(A1 *A2) FindDeltaAngleRadians
(
T A1, |
Find the smallest angle between two headings (in radians) | Math/UnrealMathUtility.h | |
static auto FInterpConstantTo
(
T1 Current, |
Interpolate float from Current to Target with constant step | Math/UnrealMathUtility.h | |
static auto FInterpTo
(
T1 Current, |
Interpolate float from Current to Target. | Math/UnrealMathUtility.h | |
static float FixedTurn
(
float InCurrent, |
Returns a new rotation component value | Math/UnrealMathUtility.h | |
static double Floor
(
double F |
Converts a double to a nearest less or equal integer. | Math/UnrealMathUtility.h | |
static float Floor
(
float F |
Converts a float to a nearest less or equal integer. | Math/UnrealMathUtility.h | |
static IntegralType Floor
(
IntegralType I |
Converts an integral type to a nearest less or equal integer. | Math/UnrealMathUtility.h | |
static FString FormatIntToHumanReadable
(
int32 Val |
Formats an integer value into a human readable string (i.e. 12345 becomes "12,345") | Math/UnrealMathUtility.h | |
static float FRandRange
(
float InMin, |
Util to generate a random number in a range. | Math/UnrealMathUtility.h | |
static decltype(X *Y) FRandRange
(
Arg1 X, |
Math/UnrealMathUtility.h | ||
static double FRandRange
(
double InMin, |
Util to generate a random number in a range. | Math/UnrealMathUtility.h | |
static FVector2D GetAzimuthAndElevation
(
const FVector& Direction, |
Returns Azimuth and Elevation of vector 'Direction' in coordinate system O(AxisX,AxisY,AxisZ). | Math/UnrealMathUtility.h | |
static FVector GetBaryCentric2D
(
const FVector2D& Point, |
Computes the barycentric coordinates for a given point in a triangle - simpler than the Compute versions | Math/UnrealMathUtility.h | |
static FVector GetBaryCentric2D
(
const FVector& Point, |
Computes the barycentric coordinates for a given point in a triangle, only considering the XY coordinates - simpler than the Compute versions | Math/UnrealMathUtility.h | |
static bool GetDistanceWithinConeSegment
(
FVector Point, |
Calculates whether a Point is within a cone segment, and also what percentage within the cone (100% is along the center line, whereas 0% is along the edge) | Math/UnrealMathUtility.h | |
static bool GetDotDistance
(
FVector2D& OutDotDist, |
Calculates the dotted distance of vector 'Direction' to coordinate system O(AxisX,AxisY,AxisZ). | Math/UnrealMathUtility.h | |
static T GetMappedRangeValueClamped
(
const TRange< T >& InputRange, |
Math/UnrealMathUtility.h | ||
static auto GetMappedRangeValueClamped
(
const UE::Math::TVector2< T >& InputRange, |
For the given Value clamped to the [Input:Range] inclusive, returns the corresponding percentage in [Output:Range] Inclusive. | Math/UnrealMathUtility.h | |
static auto GetMappedRangeValueUnclamped
(
const UE::Math::TVector2< T >& InputRange, |
Transform the given Value relative to the input range to the Output Range. | Math/UnrealMathUtility.h | |
static auto GetRangePct
(
UE::Math::TVector2< T > const& Range, |
Same as above, but taking a 2d vector as the range. | Math/UnrealMathUtility.h | |
static double GetRangePct
(
TRange< T > const& Range, |
Math/UnrealMathUtility.h | ||
static auto GetRangePct
(
T MinValue, |
Calculates the percentage along a line from MinValue to MaxValue that Value is. | Math/UnrealMathUtility.h | |
static auto GetRangeValue
(
UE::Math::TVector2< T > const& Range, |
Basically a Vector2d version of Lerp. | Math/UnrealMathUtility.h | |
static T GetRangeValue
(
TRange< T > const& Range, |
Math/UnrealMathUtility.h | ||
static FVector GetReflectionVector
(
const FVector& Direction, |
Given a direction vector and a surface normal, returns the vector reflected across the surface normal. | Math/UnrealMathUtility.h | |
static float GetTForSegmentPlaneIntersect
(
const FVector& StartPoint, |
Returns the time (t) of the intersection of the passed segment and a plane (could be <0 or >1) | Math/UnrealMathUtility.h | |
static int32 GreatestCommonDivisor
(
int32 a, |
Use the Euclidean method to find the GCD. | Math/UnrealMathUtility.h | |
static T GridSnap
(
T Location, |
Snaps a value to the nearest grid multiple | Math/UnrealMathUtility.h | |
static decltype(X *Y) GridSnap
(
Arg1 X, |
Allow mixing float/double arguments, promoting to highest precision type. | Math/UnrealMathUtility.h | |
static T InterpCircularIn
(
const T& A, |
Interpolation between A and B, applying a circular in function. | Math/UnrealMathUtility.h | |
static T InterpCircularInOut
(
const T& A, |
Interpolation between A and B, applying a circular in/out function. | Math/UnrealMathUtility.h | |
static T InterpCircularOut
(
const T& A, |
Interpolation between A and B, applying a circular out function. | Math/UnrealMathUtility.h | |
static T InterpEaseIn
(
const T& A, |
Interpolate between A and B, applying an ease in function. Exp controls the degree of the curve. | Math/UnrealMathUtility.h | |
static T InterpEaseInOut
(
const T& A, |
Interpolate between A and B, applying an ease in/out function. | Math/UnrealMathUtility.h | |
static T InterpEaseOut
(
const T& A, |
Interpolate between A and B, applying an ease out function. Exp controls the degree of the curve. | Math/UnrealMathUtility.h | |
static T InterpExpoIn
(
const T& A, |
Interpolation between A and B, applying an exponential in function. | Math/UnrealMathUtility.h | |
static T InterpExpoInOut
(
const T& A, |
Interpolation between A and B, applying an exponential in/out function. | Math/UnrealMathUtility.h | |
static T InterpExpoOut
(
const T& A, |
Interpolation between A and B, applying an exponential out function. | Math/UnrealMathUtility.h | |
static T InterpSinIn
(
const T& A, |
Interpolation between A and B, applying a sinusoidal in function. | Math/UnrealMathUtility.h | |
static T InterpSinInOut
(
const T& A, |
Interpolation between A and B, applying a sinusoidal in/out function. | Math/UnrealMathUtility.h | |
static T InterpSinOut
(
const T& A, |
Interpolation between A and B, applying a sinusoidal out function. | Math/UnrealMathUtility.h | |
static T InterpStep
(
const T& A, |
Interpolation between A and B, applying a step function. | Math/UnrealMathUtility.h | |
static bool IntersectPlanes2
(
UE::Math::TVector< FReal >& I, |
Compute intersection point and direction of line joining two planes. | Math/UnrealMathUtility.h | |
static bool IntersectPlanes3
(
UE::Math::TVector< FReal >& I, |
Compute intersection point of three planes. Return 1 if valid, 0 if infinite. | Math/UnrealMathUtility.h | |
static T InvExpApprox
(
T X |
Returns an approximation of Exp(-X) based on a Taylor expansion that has had the coefficients adjusted (using optimisation) to minimise the error in the range 0 < X < 1, which is below 0.1%. | Math/UnrealMathUtility.h | |
static bool IsNearlyEqual
(
float A, |
Checks if two floating point numbers are nearly equal. | Math/UnrealMathUtility.h | |
static bool IsNearlyEqual
(
double A, |
Math/UnrealMathUtility.h | ||
static bool IsNearlyEqual
(
Arg1 X, |
Math/UnrealMathUtility.h | ||
static bool IsNearlyEqual
(
Arg1 X, |
Math/UnrealMathUtility.h | ||
static bool IsNearlyEqualByULP
(
float A, |
Check if two floating point numbers are nearly equal to within specific number of units of last place (ULP). | Math/UnrealMathUtility.h | |
static bool IsNearlyEqualByULP
(
double A, |
Check if two floating point numbers are nearly equal to within specific number of units of last place (ULP). | Math/UnrealMathUtility.h | |
static bool IsNearlyZero
(
float Value, |
Checks if a floating point number is nearly zero. | Math/UnrealMathUtility.h | |
static bool IsNearlyZero
(
double Value, |
Checks if a floating point number is nearly zero. | Math/UnrealMathUtility.h | |
static bool IsNearlyZero
(
Arg1 X, |
Math/UnrealMathUtility.h | ||
static bool IsPowerOfTwo
(
T Value |
Checks whether a number is a power of two. | Math/UnrealMathUtility.h | |
static bool IsWithin
(
const T& TestValue, |
Checks if value is within a range, exclusive on MaxValue) | Math/UnrealMathUtility.h | |
static bool IsWithinInclusive
(
const T& TestValue, |
Checks if value is within a range, inclusive on MaxValue) | Math/UnrealMathUtility.h | |
static int32 LeastCommonMultiplier
(
int32 a, |
LCM = a/gcd * b a and b are the number we want to find the lcm | Math/UnrealMathUtility.h | |
static T Lerp
(
const T& A, |
Performs a linear interpolation between two values, Alpha ranges from 0-1 | Math/UnrealMathUtility.h | |
| Allow passing of differing A/B types. | Math/UnrealMathUtility.h | ||
static T Lerp
(
const T& A, |
Custom lerps defined for those classes not suited to the default implemenation. | Math/UnrealMathUtility.h | |
static UE::Math::TRotator< T > LerpRange
(
const UE::Math::TRotator< T >& A, |
Rotator specific interpolation Similar to Lerp, but does not take the shortest path. | Math/UnrealMathUtility.h | |
static decltype(A *B) LerpStable
(
const T1& A, |
Allow passing of differing A/B types. | Math/UnrealMathUtility.h | |
static T LerpStable
(
const T& A, |
Performs a linear interpolation between two values, Alpha ranges from 0-1. | Math/UnrealMathUtility.h | |
static T LerpStable
(
const T& A, |
Performs a linear interpolation between two values, Alpha ranges from 0-1. | Math/UnrealMathUtility.h | |
static bool LineBoxIntersection
(
const UE::Math::TBox< FReal >& Box, |
Determines whether a line intersects a box. | Math/UnrealMathUtility.h | |
static bool LineBoxIntersection
(
const UE::Math::TBox< FReal >& Box, |
Determines whether a line intersects a box. | Math/UnrealMathUtility.h | |
static bool LineExtentBoxIntersection
(
const FBox& inBox, |
Swept-Box vs Box test | Math/UnrealMathUtility.h | |
static UE::Math::TVector< FReal > LinePlaneIntersection
(
const UE::Math::TVector< FReal >& Point1, |
Find the intersection of a line and a plane. | Math/UnrealMathUtility.h | |
static UE::Math::TVector< FReal > LinePlaneIntersection
(
const UE::Math::TVector< FReal >& Point1, |
Find the intersection of a line and an offset plane. | Math/UnrealMathUtility.h | |
static bool LineSphereIntersection
(
const UE::Math::TVector< FReal >& Start, |
Determines whether a line intersects a sphere. | Math/UnrealMathUtility.h | |
static double Log2
(
double Value |
Computes the base 2 logarithm of the specified value | Math/UnrealMathUtility.h | |
static float Log2
(
float Value |
Computes the base 2 logarithm of the specified value | Math/UnrealMathUtility.h | |
static float MakePulsatingValue
(
const double InCurrentTime, |
Simple function to create a pulsating scalar value | Math/UnrealMathUtility.h | |
static bool MatrixInverse
(
FMatrix44d* DstMatrix, |
Calculate the inverse of an FMatrix44.Src == Dst is allowed | Math/UnrealMathUtility.h | |
static bool MatrixInverse
(
FMatrix44f* DstMatrix, |
Calculate the inverse of an FMatrix44. | Math/UnrealMathUtility.h | |
static T Max3
(
const T A, |
Returns highest of 3 values | Math/UnrealMathUtility.h | |
static int32 Max3Index
(
const T A, |
Math/UnrealMathUtility.h | ||
static bool MemoryTest
(
void* BaseAddress, |
Tests a memory region to see that it's working properly. | Math/UnrealMathUtility.h | |
static T Min3
(
const T A, |
Returns lowest of 3 values | Math/UnrealMathUtility.h | |
static int32 Min3Index
(
const T A, |
Returns index of the lowest value | Math/UnrealMathUtility.h | |
static auto Modulo
(
ValueType Value, |
Math/UnrealMathUtility.h | ||
static float PerlinNoise1D
(
float Value |
Generates a 1D Perlin noise from the given value. | Math/UnrealMathUtility.h | |
static float PerlinNoise2D
(
const FVector2D& Location |
Generates a 2D Perlin noise sample at the given location. | Math/UnrealMathUtility.h | |
static float PerlinNoise3D
(
const FVector& Location |
Generates a 3D Perlin noise sample at the given location. | Math/UnrealMathUtility.h | |
static bool PlaneAABBIntersection
(
const FPlane& P, |
Determine if a plane and an AABB intersect | Math/UnrealMathUtility.h | |
static int32 PlaneAABBRelativePosition
(
const FPlane& P, |
Determine the position of an AABB relative to a plane: completely above (in the direction of the normal of the plane), completely below or intersects it | Math/UnrealMathUtility.h | |
static bool PointBoxIntersection
(
const UE::Math::TVector< FReal >& Point, |
Determines whether a point is inside a box.FMath inline functions | Math/UnrealMathUtility.h | |
static float PointDistToLine
(
const FVector& Point, |
Calculates the distance of a given Point in world space to a given line, defined by the vector couple (Origin, Direction). | Math/UnrealMathUtility.h | |
static float PointDistToLine
(
const FVector& Point, |
Math/UnrealMathUtility.h | ||
static float PointDistToSegment
(
const FVector& Point, |
Returns distance from a point to the closest point on a segment. | Math/UnrealMathUtility.h | |
static float PointDistToSegmentSquared
(
const FVector& Point, |
Returns square of the distance from a point to the closest point on a segment. | Math/UnrealMathUtility.h | |
static bool PointsAreCoplanar
(
const TArray< FVector >& Points, |
Determines whether a given set of points are coplanar, with a tolerance. | Math/UnrealMathUtility.h | |
static void PolarToCartesian
(
const UE::Math::TVector2< T > InPolar, |
Converts given Polar coordinate pair to Cartesian coordinate system. | Math/UnrealMathUtility.h | |
static void PolarToCartesian
(
const T Rad, |
Converts given Polar coordinate pair to Cartesian coordinate system. | Math/UnrealMathUtility.h | |
static UE::Math::TQuat< T > QInterpConstantTo
(
const UE::Math::TQuat< T >& Current, |
Interpolate quaternion from Current to Target with constant step (in radians) | Math/UnrealMathUtility.h | |
static UE::Math::TQuat< T > QInterpTo
(
const UE::Math::TQuat< T >& Current, |
Interpolate quaternion from Current to Target. | Math/UnrealMathUtility.h | |
static uint8 Quantize8SignedByte
(
float x |
Math/UnrealMathUtility.h | ||
static uint8 Quantize8UnsignedByte
(
float x |
Math/UnrealMathUtility.h | ||
static double RadiansToDegrees
(
double const& RadVal |
Math/UnrealMathUtility.h | ||
static float RadiansToDegrees
(
float const& RadVal |
Math/UnrealMathUtility.h | ||
static decltype(RadVal *(180.f/(3.1415926535897932f))) RadiansToDegrees
(
T const& RadVal |
Converts radians to degrees. | Math/UnrealMathUtility.h | |
static bool RandBool() |
Util to generate a random boolean. | Math/UnrealMathUtility.h | |
static int32 RandHelper
(
int32 A |
Helper function for rand implementations. Returns a random number in [0..A) | Math/UnrealMathUtility.h | |
static int64 RandHelper64
(
int64 A |
Math/UnrealMathUtility.h | ||
static FVector RandPointInBox
(
const FBox& Box |
Returns a random point within the passed in bounding box | Math/UnrealMathUtility.h | |
static FVector2D RandPointInCircle
(
float CircleRadius |
Returns a random point, uniformly distributed, within the specified radius | Math/UnrealMathUtility.h | |
static float RandRange
(
float InMin, |
Util to generate a random number in a range. | Math/UnrealMathUtility.h | |
static int64 RandRange
(
int64 Min, |
Math/UnrealMathUtility.h | ||
static int32 RandRange
(
int32 Min, |
Helper function for rand implementations. Returns a random number >= Min and <= Max | Math/UnrealMathUtility.h | |
static double RandRange
(
double InMin, |
Math/UnrealMathUtility.h | ||
static UE::Math::TVector< FReal > RayPlaneIntersection
(
const UE::Math::TVector< FReal >& RayOrigin, |
Find the intersection of a ray and a plane. | Math/UnrealMathUtility.h | |
static FReal RayPlaneIntersectionParam
(
const UE::Math::TVector< FReal >& RayOrigin, |
Find the intersection of a ray and a plane. | Math/UnrealMathUtility.h | |
static FRotator RInterpConstantTo
(
const FRotator& Current, |
Interpolate rotator from Current to Target with constant step | Math/UnrealMathUtility.h | |
static FRotator RInterpTo
(
const FRotator& Current, |
Interpolate rotator from Current to Target. | Math/UnrealMathUtility.h | |
static float RoundFromZero
(
float F |
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 | Math/UnrealMathUtility.h | |
static double RoundFromZero
(
double F |
Math/UnrealMathUtility.h | ||
static float RoundHalfFromZero
(
float F |
Converts a floating point number to the nearest integer, equidistant ties go to the value which is further from zero: -0.5 becomes -1.0, 0.5 becomes 1.0 | Math/UnrealMathUtility.h | |
static double RoundHalfFromZero
(
double F |
Math/UnrealMathUtility.h | ||
static float RoundHalfToEven
(
float F |
Converts a floating point number to the nearest integer, equidistant ties go to the value which is closest to an even value: 1.5 becomes 2, 0.5 becomes 0 | Math/UnrealMathUtility.h | |
static double RoundHalfToEven
(
double F |
Math/UnrealMathUtility.h | ||
static float RoundHalfToZero
(
float F |
Converts a floating point number to the nearest integer, equidistant ties go to the value which is closer to zero: -0.5 becomes 0, 0.5 becomes 0 | Math/UnrealMathUtility.h | |
static double RoundHalfToZero
(
double F |
Math/UnrealMathUtility.h | ||
static float RoundToNegativeInfinity
(
float F |
Converts a floating point number to an integer which is more negative: 0.1 becomes 0, -0.1 becomes -1 | Math/UnrealMathUtility.h | |
static double RoundToNegativeInfinity
(
double F |
Math/UnrealMathUtility.h | ||
static float RoundToPositiveInfinity
(
float F |
Converts a floating point number to an integer which is more positive: 0.1 becomes 1, -0.1 becomes 0 | Math/UnrealMathUtility.h | |
static double RoundToPositiveInfinity
(
double F |
Math/UnrealMathUtility.h | ||
static float RoundToZero
(
float F |
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 | Math/UnrealMathUtility.h | |
static double RoundToZero
(
double F |
Math/UnrealMathUtility.h | ||
static void SegmentDistToSegment
(
FVector A1, |
Find closest points between 2 segments. | Math/UnrealMathUtility.h | |
static void SegmentDistToSegmentSafe
(
UE::Math::TVector< T > A1, |
Find closest points between 2 segments. | Math/UnrealMathUtility.h | |
static bool SegmentIntersection2D
(
const FVector& SegmentStartA, |
Returns true if there is an intersection between the segment specified by SegmentStartA and SegmentEndA, and the segment specified by SegmentStartB and SegmentEndB, in 2D space. | Math/UnrealMathUtility.h | |
static bool SegmentPlaneIntersection
(
const FVector& StartPoint, |
Returns true if there is an intersection between the segment specified by StartPoint and Endpoint, and the plane on which polygon Plane lies. | Math/UnrealMathUtility.h | |
static bool SegmentTriangleIntersection
(
const FVector& StartPoint, |
Returns true if there is an intersection between the segment specified by StartPoint and Endpoint, and the Triangle defined by A, B and C. | Math/UnrealMathUtility.h | |
static void SetBoolInBitField
(
uint8* Ptr, |
Set a bit in memory created from bitflags (uint32 Value:1), used for EngineShowFlags, TestBitFieldFunctions() tests the implementation | Math/UnrealMathUtility.h | |
static void SinCos
(
std::decay_t< T >* ScalarSin, |
Computes the sine and cosine of a scalar value. | Math/UnrealMathUtility.h | |
static void SinCos
(
T* ScalarSin, |
Math/UnrealMathUtility.h | ||
static void SinCos
(
double* ScalarSin, |
Math/UnrealMathUtility.h | ||
static T SmoothStep
(
T A, |
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. | Math/UnrealMathUtility.h | |
static bool SphereAABBIntersection
(
const UE::Math::TVector< FReal >& SphereCenter, |
Performs a sphere vs box intersection test using Arvo's algorithm: | Math/UnrealMathUtility.h | |
static bool SphereAABBIntersection
(
const UE::Math::TSphere< FReal >& Sphere, |
Converts a sphere into a point plus radius squared for the test above | Math/UnrealMathUtility.h | |
static bool SphereConeIntersection
(
const FVector& SphereCenter, |
Assumes the cone tip is at 0,0,0 (means the SphereCenter is relative to the cone tip) | Math/UnrealMathUtility.h | |
static void SphereDistToLine
(
FVector SphereOrigin, |
Find closest point on a Sphere to a Line. | Math/UnrealMathUtility.h | |
static void SpringDamper
(
T& InOutValue, |
Smooths a value using a spring damper towards a target. | Math/UnrealMathUtility.h | |
static void SpringDamperSmoothing
(
T& InOutValue, |
Smooths a value using a spring damper towards a target. | Math/UnrealMathUtility.h | |
static T Square
(
const T A |
Multiples value by itself | Math/UnrealMathUtility.h | |
static bool TIsNearlyEqualByULP
(
FloatType A, |
Math/UnrealMathUtility.h | ||
static float TruncateToHalfIfClose
(
float F, |
Truncates a floating point number to half if closer than the given tolerance. | Math/UnrealMathUtility.h | |
static double TruncateToHalfIfClose
(
double F, |
Math/UnrealMathUtility.h | ||
static T UnwindDegrees
(
T A |
Utility to ensure angle is between +/- 180 degrees by unwinding. | Math/UnrealMathUtility.h | |
static T UnwindRadians
(
T A |
Given a heading which may be outside the +/- PI range, 'unwind' it back into that range. | Math/UnrealMathUtility.h | |
static FVector2D Vector2DInterpConstantTo
(
const FVector2D& Current, |
Interpolate vector2D from Current to Target with constant step | Math/UnrealMathUtility.h | |
static UE::Math::TVector2< T > Vector2DInterpTo
(
const UE::Math::TVector2< T >& Current, |
Interpolate vector2D from Current to Target. | Math/UnrealMathUtility.h | |
static FVector VInterpConstantTo
(
const FVector& Current, |
Interpolate vector from Current to Target with constant step | Math/UnrealMathUtility.h | |
static FVector VInterpNormalRotationTo
(
const FVector& Current, |
Interpolate a normal vector Current to Target, by interpolating the angle between those vectors with constant step. | Math/UnrealMathUtility.h | |
static FVector VInterpTo
(
const FVector& Current, |
Interpolate vector from Current to Target. | Math/UnrealMathUtility.h | |
static FVector VRand() |
Return a uniformly distributed random unit length vector = point on the unit sphere surface. | Math/UnrealMathUtility.h | |
static FVector VRandCone
(
FVector const& Dir, |
Returns a random unit vector, uniformly distributed, within the specified cone ConeHalfAngleRad is the half-angle of cone, in radians. | Math/UnrealMathUtility.h | |
static FVector VRandCone
(
FVector const& Dir, |
This is a version of VRandCone that handles "squished" cones, i.e. with different angle limits in the Y and Z axes. | Math/UnrealMathUtility.h | |
static T WeightedMovingAverage
(
T CurrentSample, |
Calculates the new value in a weighted moving average series using the previous value and the weight | Math/UnrealMathUtility.h | |
static void WindRelativeAnglesDegrees
(
double InAngle0, |
Math/UnrealMathUtility.h | ||
static void WindRelativeAnglesDegrees
(
float InAngle0, |
Given two angles in degrees, 'wind' the rotation in Angle1 so that it avoids >180 degree flips. | Math/UnrealMathUtility.h | |
static T Wrap
(
const T X, |
Math/UnrealMathUtility.h | ||
static T Wrap
(
const T X, |
Wraps X to be between Min and Max, inclusive. | Math/UnrealMathUtility.h | |
static T WrapExclusive
(
const T X, |
Wraps X to be between Min and Max, exclusive. Will never return Max. | Math/UnrealMathUtility.h | |
static T WrapImpl
(
const T X, |
Math/UnrealMathUtility.h |