UKismetMathLibrary::Quat_IsFinite
#include "Kismet/KismetMathLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Returns true if all four components (X, Y, Z, W) are finite — neither NaN nor Infinity.
Caveats & Gotchas
- • A finite quaternion is not necessarily normalized; use Quat_IsNormalized separately if you also need to verify unit length.
- • NaN/Inf in quaternions most often originates from dividing by a near-zero vector length (e.g. normalizing a zero vector); check the source operation rather than just filtering outputs.
Signature
static UE_INL_API bool Quat_IsFinite(const FQuat& Q) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Q | const FQuat& | The quaternion to test. | — |
Return Type
bool Example
Guard against NaN before applying a quaternion C++
FQuat Rot = ComputeRotation();
if (UKismetMathLibrary::Quat_IsFinite(Rot))
{
MyComponent->SetWorldRotation(Rot);
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Invalid quaternion from ComputeRotation"));
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?