Ejemplo n.º 1
0
 public void Load(String filename)
 {
     FileStream fs = new FileStream(filename, FileMode.Open);
     BinaryFormatter f = new BinaryFormatter();
     simulation = (Common.Motion.Simulation)f.Deserialize(fs);
     zombieSimulation = (Common.Motion.Simulation)f.Deserialize(fs);
 }
Ejemplo n.º 2
0
        public Manager(Map.Map map)
        {
            InRange = new Common.NearestNeighbours<Map.Destructible>(Vector2.Zero, Common.Math.ToVector2(map.Ground.Size), Program.Settings.AIInRangeGridSize);

             if (Program.Settings.MotionSettings.UseDummyMotion)
                 MotionSimulation = new Common.Motion.DummySimulation();
             else
             {
                 var sim = new Common.Motion.Simulation(map.NavMesh);
            #if BETA_RELEASE
                 sim.StepStart = () => PhysicsProfilers.Step.Start();
                 sim.StepStop = () => PhysicsProfilers.Step.Stop();

                 sim.UnitStepStart = () => PhysicsProfilers.UnitStep.Start();
                 sim.UnitStepStop = () => PhysicsProfilers.UnitStep.Stop();

                 sim.USFindStateStart = () => PhysicsProfilers.USFindState.Start();
                 sim.USFindStateStop = () => PhysicsProfilers.USFindState.Stop();

                 sim.USWalkStart = () => PhysicsProfilers.USWalk.Start();
                 sim.USWalkStop = () => PhysicsProfilers.USWalk.Stop();

                 sim.WalkSlideStart = () => PhysicsProfilers.WalkSlide.Start();
                 sim.WalkSlideStop = () => PhysicsProfilers.WalkSlide.Stop();

                 sim.USFlyStart = () => PhysicsProfilers.USFly.Start();
                 sim.USFlyStop = () => PhysicsProfilers.USFly.Stop();

                 sim.StaticBndUpdStart = () => PhysicsProfilers.StaticBndUpd.Start();
                 sim.StaticBndUpdStop = () => PhysicsProfilers.StaticBndUpd.Stop();

                 sim.UnitBndUpdStart = () => PhysicsProfilers.UnitBndUpd.Start();
                 sim.UnitBndUpdStop = () => PhysicsProfilers.UnitBndUpd.Stop();

                 sim.ProjStepStart = () => PhysicsProfilers.ProjStep.Start();
                 sim.ProjStepStop = () => PhysicsProfilers.ProjStep.Stop();

                 sim.UnitColDetStart = () => PhysicsProfilers.UnitColDet.Start();
                 sim.UnitColDetStop = () => PhysicsProfilers.UnitColDet.Stop();

                 sim.UnitColResStart = () => PhysicsProfilers.UnitColRes.Start();
                 sim.UnitColResStop = () => PhysicsProfilers.UnitColRes.Stop();

                 sim.UnitHeightAdjStart = () => PhysicsProfilers.UnitHeightAdj.Start();
                 sim.UnitHeightAdjStop = () => PhysicsProfilers.UnitHeightAdj.Stop();

                 sim.InterpolationStart = () => PhysicsProfilers.Interpolation.Start();
                 sim.InterpolationStop = () => PhysicsProfilers.Interpolation.Stop();
            #endif
                 sim.SetHeightMap(map.Ground.HeightmapFloats, new Vector2(map.Ground.Size.Width, map.Ground.Size.Height), Common.Math.ToVector2(map.Ground.Position));
                 sim.Settings = Program.Settings.MotionSettings;
                 if (Program.Settings.MotionSettings.UseMultiThreadedPhysics)
                     MotionSimulation = new Common.Motion.ThreadSimulationProxy(sim);
                 else
                     MotionSimulation = sim;
             }

            Pickups = new Common.Quadtree<Client.Game.Map.Pickup>(10);
        }
Ejemplo n.º 3
0
        public View()
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);

            Simulation = new Common.Motion.Simulation();

            //tempNPC = new Common.Motion.NPC
            //{
            //    Position = new Vector3(20, 20, 0),
            //    Orientation = (float)Math.PI/2f,
            //    RunVelocity = new Vector2(100, 100),
            //    SteeringEnabled = true,
            //    RunSpeed = 50f,
            //    LocalBounding = new Common.Bounding.Cylinder
            //    {
            //        Radius = 10,
            //        Position = new Vector3(0, 0, 0.001f)
            //    }
            //};
            //Simulation.Insert(tempNPC);
            var tempUnit = new Common.Motion.Unit
            {
                Position      = new Vector3(20, 20, 0),
                RunVelocity   = new Vector2(20, 20),
                LocalBounding = new Common.Bounding.Cylinder
                {
                    Height = 1f,
                    Radius = 10f
                }
            };

            var ground = new Common.Motion.Static
            {
                Position      = Vector3.Zero,
                LocalBounding = new BoundingBox(new Vector3(-1000, -1000, -1), new Vector3(1000, 1000, -0.00001f))
            };

            Simulation.Insert(ground);

            timer          = new Timer();
            timer.Tick    += new EventHandler(timer_Tick);
            timer.Interval = 1000 / 60;
            timer.Enabled  = true;
        }
Ejemplo n.º 4
0
        public View()
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);

            Simulation = new Common.Motion.Simulation();

            //tempNPC = new Common.Motion.NPC
            //{
            //    Position = new Vector3(20, 20, 0),
            //    Orientation = (float)Math.PI/2f,
            //    RunVelocity = new Vector2(100, 100),
            //    SteeringEnabled = true,
            //    RunSpeed = 50f,
            //    LocalBounding = new Common.Bounding.Cylinder
            //    {
            //        Radius = 10,
            //        Position = new Vector3(0, 0, 0.001f)
            //    }
            //};
            //Simulation.Insert(tempNPC);
            var tempUnit = new Common.Motion.Unit
            {
                Position = new Vector3(20, 20, 0),
                RunVelocity = new Vector2(20, 20),
                LocalBounding = new Common.Bounding.Cylinder
                {
                    Height = 1f,
                    Radius = 10f
                }
            };

            var ground = new Common.Motion.Static
            {
                Position = Vector3.Zero,
                LocalBounding = new BoundingBox(new Vector3(-1000, -1000, -1), new Vector3(1000, 1000, -0.00001f))
            };
            Simulation.Insert(ground);

            timer = new Timer();
            timer.Tick += new EventHandler(timer_Tick);
            timer.Interval = 1000 / 60;
            timer.Enabled = true;
        }
Ejemplo n.º 5
0
        public override void Init()
        {
            Content.ContentPath = "Data";

            scene      = new Scene();
            scene.View = this;

            scene.Camera = new LookatCartesianCamera()
            {
                Lookat      = new Vector3(size.Width / 2f, size.Height / 2f, 0),
                Position    = new Vector3(10, 10, 10),
                FOV         = 0.5f,
                ZFar        = 100,
                AspectRatio = AspectRatio
            };

            InputHandler = new WalkaroundCameraInputHandler
            {
                Camera = (LookatCartesianCamera)scene.Camera
            };

            renderer = new Graphics.Renderer.Renderer(Device9)
            {
                Scene = scene, StateManager = new Graphics.GraphicsDevice.Device9StateManager(Device9), Settings = new Graphics.Renderer.Settings {
                    WaterEnable = false
                }
            };
            renderer.Initialize(this);

            sceneRendererConnector = new SortedTestSceneRendererConnector
            {
                Renderer = renderer,
                Scene    = scene
            };
            sceneRendererConnector.Initialize();

            motionSimulation = new Common.Motion.Simulation();

            scene.EntityAdded += new Action <Entity>(scene_EntityAdded);
            CreateGround();
            scene.EntityAdded -= new Action <Entity>(scene_EntityAdded);
        }
Ejemplo n.º 6
0
        public override void Init()
        {
            Content.ContentPath = "Data";

            scene      = new Scene();
            scene.View = this;

            scene.Camera = new LookatCartesianCamera()
            {
                Lookat      = new Vector3(0, 0, 0),
                Position    = new Vector3(0, 0, 10),
                FOV         = 0.5f,
                ZFar        = 100,
                AspectRatio = AspectRatio
            };

            InputHandler = new WalkaroundCameraInputHandler
            {
                Camera       = (LookatCartesianCamera)scene.Camera,
                InputHandler = new InteractiveSceneManager {
                    Scene = scene
                },
            };

            renderer = new Graphics.Renderer.Renderer(Device9)
            {
                Scene = scene, StateManager = new Graphics.GraphicsDevice.Device9StateManager(Device9)
            };
            renderer.Initialize(this);

            motionSimulation = new Common.Motion.Simulation();

            scene.EntityRemoved += new Action <Entity>(scene_EntityRemoved);
            scene.EntityAdded   += new Action <Entity>(scene_EntityAdded);

            scene.Add(CreateBlock(-Vector3.UnitZ, new Vector3(size.Width, size.Height, 1), "grass1.png"));
            InitiateUnits();
        }
Ejemplo n.º 7
0
        public override void Enter()
        {
            models = new Models(Program.Instance.content, Program.Instance.Device);

            var interfaceManager = Program.Instance.InterfaceManager;

            interfaceManager.Add(new WorldSceneControl(interfaceManager, Program.Instance.content)
            {
                Scene = GameScene = new GameScene(Program.Instance),
                Size = ((Control)interfaceManager.Root).Size
            });
            GameScene.Camera = new LookatCamera(Program.Instance);

            HUD = new Client.Interface.HUD(interfaceManager)
            {
                Position = new Vector3(0, 0, 10)
            };
            interfaceManager.Add(HUD);

            Console.WriteLine("Client inited");

            Program.Instance.KeyDown += new System.Windows.Forms.KeyEventHandler(OnKeyDown);
            Program.Instance.KeyUp += new System.Windows.Forms.KeyEventHandler(OnKeyUp);

            Server.Log.Output += new Action<string>((s) => Console.WriteLine(s));

            var m = Program.Instance.Map;

            worldwidth = m.Width;
            worldheight = m.Height;

            motionSimulation = new Common.Motion.Simulation(0, 0, m.Width, m.Height,
                (x, y) => { return Common.Math.GetHeight(m.Heightmap, m.Width, m.Height, new SlimDX.Vector3(x, y, 0)); });

            foreach (Common.Entities.Prop prop in m.PropEntities)
            {
                GameScene.Add(new WorldEntity()
                {
                    Model = models.GetModel(m.PropClasses[prop.Class].Model),
                    Translation = prop.Position,
                    Rotation = Quaternion.RotationAxis(Vector3.UnitZ, prop.Rotation),
                    Scale = new Vector3(prop.Scale, prop.Scale, prop.Scale),
                    Name = prop.Name,
                });
                motionSimulation.CreateStatic(prop.Position, prop.Rotation, prop.Scale, m.PropClasses[prop.Class].CollisionRadius);
            }

            SlimDX.Direct3D9.Mesh ground_mesh = Ground.CreateMesh(Program.Instance.Device, m);
            ground_mesh.ComputeNormals();
            GameScene.View.content.Register("groundmesh", ground_mesh);

            terrainTexture = Program.Instance.content.Get<Texture>("ground.jpg");
            //terrainTexture = Program.Instance.content.Get<Texture>("robber1.png");

            GameScene.Add(new WorldEntity()
            {
                Model = new Model()
                {
                    XMesh = ground_mesh,
                    Texture = terrainTexture,
                    IsBillboard = false,
                    Effect = Program.Instance.content.Get<SlimDX.Direct3D9.Effect>("ground.fx")
                }
            });

            GameState.InitTextures();
        }
        public override void Init()
        {
            if (DesignMode)
            {
                return;
            }

            Content.ContentPath = "Data";

            scene      = new Scene();
            scene.View = this;

            scene.Camera = new LookatCartesianCamera()
            {
                Lookat      = Vector3.Zero,
                Position    = new Vector3(-15, 15, 15),
                FOV         = 0.5f,
                ZFar        = 400,
                AspectRatio = AspectRatio
            };

            renderer = new Graphics.Renderer.Renderer(Device9)
            {
                Scene        = scene,
                Settings     = new Graphics.Renderer.Settings(),
                StateManager = new Graphics.GraphicsDevice.Device9StateManager(Device9)
            };
            renderer.Initialize(this);
            sceneQuadtree          = new Common.Quadtree <Entity>(10);
            sbau                   = new SceneBVHAutoSyncer(scene, sceneQuadtree);
            sceneRendererConnector = new SortedTestSceneRendererConnector
            {
                Renderer = renderer,
                Scene    = scene
            };
            sceneRendererConnector.Initialize();

            navMesh = new Common.Pathing.NavMesh();

            worldViewProbe = new Graphics.WorldViewProbe(this, scene.Camera);
            editor         = new Graphics.Editors.BoundingRegionEditor(this, worldViewProbe);
            editor.Region  = navMesh.BoundingRegion;

            editorRenderer = new Graphics.Editors.BoundingRegionEditor.Renderer9(editor)
            {
                StateManager = new Graphics.GraphicsDevice.Device9StateManager(Device9),
                Camera       = scene.Camera
            };
            InputHandler = editor;
            inputHandlers.Add(editor);
            inputHandlers.Add(new WalkaroundCameraInputHandler
            {
                Camera       = (LookatCartesianCamera)scene.Camera,
                InputHandler = new InteractiveSceneManager {
                    Scene = scene
                },
                //FilteredMessages = new MessageType[] { }
            });

            var sim = new Common.Motion.Simulation(navMesh);

            ((Common.Motion.Simulation)sim).SetHeightMap(new float[][] { new float[] { 0.5f } }, new Vector2(400, 400), new Vector2(-200, -200));
            motionSimulation = sim;
            //motionSimulation = new Common.Motion.ThreadSimulationProxy(sim);

            var ground = CreateBlock(new Vector3(-200, -200, -0.5f), new Vector3(400, 400, 1), "Models/GroundTextures/Grass1.png");

            scene.Add(ground);
            motionSimulation.Insert(ground.MotionObject);

            npc = CreateNPC(new Vector2(-2, -2));
            scene.Add(npc);
            motionSimulation.Insert(npc.MotionObject);
            ((Common.IMotion.IUnit)npc.MotionObject).VelocityImpulse(new Vector3(0, 0, 0.1f));
            ((Common.IMotion.INPC)npc.MotionObject).Weight = 10000000f;
            AddCreatedGridEvent(npc);
            //((Common.Motion.NPC)npc.MotionObject).DebugSolidAsARock = true;


            int     amount = 25;
            Vector2 offset = new Vector2(-4, -4);

            for (int i = 0; i < amount; i++)
            {
                int x = i / (int)System.Math.Sqrt(amount);
                int y = i % (int)System.Math.Sqrt(amount);
                var n = CreateNPC(new Vector2(x, y));
                pursuers.Add(n);
                scene.Add(n);
                motionSimulation.Insert(n.MotionObject);
                ((Common.IMotion.IUnit)n.MotionObject).VelocityImpulse(new Vector3(0, 0, 0.1f));
                AddCreatedGridEvent(n);
            }
        }
Ejemplo n.º 9
0
 public void Load(String filename)
 {
     Clear();
     FileStream fs = new FileStream(filename, FileMode.Open);
     var f = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
     Simulation = (Common.Motion.Simulation)f.Deserialize(fs);
     foreach (var o in Simulation.All)
     {
         if (o is Common.Motion.NPC)
             NPCs.Add((Common.Motion.NPC)o);
         else if (o is Common.Motion.Unit)
             Units.Add((Common.Motion.Unit)o);
     }
     Invalidate();
 }
Ejemplo n.º 10
0
        public override void Init()
        {
            Content.ContentPath = "Data";

            scene      = new Scene();
            scene.View = this;

            scene.Camera = new LookatCartesianCamera()
            {
                Lookat      = new Vector3(size.Width / 2f, size.Height / 2f, 0),
                Position    = new Vector3(10, 10, 10),
                FOV         = 0.5f,
                ZFar        = 100,
                AspectRatio = AspectRatio
            };

            viewport = new Graphics.GraphicsDevice.Viewport(Device9.Viewport);

            InputHandler = new WalkaroundCameraInputHandler
            {
                Camera       = (LookatCartesianCamera)scene.Camera,
                InputHandler = new InteractiveSceneManager {
                    Scene = scene
                },
            };

            renderer = new Graphics.Renderer.Renderer(Device9)
            {
                Scene = scene, StateManager = new Graphics.GraphicsDevice.Device9StateManager(Device9), Settings = new Graphics.Renderer.Settings {
                    WaterEnable = false
                }
            };
            //renderer = new Graphics.DummyRenderer.Renderer { Scene = scene, StateManager = new Graphics.GraphicsDevice.Device9StateManager(Device9), Settings = new Graphics.Renderer.Settings { WaterEnable = false } };
            renderer.Initialize(this);

            sceneRendererConnector = new SortedTestSceneRendererConnector
            {
                Renderer = renderer,
                Scene    = scene
            };
            sceneRendererConnector.Initialize();

            motionSimulation = new Common.Motion.Simulation();

            scene.EntityAdded   += new Action <Entity>(scene_EntityAdded);
            scene.EntityRemoved += new Action <Entity>(scene_EntityRemoved);

            var sim = (Common.Motion.Simulation)motionSimulation;

            npcs = new List <Common.IMotion.INPC>();
            Vector2 startingPosition = new Vector2(size.Width / 2f, size.Height / 2f);

            CreateGround(true);
            scene.Add(controlledUnit = CreateUnit(startingPosition));
            scene.Add(CreateBlock(Common.Math.ToVector3(startingPosition + new Vector2(2, -2)), new Vector3(1, 1, 1.5f)));
            scene.Add(CreateBlock(Common.Math.ToVector3(startingPosition + new Vector2(-4, 2)), new Vector3(1, 1, 1.5f)));
            scene.Add(CreateBlock(Common.Math.ToVector3(startingPosition + new Vector2(4, -2)), new Vector3(1, 1, 1.5f)));
            scene.Add(CreateBlock(Common.Math.ToVector3(startingPosition + new Vector2(7, -1)), new Vector3(1, 1, 1.5f)));
            //scene.Add(CreateNPC(startingPosition + new Vector2(3, 3)));
            scene.Add(CreateNPC(startingPosition + new Vector2(3, -1)));
            scene.Add(CreateNPC(startingPosition + new Vector2(-5, 3)));
            scene.Add(CreateNPC(startingPosition + new Vector2(-2, 1)));
            Vector2 unitGroupStartingPosition = startingPosition + new Vector2(3, 3);

            for (int y = 0; y < 5; y++)
            {
                for (int x = 0; x < 5; x++)
                {
                    scene.Add(CreateNPC(unitGroupStartingPosition + new Vector2(x, y)));
                }
            }

            BulletCreation = (() =>
            {
                scene.Add(CreateBullet(controlledUnit.Translation + Vector3.UnitZ,
                                       bulletSpeed,
                                       controlledUnit.MotionObject.Rotation.Angle,
                                       bulletAcceleration));
            });

            foreach (var npc in npcs)
            {
                npc.Pursue(controlledUnit.MotionObject, 1f);
            }
        }
Ejemplo n.º 11
0
        public override void Init()
        {
            Content.ContentPath = "Data";

            scene      = new Scene();
            scene.View = this;

            scene.Camera = new LookatCartesianCamera()
            {
                Lookat      = new Vector3(size.Width / 2f, size.Height / 2f, 0),
                Position    = new Vector3(10, 10, 10),
                FOV         = 0.5f,
                ZFar        = 100,
                AspectRatio = AspectRatio
            };

            sceneQuadtree = new Common.Quadtree <Entity>(10);
            sbau          = new SceneBVHAutoSyncer(scene, sceneQuadtree);

            InputHandler = new WalkaroundCameraInputHandler
            {
                Camera       = (LookatCartesianCamera)scene.Camera,
                InputHandler = new InteractiveSceneManager {
                    Scene = scene
                },
            };

            renderer = new Graphics.Renderer.Renderer(Device9)
            {
                Scene = scene, StateManager = new Graphics.GraphicsDevice.Device9StateManager(Device9), Settings = new Graphics.Renderer.Settings {
                    WaterEnable = false, FogDistance = float.MaxValue, ShadowQuality = Graphics.Renderer.Settings.ShadowQualities.Lowest
                }
            };
            renderer.Initialize(this);

            sceneRendererConnector = new SortedTestSceneRendererConnector
            {
                Renderer = renderer,
                Scene    = scene
            };
            sceneRendererConnector.Initialize();

            motionSimulation = new Common.Motion.Simulation();
            //motionSimulation = new Common.Motion.ThreadSimulationProxy(new Common.Motion.Simulation());
            //System.Windows.Forms.Application.ApplicationExit += ((sender, o) => { ((Common.Motion.ThreadSimulationProxy)motionSimulation).Shutdown(); });

            scene.EntityAdded   += new Action <Entity>(scene_EntityAdded);
            scene.EntityRemoved += new Action <Entity>(scene_EntityRemoved);

            heightMap = CreateGround();

            //((Common.Motion.Simulation)((Common.Motion.ThreadSimulationProxy)motionSimulation).InnerSimulation).SetHeightMap(heightMap, new Vector2(size.Width, size.Height), Vector2.Zero);
            //scene.Add(CreateBlock(-Vector3.UnitZ, new Vector3(size.Width, size.Height, 1), "grass1.png"));

            Random r = new Random();

            for (int i = 0; i < 0; i++)
            {
                InsertUnit(r);
            }
            //var unit = CreateUnit(new Vector3(size.Width/2f, size.Height/2f, -5f));
            //scene.Add(unit);
            //units.Add(unit);
            foreach (var u in units)
            {
                ((Common.IMotion.IUnit)u.MotionObject).VelocityImpulse(new Vector3(0, 0, 0.00001f));
            }
        }
Ejemplo n.º 12
0
        public Manager(Map.Map map)
        {
            InRange = new Common.NearestNeighbours <Map.Destructible>(Vector2.Zero, Common.Math.ToVector2(map.Ground.Size), Program.Settings.AIInRangeGridSize);

            if (Program.Settings.MotionSettings.UseDummyMotion)
            {
                MotionSimulation = new Common.Motion.DummySimulation();
            }
            else
            {
                var sim = new Common.Motion.Simulation(map.NavMesh);
#if BETA_RELEASE
                sim.StepStart = () => PhysicsProfilers.Step.Start();
                sim.StepStop  = () => PhysicsProfilers.Step.Stop();

                sim.UnitStepStart = () => PhysicsProfilers.UnitStep.Start();
                sim.UnitStepStop  = () => PhysicsProfilers.UnitStep.Stop();

                sim.USFindStateStart = () => PhysicsProfilers.USFindState.Start();
                sim.USFindStateStop  = () => PhysicsProfilers.USFindState.Stop();

                sim.USWalkStart = () => PhysicsProfilers.USWalk.Start();
                sim.USWalkStop  = () => PhysicsProfilers.USWalk.Stop();

                sim.WalkSlideStart = () => PhysicsProfilers.WalkSlide.Start();
                sim.WalkSlideStop  = () => PhysicsProfilers.WalkSlide.Stop();

                sim.USFlyStart = () => PhysicsProfilers.USFly.Start();
                sim.USFlyStop  = () => PhysicsProfilers.USFly.Stop();

                sim.StaticBndUpdStart = () => PhysicsProfilers.StaticBndUpd.Start();
                sim.StaticBndUpdStop  = () => PhysicsProfilers.StaticBndUpd.Stop();

                sim.UnitBndUpdStart = () => PhysicsProfilers.UnitBndUpd.Start();
                sim.UnitBndUpdStop  = () => PhysicsProfilers.UnitBndUpd.Stop();

                sim.ProjStepStart = () => PhysicsProfilers.ProjStep.Start();
                sim.ProjStepStop  = () => PhysicsProfilers.ProjStep.Stop();

                sim.UnitColDetStart = () => PhysicsProfilers.UnitColDet.Start();
                sim.UnitColDetStop  = () => PhysicsProfilers.UnitColDet.Stop();

                sim.UnitColResStart = () => PhysicsProfilers.UnitColRes.Start();
                sim.UnitColResStop  = () => PhysicsProfilers.UnitColRes.Stop();

                sim.UnitHeightAdjStart = () => PhysicsProfilers.UnitHeightAdj.Start();
                sim.UnitHeightAdjStop  = () => PhysicsProfilers.UnitHeightAdj.Stop();

                sim.InterpolationStart = () => PhysicsProfilers.Interpolation.Start();
                sim.InterpolationStop  = () => PhysicsProfilers.Interpolation.Stop();
#endif
                sim.SetHeightMap(map.Ground.HeightmapFloats, new Vector2(map.Ground.Size.Width, map.Ground.Size.Height), Common.Math.ToVector2(map.Ground.Position));
                sim.Settings = Program.Settings.MotionSettings;
                if (Program.Settings.MotionSettings.UseMultiThreadedPhysics)
                {
                    MotionSimulation = new Common.Motion.ThreadSimulationProxy(sim);
                }
                else
                {
                    MotionSimulation = sim;
                }
            }

            Pickups = new Common.Quadtree <Client.Game.Map.Pickup>(10);
        }