Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Index was outside the bounds of the array
#3
Indeed, it was a bug. Thanks you both for finding and reporting it.

Change lines 153-162 of ObiSkinnedCloth.cs with this:

Code:
int solverIndex = batch.particleIndices[i];
int actorIndex = solver.particleToActor[solverIndex].indexInActor;

batch.skinPoints[i] = skinToSolver.MultiplyPoint3x4(sortedPoints[actorIndex]);
batch.skinNormals[i] = skinToSolver.MultiplyVector(sortedNormals[actorIndex]);

// Rigidly transform particles with zero skin radius and zero compliance:
if (Mathf.Approximately(batch.skinRadiiBackstop[i * 3], 0) & Mathf.Approximately(batch.skinCompliance[i], 0))
{
     solver.invMasses[solverIndex] = 0;
     solver.positions[solverIndex] = batch.skinPoints[i];
}

That should fix it. I'm attaching the entire corrected file for convenience.

Let me know how it goes.


Attached Files
.cs   ObiSkinnedCloth.cs (Size: 7.36 KB / Downloads: 3)
Reply


Messages In This Thread
RE: Index was outside the bounds of the array - by josemendez - 21-01-2020, 11:27 AM