10-05-2022, 09:32 AM
(This post was last modified: 10-05-2022, 09:32 AM by josemendez.)
Hi there!
The 3 calls above are no longer necessary. Actors are automatically added to the first solver up their hierarchy, no need to call AddToSolver() manually. Also, the solver stores some "dirty" flags which automatically update active constraints or particles when necessary, so no need for SetActiveConstraints() or UpdateActiveParticles().
Regarding batch.GetConstraintsInvolvingParticle(), it was removed due to how inefficient it is (linear search trough all constraints in the cloth). Note you can still reimplement it if you want, it just iterates trough all constraints in the batch checking its particleIndices array for references to that particle. Each distance constraint references 2 particles, so something like:
The 3 calls above are no longer necessary. Actors are automatically added to the first solver up their hierarchy, no need to call AddToSolver() manually. Also, the solver stores some "dirty" flags which automatically update active constraints or particles when necessary, so no need for SetActiveConstraints() or UpdateActiveParticles().
Regarding batch.GetConstraintsInvolvingParticle(), it was removed due to how inefficient it is (linear search trough all constraints in the cloth). Note you can still reimplement it if you want, it just iterates trough all constraints in the batch checking its particleIndices array for references to that particle. Each distance constraint references 2 particles, so something like:
Code:
for (int i = 0; i < activeConstraintCount; ++i)
{
if (particleIndices[i*2] == particleIndex || particleIndices[i*2+1] == particleIndex)
affectedConstraints.Add(i/2);
}