Navigation
Unreal Engine C++ API Reference > Runtime > Core > Math
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/Math/UnitConversion.h |
Include | #include "Math/UnitConversion.h" |
Syntax
template<typename NumericType>
struct FNumericUnit
Remarks
FNumericUnit is a numeric type that wraps the templated type, whilst a specified unit. It handles conversion to/from related units automatically. The units are considered not to contribute to the type's state, and as such should be considered immutable once set.
Forward declaration of types defined in UnitConversion.h
Variables
Type | Name | Description | |
---|---|---|---|
![]() |
const EUnit | Units | The associated units for the value. |
![]() |
NumericType | Value | The numeric (scalar) value |
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
FNumericUnit () |
Constructors | |
![]() |
FNumericUnit
(
const FNumericUnit& Other |
Copy construction/assignment from the same type | |
![]() |
FNumericUnit
(
const FNumericUnit< OtherType >& Other |
Templated Copy construction/assignment from differing numeric types. | |
![]() |
FNumericUnit
(
const NumericType& InValue, |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
TOptional< FNumericUnit< NumericType > > | ConvertTo
(
EUnit ToUnits |
Convert this quantity to a different unit |
![]() ![]() |
FNumericUnit< NumericType > | Quantizes this number to the most appropriate unit for user friendly presentation (e.g. 1000m returns 1km). | |
![]() ![]() |
TValueOrError< FNumericUnit< NumericType >, FText > | TryParseExpression
(
const TCHAR* InExpression, |
Try and parse an expression into a numeric unit |
![]() ![]() |
TOptional< FNumericUnit< NumericType > > | TryParseString
(
const TCHAR* InSource |
Parse a numeric unit from a string |
Operators
Type | Name | Description | |
---|---|---|---|
![]() |
FNumericUnit & | operator=
(
const FNumericUnit& Other |
|
![]() |
FNumericUnit & | operator=
(
const FNumericUnit< OtherType >& Other |
|
![]() |
FNumericUnit< NumericType > & | operator=
(
const FNumericUnit< OtherType >& Other |