UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PerParticlePBDShapeConstraints.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4// HEADER_UNIT_SKIP - This file does not compile anymore (Base ctor not matching)
5
9
10namespace Chaos::Softs
11{
12
13class UE_DEPRECATED(5.0, "Per particle constraint rules are no longer used by the cloth solver. Use FPBDShapeConstraints instead.") FPerParticlePBDShapeConstraints final : public FPBDShapeConstraintsBase
14{
15 typedef FPBDShapeConstraintsBase Base;
16
17 public:
18 FPerParticlePBDShapeConstraints(const FSolverReal Stiffness = (FSolverReal)1.)
20 {
21 }
22 FPerParticlePBDShapeConstraints(const FSolverParticles& InParticles, const TArray<FSolverVec3>& TargetPositions, const FSolverReal Stiffness = (FSolverReal)1.)
23 : Base(InParticles, TargetPositions, Stiffness)
24 {
25 }
26 virtual ~FPerParticlePBDShapeConstraints() override {}
27
28 // TODO(mlentine): We likely need to use time n positions here
29 void Apply(FSolverParticles& InParticles, const FSolverReal Dt, const int32 Index) const
30 {
31 if (InParticles.InvM(Index) > 0)
32 {
33 InParticles.P(Index) -= InParticles.InvM(Index) * Base::GetDelta(InParticles, Index);
34 }
35 }
36
37 void Apply(FSolverParticles& InParticles, const FSolverReal Dt) const
38 {
40 Apply(InParticles, Dt, Index);
41 });
42 }
43};
44
45} // End namespace Chaos::Softs
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
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
Definition Array.h:670
Definition CollectionEmbeddedSpringConstraintFacade.cpp:6
void CHAOS_API PhysicsParallelFor(int32 InNum, TFunctionRef< void(int32)> InCallable, bool bForceSingleThreaded=false)
Definition Parallel.cpp:55
@ Apply
Definition NavigationModifier.h:49
U16 Index
Definition radfft.cpp:71