示例#1
0
 /// <summary>
 /// Converts a <see cref="Fusee.Math.Core.float4x4"/> to an Array of double values. The row major order storage of the
 /// original matrix is converted to column major order (the matrix is transposed before exporting it to an Array).
 /// This way the returned array can be used in environments taking column major order
 /// matrices (like e.g. DirectX). Use ToArray[]RowOrder for converting the original matrix to environments taking
 /// row major order matrices (e.g. OpenGL).
 /// </summary>
 /// <param name="value">The matrix value to convert.</param>
 /// <returns>A double array containing 16 values in column major order [m11, m21, m31, ...].</returns>
 public static double[] float4x4ToArrayDoubleColOrder(Fusee.Math.Core.float4x4 value)
 {
     return(new double[] { value.M11, value.M21, value.M31, value.M41,
                           value.M12, value.M22, value.M32, value.M42,
                           value.M13, value.M23, value.M33, value.M43,
                           value.M14, value.M24, value.M34, value.M44 });
 }
示例#2
0
 /// <summary>
 /// Converts a <see cref="Fusee.Math.Core.float4x4"/> to an Array of floats. The row major order storage of the
 /// original matrix is kept. This way the returned array can be used in environments taking row major order matrices
 /// (e.g. OpenGL). Use ToArray[]ColOrder for converting the original matrix to environments taking column major order
 /// matrices (like e.g. DirectX).
 /// </summary>
 /// <param name="value">The matrix value to convert.</param>
 /// <returns>A float array containing 16 values in row major order [m11, m12, m13, ...].</returns>
 public static float[] float4x4ToArrayFloatRowOrder(Fusee.Math.Core.float4x4 value)
 {
     return(new float[] { value.M11, value.M12, value.M13, value.M14,
                          value.M21, value.M22, value.M23, value.M24,
                          value.M31, value.M32, value.M33, value.M34,
                          value.M41, value.M42, value.M43, value.M44 });
 }