I've developed miltithreaded game engine using BEPU. It's works fine, but sometimes BEPU crashes in "internal void RayCast(ref Ray ray, IList<BroadPhaseEntry> outEntries)" in DynamicHierarchyNode.cs with "Collection was modified; enumeration operation may not execute."
RayCast called from worker thread.
Multithreaded RayCast Issue
Re: Multithreaded RayCast Issue
Is it running in parallel with the physics update? The broad phase update will interfere with any queries going on at the time, so it's not allowed. All BroadPhases expose a Locker property which is held when the BroadPhase updates. You can lock it before performing a raycast to ensure that it won't get corrupted.
Re: Multithreaded RayCast Issue
yesNorbo wrote:Is it running in parallel with the physics update?
Thanks! It's works.Norbo wrote:You can lock it before performing a raycast to ensure that it won't get corrupted.