UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ClothPhysicalMeshData.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "ClothTetherData.h"
5#include "ClothVertBoneData.h"
6#include "Containers/Array.h"
7#include "Containers/Map.h"
8#include "CoreTypes.h"
9#include "Math/Color.h"
10#include "Math/UnrealMathSSE.h"
11#include "Math/Vector.h"
12#include "PointWeightMap.h"
14
15#include "ClothPhysicalMeshData.generated.h"
16
17class FName;
20struct FPointWeightMap;
21template <typename T> struct TObjectPtr;
22
24USTRUCT()
26{
28
29
36
38 CLOTHINGSYSTEMRUNTIMECOMMON_API void MigrateFrom(FClothPhysicalMeshData& ClothPhysicalMeshData);
39
42
45
47 CLOTHINGSYSTEMRUNTIMECOMMON_API void ClearWeightMaps();
48
50 CLOTHINGSYSTEMRUNTIMECOMMON_API void BuildSelfCollisionData(float SelfCollisionRadius);
51
53 CLOTHINGSYSTEMRUNTIMECOMMON_API void CalculateInverseMasses();
54
56 CLOTHINGSYSTEMRUNTIMECOMMON_API void CalculateNumInfluences();
57
60
62 template<typename T>
63 bool HasWeightMap(const T Target) const { return WeightMaps.Contains((uint32)Target); }
64
66 template<typename T>
67 const FPointWeightMap* FindWeightMap(const T Target) const { return WeightMaps.Find((uint32)Target); }
68
70 template<typename T>
71 FPointWeightMap* FindWeightMap(const T Target) { return WeightMaps.Find((uint32)Target); }
72
74 template<typename T>
75 FPointWeightMap& AddWeightMap(const T Target) { return WeightMaps.Add((uint32)Target); }
76
78 template<typename T>
79 FPointWeightMap& FindOrAddWeightMap(const T Target) { return WeightMaps.FindOrAdd((uint32)Target); }
80
82 template<typename T>
83 const FPointWeightMap& GetWeightMap(const T Target) const { return WeightMaps[(uint32)Target]; }
84
86 template<typename T>
87 FPointWeightMap& GetWeightMap(const T Target) { return WeightMaps[(uint32)Target]; }
88
89 // Positions of each simulation vertex
90 UPROPERTY(EditAnywhere, Category = SimMesh)
91 TArray<FVector3f> Vertices;
92
93 // Normal at each vertex
94 UPROPERTY(EditAnywhere, Category = SimMesh)
96
97#if WITH_EDITORONLY_DATA
98 // Color at each vertex
99 UPROPERTY(EditAnywhere, Category = SimMesh)
101#endif // WITH_EDITORONLY_DATA
102
103 // Indices of the simulation mesh triangles
104 UPROPERTY(EditAnywhere, Category = SimMesh)
105 TArray<uint32> Indices;
106
107 // The weight maps, or masks, used by this mesh, sorted by their target id
108 UPROPERTY(EditAnywhere, Category = SimMesh)
110
111 // Inverse mass for each vertex in the physical mesh
112 UPROPERTY(EditAnywhere, Category = SimMesh)
114
115 // Indices and weights for each vertex, used to skin the mesh to create the reference pose
116 UPROPERTY(EditAnywhere, Category = SimMesh)
118
119 // Valid indices to use for self collisions (reduced set of Indices)
120 UPROPERTY(EditAnywhere, Category = SimMesh)
121 TSet<int32> SelfCollisionVertexSet;
122
123 // Long range attachment tethers, using euclidean (beeline) distance to find the closest attachment
124 UPROPERTY(EditAnywhere, Category = SimMesh)
125 FClothTetherData EuclideanTethers;
126
127 // Long range attachment tethers, using geodesic (surface) distance to find the closest attachment
128 UPROPERTY(EditAnywhere, Category = SimMesh)
129 FClothTetherData GeodesicTethers;
130
131 // Maximum number of bone weights of any vetex
132 UPROPERTY(EditAnywhere, Category = SimMesh)
133 int32 MaxBoneWeights;
134
135 // Number of fixed verts in the simulation mesh (fixed verts are just skinned and do not simulate)
136 UPROPERTY(EditAnywhere, Category = SimMesh)
137 int32 NumFixedVerts;
138
139 UE_DEPRECATED(5.4, "Use SelfCollisionVertexSet instead.")
140 UPROPERTY()
141 TArray<uint32> SelfCollisionIndices;
142#if WITH_EDITORONLY_DATA
143 // Deprecated. Use WeightMaps instead.
144 UPROPERTY()
146 UPROPERTY()
148 UPROPERTY()
150 UPROPERTY()
152
153#endif // WITH_EDITORONLY_DATA
154};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define USTRUCT(...)
Definition ObjectMacros.h:746
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NameTypes.h:617
Definition UnrealType.h:3087
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition ClothConfigBase.h:19
Definition ClothPhysicalMeshDataBase_Legacy.h:27
Definition ClothPhysicalMeshData.h:26
FPointWeightMap & AddWeightMap(const T Target)
Definition ClothPhysicalMeshData.h:75
FClothPhysicalMeshData(const FClothPhysicalMeshData &)=default
FPointWeightMap & GetWeightMap(const T Target)
Definition ClothPhysicalMeshData.h:87
bool HasWeightMap(const T Target) const
Definition ClothPhysicalMeshData.h:63
PRAGMA_DISABLE_DEPRECATION_WARNINGS ~FClothPhysicalMeshData()=default
FClothPhysicalMeshData & operator=(const FClothPhysicalMeshData &)=default
FPointWeightMap * FindWeightMap(const T Target)
Definition ClothPhysicalMeshData.h:71
const FPointWeightMap & GetWeightMap(const T Target) const
Definition ClothPhysicalMeshData.h:83
const FPointWeightMap * FindWeightMap(const T Target) const
Definition ClothPhysicalMeshData.h:67
FPointWeightMap & FindOrAddWeightMap(const T Target)
Definition ClothPhysicalMeshData.h:79
Definition ClothTetherData.h:22
Definition ClothVertBoneData.h:10
Definition PointWeightMap.h:33
Definition ObjectPtr.h:488