diff --git a/Source/OpenTK/Math/Matrix4d.cs b/Source/OpenTK/Math/Matrix4d.cs index c4b9387d..7abbfd2e 100644 --- a/Source/OpenTK/Math/Matrix4d.cs +++ b/Source/OpenTK/Math/Matrix4d.cs @@ -886,11 +886,38 @@ namespace OpenTK #endregion #region CreateFromQuaternion + /// + /// Build a rotation matrix from the specified quaternion. + /// + /// Quaternion to translate. + /// Matrix result. + public static void CreateFromQuaternion(ref Quaterniond q, out Matrix4d result) + { + Vector3d axis; + double angle; + q.ToAxisAngle(out axis, out angle); + CreateFromAxisAngle(axis, angle, out result); + } + + /// + /// Builds a rotation matrix from a quaternion. + /// + /// The quaternion to rotate by. + /// A matrix instance. + public static Matrix4d CreateFromQuaternion(Quaterniond q) + { + Matrix4d result; + CreateFromQuaternion(ref q, out result); + return result; + } + + /// /// Build a rotation matrix from the specified quaternion. /// /// Quaternion to translate. /// Matrix result. + [Obsolete("Use double-precision overload instead")] public static void CreateFromQuaternion(ref Quaternion q,ref Matrix4 m) { m = Matrix4.Identity; @@ -926,6 +953,7 @@ namespace OpenTK /// /// Quaternion to translate. /// A matrix instance. + [Obsolete("Use double-precision overload instead")] public static Matrix4 CreateFromQuaternion(ref Quaternion q) { Matrix4 result = Matrix4.Identity;