Files
marc audy 311f7464bf Updated ../Engine/Source/Runtime/... to inline gen.cpp files
Before:
3648 unity files
Total CPU Time: 47886.140625 s
Total time in Parallel executor: 498.81 seconds

After:
3548 unity files
Total CPU Time: 46643.828125 s
Total time in Parallel executor: 486.06 seconds

#jira
#preflight

[CL 22173263 by marc audy in ue5-main branch]
2022-09-24 13:57:58 -04:00

56 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "ClothingSimulationInteractor.h"
#include "ClothingAssetBase.h"
#include "ClothingSimulationInterface.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(ClothingSimulationInteractor)
void UClothingSimulationInteractor::CreateClothingInteractor(const UClothingAssetBase* ClothingAsset, int32 ClothingId)
{
if (ClothingAsset)
{
if (UClothingInteractor* const ClothingInteractor = CreateClothingInteractor())
{
ClothingInteractor->ClothingId = ClothingId;
ClothingInteractors.Emplace(ClothingAsset->GetName(), ClothingInteractor);
}
}
}
void UClothingSimulationInteractor::DestroyClothingInteractors()
{
ClothingInteractors.Reset();
}
UClothingInteractor* UClothingSimulationInteractor::GetClothingInteractor(const FString& ClothingAssetName) const
{
if (const TObjectPtr<UClothingInteractor>* ClothingInteractor = ClothingInteractors.Find(FName(ClothingAssetName)))
{
return *ClothingInteractor;
}
// Returning the default object will still make this a valid ClothingInteractor pointer, but one with no type or interface
return UClothingInteractor::StaticClass()->GetDefaultObject<UClothingInteractor>();
}
void UClothingSimulationInteractor::Sync(IClothingSimulation* Simulation, IClothingSimulationContext* Context)
{
LastNumCloths = Simulation->GetNumCloths();
LastNumKinematicParticles = Simulation->GetNumKinematicParticles();
LastNumDynamicParticles = Simulation->GetNumDynamicParticles();
LastNumIterations = Simulation->GetNumIterations();
LastNumSubsteps = Simulation->GetNumSubsteps();
LastSimulationTime = Simulation->GetSimulationTime();
for (const auto& ClothingInteractor : UClothingSimulationInteractor::ClothingInteractors)
{
if (ClothingInteractor.Value)
{
ClothingInteractor.Value->Sync(Simulation);
}
}
}