TRotation< FReal, 3 >::GetRotationAxisSafe

Extract the axis from the Quaternion.

Windows
MacOS
Linux

Warnings

  • The axis calculation cannot succeed for small angles due to numerical error. In this case, the function will return false, but set the axis to DefaultAxis. @note EpsilonSq is approximately the square of the angle below which we cannot calculate the axis. It needs to be "much greater" than square of the error in the quaternion values which is usually ~1e-4, so values around 1e-3^2 = 1e-6 or greater are about right.

References

Module

Chaos

Header

/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Rotation.h

Include

#include "Chaos/Rotation.h"

Syntax

bool GetRotationAxisSafe
(
    TVector< FReal, 3 > & OutAxis,
    const TVector< FReal, 3 > & DefaultAxis,
    FReal EpsilionSq
) const

Remarks

Extract the axis from the Quaternion.

The axis calculation cannot succeed for small angles due to numerical error. In this case, the function will return false, but set the axis to DefaultAxis. @note EpsilonSq is approximately the square of the angle below which we cannot calculate the axis. It needs to be "much greater" than square of the error in the quaternion values which is usually ~1e-4, so values around 1e-3^2 = 1e-6 or greater are about right.

Returns

Whether the axis was successfully calculated (true except for very small angles around or less than Epsilon).

Parameters

Parameter

Description

OutAxis

The axis of rotation.

DefaultAxis

The axis to set when the angle is too small to accurately calculate the axis.

EpsilonSq

The squared tolerance used to check for small angles.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss