UChaosCache

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

ChaosCaching

Header

/Engine/Plugins/Experimental/ChaosCaching/Source/ChaosCaching/Public/Chaos/ChaosCache.h

Include

#include "Chaos/ChaosCache.h"

Syntax

UCLASS(Experimental)
class UChaosCache : public UObject

Variables

Name Description

Public variable UProperty

TMap< FName, FR...

 

CurveData

Per component/cache curve data, any continuous data that isn't per-particle can be stored here

Public variable UProperty Category visibleanywhere

uint32

 

NumRecordedFrames

Public variable UProperty

TArray< FPerPar...

 

ParticleTracks

Per-particle data, includes transforms, velocities and other per-particle, per-frame data

Public variable UProperty Category visibleanywhere

float

 

RecordedDuration

Public variable UProperty

TArray< int32 >

 

TrackToParticle

Maps a track index in the cache to the original particle index specified when recording

Constructors

Name Description

Public function

UChaosCache()

Functions

Name Description

Public function

void

 

AddFrame_Concurrent

(
    FPendingFrameWrite&& InFrame
)

Adds a new frame to process to a threadsafe queue for later processing in FlushPendingFrames

Public function

FCacheUserTo...

 

BeginPlayback()

Initialise the cache for playback, may not take any actual action on the cache but will provide the caller with a valid cache user token if it is safe to continue with playback

Public function

FCacheUserTo...

 

BeginRecord

(
    UPrimitiveComponent* InCompone...,
    FGuid InAdapterId,
    const FTransform& SpaceTransform
)

Reset and initialize a cache to make it ready to record the specified component

Public function

void

 

BuildSpawnableFromComponent

(
    UPrimitiveComponent* InCompone...,
    const FTransform& SpaceTransform
)

Initializes the spawnable template from a currently existing component so it can be spawned by the editor when a cache is dragged into the scene.

Public function

void

 

EndPlayback

(
    FCacheUserToken& InOutToken
)

End a playback session for the cache.

Public function

void

 

EndRecord

(
    FCacheUserToken& InOutToken
)

End the recording session for the cache.

Public function

FCacheEvalua...

 

Evaluate

(
    const FCacheEvaluationContext& InC...
)

Evaluate the cache with the specified parameters, returning the evaluated results

Public function

void

 

EvaluateCurves

(
    const FPerParticleCacheData& InDat...,
    float InTime,
    TMap< FName, float >& OutCurves
)

Public function

void

 

EvaluateEvents

(
    FPlaybackTickRecord& InTickRecord,
    TMap< FName, TArray< FCacheEventHan...
)

Public function

void

 

EvaluateSingle

(
    int32 InIndex,
    FPlaybackTickRecord& InTickRecord,
    FTransform* OutOptTransform,
    TMap< FName, float >* OutOptCu...
)

Evaluates a single particle from the tracks array

Public function

void

 

EvaluateTransform

(
    const FPerParticleCacheData& InDat...,
    float InTime,
    FTransform& OutTransform
)

Public function

FCacheEventT...

 

FindOrAddEventTrack

(
    FName InName
)

Public function

void

 

FlushPendingFrames()

As we record post-simulate of physics, we're almost always taking data from a non-main thread (physics thread).

Public function Const

float

 

GetDuration()

Gets the recorded duration of the cache

Public function Const

const FCache...

 

GetSpawnableTemplate()

Read access to the spawnable template stored in the cache

Overridden from UObject

Name Description

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Constants

Name

Description

CurrentVersion

Version 0 : Pre versioning.