daily update on 20241226 by nitload youmu

This commit is contained in:
Nitload
2024-12-26 03:09:46 +08:00
parent 7c8d462ca5
commit 592ad55d57
94 changed files with 3767 additions and 1484 deletions
@@ -52,8 +52,16 @@ namespace StgSharp.Math
[FieldOffset( 0 )] internal Vec3 colum0;
[FieldOffset( 4 * 4 )] internal Vec3 colum1;
public Matrix32()
{
Unsafe.SkipInit(out this);
isTransposed = false;
}
internal Matrix32( Vector4 c0, Vector4 c1 )
{
Unsafe.SkipInit(out this);
isTransposed = false;
mat.colum0 = c0;
mat.colum1 = c1;
}
@@ -66,11 +74,8 @@ namespace StgSharp.Math
float a20,
float a21 )
{
#if NET5_0_OR_GREATER
Unsafe.SkipInit( out colum0 );
Unsafe.SkipInit( out colum1 );
Unsafe.SkipInit( out transpose );
#endif
Unsafe.SkipInit(out this);
isTransposed = false;
mat.colum0 = new Vector4( a00, a10, a20, 0 );
mat.colum1 = new Vector4( a01, a11, a21, 0 );
}
@@ -204,11 +209,11 @@ namespace StgSharp.Math
}
[MethodImpl( MethodImplOptions.AggressiveInlining )]
public static Matrix32 operator +( Matrix32 left, Matrix32 right )
public static unsafe Matrix32 operator +( Matrix32 left, Matrix32 right )
{
return new Matrix32(
left.mat.colum0 + right.mat.colum0,
left.mat.colum1 + right.mat.colum1 );
Matrix32 ret = new Matrix32();
InternalIO.Intrinsic.add_mat_2(&left.mat, &right.mat, &ret.mat);
return ret;
}
}