CToolMath

Overview

Math utility functions.

Functions

Name Description
unixTimeStamp Returns current time as milliseconds since Unix epoch (double).
pointOnCercle Distribute points evenly in a circle around a center point.
roundFloat Round a float to N decimal places.
shuffle Randomly shuffle an array using a seeded random stream.
easeAlpha Apply an easing function to an alpha value.
easeIt Interpolate between A and B with easing.
double ts = unixTimeStamp();

// 8 points in a circle of radius 100 around (50, 50)
TArray<FVector2D> points = pointOnCercle(FVector2D(50, 50), 8, 100.0f);

float rounded = roundFloat(3.14159f, 2); // 3.14

TArray<int> arr = {1, 2, 3, 4, 5};
shuffle(myRandomStream, arr);

float eased = easeAlpha(0.5f, EAlphaBlendOption::EaseIn);
float val = easeIt(0.0f, 100.0f, 0.5f, EAlphaBlendOption::EaseInOut);