mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 03:05:30 +00:00
Removed (IntPtr) and (float*) cast operators. Added this indexer (Vector3[0], Vector3[0] etc)
This commit is contained in:
parent
e2b08d0bd6
commit
9fd384420d
|
@ -254,18 +254,23 @@ namespace OpenTK.Math
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
[CLSCompliant(false)]
|
public float get(int index)
|
||||||
unsafe public static explicit operator float*(Vector3 v)
|
|
||||||
{
|
|
||||||
return &v.X;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static explicit operator IntPtr(Vector3 v)
|
|
||||||
{
|
{
|
||||||
|
switch (index)
|
||||||
|
{
|
||||||
|
case 0: return X;
|
||||||
|
case 1: return Y;
|
||||||
|
case 2: return Z;
|
||||||
|
default: throw new ArgumentOutOfRangeException("index", index, "Should be 0, 1 or 2.");
|
||||||
|
}
|
||||||
|
/*
|
||||||
unsafe
|
unsafe
|
||||||
{
|
{
|
||||||
return (IntPtr)(&v.X);
|
fixed (float* ptr = &this.X)
|
||||||
|
return *(ptr + index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in a new issue