daily update on 20230829 by nitload youmu
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
@@ -36,6 +36,11 @@ namespace StgSharp
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static extern unsafe void Transpose2to4_internal(Mat2* source, Mat4* target);
|
||||
|
||||
[DllImport("StgsharpGraphic", EntryPoint = "transmpose2to3",
|
||||
CallingConvention = CallingConvention.Cdecl)]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static extern unsafe void Transpose2to3_internal(Mat2* source, Mat3* target);
|
||||
|
||||
#endregion
|
||||
|
||||
#region deinit mat2
|
||||
@@ -56,8 +61,8 @@ namespace StgSharp.Math
|
||||
internal struct Mat2
|
||||
{
|
||||
|
||||
[FieldOffset(0)] internal M128 colum0;
|
||||
[FieldOffset(4 * sizeof(float))] internal M128 colum1;
|
||||
[FieldOffset(0)] internal Vector4 colum0;
|
||||
[FieldOffset(4 * sizeof(float))] internal Vector4 colum1;
|
||||
|
||||
[FieldOffset(0 * sizeof(float))] internal float m00;
|
||||
[FieldOffset(1 * sizeof(float))] internal float m10;
|
||||
@@ -69,5 +74,31 @@ namespace StgSharp.Math
|
||||
[FieldOffset(6 * sizeof(float))] internal float m21;
|
||||
[FieldOffset(7 * sizeof(float))] internal float m31;
|
||||
|
||||
internal Mat2(
|
||||
Vector4 c0,
|
||||
Vector4 c1
|
||||
)
|
||||
{
|
||||
colum0 = c0;
|
||||
colum1 = c1;
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static Mat2 Add(Mat2 left, Mat2 right)
|
||||
{
|
||||
return new Mat2(
|
||||
left.colum0 + right.colum0,
|
||||
left.colum1 + right.colum1
|
||||
);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static Mat2 Sub(Mat2 left, Mat2 right)
|
||||
{
|
||||
return new Mat2(
|
||||
left.colum0 - right.colum0,
|
||||
left.colum1 - right.colum1
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user