mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 19:55:29 +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;
|
||||
}
|
||||
|
||||
[CLSCompliant(false)]
|
||||
unsafe public static explicit operator float*(Vector3 v)
|
||||
{
|
||||
return &v.X;
|
||||
}
|
||||
|
||||
public static explicit operator IntPtr(Vector3 v)
|
||||
public float get(int index)
|
||||
{
|
||||
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
|
||||
{
|
||||
return (IntPtr)(&v.X);
|
||||
fixed (float* ptr = &this.X)
|
||||
return *(ptr + index);
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
Loading…
Reference in a new issue