daily uodate on 20231208 by nitload youmu, preparation for multi thread rendering
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user