Navigation
API > API/Runtime > API/Runtime/ChaosCore > API/Runtime/ChaosCore/TRotation_FRealSingle_3
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.
Description
Extract the axis and angle 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.
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.
| Name | ToAxisAndAngleSafe |
| Type | function |
| Header File | /Engine/Source/Runtime/Experimental/ChaosCore/Public/Chaos/Rotation.h |
| Include Path | #include "Chaos/Rotation.h" |
bool ToAxisAndAngleSafe
(
TVector < FRealSingle, 3 > & OutAxis,
FRealSingle & OutAngle,
const TVector < FRealSingle, 3 > & DefaultAxis,
FRealSingle EpsilionSq
) const
Whether the axis was successfully calculated (true except for very small angles around or less than Epsilon).
Parameters
| Name | Remarks |
|---|---|
| OutAxis | The axis of rotation. |
| OutAngle | The angle of rotation about the axis (radians). |
| 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. |