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 Note that sub frames are always positive, so negative decimal representations result in an inverted sub frame and floored frame number

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

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback