mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 15:55:31 +00:00
Added operators for Mat * Vec
This commit is contained in:
parent
22b33ab735
commit
2989ea1c3a
|
@ -1585,6 +1585,28 @@ namespace OpenTK
|
||||||
return 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 *(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>
|
/// <summary>
|
||||||
/// Transforms a vector by a quaternion rotation.
|
/// Transforms a vector by a quaternion rotation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1543,6 +1543,17 @@ namespace OpenTK
|
||||||
return 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 Vector4 operator *(Matrix4 mat, Vector4 vec)
|
||||||
|
{
|
||||||
|
Vector4 result;
|
||||||
|
Vector4.RightHandedTransform(ref vec, ref mat, out result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Transforms a vector by a quaternion rotation.
|
/// Transforms a vector by a quaternion rotation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in a new issue