CelticCraft/Plugins/VoxelFree/Source/Voxel/Public/VoxelRender/MaterialCollections/VoxelCachedMaterialCollection.h

32 lines
1 KiB
C
Raw Permalink Normal View History

2023-07-03 16:17:13 +00:00
// Copyright 2020 Phyronnaz
#pragma once
#include "CoreMinimal.h"
#include "VoxelRender/VoxelMaterialIndices.h"
#include "VoxelRender/MaterialCollections/VoxelMaterialCollectionBase.h"
#include "VoxelCachedMaterialCollection.generated.h"
UCLASS(Abstract)
class VOXEL_API UVoxelCachedMaterialCollection : public UVoxelMaterialCollectionBase
{
GENERATED_BODY()
public:
//~ Begin UVoxelMaterialCollectionBase Interface
virtual UMaterialInterface* GetVoxelMaterial(const FVoxelMaterialIndices& Indices, uint64 UniqueIdForErrors) const override final;
virtual void InitializeCollection() override;
//~ End UVoxelMaterialCollectionBase Interface
//~ Begin UVoxelCachedMaterialCollection Interface
virtual UMaterialInterface* GetVoxelMaterial_NotCached(const FVoxelMaterialIndices& Indices, uint64 UniqueIdForErrors) const
{
unimplemented();
return nullptr;
}
//~ End UVoxelCachedMaterialCollection Interface
private:
UPROPERTY(Transient)
mutable TMap<FVoxelMaterialIndices, TObjectPtr<UMaterialInterface>> CachedMaterials;
};