2021-04-29 18:12:32 -04:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "GeometryProcessingInterfacesModule.h"
|
|
|
|
|
#include "CoreGlobals.h"
|
|
|
|
|
#include "Features/IModularFeatures.h"
|
|
|
|
|
#include "Modules/ModuleManager.h"
|
|
|
|
|
|
|
|
|
|
#include "GeometryProcessingInterfaces/ApproximateActors.h"
|
2023-02-26 21:00:47 -05:00
|
|
|
#include "GeometryProcessingInterfaces/CombineMeshInstances.h"
|
2021-04-29 18:12:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FGeometryProcessingInterfacesModule, GeometryProcessingInterfaces);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FGeometryProcessingInterfacesModule::StartupModule()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FGeometryProcessingInterfacesModule::ShutdownModule()
|
|
|
|
|
{
|
|
|
|
|
ApproximateActors = nullptr;
|
2023-02-26 21:00:47 -05:00
|
|
|
CombineMeshInstances = nullptr;
|
2021-04-29 18:12:32 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IGeometryProcessing_ApproximateActors* FGeometryProcessingInterfacesModule::GetApproximateActorsImplementation()
|
|
|
|
|
{
|
|
|
|
|
if (ApproximateActors == nullptr)
|
|
|
|
|
{
|
|
|
|
|
TArray<IGeometryProcessing_ApproximateActors*> ApproximateActorsOptions =
|
|
|
|
|
IModularFeatures::Get().GetModularFeatureImplementations<IGeometryProcessing_ApproximateActors>(IGeometryProcessing_ApproximateActors::GetModularFeatureName());
|
|
|
|
|
|
|
|
|
|
ApproximateActors = (ApproximateActorsOptions.Num() > 0) ? ApproximateActorsOptions[0] : nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return ApproximateActors;
|
|
|
|
|
}
|
2023-02-26 21:00:47 -05:00
|
|
|
IGeometryProcessing_CombineMeshInstances* FGeometryProcessingInterfacesModule::GetCombineMeshInstancesImplementation()
|
|
|
|
|
{
|
2023-03-07 15:37:16 -05:00
|
|
|
if (CombineMeshInstances == nullptr)
|
2023-02-26 21:00:47 -05:00
|
|
|
{
|
|
|
|
|
TArray<IGeometryProcessing_CombineMeshInstances*> CombineMeshInstancesOptions =
|
|
|
|
|
IModularFeatures::Get().GetModularFeatureImplementations<IGeometryProcessing_CombineMeshInstances>(IGeometryProcessing_CombineMeshInstances::GetModularFeatureName());
|
|
|
|
|
|
|
|
|
|
CombineMeshInstances = (CombineMeshInstancesOptions.Num() > 0) ? CombineMeshInstancesOptions[0] : nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return CombineMeshInstances;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|