Beispiel #1
0
        /// <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 Vector3 norm, ref Matrix4 mat, out Vector3 result)
        {
            Matrix4 Inverse = Matrix4Extensions.Invert(mat);

            Vector3.TransformNormalInverse(ref norm, ref Inverse, out result);
        }
Beispiel #2
0
 /// <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 Vector3 TransformNormal(Vector3 norm, Matrix4 mat)
 {
     Matrix4Extensions.Invert(ref mat, out mat);
     return(TransformNormalInverse(norm, mat));
 }