Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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();
     }
 }
Ejemplo n.º 4
0
        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();
        }