public PhysicsSimulationExecutor(PhysicsWorldInfo worldInfo) { var worldAabb = new AABB { LowerBound = worldInfo.LowerBound.FromVector2(), UpperBound = worldInfo.UpperBound.FromVector2() }; world = new World(worldAabb, worldInfo.Gravity.FromVector2(), worldInfo.DoSleep); world.SetContactFilter(new ContactFilterModified()); world.SetContactListener(new ContactListenerModified()); world.SetContinuousPhysics(false); }
public void AddScene(Maps map, Vector2 sceneSize, Vector2 regionSize, PhysicsWorldInfo physicsWorldInfo, bool drawPhysics) { var gameSceneWrapper = new GameSceneWrapper(map, sceneSize, regionSize); scenes.Add(map, gameSceneWrapper); var scene = gameSceneWrapper.GetScene(); scene.Components.AddComponent(new SceneOrderExecutor()); scene.Components.AddComponent(new PhysicsSimulationExecutor(physicsWorldInfo)); scene.Components.AddComponent(new PhysicsMapCreator(map)); scene.Components.AddComponent(new EntityManager()); gameSceneWrapper.CreateSceneObjectsViaPython(); if (drawPhysics) { RunScenePhysicsSimulationWindow(scene.Components, map.ToString(), 800, 600); } }