public BepuSimulation Create(BepuPhysicsProcessor sceneProcessor, BepuPhysicsEngineFlags flags = BepuPhysicsEngineFlags.None) { var scene = new PhysicsScene { Processor = sceneProcessor, Simulation = new BepuSimulation(sceneProcessor, physicsConfiguration) }; lock (this) { scenes.Add(scene); } return(scene.Simulation); }
public void Release(BepuPhysicsProcessor processor) { lock (this) { var scene = scenes.SingleOrDefault(x => x.Processor == processor); if (scene == null) { return; } scenes.Remove(scene); scene.Simulation.Dispose(); } }