/// <summary> /// Converts the angle vector into a rotation matrix. /// </summary> /// <returns></returns> public Matrix4x4 ToRotationMatrix() { return(Matrix4x4.CreateRotationX(RotationConverter.AngleToRadians(X)) * Matrix4x4.CreateRotationY(RotationConverter.AngleToRadians(Y)) * Matrix4x4.CreateRotationZ(RotationConverter.AngleToRadians(Z))); }
/// <summary> /// Converts the angle vector to euler rotation in radians. /// </summary> /// <returns></returns> public Vector3 ToRadians() { return(new Vector3(RotationConverter.AngleToRadians(X), RotationConverter.AngleToRadians(Y), RotationConverter.AngleToRadians(Z))); }
/// <summary> /// Create an angle vector from euler rotation in degrees. /// </summary> /// <param name="vector"></param> /// <returns></returns> public static AngleVector FromDegrees(Vector3 vector) { return(new AngleVector(RotationConverter.DegreesToAngle(vector.X), RotationConverter.DegreesToAngle(vector.Y), RotationConverter.DegreesToAngle(vector.Z))); }
/// <summary> /// Create an angle vector from euler rotation in radians. /// </summary> /// <param name="vector"></param> /// <returns></returns> public static AngleVector FromRadians(Vector3 vector) { return(new AngleVector(RotationConverter.RadiansToAngle(vector.X), RotationConverter.RadiansToAngle(vector.Y), RotationConverter.RadiansToAngle(vector.Z))); }
/// <summary> /// Converts the angle vector into a rotation matrix around an origin. /// </summary> /// <param name="origin"></param> /// <returns></returns> public Matrix4x4 ToRotationMatrixZXY(Vector3 origin) { return(Matrix4x4.CreateRotationZ(RotationConverter.AngleToRadians(X), origin) * Matrix4x4.CreateRotationX(RotationConverter.AngleToRadians(Y), origin) * Matrix4x4.CreateRotationY(RotationConverter.AngleToRadians(Z), origin)); }