Ejemplo n.º 1
0
        public override void Update(GameSettings settings, GameTime gameTime)
        {
            base.Update(settings, gameTime);

            PolyShapesCallback callback = new PolyShapesCallback();

            callback.Circle.Radius   = 2.0f;
            callback.Circle.Position = new Vector2(0.0f, 2.1f);
            callback.Transform.SetIdentity();
            callback.DebugDraw = DebugView;

            AABB aabb;

            callback.Circle.ComputeAABB(out aabb, ref callback.Transform, 0);

            DebugView.BeginCustomDraw(ref GameInstance.Projection, ref GameInstance.View);
            World.QueryAABB(callback.ReportFixture, ref aabb);

            Color color = new Color(0.4f, 0.7f, 0.8f);

            DebugView.DrawCircle(callback.Circle.Position, callback.Circle.Radius, color);
            DebugView.EndCustomDraw();

            DebugView.DrawString(50, TextLine, "Press 1-5 to drop stuff");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Press a to (de)activate some bodies");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Press d to destroy a body");
            TextLine += 15;
        }
Ejemplo n.º 2
0
        public override void Update(GameSettings settings, GameTime gameTime)
        {
            base.Update(settings, gameTime);

            PolyShapesCallback callback = new PolyShapesCallback();
            callback.Circle.Radius = 2.0f;
            callback.Circle.Position = new Vector2(0.0f, 1.1f);
            callback.Transform.SetIdentity();
            callback.DebugDraw = DebugView;

            AABB aabb;
            callback.Circle.ComputeAABB(out aabb, ref callback.Transform, 0);

            DebugView.BeginCustomDraw(ref GameInstance.Projection, ref GameInstance.View);
            World.QueryAABB(callback.ReportFixture, ref aabb);

            Color color = new Color(0.4f, 0.7f, 0.8f);
            DebugView.DrawCircle(callback.Circle.Position, callback.Circle.Radius, color);
            DebugView.EndCustomDraw();

            DebugView.DrawString(50, TextLine, "Press 1-5 to drop stuff");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Press a to (de)activate some bodies");
            TextLine += 15;
            DebugView.DrawString(50, TextLine, "Press d to destroy a body");
            TextLine += 15;
        }