зеркало из https://github.com/stride3d/opentk.git
Added multiplication operator to all vectors
This commit is contained in:
Родитель
87cfe60b16
Коммит
617131066a
|
@ -1062,6 +1062,19 @@ namespace OpenTK
|
|||
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>
|
||||
/// Divides the specified instance by a scalar.
|
||||
/// </summary>
|
||||
|
|
|
@ -924,6 +924,19 @@ namespace OpenTK
|
|||
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>
|
||||
/// Divides an instance by a scalar.
|
||||
/// </summary>
|
||||
|
|
|
@ -1373,6 +1373,20 @@ namespace OpenTK
|
|||
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>
|
||||
/// Divides an instance by a scalar.
|
||||
/// </summary>
|
||||
|
|
|
@ -1370,7 +1370,21 @@ namespace OpenTK
|
|||
vec.Z *= scale;
|
||||
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>
|
||||
/// Divides an instance by a scalar.
|
||||
/// </summary>
|
||||
|
|
|
@ -1490,7 +1490,22 @@ namespace OpenTK
|
|||
vec.W *= scale;
|
||||
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>
|
||||
/// Divides an instance by a scalar.
|
||||
/// </summary>
|
||||
|
|
|
@ -1493,6 +1493,21 @@ namespace OpenTK
|
|||
vec.W *= scale;
|
||||
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>
|
||||
/// Divides an instance by a scalar.
|
||||
|
|
Загрузка…
Ссылка в новой задаче