Files
UnrealEngineUWP/Engine/Source/Runtime/ClothingSystemRuntimeInterface/Private/ClothPhysicalMeshDataBase.cpp
kriss gossart 9b11c2a5bd Rename ClothPhysicalMeshData files to ClothPhysicalMeshDataBase to match the other class/file names and allow for a common runtime version.
[FYI] Benn.Gallagher, Jaco.VanDyk


#ROBOMERGE-SOURCE: CL 10005752 via CL 10005832
#ROBOMERGE-BOT: (v562-10004402)

[CL 10005847 by kriss gossart in Main branch]
2019-11-05 07:32:18 -05:00

65 lines
1.4 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "ClothPhysicalMeshDataBase.h"
UClothPhysicalMeshDataBase::UClothPhysicalMeshDataBase()
: NumFixedVerts(0)
, MaxBoneWeights(0)
{}
UClothPhysicalMeshDataBase::~UClothPhysicalMeshDataBase()
{}
void UClothPhysicalMeshDataBase::Reset(const int32 InNumVerts)
{
Vertices.Reset();
Normals.Reset();
#if WITH_EDITORONLY_DATA
VertexColors.Reset();
#endif // #if WITH_EDITORONLY_DATA
InverseMasses.Reset();
BoneData.Reset();
Vertices.AddDefaulted(InNumVerts);
Normals.AddDefaulted(InNumVerts);
#if WITH_EDITORONLY_DATA
VertexColors.AddDefaulted(InNumVerts);
#endif //#if WITH_EDITORONLY_DATA
InverseMasses.AddDefaulted(InNumVerts);
BoneData.AddDefaulted(InNumVerts);
NumFixedVerts = 0;
MaxBoneWeights = 0;
}
TArray<float>* UClothPhysicalMeshDataBase::GetFloatArray(const uint32 Id) const
{
check(IdToArray.Contains(Id));
return IdToArray[Id];
}
TArray<uint32> UClothPhysicalMeshDataBase::GetFloatArrayIds() const
{
TArray<uint32> Keys;
IdToArray.GetKeys(Keys);
return Keys;
}
TArray<TArray<float>*> UClothPhysicalMeshDataBase::GetFloatArrays() const
{
TArray<TArray<float>*> Values;
IdToArray.GenerateValueArray(Values);
return Values;
}
void UClothPhysicalMeshDataBase::RegisterFloatArray(
const uint32 Id,
TArray<float> *Array)
{
check(Id != INDEX_NONE);
check(Array != nullptr);
check(!IdToArray.Contains(Id) || IdToArray[Id] == Array);
IdToArray.Add(Id, Array);
}