Added operators for Mat * Vec

This commit is contained in:
Matthias 2016-02-20 15:16:37 +02:00
parent 22b33ab735
commit 2989ea1c3a
2 changed files with 33 additions and 0 deletions

View file

@ -1585,6 +1585,28 @@ namespace OpenTK
return result;
}
/// <summary>Transform a Vector by the given Matrix using right-handed notation</summary>
/// <param name="vec">The vector to transform</param>
/// <param name="mat">The desired transformation</param>
/// <returns>The transformed vector</returns>
public static Vector3 operator *(Matrix3 mat, Vector3 vec)
{
Vector3 result;
Vector3.RightHandedTransform(ref vec, ref mat, out result);
return result;
}
/// <summary>Transform a Vector by the given Matrix using right-handed notation</summary>
/// <param name="vec">The vector to transform</param>
/// <param name="mat">The desired transformation</param>
/// <returns>The transformed vector</returns>
public static Vector3 operator *(Matrix4 mat, Vector3 vec)
{
Vector3 result;
Vector3.RightHandedTransform(ref vec, ref mat, out result);
return result;
}
/// <summary>
/// Transforms a vector by a quaternion rotation.
/// </summary>

View file

@ -1543,6 +1543,17 @@ namespace OpenTK
return result;
}
/// <summary>Transform a Vector by the given Matrix using right-handed notation</summary>
/// <param name="vec">The vector to transform</param>
/// <param name="mat">The desired transformation</param>
/// <returns>The transformed vector</returns>
public static Vector4 operator *(Matrix4 mat, Vector4 vec)
{
Vector4 result;
Vector4.RightHandedTransform(ref vec, ref mat, out result);
return result;
}
/// <summary>
/// Transforms a vector by a quaternion rotation.
/// </summary>