FPBDConstraintGraph

Build a graph of connected particles, and then a set of independent islands.

Windows
MacOS
Linux

References

Module

Chaos

Header

/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/PBDConstraintGraph.h

Include

#include "Chaos/PBDConstraintGraph.h"

Syntax

class FPBDConstraintGraph

Remarks

Build a graph of connected particles, and then a set of independent islands. Particles/constraints in different islands do not interact, so islands can be updated in parallel. This is also where particle sleeping is controlled. Note that at the moment this graph is rebuilt every frame. When this changes some of the underlying data will need to be changed. I.e. move from indices to pointers to handles

Constructors

Destructors

Name Description

Public function Virtual

~FPBDConstraintGraph()

Functions

Name Description

Public function

void

 

AddConstraint

(
    const uint32 InContainerId,
    FConstraintHandle* InConstrain...,
    const TVector< TGeometryParticleHan...
)

Add a constraint to the graph for each constraint in the container.

Public function

void

 

AddParticle

(
    TGeometryParticleHandle< FReal, 3 >...
)

Public function

void

 

DisableParticle

(
    TGeometryParticleHandle< FReal, 3 >...
)

Disable a particle and remove it from its island.

Public function

void

 

DisableParticles

(
    const TSet< TGeometryParticleHandle...
)

Disable a set of particles and remove them from their island.

Public function

void

 

EnableParticle

(
    TGeometryParticleHandle< FReal, 3 >...,
    const TGeometryParticleHandle< FRea...
)

Adds `ChildParticle_ to the constraint graph.

Public function Const

const FConst...

 

GetConstraintData

(
    int32 ConstraintDataIndex
)

Information mapping the edge back to a rule's constraint

Public function Const

const TArray...

 

GetIslandConstraintData

(
    int32 Island
)

Get the list of ConstraintsData indices associated with the specified island.

Public function Const

const TArray...

 

GetIslandParticles

(
    int32 Island
)

Get the list of Particle indices associated with the specified island.

Public function Const

int32

 

GetIslandSleepCount

(
    int32 Island
)

Get the list of Particle indices associated with the specified island.

Public function

void

 

InitializeGraph

(
    const TParticleView< TGeometryParti...
)

Clear the graph and set up the particle-to-graph-node mapping for the specified particles Should be called before AddConstraint.

Public function Const

int32

 

NumIslands()

The number of islands in the graph.

Public function

void

 

ReconcileIslands()

Ensure that the particles in each island have consistent sleep states - if any are awake, wake all.

Public function

void

 

RemoveParticle

(
    TGeometryParticleHandle< FReal, 3 >...
)

Remove particle from constraint, maybe rethink some of these names.

Public function

void

 

ReserveConstraints

(
    const int32 NumConstraints
)

Reserve space in the graph for NumConstraints additional constraints.

Public function

int32

 

ReserveParticles

(
    const int32 Num
)

Preallocate buffers for `Num_ particles.

Returns the number of new slots created.

Public function

void

 

ResetIslands

(
    const TParticleView< TPBDRigidParti...
)

Add particles/constraints to their particle's already-assigned islands (if applicable).

Public function

bool

 

SleepInactive

(
    const int32 Island,
    const TArrayCollectionArray< TSeria...
)

Put particles in inactive islands to sleep.

Public function

void

 

UpdateIslands

(
    const TParticleView< TPBDRigidParti...,
    TPBDRigidsSOAs< FReal, 3 >& Partic...
)

Generate the simulation islands of connected particles (AddConstraints must have already been called).

Public function

void

 

WakeIsland

(
    const int32 Island
)

Wake all particles in an Island.

Classes

Name

Description

Public struct

FConstraintData

Information required to map a graph edge back to its constraint

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss