New IO structure, unexpexted error in C code
This commit is contained in:
@@ -1,22 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Runtime;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public struct vec2d:IEquatable<vec2d>
|
||||
public struct vec2d : IEquatable<vec2d>
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public float X;
|
||||
[FieldOffset(sizeof(float))]
|
||||
public float Y;
|
||||
|
||||
public vec2d(float x,float y)
|
||||
public vec2d(float x, float y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
@@ -62,7 +58,7 @@ namespace StgSharp.Math
|
||||
|
||||
public static bool operator ==(vec2d vec1, vec2d vec2)
|
||||
{
|
||||
return vec1.X==vec2.X && vec1.Y==vec2.Y;
|
||||
return vec1.X == vec2.X && vec1.Y == vec2.Y;
|
||||
}
|
||||
|
||||
public static bool operator !=(vec2d vec1, vec2d vec2)
|
||||
@@ -87,13 +83,13 @@ namespace StgSharp.Math
|
||||
|
||||
public static vec2d operator /(vec2d vec, float x)
|
||||
{
|
||||
return new vec2d(vec.X/x, vec.Y/x);
|
||||
return new vec2d(vec.X / x, vec.Y / x);
|
||||
}
|
||||
|
||||
public static implicit operator float[](vec2d vec)
|
||||
{
|
||||
return new float[2] {vec.X,vec.Y };
|
||||
return new float[2] { vec.X, vec.Y };
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user