public Simulation Create(PhysicsProcessor sceneProcessor, PhysicsEngineFlags flags = PhysicsEngineFlags.None) { var scene = new PhysicsScene { Processor = sceneProcessor, Simulation = new Simulation(sceneProcessor, physicsConfiguration) }; scenes.Add(scene); return(scene.Simulation); }
public object Create(PhysicsProcessor sceneProcessor, PhysicsEngineFlags flags = PhysicsEngineFlags.None, bool bepu = false) { var scene = new PhysicsScene { Processor = sceneProcessor, Simulation = bepu == false ? new Simulation(sceneProcessor, physicsConfiguration) : null, BepuSimulation = bepu ? new BepuSimulation(physicsConfiguration) : null }; scenes.Add(scene); return(bepu ? (object)scene.BepuSimulation : (object)scene.Simulation); }
public void Release(PhysicsProcessor processor) { lock (this) { var scene = scenes.SingleOrDefault(x => x.Processor == processor); if (scene == null) { return; } scenes.Remove(scene); scene.Simulation.Dispose(); } }
public void Release(PhysicsProcessor processor) { EndThread(); var scene = scenes.SingleOrDefault(x => x.Processor == processor); if (scene == null) { return; } scenes.Remove(scene); scene.Simulation?.Dispose(); scene.BepuSimulation?.Dispose(); }