Пример #1
0
        /// <summary>
        /// Draws the node visually. Only used for debug purpose.
        /// </summary>
        /// <param name="spriteBatch"></param>
        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(Common.White1px, AABB.ToRect(), BGColor);

            const int LINE_WIDTH = 3;

            spriteBatch.Draw(Common.White1px, new Rectangle((int)AABB.Left, (int)AABB.Top, (int)AABB.Width, LINE_WIDTH), Color.Red);
            spriteBatch.Draw(Common.White1px, new Rectangle((int)AABB.Right - LINE_WIDTH, (int)AABB.Top, LINE_WIDTH, (int)AABB.Height), Color.Red);
            spriteBatch.Draw(Common.White1px, new Rectangle((int)AABB.Left, (int)AABB.Bottom - LINE_WIDTH, (int)AABB.Width, LINE_WIDTH), Color.Red);
            spriteBatch.Draw(Common.White1px, new Rectangle((int)AABB.Left, (int)AABB.Top, LINE_WIDTH, (int)AABB.Height), Color.Red);

            if (!IsLeaf)
            {
                TopLeft.Draw(spriteBatch);
                TopRight.Draw(spriteBatch);
                BottomRight.Draw(spriteBatch);
                BottomLeft.Draw(spriteBatch);
            }
        }
Пример #2
0
 /// <summary>
 /// Debug draw
 /// </summary>
 /// <param name="spriteBatch"></param>
 public void DrawNodes(SpriteBatch spriteBatch)
 {
     RootNode.Draw(spriteBatch);
 }