mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 18:35:32 +00:00
Added multiplication operator to all vectors
This commit is contained in:
parent
87cfe60b16
commit
617131066a
|
@ -1062,6 +1062,19 @@ namespace OpenTK
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Component-wise multiplication between the specified instance by a scale vector.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scale">Left operand.</param>
|
||||||
|
/// <param name="vec">Right operand.</param>
|
||||||
|
/// <returns>Result of multiplication.</returns>
|
||||||
|
public static Vector2 operator *(Vector2 vec, Vector2 scale)
|
||||||
|
{
|
||||||
|
vec.X *= scale.X;
|
||||||
|
vec.Y *= scale.Y;
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Divides the specified instance by a scalar.
|
/// Divides the specified instance by a scalar.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -924,6 +924,19 @@ namespace OpenTK
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Component-wise multiplication between the specified instance by a scale vector.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scale">Left operand.</param>
|
||||||
|
/// <param name="vec">Right operand.</param>
|
||||||
|
/// <returns>Result of multiplication.</returns>
|
||||||
|
public static Vector2d operator *(Vector2d vec, Vector2d scale)
|
||||||
|
{
|
||||||
|
vec.X *= scale.X;
|
||||||
|
vec.Y *= scale.Y;
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Divides an instance by a scalar.
|
/// Divides an instance by a scalar.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1373,6 +1373,20 @@ namespace OpenTK
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Component-wise multiplication between the specified instance by a scale vector.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scale">Left operand.</param>
|
||||||
|
/// <param name="vec">Right operand.</param>
|
||||||
|
/// <returns>Result of multiplication.</returns>
|
||||||
|
public static Vector3 operator *(Vector3 vec, Vector3 scale)
|
||||||
|
{
|
||||||
|
vec.X *= scale.X;
|
||||||
|
vec.Y *= scale.Y;
|
||||||
|
vec.Z *= scale.Z;
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Divides an instance by a scalar.
|
/// Divides an instance by a scalar.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1370,7 +1370,21 @@ namespace OpenTK
|
||||||
vec.Z *= scale;
|
vec.Z *= scale;
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Component-wise multiplication between the specified instance by a scale vector.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scale">Left operand.</param>
|
||||||
|
/// <param name="vec">Right operand.</param>
|
||||||
|
/// <returns>Result of multiplication.</returns>
|
||||||
|
public static Vector3d operator *(Vector3d vec, Vector3d scale)
|
||||||
|
{
|
||||||
|
vec.X *= scale.X;
|
||||||
|
vec.Y *= scale.Y;
|
||||||
|
vec.Z *= scale.Z;
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Divides an instance by a scalar.
|
/// Divides an instance by a scalar.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1490,7 +1490,22 @@ namespace OpenTK
|
||||||
vec.W *= scale;
|
vec.W *= scale;
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Component-wise multiplication between the specified instance by a scale vector.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scale">Left operand.</param>
|
||||||
|
/// <param name="vec">Right operand.</param>
|
||||||
|
/// <returns>Result of multiplication.</returns>
|
||||||
|
public static Vector4 operator *(Vector4 vec, Vector4 scale)
|
||||||
|
{
|
||||||
|
vec.X *= scale.X;
|
||||||
|
vec.Y *= scale.Y;
|
||||||
|
vec.Z *= scale.Z;
|
||||||
|
vec.W *= scale.W;
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Divides an instance by a scalar.
|
/// Divides an instance by a scalar.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1493,6 +1493,21 @@ namespace OpenTK
|
||||||
vec.W *= scale;
|
vec.W *= scale;
|
||||||
return vec;
|
return vec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Component-wise multiplication between the specified instance by a scale vector.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scale">Left operand.</param>
|
||||||
|
/// <param name="vec">Right operand.</param>
|
||||||
|
/// <returns>Result of multiplication.</returns>
|
||||||
|
public static Vector4d operator *(Vector4d vec, Vector4d scale)
|
||||||
|
{
|
||||||
|
vec.X *= scale.X;
|
||||||
|
vec.Y *= scale.Y;
|
||||||
|
vec.Z *= scale.Z;
|
||||||
|
vec.W *= scale.W;
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Divides an instance by a scalar.
|
/// Divides an instance by a scalar.
|
||||||
|
|
Loading…
Reference in a new issue