/// <summary>Transform a Normal by the given Matrix</summary> /// <remarks> /// This calculates the inverse of the given matrix, use TransformNormalInverse if you /// already have the inverse to avoid this extra calculation /// </remarks> /// <param name="norm">The normal to transform</param> /// <param name="mat">The desired transformation</param> /// <param name="result">The transformed normal</param> public static void TransformNormal(this Vector3Float norm, ref Matrix4X4 mat, out Vector3Float result) { Matrix4X4 Inverse = Matrix4X4.Invert(mat); norm.TransformNormalInverse(ref Inverse, out result); }
/// <summary>Transform a Normal by the given Matrix</summary> /// <remarks> /// This calculates the inverse of the given matrix, use TransformNormalInverse if you /// already have the inverse to avoid this extra calculation /// </remarks> /// <param name="norm">The normal to transform</param> /// <param name="mat">The desired transformation</param> /// <returns>The transformed normal</returns> public static Vector3Float TransformNormal(this Vector3Float norm, Matrix4X4 mat) { mat.Invert(); return(norm.TransformNormalInverse(mat)); }