74 lines
2.2 KiB
C#
74 lines
2.2 KiB
C#
using StgSharp.Math;
|
|
using System;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Runtime.InteropServices;
|
|
using System.Security.Cryptography;
|
|
|
|
namespace StgSharp
|
|
{
|
|
internal static unsafe partial class internalIO
|
|
{
|
|
#region add
|
|
|
|
[DllImport("StgsharpGraphic", EntryPoint = "add_Mat2",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static extern Mat2* add_mat2(Mat2* left, Mat2* right);
|
|
|
|
|
|
#endregion
|
|
|
|
#region sub
|
|
|
|
[DllImport("StgsharpGraphic", EntryPoint = "sub_mat2",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static extern unsafe Mat2* sub_mat2(Mat2* left, Mat2* right);
|
|
|
|
#endregion
|
|
|
|
|
|
#region transpose
|
|
|
|
|
|
[DllImport("StgsharpGraphic", EntryPoint = "transmpose2to4",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static extern unsafe void Transpose2to4_internal(Mat2* source, Mat4* target);
|
|
|
|
#endregion
|
|
|
|
#region deinit mat2
|
|
|
|
[DllImport("StgsharpGraphic", EntryPoint = "deinit_mat2",
|
|
CallingConvention = CallingConvention.Cdecl)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
internal static extern unsafe void deinit_mat2(Mat2* mat);
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|
|
|
|
namespace StgSharp.Math
|
|
{
|
|
[StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)]
|
|
internal struct Mat2
|
|
{
|
|
|
|
[FieldOffset(0)] internal M128 colum0;
|
|
[FieldOffset(4 * sizeof(float))] internal M128 colum1;
|
|
|
|
[FieldOffset(0 * sizeof(float))] internal float m00;
|
|
[FieldOffset(1 * sizeof(float))] internal float m10;
|
|
[FieldOffset(2 * sizeof(float))] internal float m20;
|
|
[FieldOffset(3 * sizeof(float))] internal float m30;
|
|
|
|
[FieldOffset(4 * sizeof(float))] internal float m01;
|
|
[FieldOffset(5 * sizeof(float))] internal float m11;
|
|
[FieldOffset(6 * sizeof(float))] internal float m21;
|
|
[FieldOffset(7 * sizeof(float))] internal float m31;
|
|
|
|
}
|
|
}
|