daily update on 20230730 by nitload youmu, 5th day of params displacement

This commit is contained in:
Nitload
2023-07-30 07:08:36 +08:00
parent e11c88b051
commit 194d65edf6
147 changed files with 36506 additions and 1927 deletions
+44 -21
View File
@@ -6,63 +6,86 @@ using System.Runtime.InteropServices;
namespace StgSharp.Math
{
public class Vec4d
{
internal readonly int mapID;
internal readonly long m128Ptr;
internal readonly M128Map _map;
internal readonly IntPtr _m128Ptr;
private M128 _value;
public unsafe float X
{
get { return (*(M128*)mapID).single_0; }
set { (*(M128*)mapID).single_0 = value; }
get { return (*(M128*)_m128Ptr).single_0; }
set { (*(M128*)_m128Ptr).single_0 = value; }
}
public float Y
public unsafe float Y
{
get { return _value.single_1; }
set { _value.single_1 = value; }
get { return (*(M128*)_m128Ptr).single_1; }
set { (*(M128*)_m128Ptr).single_1 = value; }
}
public float Z
public unsafe float Z
{
get { return _value.single_2; }
set { _value.single_2 = value; }
get { return (*(M128*)_m128Ptr).single_2; }
set { (*(M128*)_m128Ptr).single_2 = value; }
}
public float W
public unsafe float W
{
get { return _value.single_3; }
set { _value.single_3 = value; }
get { return (*(M128*)_m128Ptr).single_3; }
set { (*(M128*)_m128Ptr).single_3 = value; }
}
public Vec4d(float x, float y, float z, float w)
{
X = x;
Y = y;
Z = z;
W = w;
IntPtr a = internalIO.InternalInitM128(x,y,z,w);
if ((ulong)a>=0)
{
this._m128Ptr = a;
}
}
internal Vec4d()
{
_m128Ptr = internalIO.InternalInitM128(0,0,0,0);
}
public static Vec4d operator +(Vec4d vec1,Vec4d vec2)
{
Vec4d result = new Vec4d();
result._value = internalIO.VecAddVec(vec1._value,vec2._value);
internalIO.VecAddVec(vec1._m128Ptr, vec2._m128Ptr/**/,result._m128Ptr/**/);
return result;
}
/**/
public static Vec4d operator -(Vec4d vec1, Vec4d vec2)
{
Vec4d result = new Vec4d();
result._value = internalIO.VecAddVec(vec1._value, vec2._value);
internalIO.VecSubVec(vec1._m128Ptr,vec2._m128Ptr,result._m128Ptr);
return result;
}
/**/
public unsafe override string ToString()
{
return $"{*(M128*)_m128Ptr}";
}
~Vec4d()
{
if (_map == null)
{
internalIO.InternalDeinitM128(this._m128Ptr);
}
else
{
}
}
}
}