Replace() 공개 메소드

Replaces a vector at the given index with the argument Vector2.
public Replace ( int index, Vector2 whatToReplaceWith ) : void
index int What index to replace.
whatToReplaceWith Vector2 The new vector that will be placed at the given index
리턴 void
예제 #1
0
 public static void UpdateLinePrimitive(LinePrimitive linePrimitive, IPositionedSizedObject ipso)
 {
     linePrimitive.Replace(0, Vector2.Zero);
     linePrimitive.Replace(1, new Vector2(ipso.Width, 0));
     linePrimitive.Replace(2, new Vector2(ipso.Width, ipso.Height));
     linePrimitive.Replace(3, new Vector2(0, ipso.Height));
     linePrimitive.Replace(4, Vector2.Zero); // close back on itself
 }
예제 #2
0
        public static void UpdateLinePrimitive(LinePrimitive linePrimitive, IRenderableIpso ipso)
        {
            Matrix matrix = Matrix.CreateRotationZ(-MathHelper.ToRadians(ipso.GetAbsoluteRotation()));

            linePrimitive.Replace(0, Vector2.Zero);
            linePrimitive.Replace(1, Vector2.Transform(new Vector2(ipso.Width, 0), matrix));
            linePrimitive.Replace(2, Vector2.Transform(new Vector2(ipso.Width, ipso.Height), matrix));
            linePrimitive.Replace(3, Vector2.Transform(new Vector2(0, ipso.Height), matrix));
            linePrimitive.Replace(4, Vector2.Zero); // close back on itself
        }
예제 #3
0
        public static void UpdateLinePrimitive(LinePrimitive linePrimitive, IPositionedSizedObject ipso)
        {
            Matrix matrix = Matrix.CreateRotationZ(-MathHelper.ToRadians(ipso.Rotation));



            linePrimitive.Replace(0, Vector2.Zero);
            linePrimitive.Replace(1, Vector2.Transform(new Vector2(ipso.Width, 0), matrix));
            linePrimitive.Replace(2, Vector2.Transform(new Vector2(ipso.Width, ipso.Height), matrix));
            linePrimitive.Replace(3, Vector2.Transform(new Vector2(0, ipso.Height), matrix));
            linePrimitive.Replace(4, Vector2.Zero); // close back on itself
        }
예제 #4
0
파일: Line.cs 프로젝트: vchelaru/Anfloga
        private void UpdatePoints()
        {
            while (mLinePrimitive.VectorCount < 2)
            {
                mLinePrimitive.Add(0, 0);
            }

            mLinePrimitive.Replace(1, this.RelativePoint);

            mLinePrimitive.Position.X = this.GetAbsoluteX();
            mLinePrimitive.Position.Y = this.GetAbsoluteY();
        }
예제 #5
0
 public static void UpdateLinePrimitive(LinePrimitive linePrimitive, IPositionedSizedObject ipso)
 {
     linePrimitive.Replace(0, Vector2.Zero);
     linePrimitive.Replace(1, new Vector2(ipso.Width, 0));
     linePrimitive.Replace(2, new Vector2(ipso.Width, ipso.Height));
     linePrimitive.Replace(3, new Vector2(0, ipso.Height));
     linePrimitive.Replace(4, Vector2.Zero); // close back on itself
 }
예제 #6
0
        public static void UpdateLinePrimitive(LinePrimitive linePrimitive, IPositionedSizedObject ipso)
        {
            Matrix matrix = Matrix.CreateRotationZ(-MathHelper.ToRadians(ipso.Rotation));

            

            linePrimitive.Replace(0, Vector2.Zero);
            linePrimitive.Replace(1, Vector2.Transform(new Vector2(ipso.Width, 0), matrix) );
            linePrimitive.Replace(2, Vector2.Transform(new Vector2(ipso.Width, ipso.Height), matrix) );
            linePrimitive.Replace(3, Vector2.Transform(new Vector2(0, ipso.Height), matrix) );
            linePrimitive.Replace(4, Vector2.Zero); // close back on itself

        }