UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
KinematicGeometryParticles.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
7
8namespace Chaos
9{
10
11template<class T, int d, EGeometryParticlesSimType SimType>
13{
14 public:
33
34 UE_DEPRECATED(5.4, "Use GetV instead")
35 const TVector<T, d> V(const int32 Index) const { return TVector<T, d>(MV[Index]); }
36 UE_DEPRECATED(5.4, "Use GetV or SetV instead")
37 TVector<T, d> V(const int32 Index) { return TVector<T, d>(MV[Index]); }
38 const TVector<T, d> GetV(const int32 Index) const { return TVector<T, d>(MV[Index]); }
39 void SetV(const int32 Index, const TVector<T, d>& InV) { MV[Index] = InV; }
40 const TVector<FRealSingle, d> GetVf(const int32 Index) const { return MV[Index]; }
41 void SetVf(const int32 Index, const TVector<FRealSingle, d>& InV) { MV[Index] = InV; }
42
43 UE_DEPRECATED(5.4, "Use GetW instead")
44 const TVector<T, d> W(const int32 Index) const { return TVector<T, d>(MW[Index]); }
45 UE_DEPRECATED(5.4, "Use GetW or SetW instead")
46 TVector<T, d> W(const int32 Index) { return TVector<T, d>(MW[Index]); }
47 const TVector<T, d> GetW(const int32 Index) const { return TVector<T, d>(MW[Index]); }
48 void SetW(const int32 Index, const TVector<T, d>& InW) { MW[Index] = InW; }
49 const TVector<FRealSingle, d> GetWf(const int32 Index) const { return MW[Index]; }
50 void SetWf(const int32 Index, const TVector<FRealSingle, d>& InW) { MW[Index] = InW; }
51
52 const FKinematicTarget& KinematicTarget(const int32 Index) const { return KinematicTargets[Index]; }
53 FKinematicTarget& KinematicTarget(const int32 Index) { return KinematicTargets[Index]; }
54
55 FString ToString(int32 index) const
56 {
58 return FString::Printf(TEXT("%s, MV:%s, MW:%s"), *BaseString, *GetV(index).ToString(), *GetW(index).ToString());
59 }
60
62 const THandleType* Handle(int32 Index) const;
63
64 //cannot be reference because double pointer would allow for badness, but still useful to have non const access to handle
66
67 virtual void Serialize(FChaosArchive& Ar) override
68 {
70
72 if (Ar.CustomVer(FUE5ReleaseStreamObjectVersion::GUID) >= FUE5ReleaseStreamObjectVersion::SinglePrecisonParticleDataPT)
73 {
74 Ar << MV << MW;
75 }
76 else
77 {
79 VDouble.Resize(MV.Num());
80 for (int32 Index = 0; Index < MV.Num(); ++Index)
81 {
82 VDouble[Index] = MV[Index];
83 }
85 WDouble.Resize(MW.Num());
86 for (int32 Index = 0; Index < MW.Num(); ++Index)
87 {
88 WDouble[Index] = MW[Index];
89 }
90
91 Ar << VDouble << WDouble;
92
93 MV.Resize(VDouble.Num());
94 for (int32 Index = 0; Index < VDouble.Num(); ++Index)
95 {
96 MV[Index] = VDouble[Index];
97 }
98 MW.Resize(WDouble.Num());
99 for (int32 Index = 0; Index < WDouble.Num(); ++Index)
100 {
101 MW[Index] = WDouble[Index];
102 }
103 }
104
107 {
108 Ar << KinematicTargets;
109 }
110 }
111
115
116 private:
120};
121
122template <typename T, int d, EGeometryParticlesSimType SimType>
124{
125 Particles.Serialize(Ar);
126 return Ar;
127}
128
129
130
131template <typename T, int d>
133
135
136template <typename T, int d>
138
139using FKinematicGeometryClothParticles UE_DEPRECATED(5.0, "FKinematicGeometryClothParticles is deprecated, use Softs::FSolverRigidParticles instead.") = TKinematicGeometryClothParticles<FReal, 3>;
140}
141
#define FORCEINLINE
Definition AndroidPlatform.h:140
#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
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition ChaosArchive.h:167
Definition KinematicTargets.h:34
Definition ArrayCollectionArray.h:15
void Resize(const int Num) override
Definition ArrayCollectionArray.h:79
int32 AddArray(TArrayCollectionArrayBase *Array)
Definition ArrayCollection.h:36
Definition GeometryParticles.h:152
FString ToString(int32 index) const
Definition GeometryParticles.h:560
EParticleType MParticleType
Definition GeometryParticles.h:637
virtual void Serialize(FChaosArchive &Ar) override
Definition GeometryParticles.h:566
Definition ParticleHandle.h:907
Definition KinematicGeometryParticles.h:13
void SetV(const int32 Index, const TVector< T, d > &InV)
Definition KinematicGeometryParticles.h:39
void SetVf(const int32 Index, const TVector< FRealSingle, d > &InV)
Definition KinematicGeometryParticles.h:41
FORCEINLINE TArray< TVector< FRealSingle, d > > & AllW()
Definition KinematicGeometryParticles.h:113
const TVector< T, d > GetW(const int32 Index) const
Definition KinematicGeometryParticles.h:47
const TVector< T, d > GetV(const int32 Index) const
Definition KinematicGeometryParticles.h:38
const TVector< FRealSingle, d > GetWf(const int32 Index) const
Definition KinematicGeometryParticles.h:49
FORCEINLINE TArray< FKinematicTarget > & AllKinematicTargets()
Definition KinematicGeometryParticles.h:114
virtual ~TKinematicGeometryParticlesImp()
Definition KinematicGeometryParticles.h:32
FKinematicTarget & KinematicTarget(const int32 Index)
Definition KinematicGeometryParticles.h:53
TKinematicGeometryParticlesImp(const TKinematicGeometryParticlesImp< T, d, SimType > &Other)=delete
virtual void Serialize(FChaosArchive &Ar) override
Definition KinematicGeometryParticles.h:67
void SetWf(const int32 Index, const TVector< FRealSingle, d > &InW)
Definition KinematicGeometryParticles.h:50
const TVector< FRealSingle, d > GetVf(const int32 Index) const
Definition KinematicGeometryParticles.h:40
FORCEINLINE TArray< TVector< FRealSingle, d > > & AllV()
Definition KinematicGeometryParticles.h:112
const FKinematicTarget & KinematicTarget(const int32 Index) const
Definition KinematicGeometryParticles.h:52
void SetW(const int32 Index, const TVector< T, d > &InW)
Definition KinematicGeometryParticles.h:48
TKinematicGeometryParticleHandle< T, d > THandleType
Definition KinematicGeometryParticles.h:61
const TVector< T, d > W(const int32 Index) const
Definition KinematicGeometryParticles.h:44
const TVector< T, d > V(const int32 Index) const
Definition KinematicGeometryParticles.h:35
TKinematicGeometryParticlesImp(TKinematicGeometryParticlesImp< T, d, SimType > &&Other)
Definition KinematicGeometryParticles.h:24
TKinematicGeometryParticlesImp()
Definition KinematicGeometryParticles.h:15
FString ToString(int32 index) const
Definition KinematicGeometryParticles.h:55
Definition Vector.h:41
virtual CORE_API void UsingCustomVersion(const struct FGuid &Guid)
Definition Archive.cpp:590
CORE_API int32 CustomVer(const struct FGuid &Key) const
Definition Archive.cpp:602
Definition Array.h:670
Definition SkeletalMeshComponent.h:307
FChaosArchive & operator<<(FChaosArchive &Ar, FRigidParticleControlFlags &Flags)
Definition RigidParticleControlFlags.cpp:15
U16 Index
Definition radfft.cpp:71
CORE_API static const FGuid GUID
Definition ExternalPhysicsCustomObjectVersion.h:144
@ KinematicTargets
Definition ExternalPhysicsCustomObjectVersion.h:40
CORE_API static const FGuid GUID
Definition UE5ReleaseStreamObjectVersion.h:22