UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Chaos::TDataRewindHistory< DataType > Struct Template Reference

#include <RewindData.h>

+ Inheritance diagram for Chaos::TDataRewindHistory< DataType >:

Public Member Functions

FORCEINLINE TDataRewindHistory (const int32 FrameCount, const bool bIsHistoryLocal)
 
FORCEINLINE TDataRewindHistory (const int32 FrameCount)
 
virtual FORCEINLINE ~TDataRewindHistory ()
 
virtual void Initialize ()
 
virtual FORCEINLINE bool HasValidData (const int32 ValidFrame) const override
 
virtual FORCEINLINE bool ExtractData (const int32 ExtractFrame, const bool bResetSolver, void *HistoryData, const bool bExactFrame=false) override
 
virtual FORCEINLINE void MergeData (int32 FromFrame, void *ToData) override
 
FORCEINLINE bool LoadData (const int32 LoadFrame)
 
FORCEINLINE bool EvalData (const int32 EvalFrame)
 
virtual FORCEINLINE bool RecordData (const int32 RecordFrame, const void *HistoryData) override
 
virtual FORCEINLINE bool RecordDataGrowingOrdered (const void *HistoryData) override
 
virtual FORCEINLINE void SetRecordDataIncremental (const bool bInIncremental) override
 
virtual bool CopyAllDataGrowingOrdered (Chaos::FBaseRewindHistory &OutHistory) override
 
DataType & GetCurrentData ()
 
const DataType & GetCurrentData () const
 
DataType & GetAndLoadEarliestData ()
 
DataType * GetAndLoadNextIncrementalData ()
 
FORCEINLINE uint32 NumValidData (const uint32 StartFrame, const uint32 EndFrame) const
 
TArray< DataType > & GetDataHistory ()
 
const TArray< DataType > & GetDataHistoryConst () const
 
virtual const int32 GetLatestFrame () const override
 
virtual const int32 GetEarliestFrame () const override
 
virtual const int32 GetHistorySize () const
 
virtual const bool HasDataInHistory () const
 
FORCEINLINE void ResizeDataHistory (const int32 FrameCount, const EAllowShrinking AllowShrinking=EAllowShrinking::Default) override
 
FORCEINLINE const uint32 GetFrameIndex (const int32 Frame) const
 
virtual FORCEINLINE void ResetFast ()
 
- Public Member Functions inherited from Chaos::FBaseRewindHistory
virtual FORCEINLINE ~FBaseRewindHistory ()
 
virtual TUniquePtr< FBaseRewindHistoryCreateNew () const =0
 
virtual TUniquePtr< FBaseRewindHistoryClone () const =0
 
virtual FORCEINLINE void SetPackageMap (class UPackageMap *InPackageMap)
 
virtual FORCEINLINE int32 CountValidData (const uint32 StartFrame, const uint32 EndFrame, const bool bIncludeUnimportant=true, const bool bIncludeImportant=false)
 
virtual FORCEINLINE int32 CountAlteredData (const bool bIncludeUnimportant=true, const bool bIncludeImportant=false)
 
virtual FORCEINLINE void SetImportant (const bool bImportant, const int32 Frame=INDEX_NONE)
 
virtual FORCEINLINE void ApplyDataRange (const int32 FromFrame, const int32 ToFrame, void *ActorComponent, const bool bOnlyImportant=false)
 
virtual bool CopyAllData (Chaos::FBaseRewindHistory &OutHistory, bool bIncludeUnimportant=true, bool bIncludeImportant=false)
 
virtual bool CopyAlteredData (Chaos::FBaseRewindHistory &OutHistory, bool bIncludeUnimportant=true, bool bIncludeImportant=false)
 
virtual bool CopyData (Chaos::FBaseRewindHistory &OutHistory, const uint32 StartFrame, const uint32 EndFrame, bool bIncludeUnimportant=true, bool bIncludeImportant=false)
 
virtual TUniquePtr< FBaseRewindHistoryCopyFramesWithOffset (const uint32 StartFrame, const uint32 EndFrame, const int32 FrameOffset)=0
 
virtual int32 ReceiveNewData (FBaseRewindHistory &NewData, const int32 FrameOffset, const bool CompareDataForRewind=false, const bool bImportant=false, int32 TryInjectAtFrame=INDEX_NONE)
 
virtual int32 ReceiveNewData (FBaseRewindHistory &NewData, const int32 FrameOffset, const bool CompareDataForRewind=false, const bool bImportant=false)
 
virtual void NetSerialize (FArchive &Ar, UPackageMap *PackageMap)
 
virtual void NetSerialize (FArchive &Ar, UPackageMap *PackageMap, TUniqueFunction< void(void *Data, const int32 DataIndex)> DataSetupFunction)
 
virtual void ValidateDataInHistory (const void *ActorComponent)
 
virtual FORCEINLINE void DebugData (const FString &DebugText)
 
virtual FORCEINLINE void DebugData (const Chaos::FBaseRewindHistory &NewData, TArray< int32 > &LocalFrames, TArray< int32 > &ServerFrames, TArray< int32 > &InputFrames)
 
virtual FORCEINLINE bool RewindStates (const int32 RewindFrame, const bool bResetSolver)
 
virtual FORCEINLINE bool ApplyInputs (const int32 ApplyFrame, const bool bResetSolver)
 

Protected Member Functions

FORCEINLINE int32 ClosestData (const int32 DataFrame, const bool bMinData)
 

Protected Attributes

bool bIsLocalHistory
 
bool bIncremental
 
TArray< DataType > DataHistory
 
int32 LatestFrame
 
int32 CurrentFrame
 
int32 CurrentIndex
 
int32 NumFrames = 0
 

Detailed Description

template<typename DataType>
struct Chaos::TDataRewindHistory< DataType >

Templated data history holding a data buffer

Constructor & Destructor Documentation

◆ TDataRewindHistory() [1/2]

template<typename DataType >
FORCEINLINE Chaos::TDataRewindHistory< DataType >::TDataRewindHistory ( const int32  FrameCount,
const bool  bIsHistoryLocal 
)
inline

◆ TDataRewindHistory() [2/2]

template<typename DataType >
FORCEINLINE Chaos::TDataRewindHistory< DataType >::TDataRewindHistory ( const int32  FrameCount)
inline

◆ ~TDataRewindHistory()

template<typename DataType >
virtual FORCEINLINE Chaos::TDataRewindHistory< DataType >::~TDataRewindHistory ( )
inlinevirtual

Member Function Documentation

◆ ClosestData()

template<typename DataType >
FORCEINLINE int32 Chaos::TDataRewindHistory< DataType >::ClosestData ( const int32  DataFrame,
const bool  bMinData 
)
inlineprotected

Get the closest (min/max) valid data from the data frame

◆ CopyAllDataGrowingOrdered()

template<typename DataType >
virtual bool Chaos::TDataRewindHistory< DataType >::CopyAllDataGrowingOrdered ( Chaos::FBaseRewindHistory OutHistory)
inlineoverridevirtual

Copy all data and record it ordered and growing

Reimplemented from Chaos::FBaseRewindHistory.

◆ EvalData()

template<typename DataType >
FORCEINLINE bool Chaos::TDataRewindHistory< DataType >::EvalData ( const int32  EvalFrame)
inline

Eval the data from the buffer at a specific frame

◆ ExtractData()

template<typename DataType >
virtual FORCEINLINE bool Chaos::TDataRewindHistory< DataType >::ExtractData ( const int32  ExtractFrame,
const bool  bResetSolver,
void HistoryData,
const bool  bExactFrame = false 
)
inlineoverridevirtual

Extract states at a given time

Reimplemented from Chaos::FBaseRewindHistory.

◆ GetAndLoadEarliestData()

template<typename DataType >
DataType & Chaos::TDataRewindHistory< DataType >::GetAndLoadEarliestData ( )
inline

Returns the earliest data entry and loads it as the current data of the history

◆ GetAndLoadNextIncrementalData()

template<typename DataType >
DataType * Chaos::TDataRewindHistory< DataType >::GetAndLoadNextIncrementalData ( )
inline

Returns the next incremental data entry after the CurrentIndex (and loads it as the current data of the history), if there isn't a data entry with a higher LocalFrame value, nullptr is returned

◆ GetCurrentData() [1/2]

template<typename DataType >
DataType & Chaos::TDataRewindHistory< DataType >::GetCurrentData ( )
inline

Current data that is being loaded/recorded

◆ GetCurrentData() [2/2]

template<typename DataType >
const DataType & Chaos::TDataRewindHistory< DataType >::GetCurrentData ( ) const
inline

◆ GetDataHistory()

template<typename DataType >
TArray< DataType > & Chaos::TDataRewindHistory< DataType >::GetDataHistory ( )
inline

◆ GetDataHistoryConst()

template<typename DataType >
const TArray< DataType > & Chaos::TDataRewindHistory< DataType >::GetDataHistoryConst ( ) const
inline

◆ GetEarliestFrame()

template<typename DataType >
virtual const int32 Chaos::TDataRewindHistory< DataType >::GetEarliestFrame ( ) const
inlineoverridevirtual

Return the least up to date frame entry in history

Reimplemented from Chaos::FBaseRewindHistory.

◆ GetFrameIndex()

template<typename DataType >
FORCEINLINE const uint32 Chaos::TDataRewindHistory< DataType >::GetFrameIndex ( const int32  Frame) const
inline

Return circular index for given frame value

◆ GetHistorySize()

template<typename DataType >
virtual const int32 Chaos::TDataRewindHistory< DataType >::GetHistorySize ( ) const
inlinevirtual

Return the max size of the history

Reimplemented from Chaos::FBaseRewindHistory.

◆ GetLatestFrame()

template<typename DataType >
virtual const int32 Chaos::TDataRewindHistory< DataType >::GetLatestFrame ( ) const
inlineoverridevirtual

Return the most up to date frame entry in history

Reimplemented from Chaos::FBaseRewindHistory.

◆ HasDataInHistory()

template<typename DataType >
virtual const bool Chaos::TDataRewindHistory< DataType >::HasDataInHistory ( ) const
inlinevirtual

Return if history has valid data

Reimplemented from Chaos::FBaseRewindHistory.

◆ HasValidData()

template<typename DataType >
virtual FORCEINLINE bool Chaos::TDataRewindHistory< DataType >::HasValidData ( const int32  ValidFrame) const
inlineoverridevirtual

Check if the history buffer contains an entry for the given frame

Reimplemented from Chaos::FBaseRewindHistory.

◆ Initialize()

template<typename DataType >
virtual void Chaos::TDataRewindHistory< DataType >::Initialize ( )
inlinevirtual

Initialize history

Reimplemented from Chaos::FBaseRewindHistory.

◆ LoadData()

template<typename DataType >
FORCEINLINE bool Chaos::TDataRewindHistory< DataType >::LoadData ( const int32  LoadFrame)
inline

Load the data from the buffer at a specific frame

◆ MergeData()

template<typename DataType >
virtual FORCEINLINE void Chaos::TDataRewindHistory< DataType >::MergeData ( int32  FromFrame,
void ToData 
)
inlineoverridevirtual

Iterate over and merge data

Reimplemented from Chaos::FBaseRewindHistory.

◆ NumValidData()

template<typename DataType >
FORCEINLINE uint32 Chaos::TDataRewindHistory< DataType >::NumValidData ( const uint32  StartFrame,
const uint32  EndFrame 
) const
inline

Get the number of valid data in the buffer index range

◆ RecordData()

template<typename DataType >
virtual FORCEINLINE bool Chaos::TDataRewindHistory< DataType >::RecordData ( const int32  RecordFrame,
const void HistoryData 
)
inlineoverridevirtual

Record data into the history buffer at a given time

Reimplemented from Chaos::FBaseRewindHistory.

◆ RecordDataGrowingOrdered()

template<typename DataType >
virtual FORCEINLINE bool Chaos::TDataRewindHistory< DataType >::RecordDataGrowingOrdered ( const void HistoryData)
inlineoverridevirtual

Record data in order and allow growing the history

Reimplemented from Chaos::FBaseRewindHistory.

◆ ResetFast()

template<typename DataType >
virtual FORCEINLINE void Chaos::TDataRewindHistory< DataType >::ResetFast ( )
inlinevirtual

Perform a fast reset, marking the data history as reset but not clearing the data or resetting collections

Reimplemented from Chaos::FBaseRewindHistory.

◆ ResizeDataHistory()

template<typename DataType >
FORCEINLINE void Chaos::TDataRewindHistory< DataType >::ResizeDataHistory ( const int32  FrameCount,
const EAllowShrinking  AllowShrinking = EAllowShrinking::Default 
)
inlineoverridevirtual

Resize the history

Reimplemented from Chaos::FBaseRewindHistory.

◆ SetRecordDataIncremental()

template<typename DataType >
virtual FORCEINLINE void Chaos::TDataRewindHistory< DataType >::SetRecordDataIncremental ( const bool  bInIncremental)
inlineoverridevirtual

Set if this history should only allow overriding of data if it has a higher value than current recorded data

Reimplemented from Chaos::FBaseRewindHistory.

Member Data Documentation

◆ bIncremental

template<typename DataType >
bool Chaos::TDataRewindHistory< DataType >::bIncremental
protected

If this history only record data that is of a higher frame value than previous recorded frame on the same index

◆ bIsLocalHistory

template<typename DataType >
bool Chaos::TDataRewindHistory< DataType >::bIsLocalHistory
protected

Check if the history is on the local/remote client

◆ CurrentFrame

template<typename DataType >
int32 Chaos::TDataRewindHistory< DataType >::CurrentFrame
protected

Current frame that is being loaded/recorded

◆ CurrentIndex

template<typename DataType >
int32 Chaos::TDataRewindHistory< DataType >::CurrentIndex
protected

Current index that is being loaded/recorded

◆ DataHistory

template<typename DataType >
TArray<DataType> Chaos::TDataRewindHistory< DataType >::DataHistory
protected

Data buffer holding the history

◆ LatestFrame

template<typename DataType >
int32 Chaos::TDataRewindHistory< DataType >::LatestFrame
protected

The most up to date frame entry in history

◆ NumFrames

template<typename DataType >
int32 Chaos::TDataRewindHistory< DataType >::NumFrames = 0
protected

Number of frames in data history


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