UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
PBDRigidClustering.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
8#include "Chaos/Transform.h"
11#include "Chaos/TriangleMesh.h"
16
17namespace Chaos
18{
19 class FPBDCollisionConstraints;
20
24
25/****
26*
27* FRigidClustering
28*
29* The Chaos Destruction System allows artists to define exactly how geometry
30* will break and separate during the simulations. Artists construct the
31* simulation assets using pre-fractured geometry and utilize dynamically
32* generated rigid constraints to model the structural connections during the
33* simulation. The resulting objects within the simulation can separate from
34* connected structures based on interactions with environmental elements,
35* like fields and collisions.
36*
37* The destruction system relies on an internal clustering model
38* (aka Clustering) which controls how the rigidly attached geometry is
39* simulated. Clustering allows artists to initialize sets of geometry as
40* a single rigid body, then dynamically break the objects during the
41* simulation. At its core, the clustering system will simply join the mass
42* and inertia of each connected element into one larger single rigid body.
43*
44* At the beginning of the simulation a connection graph is initialized
45* based on the rigid body’s nearest neighbors. Each connection between the
46* bodies represents a rigid constraint within the cluster and is given
47* initial strain values. During the simulation, the strains within the
48* connection graph are evaluated. The connections can be broken when collision
49* constraints, or field evaluations, impart an impulse on the rigid body that
50* exceeds the connections limit. Fields can also be used to decrease the
51* internal strain values of the connections, resulting in a weakening of the
52* internal structure
53*
54*/
56{
57public:
58
65
68
69 //
70 // Initialization
71 //
72
84 const int32 ClusterGroupIndex,
89 const FUniqueIdx* ExistingIndex = nullptr);
90
91 UE_DEPRECATED(5.4, "Use CreateClusterParticle with FImplicitObjectPtr instead")
93 const int32 ClusterGroupIndex,
98 const FUniqueIdx* ExistingIndex = nullptr)
99 {
100 check(false);
101 return nullptr;
102 }
103
112 const FClusterCreationParameters& Parameters/* = FClusterCreationParameters()*/);
113
123
136
137 //
138 // Releasing
139 //
140
141 /*
142 * DeactivateClusterParticle
143 * Release all the particles within the cluster particle
144 */
146
147 /*
148 * ReleaseClusterParticles (BasedOnStrain)
149 * Release clusters based on the passed in \p ExternalStrainArray, or the
150 * particle handle's current \c CollisionImpulses() value. Any cluster bodies
151 * that have a strain value less than this valid will be released from the
152 * cluster.
153 */
156 bool bForceRelease = false);
157
160 bool bForceRelease = false);
161
162 /*
163 * ReleaseClusterParticles
164 * Release all rigid body IDs passed,
165 */
168
174
175 /*
176 * DestroyClusterParticle
177 * Disable the cluster particle and remove from all internal clustering
178 * structures. This will not activate children.
179 *
180 * Returns the active parent cluster that might need to be rebuilt because
181 * its geometry might be pointing to deleted particle handels.
182 */
186
187 /*
188 * BreakCluster
189 * Breaks a cluster (internal or not) by applying max external strain to all its children
190 *
191 * @param ClusteredParticle handle of the cluster to break
192 * @return true if the cluster was successfully found and act upon
193 */
195
196 /*
197 * BreakClustersByProxy
198 * Breaks clusters (internal or not) own by a specific proxy by applying max external strain to all its children
199 *
200 * @param Proxy proxy owning the clusters to break
201 * @return true if any cluster was successfully found and act upon
202 */
204
205 //
206 // Operational
207 //
208
209 /*
210 * AdvanceClustering
211 * Advance the cluster forward in time;
212 * ... Union unprocessed geometry.
213 * ... Release bodies based collision impulses.
214 * ... Updating properties as necessary.
215 */
217
228
229 //
230 // Access
231 //
232
240
241 /*
242 * GetActiveClusterIndex
243 * Get the current childs active cluster. Returns INDEX_NONE if
244 * not active or driven.
245 */
247
248 /*
249 * GetClusterIdsArray
250 * The cluster ids provide a mapping from the rigid body index
251 * to its parent cluster id. The parent id might not be the
252 * active id, see the GetActiveClusterIndex to find the active cluster.
253 * INDEX_NONE represents a non-clustered body.
254 */
257
258 /*
259 * GetRigidClusteredFlagsArray
260 * The RigidClusteredFlags array contains various flag related to clustered particles
261 */
263
264 /*
265 * GetChildToParentMap
266 * This map stores the relative transform from a child to its cluster parent.
267 */
269
270 /*
271 * GetStrainArray
272 * The strain array is used to store the maximum strain allowed for a individual
273 * body in the simulation. This attribute is initialized during the creation of
274 * the cluster body, can be updated during the evaluation of the simulation.
275 */
277 const TArrayCollectionArray<FRealSingle>& GetStrainArray() const { return MParticles.StrainsArray(); }
278
285 FClusterMap& GetChildrenMap() { return MChildren; }
286 const FClusterMap& GetChildrenMap() const { return MChildren; }
287
288 /*
289 * GetClusterGroupIndexArray
290 * The group index is used to automatically bind disjoint clusters. This attribute it set
291 * during the creation of cluster to a positive integer value. During UnionClusterGroups (which
292 * is called during AdvanceClustering) the positive bodies are joined with a negative pre-existing
293 * body, then set negative. Zero entries are ignored within the union.
294 */
296
297 /*
298 * Reset all events ( this include breaking, crumbling event and tracking data
299 */
301
302 /*
303 * Cluster Break Data
304 * The cluster breaks can be used to seed particle emissions.
305 */
306 const TArray<FBreakingData>& GetAllClusterBreakings() const { return MAllClusterBreakings; }
307 void SetGenerateClusterBreaking(bool DoGenerate) { DoGenerateBreakingData = DoGenerate; }
308 bool GetDoGenerateBreakingData() const { return DoGenerateBreakingData; }
309 void ResetAllClusterBreakings() { MAllClusterBreakings.Reset(); }
310
311 /*
312 * Cluster crumbling Data
313 * triggered when all the children of a cluster are released all at once
314 * event is generated only if the owning proxy allows it
315 */
316 const TArray<FCrumblingData>& GetAllClusterCrumblings() const { return MAllClusterCrumblings; }
317 void ResetAllClusterCrumblings() { MAllClusterCrumblings.Reset(); }
318
319 /*
320 * GetConnectivityEdges
321 * Provides a list of each rigid body's current siblings and associated strain within the cluster.
322 */
324
325 /*
326 * FindClosestChild
327 * Find the closest child of an active cluster from a world position
328 * current implementation will pick the closest based on the distance from the center
329 * future implementation may expose option for more precise queries
330 * @param ClusteredParticle active cluster handle to query the children from
331 * @param WorldLocation world space location to find the closest child from
332 */
334
335 /*
336 * FindClosest
337 * Find the closest particle from an array of particle
338 * current implementation will pick the closest based on the distance from the center
339 * future implementation may expose option for more precise queries
340 * @param Particles array of clustered particles to select from
341 * @param WorldLocation world space location to find the closest particle from
342 */
344
345 /*
346 * FindChildrenWithinRadius
347 * Find the children of an active cluster from a world position and a radius
348 * current implementation will pick the closest based on the distance from the center
349 * future implementation may expose option for more precise queries
350 * if bAlwaysReturnClosest is checked this will always return the closest from the location even if the radius does not encompass any center of mass
351 * @param ClusteredParticle active cluster handle to query the children from
352 * @param WorldLocation world space location to find the closest child from
353 * @param Radius Radius to use from the WorldLocation
354 * @param bAlwaysReturnClosest if radius query does not return anything still return the closest from the point
355 */
357
358 /*
359 * FindParticlesWithinRadius
360 * Find the closest particle from an array of particle from a world position and a radius
361 * current implementation will pick the closest based on the distance from the center
362 * future implementation may expose option for more precise queries
363 * if bAlwaysReturnClosest is checked this will always return the closest from the location even if the radius does not encompass any center of mass
364 * @param Particles array of clustered particles to select from
365 * @param WorldLocation world space location to find the closest particle from
366 * @param bAlwaysReturnClosest if radius query does not return anything still return the closest from the point
367 */
369
376 void SetClusterUnionConnectionType(FClusterCreationParameters::EConnectionMethod ClusterConnectionType) { MClusterUnionConnectionType = ClusterConnectionType; }
378
379 void ApplySettings(const FChaosSolverConfiguration& Settings);
380
382 const TArray<FPBDRigidParticleHandle*>& Particles,
386
390
392
393 const TSet<Chaos::FPBDRigidClusteredParticleHandle*>& GetTopLevelClusterParents() const { return TopLevelClusterParents; }
395
396 FRigidEvolution& GetEvolution() { return MEvolution; }
397 const FRigidEvolution& GetEvolution() const { return MEvolution; }
398
401
402 /*
403 * BuildConvexOptimizer
404 * Create the convex optimizer unique ptr and loop over the particle geometry to simplify
405 * all the convexes within the hierarchy
406 * @param Particle particle on which the geometry will be simplified
407 */
409
411
412 FClusterUnionManager& GetClusterUnionManager() { return ClusterUnionManager; }
413 const FClusterUnionManager& GetClusterUnionManager() const { return ClusterUnionManager; }
414
415 UE_DEPRECATED(5.4, "No longer expose publicly - now return empty set")
421
422 // Remove connectivity edges for specified particles
425
426 template<typename TFilter>
428 {
429 check(ClusteredChild != nullptr);
430
431 constexpr bool bHasFilter = std::is_invocable_r_v < bool, TFilter, const TConnectivityEdge<FReal>&>;
432 TArray<TConnectivityEdge<FReal>>& Edges = ClusteredChild->ConnectivityEdges();
433 for (int32 EdgeIndex = Edges.Num() - 1; EdgeIndex >= 0; --EdgeIndex)
434 {
435 const TConnectivityEdge<FReal>& Edge = Edges[EdgeIndex];
436 FPBDRigidParticleHandle* Sibling = Edge.Sibling;
437 if constexpr (bHasFilter)
438 {
439 if (!Filter(Edge))
440 {
441 continue;
442 }
443
444 Edges.RemoveAtSwap(EdgeIndex, EAllowShrinking::No);
445 }
446
447 check(Sibling != nullptr);
448 TArray<TConnectivityEdge<FReal>>& OtherEdges = Sibling->CastToClustered()->ConnectivityEdges();
449 const int32 Idx = OtherEdges.IndexOfByKey(ClusteredChild);
450 if (Idx != INDEX_NONE)
451 {
452 OtherEdges.RemoveAtSwap(Idx);
453 }
454
455 // Make sure there are no duplicates!
456 check(OtherEdges.IndexOfByKey(ClusteredChild) == INDEX_NONE);
457 }
458
459 if constexpr (!bHasFilter)
460 {
461 Edges.SetNum(0);
462 }
463 else
464 {
465 Edges.Shrink();
466 }
467 }
468
469 template<typename ParticleHandleTypeA, typename ParticleHandleTypeB>
471 {
472 if(A && B)
473 {
474 CreateNodeConnection(A->CastToClustered(), B->CastToClustered());
475 }
476 else
477 {
478 ensureMsgf(false, TEXT("CreateNodeConnection asked to connect a null particle, ignoring connection."));
479 }
480 }
481
483
484
490
495
497
501
504
505 const FChaosSolverDestructionSettings& GetDestructionSettings() const { return DestructionSettings; }
506
507 protected:
508
512
513 /*
514 * Connectivity
515 */
517 const TArray<FPBDRigidParticleHandle*>& Particles,
524
526 const TArray<FPBDRigidParticleHandle*>& Particles,
533
535 const TArray<FPBDRigidParticleHandle*>& Particles,
542
544 const TArray<FPBDRigidParticleHandle*>& Particles,
551
554
555 // When a body has broken due to contact resolution, record an entry in a set
556 // for the collision and the particle who's momentum should be restored.
558
559 // Restore some percentage of momenta for objects which were involved in collisions
560 // with destroyed GCs
563
566
569 bool bForceRelease,
570 bool bCreateNewClusters);
571
575
577
583 UE_DEPRECATED(5.4, "This should be handled for you properly in AddParticlesToCluster and RemoveParticlesFromCluster. There is no need for an extra function call.")
586 const FRigidHandleArray& Children,
588
589private:
590
591 // Cluster release stats for debugging with CVar p.Chaos.Clustering.DumpClusterAndReleaseStats
592 uint32 AdvanceCount = 0;
593 uint32 TotalProcessedClusters = 0;
594 uint32 TotalReleasedChildren = 0;
595 uint32 FrameProcessedClusters = 0;
596 uint32 FrameReleasedChildren = 0;
597
598 FRigidEvolution& MEvolution;
599 FPBDRigidClusteredParticles& MParticles;
600 TSet<Chaos::FPBDRigidClusteredParticleHandle*> TopLevelClusterParents;
601
602 TMap<Chaos::FPBDRigidClusteredParticleHandle*, int64> TopLevelClusterParentsStrained;
603
604 // Cluster data
605 FClusterMap MChildren;
606
612 FClusterUnionManager ClusterUnionManager;
613
614 // Collision Impulses
615 bool MCollisionImpulseArrayDirty;
616
617 // Breaking data
618 bool DoGenerateBreakingData;
619 TArray<FBreakingData> MAllClusterBreakings;
620
621 TArray<FCrumblingData> MAllClusterCrumblings;
622
623 TSet<FPBDRigidClusteredParticleHandle*> CrumbledSinceLastUpdate;
624 TMap<IPhysicsProxyBase*, TArray<FPBDRigidClusteredParticleHandle*>> EmptyInternalClustersPerProxy;
625
626 struct FMomentumRestoringData
627 {
630 };
631 // this map stores the momentum information a particle had when colliding with a breaking clustered particle
632 // this allow the colliding particle to keep going if the clustered particle break depsite the fact that the collision constraint resolution stopped it
633 TMap<FPBDRigidParticleHandle*, FMomentumRestoringData> MomentumRestoringDataByParticle;
634
635 FReal MClusterConnectionFactor;
636 FClusterCreationParameters::EConnectionMethod MClusterUnionConnectionType;
637
638 // Sim callback objects which implement cluster modification steps
639 const TArray<ISimCallbackObject*>* StrainModifiers;
640
641 FChaosSolverDestructionSettings DestructionSettings;
642};
643
644} // namespace Chaos
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define check(expr)
Definition AssertionMacros.h:314
#define ensureMsgf( InExpression, InFormat,...)
Definition AssertionMacros.h:465
@ INDEX_NONE
Definition CoreMiscDefines.h:150
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
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
ESPMode
Definition SharedPointerFwd.h:12
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ClusterUnionManager.h:159
Definition ImplicitObject.h:111
Definition PBDCollisionConstraints.h:49
Definition PBDRigidsEvolutionGBF.h:51
Definition PBDRigidClustering.h:56
FClusterUnionManager & GetClusterUnionManager()
Definition PBDRigidClustering.h:412
FPBDRigidsEvolutionGBF FRigidEvolution
Definition PBDRigidClustering.h:59
const TArrayCollectionArray< TArray< TConnectivityEdge< FReal > > > & GetConnectivityEdges() const
Definition PBDRigidClustering.h:323
void ResetAllClusterBreakings()
Definition PBDRigidClustering.h:309
const TArrayCollectionArray< FRealSingle > & GetStrainArray() const
Definition PBDRigidClustering.h:277
const TSet< Chaos::FPBDRigidClusteredParticleHandle * > & GetTopLevelClusterParentsStrained() const
Definition PBDRigidClustering.h:416
const FClusterUnionManager & GetClusterUnionManager() const
Definition PBDRigidClustering.h:413
CHAOS_API void SetExternalStrain(FPBDRigidClusteredParticleHandle *Particle, FRealSingle Strain)
Definition PBDRigidClustering.cpp:1055
CHAOS_API ~FRigidClustering()
Definition PBDRigidClustering.cpp:207
CHAOS_API void RemoveChildFromParentAndChildrenArray(FPBDRigidParticleHandle *Child, FPBDRigidClusteredParticleHandle *ClusteredParent)
Definition PBDRigidClustering.cpp:960
void ResetAllClusterCrumblings()
Definition PBDRigidClustering.h:317
const TArrayCollectionArray< FRigidClusteredFlags > & GetRigidClusteredFlagsArray() const
Definition PBDRigidClustering.h:262
static CHAOS_API bool ShouldUnionsHaveCollisionParticles()
Definition PBDRigidClustering.cpp:550
CHAOS_API void SendBreakingEvent(FPBDRigidClusteredParticleHandle *ClusteredParticle, bool bFromCrumble)
Definition PBDRigidClustering.cpp:780
CHAOS_API FPBDRigidParticleHandle * GetActiveClusterIndex(FPBDRigidParticleHandle *Child)
Definition PBDRigidClustering.cpp:2048
const FRigidEvolution & GetEvolution() const
Definition PBDRigidClustering.h:397
CHAOS_API void RemoveChildFromParent(FPBDRigidParticleHandle *Child, FPBDRigidClusteredParticleHandle *ClusteredParent)
Definition PBDRigidClustering.cpp:910
FPBDRigidClusteredParticleHandle * FClusterHandle
Definition PBDRigidClustering.h:62
CHAOS_API void SendCrumblingEvent(FPBDRigidClusteredParticleHandle *ClusteredParticle)
Definition PBDRigidClustering.cpp:807
CHAOS_API bool BreakClustersByProxy(const IPhysicsProxyBase *Proxy)
Definition PBDRigidClustering.cpp:2600
CHAOS_API void ClearConnectionGraph(FPBDRigidClusteredParticleHandle *Parent)
Definition PBDRigidClustering.cpp:2196
CHAOS_API void AdvanceClustering(const FReal dt, FPBDCollisionConstraints &CollisionRule)
Definition PBDRigidClustering.cpp:1672
const TArrayCollectionArray< FRigidTransform3 > & GetChildToParentMap() const
Definition PBDRigidClustering.h:268
const FChaosSolverDestructionSettings & GetDestructionSettings() const
Definition PBDRigidClustering.h:505
CHAOS_API TSet< FPBDRigidParticleHandle * > HandleConnectivityOnReleaseClusterParticle(FPBDRigidClusteredParticleHandle *ClusteredParticle, bool bCreateNewClusters)
Definition PBDRigidClustering.cpp:1352
CHAOS_API void ComputeStrainFromCollision(const FPBDCollisionConstraints &CollisionRule, const FReal Dt)
Definition PBDRigidClustering.cpp:2226
CHAOS_API void RemoveNodeConnections(FPBDRigidParticleHandle *Child)
Definition PBDRigidClustering.cpp:3079
TArrayCollectionArray< int32 > & GetClusterGroupIndexArray()
Definition PBDRigidClustering.h:295
void SetClusterUnionConnectionType(FClusterCreationParameters::EConnectionMethod ClusterConnectionType)
Definition PBDRigidClustering.h:376
CHAOS_API void UpdateTopLevelParticle(FPBDRigidClusteredParticleHandle *Particle)
Definition PBDRigidClustering.cpp:1061
CHAOS_API void ResetCollisionImpulseArray()
Definition PBDRigidClustering.cpp:2429
CHAOS_API void UpdateConnectivityGraphUsingDelaunayTriangulation(const TArray< FPBDRigidParticleHandle * > &Particles, const FClusterCreationParameters &Parameters=FClusterCreationParameters(), const TSet< FPBDRigidParticleHandle * > *FromParticles=nullptr, const TSet< FPBDRigidParticleHandle * > *ToParticles=nullptr)
Definition PBDRigidClustering.cpp:3021
void SetClusterConnectionFactor(FReal ClusterConnectionFactorIn)
Definition PBDRigidClustering.h:375
CHAOS_API void FixConnectivityGraphUsingDelaunayTriangulation(const TArray< FPBDRigidParticleHandle * > &Particles, const FClusterCreationParameters &Parameters=FClusterCreationParameters(), const TSet< FPBDRigidParticleHandle * > *FromParticles=nullptr, const TSet< FPBDRigidParticleHandle * > *ToParticles=nullptr)
Definition PBDRigidClustering.cpp:2802
const TSet< Chaos::FPBDRigidClusteredParticleHandle * > & GetTopLevelClusterParents() const
Definition PBDRigidClustering.h:393
CHAOS_API void UpdateClusterParticlePropertiesFromChildren(FPBDRigidClusteredParticleHandle *Cluster, const FRigidHandleArray &Children, const TMap< FPBDRigidParticleHandle *, FPBDRigidParticleHandle * > &ChildToParentMap)
Definition PBDRigidClustering.cpp:516
void SetGenerateClusterBreaking(bool DoGenerate)
Definition PBDRigidClustering.h:307
FRigidEvolution & GetEvolution()
Definition PBDRigidClustering.h:396
void CreateNodeConnection(ParticleHandleTypeA *A, ParticleHandleTypeB *B)
Definition PBDRigidClustering.h:470
void ThrottleReleasedParticlesIfNecessary(TSet< FPBDRigidParticleHandle * > &Particles)
Definition PBDRigidClustering.cpp:3099
void RemoveFilteredNodeConnections(FPBDRigidClusteredParticleHandle *ClusteredChild, TFilter &&Filter)
Definition PBDRigidClustering.h:427
TMap< FClusterHandle, FRigidHandleArray > FClusterMap
Definition PBDRigidClustering.h:63
CHAOS_API void AddParticlesToCluster(FPBDRigidClusteredParticleHandle *Cluster, const TArray< FPBDRigidParticleHandle * > &InChildren, const TMap< FPBDRigidParticleHandle *, FPBDRigidParticleHandle * > &ChildToParentMap)
Definition PBDRigidClustering.cpp:335
TArray< FRigidHandle > FRigidHandleArray
Definition PBDRigidClustering.h:61
CHAOS_API void BuildConvexOptimizer(FPBDRigidClusteredParticleHandle *Particle)
Definition PBDRigidClustering.cpp:394
CHAOS_API FPBDRigidParticleHandle * FindClosestChild(const FPBDRigidClusteredParticleHandle *ClusteredParticle, const FVec3 &WorldLocation) const
Definition PBDRigidClustering.cpp:2059
TArrayCollectionArray< FRealSingle > & GetStrainArray()
Definition PBDRigidClustering.h:276
CHAOS_API bool BreakCluster(FPBDRigidClusteredParticleHandle *ClusteredParticle)
Definition PBDRigidClustering.cpp:2569
FClusterMap & GetChildrenMap()
Definition PBDRigidClustering.h:285
CHAOS_API void TrackBreakingCollision(FPBDRigidClusteredParticleHandle *ClusteredParticle)
Definition PBDRigidClustering.cpp:701
const TArrayCollectionArray< ClusterId > & GetClusterIdsArray() const
Definition PBDRigidClustering.h:256
CHAOS_API void UnionClusterGroups()
Definition PBDRigidClustering.cpp:672
CHAOS_API Chaos::FPBDRigidClusteredParticleHandle * CreateClusterParticleFromClusterChildren(TArray< FPBDRigidParticleHandle * > &&Children, FPBDRigidClusteredParticleHandle *Parent, const FRigidTransform3 &ClusterWorldTM, const FClusterCreationParameters &Parameters)
Definition PBDRigidClustering.cpp:557
CHAOS_API void UpdateConnectivityGraphUsingPointImplicit(const TArray< FPBDRigidParticleHandle * > &Particles, FReal CollisionThicknessPercent, const TSet< FPBDRigidParticleHandle * > *FromParticles=nullptr, const TSet< FPBDRigidParticleHandle * > *ToParticles=nullptr)
Definition PBDRigidClustering.cpp:2719
CHAOS_API void DisableCluster(FPBDRigidClusteredParticleHandle *ClusteredParticle)
Definition PBDRigidClustering.cpp:2441
TFunction< void(FRigidClustering &, FRigidHandle)> FVisitorFunction
Definition PBDRigidClustering.h:64
CHAOS_API void RemoveFromMomentumRestoringStructures(const FPBDRigidParticleHandle *ParticleToRemove)
Definition PBDRigidClustering.cpp:775
CHAOS_API TArray< FPBDRigidParticleHandle * > CreateClustersFromNewIslands(TArray< FParticleIsland > &Islands, FPBDRigidClusteredParticleHandle *ClusteredParent)
Definition PBDRigidClustering.cpp:975
CHAOS_API void RemoveParticlesFromCluster(FPBDRigidClusteredParticleHandle *Cluster, const TArray< FPBDRigidParticleHandle * > &InChildren)
Definition PBDRigidClustering.cpp:448
void DisableParticle(FPBDRigidParticleHandle *ParticleToDisable, bool bRemoveFromChildrenMap=true)
Definition PBDRigidClustering.cpp:2449
CHAOS_API void ApplyStrainModifiers(const TArray< FPBDRigidClusteredParticleHandle * > &StrainedParticles)
Definition PBDRigidClustering.cpp:2470
CHAOS_API TSet< FPBDRigidParticleHandle * > DeactivateClusterParticle(FPBDRigidClusteredParticleHandle *ClusteredParticle)
Definition PBDRigidClustering.cpp:680
CHAOS_API void Visitor(FClusterHandle Cluster, FVisitorFunction Function)
Definition PBDRigidClustering.cpp:2004
CHAOS_API TSet< FPBDRigidParticleHandle * > ReleaseClusterParticlesNoInternalCluster(FPBDRigidClusteredParticleHandle *ClusteredParticle, bool bForceRelease=false)
Definition PBDRigidClustering.cpp:1095
CHAOS_API FPBDRigidClusteredParticleHandle * DestroyClusterParticle(FPBDRigidClusteredParticleHandle *ClusteredParticle, const FClusterDestoryParameters &Parameters=FClusterDestoryParameters())
Definition PBDRigidClustering.cpp:2483
CHAOS_API void BreakingModel()
Definition PBDRigidClustering.cpp:1915
CHAOS_API void ResetAllEvents()
Definition PBDRigidClustering.cpp:694
CHAOS_API void UpdateConnectivityGraphUsingDelaunayTriangulationWithBoundsOverlaps(const TArray< FPBDRigidParticleHandle * > &Particles, const FClusterCreationParameters &Parameters=FClusterCreationParameters(), const TSet< FPBDRigidParticleHandle * > *FromParticles=nullptr, const TSet< FPBDRigidParticleHandle * > *ToParticles=nullptr)
Definition PBDRigidClustering.cpp:3053
static CHAOS_API TArray< FPBDRigidParticleHandle * > FindParticlesWithinRadius(const TArray< FPBDRigidParticleHandle * > &Particles, const FVec3 &WorldLocation, FReal Radius, bool bAlwaysReturnClosest)
Definition PBDRigidClustering.cpp:2096
CHAOS_API Chaos::FPBDRigidClusteredParticleHandle * CreateClusterParticle(const int32 ClusterGroupIndex, TArray< Chaos::FPBDRigidParticleHandle * > &&Children, const FClusterCreationParameters &Parameters=FClusterCreationParameters(), const Chaos::FImplicitObjectPtr &ProxyGeometry=nullptr, const FRigidTransform3 *ForceMassOrientation=nullptr, const FUniqueIdx *ExistingIndex=nullptr)
Definition PBDRigidClustering.cpp:211
CHAOS_API TArray< FParticleIsland > FindIslandsInChildren(const FPBDRigidClusteredParticleHandle *ClusteredParticle, bool bTraverseInterclusterEdges)
Definition PBDRigidClustering.cpp:839
FClusterCreationParameters::EConnectionMethod GetClusterUnionConnectionType() const
Definition PBDRigidClustering.h:377
CHAOS_API void CleanupInternalClustersForProxies(TArrayView< IPhysicsProxyBase * > Proxies)
Definition PBDRigidClustering.cpp:1900
CHAOS_API TArray< FPBDRigidParticleHandle * > FindChildrenWithinRadius(const FPBDRigidClusteredParticleHandle *ClusteredParticle, const FVec3 &WorldLocation, FReal Radius, bool bAlwaysReturnClosest) const
Definition PBDRigidClustering.cpp:2086
TArrayCollectionArray< ClusterId > & GetClusterIdsArray()
Definition PBDRigidClustering.h:255
TSet< Chaos::FPBDRigidClusteredParticleHandle * > & GetTopLevelClusterParents()
Definition PBDRigidClustering.h:394
CHAOS_API void ForceReleaseChildParticleAndParents(FPBDRigidClusteredParticleHandle *ChildClusteredParticle, bool bTriggerBreakEvents)
Definition PBDRigidClustering.cpp:1624
const TArray< FBreakingData > & GetAllClusterBreakings() const
Definition PBDRigidClustering.h:306
bool ShouldThrottleParticleRelease() const
Definition PBDRigidClustering.cpp:3094
static CHAOS_API FPBDRigidParticleHandle * FindClosestParticle(const TArray< FPBDRigidParticleHandle * > &Particles, const FVec3 &WorldLocation)
Definition PBDRigidClustering.cpp:2068
CHAOS_API TSet< FPBDRigidParticleHandle * > ReleaseClusterParticles(FPBDRigidClusteredParticleHandle *ClusteredParticle, bool bForceRelease=false)
Definition PBDRigidClustering.cpp:1074
FPBDRigidParticleHandle * FRigidHandle
Definition PBDRigidClustering.h:60
bool GetDoGenerateBreakingData() const
Definition PBDRigidClustering.h:308
CHAOS_API TSet< FPBDRigidParticleHandle * > ReleaseClusterParticlesImpl(FPBDRigidClusteredParticleHandle *ClusteredParticle, bool bForceRelease, bool bCreateNewClusters)
Definition PBDRigidClustering.cpp:1109
const TArray< FCrumblingData > & GetAllClusterCrumblings() const
Definition PBDRigidClustering.h:316
CHAOS_API void SetInternalStrain(FPBDRigidClusteredParticleHandle *Particle, FRealSingle Strain)
Definition PBDRigidClustering.cpp:1049
void ApplySettings(const FChaosSolverConfiguration &Settings)
Definition PBDRigidClustering.cpp:3129
CHAOS_API void GenerateConnectionGraph(const TArray< FPBDRigidParticleHandle * > &Particles, const FClusterCreationParameters &Parameters=FClusterCreationParameters(), const TSet< FPBDRigidParticleHandle * > *FromParticles=nullptr, const TSet< FPBDRigidParticleHandle * > *ToParticles=nullptr)
Definition PBDRigidClustering.cpp:2131
CHAOS_API void RestoreBreakingMomentum()
Definition PBDRigidClustering.cpp:762
const FClusterMap & GetChildrenMap() const
Definition PBDRigidClustering.h:286
Definition ArrayCollectionArray.h:15
const TPBDRigidClusteredParticleHandleImp< T, d, bPersistent > * CastToClustered() const
Definition ParticleHandle.h:1703
Definition PBDRigidClusteredParticles.h:146
const auto & ClusterIdsArray() const
Definition PBDRigidClusteredParticles.h:222
const auto & ClusterGroupIndexArray() const
Definition PBDRigidClusteredParticles.h:231
const auto & ConnectivityEdgesArray() const
Definition PBDRigidClusteredParticles.h:220
const auto & StrainsArray() const
Definition PBDRigidClusteredParticles.h:228
const FRigidClusteredFlags & RigidClusteredFlags(int32 Idx) const
Definition PBDRigidClusteredParticles.h:217
const auto & ChildToParentArray() const
Definition PBDRigidClusteredParticles.h:225
Definition ParticleHandle.h:987
Definition PhysicsProxyBase.h:97
Definition ArrayView.h:139
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
void Reset(SizeType NewSize=0)
Definition Array.h:2246
UE_FORCEINLINE_HINT void RemoveAtSwap(SizeType Index, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2185
void SetNum(SizeType NewNum, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:2308
UE_FORCEINLINE_HINT void Shrink()
Definition Array.h:1278
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SkeletalMeshComponent.h:307
FRealDouble FReal
Definition Real.h:22
float FRealSingle
Definition Real.h:14
Definition ExternalCollisionData.h:213
Definition ClusterCreationParameters.h:14
EConnectionMethod
Definition ClusterCreationParameters.h:16
Definition PBDRigidClustering.h:21
bool bReturnInternalOnly
Definition PBDRigidClustering.h:22
Definition ExternalCollisionData.h:248
Definition GeometryParticlesfwd.h:87
Definition PBDRigidClusteredParticles.h:48
Definition ChaosSolverConfiguration.h:52
Definition ChaosSolverConfiguration.h:22
static CORE_API const TVector< double > ZeroVector
Definition Vector.h:79