TFrame3::ConstrainedAlignPerpAxes

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)](API\Runtime\Engine\EMaterialPreshaderOpcode) > 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.

Windows
MacOS
Linux

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/FrameTypes.h

Include

#include "FrameTypes.h"

Syntax

void ConstrainedAlignPerpAxes
(
    int PerpAxis1,
    int PerpAxis2,
    int NormalAxis,
    const FVector3< RealType > & UpAxis,
    const FVector3< RealType > & FallbackAxis,
    RealType UpDotTolerance
)

Remarks

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.

Parameters

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

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