daily update on 2024.03.18 by itload youmu

This commit is contained in:
YoumuLiu
2024-03-19 02:41:04 +08:00
parent 15bf989285
commit 0c50c6282e
200 changed files with 7663 additions and 3455 deletions
+60 -26
View File
@@ -1,5 +1,36 @@
using StgSharp;
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
// file="mat4.cs"
// Project: StgSharp
// AuthorGroup: Nitload Space
// Copyright (c) Nitload Space. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the “Software”), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
//
// The above copyright notice and
// this permission notice shall be included in all copies
// or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED “AS IS”,
// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH
// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//-----------------------------------------------------------------------
//-----------------------------------------------------------------------
using StgSharp;
using StgSharp.Math;
using System;
using System.Numerics;
using System.Runtime.CompilerServices;
@@ -10,6 +41,26 @@ namespace StgSharp
internal static unsafe partial class InternalIO
{
#region deinit_mat4
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinit_mat4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern void deinit_mat4(Mat4* mat);
#endregion
#region det
[DllImport(InternalIO.SSC_libname, EntryPoint = "det_mat4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe float det_mat4(Mat4* matPtr, Mat4* transpose);
#endregion
#region transpose
[DllImport(InternalIO.SSC_libname, EntryPoint = "transpose4to4",
@@ -27,25 +78,6 @@ namespace StgSharp
#endregion
#region det
[DllImport(InternalIO.SSC_libname, EntryPoint = "det_mat4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static unsafe extern float det_mat4(Mat4* matPtr, Mat4* transpose);
#endregion
#region deinit_mat4
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinit_mat4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern void deinit_mat4(Mat4* mat);
#endregion
}
@@ -57,6 +89,7 @@ namespace StgSharp.Math
[StructLayout(LayoutKind.Explicit, Size = 16 * sizeof(float))]
public struct Mat4 : IEquatable<Mat4>, IMat
{
[FieldOffset(0)] internal Vector4 colum0;
[FieldOffset(16)] internal Vector4 colum1;
[FieldOffset(32)] internal Vector4 colum2;
@@ -98,7 +131,7 @@ namespace StgSharp.Math
public override bool Equals(object? obj)
{
return obj is Mat4 mat && Equals(mat);
return (obj is Mat4 mat) && Equals(mat);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -110,16 +143,17 @@ namespace StgSharp.Math
colum3.Equals(other.colum3);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(Mat4 left, Mat4 right)
{
return !(left == right);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator ==(Mat4 left, Mat4 right)
{
return left.Equals(right);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool operator !=(Mat4 left, Mat4 right)
{
return !(left == right);
}
}
}