RealDocs

UKismetMathLibrary::Quat_IsIdentity

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

Description

Returns true if the quaternion is approximately equal to the identity rotation (0, 0, 0, 1) within the given tolerance.

Caveats & Gotchas

  • The header comment says this assumes the quaternion is already normalized — an un-normalized quaternion may return false even if it represents zero rotation once normalised.
  • Like EqualEqual_QuatQuat, this checks components not rotation equivalence — the quaternion (0,0,0,-1) represents the same identity rotation but will fail this test.

Signature

static UE_INL_API bool Quat_IsIdentity(const FQuat& Q, float Tolerance = 1.e-4f)

Parameters

Name Type Description Default
Q const FQuat& The quaternion to test.
Tolerance float Per-component tolerance for comparison with (0,0,0,1). 1.e-4f

Return Type

bool

Example

Skip rotation update when already at rest C++
FQuat DeltaRot = NewQuat * CurrentQuat.Inverse();
if (!UKismetMathLibrary::Quat_IsIdentity(DeltaRot))
{
    SetActorRotation((DeltaRot * GetActorQuat()).Rotator());
}

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.