From 6a48c1fbbb6be5e41baabb72cb04709fb95ffe08 Mon Sep 17 00:00:00 2001 From: Ross Nordby Date: Mon, 4 Mar 2024 16:43:08 -0600 Subject: [PATCH] Fixed an issue with kinematic integration responsibilities; incorrect buffer was being cleared. --- BepuPhysics/Solver_Solve.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BepuPhysics/Solver_Solve.cs b/BepuPhysics/Solver_Solve.cs index 91668475..6036375a 100644 --- a/BepuPhysics/Solver_Solve.cs +++ b/BepuPhysics/Solver_Solve.cs @@ -1130,7 +1130,8 @@ public override IndexSet PrepareConstraintIntegrationResponsibilities(IThreadDis pool.Take((bodies.HandlePool.HighestPossiblyClaimedId + 64) / 64, out mergedConstrainedBodyHandles.Flags); var copyLength = Math.Min(mergedConstrainedBodyHandles.Flags.Length, batchReferencedHandles[0].Flags.Length); batchReferencedHandles[0].Flags.CopyTo(0, mergedConstrainedBodyHandles.Flags, 0, copyLength); - batchReferencedHandles[0].Flags.Clear(copyLength, batchReferencedHandles[0].Flags.Length - copyLength); + mergedConstrainedBodyHandles.Flags.Clear(copyLength, mergedConstrainedBodyHandles.Flags.Length - copyLength); + //Yup, we're just leaving the first slot unallocated to avoid having to offset indices all over the place. Slight wonk, but not a big deal. bodiesFirstObservedInBatches[0] = default;