UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PBDUnilateralTetConstraints.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
6#include "Chaos/Core.h"
11#include "Containers/Array.h"
12
13namespace Chaos::Softs
14{
15
17 {
18 public:
19 static constexpr FSolverReal MinStiffness = (FSolverReal)0;
20 static constexpr FSolverReal MaxStiffness = (FSolverReal)1.f;
21 static constexpr FSolverReal DefaultStiffness = (FSolverReal)0.5f;
22
24 const FSolverParticlesRange& Particles,
29
31
32 void ApplyProperties(const FSolverReal /*Dt*/, const int32 /*NumIterations*/)
33 {
34 }
35
36 CHAOS_API void Apply(FSolverParticlesRange& Particles, const FSolverReal Dt) const;
37
39
40#if CHAOS_DEBUG_DRAW
42#endif
43
44 private:
45
46 void TrimKinematicConstraints(const FSolverParticlesRange& Particles);
47 void InitColor(const FSolverParticlesRange& Particles);
48
49 void ApplyVolumeConstraint(FSolverParticlesRange& Particles, const FSolverReal Dt) const;
50#if INTEL_ISPC
51 void ApplyVolumeConstraint_ISPC(FSolverParticlesRange& Particles, const FSolverReal Dt) const {}
52#endif
53
55 TArray<FSolverReal> Volumes;
56
57 TArray<int32> ConstraintsPerColorStartIndex; // Constraints are ordered so each batch is contiguous. This is ColorNum + 1 length so it can be used as start and end.
58
59#if CHAOS_DEBUG_DRAW
60 // Used for debug draw to show which constraints were active last apply
62#endif
63
64 protected:
67 };
68
92
93} // End namespace Chaos::Softs
94
#define UE_CHAOS_DECLARE_PROPERTYCOLLECTION_NAME(PropertyName, Type)
Definition CollectionPropertyFacade.h:969
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 CollectionPropertyFacade.h:49
Definition CollectionEmbeddedSpringConstraintFacade.h:44
Definition PBDUnilateralTetConstraints.h:17
const TArray< TVector< int32, 4 > > & GetConstraints() const
Definition PBDUnilateralTetConstraints.h:38
static constexpr FSolverReal MinStiffness
Definition PBDUnilateralTetConstraints.h:19
FSolverReal Stiffness
Definition PBDUnilateralTetConstraints.h:65
int32 MaxNumIters
Definition PBDUnilateralTetConstraints.h:66
static constexpr FSolverReal MaxStiffness
Definition PBDUnilateralTetConstraints.h:20
CHAOS_API void Apply(FSolverParticlesRange &Particles, const FSolverReal Dt) const
Definition PBDUnilateralTetConstraints.cpp:113
void ApplyProperties(const FSolverReal, const int32)
Definition PBDUnilateralTetConstraints.h:32
static constexpr FSolverReal DefaultStiffness
Definition PBDUnilateralTetConstraints.h:21
Definition PBDUnilateralTetConstraints.h:70
CHAOS_API void SetProperties(const FCollectionPropertyConstFacade &PropertyCollection)
Definition PBDUnilateralTetConstraints.cpp:198
static bool IsEnabled(const FCollectionPropertyConstFacade &PropertyCollection)
Definition PBDUnilateralTetConstraints.h:73
Definition SoftsSolverParticlesRange.h:12
Definition Vector.h:41
Definition Constraints.Build.cs:6
Definition Array.h:670
Definition CollectionEmbeddedSpringConstraintFacade.cpp:6
FRealSingle FSolverReal
Definition PBDSoftsEvolutionFwd.h:31
FRealSingle FSolverReal
Definition SolverBody.h:38