Module |
|
Header |
/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/PBDConstraintGraph.h |
Include |
#include "Chaos/PBDConstraintGraph.h" |
Source |
/Engine/Source/Runtime/Experimental/Chaos/Private/Chaos/PBDConstraintGraph.cpp |
void InitializeGraph
(
const TParticleView< TGeometryParticles< FReal, 3 >> & Particles
)
Clear the graph and set up the particle-to-graph-node mapping for the specified particles Should be called before AddConstraint.
Called every frame, it used to clear all Nodes, Edges, ParticleToNodeIndex then AddToGraph on constraint rules would fill up
Now clears Edges and attempts to retain Nodes and ParticleToNodeIndex It is still setting up nodes that don't have a constraint so wasted effort iterating over all nodes, better to iterate over constraints or don't fill out Nodes if they don't have a constraint