Array out of index with NarrowPhaseSystems
Posted: Mon Jan 14, 2019 7:28 pm
Hi,
I`m getting array out of index in BEPUutilities.DataStructures.RawList<BEPUphysics.NarrowPhaseSystems.Pairs.NarrowPhasePair>.FastRemoveAt(int index) when adding box to physics scene in bepu 1. It happens when I receive command from server that I execute.
I tried to use Space.SpaceObjectBuffer but it didn't help as I thought it might be because of bepu is currently running.
My update code is very simple. It's like this - where all the computation and added objects should be run before physics update. Any ideas?
Edit: Oh yeah and I´m running on .net core 2.1 - can BEPU 1 run on it? I thought I saw release that supports at least .NET Standard 2.0..?
I`m getting array out of index in BEPUutilities.DataStructures.RawList<BEPUphysics.NarrowPhaseSystems.Pairs.NarrowPhasePair>.FastRemoveAt(int index) when adding box to physics scene in bepu 1. It happens when I receive command from server that I execute.
I tried to use Space.SpaceObjectBuffer but it didn't help as I thought it might be because of bepu is currently running.
Code: Select all
/// <summary>
/// Removes an element from the list without maintaining order.
/// </summary>
/// <param name="index">Index of the element to remove.</param>
public void FastRemoveAt(int index)
{
if (index >= Count)
{
throw new ArgumentOutOfRangeException("index");
}
Count--;
if (index < Count)
{
Elements[index] = Elements[Count];
}
Elements[Count] = default(T);
}
Code: Select all
public void StepForward(float dt)
{
tickSystem.Run();
physicsScene.Update();
}