RealDocs

UKismetMathLibrary::Quat_Log

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticUFUNCTIONBlueprintPure

Description

Computes the quaternion logarithm, mapping a unit quaternion to a pure quaternion (W=0, V=theta*v). The result's vector part is the rotation axis scaled by half the rotation angle in radians.

Caveats & Gotchas

  • The result always has W=0. Passing a non-unit quaternion produces an undefined result — normalize first.
  • This is the mathematical inverse of Quat_Exp for unit quaternions. Together they enable quaternion-space arithmetic used in squad interpolation and blend-tree blending. You will almost never call this directly unless implementing custom interpolation.

Signature

static UE_INL_API FQuat Quat_Log(const FQuat& Q);

Parameters

Name Type Description Default
Q const FQuat& A unit quaternion to compute the logarithm of.

Return Type

FQuat

Example

Compute quaternion velocity (angular velocity representation) C++
FQuat Q0 = PrevQuat;
FQuat Q1 = CurrQuat;

// Angular displacement as pure quaternion
FQuat DeltaQ = Q1 * UKismetMathLibrary::Quat_Inversed(Q0);
FQuat LogDelta = UKismetMathLibrary::Quat_Log(DeltaQ);

// LogDelta.X/Y/Z = axis * half_angle_radians

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.