UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ClothConfigNv.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "ClothConfig.h"
6#include "CoreTypes.h"
8#include "Math/Vector.h"
11
12#include "ClothConfigNv.generated.h"
13
14class FArchive;
15class UObject;
16
18USTRUCT()
20{
22
24
25 // Migrate from the legacy FClothConstraintSetup structure.
26 void MigrateFrom(const FClothConstraintSetup_Legacy& Setup);
27
28 // Migrate to the legacy FClothConstraintSetup structure.
29 void MigrateTo(FClothConstraintSetup_Legacy& Setup) const;
30
31 // How stiff this constraint is, this affects how closely it will follow the desired position
32 UPROPERTY(EditAnywhere, Category=Constraint)
33 float Stiffness;
34
35 // A multiplier affecting the above value
36 UPROPERTY(EditAnywhere, Category = Constraint)
37 float StiffnessMultiplier;
38
39 // The hard limit on how far this constraint can stretch
40 UPROPERTY(EditAnywhere, Category = Constraint)
41 float StretchLimit;
42
43 // The hard limit on how far this constraint can compress
44 UPROPERTY(EditAnywhere, Category = Constraint)
45 float CompressionLimit;
46};
47
49UENUM()
51{
52 // Use legacy wind mode, where accelerations are modified directly by the simulation
53 // with no regard for drag or lift
54 Legacy,
55
56 // Use updated wind calculation for NvCloth based solved taking into account
57 // drag and lift, this will require those properties to be correctly set in
58 // the clothing configuration
60};
61
64UCLASS(MinimalAPI)
66{
68public:
70
71 // Set up custom version serialization.
72 CLOTHINGSYSTEMRUNTIMENV_API virtual void Serialize(FArchive& Ar) override;
73
74 // Update the deprecated properties.
75 CLOTHINGSYSTEMRUNTIMENV_API virtual void PostLoad() override;
76
77 // Migrate from the legacy FClothConfig structure.
78 CLOTHINGSYSTEMRUNTIMENV_API virtual void MigrateFrom(const FClothConfig_Legacy& ClothConfig) override;
79
80 // Migrate to the legacy FClothConfig structure.
81 CLOTHINGSYSTEMRUNTIMENV_API virtual bool MigrateTo(FClothConfig_Legacy& ClothConfig) const override;
82
84 virtual bool NeedsSelfCollisionData() const override { return SelfCollisionRadius > 0.0f && SelfCollisionStiffness > 0.0f; }
85
87 virtual bool NeedsInverseMasses() const override { return true; }
88
90 virtual bool NeedsTethers() const override { return false; }
91
92 // Return the collision radius required to calculate the self collision indices, or 0.f if self collision is disabled.
93 virtual float GetSelfCollisionRadius() const override { return NeedsSelfCollisionData() ? SelfCollisionRadius * SelfCollisionCullScale : 0.0f; }
94
95 // How wind should be processed, Accurate uses drag and lift to make the cloth react differently, legacy applies similar forces to all clothing without drag and lift (similar to APEX)
96 UPROPERTY(EditAnywhere, Category = ClothConfig)
97 EClothingWindMethodNv ClothingWindMethod;
98
99 // Constraint data for vertical constraints
100 UPROPERTY(EditAnywhere, Category = ClothConfig)
101 FClothConstraintSetupNv VerticalConstraint;
102
103 // Constraint data for horizontal constraints
104 UPROPERTY(EditAnywhere, Category = ClothConfig)
105 FClothConstraintSetupNv HorizontalConstraint;
106
107 // Constraint data for bend constraints
108 UPROPERTY(EditAnywhere, Category = ClothConfig)
110
111 // Constraint data for shear constraints
112 UPROPERTY(EditAnywhere, Category = ClothConfig)
113 FClothConstraintSetupNv ShearConstraint;
114
115 // Size of self collision spheres centered on each vert
116 UPROPERTY(EditAnywhere, Category = ClothConfig)
117 float SelfCollisionRadius;
118
119 // Stiffness of the spring force that will resolve self collisions
120 UPROPERTY(EditAnywhere, Category = ClothConfig)
121 float SelfCollisionStiffness;
122
130 UPROPERTY(EditAnywhere, Category = ClothConfig, meta = (UIMin="0", ClampMin="0"))
131 float SelfCollisionCullScale;
132
133 // Damping of particle motion per-axis
134 UPROPERTY(EditAnywhere, Category = ClothConfig)
135 FVector Damping;
136
137 // Friction of the surface when colliding
138 UPROPERTY(EditAnywhere, Category = ClothConfig)
139 float Friction;
140
141 // Drag coefficient for wind calculations, higher values mean wind has more lateral effect on cloth
142 UPROPERTY(EditAnywhere, Category = ClothConfig)
143 float WindDragCoefficient;
144
145 // Lift coefficient for wind calculations, higher values make cloth rise easier in wind
146 UPROPERTY(EditAnywhere, Category = ClothConfig)
147 float WindLiftCoefficient;
148
149 // Drag applied to linear particle movement per-axis
150 UPROPERTY(EditAnywhere, Category = ClothConfig)
151 FVector LinearDrag;
152
153 // Drag applied to angular particle movement, higher values should limit material bending (per-axis)
154 UPROPERTY(EditAnywhere, Category = ClothConfig)
155 FVector AngularDrag;
156
157 // Scale for linear particle inertia, how much movement should translate to linear motion (per-axis)
158 UPROPERTY(EditAnywhere, Category = ClothConfig, meta = (UIMin="0", UIMax="1", ClampMin="0", ClampMax="1"))
159 FVector LinearInertiaScale;
160
161 // Scale for angular particle inertia, how much movement should translate to angular motion (per-axis)
162 UPROPERTY(EditAnywhere, Category = ClothConfig, meta = (UIMin = "0", UIMax = "1", ClampMin = "0", ClampMax = "1"))
163 FVector AngularInertiaScale;
164
165 // Scale for centrifugal particle inertia, how much movement should translate to angular motion (per-axis)
166 UPROPERTY(EditAnywhere, Category = ClothConfig, meta = (UIMin = "0", UIMax = "1", ClampMin = "0", ClampMax = "1"))
167 FVector CentrifugalInertiaScale;
168
169 // Frequency of the position solver, lower values will lead to stretchier, bouncier cloth
170 UPROPERTY(EditAnywhere, Category = ClothConfig, meta = (UIMin = "30", UIMax = "240", ClampMin = "30", ClampMax = "1000"))
171 float SolverFrequency;
172
173 // Frequency for stiffness calculations, lower values will degrade stiffness of constraints
174 UPROPERTY(EditAnywhere, Category = ClothConfig)
175 float StiffnessFrequency;
176
177 // Scale of gravity effect on particles
178 UPROPERTY(EditAnywhere, Category = ClothConfig, meta = (EditCondition = "!bUseGravityOverride"))
179 float GravityScale;
180
181 // Direct gravity override value
182 UPROPERTY(EditAnywhere, Category = ClothConfig, meta = (EditCondition = "bUseGravityOverride"))
183 FVector GravityOverride;
184
186 UPROPERTY(EditAnywhere, Category = ClothConfig, meta = (InlineEditConditionToggle))
187 bool bUseGravityOverride;
188
189 // Scale for stiffness of particle tethers between each other
190 UPROPERTY(EditAnywhere, Category = ClothConfig)
191 float TetherStiffness;
192
193 // Scale for the limit of particle tethers (how far they can separate)
194 UPROPERTY(EditAnywhere, Category = ClothConfig)
195 float TetherLimit;
196
197 // 'Thickness' of the simulated cloth, used to adjust collisions
198 UPROPERTY(EditAnywhere, Category = ClothConfig)
199 float CollisionThickness;
200
201 // Default spring stiffness for anim drive if an anim drive is in use
202 UPROPERTY(EditAnywhere, Category = ClothConfig)
203 float AnimDriveSpringStiffness;
204
205 // Default damper stiffness for anim drive if an anim drive is in use
206 UPROPERTY(EditAnywhere, Category = ClothConfig)
207 float AnimDriveDamperStiffness;
208
209 // Deprecated properties using old legacy structure and enum that couldn't be redirected
210 UPROPERTY()
211 EClothingWindMethod_Legacy WindMethod_DEPRECATED;
212 UPROPERTY()
213 FClothConstraintSetup_Legacy VerticalConstraintConfig_DEPRECATED;
214 UPROPERTY()
215 FClothConstraintSetup_Legacy HorizontalConstraintConfig_DEPRECATED;
216 UPROPERTY()
217 FClothConstraintSetup_Legacy BendConstraintConfig_DEPRECATED;
218 UPROPERTY()
219 FClothConstraintSetup_Legacy ShearConstraintConfig_DEPRECATED;
220};
EClothingWindMethodNv
Definition ClothConfigNv.h:51
EClothingWindMethod_Legacy
Definition ClothConfig_Legacy.h:15
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 UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
#define USTRUCT(...)
Definition ObjectMacros.h:746
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition Archive.h:1208
Definition ClothConfig.h:30
Definition ClothConfigNv.h:66
virtual bool NeedsInverseMasses() const override
Definition ClothConfigNv.h:87
virtual bool NeedsSelfCollisionData() const override
Definition ClothConfigNv.h:84
virtual float GetSelfCollisionRadius() const override
Definition ClothConfigNv.h:93
virtual bool NeedsTethers() const override
Definition ClothConfigNv.h:90
Definition Object.h:95
Definition ClothConfig_Legacy.h:67
Definition ClothConfigNv.h:20
Definition ClothConfig_Legacy.h:33