Пример #1
0
        /// <summary>
        /// Returns the reflection of a vector over a given normal.
        /// </summary>
        /// <param name="vectorToReflect">Vector to reflect over the normal.</param>
        /// <param name="normal">Normal to reflect the vector over.</param>
        /// <returns>Reflected vector over the the normal.</returns>
        public static Vector2 Reflect(Vector2 vectorToReflect, Vector2 normal)
        {
            var reflection = MonoGameVector2.Reflect(vectorToReflect.MonoGameVector, normal.MonoGameVector);

            return(new Vector2(reflection));
        }
Пример #2
0
 public static Vector2 Reflect(Vector2 v, Vector2 n)
 {
     return(Vector.Reflect(v, n));
 }