You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
80 lines
2.8 KiB
C++
80 lines
2.8 KiB
C++
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "GeometryCollection/RecordedTransformTrack.h"
|
|
|
|
#include "GeometryCollectionCache.generated.h"
|
|
|
|
class UGeometryCollection;
|
|
|
|
GEOMETRYCOLLECTIONENGINE_API DECLARE_LOG_CATEGORY_EXTERN(LogGeometryCollectionCache, Log, All);
|
|
|
|
UCLASS(Experimental)
|
|
class GEOMETRYCOLLECTIONENGINE_API UGeometryCollectionCache : public UObject
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
public:
|
|
|
|
/** Tagnames for asset registry tags */
|
|
static FName TagName_Name; // Name of the cache
|
|
static FName TagName_IdGuid; // ID GUID for the cache - never changes for a given cache
|
|
static FName TagName_StateGuid; // State GUID - changes when an edit is made to
|
|
|
|
/**
|
|
* Given a raw track with transforms per-particle on each frame record, set to this cache
|
|
* and strip out any data we don't need (transform repeats and disabled particles etc.)
|
|
*/
|
|
void SetFromRawTrack(const FRecordedTransformTrack& InTrack);
|
|
|
|
/** Set directly from a track, does not do any data stripping. */
|
|
void SetFromTrack(const FRecordedTransformTrack& InTrack);
|
|
|
|
/** Sets the geometry collection that this cache supports, empties the recorded data in this cache */
|
|
void SetSupportedCollection(UGeometryCollection* InCollection);
|
|
|
|
/** UObject Interface */
|
|
virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const override;
|
|
/** End UObject Interface */
|
|
|
|
/** Access the recorded tracks */
|
|
const FRecordedTransformTrack* GetData() const { return &RecordedData; }
|
|
|
|
/** Given a collection, create an empty compatible cache for it */
|
|
static UGeometryCollectionCache* CreateCacheForCollection(UGeometryCollection* InCollection);
|
|
|
|
/** Get the GUID for the state of the supported collection when this cache was last recorded to. */
|
|
FGuid GetCompatibleStateGuid() const { return CompatibleCollectionState; }
|
|
|
|
private:
|
|
|
|
void ProcessRawRecordedDataInternal(const FRecordedTransformTrack& InTrack);
|
|
|
|
/** The recorded data from the simulation */
|
|
UPROPERTY()
|
|
FRecordedTransformTrack RecordedData;
|
|
|
|
/** The collection that we recorded the data from */
|
|
UPROPERTY()
|
|
UGeometryCollection* SupportedCollection;
|
|
|
|
/** Guid pulled from the collection when the recording was last saved */
|
|
UPROPERTY()
|
|
FGuid CompatibleCollectionState;
|
|
|
|
};
|
|
|
|
/**
|
|
* Provider for target caches when recording is requested but we don't have a target cache
|
|
* Initial purpose is to allow an opaque way to call some editor system to generate new assets
|
|
* but this could be expanded later for runtime recording and playback if the need arises
|
|
*/
|
|
class GEOMETRYCOLLECTIONENGINE_API ITargetCacheProvider : public IModularFeature
|
|
{
|
|
public:
|
|
static FName GetFeatureName() { return "GeometryCollectionTargetCacheProvider"; }
|
|
virtual UGeometryCollectionCache* GetCacheForCollection(UGeometryCollection* InCollection) = 0;
|
|
};
|