From bea15cd250ed7961dfc4c6d9b5703e2cecf7659c Mon Sep 17 00:00:00 2001 From: Jarl Gullberg Date: Fri, 2 Jun 2017 19:42:08 +0200 Subject: [PATCH] Obsoleted Min/Max methods. --- src/OpenTK/Math/Vector2.cs | 4 +++- src/OpenTK/Math/Vector2d.cs | 6 +++++- src/OpenTK/Math/Vector3.cs | 10 ++++++---- src/OpenTK/Math/Vector3d.cs | 6 ++++-- src/OpenTK/Math/Vector4.cs | 6 +++++- src/OpenTK/Math/Vector4d.cs | 8 ++++++-- 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/OpenTK/Math/Vector2.cs b/src/OpenTK/Math/Vector2.cs index d7f8142..6047439 100644 --- a/src/OpenTK/Math/Vector2.cs +++ b/src/OpenTK/Math/Vector2.cs @@ -717,6 +717,7 @@ namespace OpenTK /// Left operand /// Right operand /// The minimum Vector3 + [Obsolete("Use MagnitudeMin() instead.")] public static Vector2 Min(Vector2 left, Vector2 right) { return left.LengthSquared < right.LengthSquared ? left : right; @@ -732,6 +733,7 @@ namespace OpenTK /// Left operand /// Right operand /// The minimum Vector3 + [Obsolete("Use MagnitudeMax() instead.")] public static Vector2 Max(Vector2 left, Vector2 right) { return left.LengthSquared >= right.LengthSquared ? left : right; @@ -1074,7 +1076,7 @@ namespace OpenTK vec.Y *= scale.Y; return vec; } - + /// /// Divides the specified instance by a scalar. /// diff --git a/src/OpenTK/Math/Vector2d.cs b/src/OpenTK/Math/Vector2d.cs index 3993aaf..a57f18e 100644 --- a/src/OpenTK/Math/Vector2d.cs +++ b/src/OpenTK/Math/Vector2d.cs @@ -577,6 +577,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise minimum + [Obsolete("Use ComponentMin() instead.")] public static Vector2d Min(Vector2d a, Vector2d b) { a.X = a.X < b.X ? a.X : b.X; @@ -590,6 +591,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise minimum + [Obsolete("Use ComponentMin() instead.")] public static void Min(ref Vector2d a, ref Vector2d b, out Vector2d result) { result.X = a.X < b.X ? a.X : b.X; @@ -606,6 +608,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise maximum + [Obsolete("Use ComponentMax() instead.")] public static Vector2d Max(Vector2d a, Vector2d b) { a.X = a.X > b.X ? a.X : b.X; @@ -619,6 +622,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise maximum + [Obsolete("Use ComponentMax() instead.")] public static void Max(ref Vector2d a, ref Vector2d b, out Vector2d result) { result.X = a.X > b.X ? a.X : b.X; @@ -936,7 +940,7 @@ namespace OpenTK vec.Y *= scale.Y; return vec; } - + /// /// Divides an instance by a scalar. /// diff --git a/src/OpenTK/Math/Vector3.cs b/src/OpenTK/Math/Vector3.cs index 000a369..e7eb009 100644 --- a/src/OpenTK/Math/Vector3.cs +++ b/src/OpenTK/Math/Vector3.cs @@ -727,6 +727,7 @@ namespace OpenTK /// Left operand /// Right operand /// The minimum Vector3 + [Obsolete("Use MagnitudeMin() instead.")] public static Vector3 Min(Vector3 left, Vector3 right) { return left.LengthSquared < right.LengthSquared ? left : right; @@ -742,6 +743,7 @@ namespace OpenTK /// Left operand /// Right operand /// The minimum Vector3 + [Obsolete("Use MagnitudeMax() instead.")] public static Vector3 Max(Vector3 left, Vector3 right) { return left.LengthSquared >= right.LengthSquared ? left : right; @@ -1270,10 +1272,10 @@ namespace OpenTK { Vector4 result; - result.X = - vector.X * worldViewProjection.M11 + - vector.Y * worldViewProjection.M21 + - vector.Z * worldViewProjection.M31 + + result.X = + vector.X * worldViewProjection.M11 + + vector.Y * worldViewProjection.M21 + + vector.Z * worldViewProjection.M31 + worldViewProjection.M41; result.Y = diff --git a/src/OpenTK/Math/Vector3d.cs b/src/OpenTK/Math/Vector3d.cs index 556b9ab..7620287 100644 --- a/src/OpenTK/Math/Vector3d.cs +++ b/src/OpenTK/Math/Vector3d.cs @@ -725,6 +725,7 @@ namespace OpenTK /// Left operand /// Right operand /// The minimum Vector3 + [Obsolete("Use MagnitudeMin() instead.")] public static Vector3d Min(Vector3d left, Vector3d right) { return left.LengthSquared < right.LengthSquared ? left : right; @@ -740,6 +741,7 @@ namespace OpenTK /// Left operand /// Right operand /// The minimum Vector3 + [Obsolete("Use MagnitudeMax() instead.")] public static Vector3d Max(Vector3d left, Vector3d right) { return left.LengthSquared >= right.LengthSquared ? left : right; @@ -1372,7 +1374,7 @@ namespace OpenTK vec.Z *= scale; return vec; } - + /// /// Component-wise multiplication between the specified instance by a scale vector. /// @@ -1386,7 +1388,7 @@ namespace OpenTK vec.Z *= scale.Z; return vec; } - + /// /// Divides an instance by a scalar. /// diff --git a/src/OpenTK/Math/Vector4.cs b/src/OpenTK/Math/Vector4.cs index a821031..ff09f98 100644 --- a/src/OpenTK/Math/Vector4.cs +++ b/src/OpenTK/Math/Vector4.cs @@ -703,6 +703,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise minimum + [Obsolete("Use ComponentMin() instead.")] public static Vector4 Min(Vector4 a, Vector4 b) { a.X = a.X < b.X ? a.X : b.X; @@ -718,6 +719,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise minimum + [Obsolete("Use ComponentMin() instead.")] public static void Min(ref Vector4 a, ref Vector4 b, out Vector4 result) { result.X = a.X < b.X ? a.X : b.X; @@ -736,6 +738,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise maximum + [Obsolete("Use ComponentMax() instead.")] public static Vector4 Max(Vector4 a, Vector4 b) { a.X = a.X > b.X ? a.X : b.X; @@ -751,6 +754,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise maximum + [Obsolete("Use ComponentMax() instead.")] public static void Max(ref Vector4 a, ref Vector4 b, out Vector4 result) { result.X = a.X > b.X ? a.X : b.X; @@ -1514,7 +1518,7 @@ namespace OpenTK vec.W *= scale; return vec; } - + /// /// Component-wise multiplication between the specified instance by a scale vector. /// diff --git a/src/OpenTK/Math/Vector4d.cs b/src/OpenTK/Math/Vector4d.cs index facc329..0380149 100644 --- a/src/OpenTK/Math/Vector4d.cs +++ b/src/OpenTK/Math/Vector4d.cs @@ -175,7 +175,7 @@ namespace OpenTK #endregion #region Public Members - + /// /// Gets or sets the value at the index of the Vector. /// @@ -705,6 +705,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise minimum + [Obsolete("Use ComponentMin() instead.")] public static Vector4d Min(Vector4d a, Vector4d b) { a.X = a.X < b.X ? a.X : b.X; @@ -720,6 +721,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise minimum + [Obsolete("Use ComponentMin() instead.")] public static void Min(ref Vector4d a, ref Vector4d b, out Vector4d result) { result.X = a.X < b.X ? a.X : b.X; @@ -738,6 +740,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise maximum + [Obsolete("Use ComponentMax() instead.")] public static Vector4d Max(Vector4d a, Vector4d b) { a.X = a.X > b.X ? a.X : b.X; @@ -753,6 +756,7 @@ namespace OpenTK /// First operand /// Second operand /// The component-wise maximum + [Obsolete("Use ComponentMax() instead.")] public static void Max(ref Vector4d a, ref Vector4d b, out Vector4d result) { result.X = a.X > b.X ? a.X : b.X; @@ -1493,7 +1497,7 @@ namespace OpenTK vec.W *= scale; return vec; } - + /// /// Component-wise multiplication between the specified instance by a scale vector. /// -- 2.7.4