2023-03-31 02:58:27 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "UObject/Interface.h"
|
|
|
|
|
|
|
|
|
|
#include "GeometryCollectionExternalRenderInterface.generated.h"
|
|
|
|
|
|
|
|
|
|
class UGeometryCollection;
|
2023-04-03 10:06:24 -04:00
|
|
|
class UGeometryCollectionComponent;
|
2023-03-31 02:58:27 -04:00
|
|
|
|
2023-06-17 18:13:06 -04:00
|
|
|
UINTERFACE(MinimalAPI)
|
|
|
|
|
class UGeometryCollectionExternalRenderInterface : public UInterface
|
2023-03-31 02:58:27 -04:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
};
|
|
|
|
|
|
2023-06-17 18:13:06 -04:00
|
|
|
class IGeometryCollectionExternalRenderInterface
|
2023-03-31 02:58:27 -04:00
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
|
|
|
|
|
public:
|
2023-10-12 20:59:48 -04:00
|
|
|
enum EStateFlags
|
|
|
|
|
{
|
|
|
|
|
EState_Visible = 1 << 0,
|
|
|
|
|
EState_Broken = 1 << 1,
|
|
|
|
|
EState_ForcedBroken = 1 << 2,
|
|
|
|
|
};
|
|
|
|
|
|
2023-04-03 10:06:24 -04:00
|
|
|
virtual void OnRegisterGeometryCollection(UGeometryCollectionComponent const& InComponent) = 0;
|
|
|
|
|
virtual void OnUnregisterGeometryCollection() = 0;
|
2024-03-25 18:45:40 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Set the state of the geometry collection
|
|
|
|
|
* this is used by the renderer to managed resources with regards to the state ( see EStateFlags )
|
|
|
|
|
*/
|
2023-10-12 20:59:48 -04:00
|
|
|
virtual void UpdateState(UGeometryCollection const& InGeometryCollection, FTransform const& InComponentTransform, uint32 InStateFlags) = 0;
|
2024-03-25 18:45:40 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update the root bone transform of the geometry collection
|
|
|
|
|
* if the geometry collection is using of multiple proxy root meshes this transform applies to all of them
|
|
|
|
|
*/
|
2023-04-06 17:29:18 -04:00
|
|
|
virtual void UpdateRootTransform(UGeometryCollection const& InGeometryCollection, FTransform const& InRootTransform) = 0;
|
2024-03-25 18:45:40 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update the root proxy transforms of the geometry collection
|
|
|
|
|
* if the geometry collection is using of multiple proxy root meshes, InRootTransforms is expected to contain an entry for each of them
|
|
|
|
|
* @param InRootTransform Component space root transform
|
|
|
|
|
* @param InRootLocalTransforms Root space local transforms
|
|
|
|
|
*/
|
2024-03-25 18:45:47 -04:00
|
|
|
virtual void UpdateRootTransforms(UGeometryCollection const& InGeometryCollection, FTransform const& InRootTransform, TArrayView<const FTransform3f> InRootLocalTransforms) { check(false); };
|
2024-03-25 18:45:40 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update all the bones transforms
|
|
|
|
|
*/
|
2023-10-16 12:20:18 -04:00
|
|
|
virtual void UpdateTransforms(UGeometryCollection const& InGeometryCollection, TArrayView<const FTransform3f> InTransforms) = 0;
|
2023-05-11 19:37:23 -04:00
|
|
|
|
2024-03-01 18:07:13 -05:00
|
|
|
// todo: Maybe move this to a separate ISMPool renderer interface? But maybe that is overengineering?
|
|
|
|
|
virtual void SetCustomInstanceData(int32 CustomFloatIndex, float CustomFloatValue) {}
|
|
|
|
|
|
2023-10-12 20:59:48 -04:00
|
|
|
UE_DEPRECATED(5.4, "Use flags version of UpdateState instead")
|
|
|
|
|
virtual void UpdateState(UGeometryCollection const& InGeometryCollection, FTransform const& InComponentTransform, bool bInIsBroken, bool bInIsVisible)
|
|
|
|
|
{
|
|
|
|
|
uint32 StateFlags = 0;
|
|
|
|
|
StateFlags |= bInIsVisible ? IGeometryCollectionExternalRenderInterface::EState_Visible : 0;
|
|
|
|
|
StateFlags |= bInIsBroken ? IGeometryCollectionExternalRenderInterface::EState_Broken : 0;
|
|
|
|
|
return UpdateState(InGeometryCollection, InComponentTransform, StateFlags);
|
|
|
|
|
};
|
2023-05-11 19:37:23 -04:00
|
|
|
UE_DEPRECATED(5.3, "Use FTransform version of UpdateTransforms instead")
|
|
|
|
|
virtual void UpdateTransforms(UGeometryCollection const& InGeometryCollection, TArrayView<const FMatrix> InMatrices) {};
|
2023-03-31 02:58:27 -04:00
|
|
|
};
|