Beispiel #1
0
        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);
        }
Beispiel #2
0
 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();
     }
 }