UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ClothingSimulation.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
6#include "Containers/Array.h"
7#include "Math/Transform.h"
8#include "Math/Vector.h"
9#include "Stats/Stats.h"
10
11#define UE_API CLOTHINGSYSTEMRUNTIMECOMMON_API
12class USkeletalMeshComponent;
13
14// Common simulation stats
20
23{
24public:
28
30
31 // Fill this context using the given skeletal mesh component
32 UE_API virtual void Fill(const USkeletalMeshComponent* InComponent, float InDeltaSeconds, float InMaxPhysicsDelta, bool bIsInitialization);
33
34protected:
35 // Default fill behavior as expected to be used by every simulation
36 UE_API virtual void FillBoneTransforms(const USkeletalMeshComponent* InComponent);
37 UE_API virtual void FillRefToLocals(const USkeletalMeshComponent* InComponent, bool bIsInitialization);
38 UE_API virtual void FillComponentToWorld(const USkeletalMeshComponent* InComponent);
39 UE_API virtual void FillWorldGravity(const USkeletalMeshComponent* InComponent);
40 UE_API virtual void FillWindVelocity(const USkeletalMeshComponent* InComponent);
42 UE_API virtual void FillTeleportMode(const USkeletalMeshComponent* InComponent, float InDeltaSeconds, float InMaxPhysicsDelta);
43 UE_API virtual void FillMaxDistanceScale(const USkeletalMeshComponent* InComponent);
44 UE_API virtual void FillSolverGeometryScale(const USkeletalMeshComponent* InComponent);
45
46public:
47 // Component space bone transforms of the owning component
49
50 // Ref to local matrices from the owning component (for skinning fixed verts)
52
53 // Component to world transform of the owning component
55
56 // Gravity extracted from the world
58
59 // Wind velocity at the component location
61
62 // Wind adaption, a measure of how quickly to adapt to the wind speed
63 // when using the legacy wind calculation mode
65
66 // Delta for this tick
68
69 // Velocity scale to compensate input velocities in case the MaxPhysicsDelta kicks in
71
72 // Whether and how we should teleport the simulation this tick
74
75 // Scale for the max distance constraints of the simulation mesh
77
78 // Scale applied to all incoming geometry
80
81 // The predicted LOD of the skeletal mesh component running the simulation
83
84 // Data read from the cache.
86};
87
88// Base simulation to fill in common data for the base context
89class UE_DEPRECATED(5.7, "Use IClothingSimulationInterface instead.") FClothingSimulationCommon
91 : public IClothingSimulation // UE_DEPRECATED(5.7, "Use IClothingSimulationInterface instead.")
93{
94public:
97
98protected:
100 UE_API virtual void FillContextAndPrepareTick(const USkeletalMeshComponent* InComponent, float InDeltaTime, IClothingSimulationContext* InOutContext, bool bIsInitialization, bool bForceTeleportResetOnly) override;
101
102protected:
104 float MaxPhysicsDelta;
105};
106
107#undef UE_API
#define UE_API
Definition ClothingSimulation.h:11
EClothingTeleportMode
Definition ClothingSystemRuntimeTypes.h:46
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define DECLARE_CYCLE_STAT_EXTERN(CounterName, StatId, GroupId, API)
Definition Stats.h:679
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 UE_API
Definition SColorGradingComponentViewer.h:12
Definition ClothingSimulation.h:23
virtual UE_API void FillComponentToWorld(const USkeletalMeshComponent *InComponent)
Definition ClothingSimulation.cpp:149
float VelocityScale
Definition ClothingSimulation.h:70
virtual UE_API void FillRefToLocals(const USkeletalMeshComponent *InComponent, bool bIsInitialization)
Definition ClothingSimulation.cpp:126
virtual UE_API void FillSolverGeometryScale(const USkeletalMeshComponent *InComponent)
Definition ClothingSimulation.cpp:189
virtual UE_API void FillMaxDistanceScale(const USkeletalMeshComponent *InComponent)
Definition ClothingSimulation.cpp:184
FClothingSimulationContextCommon & operator=(const FClothingSimulationContextCommon &)=default
TArray< FTransform > BoneTransforms
Definition ClothingSimulation.h:48
virtual UE_API void FillBoneTransforms(const USkeletalMeshComponent *InComponent)
Definition ClothingSimulation.cpp:69
virtual UE_API ~FClothingSimulationContextCommon() override
Definition ClothingSimulation.cpp:46
float DeltaSeconds
Definition ClothingSimulation.h:67
FVector WorldGravity
Definition ClothingSimulation.h:57
float SolverGeometryScale
Definition ClothingSimulation.h:79
virtual UE_API void FillWindVelocity(const USkeletalMeshComponent *InComponent)
Definition ClothingSimulation.cpp:161
virtual UE_API void FillTeleportMode(const USkeletalMeshComponent *InComponent, float InDeltaSeconds, float InMaxPhysicsDelta)
Definition ClothingSimulation.cpp:171
float WindAdaption
Definition ClothingSimulation.h:64
TArray< FMatrix44f > RefToLocals
Definition ClothingSimulation.h:51
float MaxDistanceScale
Definition ClothingSimulation.h:76
EClothingTeleportMode TeleportMode
Definition ClothingSimulation.h:73
FTransform ComponentToWorld
Definition ClothingSimulation.h:54
FVector WindVelocity
Definition ClothingSimulation.h:60
UE_API FClothingSimulationContextCommon()
Definition ClothingSimulation.cpp:32
FClothingSimulationContextCommon(const FClothingSimulationContextCommon &)=default
virtual UE_API void FillWorldGravity(const USkeletalMeshComponent *InComponent)
Definition ClothingSimulation.cpp:154
FClothingSimulationCacheData CacheData
Definition ClothingSimulation.h:85
virtual UE_API void FillDeltaSeconds(float InDeltaSeconds, float InMaxPhysicsDelta)
Definition ClothingSimulation.cpp:166
int32 PredictedLod
Definition ClothingSimulation.h:82
Definition ClothingSimulationInterface.h:20
Definition Array.h:670
Definition ClothingSimulationCacheData.h:10