Microsoft.Xna.Framework.Vector2.Reflect C# (CSharp) Method

Reflect() public static method

Determines the reflect vector of the given vector and normal.
public static Reflect ( Vector2 &vector, Vector2 &normal, Vector2 &result ) : void
vector Vector2 Source vector.
normal Vector2 Normal of vector.
result Vector2 [OutAttribute] The created reflect vector.
return void
        public static void Reflect(ref Vector2 vector, ref Vector2 normal, out Vector2 result)
        {
            float num = vector.X * normal.X + vector.Y * normal.Y;
            result.X = vector.X - 2f * num * normal.X;
            result.Y = vector.Y - 2f * num * normal.Y;
        }
        /// <summary>Returns a vector that contains the lowest value from each matching pair of components.</summary>

Same methods

Vector2::Reflect ( Vector2 vector, Vector2 normal ) : Vector2