You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Headers are updated to contain any missing #includes needed to compile and #includes are sorted. Nothing is removed. #ushell-cherrypick of 21065896 by bryan.sefcik #preflight 62d4b1a5a6141b6adfb0c892 #jira #ROBOMERGE-OWNER: Bryan.sefcik #ROBOMERGE-AUTHOR: bryan.sefcik #ROBOMERGE-SOURCE: CL 21150156 via CL 21151754 via CL 21154719 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824) #ROBOMERGE-CONFLICT from-shelf [CL 21181076 by Bryan sefcik in ue5-main branch]
50 lines
1.6 KiB
C++
50 lines
1.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
#pragma once
|
|
|
|
#include "Containers/Array.h"
|
|
#include "Containers/ContainersFwd.h"
|
|
#include "Math/UnrealMathSSE.h"
|
|
#include "Templates/Tuple.h"
|
|
#include "UObject/Class.h"
|
|
#include "UObject/ObjectMacros.h"
|
|
|
|
#include "ClothTetherData.generated.h"
|
|
|
|
class FArchive;
|
|
|
|
/**
|
|
* 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,
|
|
};
|
|
};
|