BepuPhysics/BodyLayoutOptimizer.cs
/// <summary>
/// Checks the referenced bodies set and resizes the claims array if it does not match the size needed to contain the bodies set.
/// </summary>
Checks the referenced bodies set and resizes the claims array if it does not match the size needed to contain the bodies set.
Checks the referenced bodies set and resizes the claims array if it does not match the size needed to contain the bodies set .
public void ResizeForBodiesCapacity(BufferPool pool)
        {
            var bodiesCapacity = bodies.ActiveSet.IndexToHandle.Length;
            if (claims.Length != BufferPool<int>.GetLowestContainingElementCount(bodiesCapacity))
            {
                pool.SpecializeFor<int>().Resize(ref claims, bodiesCapacity, 0);
                claims.Clear(0, claims.Length);
            }
        }
public void ResizeForBodiesCapacity ( BufferPool pool ) { var bodiesCapacity = bodies . ActiveSet . IndexToHandle . Length ; if ( claims . Length != BufferPool < int > . GetLowestContainingElementCount ( bodiesCapacity ) ) { pool . SpecializeFor < int > ( ) . Resize ( ref claims , bodiesCapacity , 0 ) ; claims . Clear ( 0 , claims . Length ) ; } }
Checks the referenced bodies set and resizes the claims array if it does not match the size needed to contain the bodies set.
Checks the referenced bodies set and resizes the claims array if it does not match the size needed to contain the bodies set .
//We need a new claims buffer. Get rid of the old one. //Claims need to be zeroed so that workers can claim by identity. //Go ahead and clear the full buffer so we don't have to worry about later body additions resulting in accesses to uncleared memory. //Easier to clear upfront than track every single add.
pool
BufferPool