@@ -3,7 +3,9 @@ namespace Silk.NET.Maths
33 using System . Diagnostics . CodeAnalysis ;
44 using System . Numerics ;
55
6- partial struct Matrix3x3F < T > : IEquatable < Matrix3x3F < T > > where T : IFloatingPointIeee754 < T >
6+ partial struct Matrix3x3F < T > :
7+ IEquatable < Matrix3x3F < T > >
8+ where T : IFloatingPointIeee754 < T >
79 {
810 /// <summary>The multiplicative identity matrix of size 3x3.</summary>
911 public static readonly Matrix3x3F < T > Identity = new (
@@ -45,7 +47,7 @@ public ref Vector3F<T> this[int row]
4547 }
4648
4749 [ UnscopedRef ]
48- public ref Vector3F < T > this [ int row , int column ] => ref this [ row ] [ column ] ;
50+ public ref T this [ int row , int column ] => ref this [ row ] [ column ] ;
4951
5052 /// <summary>Gets the element in the 1st row and 1st column of the matrix.</summary>
5153 [ UnscopedRef ]
@@ -96,7 +98,7 @@ public ref Vector3F<T> this[int row]
9698 public Matrix3x3F < T > Transpose ( ) =>
9799 new ( new ( M11 , M21 , M31 ) ,
98100 new ( M12 , M22 , M32 ) ,
99- new ( M13 , M23 , M33 ) )
101+ new ( M13 , M23 , M33 ) ) ;
100102
101103 /// <summary>Returns a boolean indicating whether the given two matrices are equal.</summary>
102104 /// <param name="left">The first matrix to compare.</param>
@@ -165,4 +167,13 @@ public Matrix3x3F<T> Transpose() =>
165167 left . M21 * right . Row1 + left . M22 * right . Row2 + left . M23 * right . Row3 ,
166168 left . M31 * right . Row1 + left . M32 * right . Row2 + left . M33 * right . Row3 ) ;
167169 }
170+
171+ static partial class Matrix3x3F
172+ {
173+ public static Matrix3x3F < T > Lerp < T > ( Matrix3x3F < T > value1 , Matrix3x3F < T > value2 , T amount )
174+ where T : IFloatingPointIeee754 < T > =>
175+ new ( new ( T . Lerp ( value1 . M11 , value2 . M11 , amount ) , T . Lerp ( value1 . M12 , value2 . M12 , amount ) , T . Lerp ( value1 . M13 , value2 . M13 , amount ) ) ,
176+ new ( T . Lerp ( value1 . M21 , value2 . M21 , amount ) , T . Lerp ( value1 . M22 , value2 . M22 , amount ) , T . Lerp ( value1 . M23 , value2 . M23 , amount ) ) ,
177+ new ( T . Lerp ( value1 . M31 , value2 . M31 , amount ) , T . Lerp ( value1 . M32 , value2 . M32 , amount ) , T . Lerp ( value1 . M33 , value2 . M33 , amount ) ) ) ;
178+ }
168179}
0 commit comments