daily uodate on 20231208 by nitload youmu, preparation for multi thread rendering

This commit is contained in:
Nitload
2023-12-08 05:36:04 +08:00
parent ae804553ce
commit ab85c1a9fe
297 changed files with 157896 additions and 5170 deletions
+19 -1
View File
@@ -10,7 +10,7 @@ namespace StgSharp.Math
/// Vec2Ds in StgSharp are defaultly usaed as colum vector.
/// </summary>
[StructLayout(LayoutKind.Explicit, Size = 16,Pack = 16)]
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)]
public struct Vec2d
{
@@ -27,6 +27,11 @@ namespace StgSharp.Math
X = x; Y = y;
}
public static Vec2d Zero
{
get { return new Vec2d(0, 0); }
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Vec2d operator +(Vec2d vec1, Vec2d vec2)
{
@@ -61,7 +66,20 @@ namespace StgSharp.Math
);
}
public static bool operator ==(Vec2d left, Vec2d right)
{
return left.X == right.X && left.Y == right.Y;
}
public static bool operator !=(Vec2d left, Vec2d right)
{
return !(left == right);
}
public float Cross(Vec2d right)
{
return X * right.Y - Y * right.X;
}
}
}