FFrameTime

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](API\Runtime\Core\Misc\FFrameRate).

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/FrameTime.h

Include

#include "Misc/FrameTime.h"

Syntax

struct FFrameTime

Remarks

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

Variables

Name Description

Public variable

FFrameNumber

 

FrameNumber

Constructors

Name Description

Public function

FFrameTime()

Default constructor initializing to zero

Public function

FFrameTime

(
    T InFrameNumber
)

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

Public function

FFrameTime

(
    FFrameNumber InFrameNumber
)

Implicit construction from a type-safe frame number

Public function

FFrameTime

(
    FFrameNumber InFrameNumber,
    float InSubFrame
)

Construction from a frame number and a sub frame

Functions

Name Description

Public function Const

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.

Public function Const

FFrameNumber

 

CeilToFrame()

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

Public function Const

FFrameNumber

 

FloorToFrame()

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

Public function Static

FFrameTime

 

FromDecimal

(
    double InDecimalFrame
)

Convert a decimal representation to a frame time

Public function Const

FFrameNumber

 

GetFrame()

Access this time's frame number

Public function Const

float

 

GetSubFrame()

Access this time's sub frame

Public function Const

FFrameNumber

 

RoundToFrame()

Round to the nearest frame number

Operators

Name Description

Public function

FFrameTime &

 

operator=

(
    FFrameNumber InFrameNumber
)

Assignment from a type-safe frame number

Constants

Name

Description

MaxSubframe

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss