daily update on 20240413 by nitload youmu, camera complete

This commit is contained in:
YoumuLiu
2024-04-13 04:04:14 +08:00
parent f0f80f72f1
commit 7c755fe1e2
99 changed files with 1351 additions and 1119 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit, Size = ((3 + 2) * 4 * sizeof(float)) + sizeof(bool), Pack = 16)]
public struct Matrix23
public struct Matrix23:IMat
{
[FieldOffset(5 * 4 * sizeof(float))] internal bool isTransposed;
+1 -1
View File
@@ -36,7 +36,7 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit, Size = ((4 + 2) * 4 * sizeof(float)) + sizeof(bool), Pack = 16)]
public struct Matrix24
public struct Matrix24:IMat
{
[FieldOffset(6 * 4 * sizeof(float))] internal bool isTransposed;
+3 -3
View File
@@ -36,7 +36,7 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit, Size = (5 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)]
public struct Matrix32
public struct Matrix32:IMat
{
[FieldOffset(0)] internal vec3d colum0;
@@ -62,13 +62,13 @@ namespace StgSharp.Math
float a20, float a21
)
{
mat.colum0 = new Vector4(a00, a10, a20, 0);
mat.colum0 = new Vector4(a01, a11, a21, 0);
#if NET5_0_OR_GREATER
Unsafe.SkipInit(out colum0);
Unsafe.SkipInit(out colum1);
Unsafe.SkipInit(out transpose);
#endif
mat.colum0 = new Vector4(a00, a10, a20, 0);
mat.colum1 = new Vector4(a01, a11, a21, 0);
}
public unsafe float this[int rowNum, int columNum]
+1 -1
View File
@@ -36,7 +36,7 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit, Size = (6 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)]
public struct Matrix33
public struct Matrix33:IMat
{
[FieldOffset(6 * 4 * sizeof(float))] internal bool isTransposed;
+1 -1
View File
@@ -38,7 +38,7 @@ namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit, Size = (7 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)]
public struct Matrix34
public struct Matrix34:IMat
{
[FieldOffset(7 * 4 * sizeof(float))] internal bool isTransposed;
+1 -1
View File
@@ -39,7 +39,7 @@ namespace StgSharp.Math
[StructLayout(LayoutKind.Explicit, Size = ((16 + 8) * sizeof(float)) + sizeof(bool), Pack = 16)]
public struct Matrix42
public struct Matrix42:IMat
{
[FieldOffset((16 + 8) * sizeof(float))] internal bool isTransposed;
+1 -1
View File
@@ -37,7 +37,7 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit, Size = (7 * 4 * sizeof(float)) + sizeof(bool), Pack = 16)]
public struct Matrix43 : IEquatable<Matrix43>
public struct Matrix43 : IEquatable<Matrix43>,IMat
{
[FieldOffset(7 * 4 * sizeof(float))]
+5 -5
View File
@@ -49,10 +49,10 @@ namespace StgSharp.Math
[FieldOffset(0)] internal Mat4 mat;
[FieldOffset(16 * sizeof(float))] internal Mat4 transpose;
[FieldOffset(0 * sizeof(float))] public vec4d Colum0;
[FieldOffset(4 * sizeof(float))] public vec4d Colum1;
[FieldOffset(8 * sizeof(float))] public vec4d Colum2;
[FieldOffset(12 * sizeof(float))] public vec4d Colum3;
[FieldOffset(0 * sizeof(float))] internal vec4d colum0;
[FieldOffset(4 * sizeof(float))] internal vec4d colum1;
[FieldOffset(8 * sizeof(float))] internal vec4d colum2;
[FieldOffset(12 * sizeof(float))] internal vec4d colum3;
internal Matrix44(Mat4 mat)
{
@@ -223,7 +223,7 @@ namespace StgSharp.Math
{
if (!isTransposed)
{
fixed (Mat4* source = &this.mat, target = &this.transpose)
fixed (Mat4* source = &mat, target = &transpose)
{
InternalIO.Transpose4to4_internal(source, target);
}
+2 -3
View File
@@ -71,12 +71,12 @@ namespace StgSharp
#region transpose
[DllImport(InternalIO.SSC_libname, EntryPoint = "transmpose2to4",
[DllImport(InternalIO.SSC_libname, EntryPoint = "transpose2to4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe void Transpose2to4_internal(Mat2* source, Mat4* target);
[DllImport(InternalIO.SSC_libname, EntryPoint = "transmpose2to3",
[DllImport(InternalIO.SSC_libname, EntryPoint = "transpose2to3",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe void Transpose2to3_internal(Mat2* source, Mat3* target);
@@ -97,7 +97,6 @@ namespace StgSharp.Math
[FieldOffset(4 * sizeof(float))] internal Vector4 colum1;
[FieldOffset(0 * sizeof(float))] internal float m00;
[FieldOffset(4 * sizeof(float))] internal float m01;
[FieldOffset(1 * sizeof(float))] internal float m10;
[FieldOffset(5 * sizeof(float))] internal float m11;
+3 -3
View File
@@ -51,15 +51,15 @@ namespace StgSharp
#region transpose
[DllImport(InternalIO.SSC_libname, EntryPoint = "transpose3to4",
[DllImport(SSC_libname, EntryPoint = "transpose3to4",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose3to4_internal(Mat3* source, Mat4* target);
[DllImport("StgsharpGra[hic", EntryPoint = "transpose3to4",
[DllImport(SSC_libname, EntryPoint = "transpose3to3",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose3to3_internal(Mat3* source, Mat3* target);
[DllImport("StgsharpGra[hic", EntryPoint = "transpose3to2",
[DllImport(SSC_libname, EntryPoint = "transpose3to2",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose3to2_internal(Mat3* source, Mat2* target);
+5 -5
View File
@@ -44,7 +44,7 @@ namespace StgSharp
#region deinit_mat4
[DllImport(InternalIO.SSC_libname, EntryPoint = "deinit_mat4",
[DllImport(SSC_libname, EntryPoint = "deinit_mat4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern void deinit_mat4(Mat4* mat);
@@ -53,7 +53,7 @@ namespace StgSharp
#region det
[DllImport(InternalIO.SSC_libname, EntryPoint = "det_mat4",
[DllImport(SSC_libname, EntryPoint = "det_mat4",
CallingConvention = CallingConvention.Cdecl)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static extern unsafe float det_mat4(Mat4* matPtr, Mat4* transpose);
@@ -63,15 +63,15 @@ namespace StgSharp
#region transpose
[DllImport(InternalIO.SSC_libname, EntryPoint = "transpose4to4",
[DllImport(SSC_libname, EntryPoint = "transpose4to4",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose4to4_internal(Mat4* source, Mat4* target);
[DllImport(InternalIO.SSC_libname, EntryPoint = "transpose4to3",
[DllImport(SSC_libname, EntryPoint = "transpose4to3",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose4to3_internal(Mat4* source, Mat3* target);
[DllImport(InternalIO.SSC_libname, EntryPoint = "transpose4to2",
[DllImport(SSC_libname, EntryPoint = "transpose4to2",
CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void Transpose4to2_internal(Mat4* source, Mat2* target);