Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Source/Runtime/GeometryCore/Public/FrameTypes.h |
Include |
#include "FrameTypes.h" |
Compute rotation around NormalAxis that best-aligns one of the other two frame axes with either given UpAxis or FallbackAxis (FallbackAxis is required if Dot(NormalAxis,UpAxis) > UpDotTolerance, ie if the Normal and Up directions are too closely aligned. Basically this divides direction-sphere into three regions - polar caps with size defined by UpDotTolerance, and a wide equator band covering the rest. When crossing between these regions the alignment has a discontinuity. It is impossible to avoid this discontinuity because it is impossible to comb a sphere.
Parameter |
Description |
---|---|
PerpAxis1 |
Index of first axis orthogonal to NormalAxis |
PerpAxis2 |
Index of second axis orthogonal to NormalAxis |
NormalAxis |
Axis of frame to rotate around |
UpAxis |
Target axis in equator region, defaults to UnitZ |
FallbackAxis |
Target axis in polar region, defaults to UnitX |
UpDotTolerance |
defaults to cos(45), ie flip between regions happens roughly half way to poles |