Navigation
API > API/Runtime > API/Runtime/Core
Structure representing a time by a context-free frame number, plus a sub frame value in the range [0:1) Conversion to and from time in seconds is achieved in combination with FFrameRate. Only the frame number part of this representation can be negative, sub frames are always a positive value between the frame number and its next logical frame
| Name | FFrameTime |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Misc/FrameTime.h |
| Include Path | #include "Misc/FrameTime.h" |
Syntax
struct FFrameTime
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FFrameTime () |
Default constructor initializing to zero | Misc/FrameTime.h | |
FFrameTime
(
T InFrameNumber |
Implicit construction from a single integer, while disallowing implicit conversion from any other numeric type | Misc/FrameTime.h | |
FFrameTime
(
FFrameNumber InFrameNumber |
Implicit construction from a type-safe frame number | Misc/FrameTime.h | |
FFrameTime
(
FFrameNumber InFrameNumber, |
Construction from a frame number and a sub frame | Misc/FrameTime.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| MaxSubframe | const float | Misc/FrameTime.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| FrameNumber | FFrameNumber | IMPORTANT: If you change the struct data, ensure that you also update the version in NoExportTypes.h | Misc/FrameTime.h |
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| SubFrame | float | Must be 0.f <= SubFrame < 1.f | Misc/FrameTime.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
double AsDecimal() |
Retrieve a decimal representation of this frame time Sub frames are always added to the current frame number, so for negative frame times, a time of -10 [sub frame 0.25] will yield a decimal value of -9.75. | Misc/FrameTime.h | |
FFrameNumber CeilToFrame() |
Return the next frame number greater than or equal to this frame time | Misc/FrameTime.h | |
FFrameNumber FloorToFrame() |
Return the first frame number less than or equal to this frame time | Misc/FrameTime.h | |
FFrameNumber GetFrame() |
Access this time's frame number | Misc/FrameTime.h | |
float GetSubFrame() |
Access this time's sub frame | Misc/FrameTime.h | |
FFrameNumber RoundToFrame() |
Round to the nearest frame number | Misc/FrameTime.h | |
bool Serialize
(
FArchive& Ar |
Serializes the given FrameTime from or into the specified archive | Misc/FrameTime.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FFrameTime FromDecimal
(
double InDecimalFrame |
Convert a decimal representation to a frame time Note that sub frames are always positive, so negative decimal representations result in an inverted sub frame and floored frame number | Misc/FrameTime.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FFrameTime & operator=
(
FFrameNumber InFrameNumber |
Assignment from a type-safe frame number | Misc/FrameTime.h |