UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FFrameTime Struct Reference

#include <FrameTime.h>

Public Member Functions

 FFrameTime ()
 
template<typename T , typename = typename TEnableIf<std::is_same_v<T, int32>>::Type>
 FFrameTime (T InFrameNumber)
 
 FFrameTime (FFrameNumber InFrameNumber)
 
 FFrameTime (FFrameNumber InFrameNumber, float InSubFrame)
 
FFrameTimeoperator= (FFrameNumber InFrameNumber)
 
bool Serialize (FArchive &Ar)
 
UE_FORCEINLINE_HINT FFrameNumber GetFrame () const
 
UE_FORCEINLINE_HINT float GetSubFrame () const
 
FFrameNumber FloorToFrame () const
 
FFrameNumber CeilToFrame () const
 
FFrameNumber RoundToFrame () const
 
double AsDecimal () const
 

Static Public Member Functions

static FFrameTime FromDecimal (double InDecimalFrame)
 

Public Attributes

FFrameNumber FrameNumber
 

Static Public Attributes

static CORE_API const float MaxSubframe = 0.99999994f
 

Friends

FArchiveoperator<< (FArchive &Ar, FFrameTime &FrameTime)
 
UE_FORCEINLINE_HINT bool operator== (FFrameTime A, FFrameTime B)
 
UE_FORCEINLINE_HINT bool operator!= (FFrameTime A, FFrameTime B)
 
UE_FORCEINLINE_HINT bool operator> (FFrameTime A, FFrameTime B)
 
UE_FORCEINLINE_HINT bool operator>= (FFrameTime A, FFrameTime B)
 
UE_FORCEINLINE_HINT bool operator< (FFrameTime A, FFrameTime B)
 
UE_FORCEINLINE_HINT bool operator<= (FFrameTime A, FFrameTime B)
 
FFrameTimeoperator+= (FFrameTime &LHS, FFrameTime RHS)
 
FFrameTime operator+ (FFrameTime A, FFrameTime B)
 
FFrameTimeoperator-= (FFrameTime &LHS, FFrameTime RHS)
 
FFrameTime operator- (FFrameTime A, FFrameTime B)
 
FFrameTime operator% (FFrameTime A, FFrameTime B)
 
FFrameTime operator- (FFrameTime A)
 
UE_FORCEINLINE_HINT FFrameTime operator* (FFrameTime A, double Scalar)
 
UE_FORCEINLINE_HINT FFrameTime operator* (double Scalar, FFrameTime A)
 
UE_FORCEINLINE_HINT FFrameTime operator/ (FFrameTime A, double Scalar)
 

Detailed Description

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

Constructor & Destructor Documentation

◆ FFrameTime() [1/4]

FFrameTime::FFrameTime ( )
inline

Default constructor initializing to zero

◆ FFrameTime() [2/4]

template<typename T , typename >
FFrameTime::FFrameTime ( InFrameNumber)

Implicit construction from a single integer, while disallowing implicit conversion from any other numeric type

◆ FFrameTime() [3/4]

FFrameTime::FFrameTime ( FFrameNumber  InFrameNumber)
inline

Implicit construction from a type-safe frame number

◆ FFrameTime() [4/4]

FFrameTime::FFrameTime ( FFrameNumber  InFrameNumber,
float  InSubFrame 
)
inline

Construction from a frame number and a sub frame

Member Function Documentation

◆ AsDecimal()

UE_FORCEINLINE_HINT double FFrameTime::AsDecimal ( ) const

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.

◆ CeilToFrame()

UE_FORCEINLINE_HINT FFrameNumber FFrameTime::CeilToFrame ( ) const

Return the next frame number greater than or equal to this frame time

◆ FloorToFrame()

UE_FORCEINLINE_HINT FFrameNumber FFrameTime::FloorToFrame ( ) const

Return the first frame number less than or equal to this frame time

◆ FromDecimal()

FFrameTime FFrameTime::FromDecimal ( double  InDecimalFrame)
inlinestatic

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

◆ GetFrame()

UE_FORCEINLINE_HINT FFrameNumber FFrameTime::GetFrame ( ) const
inline

Access this time's frame number

◆ GetSubFrame()

UE_FORCEINLINE_HINT float FFrameTime::GetSubFrame ( ) const
inline

Access this time's sub frame

◆ operator=()

FFrameTime & FFrameTime::operator= ( FFrameNumber  InFrameNumber)
inline

Assignment from a type-safe frame number

◆ RoundToFrame()

UE_FORCEINLINE_HINT FFrameNumber FFrameTime::RoundToFrame ( ) const

Round to the nearest frame number

◆ Serialize()

bool FFrameTime::Serialize ( FArchive Ar)
inline

Serializes the given FrameTime from or into the specified archive

Friends And Related Symbol Documentation

◆ operator!=

◆ operator%

FFrameTime operator% ( FFrameTime  A,
FFrameTime  B 
)
friend

◆ operator* [1/2]

UE_FORCEINLINE_HINT FFrameTime operator* ( double  Scalar,
FFrameTime  A 
)
friend

◆ operator* [2/2]

UE_FORCEINLINE_HINT FFrameTime operator* ( FFrameTime  A,
double  Scalar 
)
friend

◆ operator+

FFrameTime operator+ ( FFrameTime  A,
FFrameTime  B 
)
friend

◆ operator+=

FFrameTime & operator+= ( FFrameTime LHS,
FFrameTime  RHS 
)
friend

◆ operator- [1/2]

FFrameTime operator- ( FFrameTime  A)
friend

◆ operator- [2/2]

FFrameTime operator- ( FFrameTime  A,
FFrameTime  B 
)
friend

◆ operator-=

FFrameTime & operator-= ( FFrameTime LHS,
FFrameTime  RHS 
)
friend

◆ operator/

UE_FORCEINLINE_HINT FFrameTime operator/ ( FFrameTime  A,
double  Scalar 
)
friend

◆ operator<

UE_FORCEINLINE_HINT bool operator< ( FFrameTime  A,
FFrameTime  B 
)
friend

◆ operator<<

FArchive & operator<< ( FArchive Ar,
FFrameTime FrameTime 
)
friend

Serializes the given FrameTime from or into the specified archive.

Parameters
ArThe archive to serialize from or into.
FrameTimeThe frame time to serialize.
Returns
The archive used for serialization.

◆ operator<=

UE_FORCEINLINE_HINT bool operator<= ( FFrameTime  A,
FFrameTime  B 
)
friend

◆ operator==

UE_FORCEINLINE_HINT bool operator== ( FFrameTime  A,
FFrameTime  B 
)
friend

◆ operator>

UE_FORCEINLINE_HINT bool operator> ( FFrameTime  A,
FFrameTime  B 
)
friend

◆ operator>=

UE_FORCEINLINE_HINT bool operator>= ( FFrameTime  A,
FFrameTime  B 
)
friend

Member Data Documentation

◆ FrameNumber

FFrameNumber FFrameTime::FrameNumber

IMPORTANT: If you change the struct data, ensure that you also update the version in NoExportTypes.h

◆ MaxSubframe

const float FFrameTime::MaxSubframe = 0.99999994f
static

The documentation for this struct was generated from the following files: