UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
RigidParticles.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "Containers/Queue.h"
11#include "Chaos/Matrix.h"
12#include "Chaos/Particles.h"
13#include "Chaos/Rotation.h"
18
19namespace Chaos
20{
21
22enum class ESleepType : uint8
23{
24 MaterialSleep, //physics material determines sleep threshold
25 NeverSleep //never falls asleep
26};
27
28template<class T, int d>
45
46
47// Counts the number of bits needed to represent an int with a max
48constexpr int8 NumBitsNeeded(const int8 MaxValue)
49{
50 return MaxValue == 0 ? 0 : 1 + NumBitsNeeded(MaxValue >> 1);
51}
52
53// Make a bitmask which covers the lowest NumBits bits with 1's.
54constexpr int8 LowBitsMask(const int8 NumBits)
55{
56 return NumBits == 0 ? 0 : (int8)((1 << (NumBits - 1)) | LowBitsMask(NumBits - 1));
57}
58
59// Count N, the number of bits needed to store an object state
60static constexpr int8 ObjectStateBitCount = NumBitsNeeded((int8)EObjectStateType::Count - (int8)1);
61
62// RigidParticle data that is commonly accessed together.
63// This contains all properties accessed in the broadphase filtering (FSpatialAccelerationBroadPhase)
64// NOTE: not a member class for easier natvis
75
76template<class T, int d>
78{
79public:
81 using TParticles<T, d>::X;
82 using TGeometryParticles<T, d>::R;
83
89
93 , CoreData(MoveTemp(Other.CoreData))
94 , MVSmooth(MoveTemp(Other.MVSmooth))
95 , MWSmooth(MoveTemp(Other.MWSmooth))
96 , MAcceleration(MoveTemp(Other.MAcceleration))
97 , MAngularAcceleration(MoveTemp(Other.MAngularAcceleration))
98 , MLinearImpulseVelocity(MoveTemp(Other.MLinearImpulseVelocity))
99 , MAngularImpulseVelocity(MoveTemp(Other.MAngularImpulseVelocity))
100 , MI(MoveTemp(Other.MI))
101 , MInvI(MoveTemp(Other.MInvI))
102 , MInvIConditioning(MoveTemp(Other.MInvIConditioning))
103 , MM(MoveTemp(Other.MM))
104 , MInvM(MoveTemp(Other.MInvM))
105 , MCenterOfMass(MoveTemp(Other.MCenterOfMass))
106 , MRotationOfMass(MoveTemp(Other.MRotationOfMass))
107 , MLinearEtherDrag(MoveTemp(Other.MLinearEtherDrag))
108 , MAngularEtherDrag(MoveTemp(Other.MAngularEtherDrag))
109 , MaxLinearSpeedsSq(MoveTemp(Other.MaxLinearSpeedsSq))
110 , MaxAngularSpeedsSq(MoveTemp(Other.MaxAngularSpeedsSq))
111 , MInitialOverlapDepenetrationVelocity(MoveTemp(Other.MInitialOverlapDepenetrationVelocity))
112 , MSleepThresholdMultiplier(MoveTemp(Other.MSleepThresholdMultiplier))
113 , MCollisionParticles(MoveTemp(Other.MCollisionParticles))
114 , MSleepType(MoveTemp(Other.MSleepType))
115 , MSleepCounter(MoveTemp(Other.MSleepCounter))
116 , MDisableCounter(MoveTemp(Other.MDisableCounter))
117 , MParticleIterationCounts(MoveTemp(Other.MParticleIterationCounts))
118 {
120 }
121
123 {
125
128 TArrayCollection::AddArray(&MAcceleration);
129 TArrayCollection::AddArray(&MAngularAcceleration);
130 TArrayCollection::AddArray(&MLinearImpulseVelocity);
131 TArrayCollection::AddArray(&MAngularImpulseVelocity);
134 TArrayCollection::AddArray(&MInvIConditioning);
137 TArrayCollection::AddArray(&MCenterOfMass);
138 TArrayCollection::AddArray(&MRotationOfMass);
139 TArrayCollection::AddArray(&MLinearEtherDrag);
140 TArrayCollection::AddArray(&MAngularEtherDrag);
141 TArrayCollection::AddArray(&MaxLinearSpeedsSq);
142 TArrayCollection::AddArray(&MaxAngularSpeedsSq);
143 TArrayCollection::AddArray(&MInitialOverlapDepenetrationVelocity);
144 TArrayCollection::AddArray(&MSleepThresholdMultiplier);
145 TArrayCollection::AddArray(&MCollisionParticles);
146 TArrayCollection::AddArray(&MSleepType);
147 TArrayCollection::AddArray(&MSleepCounter);
148 TArrayCollection::AddArray(&MDisableCounter);
149 TArrayCollection::AddArray(&MParticleIterationCounts);
150
151 }
152
154 {}
155
156 FORCEINLINE const TVector<T, d>& VSmooth(const int32 Index) const { return MVSmooth[Index]; }
157 FORCEINLINE TVector<T, d>& VSmooth(const int32 Index) { return MVSmooth[Index]; }
158
159 FORCEINLINE const TVector<T, d>& WSmooth(const int32 Index) const { return MWSmooth[Index]; }
160 FORCEINLINE TVector<T, d>& WSmooth(const int32 Index) { return MWSmooth[Index]; }
161
162 FORCEINLINE const TVector<T, d>& AngularAcceleration(const int32 Index) const { return MAngularAcceleration[Index]; }
163 FORCEINLINE TVector<T, d>& AngularAcceleration(const int32 Index) { return MAngularAcceleration[Index]; }
164
165 FORCEINLINE const TVector<T, d>& Acceleration(const int32 Index) const { return MAcceleration[Index]; }
166 FORCEINLINE TVector<T, d>& Acceleration(const int32 Index) { return MAcceleration[Index]; }
167
168 FORCEINLINE const TVector<T, d>& LinearImpulseVelocity(const int32 Index) const { return MLinearImpulseVelocity[Index]; }
169 FORCEINLINE TVector<T, d>& LinearImpulseVelocity(const int32 Index) { return MLinearImpulseVelocity[Index]; }
170
171 FORCEINLINE const TVector<T, d>& AngularImpulseVelocity(const int32 Index) const { return MAngularImpulseVelocity[Index]; }
172 FORCEINLINE TVector<T, d>& AngularImpulseVelocity(const int32 Index) { return MAngularImpulseVelocity[Index]; }
173
174 FORCEINLINE const TVec3<FRealSingle>& I(const int32 Index) const { return MI[Index]; }
176
177 FORCEINLINE const TVec3<FRealSingle>& InvI(const int32 Index) const { return MInvI[Index]; }
179
180 FORCEINLINE const TVec3<FRealSingle>& InvIConditioning(const int32 Index) const { return MInvIConditioning[Index]; }
181 FORCEINLINE TVec3<FRealSingle>& InvIConditioning(const int32 Index) { return MInvIConditioning[Index]; }
182
183 FORCEINLINE const T M(const int32 Index) const { return MM[Index]; }
184 FORCEINLINE T& M(const int32 Index) { return MM[Index]; }
185
186 FORCEINLINE const T InvM(const int32 Index) const { return MInvM[Index]; }
187 FORCEINLINE T& InvM(const int32 Index) { return MInvM[Index]; }
188
189 FORCEINLINE const TVector<T,d>& CenterOfMass(const int32 Index) const { return MCenterOfMass[Index]; }
190 FORCEINLINE TVector<T,d>& CenterOfMass(const int32 Index) { return MCenterOfMass[Index]; }
191
192 FORCEINLINE const TRotation<T,d>& RotationOfMass(const int32 Index) const { return MRotationOfMass[Index]; }
193 FORCEINLINE TRotation<T,d>& RotationOfMass(const int32 Index) { return MRotationOfMass[Index]; }
194
195 FORCEINLINE const T& LinearEtherDrag(const int32 index) const { return MLinearEtherDrag[index]; }
196 FORCEINLINE T& LinearEtherDrag(const int32 index) { return MLinearEtherDrag[index]; }
197
198 FORCEINLINE const T& AngularEtherDrag(const int32 index) const { return MAngularEtherDrag[index]; }
199 FORCEINLINE T& AngularEtherDrag(const int32 index) { return MAngularEtherDrag[index]; }
200
201 FORCEINLINE const T& MaxLinearSpeedSq(const int32 index) const { return MaxLinearSpeedsSq[index]; }
202 FORCEINLINE T& MaxLinearSpeedSq(const int32 index) { return MaxLinearSpeedsSq[index]; }
203
204 FORCEINLINE const T& MaxAngularSpeedSq(const int32 index) const { return MaxAngularSpeedsSq[index]; }
205 FORCEINLINE T& MaxAngularSpeedSq(const int32 index) { return MaxAngularSpeedsSq[index]; }
206
207 FORCEINLINE const FRealSingle& InitialOverlapDepenetrationVelocity(const int32 index) const { return MInitialOverlapDepenetrationVelocity[index]; }
208 FORCEINLINE FRealSingle& InitialOverlapDepenetrationVelocity(const int32 index) { return MInitialOverlapDepenetrationVelocity[index]; }
209
210 FORCEINLINE const FRealSingle& SleepThresholdMultiplier(const int32 Index) const { return MSleepThresholdMultiplier[Index]; }
211 FORCEINLINE FRealSingle& SleepThresholdMultiplier(const int32 Index) { return MSleepThresholdMultiplier[Index]; }
212
213 FORCEINLINE int32 CollisionParticlesSize(int32 Index) const { return MCollisionParticles[Index] == nullptr ? 0 : MCollisionParticles[Index]->Size(); }
214
216 void SetCollisionParticles(const int32 Index, TParticles<T, d>&& Particles);
217
218 FORCEINLINE const TUniquePtr<TBVHParticles<T, d>>& CollisionParticles(const int32 Index) const { return MCollisionParticles[Index]; }
220
221 FORCEINLINE const int32 CollisionGroup(const int32 Index) const { return CoreData[Index].CollisionGroup; }
222 FORCEINLINE int32& CollisionGroup(const int32 Index) { return CoreData[Index].CollisionGroup; }
223
224 FORCEINLINE bool HasCollisionConstraintFlag(const ECollisionConstraintFlags Flag, const int32 Index) const { return (CoreData[Index].CollisionConstraintFlags & (uint32)Flag) != 0; }
225 FORCEINLINE void AddCollisionConstraintFlag(const ECollisionConstraintFlags Flag, const int32 Index) { CoreData[Index].CollisionConstraintFlags |= (uint32)Flag; }
226 FORCEINLINE void RemoveCollisionConstraintFlag(const ECollisionConstraintFlags Flag, const int32 Index) { CoreData[Index].CollisionConstraintFlags &= ~(uint32)Flag; }
227 FORCEINLINE void SetCollisionConstraintFlags(const int32 Index, const uint32 Flags) { CoreData[Index].CollisionConstraintFlags = Flags; }
228 FORCEINLINE uint32 CollisionConstraintFlags(const int32 Index) const { return CoreData[Index].CollisionConstraintFlags; }
229
230 FORCEINLINE const bool Disabled(const int32 Index) const { return CoreData[Index].bDisabled; }
231
232 FORCEINLINE bool& DisabledRef(const int32 Index) { return CoreData[Index].bDisabled; }
233
234 // DisableParticle/EnableParticle on Evolution should be used. Don't disable particles with this.
235 // Using this will break stuff. This is for solver's use only, and possibly some particle construction/copy code.
236 FORCEINLINE void SetDisabledLowLevel(const int32 Index, bool InDisabled) { CoreData[Index].bDisabled = InDisabled; }
237
238 FORCEINLINE const FRigidParticleControlFlags& ControlFlags(const int32 Index) const { return CoreData[Index].ControlFlags; }
239 FORCEINLINE FRigidParticleControlFlags& ControlFlags(const int32 Index) { return CoreData[Index].ControlFlags; }
240
241 FORCEINLINE const FRigidParticleTransientFlags& TransientFlags(const int32 Index) const { return CoreData[Index].TransientFlags; }
242 FORCEINLINE FRigidParticleTransientFlags& TransientFlags(const int32 Index) { return CoreData[Index].TransientFlags; }
243
244 FORCEINLINE ESleepType SleepType(const int32 Index) const { return MSleepType[Index]; }
245 FORCEINLINE ESleepType& SleepType(const int32 Index) { return MSleepType[Index]; }
246
247 FORCEINLINE int8 SleepCounter(const int32 Index) const { return MSleepCounter[Index]; }
248 FORCEINLINE int8& SleepCounter(const int32 Index) { return MSleepCounter[Index]; }
249
250 FORCEINLINE int8 DisableCounter(const int32 Index) const { return MDisableCounter[Index]; }
251 FORCEINLINE int8& DisableCounter(const int32 Index) { return MDisableCounter[Index]; }
252
253 FORCEINLINE Private::FIterationSettings ParticleIterationCounts(const int32 Index) const { return MParticleIterationCounts[Index]; }
255
256 // @todo(chaos): This data should be marshalled via the proxies like everything else. There is probably a particle recycling bug here.
259 {
261 SleepData.Particle = Particle;
263
264 SleepDataLock.WriteLock();
265 MSleepData.Add(SleepData);
266 SleepDataLock.WriteUnlock();
267 }
269 {
270 SleepDataLock.WriteLock();
271 MSleepData.Empty();
272 SleepDataLock.WriteUnlock();
273 }
274 FORCEINLINE FRWLock& GetSleepDataLock() { return SleepDataLock; }
275
276 FORCEINLINE const EObjectStateType ObjectState(const int32 Index) const { return CoreData[Index].ObjectState; }
277 FORCEINLINE EObjectStateType& ObjectState(const int32 Index) { return CoreData[Index].ObjectState; }
278
279 FORCEINLINE const EObjectStateType PreObjectState(const int32 Index) const { return CoreData[Index].PreObjectState; }
280 FORCEINLINE EObjectStateType& PreObjectState(const int32 Index) { return CoreData[Index].PreObjectState; }
281
283
285
286 FORCEINLINE const bool HasInfiniteMass(const int32 Index) const { return MInvM[Index] == (T)0; }
287
289 {
291 return FString::Printf(TEXT("%s, MAcceleration:%s, MAngularAcceleration:%s, MLinearImpulseVelocity:%s, MAngularImpulseVelocity:%s, MI:%s, MInvI:%s, MM:%f, MInvM:%f, MCenterOfMass:%s, MRotationOfMass:%s, MCollisionParticles(num):%d, MCollisionGroup:%d, MDisabled:%d, MSleeping:%d"),
295 }
296
297 virtual void Serialize(FChaosArchive& Ar) override
298 {
300
301 // To avoid bumping file version, serialize to/from previous structures
302 // If we aren't loading (i.e., we are saving or copying) CoreData will be valid, so copy that to the legacy structure
303 // Also, Particles do not know their island index and it should not be serialized (but it used to be)
304 // @todo(chaos): I think its time to bump the version number and clean up particle serialization!
305 FLegacyData LegacyData;
307
308 if (!Ar.IsLoading())
309 {
310 LegacyData.CopyFromCoreData(CoreData);
311 LegacyIslandIndex.SetNumZeroed(MCollisionParticles.Num());
312 }
313
316 {
317 Ar << MCenterOfMass;
318 Ar << MRotationOfMass;
319 }
320
321 Ar << MAcceleration << MAngularAcceleration << MLinearImpulseVelocity << MAngularImpulseVelocity;
322
325 if (Ar.IsLoading() && Ar.CustomVer(FFortniteMainBranchObjectVersion::GUID) < FFortniteMainBranchObjectVersion::ChaosInertiaConvertedToVec3
326 && Ar.CustomVer(FUE5ReleaseStreamObjectVersion::GUID) < FUE5ReleaseStreamObjectVersion::ChaosInertiaConvertedToVec3)
327 {
330 Ar << IArray << InvIArray;
331
332 for (int32 Idx = 0; Idx < IArray.Num(); ++Idx)
333 {
334 MI.Add(IArray[Idx].GetDiagonal());
335 MInvI.Add(InvIArray[Idx].GetDiagonal());
336 }
337 }
338 else
339 {
340 Ar << MI << MInvI;
341 }
342
343 MInvIConditioning.Resize(MInvI.Num());
344 for (int32 Index = 0; Index < MInvI.Num(); ++Index)
345 {
346 MInvIConditioning[Index] = TVec3<FRealSingle>(1);
347 }
348
349 Ar << MM << MInvM;
350
353 {
354 Ar << MLinearEtherDrag << MAngularEtherDrag;
355 }
356
357 Ar << MCollisionParticles << LegacyData.MCollisionGroup << LegacyIslandIndex << LegacyData.MDisabled << LegacyData.MObjectState << MSleepType;
358 // @todo(chaos): what about ControlFlags, TransientFlags, PreObjectState, SleepCounter, ..?
359
360 // If we loaded into the legacy structure, copy to CoreData
361 if (Ar.IsLoading())
362 {
363 LegacyData.CopyToCoreData(CoreData);
364 }
365 }
366
367 // Deprecated API
368 UE_DEPRECATED(5.3, "No longer supported") const int32 IslandIndex(const int32 Index) const { return INDEX_NONE; }
369 UE_DEPRECATED(5.3, "No longer supported") int32& IslandIndex(const int32 Index) { static int32 Dummy = INDEX_NONE; return Dummy; }
370
371private:
372 // Used during serialization to avoid bumping the file version as we switch to aggregated strunctures like FRigidParticleCoreData.
373 // Note: Only serialized data is needed here and not all data is serialized so some elements in the aggregates are not represented.
374 struct FLegacyData
375 {
376 TArrayCollectionArray<int32> MCollisionGroup;
379
380 void CopyFromCoreData(const TArrayCollectionArray<FRigidParticleCoreData>& Source)
381 {
382 MCollisionGroup.Resize(Source.Num());
383 MObjectState.Resize(Source.Num());
384 MDisabled.Resize(Source.Num());
385
386 for (int32 Index = 0; Index < Source.Num(); ++Index)
387 {
388 MCollisionGroup[Index] = Source[Index].CollisionGroup;
389 MObjectState[Index] = Source[Index].ObjectState;
390 MDisabled[Index] = Source[Index].bDisabled;
391 }
392 }
393
394 void CopyToCoreData(TArrayCollectionArray<FRigidParticleCoreData>& Dest)
395 {
396 Dest.Resize(MCollisionGroup.Num());
397
398 for (int32 Index = 0; Index < Dest.Num(); ++Index)
399 {
400 Dest[Index].CollisionGroup = MCollisionGroup[Index];
401 Dest[Index].ObjectState = MObjectState[Index];
402 Dest[Index].bDisabled = MDisabled[Index];
403 }
404 }
405 };
406
408
412 TArrayCollectionArray<TVector<T, d>> MAngularAcceleration;
413 TArrayCollectionArray<TVector<T, d>> MLinearImpulseVelocity;
414 TArrayCollectionArray<TVector<T, d>> MAngularImpulseVelocity;
422 TArrayCollectionArray<T> MLinearEtherDrag;
423 TArrayCollectionArray<T> MAngularEtherDrag;
424 TArrayCollectionArray<T> MaxLinearSpeedsSq;
425 TArrayCollectionArray<T> MaxAngularSpeedsSq;
426 TArrayCollectionArray<FRealSingle> MInitialOverlapDepenetrationVelocity;
427 TArrayCollectionArray<FRealSingle> MSleepThresholdMultiplier;
429 TArrayCollectionArray<ESleepType> MSleepType;
430 TArrayCollectionArray<int8> MSleepCounter;
431 TArrayCollectionArray<int8> MDisableCounter;
433
434 TArray<TSleepData<T, d>> MSleepData;
435 FRWLock SleepDataLock;
436};
437
438
439
440template <typename T, int d>
442{
443 Particles.Serialize(Ar);
444 return Ar;
445}
446
447}
#define FORCEINLINE
Definition AndroidPlatform.h:140
@ INDEX_NONE
Definition CoreMiscDefines.h:150
FPlatformTypes::int8 int8
An 8-bit signed integer.
Definition Platform.h:1121
#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
return true
Definition ExternalRpcRegistry.cpp:601
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ChaosArchive.h:167
Enable/Disable the features on a particle These flags are externally controlled and should not be cha...
Definition RigidParticleControlFlags.h:18
Transient flags for indicating somethings needs to be updated based on a change to the particle Typic...
Definition RigidParticleControlFlags.h:121
Definition IterationSettings.h:19
Definition ArrayCollectionArray.h:15
void Resize(const int Num) override
Definition ArrayCollectionArray.h:79
int32 AddArray(TArrayCollectionArrayBase *Array)
Definition ArrayCollection.h:36
uint32 Size() const
Definition ArrayCollection.h:66
Definition ParticleHandle.h:436
bool Sleeping() const
Definition ParticleHandle.h:717
Definition GeometryParticles.h:152
Definition KinematicGeometryParticles.h:13
virtual void Serialize(FChaosArchive &Ar) override
Definition KinematicGeometryParticles.h:67
FString ToString(int32 index) const
Definition KinematicGeometryParticles.h:55
Definition Particles.h:32
Definition RigidParticles.h:78
void RegisterArrays()
Definition RigidParticles.h:122
FORCEINLINE TVec3< FRealSingle > & InvIConditioning(const int32 Index)
Definition RigidParticles.h:181
FORCEINLINE TVector< T, d > & VSmooth(const int32 Index)
Definition RigidParticles.h:157
FORCEINLINE bool & DisabledRef(const int32 Index)
Definition RigidParticles.h:232
FORCEINLINE const TVector< T, d > & LinearImpulseVelocity(const int32 Index) const
Definition RigidParticles.h:168
FORCEINLINE const TVector< T, d > & WSmooth(const int32 Index) const
Definition RigidParticles.h:159
FORCEINLINE uint32 CollisionConstraintFlags(const int32 Index) const
Definition RigidParticles.h:228
FORCEINLINE ESleepType SleepType(const int32 Index) const
Definition RigidParticles.h:244
FORCEINLINE void SetDisabledLowLevel(const int32 Index, bool InDisabled)
Definition RigidParticles.h:236
FORCEINLINE const TVec3< FRealSingle > & InvI(const int32 Index) const
Definition RigidParticles.h:177
FORCEINLINE T & M(const int32 Index)
Definition RigidParticles.h:184
TRigidParticles(TRigidParticles< T, d > &&Other)
Definition RigidParticles.h:91
FORCEINLINE const TRotation< T, d > & RotationOfMass(const int32 Index) const
Definition RigidParticles.h:192
FORCEINLINE const T & MaxLinearSpeedSq(const int32 index) const
Definition RigidParticles.h:201
virtual void Serialize(FChaosArchive &Ar) override
Definition RigidParticles.h:297
FORCEINLINE int8 & DisableCounter(const int32 Index)
Definition RigidParticles.h:251
FORCEINLINE const T M(const int32 Index) const
Definition RigidParticles.h:183
FORCEINLINE FRealSingle & InitialOverlapDepenetrationVelocity(const int32 index)
Definition RigidParticles.h:208
FORCEINLINE T & LinearEtherDrag(const int32 index)
Definition RigidParticles.h:196
FORCEINLINE const T & MaxAngularSpeedSq(const int32 index) const
Definition RigidParticles.h:204
FORCEINLINE TVector< T, d > & WSmooth(const int32 Index)
Definition RigidParticles.h:160
FORCEINLINE int32 & CollisionGroup(const int32 Index)
Definition RigidParticles.h:222
FORCEINLINE TUniquePtr< TBVHParticles< T, d > > & CollisionParticles(const int32 Index)
Definition RigidParticles.h:219
FORCEINLINE void AddSleepData(TGeometryParticleHandle< T, d > *Particle, bool Sleeping)
Definition RigidParticles.h:258
FORCEINLINE void SetCollisionConstraintFlags(const int32 Index, const uint32 Flags)
Definition RigidParticles.h:227
FORCEINLINE const bool Sleeping(const int32 Index) const
Definition RigidParticles.h:284
FORCEINLINE int8 SleepCounter(const int32 Index) const
Definition RigidParticles.h:247
void ClearSleepData()
Definition RigidParticles.h:268
FORCEINLINE const T InvM(const int32 Index) const
Definition RigidParticles.h:186
FORCEINLINE FRigidParticleControlFlags & ControlFlags(const int32 Index)
Definition RigidParticles.h:239
FORCEINLINE void AddCollisionConstraintFlag(const ECollisionConstraintFlags Flag, const int32 Index)
Definition RigidParticles.h:225
FORCEINLINE const EObjectStateType ObjectState(const int32 Index) const
Definition RigidParticles.h:276
FORCEINLINE ESleepType & SleepType(const int32 Index)
Definition RigidParticles.h:245
FORCEINLINE TVec3< FRealSingle > & I(const int32 Index)
Definition RigidParticles.h:175
FORCEINLINE FString ToString(int32 Index) const
Definition RigidParticles.h:288
void SetCollisionParticles(const int32 Index, TParticles< T, d > &&Particles)
Definition RigidParticles.cpp:18
FORCEINLINE T & AngularEtherDrag(const int32 index)
Definition RigidParticles.h:199
FORCEINLINE const T & LinearEtherDrag(const int32 index) const
Definition RigidParticles.h:195
FORCEINLINE const bool Disabled(const int32 Index) const
Definition RigidParticles.h:230
TRigidParticles(const TRigidParticles< T, d > &Other)=delete
FORCEINLINE bool HasCollisionConstraintFlag(const ECollisionConstraintFlags Flag, const int32 Index) const
Definition RigidParticles.h:224
FORCEINLINE const TVector< T, d > & VSmooth(const int32 Index) const
Definition RigidParticles.h:156
FORCEINLINE EObjectStateType & PreObjectState(const int32 Index)
Definition RigidParticles.h:280
FORCEINLINE TVector< T, d > & AngularImpulseVelocity(const int32 Index)
Definition RigidParticles.h:172
FORCEINLINE const T & AngularEtherDrag(const int32 index) const
Definition RigidParticles.h:198
FORCEINLINE const TVector< T, d > & Acceleration(const int32 Index) const
Definition RigidParticles.h:165
FORCEINLINE TVector< T, d > & CenterOfMass(const int32 Index)
Definition RigidParticles.h:190
FORCEINLINE FRealSingle & SleepThresholdMultiplier(const int32 Index)
Definition RigidParticles.h:211
FORCEINLINE Private::FIterationSettings & ParticleIterationCounts(const int32 Index)
Definition RigidParticles.h:254
FORCEINLINE const TVector< T, d > & AngularAcceleration(const int32 Index) const
Definition RigidParticles.h:162
FORCEINLINE const FRealSingle & InitialOverlapDepenetrationVelocity(const int32 index) const
Definition RigidParticles.h:207
FORCEINLINE int32 CollisionParticlesSize(int32 Index) const
Definition RigidParticles.h:213
FORCEINLINE const EObjectStateType PreObjectState(const int32 Index) const
Definition RigidParticles.h:279
FORCEINLINE int8 DisableCounter(const int32 Index) const
Definition RigidParticles.h:250
FORCEINLINE const int32 CollisionGroup(const int32 Index) const
Definition RigidParticles.h:221
virtual ~TRigidParticles()
Definition RigidParticles.h:153
FORCEINLINE const TVec3< FRealSingle > & InvIConditioning(const int32 Index) const
Definition RigidParticles.h:180
TRigidParticles()
Definition RigidParticles.h:84
FORCEINLINE const TVector< T, d > & CenterOfMass(const int32 Index) const
Definition RigidParticles.h:189
void CollisionParticlesInitIfNeeded(const int32 Index)
Definition RigidParticles.cpp:9
FORCEINLINE const TUniquePtr< TBVHParticles< T, d > > & CollisionParticles(const int32 Index) const
Definition RigidParticles.h:218
UE_DEPRECATED(5.3, "No longer supported") int32 &IslandIndex(const int32 Index)
Definition RigidParticles.h:369
FORCEINLINE const FRigidParticleTransientFlags & TransientFlags(const int32 Index) const
Definition RigidParticles.h:241
FORCEINLINE void RemoveCollisionConstraintFlag(const ECollisionConstraintFlags Flag, const int32 Index)
Definition RigidParticles.h:226
FORCEINLINE TVector< T, d > & AngularAcceleration(const int32 Index)
Definition RigidParticles.h:163
UE_DEPRECATED(5.3, "No longer supported") const int32 IslandIndex(const int32 Index) const
Definition RigidParticles.h:368
FORCEINLINE const bool HasInfiniteMass(const int32 Index) const
Definition RigidParticles.h:286
FORCEINLINE T & InvM(const int32 Index)
Definition RigidParticles.h:187
FORCEINLINE TArray< TSleepData< T, d > > & GetSleepData()
Definition RigidParticles.h:257
FORCEINLINE TVector< T, d > & LinearImpulseVelocity(const int32 Index)
Definition RigidParticles.h:169
FORCEINLINE const bool Dynamic(const int32 Index) const
Definition RigidParticles.h:282
FORCEINLINE const FRealSingle & SleepThresholdMultiplier(const int32 Index) const
Definition RigidParticles.h:210
FORCEINLINE FRigidParticleTransientFlags & TransientFlags(const int32 Index)
Definition RigidParticles.h:242
FORCEINLINE TVec3< FRealSingle > & InvI(const int32 Index)
Definition RigidParticles.h:178
FORCEINLINE Private::FIterationSettings ParticleIterationCounts(const int32 Index) const
Definition RigidParticles.h:253
FORCEINLINE const FRigidParticleControlFlags & ControlFlags(const int32 Index) const
Definition RigidParticles.h:238
FORCEINLINE const TVector< T, d > & AngularImpulseVelocity(const int32 Index) const
Definition RigidParticles.h:171
FORCEINLINE FRWLock & GetSleepDataLock()
Definition RigidParticles.h:274
FORCEINLINE EObjectStateType & ObjectState(const int32 Index)
Definition RigidParticles.h:277
FORCEINLINE int8 & SleepCounter(const int32 Index)
Definition RigidParticles.h:248
FORCEINLINE T & MaxAngularSpeedSq(const int32 index)
Definition RigidParticles.h:205
FORCEINLINE TVector< T, d > & Acceleration(const int32 Index)
Definition RigidParticles.h:166
FORCEINLINE TRotation< T, d > & RotationOfMass(const int32 Index)
Definition RigidParticles.h:193
FORCEINLINE T & MaxLinearSpeedSq(const int32 index)
Definition RigidParticles.h:202
FORCEINLINE const TVec3< FRealSingle > & I(const int32 Index) const
Definition RigidParticles.h:174
Definition Rotation.h:41
Definition Vector.h:1000
Definition Vector.h:41
virtual CORE_API void UsingCustomVersion(const struct FGuid &Guid)
Definition Archive.cpp:590
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
CORE_API int32 CustomVer(const struct FGuid &Key) const
Definition Archive.cpp:602
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void SetNumZeroed(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2340
Definition UniquePtr.h:107
Definition CriticalSection.h:14
UE_REWRITE void WriteLock()
Definition CriticalSection.h:21
UE_REWRITE void WriteUnlock()
Definition CriticalSection.h:26
Definition SkeletalMeshComponent.h:307
@ X
Definition SimulationModuleBase.h:152
FChaosArchive & operator<<(FChaosArchive &Ar, FRigidParticleControlFlags &Flags)
Definition RigidParticleControlFlags.cpp:15
ECollisionConstraintFlags
Flags for user-control over per-particle collision behaviour.
Definition CollisionConstraintFlags.h:22
EObjectStateType
Definition ObjectState.h:10
constexpr int8 NumBitsNeeded(const int8 MaxValue)
Definition RigidParticles.h:48
float FRealSingle
Definition Real.h:14
@ Disabled
Definition SimulationModuleBase.h:138
ESleepType
Definition RigidParticles.h:23
constexpr int8 LowBitsMask(const int8 NumBits)
Definition RigidParticles.h:54
U16 Index
Definition radfft.cpp:71
Definition RigidParticles.h:66
FRigidParticleControlFlags ControlFlags
Definition RigidParticles.h:69
EObjectStateType ObjectState
Definition RigidParticles.h:71
bool bDisabled
Definition RigidParticles.h:73
uint32 CollisionConstraintFlags
Definition RigidParticles.h:68
FRigidParticleTransientFlags TransientFlags
Definition RigidParticles.h:70
int32 CollisionGroup
Definition RigidParticles.h:67
EObjectStateType PreObjectState
Definition RigidParticles.h:72
Definition RigidParticles.h:30
TSleepData(TGeometryParticleHandle< T, d > *InParticle, bool InSleeping)
Definition RigidParticles.h:36
bool Sleeping
Definition RigidParticles.h:43
TSleepData()
Definition RigidParticles.h:31
TGeometryParticleHandle< T, d > * Particle
Definition RigidParticles.h:42
CORE_API static const FGuid GUID
Definition ExternalPhysicsCustomObjectVersion.h:144
@ AddDampingToRigids
Definition ExternalPhysicsCustomObjectVersion.h:85
@ KinematicCentersOfMass
Definition ExternalPhysicsCustomObjectVersion.h:76
CORE_API static const FGuid GUID
Definition FortniteMainBranchObjectVersion.h:21
CORE_API static const FGuid GUID
Definition UE5ReleaseStreamObjectVersion.h:22