diff --git a/Source/OpenTK/Math/Vector3.cs b/Source/OpenTK/Math/Vector3.cs index 37048fa7..596fa0eb 100644 --- a/Source/OpenTK/Math/Vector3.cs +++ b/Source/OpenTK/Math/Vector3.cs @@ -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