示例#1
0
        public override void Draw(PrimitiveBatch primitiveBatch)
        {
            double angleStep = 2f / this.Radius;
            float x = 0;
            float y = 0;

            for (double angle = 0; angle < Math.PI * 2; angle += angleStep)
            {
                x = (float)Math.Round(this.Center.X + this.Radius * Math.Cos(angle));
                y = (float)Math.Round(this.Center.Y + this.Radius * Math.Sin(angle));

                primitiveBatch.AddVertex(new Vector2(x, y), Color.Yellow);

                x = (float)Math.Round(this.Center.X + this.Radius * Math.Cos(angle + angleStep));
                y = (float)Math.Round(this.Center.Y + this.Radius * Math.Sin(angle + angleStep));

                primitiveBatch.AddVertex(new Vector2(x, y), Color.Yellow);
            }
        }
示例#2
0
        public void Draw(PrimitiveBatch primitiveBatch)
        {
            primitiveBatch.AddVertex(pointA, Color.Green);
            primitiveBatch.AddVertex(pointB, Color.Green);
            primitiveBatch.AddVertex(pointB, Color.Green);
            primitiveBatch.AddVertex(pointC, Color.Green);
            primitiveBatch.AddVertex(pointC, Color.Green);
            primitiveBatch.AddVertex(pointD, Color.Green);
            primitiveBatch.AddVertex(pointD, Color.Green);
            primitiveBatch.AddVertex(pointA, Color.Green);

            if (children != null)
            {
                for (int i = 0; i < 4; i++)
                {
                    this.children[i].Draw(primitiveBatch);
                }
            }
        }
示例#3
0
        public override void Draw(PrimitiveBatch primitiveBatch)
        {
            for (int pointA = 0, pointB = 0; pointA < this.Vertices.Count; pointA++)
            {
                if (pointA + 1 == this.Vertices.Count)
                {
                    pointB = 0;
                }
                else
                {
                    pointB = pointA + 1;
                }

                primitiveBatch.AddVertex(this.Vertices[pointA], Color.Red);
                primitiveBatch.AddVertex(this.Vertices[pointB], Color.Red);
            }
        }
示例#4
0
 public abstract void Draw(PrimitiveBatch primitiveBatch);
示例#5
0
文件: Box.cs 项目: Towanime/FeInwork
        public override void Draw(PrimitiveBatch primitiveBatch)
        {
            for (int pointA = 0, pointB = 0; pointA < 4; pointA++)
            {
                if (pointA + 1 == this.points.Length)
                {
                    pointB = 0;
                }
                else
                {
                    pointB = pointA + 1;
                }

                primitiveBatch.AddVertex(this.points[pointA], Color.Blue);
                primitiveBatch.AddVertex(this.points[pointB], Color.Blue);
            }
        }