Replace() public méthode

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
Résultat void
Exemple #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
 }
Exemple #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
        }
Exemple #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
        }
Exemple #4
0
        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();
        }
Exemple #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
 }
        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

        }