Fixed XML documentation warnings.
This commit is contained in:
parent
98882acdbf
commit
376a1fca65
8 changed files with 373 additions and 48 deletions
|
@ -249,6 +249,9 @@ namespace OpenTK
|
|||
|
||||
#region public void Invert()
|
||||
|
||||
/// <summary>
|
||||
/// Converts this instance into its inverse.
|
||||
/// </summary>
|
||||
public void Invert()
|
||||
{
|
||||
this = Matrix4.Invert(this);
|
||||
|
@ -259,7 +262,7 @@ namespace OpenTK
|
|||
#region public void Transpose()
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the transpose of this instance.
|
||||
/// Converts this instance into its transpose.
|
||||
/// </summary>
|
||||
public void Transpose()
|
||||
{
|
||||
|
@ -836,7 +839,7 @@ namespace OpenTK
|
|||
Vector3 axis;
|
||||
float angle;
|
||||
q.ToAxisAngle(out axis, out angle);
|
||||
return Rotate(axis, angle);
|
||||
return CreateFromAxisAngle(axis, angle);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -1128,11 +1131,23 @@ namespace OpenTK
|
|||
return Matrix4.Mult(left, right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(Matrix4 left, Matrix4 right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equal right; false otherwise.</returns>
|
||||
public static bool operator !=(Matrix4 left, Matrix4 right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
|
|
|
@ -249,6 +249,9 @@ namespace OpenTK
|
|||
|
||||
#region public void Invert()
|
||||
|
||||
/// <summary>
|
||||
/// Converts this instance into its inverse.
|
||||
/// </summary>
|
||||
public void Invert()
|
||||
{
|
||||
this = Matrix4d.Invert(this);
|
||||
|
@ -258,6 +261,9 @@ namespace OpenTK
|
|||
|
||||
#region public void Transpose()
|
||||
|
||||
/// <summary>
|
||||
/// Converts this instance into its transpose.
|
||||
/// </summary>
|
||||
public void Transpose()
|
||||
{
|
||||
this = Matrix4d.Transpose(this);
|
||||
|
@ -981,11 +987,23 @@ namespace OpenTK
|
|||
return Matrix4d.Mult(left, right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(Matrix4d left, Matrix4d right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equal right; false otherwise.</returns>
|
||||
public static bool operator !=(Matrix4d left, Matrix4d right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
|
|
|
@ -278,7 +278,7 @@ namespace OpenTK
|
|||
/// </summary>
|
||||
/// <param name="left">The left instance.</param>
|
||||
/// <param name="right">The right instance.</param>
|
||||
/// <returns>The result of the operation.</returns>
|
||||
/// <param name="result">The result of the operation.</param>
|
||||
public static void Sub(ref Quaternion left, ref Quaternion right, out Quaternion result)
|
||||
{
|
||||
result = new Quaternion(
|
||||
|
@ -290,6 +290,12 @@ namespace OpenTK
|
|||
|
||||
#region Mult
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
public static Quaternion Mult(Quaternion left, Quaternion right)
|
||||
{
|
||||
return new Quaternion(
|
||||
|
@ -297,6 +303,12 @@ namespace OpenTK
|
|||
left.W * right.W - Vector3.Dot(left.Xyz, right.Xyz));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <param name="result">A new instance containing the result of the calculation.</param>
|
||||
public static void Mult(ref Quaternion left, ref Quaternion right, out Quaternion result)
|
||||
{
|
||||
result = new Quaternion(
|
||||
|
@ -488,6 +500,12 @@ namespace OpenTK
|
|||
|
||||
#region Operators
|
||||
|
||||
/// <summary>
|
||||
/// Adds two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Quaternion operator +(Quaternion left, Quaternion right)
|
||||
{
|
||||
left.Xyz += right.Xyz;
|
||||
|
@ -495,6 +513,12 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Quaternion operator -(Quaternion left, Quaternion right)
|
||||
{
|
||||
left.Xyz -= right.Xyz;
|
||||
|
@ -502,6 +526,12 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Quaternion operator *(Quaternion left, Quaternion right)
|
||||
{
|
||||
float w = left.W * right.W - Vector3.Dot(left.Xyz, right.Xyz);
|
||||
|
@ -510,11 +540,23 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(Quaternion left, Quaternion right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equal right; false otherwise.</returns>
|
||||
public static bool operator !=(Quaternion left, Quaternion right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
|
|
|
@ -278,7 +278,7 @@ namespace OpenTK
|
|||
/// </summary>
|
||||
/// <param name="left">The left instance.</param>
|
||||
/// <param name="right">The right instance.</param>
|
||||
/// <returns>The result of the operation.</returns>
|
||||
/// <param name="result">The result of the operation.</param>
|
||||
public static void Sub(ref Quaterniond left, ref Quaterniond right, out Quaterniond result)
|
||||
{
|
||||
result = new Quaterniond(
|
||||
|
@ -290,6 +290,12 @@ namespace OpenTK
|
|||
|
||||
#region Mult
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>A new instance containing the result of the calculation.</returns>
|
||||
public static Quaterniond Mult(Quaterniond left, Quaterniond right)
|
||||
{
|
||||
return new Quaterniond(
|
||||
|
@ -297,6 +303,12 @@ namespace OpenTK
|
|||
left.W * right.W - Vector3d.Dot(left.Xyz, right.Xyz));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <param name="result">A new instance containing the result of the calculation.</param>
|
||||
public static void Mult(ref Quaterniond left, ref Quaterniond right, out Quaterniond result)
|
||||
{
|
||||
result = new Quaterniond(
|
||||
|
@ -488,6 +500,12 @@ namespace OpenTK
|
|||
|
||||
#region Operators
|
||||
|
||||
/// <summary>
|
||||
/// Adds two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Quaterniond operator +(Quaterniond left, Quaterniond right)
|
||||
{
|
||||
left.Xyz += right.Xyz;
|
||||
|
@ -495,6 +513,12 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Quaterniond operator -(Quaterniond left, Quaterniond right)
|
||||
{
|
||||
left.Xyz -= right.Xyz;
|
||||
|
@ -502,6 +526,12 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Multiplies two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Quaterniond operator *(Quaterniond left, Quaterniond right)
|
||||
{
|
||||
double w = left.W * right.W - Vector3d.Dot(left.Xyz, right.Xyz);
|
||||
|
@ -510,11 +540,23 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(Quaterniond left, Quaterniond right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equal right; false otherwise.</returns>
|
||||
public static bool operator !=(Quaterniond left, Quaterniond right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
|
|
|
@ -1022,6 +1022,12 @@ namespace OpenTK
|
|||
|
||||
#region Operators
|
||||
|
||||
/// <summary>
|
||||
/// Adds two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3 operator +(Vector3 left, Vector3 right)
|
||||
{
|
||||
left.X += right.X;
|
||||
|
@ -1030,6 +1036,12 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3 operator -(Vector3 left, Vector3 right)
|
||||
{
|
||||
left.X -= right.X;
|
||||
|
@ -1038,6 +1050,11 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Negates an instance.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3 operator -(Vector3 vec)
|
||||
{
|
||||
vec.X = -vec.X;
|
||||
|
@ -1046,36 +1063,66 @@ namespace OpenTK
|
|||
return vec;
|
||||
}
|
||||
|
||||
public static Vector3 operator *(Vector3 vec, float f)
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3 operator *(Vector3 vec, float scale)
|
||||
{
|
||||
vec.X *= f;
|
||||
vec.Y *= f;
|
||||
vec.Z *= f;
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
vec.Z *= scale;
|
||||
return vec;
|
||||
}
|
||||
|
||||
public static Vector3 operator *(float f, Vector3 vec)
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3 operator *(float scale, Vector3 vec)
|
||||
{
|
||||
vec.X *= f;
|
||||
vec.Y *= f;
|
||||
vec.Z *= f;
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
vec.Z *= scale;
|
||||
return vec;
|
||||
}
|
||||
|
||||
public static Vector3 operator /(Vector3 vec, float f)
|
||||
/// <summary>
|
||||
/// Divides an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3 operator /(Vector3 vec, float scale)
|
||||
{
|
||||
float mult = 1.0f / f;
|
||||
float mult = 1.0f / scale;
|
||||
vec.X *= mult;
|
||||
vec.Y *= mult;
|
||||
vec.Z *= mult;
|
||||
return vec;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(Vector3 left, Vector3 right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equa lright; false otherwise.</returns>
|
||||
public static bool operator !=(Vector3 left, Vector3 right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
|
|
|
@ -1019,6 +1019,12 @@ namespace OpenTK
|
|||
|
||||
#region Operators
|
||||
|
||||
/// <summary>
|
||||
/// Adds two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3d operator +(Vector3d left, Vector3d right)
|
||||
{
|
||||
left.X += right.X;
|
||||
|
@ -1027,6 +1033,12 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3d operator -(Vector3d left, Vector3d right)
|
||||
{
|
||||
left.X -= right.X;
|
||||
|
@ -1035,6 +1047,11 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Negates an instance.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3d operator -(Vector3d vec)
|
||||
{
|
||||
vec.X = -vec.X;
|
||||
|
@ -1043,36 +1060,66 @@ namespace OpenTK
|
|||
return vec;
|
||||
}
|
||||
|
||||
public static Vector3d operator *(Vector3d vec, double f)
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3d operator *(Vector3d vec, double scale)
|
||||
{
|
||||
vec.X *= f;
|
||||
vec.Y *= f;
|
||||
vec.Z *= f;
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
vec.Z *= scale;
|
||||
return vec;
|
||||
}
|
||||
|
||||
public static Vector3d operator *(double f, Vector3d vec)
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3d operator *(double scale, Vector3d vec)
|
||||
{
|
||||
vec.X *= f;
|
||||
vec.Y *= f;
|
||||
vec.Z *= f;
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
vec.Z *= scale;
|
||||
return vec;
|
||||
}
|
||||
|
||||
public static Vector3d operator /(Vector3d vec, double f)
|
||||
/// <summary>
|
||||
/// Divides an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector3d operator /(Vector3d vec, double scale)
|
||||
{
|
||||
double mult = 1.0f / f;
|
||||
double mult = 1 / scale;
|
||||
vec.X *= mult;
|
||||
vec.Y *= mult;
|
||||
vec.Z *= mult;
|
||||
return vec;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(Vector3d left, Vector3d right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equa lright; false otherwise.</returns>
|
||||
public static bool operator !=(Vector3d left, Vector3d right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
|
|
|
@ -847,6 +847,12 @@ namespace OpenTK
|
|||
|
||||
#region Operators
|
||||
|
||||
/// <summary>
|
||||
/// Adds two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4 operator +(Vector4 left, Vector4 right)
|
||||
{
|
||||
left.X += right.X;
|
||||
|
@ -856,6 +862,12 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4 operator -(Vector4 left, Vector4 right)
|
||||
{
|
||||
left.X -= right.X;
|
||||
|
@ -865,6 +877,11 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Negates an instance.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4 operator -(Vector4 vec)
|
||||
{
|
||||
vec.X = -vec.X;
|
||||
|
@ -874,27 +891,45 @@ namespace OpenTK
|
|||
return vec;
|
||||
}
|
||||
|
||||
public static Vector4 operator *(Vector4 vec, float f)
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4 operator *(Vector4 vec, float scale)
|
||||
{
|
||||
vec.X *= f;
|
||||
vec.Y *= f;
|
||||
vec.Z *= f;
|
||||
vec.W *= f;
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
vec.Z *= scale;
|
||||
vec.W *= scale;
|
||||
return vec;
|
||||
}
|
||||
|
||||
public static Vector4 operator *(float f, Vector4 vec)
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4 operator *(float scale, Vector4 vec)
|
||||
{
|
||||
vec.X *= f;
|
||||
vec.Y *= f;
|
||||
vec.Z *= f;
|
||||
vec.W *= f;
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
vec.Z *= scale;
|
||||
vec.W *= scale;
|
||||
return vec;
|
||||
}
|
||||
|
||||
public static Vector4 operator /(Vector4 vec, float f)
|
||||
/// <summary>
|
||||
/// Divides an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4 operator /(Vector4 vec, float scale)
|
||||
{
|
||||
float mult = 1.0f / f;
|
||||
float mult = 1.0f / scale;
|
||||
vec.X *= mult;
|
||||
vec.Y *= mult;
|
||||
vec.Z *= mult;
|
||||
|
@ -902,22 +937,44 @@ namespace OpenTK
|
|||
return vec;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(Vector4 left, Vector4 right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equa lright; false otherwise.</returns>
|
||||
public static bool operator !=(Vector4 left, Vector4 right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a pointer to the first element of the specified instance.
|
||||
/// </summary>
|
||||
/// <param name="v">The instance.</param>
|
||||
/// <returns>A pointer to the first element of v.</returns>
|
||||
[CLSCompliant(false)]
|
||||
unsafe public static explicit operator float*(Vector4 v)
|
||||
{
|
||||
return &v.X;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a pointer to the first element of the specified instance.
|
||||
/// </summary>
|
||||
/// <param name="v">The instance.</param>
|
||||
/// <returns>A pointer to the first element of v.</returns>
|
||||
public static explicit operator IntPtr(Vector4 v)
|
||||
{
|
||||
unsafe
|
||||
|
|
|
@ -844,6 +844,12 @@ namespace OpenTK
|
|||
|
||||
#region Operators
|
||||
|
||||
/// <summary>
|
||||
/// Adds two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4d operator +(Vector4d left, Vector4d right)
|
||||
{
|
||||
left.X += right.X;
|
||||
|
@ -853,6 +859,12 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Subtracts two instances.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4d operator -(Vector4d left, Vector4d right)
|
||||
{
|
||||
left.X -= right.X;
|
||||
|
@ -862,6 +874,11 @@ namespace OpenTK
|
|||
return left;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Negates an instance.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4d operator -(Vector4d vec)
|
||||
{
|
||||
vec.X = -vec.X;
|
||||
|
@ -871,27 +888,45 @@ namespace OpenTK
|
|||
return vec;
|
||||
}
|
||||
|
||||
public static Vector4d operator *(Vector4d vec, double f)
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4d operator *(Vector4d vec, double scale)
|
||||
{
|
||||
vec.X *= f;
|
||||
vec.Y *= f;
|
||||
vec.Z *= f;
|
||||
vec.W *= f;
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
vec.Z *= scale;
|
||||
vec.W *= scale;
|
||||
return vec;
|
||||
}
|
||||
|
||||
public static Vector4d operator *(double f, Vector4d vec)
|
||||
/// <summary>
|
||||
/// Multiplies an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4d operator *(double scale, Vector4d vec)
|
||||
{
|
||||
vec.X *= f;
|
||||
vec.Y *= f;
|
||||
vec.Z *= f;
|
||||
vec.W *= f;
|
||||
vec.X *= scale;
|
||||
vec.Y *= scale;
|
||||
vec.Z *= scale;
|
||||
vec.W *= scale;
|
||||
return vec;
|
||||
}
|
||||
|
||||
public static Vector4d operator /(Vector4d vec, double f)
|
||||
/// <summary>
|
||||
/// Divides an instance by a scalar.
|
||||
/// </summary>
|
||||
/// <param name="vec">The instance.</param>
|
||||
/// <param name="scale">The scalar.</param>
|
||||
/// <returns>The result of the calculation.</returns>
|
||||
public static Vector4d operator /(Vector4d vec, double scale)
|
||||
{
|
||||
double mult = 1.0f / f;
|
||||
double mult = 1 / scale;
|
||||
vec.X *= mult;
|
||||
vec.Y *= mult;
|
||||
vec.Z *= mult;
|
||||
|
@ -899,22 +934,44 @@ namespace OpenTK
|
|||
return vec;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for equality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left equals right; false otherwise.</returns>
|
||||
public static bool operator ==(Vector4d left, Vector4d right)
|
||||
{
|
||||
return left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Compares two instances for inequality.
|
||||
/// </summary>
|
||||
/// <param name="left">The first instance.</param>
|
||||
/// <param name="right">The second instance.</param>
|
||||
/// <returns>True, if left does not equa lright; false otherwise.</returns>
|
||||
public static bool operator !=(Vector4d left, Vector4d right)
|
||||
{
|
||||
return !left.Equals(right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a pointer to the first element of the specified instance.
|
||||
/// </summary>
|
||||
/// <param name="v">The instance.</param>
|
||||
/// <returns>A pointer to the first element of v.</returns>
|
||||
[CLSCompliant(false)]
|
||||
unsafe public static explicit operator double*(Vector4d v)
|
||||
{
|
||||
return &v.X;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a pointer to the first element of the specified instance.
|
||||
/// </summary>
|
||||
/// <param name="v">The instance.</param>
|
||||
/// <returns>A pointer to the first element of v.</returns>
|
||||
public static explicit operator IntPtr(Vector4d v)
|
||||
{
|
||||
unsafe
|
||||
|
|
Loading…
Reference in a new issue