You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Cloth - Tidy up ClothingAsset and ClothPhysicalMeshData to allow for more cloth data caching. #rb Benn.Gallagher, Cedric.Caillaud, Michael.Forot #preflight 16823444 #ROBOMERGE-SOURCE: CL 16882246 #ROBOMERGE-BOT: (v836-16769935) [CL 16913004 by kriss gossart in ue5-main branch]
43 lines
1.5 KiB
C++
43 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
#pragma once
|
|
|
|
#include "Containers/ContainersFwd.h"
|
|
|
|
#include "ClothTetherData.generated.h"
|
|
|
|
/**
|
|
* Long range attachment tether pathfinding based on Dijkstra's algorithm.
|
|
* For more information about the long range attachment, see:
|
|
* https://matthias-research.github.io/pages/publications/sca2012cloth.pdf
|
|
*/
|
|
USTRUCT()
|
|
struct FClothTetherData
|
|
{
|
|
GENERATED_BODY()
|
|
|
|
/** Long range attachment tether start/end/length, sorted in sequential batches of independant tethers. */
|
|
TArray<TArray<TTuple<int32, int32, float>>> Tethers;
|
|
|
|
/**
|
|
* Generate the tethers by following the triangle mesh network from the closest kinematic to each dynamic point.
|
|
* Inside array items can be processed concurrently, but the outside array must be iterated on sequentially.
|
|
*/
|
|
void GenerateTethers(
|
|
const TConstArrayView<FVector3f>& Points, // Reference pose
|
|
const TConstArrayView<uint32>& Indices, // Triangle mesh
|
|
const TConstArrayView<float>& MaxDistances, // Mask for sorting the kinematic from the dynamic points
|
|
bool bUseGeodesicDistance); // Whether to use geodesic (walking along the sruface) or euclidean (beeline) distances to find the tethers.
|
|
|
|
/** Custom serializer, since neiher an array of array nor a tuple can be set as a UPROPERTY. */
|
|
bool Serialize(FArchive& Ar);
|
|
};
|
|
|
|
template<>
|
|
struct TStructOpsTypeTraits<FClothTetherData> : public TStructOpsTypeTraitsBase2<FClothTetherData>
|
|
{
|
|
enum
|
|
{
|
|
WithSerializer = true,
|
|
};
|
|
};
|