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