You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
There were two instance of the type being incorrect and they were manually fixed. #rb none [CL 17472048 by Zousar Shaker in ue5-main branch]
53 lines
1.7 KiB
C++
53 lines
1.7 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "ClothingSimulationInteractor.h"
|
|
#include "ClothingAssetBase.h"
|
|
#include "ClothingSimulationInterface.h"
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|