/// <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 Vector3d TransformNormal(Vector3d norm, Matrix4d mat) { mat.Invert(); return(TransformNormalInverse(norm, mat)); }
/// <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(ref Vector3d norm, ref Matrix4d mat, out Vector3d result) { Matrix4d Inverse = Matrix4d.Invert(mat); Vector3d.TransformNormalInverse(ref norm, ref Inverse, out result); }