Esempio n. 1
0
        /// <summary>
        /// Default drawing method that takes into account rotation, translation, and scale.
        /// </summary>
        /// <param name="gameTime"></param>
        public void Draw(ref SpriteBatch spriteBatch, GameTime gameTime)
        {
            spriteBatch.Draw(texture,
                             position,
                             null,
                             color,
                             rotation,
                             center,
                             scale,
                             SpriteEffects.None,
                             0f);

            //Draw the bounding spheres
            if (!useBoundingBox && drawBoundingSpheres)
            {
                foreach (BoundingSphere b in boundingSphereList)
                {
                    PrimitiveLine brush = new PrimitiveLine(game.GraphicsDevice);
                    //Create a circle (from 100 lines) with the radius
                    brush.CreateCircle(b.Radius, 100);
                    brush.Position = new Vector2(b.Center.X, b.Center.Y);
                    brush.Render(ref spriteBatch);
                }

                PrimitiveLine br = new PrimitiveLine(game.GraphicsDevice);
                //Create a circle (from 100 lines) with the radius
                br.CreateCircle(generalBoundingSphere.Radius, 100);
                br.Position = new Vector2(generalBoundingSphere.Center.X, generalBoundingSphere.Center.Y);
                br.Render(ref spriteBatch);
            }
        }
        /// <summary>
        /// Draws the global fixed point for debug purposes.
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="gameTime"></param>
        public void Draw(ref SpriteBatch spriteBatch, GameTime gameTime)
        {
            if (drawFixedPoint)
            {
                //Draw the global fixed point
                PrimitiveLine brush = new PrimitiveLine(game.GraphicsDevice);
                //Create a circle (from 100 lines) with the radius
                int _radius = 5;
                brush.CreateCircle(_radius, 100);
                //Minus off the radius to get the circle centered on the fixed point
                brush.Position.X = globalFixedPoint.X;
                brush.Position.Y = globalFixedPoint.Y;
                brush.Render(ref spriteBatch);
            }

            //Print some gesture stats
            if (gestureComponent.showStats)
            {
                gestureComponent.Draw(ref spriteBatch, gameTime);
            }
        }
        /// <summary>
        /// Draws the global fixed point for debug purposes.
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="gameTime"></param>
        public void Draw(ref SpriteBatch spriteBatch, GameTime gameTime)
        {
            if (drawFixedPoint)
            {
                //Draw the global fixed point
                PrimitiveLine brush = new PrimitiveLine(game.GraphicsDevice);
                //Create a circle (from 100 lines) with the radius
                int _radius = 5;
                brush.CreateCircle(_radius, 100);
                //Minus off the radius to get the circle centered on the fixed point
                brush.Position.X = globalFixedPoint.X;
                brush.Position.Y = globalFixedPoint.Y;
                brush.Render(ref spriteBatch);
            }

            //Print some gesture stats
            if (gestureComponent.showStats)
                gestureComponent.Draw(ref spriteBatch, gameTime);
        }
Esempio n. 4
0
        /// <summary>
        /// Default drawing method that takes into account rotation, translation, and scale.
        /// </summary>
        /// <param name="gameTime"></param>
        public void Draw(ref SpriteBatch spriteBatch, GameTime gameTime)
        {
            spriteBatch.Draw(texture,
                    position,
                    null,
                    color,
                    rotation,
                    center,
                    scale,
                    SpriteEffects.None,
                    0f);

            //Draw the bounding spheres
            if(!useBoundingBox && drawBoundingSpheres)
            {
                foreach (BoundingSphere b in boundingSphereList)
                {
                    PrimitiveLine brush = new PrimitiveLine(game.GraphicsDevice);
                    //Create a circle (from 100 lines) with the radius
                    brush.CreateCircle(b.Radius, 100);
                    brush.Position = new Vector2(b.Center.X, b.Center.Y);
                    brush.Render(ref spriteBatch);
                }

                PrimitiveLine br = new PrimitiveLine(game.GraphicsDevice);
                //Create a circle (from 100 lines) with the radius
                br.CreateCircle(generalBoundingSphere.Radius, 100);
                br.Position = new Vector2(generalBoundingSphere.Center.X, generalBoundingSphere.Center.Y);
                br.Render(ref spriteBatch);
            }
        }