public override void Initialize()
        {
            this.World = WorldPerformanceTestSetup.CreateWorld(this.WorldSideSize); //new World();
            //this.World.HibernationEnabled = true;

            // enable multithreading
            //this.World.ContactManager.VelocityConstraintsMultithreadThreshold = 256;
            //this.World.ContactManager.PositionConstraintsMultithreadThreshold = 256;
            //this.World.ContactManager.CollideMultithreadThreshold = 256;

            //this.World.Gravity = Vector2.Zero;

            //this.CreateBounds();


            // sets up debug drawing
            base.Initialize();

            // automatically enable additional performance info
            this.DebugView.AppendFlags(Diagnostics.DebugViewFlags.PerformanceGraph);
            this.DebugView.AppendFlags(Diagnostics.DebugViewFlags.DebugPanel);
            this.DebugView.AppendFlags(Diagnostics.DebugViewFlags.AABB);
            this.DebugView.Enabled = true;

            // set zoom to show a meaningful part of the world
            //this.GameInstance.ViewZoom = 0.09f;
        }
Exemple #2
0
        public override void Initialize()
        {
            const int WorldSideSize = 2000;

            this.World = WorldPerformanceTestSetup.CreateWorld(WorldSideSize); // 2km

            // add an interest area ever X meters
            const int AAradius = 100;
            const int AAmargin = 250;

            for (var x = -WorldSideSize / 2 + AAmargin; x < WorldSideSize / 2 - AAmargin / 2; x += AAmargin)
            {
                for (var y = -WorldSideSize / 2 + AAmargin; y < WorldSideSize / 2 - AAmargin / 2; y += AAmargin)
                {
                    // init and add
                    var activeArea = new IndependentActiveArea();
                    activeArea.SetPosition(new Vector2(x, y));
                    activeArea.SetRadius(AAradius);
                    this.World.HibernationManager.ActiveAreas.Add(activeArea);
                }
            }


            // sets up debug drawing
            base.Initialize();

            // automatically enable additional performance info
            this.DebugView.AppendFlags(Diagnostics.DebugViewFlags.PerformanceGraph);
            this.DebugView.AppendFlags(Diagnostics.DebugViewFlags.DebugPanel);
            this.DebugView.AppendFlags(Diagnostics.DebugViewFlags.AABB);
            this.DebugView.Enabled = true;

            // set zoom to show a meaningful part of the world
            //this.GameInstance.ViewZoom = 0.09f;
        }
        public override void Initialize()
        {
            this.World = WorldPerformanceTestSetup.CreateWorld(2000); // 2km

            // create gravity well

            // create atmosphere

            // create ocean


            // sets up debug drawing
            base.Initialize();

            // automatically enable additional performance info
            this.DebugView.AppendFlags(Diagnostics.DebugViewFlags.PerformanceGraph);
            this.DebugView.AppendFlags(Diagnostics.DebugViewFlags.DebugPanel);
            this.DebugView.AppendFlags(Diagnostics.DebugViewFlags.AABB);
            this.DebugView.Enabled = true;
        }