struct
FMath
- Module
- Core
- Header
#include "Core/FMath.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
static constexpr float | SmallNumber | Default 1e-4f. |
static constexpr float | KindaSmallNumber | the looser float epsilon Default 1e-3f. |
static constexpr float | Pi | Default Mowo::PI. |
static constexpr float | TwoPi | Default Mowo::TWO_PI. |
static constexpr float | HalfPi | Default Mowo::HALF_PI. |
static constexpr float | DegToRad | Default Mowo::DEG2RAD. |
static constexpr float | RadToDeg | Default Mowo::RAD2DEG. |
Public functions
| Returns | Name | Description |
|---|---|---|
T | Min | |
T | Max | |
T | Clamp | |
T | Lerp | |
float | SmoothStep | Smooth-step (Hermite, t in [0,1]). |
float | FInterpTo | Frame-rate-independent exponential approach. |
float | MapRange | |
float | MapRangeClamped | |
T | Square | |
T | Cube | |
>> bool | IsPowerOfTwo | |
uint32_t | RoundUpToPowerOfTwo | |
uint32_t | DivideAndRoundUp | |
uint64_t | AlignUp | Any alignment, not only powers of two; 0 and 1 leave the value alone. |
bool | IsNearlyEqual | |
bool | IsNearlyZero | |
T | Abs | |
T | Sign | |
float | DegreesToRadians | |
float | RadiansToDegrees |
Function details
Min
C++
template<typename T> static constexpr T Min(T a, T b) noexceptMax
C++
template<typename T> static constexpr T Max(T a, T b) noexceptClamp
C++
template<typename T> static constexpr T Clamp(T value, T lo, T hi) noexceptLerp
C++
template<typename T> static constexpr T Lerp(T a, T b, float t) noexceptSmoothStep
C++
static constexpr float SmoothStep(float t) noexceptSmooth-step (Hermite, t in [0,1]).
FInterpTo
C++
static float FInterpTo(float current, float target, float dt, float rate)Frame-rate-independent exponential approach. current moves toward target by 1 - exp(-rate * dt).
MapRange
C++
static constexpr float MapRange(float value, float inMin, float inMax, float outMin, float outMax) noexceptMapRangeClamped
C++
static constexpr float MapRangeClamped(float value, float inMin, float inMax, float outMin, float outMax) noexceptSquare
C++
template<typename T> static constexpr T Square(T v) noexceptCube
C++
template<typename T> static constexpr T Cube(T v) noexceptIsPowerOfTwo
C++
template<typename T, typename = std::enable_if_t<std::is_integral_v<T>>> static constexpr bool IsPowerOfTwo(T v) noexceptRoundUpToPowerOfTwo
C++
static constexpr uint32_t RoundUpToPowerOfTwo(uint32_t v) noexceptDivideAndRoundUp
C++
static constexpr uint32_t DivideAndRoundUp(uint32_t value, uint32_t divisor) noexceptAlignUp
C++
static constexpr uint64_t AlignUp(uint64_t value, uint64_t alignment) noexceptAny alignment, not only powers of two; 0 and 1 leave the value alone.
IsNearlyEqual
C++
static bool IsNearlyEqual(float a, float b, float eps = SmallNumber) noexceptIsNearlyZero
C++
static bool IsNearlyZero(float v, float eps = SmallNumber) noexceptAbs
C++
template<typename T> static constexpr T Abs(T v) noexceptSign
C++
template<typename T> static constexpr T Sign(T v) noexceptDegreesToRadians
C++
static constexpr float DegreesToRadians(float deg) noexceptRadiansToDegrees
C++
static constexpr float RadiansToDegrees(float rad) noexceptGenerated from Core/FMath.h via core.json · Nov 5, 2026Version 1.0.0